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 CorporateLoanPricingCreateDTO implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @Schema(description = "客户名称", example = "测试科技有限公司")
    private String custName;

    @Schema(description = "证件类型", example = "统一社会信用代码")
    private String idType;

    @Schema(description = "证件号码", example = "91110000100000000X")
    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 = "1000000")
    @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 = "还款方式", example = "分期", allowableValues = {"分期", "不分期"})
    private String repayMethod;

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

    @Schema(description = "余值覆盖", example = "0")
    private String resCover;

    @Schema(description = "绿色贷款", example = "0")
    private String isGreenLoan;

    @Schema(description = "贸易和建筑业企业标识", example = "0")
    private String isTradeBuildEnt;

    @Schema(description = "抵质押类型", example = "一类", allowableValues = {"一类", "二类", "三类", "排污权抵押", "其他不动产抵押", "存单质押", "股权质押", "其他质押"})
    @Pattern(regexp = "^(一类|二类|三类|排污权抵押|其他不动产抵押|存单质押|股权质押|其他质押)$", message = "抵质押类型必须是：一类、二类、三类、排污权抵押、其他不动产抵押、存单质押、股权质押、其他质押之一")
    private String collType;

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

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