Skip to content

feat(grz-db): add cases table and pluggable case resolver#633

Open
Hoeze wants to merge 4 commits into
mainfrom
feat/cases-tracking
Open

feat(grz-db): add cases table and pluggable case resolver#633
Hoeze wants to merge 4 commits into
mainfrom
feat/cases-tracking

Conversation

@Hoeze

@Hoeze Hoeze commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Introduces case tracking so multiple submissions can be grouped into one case (an initial submission plus its addition/correction/followup for the same patient/case).

The authoritative case identity is the RKI pseudonym (psn), unique once assigned; (submitter_id, local_case_id) are non-unique resolution keys used until a pseudonym exists. Case lookup is a pluggable strategy (SubmitterLocalCaseResolver today, PsnResolver for the future PSN-based flow). submitter_id stays on submissions.

feat(grzctl): add db case commands and link submissions to cases on populate

Adds grzctl db case (list/show/modify/create/relink/delete) and links each submission to its case during db submission populate, enforcing that a new case starts with an initial (or test) submission and that at most one initial exists per case. A new Alembic migration adds the cases table and a nullable submissions.case_id, backfills existing submissions by grouping on (submitter_id, pseudonym), and keeps submitter_id on submissions. Deploying requires grzctl db upgrade.

Fixes #632

@Hoeze Hoeze marked this pull request as ready for review July 9, 2026 23:00
@Hoeze Hoeze force-pushed the feat/cases-tracking branch from c044a98 to 88d6216 Compare July 9, 2026 23:26
@Hoeze Hoeze force-pushed the feat/cases-tracking branch from 354c3fe to ca220c0 Compare July 10, 2026 10:33
@Hoeze Hoeze requested a review from tedil July 10, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(grz-db): add cases table and link submissions to cases

1 participant