package cn.iocoder.yudao.module.asset.controller.admin.customer.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import java.math.BigDecimal;

@Schema(description = "管理后台 - 客户创建/更新 Request VO")
@Data
public class CustomerSaveReqVO {

    @Schema(description = "主键ID（更新时必填）", example = "1")
    private Long id;

    @Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @NotBlank(message = "客户名称不能为空")
    @Size(max = 100, message = "客户名称长度不能超过100个字符")
    private String customerName;

    @Schema(description = "客户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
    @NotNull(message = "客户类型不能为空")
    @Min(value = 0, message = "客户类型值不正确")
    @Max(value = 1, message = "客户类型值不正确")
    private Integer customerType;

    @Schema(description = "联系人", example = "张三")
    @Size(max = 50, message = "联系人长度不能超过50个字符")
    private String contactPerson;

    @Schema(description = "联系电话", example = "13800138000")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "联系电话格式不正确")
    private String contactPhone;

    @Schema(description = "联系邮箱", example = "zhangsan@example.com")
    @Email(message = "联系邮箱格式不正确")
    @Size(max = 100, message = "联系邮箱长度不能超过100个字符")
    private String contactEmail;

    @Schema(description = "联系地址", example = "上海市浦东新区")
    @Size(max = 255, message = "联系地址长度不能超过255个字符")
    private String contactAddress;

    @Schema(description = "身份证号", example = "310101199001011234")
    @Pattern(regexp = "^[1-9]\\d{5}(18|19|20)\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[\\dXx]$", message = "身份证号格式不正确")
    private String idCardNo;

    @Schema(description = "身份证正面照片URL", example = "https://example.com/id_front.jpg")
    @Size(max = 255, message = "身份证正面照片URL长度不能超过255个字符")
    private String idCardFrontUrl;

    @Schema(description = "身份证反面照片URL", example = "https://example.com/id_back.jpg")
    @Size(max = 255, message = "身份证反面照片URL长度不能超过255个字符")
    private String idCardBackUrl;

    @Schema(description = "驾驶证号", example = "310101199001011234")
    @Size(max = 50, message = "驾驶证号长度不能超过50个字符")
    private String driverLicenseNo;

    @Schema(description = "驾驶证照片URL", example = "https://example.com/driver_license.jpg")
    @Size(max = 255, message = "驾驶证照片URL长度不能超过255个字符")
    private String driverLicenseUrl;

    @Schema(description = "企业名称", example = "上海科技有限公司")
    @Size(max = 200, message = "企业名称长度不能超过200个字符")
    private String companyName;

    @Schema(description = "统一社会信用代码", example = "91310000MA1FL0001A")
    @Pattern(regexp = "^[0-9A-HJ-NPQRTUWXY]{2}\\d{6}[0-9A-HJ-NPQRTUWXY]{10}$", message = "统一社会信用代码格式不正确")
    private String unifiedSocialCreditCode;

    @Schema(description = "营业执照URL", example = "https://example.com/business_license.jpg")
    @Size(max = 255, message = "营业执照URL长度不能超过255个字符")
    private String businessLicenseUrl;

    @Schema(description = "法人代表", example = "张总")
    @Size(max = 50, message = "法人代表长度不能超过50个字符")
    private String legalPerson;

    @Schema(description = "信用等级", example = "1")
    @Min(value = 0, message = "信用等级值不正确")
    @Max(value = 4, message = "信用等级值不正确")
    private Integer creditLevel;

    @Schema(description = "押金金额", example = "5000.00")
    @DecimalMin(value = "0.00", message = "押金金额不能为负数")
    private BigDecimal depositAmount;

    @Schema(description = "备注", example = "VIP客户")
    @Size(max = 500, message = "备注长度不能超过500个字符")
    private String remark;

    @Schema(description = "状态", example = "0")
    @Min(value = 0, message = "状态值不正确")
    @Max(value = 2, message = "状态值不正确")
    private Integer status;

}
