feat(person): add BIRTH_AFTER_DEATH and INVALID_DATE_PRECISION error codes
Backend enum, frontend ErrorCode mirror, getErrorMessage cases, and error message i18n keys (de/en/es) incl. the mixed-precision workaround hint in error_birth_after_death. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,10 @@ public enum ErrorCode {
|
|||||||
ALIAS_NOT_FOUND,
|
ALIAS_NOT_FOUND,
|
||||||
/** The submitted personType value is not allowed (e.g. SKIP is import-only). 400 */
|
/** The submitted personType value is not allowed (e.g. SKIP is import-only). 400 */
|
||||||
INVALID_PERSON_TYPE,
|
INVALID_PERSON_TYPE,
|
||||||
|
/** A person's birth date is after their death date. 400 */
|
||||||
|
BIRTH_AFTER_DEATH,
|
||||||
|
/** A life date and its precision are incoherent: date present with UNKNOWN precision, or precision set without a date. 400 */
|
||||||
|
INVALID_DATE_PRECISION,
|
||||||
// --- Documents ---
|
// --- Documents ---
|
||||||
/** A document with the given ID does not exist. 404 */
|
/** A document with the given ID does not exist. 404 */
|
||||||
DOCUMENT_NOT_FOUND,
|
DOCUMENT_NOT_FOUND,
|
||||||
|
|||||||
@@ -643,6 +643,8 @@
|
|||||||
"error_alias_not_found": "Der Namensalias wurde nicht gefunden.",
|
"error_alias_not_found": "Der Namensalias wurde nicht gefunden.",
|
||||||
"error_invalid_person_type": "Der angegebene Personentyp ist ungültig.",
|
"error_invalid_person_type": "Der angegebene Personentyp ist ungültig.",
|
||||||
"error_invalid_date_range": "Das Enddatum darf nicht vor dem Startdatum liegen.",
|
"error_invalid_date_range": "Das Enddatum darf nicht vor dem Startdatum liegen.",
|
||||||
|
"error_birth_after_death": "Geburtsdatum muss vor dem Sterbedatum liegen. Tipp: Falls nur das Todesjahr bekannt ist und der Geburtstag spät im selben Jahr lag, bitte das Folgejahr eintragen.",
|
||||||
|
"error_invalid_date_precision": "Datum und Genauigkeit stimmen nicht überein",
|
||||||
"validation_last_name_required": "Nachname ist Pflichtfeld.",
|
"validation_last_name_required": "Nachname ist Pflichtfeld.",
|
||||||
"validation_first_name_required": "Vorname ist Pflichtfeld.",
|
"validation_first_name_required": "Vorname ist Pflichtfeld.",
|
||||||
"error_ocr_service_unavailable": "Der OCR-Dienst ist nicht verfügbar.",
|
"error_ocr_service_unavailable": "Der OCR-Dienst ist nicht verfügbar.",
|
||||||
|
|||||||
@@ -643,6 +643,8 @@
|
|||||||
"error_alias_not_found": "The name alias was not found.",
|
"error_alias_not_found": "The name alias was not found.",
|
||||||
"error_invalid_person_type": "The specified person type is not valid.",
|
"error_invalid_person_type": "The specified person type is not valid.",
|
||||||
"error_invalid_date_range": "The end date must not be before the start date.",
|
"error_invalid_date_range": "The end date must not be before the start date.",
|
||||||
|
"error_birth_after_death": "Birth date must be before death date. Tip: if only the death year is known and the birthday is late in the same year, enter the following year.",
|
||||||
|
"error_invalid_date_precision": "Date and precision do not match",
|
||||||
"validation_last_name_required": "Last name is required.",
|
"validation_last_name_required": "Last name is required.",
|
||||||
"validation_first_name_required": "First name is required.",
|
"validation_first_name_required": "First name is required.",
|
||||||
"error_ocr_service_unavailable": "The OCR service is not available.",
|
"error_ocr_service_unavailable": "The OCR service is not available.",
|
||||||
|
|||||||
@@ -643,6 +643,8 @@
|
|||||||
"error_alias_not_found": "No se encontro el alias de nombre.",
|
"error_alias_not_found": "No se encontro el alias de nombre.",
|
||||||
"error_invalid_person_type": "El tipo de persona especificado no es válido.",
|
"error_invalid_person_type": "El tipo de persona especificado no es válido.",
|
||||||
"error_invalid_date_range": "La fecha final no puede ser anterior a la inicial.",
|
"error_invalid_date_range": "La fecha final no puede ser anterior a la inicial.",
|
||||||
|
"error_birth_after_death": "La fecha de nacimiento debe ser anterior a la de defunción.",
|
||||||
|
"error_invalid_date_precision": "La fecha y la precisión no coinciden",
|
||||||
"validation_last_name_required": "El apellido es obligatorio.",
|
"validation_last_name_required": "El apellido es obligatorio.",
|
||||||
"validation_first_name_required": "El nombre es obligatorio.",
|
"validation_first_name_required": "El nombre es obligatorio.",
|
||||||
"error_ocr_service_unavailable": "El servicio OCR no está disponible.",
|
"error_ocr_service_unavailable": "El servicio OCR no está disponible.",
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ export type ErrorCode =
|
|||||||
| 'PERSON_NOT_FOUND'
|
| 'PERSON_NOT_FOUND'
|
||||||
| 'ALIAS_NOT_FOUND'
|
| 'ALIAS_NOT_FOUND'
|
||||||
| 'INVALID_PERSON_TYPE'
|
| 'INVALID_PERSON_TYPE'
|
||||||
|
| 'BIRTH_AFTER_DEATH'
|
||||||
|
| 'INVALID_DATE_PRECISION'
|
||||||
| 'INVALID_DATE_RANGE'
|
| 'INVALID_DATE_RANGE'
|
||||||
| 'DOCUMENT_NOT_FOUND'
|
| 'DOCUMENT_NOT_FOUND'
|
||||||
| 'DOCUMENT_NO_FILE'
|
| 'DOCUMENT_NO_FILE'
|
||||||
@@ -96,6 +98,10 @@ export function getErrorMessage(code: ErrorCode | string | undefined): string {
|
|||||||
return m.error_alias_not_found();
|
return m.error_alias_not_found();
|
||||||
case 'INVALID_PERSON_TYPE':
|
case 'INVALID_PERSON_TYPE':
|
||||||
return m.error_invalid_person_type();
|
return m.error_invalid_person_type();
|
||||||
|
case 'BIRTH_AFTER_DEATH':
|
||||||
|
return m.error_birth_after_death();
|
||||||
|
case 'INVALID_DATE_PRECISION':
|
||||||
|
return m.error_invalid_date_precision();
|
||||||
case 'INVALID_DATE_RANGE':
|
case 'INVALID_DATE_RANGE':
|
||||||
return m.error_invalid_date_range();
|
return m.error_invalid_date_range();
|
||||||
case 'DOCUMENT_NOT_FOUND':
|
case 'DOCUMENT_NOT_FOUND':
|
||||||
|
|||||||
Reference in New Issue
Block a user