This commit is contained in:
parent
33f9789268
commit
63bd1bae6e
2 changed files with 7 additions and 2 deletions
|
|
@ -117,7 +117,7 @@ public class ClientCodeValidationConfig {
|
|||
Account.class,
|
||||
AccountError.RequiredFieldEmpty,
|
||||
AccountError.AccountNotFound,
|
||||
true,
|
||||
false,
|
||||
acc -> Objects.equals(context.getValidatedObject().getCompanyId(), acc.getCompanyId())
|
||||
? null : AccountError.AccountNotFound
|
||||
),
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@ public enum BackendClientCodeValidationRule implements IValidationRule<ImdgValid
|
|||
ClientCodeNewRequest validatedObject = context.getValidatedObject();
|
||||
List<Long> currencyIds = validatedObject.getCurrencyAccountList();
|
||||
Long moneyAccountId = validatedObject.getMoneyAccountId();
|
||||
|
||||
if (moneyAccountId == null) {
|
||||
return empty();
|
||||
}
|
||||
Imdg<TradingClearingRegistry> tradingClearingRegistryImdg =
|
||||
context.obtainMap(IMDGDistributedNames.Map_TradingClearingRegistry, TradingClearingRegistry.class);
|
||||
Imdg<TradingClearingRegistryList> tradingClearingRegistryListImdg =
|
||||
|
|
@ -58,6 +60,9 @@ public enum BackendClientCodeValidationRule implements IValidationRule<ImdgValid
|
|||
return of(AccountError.TradingClearingRegistryAlreadyExist);
|
||||
}
|
||||
|
||||
if (currencyIds == null || currencyIds.isEmpty()) {
|
||||
return empty();
|
||||
}
|
||||
for (Long id : currencyIds) {
|
||||
TradingClearingRegistryList tcrList = tradingClearingRegistryListImdg.getFirstObjectByFieldValues(
|
||||
Map.of(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue