feat(relationship): add INVALID_RELATIONSHIP_DATES error code
New 400 error code for a relationship whose toDate precedes its fromDate,
registered in all four sites at once (ErrorCode.java, errors.ts,
getErrorMessage, messages/{de,en,es}.json) per constitution §3.6. Thrown by
the relationship date validation introduced in the following commit.
Refs #837
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -122,6 +122,8 @@ public enum ErrorCode {
|
||||
CIRCULAR_RELATIONSHIP,
|
||||
/** A relationship with the same (person, relatedPerson, type) already exists. 409 */
|
||||
DUPLICATE_RELATIONSHIP,
|
||||
/** A relationship's toDate is before its fromDate. 400 */
|
||||
INVALID_RELATIONSHIP_DATES,
|
||||
|
||||
// --- Geschichten (Stories) ---
|
||||
/** A Geschichte (story) with the given ID does not exist, or is a DRAFT and the caller lacks BLOG_WRITE. 404 */
|
||||
|
||||
@@ -651,6 +651,7 @@
|
||||
"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.",
|
||||
"error_invalid_relationship_dates": "Das Ende-Datum darf nicht vor dem Beginn-Datum liegen.",
|
||||
"validation_last_name_required": "Nachname ist Pflichtfeld.",
|
||||
"validation_first_name_required": "Vorname ist Pflichtfeld.",
|
||||
"error_ocr_service_unavailable": "Der OCR-Dienst ist nicht verfügbar.",
|
||||
|
||||
@@ -651,6 +651,7 @@
|
||||
"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.",
|
||||
"error_invalid_relationship_dates": "The end date must not be before the start date.",
|
||||
"validation_last_name_required": "Last name is required.",
|
||||
"validation_first_name_required": "First name is required.",
|
||||
"error_ocr_service_unavailable": "The OCR service is not available.",
|
||||
|
||||
@@ -651,6 +651,7 @@
|
||||
"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.",
|
||||
"error_invalid_relationship_dates": "La fecha de fin no puede ser anterior a la de inicio.",
|
||||
"validation_last_name_required": "El apellido es obligatorio.",
|
||||
"validation_first_name_required": "El nombre es obligatorio.",
|
||||
"error_ocr_service_unavailable": "El servicio OCR no está disponible.",
|
||||
|
||||
@@ -10,6 +10,7 @@ export type ErrorCode =
|
||||
| 'INVALID_PERSON_TYPE'
|
||||
| 'BIRTH_AFTER_DEATH'
|
||||
| 'INVALID_DATE_PRECISION'
|
||||
| 'INVALID_RELATIONSHIP_DATES'
|
||||
| 'INVALID_DATE_RANGE'
|
||||
| 'DOCUMENT_NOT_FOUND'
|
||||
| 'DOCUMENT_NO_FILE'
|
||||
@@ -106,6 +107,8 @@ export function getErrorMessage(code: ErrorCode | string | undefined): string {
|
||||
return m.error_birth_after_death();
|
||||
case 'INVALID_DATE_PRECISION':
|
||||
return m.error_invalid_date_precision();
|
||||
case 'INVALID_RELATIONSHIP_DATES':
|
||||
return m.error_invalid_relationship_dates();
|
||||
case 'INVALID_DATE_RANGE':
|
||||
return m.error_invalid_date_range();
|
||||
case 'DOCUMENT_NOT_FOUND':
|
||||
|
||||
Reference in New Issue
Block a user