package jnpf.model.personnels.dto.goods;

import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;

@Data
public class FtbPersonnelsGoodsReceiveAddDTO {

    /**
     * 员工id
     */
    private String userId;

    /**
     * 员工姓名
     */
    private String userName;

    /**
     * 所属组织
     */
    private String orgName;

    /**
     * 领取日期
     */
    @NotNull(message = "领取日期不能为空")
    private Date receiptTime;

    /**
     * 备注
     */
    @Size(max = 500, message = "长度不能超过500个字符")
    private String remark;

    /**
     * 物品列表
     */
    @NotNull(message = "物品列表不能为空")
    @Valid
    private List<ItemsAreCollected> itemsAreCollected;

    @Data
    public static class ItemsAreCollected {
        /**
         * 物品Id
         */
        @NotNull(message = "物品Id不能为空")
        private String goodsId;
        /**
         * 领取数量
         */
        @NotNull(message = "领取数量不能为空")
        private Long number;
    }

}
