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