fix after review

This commit is contained in:
akulikov 2023-05-10 13:23:38 +03:00
parent 8d893d74ca
commit 70e73b68ae
7 changed files with 3 additions and 8 deletions

View file

@ -140,7 +140,7 @@ public class AccountValidationConfig {
AccountError.WrongFieldValue),
DictionaryPresentRule.instance("accountType",
CorrespondentAccountUpdateRequest::getAccountType,
IMDGDistributedNames.Map_ServiceStatusDictionary,
IMDGDistributedNames.Map_AccountTypeDictionary,
ServiceStatusDictionary.class,
AccountError.RequiredFieldEmpty,
AccountError.WrongFieldValue,

View file

@ -78,8 +78,6 @@ public class TradingClearingRegistryValidationConfig {
if (depoAccount == null) return AccountError.AccountNotFound;
return null;
}),
// todo на будущее: нужна ли эта проверка, если при добавлении регистра статус заполняется автоматически
// на основе полей moneyAccountId и depoAccountId, то же касается TradingClearingRegistryNewRequest, нужно ли там поле status
DictionaryPresentRule.instance("status",
TradingClearingRegistryNewRequest::getStatus,
IMDGDistributedNames.Map_ServiceStatusDictionary,

View file

@ -224,7 +224,6 @@ public class BankAccountService extends QueueConsumer implements InitializingBea
bankAccount.getId(),
account.getId());
} else {
// todo выяснить, что возвращать из метода в этой ситуации
log.debug("failed block, bank account id {}, new account id {}",
bankAccount.getId(),
account.getId());

View file

@ -128,7 +128,6 @@ public class ClearingAccountService extends QueueConsumer implements Initializin
kafkaSender.sendRequestToQueue(Consts.DESTINATION_TRADING_CLEARING_REGISTRY_AUTO_NEW, request);
log.debug("successfully processed, new clearing account id {}, account id {}", clearingAccountId, accountId);
} else {
// todo выяснить, что возвращать из метода в этой ситуации
log.debug("failed insert, new clearing account id {}, new account id {} (if id = -1 then insert is failed)",
clearingAccountId,
accountId);

View file

@ -110,7 +110,6 @@ public class DepoAccountService extends QueueConsumer implements InitializingBea
kafkaSender.sendRequestToQueue(Consts.DESTINATION_TRADING_CLEARING_REGISTRY_AUTO_NEW, request);
log.debug("successfully processed, new depo account id {}, account id {}", depoAccountId, accountId);
} else {
// todo выяснить, что возвращать из метода в этой ситуации
log.debug("failed insert, new depo account id {}, new account id {} (if id = -1 then insert is failed)",
depoAccountId,
accountId);

View file

@ -144,7 +144,6 @@ public class InformationAccountService extends QueueConsumer implements Initiali
informationAccountId,
accountId);
} else {
// todo выяснить, что возвращать из метода в этой ситуации
log.debug("failed insert, new information account id {}, new account id {} (if id = -1 then insert is failed)",
informationAccountId,
accountId);

View file

@ -140,7 +140,7 @@ public class TradingClearingRegistryService extends QueueConsumer implements Ini
Account accountMain = accountImdg.getSingleObjectByID(accountId);
// TODO: WELCOME TO HELL
// TODO
// Проверка выглядит очень сложно и запутанно, потому что репортеры сами не до конца понимают, какая она должна быть.
// Пока что она соответствует ТЗ, но возможно будет правиться, поэтому расписана без выноса кода в методы и
// прочих методов сокращения кода. В дальнейшем, после тестирования и окончательного выяснения вида проверки,
@ -154,6 +154,7 @@ public class TradingClearingRegistryService extends QueueConsumer implements Ini
req.getCompanyId(),
registry.getId())
);
log.error("process failed: {}", errMsg);
return new RequestInfoUpdate()
.setMessage(errMsg)
.setStatus(Status.Error)