account-service http://jira.mfd.msk:8088/browse/CLS-509 InformationAccount - их может быть много

This commit is contained in:
AKurakin 2023-09-14 16:59:51 +03:00
parent 4c287bfed8
commit 38333d5b95

View file

@ -55,15 +55,7 @@ public class InformationAccountValidationConfig {
company -> {
if (!WorkflowStatus.Active.equalsByKey(company.getWorkflowStatus()))
return AccountError.CompanyNotActive;
Long companyId = company.getId();
Imdg<InformationAccount> informationAccountImdg = context.obtainMap(
IMDGDistributedNames.Map_InformationAccount, InformationAccount.class
);
Collection<InformationAccount> infoAccounts = informationAccountImdg.getCollectionObjectsByFieldValues(
Map.of("companyId", companyId)
);
if (infoAccounts.isEmpty()) return null;
return AccountError.InfoAccountAlreadyExist;
return null;
}),
DictionaryPresentRule.instance("status", InformationAccountNewRequest::getStatus,
IMDGDistributedNames.Map_ServiceStatusDictionary, ServiceStatusDictionary.class,