package com.wzj.soopin.order.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.dromara.common.core.domain.model.BaseAudit;
import org.dromara.common.excel.annotation.Excel;

import java.math.BigDecimal;

/**
 * 订单中所包含的商品对象 oms_order_item
 *
 * @author zcc
 */
@Schema(description = "订单中所包含的商品对象")
@Data
@TableName("oms_order_item")
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class OrderItem extends BaseAudit {
    private static final long serialVersionUID = 1L;

    @Schema(description = "ID")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "订单id")
    @Excel(name = "订单id")
    private Long orderId;

    @Schema(description = "PRODUCT_ID")
    @Excel(name = "PRODUCT_ID")
    private Long productId;

    @Schema(description = "商品编码")
    @Excel(name = "商品编码")
    private String outProductId;

    @Schema(description = "商品sku id")
    @Excel(name = "商品sku id")
    private Long skuId;

    @Schema(description = "sku编码")
    @Excel(name = "sku编码")
    private String outSkuId;

    @Schema(description = "商品快照id")
    @Excel(name = "商品快照id")
    private Long productSnapshotId;

    @Schema(description = "sku快照id")
    @Excel(name = "sku快照id")
    private Long skuSnapshotId;

    @Schema(description = "展示图片")
    @Excel(name = "展示图片")
    private String pic;

    @Schema(description = "PRODUCT_NAME")
    @Excel(name = "PRODUCT_NAME")
    private String productName;

    @Schema(description = "销售价格")
    @Excel(name = "销售价格")
    private BigDecimal salePrice;

    @Schema(description = "采购价")
    @Excel(name = "采购价")
    private BigDecimal purchasePrice;

    @Schema(description = "购买数量")
    @Excel(name = "购买数量")
    private Integer quantity;

    @Schema(description = "商品分类id")
    @Excel(name = "商品分类id")
    private Long productCategoryId;

    @Schema(description = "商品sku属性:[{\"key\":\"颜色\",\"value\":\"颜色\"},{\"key\":\"容量\",\"value\":\"4G\"}]")
    @Excel(name = "商品sku属性:[{\"key\":\"颜色\",\"value\":\"颜色\"},{\"key\":\"容量\",\"value\":\"4G\"}]")
    private String spData;

    @Schema(description = "租户id")
    @Excel(name = "租户id")
    private String tenantId;

    @Schema(description = "租户名称")
    @Excel(name = "租户名称")
    private String tenantName;
}
