Bug: sign endpoint doesn't create outbox event — no confirmation email or GroupMe link #6

Closed
opened 2026-03-24 18:38:23 +00:00 by forgejo_admin · 0 comments

Type

Bug

Lineage

plan-wkq → Phase 14 (Billing Tiers & Contracts) — discovered during contract send-out validation

Repo

forgejo_admin/westside-contracts

What Broke

The POST /contract/{token}/sign endpoint updates the player record directly in Postgres but does NOT insert an outbox event. The basketball-api outbox worker (services/outbox.py) is what triggers the confirmation email with GroupMe share link. Without the outbox event:

  • No confirmation email is sent to the parent
  • No GroupMe team link is delivered
  • No email_log entry is created
  • The outbox-based flow tested via basketball-api (outbox id 1, player 155) worked, but the westside-contracts UI path is completely disconnected

Repro Steps

  1. Navigate to westside-contracts.tail5b443a.ts.net/contract/{token} for any test player
  2. Sign the contract (checkbox, signature pad, legal name)
  3. Success overlay appears
  4. Check outbox table — no new event created
  5. Check parent email — no confirmation email received
  6. Check email_log table — no new entry

Expected Behavior

After signing via the contract UI:

  1. Player record updated to contract_status = 'signed' (works today)
  2. Signature uploaded to MinIO (works today)
  3. Outbox event inserted in same DB transaction with {event_type: 'contract_signed', tenant_id: 1, payload: {player_id, player_name, team_id, parent_id}, status: 'pending'}
  4. HTTP POST to basketball-api /admin/process-outbox?tenant_id=1 triggers immediate processing
  5. Welcome email with GroupMe link sent to parent

Environment

  • Cluster/namespace: prod / westside-contracts
  • Service version/commit: 31cebfd (latest on main)
  • Related alerts: none — silent failure

Acceptance Criteria

  • Signing via contract UI creates an outbox event in the outbox table
  • Outbox event triggers confirmation email to parent
  • Confirmation email contains correct team GroupMe share link
  • email_log entry created with type contract_signed
  • No regression in direct DB fields (contract_status, signature_url, etc.)
  • project-westside-basketball — project this affects
  • forgejo_admin/westside-app #73 — Send travel team contracts (blocked by this)
  • forgejo_admin/westside-app #74 — Send local team contracts (blocked by this)
### Type Bug ### Lineage `plan-wkq` → Phase 14 (Billing Tiers & Contracts) — discovered during contract send-out validation ### Repo `forgejo_admin/westside-contracts` ### What Broke The `POST /contract/{token}/sign` endpoint updates the player record directly in Postgres but does NOT insert an outbox event. The basketball-api outbox worker (`services/outbox.py`) is what triggers the confirmation email with GroupMe share link. Without the outbox event: - No confirmation email is sent to the parent - No GroupMe team link is delivered - No `email_log` entry is created - The outbox-based flow tested via basketball-api (outbox id 1, player 155) worked, but the westside-contracts UI path is completely disconnected ### Repro Steps 1. Navigate to `westside-contracts.tail5b443a.ts.net/contract/{token}` for any test player 2. Sign the contract (checkbox, signature pad, legal name) 3. Success overlay appears 4. Check `outbox` table — no new event created 5. Check parent email — no confirmation email received 6. Check `email_log` table — no new entry ### Expected Behavior After signing via the contract UI: 1. Player record updated to `contract_status = 'signed'` (works today) 2. Signature uploaded to MinIO (works today) 3. Outbox event inserted in same DB transaction with `{event_type: 'contract_signed', tenant_id: 1, payload: {player_id, player_name, team_id, parent_id}, status: 'pending'}` 4. HTTP POST to basketball-api `/admin/process-outbox?tenant_id=1` triggers immediate processing 5. Welcome email with GroupMe link sent to parent ### Environment - Cluster/namespace: prod / westside-contracts - Service version/commit: `31cebfd` (latest on main) - Related alerts: none — silent failure ### Acceptance Criteria - [ ] Signing via contract UI creates an outbox event in the `outbox` table - [ ] Outbox event triggers confirmation email to parent - [ ] Confirmation email contains correct team GroupMe share link - [ ] `email_log` entry created with type `contract_signed` - [ ] No regression in direct DB fields (contract_status, signature_url, etc.) ### Related - `project-westside-basketball` — project this affects - `forgejo_admin/westside-app #73` — Send travel team contracts (blocked by this) - `forgejo_admin/westside-app #74` — Send local team contracts (blocked by this)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/westside-contracts#6
No description provided.