package com.fjhx.entity.stock;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fjhx.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 产品组合记录
 * </p>
 *
 * @author ${author}
 * @since 2023-02-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class StockCombination extends BaseEntity {

    /**
     * 产品组合id
     */
    @NotNull(message = "组合产品id不能为空")
    private Long productId;

    /**
     * 组合后放置仓库id
     */
    @NotNull(message = "组合后放置仓库id不能为空")
    private Long combinationWarehouseId;

    /**
     * 半成品所在仓库id
     */
    @NotNull(message = "半成品所在仓库id不能为空")
    private Long sourceWarehouseId;

    /**
     * 组合数量
     */
    @NotNull(message = "组合数量不能为空")
    @Min(value = 1, message = "组合数量必须大于0")
    private Integer combinationQuantity;

    /**
     * 逻辑删除 0未删除 1已删除
     */
    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Integer delFlag;


}
