package com.yc.ship.module.product.controller.admin.productSpu.skuVO;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Schema(description = "管理后台 - 产品sku新增/修改 Request VO")
@Data
public class ProductSkuSaveReqVO {

    @Schema(description = "主键", example = "20562")
    private Long id;

    @Schema(description = "产品ID", example = "19853")
    private Long productId;

    @Schema(description = "成本价格", example = "27973")
    private BigDecimal costPrice;

    @NotNull(message = "销售价格不能为空")
    @Schema(description = "销售价格", example = "100.00")
    private BigDecimal salePrice;

    @NotEmpty(message = "规格类型不能为空")
    @Schema(description = "规格类型:common通用 full全价 half半价 free免票", example = "full")
    private String specType;

    @Schema(description = "库存")
    private Integer stock;

    private Boolean salePriceIsEmpty = false;

    @Override
    public int hashCode() {
        int result = costPrice.hashCode();
        result = 31 * result + (this.salePrice != null ? this.salePrice.hashCode() : 0);
        result = 31 * result + (this.specType != null ? this.specType.hashCode() : 0);
        return result;
    }

}