using dodohold.core;
using System.Text.Json.Serialization;

namespace molilian.core
{
    public class AlimmShareInfoDTO
    {
        /// <summary>
        /// 阿里妈妈技术服务费
        /// </summary>
        public decimal alimmTechServiceFee { get; set; } = 0.04m;

        /// <summary>
        /// 阿里妈妈预技术服务费
        /// </summary>
        public decimal alimmTechServicePreFee { get; set; } = 0.04m;

        /// <summary>
        /// 阿里妈妈技术服务比例
        /// </summary>
        public decimal alimmTechServiceRate { get; set; } = 10.0m;
    }

    [Table("tk_order_details_adzone")]
    public class TkOrderDetailAdZoneDTO : BaseTkOrderDetailDTO;

    [Table("tk_order_details")]
    public class TkOrderDetailDTO : BaseTkOrderDetailDTO;


    public class BaseTkOrderDetailDTO
    {
        [Key]
        public int id { get; set; }
        public int accountId { get; set; } = 0;

        public string accountName { get; set; } = string.Empty;

        /// <summary>
        /// 淘客付款时间 
        /// </summary>
        [JsonConverter(typeof(DateTimeConverterUsingDateTimeParse))]
        public DateTime tkPaidTime { get; set; } = DateTime.MinValue;

        /// <summary>
        /// 订单类型（天猫或淘宝）
        /// </summary>
        public string orderType { get; set; } = string.Empty;

        /// <summary>
        /// 广告位ID
        /// </summary>
        public long adzoneId { get; set; } = 0;

        /// <summary>
        /// 收益率
        /// </summary>
        public decimal incomeRate { get; set; } = 0.0m;

        /// <summary>
        /// 补贴类型
        /// </summary>
        public string subsidyType { get; set; } = "--";

        /// <summary>
        /// 总佣金费用
        /// </summary>
        public decimal totalCommissionFee { get; set; } = 0.0m;

        /// <summary>
        /// 补贴费用
        /// </summary>
        public decimal subsidyFee { get; set; } = 0.0m;

        /// <summary>
        /// 分享佣金
        /// </summary>
        public decimal pubShareFee { get; set; } = 0.0m;

        /// <summary>
        /// 商品平台类型（天猫或淘宝）
        /// </summary>
        public string itemPlatformTypeText { get; set; } = string.Empty;

        /// <summary>
        /// 营销类型
        /// </summary>
        public string marketingType { get; set; } = string.Empty;

        /// <summary>
        /// 分享佣金（仅佣金）
        /// </summary>
        public decimal pubShareFeeForCommission { get; set; } = 0.0m;

        /// <summary>
        /// 总收益率（佣金+补贴）
        /// </summary>
        public decimal tkTotalRateForCommissionAndSdy { get; set; } = 0.0m;

        /// <summary>
        /// 支付宝总价
        /// </summary>
        public decimal alipayTotalPrice { get; set; } = 0.0m;

        /// <summary>
        /// 淘客状态
        /// </summary>
        public int tkStatus { get; set; } = 0;

        /// <summary>
        /// 业务标签
        /// </summary>
        public int tkBizTag { get; set; } = 0;

        /// <summary>
        /// 订单角色
        /// </summary>
        public int tkOrderRole { get; set; } = 0;

        /// <summary>
        /// 淘客创建时间
        /// </summary>
        [JsonConverter(typeof(DateTimeConverterUsingDateTimeParse))]
        public DateTime tkCreateTime { get; set; } = DateTime.MinValue;

        /// <summary>
        /// 分享佣金（补贴部分）
        /// </summary>
        public decimal pubShareFeeForSdy { get; set; } = 0.0m;

        /// <summary>
        /// 结算时间
        /// </summary>
        [JsonConverter(typeof(DateTimeConverterUsingDateTimeParse))]
        public DateTime tkEarningTime { get; set; } = DateTime.MinValue;

        /// <summary>
        /// 网站名称
        /// </summary>
        public string siteName { get; set; } = string.Empty;

        /// <summary>
        /// 商品数量
        /// </summary>
        public int itemNum { get; set; } = 0;

        /// <summary>
        /// 交易父ID
        /// </summary>
        public string tradeParentId { get; set; } = string.Empty;

        /// <summary>
        /// 支付价格
        /// </summary>
        public decimal payPrice { get; set; } = 0.0m;

        /// <summary>
        /// 流量来源
        /// </summary>
        public string flowSource { get; set; } = "--";

        /// <summary>
        /// 卖家昵称
        /// </summary>
        public string sellerNick { get; set; } = string.Empty;

        /// <summary>
        /// 广告位名称
        /// </summary>
        public string adzoneName { get; set; } = string.Empty;

        /// <summary>
        /// 分享比例
        /// </summary>
        public decimal pubShareRate { get; set; } = 0.0m;

        /// <summary>
        /// 市场ID
        /// </summary>
        public string mktId { get; set; } = string.Empty;

        /// <summary>
        /// 是否联盟（0表示否）
        /// </summary>
        public string isLx { get; set; } = "0";

        /// <summary>
        /// 预分享佣金（补贴部分）
        /// </summary>
        public decimal pubSharePreFeeForSdy { get; set; } = 0.0m;

        /// <summary>
        /// 预售
        /// </summary>
        public int preSell { get; set; } = 0;

        /// <summary>
        /// 阿里妈妈分享费
        /// </summary>
        public decimal alimamaShareFee { get; set; } = 0.0m;

        /// <summary>
        /// 市场商品链接
        /// </summary>
        public string mktItemLink { get; set; } = string.Empty;

        /// <summary>
        /// 商品价格
        /// </summary>
        public decimal itemPrice { get; set; } = 0.0m;

        /// <summary>
        /// 修改时间
        /// </summary>
        [JsonConverter(typeof(DateTimeConverterUsingDateTimeParse))]
        public DateTime modifiedTime { get; set; } = DateTime.MinValue;

        /// <summary>
        /// 阿里妈妈比例
        /// </summary>
        public decimal alimamaRate { get; set; } = 0.0m;

        /// <summary>
        /// 预分享佣金
        /// </summary>
        public decimal pubSharePreFee { get; set; } = 0.0m;

        /// <summary>
        /// 商品图片
        /// </summary>
        public string itemImg { get; set; } = string.Empty;
        public string itemId { get; set; } = string.Empty;

        /// <summary>
        /// 订单角色文本
        /// </summary>
        public string tkOrderRoleText { get; set; } = string.Empty;

        /// <summary>
        /// 推广ID
        /// </summary>
        public long pubId { get; set; } = 0;

        /// <summary>
        /// 淘客定金时间
        /// </summary>
        public string tkDepositTime { get; set; } = "--";

        /// <summary>
        /// 媒体平台佣金
        /// </summary>
        public decimal tkCommissionFeeForMediaPlatform { get; set; } = 0.0m;

        /// <summary>
        /// 补贴比例
        /// </summary>
        public decimal subsidyRate { get; set; } = 0.0m;

        /// <summary>
        /// 点击时间
        /// </summary>
        [JsonConverter(typeof(DateTimeConverterUsingDateTimeParse))]
        public DateTime clickTime { get; set; } = DateTime.MinValue;

        /// <summary>
        /// 淘宝付款时间
        /// </summary>
        [JsonConverter(typeof(DateTimeConverterUsingDateTimeParse))]
        public DateTime tbPaidTime { get; set; } = DateTime.MinValue;

        /// <summary>
        /// 终端类型
        /// </summary>
        public string terminalType { get; set; } = string.Empty;

        /// <summary>
        /// 支持商品点击
        /// </summary>
        public bool supportItemClick { get; set; } = true;

        /// <summary>
        /// 淘客状态文本
        /// </summary>
        public string tkStatusText { get; set; } = string.Empty;

        public AlimmShareInfoDTO alimmShareInfoDTO { get; set; }

        /// <summary>
        /// 商品标题
        /// </summary>
        public string itemTitle { get; set; } = string.Empty;

        /// <summary>
        /// 总收益率
        /// </summary>
        public decimal tkTotalRate { get; set; } = 0.0m;

        /// <summary>
        /// 预分享佣金（仅佣金）
        /// </summary>
        public decimal pubSharePreFeeForCommission { get; set; } = 0.0m;

        /// <summary>
        /// 定金价格
        /// </summary>
        public decimal DepositPrice { get; set; } = 0.0m;

        /// <summary>
        /// 分享比例（补贴）
        /// </summary>
        public decimal pubShareRateForSdy { get; set; } = 0.0m;

        /// <summary>
        /// 卖家店铺标题
        /// </summary>
        public string sellerShopTitle { get; set; } = string.Empty;

        /// <summary>
        /// 商品分类名称
        /// </summary>
        public string itemCategoryName { get; set; } = string.Empty;

        /// <summary>
        /// 退款标签
        /// </summary>
        public int refundTag { get; set; } = 0;

        /// <summary>
        /// 淘宝定金时间
        /// </summary>
        public string tbDepositTime { get; set; } = "--";

        /// <summary>
        /// 媒体平台佣金比例
        /// </summary>
        public decimal tkCommissionRateForMediaPlatform { get; set; } = 0.0m;

        /// <summary>
        /// 总收益率（补贴）
        /// </summary>
        public decimal tkTotalRateForSdy { get; set; } = 0.0m;

        /// <summary>
        /// 预佣金（媒体平台）
        /// </summary>
        public decimal tkCommissionPreFeeForMediaPlatform { get; set; } = 0.0m;

        /// <summary>
        /// 网站ID
        /// </summary>
        public long siteId { get; set; } = 0;

        /// <summary>
        /// 总佣金比例
        /// </summary>
        public decimal totalCommissionRate { get; set; } = 0.0m;

        /// <summary>
        /// 阿里妈妈分享信息
        /// </summary>
        public string alimmShareInfo { get; set; } = string.Empty;

        /// <summary>
        /// 交易ID
        /// </summary>
        public string tradeId { get; set; } = string.Empty;

        [IgnoreUpdate]
        public DateTime create_time { get; set; } = DateTime.Now;


        public DateTime last_time { get; set; } = DateTime.Now;





    }

}
