using MediatR;

namespace IamService.API.Application.Queries.Groups;

/// <summary>
/// EN: Query to get group by ID.
/// VI: Query để lấy nhóm theo ID.
/// </summary>
public record GetGroupByIdQuery(Guid Id) : IRequest<GroupDto?>;

/// <summary>
/// EN: Query to get groups by organization ID.
/// VI: Query để lấy nhóm theo ID tổ chức.
/// </summary>
public record GetGroupsByOrganizationQuery(Guid OrganizationId) : IRequest<IEnumerable<GroupDto>>;

/// <summary>
/// EN: Query to get groups by user ID.
/// VI: Query để lấy nhóm theo ID user.
/// </summary>
public record GetGroupsByUserQuery(Guid UserId) : IRequest<IEnumerable<GroupDto>>;

/// <summary>
/// EN: Group DTO for query results.
/// VI: DTO nhóm cho kết quả query.
/// </summary>
public record GroupDto(
    Guid Id,
    string Name,
    string? Description,
    Guid OrganizationId,
    int MemberCount,
    DateTime CreatedAt,
    DateTime? UpdatedAt);

/// <summary>
/// EN: Group member DTO.
/// VI: DTO thành viên nhóm.
/// </summary>
public record GroupMemberDto(
    Guid Id,
    Guid UserId,
    string Role,
    DateTime JoinedAt,
    Guid? AddedByUserId);
