using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Atomx.Common.Entities
{
    /// <summary>
    /// 自有商城或平台网点的商品列表。
    /// </summary>
    [Table("ProductListings")]
    public class ProductListing
    {
        /// <summary>
        /// 产品ID
        /// </summary>
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        [Key]
        public long Id { get; set; }

        /// <summary>
        /// 基础产品信息
        /// </summary>
        public long ProductId { get; set; }

        /// <summary>
        /// 发布的企业用户ID
        /// </summary>

        public long CorporationStaffId { get; set; }

        /// <summary>
        /// 归属公司ID
        /// </summary>
        public long CorporationId { get; set; }

        /// <summary>
        /// 平台ID，1自有商城，2淘宝，3天猫，4京东，5拼多多，6抖音，7快手，8小红书等
        /// </summary>
        public int PlatformId { get; set; }

        /// <summary>
        /// 卖家店铺ID
        /// </summary>
        public long StoreId { get; set; }

        /// <summary>
        /// 产品类型ID
        /// </summary>
        public long ProductTypeId { get; set; }

        /// <summary>
        /// SEO Title
        /// </summary>
        [Column(TypeName = "varchar(255)")]
        public string MetaTitle { get; set; } = string.Empty;

        /// <summary>
        /// SEO Description
        /// </summary>
        [Column(TypeName = "varchar(512)")]
        public string MetaDescription { get; set; } = string.Empty;

        /// <summary>
        /// 产品Slug
        /// </summary>
        public string Slug { get; set; } = string.Empty;

        /// <summary>
        /// 产品特点标签
        /// </summary>
        [Column(TypeName = "varchar(100)")]
        public string? Tags { get; set; } = string.Empty;

        /// <summary>
        /// 产品详细介绍
        /// </summary>
        [Column(TypeName = "text")]
        public string Body { get; set; } = string.Empty;

        /// <summary>
        /// 订单最小数量
        /// </summary>
        public int OrderMinimumQuantity { get; set; }

        /// <summary>
        /// 订单最多数量
        /// </summary>
        public int OrderMaximumQuantity { get; set; }

        /// <summary>
        /// 是否允许退货
        /// </summary>
        public bool AllowReturn { get; set; }

        /// <summary>
        /// 是否允许换货
        /// </summary>

        public bool AllowExchange { get; set; }

        /// <summary>
        /// 是否独立发货
        /// </summary>

        public bool SingleShip { get; set; }

        /// <summary>
        /// 预计运输天数
        /// </summary>
        public int ShippingDays { get; set; }

        /// <summary>
        /// 运费模板ID
        /// </summary>

        public long ShippingId { get; set; }

        /// <summary>
        /// 精选
        /// </summary>
        public bool IsFeatured { get; set; }

        /// <summary>
        /// 是否 best
        /// </summary>
        public bool IsBest { get; set; }

        /// <summary>
        /// 是否标注新品
        /// </summary>
        public bool IsNew { get; set; }


        /// <summary>
        /// 暂停销售，前台处理成已售罄
        /// </summary>
        public bool StopSales { get; set; }

        /// <summary>
        /// 产品信息审核状态
        /// </summary>
        public int ReviewStatus { get; set; }

        /// <summary>
        /// 商品库存
        /// </summary>
        public int StockQuantity { get; set; }

        /// <summary>
        /// 总销售数量
        /// </summary>
        public int SalesQuantity { get; set; }

        /// <summary>
        /// 评分
        /// </summary>
        public double Ratings { get; set; }

        /// <summary>
        /// 5颗星
        /// </summary>
        public int FiveStars { get; set; }

        /// <summary>
        /// 4课星
        /// </summary>
        public int FourStars { get; set; }

        /// <summary>
        /// 三颗星
        /// </summary>
        public int ThreeStars { get; set; }

        /// <summary>
        /// 两颗星
        /// </summary>
        public int TwoStars { get; set; }

        /// <summary>
        /// 一颗星
        /// </summary>
        public int OneStars { get; set; }

        /// <summary>
        /// 评论数量
        /// </summary>
        public int ReviewsCount { get; set; }

        /// <summary>
        /// 总浏览次数
        /// </summary>
        public int ViewsCount { get; set; }

        /// <summary>
        /// 产品状态，0未上架，1上架
        /// </summary>

        public int Status { get; set; }

        /// <summary>
        /// 是否逻辑删除
        /// </summary>
        public bool Deleted { get; set; }

        /// <summary>
        /// 删除时间
        /// </summary>
        [Column(TypeName = "timestamptz")]

        public DateTime? DeletedTime { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column(TypeName = "timestamptz")]

        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [Column(TypeName = "timestamptz")]
        public DateTime? UpdateTime { get; set; }
    }
}
