package com.ruoyi.info.collection.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 账户库编辑DTO
 *
 * @author ruoyi
 * @date 2026-04-13
 */
@Data
@Schema(description = "账户库编辑")
public class CcdiAccountInfoEditDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    @NotNull(message = "主键ID不能为空")
    @Schema(description = "主键ID")
    private Long id;

    /** 所属人类型 */
    @NotBlank(message = "所属人类型不能为空")
    @Schema(description = "所属人类型")
    private String ownerType;

    /** 所属人标识 */
    @Schema(description = "所属人标识")
    private String ownerId;

    /** 账户号码 */
    @NotBlank(message = "账户号码不能为空")
    @Size(max = 240, message = "账户号码长度不能超过240个字符")
    @Schema(description = "账户号码")
    private String accountNo;

    /** 账户类型 */
    @NotBlank(message = "账户类型不能为空")
    @Size(max = 30, message = "账户类型长度不能超过30个字符")
    @Schema(description = "账户类型")
    private String accountType;

    /** 账户范围 */
    @NotBlank(message = "账户范围不能为空")
    @Size(max = 20, message = "账户范围长度不能超过20个字符")
    @Schema(description = "账户范围")
    private String bankScope;

    /** 账户姓名 */
    @NotBlank(message = "账户姓名不能为空")
    @Size(max = 100, message = "账户姓名长度不能超过100个字符")
    @Schema(description = "账户姓名")
    private String accountName;

    /** 开户机构 */
    @NotBlank(message = "开户机构不能为空")
    @Size(max = 100, message = "开户机构长度不能超过100个字符")
    @Schema(description = "开户机构")
    private String openBank;

    /** 银行代码 */
    @Size(max = 20, message = "银行代码长度不能超过20个字符")
    @Schema(description = "银行代码")
    private String bankCode;

    /** 币种 */
    @Size(max = 3, message = "币种长度不能超过3个字符")
    @Schema(description = "币种")
    private String currency;

    /** 状态 */
    @NotNull(message = "状态不能为空")
    @Schema(description = "状态")
    private Integer status;

    /** 生效日期 */
    @NotNull(message = "生效日期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Schema(description = "生效日期")
    private Date effectiveDate;

    /** 失效日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Schema(description = "失效日期")
    private Date invalidDate;

    /** 是否实控账户 */
    @Schema(description = "是否实控账户")
    private Integer isActualControl;

    /** 月均交易笔数 */
    @Min(value = 0, message = "月均交易笔数不能小于0")
    @Schema(description = "月均交易笔数")
    private Integer avgMonthTxnCount;

    /** 月均交易金额 */
    @DecimalMin(value = "0", message = "月均交易金额不能小于0")
    @Schema(description = "月均交易金额")
    private BigDecimal avgMonthTxnAmount;

    /** 频率等级 */
    @Size(max = 20, message = "频率等级长度不能超过20个字符")
    @Schema(description = "频率等级")
    private String txnFrequencyLevel;

    /** 借方单笔最高额 */
    @DecimalMin(value = "0", message = "借方单笔最高额不能小于0")
    @Schema(description = "借方单笔最高额")
    private BigDecimal debitSingleMaxAmount;

    /** 贷方单笔最高额 */
    @DecimalMin(value = "0", message = "贷方单笔最高额不能小于0")
    @Schema(description = "贷方单笔最高额")
    private BigDecimal creditSingleMaxAmount;

    /** 借方日累计最高额 */
    @DecimalMin(value = "0", message = "借方日累计最高额不能小于0")
    @Schema(description = "借方日累计最高额")
    private BigDecimal debitDailyMaxAmount;

    /** 贷方日累计最高额 */
    @DecimalMin(value = "0", message = "贷方日累计最高额不能小于0")
    @Schema(description = "贷方日累计最高额")
    private BigDecimal creditDailyMaxAmount;

    /** 风险等级 */
    @Size(max = 10, message = "风险等级长度不能超过10个字符")
    @Schema(description = "风险等级")
    private String txnRiskLevel;
}
