package ru.soune.nocopy.dto.payout;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AddBankTransferRequest {

    @NotBlank(message = "Bank name is required")
    @Size(min = 2, max = 200, message = "Bank name must be between 2 and 200 characters")
    private String bankName;

    @NotBlank(message = "BIC is required")
    @Pattern(regexp = "^[0-9]{9}$", message = "BIC must contain 9 digits")
    private String bic;

    @Pattern(regexp = "^[0-9]{20}$", message = "Correspondent account must contain 20 digits")
    private String correspondentAccount;

    @NotBlank(message = "Account number is required")
    @Pattern(regexp = "^[0-9]{20}$", message = "Account number must contain 20 digits")
    private String accountNumber;

    @NotBlank(message = "Account holder name is required")
    @Size(min = 3, max = 200, message = "Account holder name must be between 3 and 200 characters")
    private String accountHolder;

    @Pattern(regexp = "^[0-9]{10}$|^[0-9]{12}$", message = "INN must contain 10 or 12 digits")
    private String inn;

    @Pattern(regexp = "^[0-9]{9}$", message = "KPP must contain 9 digits")
    private String kpp;

    @Builder.Default
    private boolean saveAsDefault = false;
}