using MediatR;

namespace IamService.API.Application.Queries.Organizations;

/// <summary>
/// EN: Query to get organization by ID.
/// VI: Query để lấy tổ chức theo ID.
/// </summary>
public record GetOrganizationByIdQuery(Guid Id) : IRequest<OrganizationDto?>;

/// <summary>
/// EN: Query to get organization by slug.
/// VI: Query để lấy tổ chức theo slug.
/// </summary>
public record GetOrganizationBySlugQuery(string Slug) : IRequest<OrganizationDto?>;

/// <summary>
/// EN: Query to get organization hierarchy (parent and all descendants).
/// VI: Query để lấy phân cấp tổ chức (cha và tất cả con cháu).
/// </summary>
public record GetOrganizationHierarchyQuery(Guid RootId) : IRequest<IEnumerable<OrganizationDto>>;

/// <summary>
/// EN: Query to get child organizations.
/// VI: Query để lấy tổ chức con.
/// </summary>
public record GetChildOrganizationsQuery(Guid ParentId) : IRequest<IEnumerable<OrganizationDto>>;

/// <summary>
/// EN: Organization DTO for query results.
/// VI: DTO tổ chức cho kết quả query.
/// </summary>
public record OrganizationDto(
    Guid Id,
    string Name,
    string Slug,
    string? Description,
    Guid? ParentOrganizationId,
    string Status,
    DateTime CreatedAt,
    DateTime? UpdatedAt);
