using SqlSugar;
using System.ComponentModel.DataAnnotations;
using YD_Event.Core.Enum;
namespace YD_Event.Core.Entities;
///
/// 优惠券
///
[SugarTable("Coupon")]
public class Coupon : Entity, ISoftDelete, ICreatedUserId, ICreatedTime, IUpdatedUserId, IUpdatedTime, IAvailability
{
///
/// 优惠券名称
///
[SugarColumn(ColumnDescription = "优惠券名称", Length = 64)]
[Required, MaxLength(64)]
public string Name { get; set; }
///
/// 类型(0-折扣 1-定额)
///
[SugarColumn(ColumnDescription = "类型(0-折扣 1-定额)")]
public int Type { get; set; }
///
/// 优惠值(折扣率或金额)
///
[SugarColumn(ColumnDescription = "优惠值", DecimalDigits = 2)]
public decimal Value { get; set; }
///
/// 有效期开始时间
///
[SugarColumn(ColumnDescription = "有效期开始时间", IsNullable = true)]
public DateTime? StartTime { get; set; }
///
/// 有效期结束时间
///
[SugarColumn(ColumnDescription = "有效期结束时间", IsNullable = true)]
public DateTime? EndTime { get; set; }
///
/// 可用赛事ID集合(逗号分隔)
///
[SugarColumn(ColumnDescription = "可用赛事ID集合", Length = 500, IsNullable = true)]
public string EventIds { get; set; }
///
/// 兑换码
///
[SugarColumn(ColumnDescription = "兑换码", Length = 32, IsNullable = true)]
public string RedemptionCode { get; set; }
///
/// 总数量(库存)
///
[SugarColumn(ColumnDescription = "总数量", DefaultValue = "0")]
public int TotalQuantity { get; set; }
///
/// 已领取数量
///
[SugarColumn(ColumnDescription = "已领取数量", DefaultValue = "0")]
public int ClaimedQuantity { get; set; }
///
/// 已使用数量
///
[SugarColumn(ColumnDescription = "已使用数量", DefaultValue = "0")]
public int UsedQuantity { get; set; }
///
/// 状态(0-正常 1-停用)
///
[SugarColumn(ColumnDescription = "状态", DefaultValue = "0")]
public AvailabilityStatus Status { get; set; }
///
/// 备注
///
[SugarColumn(ColumnDescription = "备注", Length = 256, IsNullable = true)]
public string Remark { get; set; }
///
/// 删除标志
///
public bool DeleteMark { get; set; }
///
/// 创建人Id
///
public long CreatedUserId { get; set; }
///
/// 创建时间
///
public DateTime CreatedTime { get; set; }
///
/// 更新人Id
///
public long? UpdatedUserId { get; set; }
///
/// 更新时间
///
public DateTime? UpdatedTime { get; set; }
}