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

import com.cf.imes.framework.common.validation.Telephone;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import jakarta.validation.constraints.*;
import java.time.LocalDateTime;

@Schema(description = "管理后台 - 订单表 order_{N}新增/修改 Request VO")
@Data
public class OrderSaveReqVO {

    private Long id;

    @Schema(description = "父单号")
    private Long parentId;

    @Schema(description = "源订单号")
    private String apiOrderId;

    @Schema(description = "订单日期", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "订单日期不能为空")
    private LocalDateTime orderDate;

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

    @Schema(description = "订单类型，2补单、3售后单、4柜体单、5五金单、6材料单", example = "1")
    private Integer orderType;

    @Schema(description = "订单排序号")
    private Integer orderSort;

    @Schema(description = "数据类型，0文件导入 1API 2数据源", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Integer dataType;

    @Schema(description = "自定义单号")
    @Size(max = 32, message = "自定义单号长度不能超过32个字符")
    private String customOrderNo;

    @Schema(description = "客户", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "客户不能为空")
    @Size(max = 255, message = "客户长度不能超过255个字符")
    private String customer;

    @Schema(description = "客户地址", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "客户地址不能为空")
    @Size(max = 255, message = "客户地址长度不能超过255个字符")
    private String address;

    @Schema(description = "客户电话", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "客户电话不能为空")
    @Telephone
    private String phoneNumber;

    @Schema(description = "经销商", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "经销商不能为空")
    @Size(max = 255, message = "经销商长度不能超过255个字符")
    private String dealer;

    @Schema(description = "经销商电话", requiredMode = Schema.RequiredMode.REQUIRED)
    @Telephone
    private String dealerPhoneNumber;

    @Schema(description = "业务员")
    @Size(max = 64, message = "业务员长度不能超过64个字符")
    private String salesman;

    @Schema(description = "拆单员")
    @Size(max = 64, message = "拆单员长度不能超过64个字符")
    private String splitter;

    @Schema(description = "备注", example = "你猜")
    @Size(max = 255, message = "备注长度不能超过255个字符")
    private String remark;

    private Boolean deleted;

}