using SqlSugar;
using YD_Event.Core.Enum;
namespace YD_Event.Core.Entities;
///
/// 订单表
///
[SugarTable("Order")]
public class Order : Entity, ISoftDelete, ICreatedUserId, ICreatedTime, IUpdatedUserId, IUpdatedTime, IAvailability
{
///
/// 订单编号
///
[SugarColumn(Length = 64)]
public string OrderNo { get; set; }
///
/// 订单类型:1-收入,2-退款
///
public int OrderType { get; set; }
///
/// 支付方式:1-线上,2-线下
///
public int PaymentMethod { get; set; }
///
/// 报名方式:1-个人,2-团队
///
public int RegistrationMode { get; set; }
///
/// 商户ID(支付商户)
///
[SugarColumn(IsNullable = true)]
public long? MerchantId { get; set; }
///
/// 单位认证ID(单位关联)
///
[SugarColumn(IsNullable = true)]
public long? MerchantCertificationId { get; set; }
///
/// 赛事ID
///
public long EventId { get; set; }
///
/// 报名ID
///
public long RegistrationId { get; set; }
///
/// 关联订单ID(退款时关联原订单)
///
[SugarColumn(IsNullable = true)]
public long? RelatedOrderId { get; set; }
///
/// 付款凭证URL
///
[SugarColumn(Length = 512, IsNullable = true)]
public string? PaymentProofUrl { get; set; }
///
/// 优惠券ID
///
[SugarColumn(IsNullable = true)]
public long? CouponId { get; set; }
///
/// 原金额
///
public decimal OriginalAmount { get; set; }
///
/// 优惠金额
///
public decimal DiscountAmount { get; set; }
///
/// 实付/退款金额
///
public decimal ActualAmount { get; set; }
///
/// 订单状态
///
public OrderStatus OrderStatus { get; set; }
///
/// 支付/退款时间
///
[SugarColumn(IsNullable = true)]
public DateTime? PaymentTime { get; set; }
///
/// 备注
///
[SugarColumn(Length = 512, IsNullable = true)]
public string? Remark { get; set; }
///
/// 可用状态
///
public AvailabilityStatus Status { get; set; }
///
/// 标记删除
///
public bool DeleteMark { get; set; }
///
/// 创建人
///
public long CreatedUserId { get; set; }
///
/// 创建时间
///
public DateTime CreatedTime { get; set; }
///
/// 更新人
///
[SugarColumn(IsNullable = true)]
public long? UpdatedUserId { get; set; }
///
/// 更新时间
///
[SugarColumn(IsNullable = true)]
public DateTime? UpdatedTime { get; set; }
}