package cn.iocoder.yudao.module.mes.controller.admin.task.vo;

import cn.iocoder.yudao.module.mes.dal.dataobject.task.TaskDetailDO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 生产任务单新增/修改 Request VO")
@Data
public class TaskSaveReqVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14570")
    private Long id;

    @Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
    private String code;

    @Schema(description = "下达日期")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime orderDate;

    @Schema(description = "交货日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "交货日期不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime deliveryDate;

    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    private Integer status;

    @Schema(description = "流程实例的编号", example = "13815")
    private String processInstanceId;

    @Schema(description = "备注", example = "你猜")
    private String remark;

    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
    private Boolean isEnable;

    @Schema(description = "生产任务单明细列表")
    private List<TaskDetailDO> taskDetails;

    @Schema(description = "任务单类型", example = "你猜")
    private String taskType;

    @Schema(description = "是否采用自动编码", example = "你猜")
    private Boolean isCode;
}