fixed error nominee add error
This commit is contained in:
+5
-2
@@ -287,8 +287,11 @@ public class ClientNomineeWritePlatformServiceImpl implements ClientNomineeWrite
|
||||
if (clientId == null || nomineeClientId == null || accountType == null || accountType.isBlank()) {
|
||||
return;
|
||||
}
|
||||
final long existing = nomineeRepository.countActiveByClientNomineeAndAccountType(
|
||||
clientId, nomineeClientId, accountType, excludeNomineeId);
|
||||
final long existing = (excludeNomineeId != null)
|
||||
? nomineeRepository.countActiveByClientNomineeAndAccountTypeExcluding(
|
||||
clientId, nomineeClientId, accountType, excludeNomineeId)
|
||||
: nomineeRepository.countActiveByClientNomineeAndAccountType(
|
||||
clientId, nomineeClientId, accountType);
|
||||
if (existing > 0) {
|
||||
throw new PlatformDataIntegrityException("error.msg.nominee.already.linked.for.account.type",
|
||||
"This person is already a nominee for one of the client's "
|
||||
|
||||
Reference in New Issue
Block a user