2026-02-07 16:03:52 +08:00

90 lines
2.6 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using SqlSugar;
using System.ComponentModel.DataAnnotations;
using YD_Event.Core.Enum;
namespace YD_Event.Core.Entities;
/// <summary>
/// 优惠券
/// </summary>
[SugarTable("Coupon")]
public class Coupon : Entity<long>, ICreatedTime, IUpdatedTime, ISoftDelete, IAvailability
{
/// <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 = "兑换码", Length = 32, IsNullable = true)]
public string RedemptionCode { 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; }
public DateTime CreatedTime { get; set; }
public DateTime? UpdatedTime { get; set; }
public bool DeleteMark { get; set; }
}