package com.aegis.resource.material.domain;

import com.aegis.common.core.domain.BaseEntity;
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 com.baomidou.mybatisplus.annotation.Version;
import java.math.BigDecimal;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 物资库存实体类 resource_material_inventory
 * 
 * @author aegis
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("resource_material_inventory")
public class MaterialInventory extends BaseEntity {
    
    private static final long serialVersionUID = 1L;

    /** 库存ID */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /** 物资ID */
    private Long materialId;

    /** 仓库ID */
    private Long warehouseId;

    /** 仓库名称 */
    @Size(max = 100, message = "仓库名称长度不能超过100个字符")
    @TableField(exist = false)
    private String warehouseName;

    /** 总数量 */
    @DecimalMin(value = "0.00", message = "总数量不能为负数")
    private BigDecimal totalQty;

    /** 可用数量 */
    @DecimalMin(value = "0.00", message = "可用数量不能为负数")
    private BigDecimal availableQty;

    /** 锁定数量 */
    @DecimalMin(value = "0.00", message = "锁定数量不能为负数")
    private BigDecimal lockedQty;

    /** 已使用数量 */
    @DecimalMin(value = "0.00", message = "已使用数量不能为负数")
    private BigDecimal usedQty;

    /** 版本号（乐观锁） */
    @Version
    private Integer version;
}