mifosx-567 ensure duplicate externalId for staff and loan general valid json error response
This commit is contained in:
+1
-1
@@ -98,7 +98,7 @@ public class StaffWritePlatformServiceJpaRepositoryImpl implements StaffWritePla
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!changesOnly.isEmpty()) {
|
if (!changesOnly.isEmpty()) {
|
||||||
this.staffRepository.save(staffForUpdate);
|
this.staffRepository.saveAndFlush(staffForUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(staffId)
|
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(staffId)
|
||||||
|
|||||||
+5
@@ -140,6 +140,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
@Override
|
@Override
|
||||||
public CommandProcessingResult submitApplication(final JsonCommand command) {
|
public CommandProcessingResult submitApplication(final JsonCommand command) {
|
||||||
|
|
||||||
|
try {
|
||||||
final AppUser currentUser = context.authenticatedUser();
|
final AppUser currentUser = context.authenticatedUser();
|
||||||
|
|
||||||
this.fromApiJsonDeserializer.validateForCreate(command.json());
|
this.fromApiJsonDeserializer.validateForCreate(command.json());
|
||||||
@@ -201,6 +202,10 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
.withGroupId(newLoanApplication.getGroupId()) //
|
.withGroupId(newLoanApplication.getGroupId()) //
|
||||||
.withLoanId(newLoanApplication.getId()) //
|
.withLoanId(newLoanApplication.getId()) //
|
||||||
.build();
|
.build();
|
||||||
|
} catch (DataIntegrityViolationException dve) {
|
||||||
|
handleDataIntegrityIssues(command, dve);
|
||||||
|
return CommandProcessingResult.empty();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|||||||
Reference in New Issue
Block a user