feat(persons): createPerson(DTO) rejects SKIP with INVALID_PERSON_TYPE

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-25 20:57:15 +02:00
committed by marcel
parent f4132edc2b
commit 5dd4a01995
2 changed files with 14 additions and 0 deletions

View File

@@ -109,6 +109,9 @@ public class PersonService {
@Transactional
public Person createPerson(PersonUpdateDTO dto) {
if (dto.getPersonType() == PersonType.SKIP) {
throw DomainException.badRequest(ErrorCode.INVALID_PERSON_TYPE, "SKIP is not a valid person type for manual creation");
}
validateYears(dto.getBirthYear(), dto.getDeathYear());
Person person = Person.builder()
.personType(dto.getPersonType())