using IamService.Domain.SeedWork;

namespace IamService.Domain.Events;

/// <summary>
/// EN: Domain event raised when verification is requested.
/// VI: Domain event được raise khi yêu cầu xác thực.
/// </summary>
public class VerificationRequestedEvent : IDomainEvent
{
    public Guid VerificationId { get; }
    public Guid UserId { get; }
    public string VerificationType { get; }
    public DateTime OccurredOn { get; }

    public VerificationRequestedEvent(Guid verificationId, Guid userId, string verificationType)
    {
        VerificationId = verificationId;
        UserId = userId;
        VerificationType = verificationType;
        OccurredOn = DateTime.UtcNow;
    }
}

/// <summary>
/// EN: Domain event raised when verification is completed.
/// VI: Domain event được raise khi xác thực hoàn thành.
/// </summary>
public class VerificationCompletedEvent : IDomainEvent
{
    public Guid VerificationId { get; }
    public Guid UserId { get; }
    public string VerificationType { get; }
    public bool IsSuccess { get; }
    public string? FailureReason { get; }
    public DateTime OccurredOn { get; }

    public VerificationCompletedEvent(
        Guid verificationId,
        Guid userId,
        string verificationType,
        bool isSuccess,
        string? failureReason = null)
    {
        VerificationId = verificationId;
        UserId = userId;
        VerificationType = verificationType;
        IsSuccess = isSuccess;
        FailureReason = failureReason;
        OccurredOn = DateTime.UtcNow;
    }
}
