package com.erp.warehouse.dto;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.Builder;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;

/**
 * 仓库创建/更新请求DTO
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class WarehouseDTO {

    private Long id;

    @NotBlank(message = "仓库名称不能为空")
    private String name;

    @NotBlank(message = "仓库类型不能为空")
    @Pattern(regexp = "^(erp|cloud)$", message = "类型必须是erp或cloud")
    private String type;

    /** 云仓系统: jst, wdt, qimen */
    @Pattern(regexp = "^(jst|wdt|qimen)?$", message = "云仓系统必须是jst、wdt或qimen")
    private String cloudSystem;

    /** 货主编码 */
    private String ownerCode;

    /** 云仓编码 */
    private String cloudCode;

    /** AppKey */
    private String appKey;

    /** AppSecret */
    private String appSecret;

    /** API地址 */
    private String apiUrl;

    /** 备注 */
    private String remark;
}
