using IamService.Domain.SeedWork;

namespace IamService.Domain.Events;

/// <summary>
/// EN: Domain event raised when a new group is created.
/// VI: Domain event được raise khi nhóm mới được tạo.
/// </summary>
public class GroupCreatedEvent : IDomainEvent
{
    public Guid GroupId { get; }
    public Guid OrganizationId { get; }
    public string Name { get; }
    public DateTime OccurredOn { get; }

    public GroupCreatedEvent(Guid groupId, Guid organizationId, string name)
    {
        GroupId = groupId;
        OrganizationId = organizationId;
        Name = name;
        OccurredOn = DateTime.UtcNow;
    }
}

/// <summary>
/// EN: Domain event raised when a member is added to a group.
/// VI: Domain event được raise khi thành viên được thêm vào nhóm.
/// </summary>
public class MemberAddedToGroupEvent : IDomainEvent
{
    public Guid GroupId { get; }
    public Guid UserId { get; }
    public string Role { get; }
    public DateTime OccurredOn { get; }

    public MemberAddedToGroupEvent(Guid groupId, Guid userId, string role)
    {
        GroupId = groupId;
        UserId = userId;
        Role = role;
        OccurredOn = DateTime.UtcNow;
    }
}

/// <summary>
/// EN: Domain event raised when a member is removed from a group.
/// VI: Domain event được raise khi thành viên bị xóa khỏi nhóm.
/// </summary>
public class MemberRemovedFromGroupEvent : IDomainEvent
{
    public Guid GroupId { get; }
    public Guid UserId { get; }
    public DateTime OccurredOn { get; }

    public MemberRemovedFromGroupEvent(Guid groupId, Guid userId)
    {
        GroupId = groupId;
        UserId = userId;
        OccurredOn = DateTime.UtcNow;
    }
}
