using Meezi.Core.Enums;

namespace Meezi.API.Models.Crm;

public record CouponDto(
    string Id,
    string Code,
    CouponType Type,
    decimal Value,
    decimal? MinOrderAmount,
    decimal? MaxDiscount,
    int? UsageLimit,
    int UsedCount,
    CustomerGroup? TargetGroup,
    DateTime? StartsAt,
    DateTime? ExpiresAt,
    bool IsActive);

public record CreateCouponRequest(
    string Code,
    CouponType Type,
    decimal Value,
    decimal? MinOrderAmount,
    decimal? MaxDiscount,
    int? UsageLimit,
    CustomerGroup? TargetGroup,
    DateTime? StartsAt,
    DateTime? ExpiresAt,
    bool IsActive = true);

public record ValidateCouponRequest(string Code, decimal Subtotal);

public record ValidateCouponResult(
    string CouponId,
    string Code,
    CouponType Type,
    decimal Value,
    decimal DiscountAmount);

public record UpdateCouponRequest(
    string? Code,
    CouponType? Type,
    decimal? Value,
    decimal? MinOrderAmount,
    decimal? MaxDiscount,
    int? UsageLimit,
    CustomerGroup? TargetGroup,
    DateTime? StartsAt,
    DateTime? ExpiresAt,
    bool? IsActive);
