namespace MiningService.API.IntegrationEvents;

/// <summary>
/// EN: Base interface for integration events.
/// VI: Interface cơ sở cho integration events.
/// </summary>
public interface IIntegrationEvent
{
    Guid EventId { get; }
    DateTime OccurredOn { get; }
}

/// <summary>
/// EN: Event published when points are mined and should be credited to wallet.
/// VI: Event được publish khi điểm được đào và cần credit vào ví.
/// </summary>
public record PointsMinedIntegrationEvent(
    Guid EventId,
    DateTime OccurredOn,
    Guid UserId,
    Guid MinerId,
    decimal Points,
    string Source,
    int StreakDays) : IIntegrationEvent;

/// <summary>
/// EN: Event published when a referral is activated (user completed KYC).
/// VI: Event được publish khi referral được kích hoạt (user đã KYC).
/// </summary>
public record ReferralActivatedIntegrationEvent(
    Guid EventId,
    DateTime OccurredOn,
    Guid ReferrerId,
    Guid ReferredUserId,
    decimal BonusRate) : IIntegrationEvent;

/// <summary>
/// EN: Event published when a security circle is completed (3+ members).
/// VI: Event được publish khi vòng tròn an toàn hoàn thành (3+ thành viên).
/// </summary>
public record CircleCompletedIntegrationEvent(
    Guid EventId,
    DateTime OccurredOn,
    Guid CircleId,
    Guid OwnerId,
    int MemberCount,
    decimal BonusMultiplier) : IIntegrationEvent;

/// <summary>
/// EN: Event consumed when user registered in IAM Service.
/// VI: Event được consume khi user đăng ký trong IAM Service.
/// </summary>
public record UserRegisteredIntegrationEvent(
    Guid EventId,
    DateTime OccurredOn,
    Guid UserId,
    string Email,
    string? ReferralCode) : IIntegrationEvent;

/// <summary>
/// EN: Event consumed when user completed KYC verification.
/// VI: Event được consume khi user hoàn thành xác thực KYC.
/// </summary>
public record UserKycCompletedIntegrationEvent(
    Guid EventId,
    DateTime OccurredOn,
    Guid UserId) : IIntegrationEvent;
