Skip to content

Tickets: erase each event's pretix data after the post-event hold - #2672

Merged
peterdrier merged 7 commits into
mainfrom
claude/pretix-event-shred
Nov 28, 2026
Merged

peterdrier merged 7 commits into
mainfrom
claude/pretix-event-shred

Conversation

@peterdrier

Copy link
Copy Markdown
Owner

Requested by Peter · project thread

What

After an event's post-event hold, Humans asks its ticketing platform once to erase the event's personal data. For pretix that runs pretix's event shredder, which clears the order log's old emails and the Stripe plugin's billing details. Peter said yes to this on 2026-11-27 and asked for the 30-day hold to be a setting.

  • ITicketingPlatform.EraseEventPersonalDataAsync(string? platformEventRef). pretix takes the shop offline if it is live (pretix shreds only an event that is over and offline), exports with every shredder the event lists, then shreds and polls (409 means wait) until pretix confirms. Any other answer throws. Box Office and Hi.Events do nothing: Box Office keeps nothing per event, and Hi.Events' per-order anonymise already scrubs its copy.
  • New TicketEventErasureJob, daily at 05:00 UTC (after the midnight account deletions, so holders whose deletion was held get erased from their orders first). It sets ticket_sales_events.PersonalDataErasedAt and audits TicketEventPersonalDataErased. A failure is logged and retried on the next run.
  • Post-event hold (days) on /Settings#tickets (ticket_settings.PostEventHoldDays, null reads as 30, audited as TicketPostEventHoldSet). It sets both the ticket-holder deletion hold and the shred date, so the shred never runs before the deletions it has to follow.
  • deploy/pretix/bootstrap.py adds event.settings.general:write to the API team, so Humans can take a shop offline.

Why

Erasing a pretix buyer was never complete: pretix's API can't delete the order log entry or the payment billing details, and only the event shredder removes them (Fixes #2623).

Existing surface checked

One new interface method on ITicketingPlatform (Peter approved it on #2623). The setting reuses the ticket_settings singleton and the existing Tickets settings tab instead of adding a new settings store. The audit and job follow TicketResaleRefundJob. The hold-date calculation is the existing TicketQueryService.PostEventHoldDate, made internal and given the day count.

Checklist

  • Review tier: tier:standard.
  • No migration edited by hand: 20261127152902_TicketEventPersonalDataErasure was generated by dotnet ef migrations add. The snapshot also picks up earlier property renames (HasColumnName) that main's snapshot had not recorded; these are not schema changes. has-pending-model-changes is clean.
  • No NOT NULL column: both new columns are nullable.
  • Section: Tickets, Pretix (plus no-op methods in Box Office and Hi.Events).
  • Targeting main on peterdrier/Humans, branched off origin/main, issue refs qualified.
  • NuGet / new rule none.
  • Reuse-first checked (above).
  • dotnet build Humans.slnx -v quiet and the full dotnet test Humans.slnx -v quiet pass (re-ran Pretix and Tickets after merging main).
  • Nav: the setting sits in the existing /Settings#tickets tab. That page is admin-only, so it has no localization.
  • NodaTime throughout.

Reviewer notes

  • Needs doing before the first hold passes: re-run bootstrap.py (or give the pretix "Humans API" team event.settings.general:write), or the offline step answers 403 and the job logs a failure every day.
  • pretix's docs don't say which permission the shredder endpoints need. If event.orders:write isn't enough, the job's warning log says so.
  • The pretix calls follow https://docs.pretix.eu/dev/api/resources/shredders.html. They are tested against a fake pretix, not a live one.
  • Changing the hold affects new deletion requests and the shred date. Deletions already scheduled keep the date they were given.

Closes

Fixes #2623


Generated by Claude Code

Adds ITicketingPlatform.EraseEventPersonalDataAsync. pretix runs its event
shredder (taking the shop offline first); Box Office and Hi.Events keep
nothing per event. A daily Tickets job calls it once per event after the
hold, records PersonalDataErasedAt and audits it. The hold (30 days) is now
a setting on /Settings#tickets and drives the deletion hold too.

Fixes #2623

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0186neA3sf8No56EAXqksPWs
@peterdrier peterdrier self-assigned this Nov 27, 2026
@peterdrier

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T15:55:09.188187Z e43cfe4 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2787a4cd03

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions github-actions Bot added the db PR includes EF Core migration label Nov 27, 2026
@github-actions

Copy link
Copy Markdown

Reviewed commit 2787a4c. 1 inline finding(s) posted.

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

PR Surface Report

Compared b6328d52...69a011ce. Scored with reforge 0.34.0.

Summary: 32 changed file(s) | EF migrations: 1 added file(s), max 1/1 per context

Reforge Surface Score

metric base head delta
total 76099 76246 +147
surface 17005 17017 +12

Section Deltas

section base head delta
Tickets 7490 7609 +119
Pretix 317 337 +20
BoxOffice 134 138 +4
HiEvents 226 230 +4

Section Size & Complexity Deltas

section LOC delta files delta classes delta cognitive p95 delta
BoxOffice +3 0 0 0
HiEvents +3 0 0 0
Pretix +47 0 0 0
Tickets +147 +1 +2 0
Corpus +200 +1 +2 0

Corpus is the solution-wide rollup (same source as Corpus Size & Complexity below), not a sum of the section rows above - cognitive p95 in particular doesn't compose across sections.

Rule Deltas

rule base head delta
classSize 6958 7004 +46
sectionSize 9498 9542 +44
methodCount 19314 19338 +24
methodComplexity 22178 22199 +21
exportedWriteMethod 1788 1800 +12

Corpus Size & Complexity

metric base head delta
locProd 202974 203174 +200
methods 8998 9011 +13
classes 3650 3652 +2
files 2548 2549 +1

At head: largest class Service, most complex method Service.BookOneTransferAsync.

Published Write Surface

16 of 57 sections publish write capability, 48 interfaces (0).

Interface Surface

Added interface methods

ITicketingPlatform

  • Task EraseEventPersonalDataAsync(string? platformEventRef, CancellationToken ct = default)

Diff Size

bucket added deleted
code 254 10
migrations 281 182
tests 121 0
docs 9 11
other 4 2

New Files

  • src/Sections/Humans.Tickets/Data/Migrations/20261127152902_TicketEventPersonalDataErasure.Designer.cs
  • src/Sections/Humans.Tickets/Data/Migrations/20261127152902_TicketEventPersonalDataErasure.cs
  • src/Sections/Humans.Tickets/Jobs/TicketEventErasureJob.cs
  • tests/Humans.Tickets.Tests/Services/Checkout/TicketCheckoutServiceEventErasureTests.cs

EF Migrations (OK)

  • src/Sections/Humans.Tickets/Data/Migrations/20261127152902_TicketEventPersonalDataErasure.cs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0186neA3sf8No56EAXqksPWs
@peterdrier

Copy link
Copy Markdown
Owner Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: e43cfe4faa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

Copy link
Copy Markdown

This PR has a merge conflict with main. Merge origin/main into the branch and resolve the conflicts. The merge-conflict label comes off automatically once it merges cleanly.

…hred

# Conflicts:
#	src/Sections/Humans.Tickets/Services/Checkout/ITicketCheckoutService.cs
#	tests/Humans.Tickets.Tests/Services/Checkout/TicketCheckoutServiceTests.cs
@peterdrier
peterdrier merged commit 61b0c73 into main Nov 28, 2026
14 checks passed
peterdrier pushed a commit that referenced this pull request Nov 28, 2026
Fixes main's build: #2672 and #2614 crossed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0186neA5yDYsREy6AJ7HhDer
peterdrier added a commit that referenced this pull request Nov 28, 2026
…napshot (#2790)

TicketEventPersonalDataErasure (#2672) was generated before
DropRetiredChildPriceColumns (#2565) merged, so its Designer still lists
ChildMaxAge/ChildPriceMinor. Both are merged and applied on QA, so they
stay frozen. This EF-generated no-op on top gives the chain a newest
Designer identical to the snapshot, which the prod promotion check needs.
No schema change; has-pending-model-changes reports none.


Claude-Session: https://claude.ai/code/session_0186neA6Nex6SZVTX9rownkq

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db PR includes EF Core migration section:tickets tier:standard Normal review cycle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pretix: shred each event's personal data after the 30-day hold

2 participants