account-service CLS-533 разрешение редактировать все счета (потому что только статус меняется)
This commit is contained in:
parent
9dc45f2165
commit
eccfb27efe
2 changed files with 10 additions and 4 deletions
|
|
@ -141,10 +141,12 @@ public class AccountValidationConfig {
|
||||||
AccountTypeDictionary.class,
|
AccountTypeDictionary.class,
|
||||||
AccountError.RequiredFieldEmpty,
|
AccountError.RequiredFieldEmpty,
|
||||||
AccountError.WrongFieldValue,
|
AccountError.WrongFieldValue,
|
||||||
accountType -> {
|
false
|
||||||
if (AccountType.Corr.equalsByKey(accountType.getCode())) return null;
|
// accountType -> {
|
||||||
return AccountError.WrongFieldValue;
|
// if (AccountType.Corr.equalsByKey(accountType.getCode())) return null;
|
||||||
})
|
// return AccountError.WrongFieldValue;
|
||||||
|
// }
|
||||||
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,10 @@ public class AccountService extends QueueConsumer implements InitializingBean {
|
||||||
CorrespondentAccountUpdateRequest request = userRequest.getRequestPayload();
|
CorrespondentAccountUpdateRequest request = userRequest.getRequestPayload();
|
||||||
|
|
||||||
Account account = accountMap.getSingleObjectByID(request.getId());
|
Account account = accountMap.getSingleObjectByID(request.getId());
|
||||||
|
if (request.getAccountType() != null && !request.getAccountType().equals(account.getAccountType())) {
|
||||||
|
requestInfoUpdate = makeError(userRequest.getId(), AccountError.WrongFieldValue, "accountType");
|
||||||
|
return requestInfoUpdate;
|
||||||
|
}
|
||||||
|
|
||||||
if (request.getStatus() != null) account.setStatus(request.getStatus());
|
if (request.getStatus() != null) account.setStatus(request.getStatus());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue