from datetime import datetime
from typing import List, Optional, Dict, Any
from pydantic import BaseModel, Field, ConfigDict


class DxmProductAlbum(BaseModel):
    """商品相册信息"""
    id: int = Field(..., alias="id", description="相册ID")
    puid: int = Field(..., alias="puid", description="用户ID")
    product_id: int = Field(..., alias="productId", description="商品ID")
    name: Optional[str] = Field(None, alias="name", description="图片名称")
    img_url: Optional[str] = Field(None, alias="imgUrl", description="图片URL")
    img_original_size: int = Field(0, alias="imgOriginalSize", description="图片原始大小")
    img_compress_size: int = Field(0, alias="imgCompressSize", description="图片压缩后大小")
    img_height: int = Field(0, alias="imgHeight", description="图片高度")
    img_width: int = Field(0, alias="imgWidth", description="图片宽度")
    is_qc: int = Field(0, alias="isQc", description="是否质检图片")
    is_from_net: int = Field(1, alias="isFromNet", description="是否来自网络")
    is_del: int = Field(0, alias="isDel", description="是否删除")
    upload_state: int = Field(0, alias="uploadState", description="上传状态")
    survey_index: int = Field(0, alias="surveyIndex", description="调查索引")
    create_time: datetime = Field(..., alias="createTime", description="创建时间")
    update_time: datetime = Field(..., alias="updateTime", description="更新时间")
    is_main: Optional[int] = Field(None, alias="isMain", description="是否主图")
    id_str: Optional[str] = Field(None, alias="idStr", description="ID字符串形式")

    model_config = ConfigDict(populate_by_name=True)


class ProductVariation(BaseModel):
    """商品变体信息"""
    id: int = Field(..., alias="id", description="变体ID")
    puid: int = Field(..., alias="puid", description="用户ID")
    product_id: int = Field(..., alias="productId", description="商品ID")
    sku: str = Field(..., alias="sku", description="SKU编码")
    create_time: datetime = Field(..., alias="createTime", description="创建时间")

    model_config = ConfigDict(populate_by_name=True)


class SupplierProductRelation(BaseModel):
    """供应商商品关系"""
    supplier_name: str = Field(..., alias="supplierName", description="供应商名称")
    is_albaba: int = Field(..., alias="isAlbaba", description="是否阿里巴巴供应商")
    supplier_id: str = Field(..., alias="supplierId", description="供应商ID")
    is_main: int = Field(..., alias="isMain", description="是否主供应商")

    model_config = ConfigDict(populate_by_name=True)


class DxmWarehouseProduct(BaseModel):
    """仓库商品信息"""
    id: int = Field(..., alias="id", description="仓库商品ID")
    puid: int = Field(..., alias="puid", description="用户ID")
    warehose_id: int = Field(..., alias="warehoseId", description="仓库ID")
    goods_shelf_id: int = Field(..., alias="goodsShelfId", description="货架ID")
    shelf_name: str = Field(..., alias="shelfName", description="货架名称")
    agent_id: int = Field(0, alias="agentId", description="代理商ID")
    development_id: int = Field(..., alias="developmentId", description="开发人员ID")
    product_id: int = Field(..., alias="productId", description="商品ID")
    product_sku: str = Field(..., alias="productSku", description="商品SKU")
    full_cid: str = Field(..., alias="fullCid", description="完整分类ID")
    supplier_id: int = Field(..., alias="supplierId", description="供应商ID")
    price: float = Field(..., alias="price", description="价格")
    stock_num: int = Field(0, alias="stockNum", description="库存数量")
    safe_stock_num: int = Field(0, alias="safeStockNum", description="安全库存数量")
    presell_num: int = Field(0, alias="presellNum", description="预售数量")
    lock_stock_num: int = Field(0, alias="lockStockNum", description="锁定库存数量")
    amount: float = Field(0.0, alias="amount", description="金额")
    on_passage_num: int = Field(0, alias="onPassageNum", description="在途数量")
    on_passage_num_move: int = Field(0, alias="onPassageNumMove", description="移动中的在途数量")
    comment: str = Field("", alias="comment", description="备注")
    propasal_comment: Optional[str] = Field(None, alias="propasalComment", description="提案备注")
    comment_color: Optional[str] = Field(None, alias="commentColor", description="备注颜色")
    is_used: int = Field(1, alias="isUsed", description="是否使用")
    product_status: int = Field(0, alias="productStatus", description="商品状态")
    is_material: bool = Field(False, alias="isMaterial", description="是否原材料")
    create_time: datetime = Field(..., alias="createTime", description="创建时间")
    update_time: datetime = Field(..., alias="updateTime", description="更新时间")
    group_state: int = Field(0, alias="groupState", description="分组状态")
    allot_lock_stock_num: int = Field(0, alias="allotLockStockNum", description="分配锁定库存数量")
    warehouse_lock_stock_num: int = Field(0, alias="warehouseLockStockNum", description="仓库锁定库存数量")
    order_num: int = Field(0, alias="orderNum", description="订单数量")
    option_mode: int = Field(1, alias="optionMode", description="操作模式")
    pur_num: int = Field(0, alias="purNum", description="采购数量")
    purchasing_audit_num: int = Field(0, alias="purchasingAuditNum", description="采购审核数量")
    mark_no_purch: int = Field(1, alias="markNoPurch", description="标记不采购")
    v: int = Field(0, alias="v", description="版本号")
    pur_wait_in_num: int = Field(0, alias="purWaitInNum", description="待入库采购数量")
    available_stock_num: Optional[int] = Field(None, alias="availableStockNum", description="可用库存数量")
    oversea_lock_stock_num: int = Field(0, alias="overseaLockStockNum", description="海外锁定库存数量")
    oversea_move_pair_mark: int = Field(1, alias="overseaMovePairMark", description="海外移动配对标记")
    oversea_warehose_id: str = Field("", alias="overseaWarehoseId", description="海外仓库ID")
    full_name: Optional[str] = Field(None, alias="fullName", description="完整名称")
    sku: Optional[str] = Field(None, alias="sku", description="SKU编码")
    sku_code: Optional[str] = Field(None, alias="skuCode", description="SKU代码")
    name: Optional[str] = Field(None, alias="name", description="名称")
    img_url: Optional[str] = Field(None, alias="imgUrl", description="图片URL")
    tiny_img_url: Optional[str] = Field(None, alias="tinyImgUrl", description="缩略图URL")
    source_url: Optional[str] = Field(None, alias="sourceUrl", description="来源URL")
    sbm_id: Optional[str] = Field(None, alias="sbmId", description="SBM ID")
    sku_pro: Optional[str] = Field(None, alias="skuPro", description="SKU属性")
    name_pro: Optional[str] = Field(None, alias="namePro", description="名称属性")
    weight_pro: Optional[float] = Field(None, alias="weightPro", description="重量属性")
    price_pro: Optional[float] = Field(None, alias="pricePro", description="价格属性")
    source_url_pro: Optional[str] = Field(None, alias="sourceUrlPro", description="来源URL属性")
    comment_pro: Optional[str] = Field(None, alias="commentPro", description="备注属性")
    img_url_pro: Optional[str] = Field(None, alias="imgUrlPro", description="图片URL属性")
    is_used_pro: Optional[int] = Field(None, alias="isUsedPro", description="是否使用属性")
    full_cid_pro: Optional[str] = Field(None, alias="fullCidPro", description="完整分类ID属性")
    name_cn_bg: Optional[str] = Field(None, alias="nameCnBg", description="中文名称背景")
    name_en_bg: Optional[str] = Field(None, alias="nameEnBg", description="英文名称背景")
    weight_bg: Optional[float] = Field(None, alias="weightBg", description="重量背景")
    price_bg: Optional[float] = Field(None, alias="priceBg", description="价格背景")
    agent_name: Optional[str] = Field(None, alias="agentName", description="代理商名称")
    development_name: Optional[str] = Field(None, alias="developmentName", description="开发人员名称")
    proposal_num: Optional[int] = Field(None, alias="proposalNum", description="提案数量")
    recent_in_time: Optional[datetime] = Field(None, alias="recentInTime", description="最近入库时间")
    recent_out_time: Optional[datetime] = Field(None, alias="recentOutTime", description="最近出库时间")
    ids: Optional[List[int]] = Field(None, alias="ids", description="ID列表")
    prices: Optional[List[float]] = Field(None, alias="prices", description="价格列表")
    kc_nums: Optional[List[int]] = Field(None, alias="kcNums", description="库存数量列表")
    aqkc_nums: Optional[List[int]] = Field(None, alias="aqkcNums", description="安全库存数量列表")
    good_shelf_ids: Optional[List[int]] = Field(None, alias="goodShelfIds", description="货架ID列表")
    comments: Optional[List[str]] = Field(None, alias="comments", description="备注列表")
    full_cids: Optional[List[str]] = Field(None, alias="fullCids", description="完整分类ID列表")
    stock_num_zh: Optional[int] = Field(None, alias="stockNumZh", description="库存数量中文")
    group_num: Optional[int] = Field(None, alias="groupNum", description="分组数量")
    group_sku_table: Optional[str] = Field(None, alias="groupSkuTable", description="分组SKU表")
    old_price: Optional[float] = Field(None, alias="oldPrice", description="旧价格")
    old_stock_num: Optional[int] = Field(None, alias="oldStockNum", description="旧库存数量")
    last_pur_price: Optional[float] = Field(None, alias="lastPurPrice", description="最后采购价格")
    sale_cofficient: Optional[float] = Field(None, alias="saleCofficient", description="销售系数")
    dxm_warehose_product_g: Optional[str] = Field(None, alias="dxmWarehoseProductG", description="DXM仓库商品G")
    proposal_set: Optional[str] = Field(None, alias="proposalSet", description="提案集")
    proposal_set_json: Optional[str] = Field(None, alias="proposalSetJson", description="提案集JSON")
    this_arrival_num: Optional[int] = Field(None, alias="thisArrivalNum", description="本次到货数量")
    daily_sale: Optional[float] = Field(None, alias="dailySale", description="日销量")
    daily_sale_num: Optional[int] = Field(None, alias="dailySaleNum", description="日销售数量")
    warning_day: Optional[int] = Field(None, alias="warningDay", description="预警天数")
    purchase_plan_number: int = Field(0, alias="purchasePlanNumber", description="采购计划数量")
    warehouse_name: str = Field(..., alias="warehouseName", description="仓库名称")
    goods_shelf_lock: int = Field(0, alias="goodsShelfLock", description="货架锁定")
    state: Optional[int] = Field(None, alias="state", description="状态")
    goods_shelf_type: int = Field(0, alias="goodsShelfType", description="货架类型")
    picking_safe_stock_num: int = Field(0, alias="pickingSafeStockNum", description="拣货安全库存数量")
    oversea_product_sku: Optional[str] = Field(None, alias="overseaProductSku", description="海外商品SKU")
    authorization_id: Optional[str] = Field(None, alias="authorizationId", description="授权ID")
    sfxz: Optional[str] = Field(None, alias="sfxz", description="SFXZ")
    oversea_platfrom: Optional[str] = Field(None, alias="overseaPlatfrom", description="海外平台")
    unbilled_order_num: int = Field(0, alias="unbilledOrderNum", description="未开票订单数量")
    id_str: str = Field(..., alias="idStr", description="ID字符串形式")
    supplier_id_str: str = Field(..., alias="supplierIdStr", description="供应商ID字符串形式")
    product_id_str: str = Field(..., alias="productIdStr", description="商品ID字符串形式")
    goods_shelf_id_str: str = Field(..., alias="goodsShelfIdStr", description="货架ID字符串形式")

    model_config = ConfigDict(populate_by_name=True)


class DxmCommodityProduct(BaseModel):
    """DXM商品信息"""
    id: int = Field(..., alias="id", description="商品ID")
    puid: int = Field(..., alias="puid", description="用户ID")
    full_cid: str = Field(..., alias="fullCid", description="完整分类ID")
    name: str = Field(..., alias="name", description="商品名称")
    name_en: str = Field("", alias="nameEn", description="商品英文名称")
    spu: str = Field(..., alias="spu", description="SPU编码")
    sku: str = Field(..., alias="sku", description="SKU编码")
    sku_code: str = Field(..., alias="skuCode", description="SKU代码")
    parent_id: int = Field(..., alias="parentId", description="父商品ID")
    survey_id: int = Field(0, alias="surveyId", description="调查ID")
    data_source: Optional[str] = Field(None, alias="dataSource", description="数据来源")
    attr: Optional[str] = Field(None, alias="attr", description="属性")
    type: Optional[str] = Field(None, alias="type", description="类型")
    price: float = Field(..., alias="price", description="价格")
    process_fee: float = Field(0.0, alias="processFee", description="加工费")
    weight: float = Field(..., alias="weight", description="重量")
    allow_weight_error: float = Field(0.0, alias="allowWeightError", description="允许重量误差")
    comment: str = Field("", alias="comment", description="备注")
    propasal_comment: Optional[str] = Field(None, alias="propasalComment", description="提案备注")
    comment_color: Optional[str] = Field(None, alias="commentColor", description="备注颜色")
    img_url: str = Field(..., alias="imgUrl", description="图片URL")
    img_url_exception: int = Field(2, alias="imgUrlException", description="图片URL异常")
    source_url: str = Field(..., alias="sourceUrl", description="来源URL")
    is_used: int = Field(1, alias="isUsed", description="是否使用")
    product_status: int = Field(0, alias="productStatus", description="商品状态")
    is_del: int = Field(0, alias="isDel", description="是否删除")
    variant_or_not: int = Field(0, alias="variantOrNot", description="是否有变体")
    state: int = Field(1, alias="state", description="状态")
    is_stock: int = Field(0, alias="isStock", description="是否有库存")
    group_state: int = Field(0, alias="groupState", description="分组状态")
    sbm_id: Optional[str] = Field(None, alias="sbmId", description="SBM ID")
    agent_id: int = Field(0, alias="agentId", description="代理商ID")
    development_id: int = Field(..., alias="developmentId", description="开发人员ID")
    sales_id: int = Field(0, alias="salesId", description="销售人员ID")
    uninue_flag: int = Field(0, alias="uninueFlag", description="唯一标志")
    product_type: str = Field(..., alias="productType", description="商品类型")
    qc_type: int = Field(0, alias="qcType", description="质检类型")
    is_qc_collect: int = Field(0, alias="isQcCollect", description="是否质检收集")
    qc_template_id: int = Field(0, alias="qcTemplateId", description="质检模板ID")
    is_bind_compliance: bool = Field(False, alias="isBindCompliance", description="是否绑定合规")
    template_id: Optional[str] = Field(None, alias="templateId", description="模板ID")
    template_name: Optional[str] = Field(None, alias="templateName", description="模板名称")
    tiny_img_url: Optional[str] = Field(None, alias="tinyImgUrl", description="缩略图URL")
    length: float = Field(0.0, alias="length", description="长度")
    width: float = Field(0.0, alias="width", description="宽度")
    height: float = Field(0.0, alias="height", description="高度")
    package_length: float = Field(0.0, alias="packageLength", description="包装长度")
    package_width: float = Field(0.0, alias="packageWidth", description="包装宽度")
    package_height: float = Field(0.0, alias="packageHeight", description="包装高度")
    package_weight: float = Field(0.0, alias="packageWeight", description="包装重量")
    create_time: datetime = Field(..., alias="createTime", description="创建时间")
    update_time: datetime = Field(..., alias="updateTime", description="更新时间")
    name_cn_bg: Optional[str] = Field(None, alias="nameCnBg", description="中文名称背景")
    name_en_bg: Optional[str] = Field(None, alias="nameEnBg", description="英文名称背景")
    weight_bg: Optional[float] = Field(None, alias="weightBg", description="重量背景")
    price_bg: Optional[float] = Field(None, alias="priceBg", description="价格背景")
    material_bg: Optional[str] = Field(None, alias="materialBg", description="材料背景")
    purpose_bg: Optional[str] = Field(None, alias="purposeBg", description="用途背景")
    hgbm_bg: Optional[str] = Field(None, alias="hgbmBg", description="海关编码背景")
    danger_des_bg: Optional[str] = Field(None, alias="dangerDesBg", description="危险描述背景")
    is_customs: Optional[bool] = Field(None, alias="isCustoms", description="是否海关")
    vids_ys: Optional[str] = Field(None, alias="vidsYs", description="视频YS")
    sku_ys: Optional[str] = Field(None, alias="skuYs", description="SKU YS")
    pt_ys: Optional[str] = Field(None, alias="ptYs", description="PT YS")
    shop_id_ys: Optional[str] = Field(None, alias="shopIdYs", description="店铺ID YS")
    pid_ys: Optional[str] = Field(None, alias="pidYs", description="PID YS")
    smt_vids: Optional[str] = Field(None, alias="smtVids", description="SMT视频")
    smt_pts: Optional[str] = Field(None, alias="smtPts", description="SMT PT")
    smt_pids: Optional[str] = Field(None, alias="smtPids", description="SMT PID")
    smt_shop_ids: Optional[str] = Field(None, alias="smtShopIds", description="SMT店铺ID")
    our_vids: Optional[str] = Field(None, alias="ourVids", description="我们的视频")
    our_pts: Optional[str] = Field(None, alias="ourPts", description="我们的PT")
    our_pids: Optional[str] = Field(None, alias="ourPids", description="我们的PID")
    our_shop_ids: Optional[str] = Field(None, alias="ourShopIds", description="我们的店铺ID")
    sf_order: Optional[str] = Field(None, alias="sfOrder", description="顺丰订单")
    full_name: str = Field(..., alias="fullName", description="完整名称")
    warehose_id: Optional[str] = Field(None, alias="warehoseId", description="仓库ID")
    warehose_name: Optional[str] = Field(None, alias="warehoseName", description="仓库名称")
    invoice_save: bool = Field(False, alias="invoiceSave", description="发票保存")
    ncm: Optional[str] = Field(None, alias="ncm", description="NCM编码")
    cest: Optional[str] = Field(None, alias="cest", description="CEST编码")
    unit: Optional[str] = Field(None, alias="unit", description="单位")
    origin: Optional[str] = Field(None, alias="origin", description="产地")
    group_num: Optional[int] = Field(None, alias="groupNum", description="分组数量")
    contain_weight: float = Field(0.0, alias="containWeight", description="包含重量")
    child_ids: Optional[str] = Field(None, alias="childIds", description="子商品ID")
    child_nums: Optional[str] = Field(None, alias="childNums", description="子商品数量")
    group_sku_table: Optional[str] = Field(None, alias="groupSkuTable", description="分组SKU表")
    goods_shelf_id: Optional[str] = Field(None, alias="goodsShelfId", description="货架ID")
    good_shelf_name: Optional[str] = Field(None, alias="goodShelfName", description="货架名称")
    product_type_list: Optional[str] = Field(None, alias="productTypeList", description="商品类型列表")
    relation_flag: Optional[str] = Field(None, alias="relationFlag", description="关系标志")
    relation_str: Optional[str] = Field(None, alias="relationStr", description="关系字符串")
    ghs_count: Optional[int] = Field(None, alias="ghsCount", description="GHS计数")
    sfxz: Optional[str] = Field(None, alias="sfxz", description="SFXZ")
    arrival_num: Optional[int] = Field(None, alias="arrivalNum", description="到货数量")
    dxm_label: Optional[str] = Field(None, alias="dxmLabel", description="DXM标签")
    stock_num: Optional[int] = Field(None, alias="stockNum", description="库存数量")
    goods_shelf_name: Optional[str] = Field(None, alias="goodsShelfName", description="货架名称")
    dxm_product_customs: Optional[str] = Field(None, alias="dxmProductCustoms", description="DXM商品海关")
    dxm_commodity_product_g: Optional[str] = Field(None, alias="dxmCommodityProductG", description="DXM商品G")
    dxm_product_album_list: List[DxmProductAlbum] = Field(..., alias="dxmProductAlbumList",
                                                          description="DXM商品相册列表")
    product_variation_list: List[ProductVariation] = Field(..., alias="productVariationList",
                                                           description="商品变体列表")
    product_variation_str: Optional[str] = Field(None, alias="productVariationStr", description="商品变体字符串")
    alibaba_pair_product_list: Optional[str] = Field(None, alias="alibabaPairProductList",
                                                     description="阿里巴巴配对商品列表")
    alias_sku: Optional[str] = Field(None, alias="aliasSku", description="别名SKU")
    color: Optional[str] = Field(None, alias="color", description="颜色")
    size: Optional[str] = Field(None, alias="size", description="尺寸")
    check_detail_list: Optional[str] = Field(None, alias="checkDetailList", description="检查详情列表")
    supplier_id: Optional[str] = Field(None, alias="supplierId", description="供应商ID")
    supplier_ids: Optional[str] = Field(None, alias="supplierIds", description="供应商ID列表")
    qc_content: Optional[str] = Field(None, alias="qcContent", description="质检内容")
    qc_img_url: Optional[str] = Field(None, alias="qcImgUrl", description="质检图片URL")
    qc_img_num: int = Field(0, alias="qcImgNum", description="质检图片数量")
    product_packs: Optional[str] = Field(None, alias="productPacks", description="商品包装")
    main_supplier_name: Optional[str] = Field(None, alias="mainSupplierName", description="主供应商名称")
    main_supplier_id: Optional[str] = Field(None, alias="mainSupplierId", description="主供应商ID")
    dxm_supplier_list_str: Optional[str] = Field(None, alias="dxmSupplierListStr", description="DXM供应商列表字符串")
    supplier_size: int = Field(0, alias="supplierSize", description="供应商大小")
    variant_sku_count: int = Field(0, alias="variantSkuCount", description="变体SKU计数")
    current_sku_count: int = Field(0, alias="currentSkuCount", description="当前SKU计数")
    reference_by_group: int = Field(0, alias="referenceByGroup", description="按组引用")
    agent_name: Optional[str] = Field(None, alias="agentName", description="代理商名称")
    development_name: Optional[str] = Field(..., alias="developmentName", description="开发人员名称")
    sales_name: Optional[str] = Field(None, alias="salesName", description="销售人员名称")
    productuu_id: Optional[str] = Field(None, alias="productuuId", description="商品UUID")
    auth_id: Optional[str] = Field(None, alias="authId", description="授权ID")
    ov_warehose_id: Optional[str] = Field(None, alias="ovWarehoseId", description="OV仓库ID")
    product_amount_price: Optional[str] = Field(None, alias="productAmountPrice", description="商品金额价格")
    is_pair_oversea: int = Field(0, alias="isPairOversea", description="是否配对海外")
    id_str: str = Field(..., alias="idStr", description="ID字符串形式")
    product_variation_str_list: List[str] = Field(..., alias="productVariationStrList",
                                                  description="商品变体字符串列表")
    qc_template_id_str: str = Field(..., alias="qcTemplateIdStr", description="质检模板ID字符串")
    goods_shelf_id_str: Optional[str] = Field(None, alias="goodsShelfIdStr", description="货架ID字符串形式")

    model_config = ConfigDict(populate_by_name=True)


class DxmProductCustoms(BaseModel):
    """DXM商品海关信息"""
    id: int = Field(..., alias="id", description="海关信息ID")
    product_id: int = Field(..., alias="productId", description="商品ID")
    name_cn: str = Field(..., alias="nameCn", description="中文名称")
    name_en: str = Field(..., alias="nameEn", description="英文名称")
    price: float = Field(..., alias="price", description="价格")
    weight: float = Field(..., alias="weight", description="重量")
    material: str = Field("", alias="material", description="材料")
    purpose: str = Field("", alias="purpose", description="用途")
    hgbm: str = Field(..., alias="hgbm", description="海关编码")
    danger_des: int = Field(0, alias="dangerDes", description="危险描述")
    puid: int = Field(..., alias="puid", description="用户ID")
    create_time: datetime = Field(..., alias="createTime", description="创建时间")
    update_time: datetime = Field(..., alias="updateTime", description="更新时间")
    sku: Optional[str] = Field(None, alias="sku", description="SKU编码")
    id_str: str = Field(..., alias="idStr", description="ID字符串形式")

    model_config = ConfigDict(populate_by_name=True)


class ProductDTO(BaseModel):
    """商品数据传输对象"""
    dxm_commodity_product: DxmCommodityProduct = Field(..., alias="dxmCommodityProduct", description="DXM商品信息")
    dxm_product_customs: DxmProductCustoms = Field(..., alias="dxmProductCustoms", description="DXM商品海关信息")
    dxm_warehose_list: Optional[List[Any]] = Field(None, alias="dxmWarehoseList", description="DXM仓库列表")
    warehouse_id_list: Optional[List[Any]] = Field(None, alias="warehouseIdList", description="仓库ID列表")
    dxm_quality_check_template: Optional[Any] = Field(None, alias="dxmQualityCheckTemplate", description="DXM质检模板")
    dxm_supplier_product_relation_list: Optional[List[Any]] = Field(None, alias="dxmSupplierProductRelationList",
                                                                    description="DXM供应商商品关系列表")
    dxm_commodity_product_list: Optional[List[Any]] = Field(None, alias="dxmCommodityProductList",
                                                            description="DXM商品列表")
    spu: Optional[str] = Field(None, alias="spu", description="SPU编码")
    dxm_product_packs: List[Any] = Field(..., alias="dxmProductPacks", description="DXM商品包装列表")
    supplier_product_relation_map_list: Optional[List[SupplierProductRelation]] = Field(...,
                                                                              alias="supplierProductRelationMapList",
                                                                              description="供应商商品关系映射列表")
    dxm_warehouse_product_list: Optional[List[DxmWarehouseProduct]] = Field(..., alias="dxmWarehouseProductList",
                                                                  description="DXM仓库商品列表")
    count: Optional[int] = Field(0, alias="count", description="计数")

    model_config = ConfigDict(populate_by_name=True)


class ViewDxmCommodityProductResponse(BaseModel):
    """查看DXM商品信息响应"""
    product_dto: ProductDTO = Field(..., alias="productDTO", description="商品数据传输对象")

    model_config = ConfigDict(populate_by_name=True)


# =============================编辑部分=========================================

class EditDxmCommodityProduct(BaseModel):
    product_id: str = Field("", alias="productId")
    name: str
    name_en: str = Field("", alias="nameEn")
    sku_code: str = Field("", alias="skuCode")
    sku: str
    product_variation_str: str = Field("", alias="productVariationStr")
    sbm_id: str = Field("", alias="sbmId")
    agent_id: str = Field("", alias="agentId")
    development_id: str = Field("", alias="developmentId")
    sales_id: str = Field("", alias="salesId")
    weight: str
    allow_weight_error: str = Field("", alias="allowWeightError")
    price: str
    source_url: str = Field("", alias="sourceUrl")
    img_url: str = Field("", alias="imgUrl")
    is_used: int = Field(..., alias="isUsed")
    full_cid: str = Field(..., alias="fullCid")
    product_type: str = Field(..., alias="productType")
    length: int
    width: int
    height: int
    qc_type: int = Field(..., alias="qcType")
    product_status: int = Field(..., alias="productStatus")
    child_ids: str = Field("", alias="childIds")
    child_nums: str = Field("", alias="childNums")
    process_fee: int = Field(..., alias="processFee")
    qc_content: str = Field("", alias="qcContent")
    qc_img_str: str = Field("", alias="qcImgStr")
    qc_img_num: int = Field("", alias="qcImgNum")
    group_state: str = Field("", alias="groupState")
    ncm: str = Field("", alias="ncm")
    cest: str = Field("", alias="cest")
    unit: str = Field("", alias="unit")
    origin: str = Field("", alias="origin")


class EditDxmProductCustoms(BaseModel):
    name_cn_bg: str = Field(..., alias="nameCnBg")
    name_en_bg: str = Field(..., alias="nameEnBg")
    weight_bg: str = Field(..., alias="weightBg")
    price_bg: str = Field(..., alias="priceBg")
    material_bg: str = Field("", alias="materialBg")
    purpose_bg: str = Field("", alias="purposeBg")
    hgbm_bg: str = Field("", alias="hgbmBg")
    danger_des_bg: str = Field(..., alias="dangerDesBg")


class EditSupplierProductRelationMap(BaseModel):
    supplier_id: str = Field(..., alias="supplierId")
    is_main: int = Field(..., alias="isMain")


class EditObj(BaseModel):
    dxm_commodity_product: EditDxmCommodityProduct = Field(..., alias="dxmCommodityProduct")
    dxm_product_customs: EditDxmProductCustoms = Field(..., alias="dxmProductCustoms")
    warehouse_id_list: str = Field("", alias="warehouseIdList")
    supplier_product_relation_map_list: List[EditSupplierProductRelationMap] = Field(..., alias="supplierProductRelationMapList")
    dxm_product_packs: List = Field(..., alias="dxmProductPacks")

