if (!changesOnly.isEmpty()) {
this.staffRepository.saveAndFlush(staffForUpdate);
}
return new CommandProcessingResultBuilder().withCommandId(command.commandId()).withEntityId(staffId)
.withOfficeId(staffForUpdate.officeId()).with(changesOnly).build();
} catch (final DataIntegrityViolationException dve) {
handleStaffDataIntegrityIssues(command, dve);
return CommandProcessingResult.empty();
}
}