remove redundant validation rules
This commit is contained in:
parent
0545a84229
commit
c01d1ba0c6
1 changed files with 1 additions and 41 deletions
|
|
@ -88,47 +88,7 @@ public class BankAccountValidationConfig {
|
|||
AccountError.RequiredFieldEmpty),
|
||||
FieldRequiredRule.instance("destination",
|
||||
BankAccountNewRequest::getDestination,
|
||||
AccountError.RequiredFieldEmpty),
|
||||
FieldRequiredRule.instance("correspondentAccount",
|
||||
BankAccountNewRequest::getCorrespondentAccount,
|
||||
AccountError.RequiredFieldEmpty,
|
||||
false,
|
||||
correspondentAccount -> {
|
||||
String currency = bankAccountNewRequest.getCurrency();
|
||||
if (CurrencyCode.RUB.getKey().equalsIgnoreCase(currency) && correspondentAccount == null)
|
||||
return AccountError.RequiredFieldEmpty;
|
||||
return null;
|
||||
}),
|
||||
FieldRequiredRule.instance("correspondentAccountName",
|
||||
BankAccountNewRequest::getCorrespondentAccountName,
|
||||
AccountError.RequiredFieldEmpty,
|
||||
false,
|
||||
correspondentAccountName -> {
|
||||
String currency = bankAccountNewRequest.getCurrency();
|
||||
if (CurrencyCode.RUB.getKey().equalsIgnoreCase(currency) && correspondentAccountName == null)
|
||||
return AccountError.RequiredFieldEmpty;
|
||||
return null;
|
||||
}),
|
||||
FieldRequiredRule.instance("taxpayerIdentificationNumber",
|
||||
BankAccountNewRequest::getTaxpayerIdentificationNumber,
|
||||
AccountError.RequiredFieldEmpty,
|
||||
false,
|
||||
taxpayerIdentificationNumber -> {
|
||||
String currency = bankAccountNewRequest.getCurrency();
|
||||
if (CurrencyCode.RUB.getKey().equalsIgnoreCase(currency) && taxpayerIdentificationNumber == null)
|
||||
return AccountError.RequiredFieldEmpty;
|
||||
return null;
|
||||
}),
|
||||
FieldRequiredRule.instance("taxRegistrationReasonCode",
|
||||
BankAccountNewRequest::getTaxRegistrationReasonCode,
|
||||
AccountError.RequiredFieldEmpty,
|
||||
false,
|
||||
taxRegistrationReasonCode -> {
|
||||
String currency = bankAccountNewRequest.getCurrency();
|
||||
if (CurrencyCode.RUB.getKey().equalsIgnoreCase(currency) && taxRegistrationReasonCode == null)
|
||||
return AccountError.RequiredFieldEmpty;
|
||||
return null;
|
||||
})
|
||||
AccountError.RequiredFieldEmpty)
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue