Skip to content

fix(workflows): cross-role defects, venue linkage, claim resolution & 107-test E2E matrix - #61

Merged
Satelink-Protocol merged 3 commits into
mainfrom
fix/god-mode-workflow-reliability
Nov 23, 2026
Merged

Satelink-Protocol merged 3 commits into
mainfrom
fix/god-mode-workflow-reliability

Conversation

@Satelink-Protocol

Copy link
Copy Markdown
Contributor

Summary of Changes

This PR delivers end-to-end reliability, bug fixes, and safety hardening across all NIGHTLIFEZ user workflows (Attendee, Organiser, Venue Partner, Admin) as part of the God Mode engineering audit.

1. Admin Venue Management & Ownership Claims

  • Implemented and wired endpoints:
    • GET /api/admin/venues with support for ?status= filtering (cast PostgreSQL enum to text to prevent type comparison errors).
    • GET /api/admin/venue-claims with status filtering and pagination, selecting claimant_telegram_user_id from users.
    • POST /api/admin/venue-claims/:id/resolve supporting atomic approved (transfers venues.org_id to claimant org, grants manage_venue capability) and rejected decisions with full audit logging and RBAC (Super Admin only).
  • Aligned admin overview KPI metrics to query WHERE status = 'active' AND onboarding_completed = true.

2. Event-Venue Linkage

  • Added optional venueId to organiser draft schema (DraftData, CreateBody, UpdateEventBody).
  • Auto-populates venue name, city, and area when draft is created with a linked venue ID.
  • Persists events.venue_id and event_sessions.venue_id upon draft publishing.
  • Exposes venueId in public event serialization (toPublicEvent).
  • Connected Venue Command Centre buttons to /organiser/new?venue_id=${state.venueId}.

3. Attendee Booking & Ticketing Invariants

  • Enforced CSRF token validation on booking cancellations (requireCsrf(req, user)).
  • Enforced ticketing constraints in bookTier: min_per_booking, sales_start_at, and sales_end_at.
  • Released seat holds properly on attendee cancellation.

4. Venue Photos & HTTP Upload Stability

  • Added POST /api/venue/photos (uploadVenuePhotoApi) with 2MB limit and magic byte sniffing (PNG, JPEG, WebP).
  • Updated readRawBody and readBinaryBody to drain the incoming stream via req.resume() on 413 payload excess rather than abrupt socket destruction (req.destroy()), preventing ECONNRESET errors.

5. Discovery & Navigation Consistency

  • Added List Your Venue link in header navigation and footer.
  • Aligned venue queries across discovery and context to require v.status = 'active' AND v.onboarding_completed = true.

6. Automated Verification Matrix

  • Added comprehensive 107-scenario God-Mode workflow test suite (test/god-mode-e2e-workflow-matrix.test.js) spanning Sections A through H (Attendee, Organiser, Venue, Operations, Admin, Security, Mobile, Concurrency).
  • Verified full test suite: 1,204 tests passing, 0 failures.
  • Verified Playwright E2E suites: 4/4 venue dashboard tests passing, 7/7 multi-role acceptance tests passing.
  • Verified 0 linter errors across 225 files.

… e2e reliability

- Admin API: implement list and resolve endpoints for venue ownership claims and venues list with proper status casting and claimant fields
- Organiser & Events: support venue_id linkage during draft creation, update, and publish to events/event_sessions tables
- Venue: add venue photo upload endpoint with 2MB limit and magic byte sniffing; link venue command centre to organiser draft wizard
- Attendee Bookings: enforce CSRF protection on booking cancellations; enforce ticket tier min_per_booking, sales_start_at, and sales_end_at constraints
- HTTP & Network: handle oversized payload with 413 without socket abort (ECONNRESET)
- Test Matrix: add 107-scenario God-Mode E2E workflow matrix covering all roles, error conditions, and concurrency
@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
strangersmeetup Ready Ready Preview Nov 23, 2026 3:08pm UTC

…workflow matrix

- Enforce venue photo upload ownership binding, draft privacy isolation, and cleanup protection
- Enforce authoritative venue usage permissions on organiser drafts, updates, and publishing
- Protect venue ownership claims under super admin role and resolve claims atomically with audit logging
- Strengthen integration test matrix with true migration 031 idempotency and paid checkout fail-closed tests
- Add real browser Playwright E2E workflows in e2e/god-mode-workflows.spec.js
@Satelink-Protocol
Satelink-Protocol merged commit 1e1eb18 into main Nov 23, 2026
3 checks passed
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.

1 participant