package com.emergency.avenue.storage.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
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.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "库存信息")
@TableName(value = "dock_stock_info", autoResultMap = true)
@EqualsAndHashCode
public class DockStockInfoDO {

    @TableId(type = IdType.AUTO)
    private Long id;

    @Schema(description = "外部仓库编码", example = "22222", required = true)
    @NotNull(message = "外部仓库编码不能为空")
    private String outWarehouseNo;

    @Schema(description = "仓库编码", example = "YCK1032178878", required = true)
    @NotNull(message = "仓库编码不能为空")
    private String warehouseNo;

    @Schema(description = "物资编码", example = "YWZ219119369859", required = true)
    @NotNull(message = "物资编码不能为空")
    private String goodsNo;


    @Schema(description = "物资所属机构编码", example = "DEP202003223879", required = true)
    @NotNull(message = "物资所属机构编码不能为空")
    private String ownerNo;

    @Schema(description = "物资所属机构名称", example = "救灾和物资保障司", required = true)
    @NotNull(message = "物资所属机构名称不能为空")
    private String ownerName;

    @Schema(description = "库存总数量", example = "3", required = true)
    @NotNull(message = "库存总数量不能为空")
    private BigDecimal realNum;

    @Schema(description = "库存可用数量", example = "2", required = true)
    @NotNull(message = "库存可用数量不能为空")
    private BigDecimal usableNum;

    @Schema(description = "库存预占数量", example = "1", required = true)
    @NotNull(message = "库存预占数量不能为空")
    private BigDecimal occupyNum;

    @Schema(description = "批次编号", example = "1111", required = true)
    @NotNull(message = "批次编号不能为空")
    private String batchCode;

    @Schema(description = "批次属性串", example = "")
    private String isvLotattrs;

    @Schema(description = "生产日期", example = "2021-09-24T00:00:00.000Z")
    private Date productDate;


    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    private String creator;

    private String updater;

    private Boolean deleted;

    private Integer upload;

    @Schema(description = "唯一标识")
    private String uniqueIdentification;

    @Schema(description = "单位计算系数")
    @TableField(exist = false)
    private BigDecimal unitCoefficient;

    @Schema(description = "数量")
    @TableField(exist = false)
    private String quantity;

    @Schema(description = "数量-入库")
    @TableField(exist = false)
    private String quantityIn;

    @Schema(description = "数量-出库")
    @TableField(exist = false)
    private String quantityOut;

    @Schema(description = "外部物资编码")
    @TableField(exist = false)
    private String outGoodsNo;

    @Schema(description = "外部机构编码")
    @TableField(exist = false)
    private String outOwnerNo;


    @Schema(description = "是否可用")
    @TableField(exist = false)
    private String isAvailable;


    @Schema(description = "单价")
    @TableField(exist = false)
    private String unitPrice;

    @Schema(description = "入库时间")
    @TableField(exist = false)
    private String inboundTime;


}
