using MediatR;
using MktXService.Domain.AggregatesModel.CampaignAggregate;

namespace MktXService.API.Application.Commands;

/// <summary>
/// EN: Command to create a new campaign.
/// VI: Command để tạo chiến dịch mới.
/// </summary>
public record CreateCampaignCommand(
    Guid MerchantId,
    string Name,
    string Type,
    Guid? TemplateId,
    List<Guid> SegmentIds,
    CampaignSchedule? Schedule = null
) : IRequest<CreateCampaignResult>;

public record CreateCampaignResult(bool Success, Guid? CampaignId, string? Error);

/// <summary>
/// EN: Command to start a campaign.
/// VI: Command để bắt đầu chiến dịch.
/// </summary>
public record StartCampaignCommand(Guid CampaignId) : IRequest<bool>;

/// <summary>
/// EN: Command to pause a running campaign.
/// VI: Command để tạm dừng chiến dịch đang chạy.
/// </summary>
public record PauseCampaignCommand(Guid CampaignId) : IRequest<bool>;

/// <summary>
/// EN: Command to resume a paused campaign.
/// VI: Command để tiếp tục chiến dịch đã tạm dừng.
/// </summary>
public record ResumeCampaignCommand(Guid CampaignId) : IRequest<bool>;

/// <summary>
/// EN: Command to cancel a campaign.
/// VI: Command để hủy chiến dịch.
/// </summary>
public record CancelCampaignCommand(Guid CampaignId, string? Reason = null) : IRequest<bool>;

/// <summary>
/// EN: Command to update campaign metrics.
/// VI: Command để cập nhật metrics chiến dịch.
/// </summary>
public record UpdateCampaignMetricsCommand(
    Guid CampaignId,
    int Sent,
    int Delivered,
    int Opened,
    int Clicked,
    int Replied,
    int Failed
) : IRequest<bool>;
