feat(model): add PersonType enum and MAIDEN_NAME alias type
PersonType has 5 values: PERSON, INSTITUTION, GROUP, UNKNOWN, SKIP. SKIP is intentionally excluded from the DB CHECK constraint (added in migration) as defense-in-depth. MAIDEN_NAME added to PersonNameAliasType for #209. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,5 +4,6 @@ public enum PersonNameAliasType {
|
||||
BIRTH,
|
||||
WIDOWED,
|
||||
DIVORCED,
|
||||
MAIDEN_NAME,
|
||||
OTHER
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.raddatz.familienarchiv.model;
|
||||
|
||||
public enum PersonType {
|
||||
PERSON,
|
||||
INSTITUTION,
|
||||
GROUP,
|
||||
UNKNOWN,
|
||||
SKIP
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.raddatz.familienarchiv.service;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.raddatz.familienarchiv.model.PersonNameAliasType;
|
||||
import org.raddatz.familienarchiv.model.PersonType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -279,4 +281,18 @@ class PersonNameParserTest {
|
||||
assertThat(result.cleaned()).isEqualTo("Walter de Gruyter");
|
||||
assertThat(result.title()).isNull();
|
||||
}
|
||||
|
||||
// --- enum values ---
|
||||
|
||||
@Test
|
||||
void personType_hasFiveValues() {
|
||||
assertThat(PersonType.values()).containsExactly(
|
||||
PersonType.PERSON, PersonType.INSTITUTION, PersonType.GROUP,
|
||||
PersonType.UNKNOWN, PersonType.SKIP);
|
||||
}
|
||||
|
||||
@Test
|
||||
void personNameAliasType_includesMaidenName() {
|
||||
assertThat(PersonNameAliasType.valueOf("MAIDEN_NAME")).isEqualTo(PersonNameAliasType.MAIDEN_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user