using System;
using System.Collections.Generic;

namespace JiaZhiQuan.Common.Models.MallGoodsModel
{
    public class MallGoodsModel
    {
        public virtual string goodsId { get; set; }
        public string goodsName { get; set; }
        public string goodsDesc { get; set; }
        public string coverImg { get; set; }
        public string specJson { get; set; }
        /// <summary>
        /// 链路code
        /// </summary>
        public string chainCodes { get; set; }
        /// <summary>
        /// 属性全链路
        /// </summary>
        public string specPath { get; set; }
        public int oneCatId { get; set; }
        public string oneCatName { get; set; }
        public int twoCatId { get; set; }
        public string twoCatName { get; set; }
        public int catId { get; set; }
        public string specIds { get; set; }
        public string specValuesIds { get; set; }
        public int hasVideo { get; set; }
        public string videoId { get; set; }
        public int coverWidth { get; set; }
        public int coverHeight { get; set; }
        public string duration { get; set; }
        public int salePrice { get; set; }
        public int originalPrice { get; set; }
        public string province { get; set; }
        public string city { get; set; }
        public virtual string sellerId { get; set; }
        public DateTime createAt { get; set; }
        public int? goodsLevel { get; set; }
        public int? viewCnt { get; set; }
        public int? collectCnt { get; set; }
        public int? shareCnt { get; set; }
        public string pointsPlanDesc { get; set; } = "";
        public int disabled { get; set; } = (int)DisabledStatus.启用;
        public int onsaleState { get; set; } = (int)MallGoodsOnsaleState.上架;
        public int saleState { get; set; }
        public UserInfoBaseWithFocusState seller { get; set; }
        /// <summary>
        /// 是否收藏过 
        /// </summary>
        public int hasCollect { get; set; } = 0;
        public int videoReady { get; set; }
        public int stock { get; set; } = 1;
        public int sourceType { get; set; } = (int)MallGoodsSourceType.c2c商品;
        public string disabledReason { get; set; }
        public int deleted { get; set; } = (int)DeletedState.正常;
        public int auditState { get; set; } = (int)MallGoodsAuditState.通过;
        public int offsaleReasonType { get; set; }
        public int version { get; set; }
        public DateTime updateAt { get; set; }
    }

    /// <summary>
    /// 商品资源
    /// </summary>
    public class MallGoodsResource
    {
        public int resourceId { get; set; }

        /// <summary>
        /// 图片url/视频封面url
        /// </summary>
        public string resourceUrl { get; set; }

        /// <summary>
        /// 商品id
        /// </summary>
        public long goodsId { get; set; }

        /// <summary>
        /// 图片类型：1.视频 2.图片
        /// </summary>
        public int resourceType { get; set; }

        /// <summary>
        /// 视频编号
        /// </summary>
        public string videoId { get; set; }

        /// <summary>
        /// 宽度
        /// </summary>
        public int width { get; set; }

        /// <summary>
        /// 高度
        /// </summary>
        public int height { get; set; }

        /// <summary>
        /// 视频时长
        /// </summary>
        public string duration { get; set; }

        /// <summary>
        /// 视频播放url
        /// </summary>
        public string videoUrl { get; set; }

        public int displayOrder { get; set; }
        public DateTime createAt { get; set; }
    }

    /// <summary>
    /// 商品类目
    /// </summary>
    public class MallCategory
    {
        public int catLevel { get; set; }
        public int catId { get; set; }
        public string catName { get; set; }
        public int parentId { get; set; }
        public int displayOrder { get; set; }
        public string catImageUrl { get; set; }

        /// <summary>
        /// 服务费模版
        /// </summary>
        public int? serviceFeeTempId { get; set; }

        public List<MallCategory> children { get; set; }
    }

    /// <summary>
    /// 商品属性
    /// </summary>
    public class MallSpec
    {
        public string code { get; set; }
        public int catId { get; set; }
        public int specId { get; set; }
        public string specName { get; set; }
        public int required { get; set; }
        public int showType { get; set; }
        public int displayOrder { get; set; }
        public int filterEnabled { get; set; }
        public int hasRestrict { get; set; }
        public int state { get; set; }
        public int level { get; set; }
        public List<MallSpecValues> specValues { get; set; }
    }

    /// <summary>
    /// 商品属性值
    /// </summary>
    public class MallSpecValues
    {
        public int svId { get; set; }
        public string svName { get; set; }
        public string svImg { get; set; }
        /// <summary>
        /// 属性值下的属性
        /// </summary>
        public List<MallSpec> specs { get; set; }
    }

    /// <summary>
    /// 服务费
    /// </summary>
    public class MallServiceFee
    {
        /// <summary>
        /// 服务费名称
        /// </summary>
        public string name { get; set; }

        /// <summary>
        ///扣除金额
        /// </summary>
        public string fee { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int displayOrder { get; set; }
    }
    /// <summary>
    /// 到手服务费
    /// </summary>
    public class NetServiceFee {
        //总服务费，单位元
        public decimal totalServiceFee { get; set; }
        //到手价，单位元
        public decimal netAmount { get; set; }
        public List<MallServiceFee> fees { get; set; }
        public bool isBelowMiniPrice { get; set; }
    }

    /// <summary>
    /// 服务费区间
    /// </summary>
    public class MallServiceFeeRange
    {
        /// <summary>
        /// 服务费名称
        /// </summary>
        public string name { get; set; }

        /// <summary>
        /// 服务费id
        /// </summary>
        public int serviceFeeId { get; set; }

        /// <summary>
        /// 收费方式（1，定额，2，比例，3免费）
        /// </summary>
        public int chargeType { get; set; }

        /// <summary>
        /// 下区间价格（单位分）
        /// </summary>
        public int startRange { get; set; }

        /// <summary>
        /// 上区间价格（单位分）
        /// </summary>
        public int endRange { get; set; }

        /// <summary>
        /// 收费金额（单位分）
        /// </summary>
        public int chargeAmount { get; set; }

        /// <summary>
        /// 收费比例(万分之几)
        /// </summary>
        public int chargeRate { get; set; }

        /// <summary>
        /// 最低金额（单位分）
        /// </summary>
        public int? minFee { get; set; }

        /// <summary>
        /// 最高金额（单位分）
        /// </summary>
        public int? maxFee { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int displayOrder { get; set; }
    }

    /// <summary>
    /// 用户评价
    /// </summary>
    public class MemberOrderRateRecord
    {
        /// <summary>
        /// 评价id
        /// </summary>
        public int id { get; set; }

        /// <summary>
        /// 用户id
        /// </summary>
        public long userId { get; set; }

        /// <summary>
        /// 昵称
        /// </summary>
        public string alias { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        public string username { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        public string headImage { get; set; }

        /// <summary>
        /// 订单id
        /// </summary>
        public long orderId { get; set; }

        /// <summary>
        /// 订单详情id
        /// </summary>
        public long orderDetailId { get; set; }

        /// <summary>
        /// 商品id
        /// </summary>
        public long goodsId { get; set; }

        /// <summary>
        /// 评论人类型（1，买家，2，卖家）'
        /// </summary>
        public int userType { get; set; }

        /// <summary>
        /// 评价类型：0差评 1 中评 2 好评 
        /// </summary>
        public int rateType { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime createAt { get; set; }

        /// <summary>
        /// 评价标签
        /// </summary>
        public string tags { get; set; }
    }

    /// <summary>
    /// 用户评价标签
    /// </summary>
    public class MemberOrderRateTags
    {
        public int recordId { get; set; }
        public string name { get; set; }
    }

    public class MallGoodsImportTask
    {
        public int id { get; set; }
        public string goodsDesc { get; set; }
        public int catId { get; set; }
        public int overwrite { get; set; }
        public string cont { get; set; }
        public DateTime execTime { get; set; }
        public int state { get; set; }
        public string sourceInfo { get; set; }
    }

    public class MallGoodsCreateModel : MallGoodsModel
    {
        public new long goodsId { get; set; }
        public new long sellerId { get; set; }
        public List<MallGoodsResource> resources { get; set; }
    }

    public class MallGoodsExcelItem : MallGoodsModel
    {
        public List<MallGoodsResource> resources { get; set; }
    }

    public class MallGoodsChangeEvent
    {
        //MallGoodsChangeEventType
        public int eventType { get; set; }
        public long goodsId { get; set; }
        public string eventName { get; set; }
        public string eventDesc { get; set; }
        public long operatorId { get; set; }
        //MallGoodsChangeOperatorType
        public int operatorType { get; set; }

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