From bd71d2acf07a5a44744bbcef31cbd18111a77a22 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sat, 13 Jun 2026 10:45:18 +0200 Subject: [PATCH] feat(timeline): add ErrorCodes for event CRUD Add TIMELINE_EVENT_NOT_FOUND (404), TIMELINE_EVENT_CONFLICT (409), TIMELINE_TITLE_TOO_LONG (400), and a generic CONFLICT (409) used by the optimistic-lock backstop. Per #775 / ADR-040. Co-Authored-By: Claude Fable 5 --- .../raddatz/familienarchiv/exception/ErrorCode.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/src/main/java/org/raddatz/familienarchiv/exception/ErrorCode.java b/backend/src/main/java/org/raddatz/familienarchiv/exception/ErrorCode.java index 5c6b6d95..bea7cf66 100644 --- a/backend/src/main/java/org/raddatz/familienarchiv/exception/ErrorCode.java +++ b/backend/src/main/java/org/raddatz/familienarchiv/exception/ErrorCode.java @@ -155,6 +155,14 @@ public enum ErrorCode { /** The merge target is a descendant of the source tag. 400 */ TAG_MERGE_INVALID_TARGET, + // --- Timeline (Zeitstrahl) --- + /** A timeline event with the given ID does not exist. 404 */ + TIMELINE_EVENT_NOT_FOUND, + /** Optimistic-locking conflict — the timeline event was modified by another curator. 409 */ + TIMELINE_EVENT_CONFLICT, + /** A timeline event title exceeds the maximum length (255 characters — the DB column bound). 400 */ + TIMELINE_TITLE_TOO_LONG, + // --- Generic --- /** Request validation failed (missing or malformed fields). 400 */ VALIDATION_ERROR, @@ -162,6 +170,8 @@ public enum ErrorCode { BATCH_TOO_LARGE, /** Bulk edit request exceeds the per-request document ID cap. 400 */ BULK_EDIT_TOO_MANY_IDS, + /** A concurrent modification was detected (generic optimistic-lock backstop). 409 */ + CONFLICT, /** An unexpected server-side error occurred. 500 */ INTERNAL_ERROR, }