package com.cf.imes.module.executor.controller.admin.plan.vo;


import com.cf.imes.framework.es.core.valid.CreateGroup;
import com.cf.imes.framework.es.core.valid.UpdateGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import java.util.List;

@Schema(description = "智能分线创建排单")
@Data
public class BranchingPlanSaveReqVO {


    @Schema(description = "机台 ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "机台 ID不能为空")
    private Long machineId;



    @Schema(description = "生产单id与商品id 列表,修改排单时，只传入新增的那一部分",requiredMode = Schema.RequiredMode.REQUIRED)
    @Valid
    private List<BranchingPlanSaveReqVO.Item> itemList;


    @Data
    public static class Item {

        @Schema(description = "生产单的商品id")
        @NotNull(message = "生产单数据错误，请检查生产单数据或重新导入，排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
        private Long id;

        @Schema(description = "生产单id")
        @NotNull(message = "生产单数据错误，请检查生产单数据或重新导入，排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
        private Long orderId;

        @Schema(description = "板材库大板id")
        @NotNull(message = "生产单数据错误，请检查生产单数据或重新导入，排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
        private String goodsId;

        @Schema(description = "余料板ID")
        private Long remainPlateId;

    }
}
