feat(person): add birth year and death year fields #18
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
User Journey
Marie is researching her great-grandmother Hedwig. She opens the person page and wants to understand who Hedwig was before reading any documents. Currently the page shows only a name — no indication of when Hedwig lived. Marie has to piece together the timeline from individual documents.
With this feature, Marie sees " 1889 · † 1952"* directly under the name. She immediately understands the historical context before reading a single letter.
High-Level Plan
Add two optional integer fields
birthYearanddeathYearto thePersonentity. Expose them in the edit form and display them in view mode. No complex date logic — years only.Layers touched: Flyway migration → JPA entity → DTO → OpenAPI types → frontend form + display.
Detailed Plan
Backend
Migration
V{n}__add_person_birth_death_years.sql:Personentity — add two nullable fields:PersonUpdateDTO— add optional fields:PersonService.update()— map the new fields from DTO to entity.Rebuild JAR and run
npm run generate:apiinfrontend/.Frontend
Edit form (
persons/[id]/+page.svelte) — add two number inputs in a new row:birthYear, type=number, min=1000, max=2100, optional)deathYear, same constraints, optional)View mode — display below the name if present:
Hide the row entirely when both are null.
+page.server.tsupdateaction — parse and forwardbirthYear/deathYearfrom form data.Acceptance Criteria
birthYear > deathYearshows a validation error on save