namespace NetinaShop.Domain.Entities.Discounts;

public partial class Discount
{
    public static Discount Create(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)
    {
        return new Discount(code, 
            discountPercent, 
            discountAmount, 
            hasCode, 
            amountType, 
            type, 
            count, 
            startDate,
            expireDate, 
            priceFloor, 
            hasPriceFloor, 
            priceCeiling, 
            hasPriceCeiling, 
            isInfinity, 
            useCount,
            isForInvitation,
            isSpecialOffer);
    }

    public bool IsExpired()
        => ExpireDate.Date < DateTime.Today.Date;
}

public partial class ProductDiscount
{
    public static ProductDiscount Create(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, Guid productId)
    {
        return new ProductDiscount(code, discountPercent, discountAmount, hasCode, amountType, type, count, startDate,
            expireDate, priceFloor, hasPriceFloor, priceCeiling, hasPriceCeiling, isInfinity, useCount,
            isForInvitation, isSpecialOffer, productId);
    }
}

public partial class CategoryDiscount
{
    public static CategoryDiscount Create(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, Guid categoryId)
    {
        return new CategoryDiscount(code, discountPercent, discountAmount, hasCode, amountType, type, count, startDate,
            expireDate, priceFloor, hasPriceFloor, priceCeiling, hasPriceCeiling, isInfinity, useCount,
            isForInvitation,isSpecialOffer, categoryId);
    }
}
