Api/Netina.Domain/Entities/Discounts/Discount.cs

84 lines
3.1 KiB
C#

namespace Netina.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,
string description,
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,
bool isForFirstPurchase,
bool immortal)
{
Code = code;
Description = description;
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;
IsForFirstPurchase = isForFirstPurchase;
Immortal = immortal;
}
public string Code { get; internal set; } = string.Empty;
public string Description { 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 bool Immortal { 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 bool IsForSaleCooperation { get; internal set; }
public bool IsForFirstPurchase { get; internal set; }
public Guid? MarketerId { get; internal set; }
public Marketer? Marketer { get; internal set; }
public List<Order> Orders { get; internal set; } = new();
}