package com.ruoyi.loanpricing.domain.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

import java.io.Serializable;

/**
 * 个人客户利率定价发起DTO
 *
 * @author ruoyi
 * @date 2025-01-19
 */
@Data
@Schema(description = "个人客户利率定价发起请求")
public class PersonalLoanPricingCreateDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "客户内码", requiredMode = Schema.RequiredMode.REQUIRED, example = "CUST001")
    @NotBlank(message = "客户内码不能为空")
    private String custIsn;

    @Schema(description = "客户名称", example = "张三")
    private String custName;

    @Schema(description = "证件类型", example = "身份证")
    private String idType;

    @Schema(description = "证件号码", example = "110101199001011234")
    private String idNum;

    @Schema(description = "担保方式", requiredMode = Schema.RequiredMode.REQUIRED, example = "信用", allowableValues = {"信用", "保证", "抵押", "质押"})
    @NotBlank(message = "担保方式不能为空")
    @Pattern(regexp = "^(信用|保证|抵押|质押)$", message = "担保方式必须是：信用、保证、抵押、质押之一")
    private String guarType;

    @Schema(description = "申请金额（元）", requiredMode = Schema.RequiredMode.REQUIRED, example = "500000")
    @NotBlank(message = "申请金额不能为空")
    private String applyAmt;

    @Schema(description = "业务种类", requiredMode = Schema.RequiredMode.REQUIRED, example = "存量转贷", allowableValues = {"新增", "存量新增", "存量转贷"})
    @NotBlank(message = "业务种类不能为空")
    @Pattern(regexp = "^(新增|存量新增|存量转贷)$", message = "业务种类必须是：新增、存量新增、存量转贷之一")
    private String businessType;

    @Schema(description = "历史贷款利率", example = "3.65")
    private String loanRateHistory;

    @Schema(description = "借款期限（年）", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
    @NotBlank(message = "借款期限不能为空")
    private String loanTerm;

    @Schema(description = "循环功能", example = "0")
    private String loanLoop;

    @Schema(description = "抵质押类型", example = "一类", allowableValues = {"一类", "二类", "三类", "四类", "存单质押", "其他质押"})
    private String collType;

    @Schema(description = "抵质押物是否三方所有", example = "0")
    private String collThirdParty;

    @Schema(description = "存单票面利率", example = "2.15")
    private String couponRate;
}
