Timeline: TimelineEvent entity + Flyway migration (#774) #816
Open
marcel
wants to merge 11 commits from
feat/issue-774-timeline-event-entity into main
pull from: feat/issue-774-timeline-event-entity
merge into: marcel:main
marcel:main
marcel:feat/issue-803-geschichten-document-filter-chip
marcel:worktree-feat+issue-738-nl-search-backend
marcel:feat/issue-286-notification-bell-form-actions
marcel:feat/issue-580-sentry-backend
marcel:fix/issue-593-management-port-zero
marcel:worktree-feat+issue-557-upload-artifact-v3-pin
marcel:worktree-chore+issue-556-drop-client-branches-coverage-gate
marcel:fix/issue-514-prerender-crawl-bakes-redirects
marcel:fix/issue-472-prerender-entries
marcel:feat/issue-395-readme
marcel:feat/issue-345-bulk-mark-reviewed
marcel:feat/issue-344-bell-tooltip
marcel:feat/issue-341-annotieren-contrast
marcel:feat/issue-225-bulk-metadata-edit
marcel:feat/issue-317-bulk-upload
marcel:feat/issue-271-dashboard-redesign
marcel:docs/issue-240-mission-control-spec
marcel:refactor/issues-193-200
marcel:feat/issue-162-korrespondenz-redesign
marcel:feature/68-new-document-file-first
marcel:feat/81-discussion-discoverability
marcel:feat/62-document-bottom-panel
marcel:feature/56-backfill-file-hashes
marcel:feat/38-document-edit-history
marcel:fix/svelte5-test-delegation-and-login-auth
No Reviewers
Labels
Clear labels
P0-critical
P1-high
P2-medium
P3-later
audit
bug
cleanup
collaboration
conversation
descoped
devops
documentation
epic
feature
file-upload
legibility
needs-discussion
notification
person
phase-1: security
phase-2: container-images
phase-3: prod-compose
phase-4: spring-prod-profile
phase-5: backups
phase-6: deployment-docs
phase-7: monitoring
refactor
security
test
ui
user
Blocks a core user journey, causes data loss, or is a security/accessibility barrier. Work on this before P1+.
Significant friction on a main user journey; workaround exists but is non-obvious. Next up after P0.
Noticeable improvement; doesn't block anything; schedule opportunistically.
Cosmetic or parking-lot work; fine to stay open indefinitely.
Read-only audit / assessment work; produces a report rather than changing code
Something isn't working
Removal of dead code, vague comments, naming violations, and scratch artifacts
We want to extend the family archive to have more collaboration tools
We will do that later
README, ARCHITECTURE, GLOSSARY, CONTRIBUTING, per-domain docs
Marker for epic-level issues that group multiple child issues
Codebase Legibility Refactor — preparing the codebase for human evaluation and bus-factor reduction
Has an open decision or design question that must be resolved before implementation can start.
Security hygiene — must be done first
Production-ready multi-stage Docker images
Production compose overlay + Caddy reverse proxy
Spring Boot production configuration profile
Database and object storage backup strategy
.env.example, DEPLOYMENT.md, runbook
Prometheus, Loki, Grafana, Alertmanager
Code restructuring without behaviour change
UI/UX and accessibility issues
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: marcel/familienarchiv#816
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "feat/issue-774-timeline-event-entity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #774.
Ships the foundational data model for the new
timelinedomain (Zeitstrahl milestone): entity + enum + repository + migration + ADR + docs. No service/controller/DTO — those land in later issues.⚠️ Renumber note
The issue body (and all 7 reviewers) said ADR-039 + V76, but both were claimed by the person life-dates work (#773) that merged on 2026-06-12, after the review. This PR uses the next free numbers: ADR-040 and V77. Using the issue's numbers would have produced a duplicate Flyway version (Flyway refuses to boot) and a duplicate ADR file. Per the issue author's instruction, the issue body was left as-is rather than patched.
What's here
timeline/EventType—PERSONAL/HISTORICAL, a stable frontend styling contract.timeline/TimelineEvent— date block mirrorsDocument(eventDate+precision+eventDateEnd); audit footprint deliberately diverges with@Version+ NOT NULLcreatedBy/updatedBy.precisionimportsdocument.DatePrecision(not duplicated), defaults toYEAR. Explicit@JoinTable+@BatchSizeon both ManyToMany collections.timeline/TimelineEventRepository— empty with aTODO(issue 5)marker.V77__add_timeline_events.sql— table + two join tables (all FK columnsON DELETE CASCADE),chk_timeline_event_range(biconditionaleventDateEndiff RANGE, intentionally stricter thanDocument),chk_timeline_event_precision(<> 'UNKNOWN'; SEASON/APPROX stay legal), and all FK + query-column indexes up-front (no V62-style retrofit).l3-backend-timeline.puml, db-orm + db-relationships ER diagrams).Tests (TDD red→green, Testcontainers
postgres:16-alpine, never H2)TimelineEventTest(17): required-field round-trip, YEAR default, linked persons/documents, eventDateEnd null/range, TEXT description (multi-KB), both RANGE-invariant rejections + UNKNOWN rejection (NOT_SUPPORTED),versionnull→0L, and a parameterized accept-side overDAY/MONTH/SEASON/YEAR/APPROX.TimelineEventCascadeIntegrationTest(2): deleting a linked Person/Document via the domain service drops the join row (directCOUNTcheck) and leaves the event intact.MigrationIntegrationTest(45) green — V77 boots clean in sequence.mvnw clean packagegreen.🤖 Generated with Claude Code
bed99ff3feto3a7c86fc87The issue body's milestone-relative ordinals ("issue 3", "issue 5") become unreadable once the milestone closes. Resolved against the Zeitstrahl milestone: issue 3 = #775 (CRUD API: service/controller/DTO), issue 5 = #777 (assembly endpoint with the per-person filter). Mapping anchored by issue 6 = #778 (date-label helper) and issue 9 = #781 (curator forms) in #774's forward notes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>Review fixes applied (4 commits,
3a7c86fc..bde12373)All four findings from the code review are addressed:
6ed5151e— dropped the two redundant join-table indexes.idx_timeline_event_persons_event_idandidx_timeline_event_documents_event_idduplicated the leading column of their composite PKs; Postgres already servestimeline_event_idlookups from the PK index. The inverse-side indexes (person_id,document_id) stay.⚠️ Deviates from the #774 task list, which asked for "explicit indexes on all four FK columns" — the two dropped ones were dead write overhead.
62b96f71—@Schema(requiredMode = REQUIRED)oncreatedBy/createdAt/updatedBy/updatedAt/version. All are populated on every persisted row; per the CLAUDE.md rule they must carry the annotation like the five domain fields already did.⚠️ Extends the #774 task list, which named only
id/title/type/eventDate/precision.bde12373— ADR-040 consequences now record the title-length guard obligation for #775 (TIMELINE_TITLE_TOO_LONG, mirroringGESCHICHTE_TITLE_TOO_LONG) so an over-long title doesn't ship as a raw 500.788a8048— relative issue ordinals pinned to real numbers across entity javadoc, repository TODO, ADR-040, and the C4 diagram: issue 3 = #775 (CRUD API), issue 5 = #777 (assembly endpoint / per-person filter). Mapping anchored by the unambiguous forward notes in #774 (issue 6 = #778 date-label helper, issue 9 = #781 curator forms).Verification:
TimelineEventTest17/17,MigrationIntegrationTest45/45 (edited V77 boots clean in sequence),ArchitectureTest13/13 — all green locally against Testcontainerspostgres:16-alpine.Note for anyone with a local dev DB that already ran this branch's V77: the migration file changed, so Flyway will report a checksum mismatch —
flyway repairor recreate the dev DB.🤖 Generated with Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.