@Override
public CommandProcessingResult deleteClient(final Long clientId) {
final Client client = this.clientRepository.findOneWithNotFoundDetection(clientId);
if (client.isNotPending()) { throw new ClientMustBePendingToBeDeletedException(clientId); }
final List<Note> relatedNotes = this.noteRepository.findByClientId(clientId);
this.noteRepository.deleteInBatch(relatedNotes);
this.clientRepository.delete(client);