Make event creation atomic and reconcile event data contracts - #5
Draft
moirakk wants to merge 4 commits into
Draft
Make event creation atomic and reconcile event data contracts#5moirakk wants to merge 4 commits into
moirakk wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make organizer event creation transactional, preserve authenticated identity through PostgreSQL, and align event reads with the canonical Supabase schema.
What Changed
create_event_atomicdatabase RPC.events.registered_countcolumn.get_public_event_registration_counts, a narrow aggregate RPC that exposes capacity usage without participant rows.Why
The previous route could leave partial records when a later write failed. Read adapters also depended on a denormalized column outside the canonical schema. This PR gives creation one success-or-rollback boundary and derives capacity usage from active registrations.
Risk Level
This changes a core write path and adds database functions. The migrations are applied to the approved clean-dev project and the real integration suite passes. The PR remains Draft only for the final organizer browser smoke test.
Product / Workflow Area
Verification
npm run verify— 125/125 testsnpm run build— production build clean, 39 routes generatedgit diff --checkoxbrxkllftyevlzmiydtLive Validation Coverage
Data, Permission, And Security Notes
auth.uid().