package com.seer.teach.mall.response;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.List;

@Getter
@Setter
@Schema(name = "OrderItemResp", description = "订单中的商品项")
public class OrderItemResp {

    @Schema(description = "订单子项Id")
    private Integer id;

    @Schema(description = "订单Id")
    private Integer orderId;

    @Schema(description = "子订单id")
    private Integer childOrderId;

    @Schema(description = "订单商品Id")
    private Integer goodsId;

    @Schema(description = "相同商品的数量")
    private Integer number;

    @Schema(description = "商品名称")
    private String goodsName;

    @Schema(description = "价格")
    private BigDecimal price;

    @Schema(description = "学豆")
    private BigDecimal coin;

    @Schema(description = "`sku_id`")
    private Integer skuId;

    @Schema(description = "图片链接")
    private String picUrl;

    @Schema(description = "评价状态，1：已评价，0：为评价")
    private Integer commentStatus;

    private List<Attribute> attributes;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Schema(description = "商品属性")
    public static class Attribute {

        @Schema(name = "属性编号", example = "1")
        private Integer attributeId;

        @Schema(name = "属性名字", example = "颜色")
        private String attributeName;

        @Schema(name = "属性值编号", example = "1")
        private Integer valueId;

        @Schema(name = "属性值名字", example = "红色")
        private String valueName;

    }

}