Skip to content

Review 8 — Retention model: 24h regeneration window replaces delete-at-issuance - #32

Draft
ArneeMe wants to merge 1 commit into
claude/review-7-admin-englishfrom
claude/review-8-retention-window
Draft

Review 8 — Retention model: 24h regeneration window replaces delete-at-issuance#32
ArneeMe wants to merge 1 commit into
claude/review-7-admin-englishfrom
claude/review-8-retention-window

Conversation

@ArneeMe

@ArneeMe ArneeMe commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Stacked on #31 (part 8 of the review stack). Core-model change per your request — review together with #29, whose delete-at-issuance description this supersedes.

The change

Issuing a certificate no longer deletes the submission. Instead, the 24h retention sweep (time since creation) is the single deletion mechanism — issued or not. Admins can regenerate the PDF any time within the window (wrong printer, lost file, typo spotted late).

How it stays safe

  • Idempotent issuance: the certificates POST checks for an existing cert for that submission and returns it instead of minting a duplicate — so "Generer PDF" is safely re-clickable and never creates two cert rows for one submission.
  • The deletion guarantee is unchanged in bound: every submission is gone at most 24h after it was created (SUBMISSION_TTL_HOURS, one constant). The sweep is documented in CLAUDE.md as load-bearing.
  • Dashboard: issued submissions stay listed with a green Utstedt chip (seeded from the cert list, so it survives reloads) next to the deletion countdown; batch flow keeps them regenerable too.
  • All user-facing copy updated in both languages: confirm/done dialogs, the volunteer confirmation screen, landing, /om, /personvern, plus CLAUDE.md and README.

One trade-off to be aware of

The window is measured from submission, not issuance — a submission issued at hour 23 has only 1h of regeneration left. If you'd rather have "24h after issuance", say so and I'll rework the sweep to track an expiry timestamp instead; that needs a small column migration.

Verification

Typecheck, lint, 110 unit tests, 8 E2E, production build — all green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BFHkXUuHJME4cF9AJWbavB


Generated by Claude Code

Product decision: admins need to regenerate a PDF after issuing (wrong
printer, lost file, typo spotted). Issuing a certificate therefore no
longer deletes the submission — the 24h retention sweep (time since
creation) is now the single deletion mechanism, issued or not.

- Certificates POST no longer deletes; it is idempotent per submission,
  returning the existing cert on re-issue instead of minting duplicates.
- Certificates GET now includes submissionId so the dashboard can mark
  already-issued submissions with an 'Utstedt' chip after reload and
  keep them regenerable until expiry.
- Dashboard: issued submissions stay in the list (chip + countdown);
  single and batch flows simplified accordingly.
- All copy updated in both languages (dialogs, confirmation screen,
  landing, /om, /personvern), plus CLAUDE.md (deletion is TIME-based,
  sweep is load-bearing) and README.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BFHkXUuHJME4cF9AJWbavB
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying inf319-certificate with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2965e7f
Status: ✅  Deploy successful!
Preview URL: https://5f78ede1.inf319-certificate.pages.dev
Branch Preview URL: https://claude-review-8-retention-wi.inf319-certificate.pages.dev

View logs

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.

2 participants