using MediatR;

namespace IamService.API.Application.Commands.AccessRequests;

/// <summary>
/// EN: Command to create a new access request.
/// VI: Command để tạo yêu cầu truy cập mới.
/// </summary>
public record CreateAccessRequestCommand(
    Guid RequesterId,
    string ResourceType,
    Guid ResourceId,
    string RequestedPermission,
    string? Justification,
    int? Priority,
    List<Guid> ApproverIds) : IRequest<CreateAccessRequestCommandResult>;

public record CreateAccessRequestCommandResult(
    Guid Id,
    string Status,
    DateTime CreatedAt);

/// <summary>
/// EN: Command to submit access request for approval.
/// VI: Command để gửi yêu cầu truy cập để phê duyệt.
/// </summary>
public record SubmitAccessRequestCommand(Guid RequestId) : IRequest<Unit>;

/// <summary>
/// EN: Command to approve access request.
/// VI: Command để phê duyệt yêu cầu truy cập.
/// </summary>
public record ApproveAccessRequestCommand(
    Guid RequestId,
    Guid ApproverId,
    string? Comments) : IRequest<Unit>;

/// <summary>
/// EN: Command to reject access request.
/// VI: Command để từ chối yêu cầu truy cập.
/// </summary>
public record RejectAccessRequestCommand(
    Guid RequestId,
    Guid ApproverId,
    string? Reason) : IRequest<Unit>;

/// <summary>
/// EN: Command to cancel access request.
/// VI: Command để hủy yêu cầu truy cập.
/// </summary>
public record CancelAccessRequestCommand(Guid RequestId) : IRequest<Unit>;
