account-service http://jira.mfd.msk:8088/browse/CLS-271 поправил валидацию.
This commit is contained in:
parent
ac10bc4fb2
commit
a998f75ed9
3 changed files with 5 additions and 8 deletions
|
|
@ -125,12 +125,7 @@ public class TradingClearingRegistryValidationConfig {
|
|||
ServiceStatusDictionary.class,
|
||||
AccountError.RequiredFieldEmpty,
|
||||
AccountError.WrongFieldValue,
|
||||
false,
|
||||
statusValue -> {
|
||||
String statusCode = statusValue.getCode();
|
||||
if (ServiceStatus.Active.equalsByKey(statusCode)) return null;
|
||||
return AccountError.WrongFieldValue;
|
||||
}),
|
||||
false),
|
||||
new newTCRDuplicateCheck()
|
||||
);
|
||||
};
|
||||
|
|
@ -162,7 +157,7 @@ public class TradingClearingRegistryValidationConfig {
|
|||
return empty();
|
||||
} else {
|
||||
String tcrIds = existTCR.stream().map(tcr -> String.valueOf(tcr.getId())).collect(Collectors.joining(";"));
|
||||
return of(AccountError.AccountForTradingClearingRegistryAlreadyUsed, validatedObject.getCompanyId(), tcrIds);
|
||||
return of(AccountError.AccountForTradingClearingRegistryAlreadyUsed, tcrIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ public enum AccountError implements IErrorEnumId {
|
|||
MoneyAccountNotFound(5018L),
|
||||
ClearingCategoryNotFound(5019L),
|
||||
ClearingCompanySymbolNotFound(5022L), // Для компании %s отсутствует клиринговый код».
|
||||
AccountForTradingClearingRegistryAlreadyUsed(5023L),
|
||||
TradingClearingRegistryNotFound(3022L),
|
||||
AccountForTradingClearingRegistryAlreadyUsed(3023L),
|
||||
;
|
||||
|
||||
private final Long id;
|
||||
|
|
|
|||
|
|
@ -306,8 +306,10 @@ public class TradingClearingRegistryService extends QueueConsumer implements Ini
|
|||
|
||||
if (req.getStatus() == null) {
|
||||
tradingClearingRegistry.setStatus(ServiceStatus.Active.getKey());
|
||||
log.trace("TCR status in request not set. Use default: {}", tradingClearingRegistry.getStatus());
|
||||
} else {
|
||||
tradingClearingRegistry.setStatus(req.getStatus());
|
||||
log.trace("TCR status in request set: {}", tradingClearingRegistry.getStatus());
|
||||
}
|
||||
|
||||
String tradingRegistryType;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue