namespace CMSMicroservice.Application.UserOrderCQ.Commands.ApplyDiscountToOrder;

/// <summary>
/// اعمال تخفیف به سفارش
/// </summary>
public record ApplyDiscountToOrderCommand : IRequest<ApplyDiscountToOrderResponseDto>
{
    /// <summary>
    /// شناسه سفارش
    /// </summary>
    public long OrderId { get; init; }

    /// <summary>
    /// مبلغ تخفیف (ریال)
    /// </summary>
    public long DiscountAmount { get; init; }

    /// <summary>
    /// دلیل تخفیف
    /// </summary>
    public string Reason { get; init; } = string.Empty;

    /// <summary>
    /// کد تخفیف (اختیاری)
    /// </summary>
    public string? DiscountCode { get; init; }
}

/// <summary>
/// پاسخ اعمال تخفیف
/// </summary>
public class ApplyDiscountToOrderResponseDto
{
    public bool Success { get; set; }
    public string Message { get; set; } = string.Empty;
    public long OriginalAmount { get; set; }
    public long DiscountAmount { get; set; }
    public long FinalAmount { get; set; }
}
