using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Atomx.Common.Entities
{
///
/// 订单
///
[Table("Orders")]
public class Order
{
//
/// 数据ID
///
[DatabaseGenerated(DatabaseGeneratedOption.None)]
[Key]
public long Id { get; set; }
///
/// 订单号
///
public long OrderNumber { get; set; }
///
/// 平台ID,1自有商城,2淘宝,3天猫,4京东,5拼多多,6抖音,7快手,8小红书等
///
public int PlatformId { get; set; }
///
/// 平台订单号
///
public long PlatformOrderNumber { get; set; }
///
/// 订单类型
///
public int Type { get; set; }
///
/// 是否虚拟数据
///
public bool IsVirtual { get; set; }
///
/// 订单商品供应商ID
///
public long VendorId { get; set; }
///
/// 成交店铺ID
///
public long StoreId { get; set; }
///
/// 归属公司ID
///
public long CorporationId { get; set; }
///
/// 销售人员Id
///
public long SalespersonId { get; set; }
///
/// 下单用户
///
public long UserId { get; set; }
///
/// 收件人姓名
///
[Column(TypeName = "varchar(128)")]
public string Name { get; set; } = string.Empty;
///
/// 邮件地址
///
[Column(TypeName = "varchar(255)")]
public string Email { get; set; } = string.Empty;
///
/// 电话号码
///
[Column(TypeName = "varchar(20)")]
public string Phone { get; set; } = string.Empty;
///
/// 公司
///
[Column(TypeName = "varchar(255)")]
public string Company { get; set; } = string.Empty;
///
/// 国家ID
///
public long CountryId { get; set; }
///
/// 国家
///
[Column(TypeName = "varchar(50)")]
public string Country { get; set; } = string.Empty;
///
/// 省份
///
public long ProvinceId { get; set; }
///
/// 省、州
///
[Column(TypeName = "varchar(100)")]
public string Province { get; set; } = string.Empty;
///
/// 城市
///
public long CityId { get; set; }
///
/// 城市
///
[Column(TypeName = "varchar(100)")]
public string City { get; set; } = string.Empty;
///
/// 地区
///
public long RegionId { get; set; }
///
/// 地区街
///
[Column(TypeName = "varchar(100)")]
public string Region { get; set; } = string.Empty;
///
/// 邮政编码
///
[Column(TypeName = "varchar(15)")]
public string PostalCode { get; set; } = string.Empty;
///
/// 详细地址
///
[Column(TypeName = "varchar(256)")]
public string AddressDetails { get; set; } = string.Empty;
///
/// 完整地址
///
[Column(TypeName = "varchar(1024)")]
public string FullAddress { get; set; } = string.Empty;
///
/// 地址所在经度
///
[Column(TypeName = "decimal(10,6)")]
public decimal Longitude { get; set; }
///
/// 地址所在纬度
///
[Column(TypeName = "decimal(10,6)")]
public decimal Latitude { get; set; }
///
/// 订单原市场总价
///
[Column(TypeName = "decimal(18,4)")]
public decimal TotalMarketPrice { get; set; }
///
/// 商品销售总价
///
[Column(TypeName = "decimal(18,4)")]
public decimal TotalPrice { get; set; }
///
/// 折扣总额
///
[Column(TypeName = "decimal(18,4)")]
public decimal DiscountAmount { get; set; }
///
/// 订单总价
///
[Column(TypeName = "decimal(18,4)")]
public decimal OrderPrice { get; set; }
///
/// 订单个数
///
public int ProductCount { get; set; }
///
/// 购买产品总数量
///
public int TotalQuantity { get; set; }
///
/// 税费
///
[Column(TypeName = "decimal(8,4)")]
public decimal Taxes { get; set; }
///
/// 运费
///
[Column(TypeName = "decimal(18,4)")]
public decimal ShippingCost { get; set; }
///
/// 订单使用的优惠券ID
///
public long CouponId { get; set; }
///
/// 客户支付单ID
///
public long OrderPaymentId { get; set; }
///
/// 付款方式,支付通道
///
public int PaymentChannel { get; set; }
///
/// 订单实付总额
///
[Column(TypeName = "decimal(18,4)")]
public decimal PaymentAmount { get; set; }
///
/// 支付状态
///
public int PaymentStatus { get; set; }
///
/// 付款时间
///
[Column(TypeName = "timestamptz")]
public DateTime? PaymentTime { get; set; }
///
/// 卖家利润
///
[Column(TypeName = "decimal(18,4)")]
public decimal StoreProfit { get; set; }
///
/// 卖家店铺是否提货
///
public bool StorePickedUp { get; set; }
///
/// 卖点店铺提货时间
///
[Column(TypeName = "timestamptz")]
public DateTime? StorePickedUpTime { get; set; }
///
/// 卖家回款时间
///
[Column(TypeName = "timestamptz")]
public DateTime? StorePaybackTime { get; set; }
///
/// 卖家订单利润结算时间
///
[Column(TypeName = "timestamptz")]
public DateTime? StoreProfitSettlementTime { get; set; }
///
/// 供应商是否确认订单
///
public bool IsConfirmed { get; set; }
///
/// 供应商订单确认时间
///
[Column(TypeName = "timestamptz")]
public DateTime? ConfirmedTime { get; set; }
///
/// 是否已评论
///
public bool Reviewed { get; set; }
///
/// 扩展信息
///
[Column(TypeName = "text")]
public string Extended { get; set; } = string.Empty;
///
/// 订单状态,(待付款,待发货,待签收,待结算,订单取消,订单过期,支付失败)
///
public int Status { get; set; }
///
/// 订单备注说明
///
[Column(TypeName = "varchar(255)")]
public string? Remark { get; set; } = string.Empty;
///
/// 卖家下单备注信息
///
[Column(TypeName = "varchar(255)")]
public string? Message { get; set; } = string.Empty;
///
/// 物流快递公司编号
///
public long ExpressId { get; set; }
///
/// 快递公司
///
[Column(TypeName = "varchar(25)")]
public string ExpressName { get; set; } = string.Empty;
///
/// 快递单号
///
[Column(TypeName = "varchar(30)")]
public string WaybillNumber { get; set; } = string.Empty;
///
/// 发货状态
///
public int DeliveryStatus { get; set; }
///
/// 发货时间
///
[Column(TypeName = "timestamptz")]
public DateTime? DeliveryTime { get; set; }
///
/// 包裹签收时间
///
[Column(TypeName = "timestamptz")]
public DateTime? SigningTime { get; set; }
///
/// 下单时间
///
[Column(TypeName = "timestamptz")]
public DateTime CreateTime { get; set; }
///
/// 更新时间
///
[Column(TypeName = "timestamptz")]
public DateTime? UpdateTime { get; set; }
}
}