Skip to content

Overnight B2 — swap-claim marketplace - #202

Merged
tomqwu merged 2 commits into
mainfrom
overnight-B2-swap-marketplace
May 19, 2026
Merged

tomqwu merged 2 commits into
mainfrom
overnight-B2-swap-marketplace

Conversation

@tomqwu

@tomqwu tomqwu commented May 19, 2026

Copy link
Copy Markdown
Owner

Summary

Completes the swap workflow end-to-end. /v/swaps lists swap_requested assignments in the volunteer's org (excluding their own requests, past events, and events they're already on). POST /v/swaps/{id}/claim transfers the assignment to the claimer (person_id→claimer, status→confirmed, decline_reason cleared), re-validated server-side & org-scoped. Previously a swap could only be admin-approved/denied (P1.11) — now another volunteer can actually cover it. Linked from /v/open.

Part of #196 (Phase B).

Test plan

  • black --check api tests / ruff check api tests clean
  • tests/web/test_swap_marketplace.py (5) — auth gate, transfer + requester-doesn't-see-own, already-on-event blocked, non-swap blocked, /v/open links to it
  • pytest tests/web — 200 passed
  • tests/e2e/test_swap_marketplace.py — multi-actor (admin + 2 isolated volunteer contexts): A claims → requests swap → B covers → B's schedule shows it, A's doesn't. Full e2e suite (smoke+B1+B2) green locally (8.7s)
  • CI: ci + blocking e2e lanes green

Closes #201

🤖 Generated with Claude Code

Volunteers can cover a teammate: /v/swaps lists swap_requested
assignments in their org (not their own, future, events they're not
on). POST /v/swaps/{id}/claim transfers the assignment to the claimer
(person_id→claimer, status→confirmed, decline_reason cleared),
re-validated server-side & org-scoped — completes the swap workflow
end-to-end (previously admin approve/deny only). Linked from /v/open.

Committed multi-actor e2e (tests/e2e/test_swap_marketplace.py): admin
event → Vol A claims → A requests swap → Vol B covers it → B's
schedule shows it, A's doesn't. + 5 web tests.

Closes #201

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tomqwu tomqwu added this to the Overnight — e2e workflows milestone May 19, 2026
@tomqwu tomqwu added the overnight Overnight e2e-workflow marathon (2026-05) label May 19, 2026
The swap-marketplace flow clicked Claim then immediately navigated to
/v/schedule without waiting for the HTMX POST to commit, so the
assignment was not yet persisted under CI's slower timing (passed
locally on a fast machine). Mirror B1's proven synchronization by
waiting for the open-list to show "No open shifts" before navigating.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tomqwu
tomqwu merged commit 4297e2f into main May 19, 2026
5 checks passed
@tomqwu
tomqwu deleted the overnight-B2-swap-marketplace branch May 19, 2026 16:22
@tomqwu tomqwu mentioned this pull request May 19, 2026
16 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

overnight Overnight e2e-workflow marathon (2026-05)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

B2 — swap-claim marketplace (/v/swaps)

1 participant