Last active
December 9, 2022 11:02
-
-
Save thomasmartin-whoz/1e933534e9fc65ec7605e981365423f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Person> listPersons(PersonListCommand command) { | |
List<Person> persons | |
if (command.personIds && command.firstName && command.lastName) { | |
persons = personRepository.findByIdInAndFirstNameAndLastName(command.personIds, command.firstName, command.lastName) | |
} else if (command.personIds && command.firstName) { | |
persons = personRepository.findByIdInAndFirstName(command.personIds, command.firstName) | |
} else if (command.personIds && command.lastName) { | |
persons = personRepository.findByIdInAndLastName(command.personIds, command.lastName) | |
} else if (command.personIds) { | |
persons = personRepository.findByIdIn(command.personIds) | |
} else if (command.firstName && command.lastName) { | |
persons = personRepository.findByFirstNameAndLastName(command.firstName, command.lastName) | |
} else if (command.firstName) { | |
persons = personRepository.findByFirstName(command.firstName) | |
} else if (command.lastName) { | |
persons = personRepository.findByLastName(command.lastName) | |
} else { | |
persons = [] | |
} | |
return persons | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment