namespace NetinaShop.Domain.Entities.Discounts;

[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
[AdaptTo("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
[GenerateMapper]

public partial class Discount : ApiEntity
{
    public Discount()
    {
        
    }

    public Discount(string code, 
        int discountPercent, 
        long discountAmount, 
        bool hasCode, 
        DiscountAmountType amountType, 
        DiscountType type, 
        int count,
        DateTime startDate, 
        DateTime expireDate, 
        long priceFloor,
        bool hasPriceFloor, 
        long priceCeiling, 
        bool hasPriceCeiling, 
        bool isInfinity, 
        long useCount, 
        bool isForInvitation,
        bool isSpecialOffer)
    {
        Code = code;
        DiscountPercent = discountPercent;
        DiscountAmount = discountAmount;
        HasCode = hasCode;
        AmountType = amountType;
        Type = type;
        Count = count;
        StartDate = startDate;
        ExpireDate = expireDate;
        PriceFloor = priceFloor;
        HasPriceFloor = hasPriceFloor;
        PriceCeiling = priceCeiling;
        HasPriceCeiling = hasPriceCeiling;
        IsInfinity = isInfinity;
        UseCount = useCount;
        IsForInvitation = isForInvitation;
        IsSpecialOffer = isSpecialOffer;
    }
    public string Code { get; internal set; } = string.Empty;
    public int DiscountPercent { get; internal set; }
    public long DiscountAmount { get; internal set; }
    public bool HasCode { get; internal set; }
    public DiscountAmountType AmountType { get; internal set; }
    public DiscountType Type { get; internal set; }
    public int Count { get; internal set; }
    public DateTime StartDate { get; internal set; }
    public DateTime ExpireDate { get; internal set; }
    public long PriceFloor { get; internal set; }
    public bool HasPriceFloor { get; internal set; }
    public long PriceCeiling { get; internal set; }
    public bool HasPriceCeiling { get; internal set; }
    public bool IsInfinity { get; internal set; }
    public long UseCount { get; internal set; }
    public bool IsSpecialOffer { get; internal set; }
    public bool IsForInvitation { get; internal set; }

    public List<Order> Orders { get; internal set; } = new();
}