You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Co-organizers: invite editors to a campaign (money stays with the owner) #253
JOY (2026-11-19) asked for parity with GoFundMe (team fundraising, co-organizers). Today one DOS ID account owns a campaign alone.
Scope (v1)
give.campaign_members (campaign_id, user_id, role editor, invited_by, accepted_at) in DOS/DOS.Me migrations, RLS and pgTAP.
The owner invites by link (single use, expires); the invitee accepts while signed in; the owner removes members.
Editors may edit content while the campaign is editable, manage milestones, media and reward tiers within the same rules as the owner, post updates, and answer or hide comments.
Money stays with the owner only: receiving accounts, statements, disbursements, refunds, fulfillment data with donor contact details, submitting for review. Every money RPC keeps its current owner check; add tests proving an editor is refused.
The campaign page shows the team.
Out of scope
Ownership transfer, team fundraising pages with per-member totals.
Done when
On beta: an owner invites an editor who edits content and posts an update but is refused on every money page and RPC; tests pass.
Campaigns PO (line:campaigns): filed the DOS/DOS.Me database prerequisite as #264 (line:platform -> Give Product Owner). Ready to build the apps/web co-organizer invite, editor workspace guards, and public team block as soon as #264 lands on DOS.Medev.
DOS/Give#264 database prerequisite is now merged into DOS/DOS.Medev via https://github.com/DOS/DOS.Me/pull/1856 (supabase/migrations/20261129170000_give_campaign_members.sql, 172 pgTAP assertions in supabase/tests/database/give_campaign_members.test.sql).
RPC Signatures & Return Shapes (schema: give)
All authenticated RPCs use auth.uid() from the user JWT (dbAs(session.accessToken).rpc(...) — never pass a spoofable actor id).
Now returns campaigns where the caller is the owner, an accepted editor, or staff, preserving SETOF give.campaigns so existing PostgREST embeds (.select(CAMPAIGN_WITH_REFS)) keep working unchanged.
Returns role IN ('owner', 'editor') for the caller (filtered to up to 200 ids when p_campaign_ids is passed). Use this (alongside campaign.organizer_id === session.user.id) to hide owner-only controls in /me/campaigns and /me/campaigns/[id].
Returns the 64-char hex raw tokenonce (only SHA-256 hash is stored; never logged). Caps: max 20 active members, max 20 active pending invites, expiry 1–720 hours, note <= 120 chars, rate limit 30/hour per campaign and 60/hour per owner.
give.revoke_campaign_member_invite(p_invite_id uuid) RETURNS text (authenticated, owner-only)
Returns 'revoked' (idempotent on already-revoked invites).
status IN ('pending', 'revoked', 'accepted', 'expired', 'unavailable', 'invalid'). Only populates campaign metadata when status = 'pending'; all non-pending statuses return NULL metadata (no draft title leak).
Single-use atomic consumption while signed in. Token cannot be replayed even after removal. Accidental click by owner or already-accepted editor raises an error without consuming the link.
give.remove_campaign_member(p_campaign_id uuid, p_user_id uuid) RETURNS text (authenticated, owner-only)
Returns 'removed'; immediately revokes all editor permissions and serializes with concurrent editor writes.
Returns rows only for public-status campaigns (give.is_public_status). Owner is ordered first (member_role = 'owner'), followed by accepted editors (member_role = 'editor') ordered by joined_at ASC. Never exposes user_id, legal_name, phone, email, private dos_name handles, or deleted/inactive profile metadata.
Capability Boundary
Accepted editor allowed (same status rules as owner):
Read campaign in managed_campaigns, campaigns, campaign_media, campaign_milestones, campaign_updates, campaign_status_events, reward_tiers.
Update editable campaign content (give.campaigns while draft / changes_requested; column grants still block organizer_id, status, review_note, allow_monthly, payment columns).
Manage give.campaign_milestones while draft / changes_requested.
Manage give.reward_tiers via save_reward_tier, delete_reward_tier, reorder_reward_tiers (draft / changes_requested) and retire_reward_tier (same status rules as owner).
Insert, update, publish, and delete their own unpublished give.campaign_updates (not cancelled / suspended); cannot edit/delete owner/other-editor drafts or published updates.
Strictly owner-only (editors refused at DB RLS + RPC layers):
checkpoint: session=532bdd1f-f159-4548-8a59-a47af6a07c07 PR #298 opened into dev at 16f7c58ea96bef7b7680145cf0b208f8788f190e (rebased onto origin/dev after #250 and #251). Local checks pass (format:check, lint, typecheck, build, 179/179 Vitest files / 2,619 tests). Running independent security & DESIGN.md review and CI checks.
checkpoint: session=532bdd1f-f159-4548-8a59-a47af6a07c07 PR #298 squash-merged into dev at 4a07a3da7ad47c8cf4c1cce651b4ed25d34cd12c (head SHA 25aeabac45cb2678e41d21607c7bbc7fcfbc9e63 after PO acceptance). Vercel dev/beta (https://beta.give.vn) deployment completed: https://vercel.com/metados/give/8ezVFYbejtyjwFWeyfJfXC7Ukcf7. Keeping #253 open for Production promotion (dev -> main) by Give Product Owner once DOS/DOS.Me#1856 reaches main and JOY approves.
Done: Implemented apps/web co-organizers (editors) for DOS/Give#253 in PR #298 (#298), squash-merged into DOS/Givedev at 4a07a3da7ad47c8cf4c1cce651b4ed25d34cd12c (head SHA 25aeabac45cb2678e41d21607c7bbc7fcfbc9e63, PO acceptance posted). Worktree /Users/JOY/Projects/Give/.claude/worktrees/253-co-organizers and local branch removed.
Evidence: Local pnpm format:check, pnpm lint, pnpm typecheck, pnpm build, and 180/180 Vitest files (2,620/2,620 tests) passed. PR #298 required checks (Verify build / Lint, Verify build / Build all apps) passed on 25aeabac45cb2678e41d21607c7bbc7fcfbc9e63. Independent fresh-context security/code review + PO flagship review approved with 0 blocking findings. Vercel dev/beta (https://beta.give.vn) deployment completed: https://vercel.com/metados/give/8ezVFYbejtyjwFWeyfJfXC7Ukcf7.
Remaining: Beta end-to-end verification (owner invites editor, editor edits content/posts update and is refused on money surfaces) and Production promotion (dev -> main / give.vn) handled by Give Product Owner (Claude PO) once DOS/DOS.Me#1856 reaches main and JOY approves.
Next step: Coordinate beta E2E verification and Production promotion with Give Product Owner when DOS/DOS.Me#1856 is promoted to main.
Blockers: DOS/DOS.Me#1856 (20261129170000_give_campaign_members.sql) promotion to DOS/DOS.Memain + JOY Production approval (cleared by Give Product Owner / JOY).
Branch: antigravity/253-co-organizers merged into dev at 4a07a3da7ad47c8cf4c1cce651b4ed25d34cd12c.
claim: executor=Antigravity session=83b36fa6-8c08-49d6-aeec-63bab02a5e52 scope="Production steps, waiting for Claude PO (Give Product Owner) DOS/DOS.Me#1856 + #298 dev -> main promotion" branch=antigravity/253-co-organizers target=2026-11-28
checkpoint: session=83b36fa6-8c08-49d6-aeec-63bab02a5e52 waiting for Production promotion (DOS/DOS.Me main then DOS/Give main / give.vn) by Give Product Owner (Claude Code) after JOY approval; #298 merged at 4a07a3d and deployed to https://beta.give.vn (Vercel success).
Activity
JOY commentedon Nov 18, 2026
Campaigns PO (
line:campaigns): filed theDOS/DOS.Medatabase prerequisite as #264 (line:platform->Give Product Owner). Ready to build theapps/webco-organizer invite, editor workspace guards, and public team block as soon as#264lands onDOS.Medev.JOY commentedon Nov 22, 2026
DOS/Give#264database prerequisite is now merged intoDOS/DOS.Medevvia https://github.com/DOS/DOS.Me/pull/1856 (supabase/migrations/20261129170000_give_campaign_members.sql, 172 pgTAP assertions insupabase/tests/database/give_campaign_members.test.sql).RPC Signatures & Return Shapes (
schema: give)All authenticated RPCs use
auth.uid()from the user JWT (dbAs(session.accessToken).rpc(...)— never pass a spoofable actor id).Discover role & managed campaigns
give.managed_campaigns(p_campaign_id uuid DEFAULT NULL) RETURNS SETOF give.campaigns(authenticated)editor, or staff, preservingSETOF give.campaignsso existing PostgREST embeds (.select(CAMPAIGN_WITH_REFS)) keep working unchanged.give.my_campaign_roles(p_campaign_ids uuid[] DEFAULT NULL) RETURNS TABLE (campaign_id uuid, role text)(authenticated)role IN ('owner', 'editor')for the caller (filtered to up to 200 ids whenp_campaign_idsis passed). Use this (alongsidecampaign.organizer_id === session.user.id) to hide owner-only controls in/me/campaignsand/me/campaigns/[id].give.is_campaign_editor(p_campaign_id uuid) RETURNS boolean/give.can_edit_campaign(p_campaign_id uuid) RETURNS boolean(anon, authenticated, service_role) — reusable for editor comment reply/hide once#250lands.Invite lifecycle & member management
give.create_campaign_member_invite(p_campaign_id uuid, p_expires_in_hours integer DEFAULT 168, p_note text DEFAULT NULL) RETURNS TABLE (invite_id uuid, token text, expires_at timestamptz)(authenticated, owner-only)tokenonce (only SHA-256 hash is stored; never logged). Caps: max 20 active members, max 20 active pending invites, expiry 1–720 hours, note <= 120 chars, rate limit 30/hour per campaign and 60/hour per owner.give.revoke_campaign_member_invite(p_invite_id uuid) RETURNS text(authenticated, owner-only)'revoked'(idempotent on already-revoked invites).give.preview_campaign_member_invite(p_token text) RETURNS TABLE (status text, campaign_id uuid, campaign_slug text, campaign_title text, organizer_display_name text, role text, expires_at timestamptz)(authenticated, service_role)status IN ('pending', 'revoked', 'accepted', 'expired', 'unavailable', 'invalid'). Only populates campaign metadata whenstatus = 'pending'; all non-pending statuses returnNULLmetadata (no draft title leak).give.accept_campaign_member_invite(p_token text) RETURNS TABLE (campaign_id uuid, campaign_slug text, role text, accepted_at timestamptz)(authenticated)give.remove_campaign_member(p_campaign_id uuid, p_user_id uuid) RETURNS text(authenticated, owner-only)'removed'; immediately revokes all editor permissions and serializes with concurrent editor writes.give.list_campaign_members(p_campaign_id uuid) RETURNS TABLE (user_id uuid, role text, display_name text, avatar_url text, invited_by uuid, accepted_at timestamptz, created_at timestamptz)(authenticated, owner & staff only)email,phone,legal_name; suppresses deleted/inactive profile & metadata fields ('Co-organizer'/NULLavatar).give.list_campaign_member_invites(p_campaign_id uuid) RETURNS TABLE (invite_id uuid, campaign_id uuid, role text, note text, expires_at timestamptz, accepted_at timestamptz, accepted_by uuid, accepted_by_display_name text, revoked_at timestamptz, created_at timestamptz, status text)(authenticated, owner & staff only)token_hash; suppresses deleted/inactive invitee metadata.Public campaign team display (
/campaigns/[slug])give.campaign_public_team(p_campaign_id uuid) RETURNS TABLE (member_role text, display_name text, avatar_url text, kind text, verification_status text, joined_at timestamptz)(anon, authenticated, service_role)give.is_public_status). Owner is ordered first (member_role = 'owner'), followed by accepted editors (member_role = 'editor') ordered byjoined_at ASC. Never exposesuser_id,legal_name,phone,email, privatedos_namehandles, or deleted/inactive profile metadata.Capability Boundary
editorallowed (same status rules as owner):managed_campaigns,campaigns,campaign_media,campaign_milestones,campaign_updates,campaign_status_events,reward_tiers.give.campaignswhiledraft/changes_requested; column grants still blockorganizer_id,status,review_note,allow_monthly, payment columns).give.campaign_milestoneswhiledraft/changes_requested.give.reward_tiersviasave_reward_tier,delete_reward_tier,reorder_reward_tiers(draft/changes_requested) andretire_reward_tier(same status rules as owner).give.campaign_updates(notcancelled/suspended); cannot edit/delete owner/other-editor drafts or published updates.receiving_accounts,account_bindings,account_swap_requests,bind_receiving_account,release_account_binding,request_account_swap,cancel_account_swap,campaigns_waiting_for_account).statement_import_batches,statement_import_rows,stage_statement_import,bank_transactions,transaction_matches,match_transaction).disbursements,disbursement_evidence,ledger_entries,campaign_paid,record_disbursement,add_disbursement_evidence).contributionsshipping/guest PII reads,set_pledge_fulfillment).set_campaign_monthly,campaign_plan_supporters).transition_campaignsubmitForReview/cancelCampaign,DELETE FROM give.campaigns).create/revoke/list_campaign_member_invites,list/remove_campaign_member).Error Codes (
GIVE_*)GIVE_AUTH_REQUIRED(42501): unauthenticated callerGIVE_CAMPAIGN_OWNER_ONLY(42501): non-owner calling owner-only team/invite RPC (uniform across missing campaign/invite ids to prevent enumeration)GIVE_CAMPAIGN_NOT_INVITABLE: <status>(23514): campaign iscancelledorsuspendedGIVE_INVITE_EXPIRY_INVALID(23514):p_expires_in_hoursoutside1..720GIVE_INVITE_NOTE_TOO_LONG(23514):p_noteexceeds 120 charsGIVE_CAMPAIGN_MEMBER_LIMIT: 20(23514): campaign already has 20 accepted editorsGIVE_CAMPAIGN_INVITE_LIMIT: 20(23514): campaign already has 20 active pending invitesGIVE_RATE_LIMITED: <seconds>(PT429): invite creation rate limit exceeded (30/hr per campaign, 60/hr per owner)GIVE_INVITE_INVALID(P0002): malformed or unknown tokenGIVE_INVITE_REVOKED(23514): invite was revokedGIVE_INVITE_ALREADY_USED(23514): single-use invite already consumed (cannot be replayed even after removal)GIVE_INVITE_ALREADY_ACCEPTED(23514): cannot revoke an already-accepted inviteGIVE_INVITE_EXPIRED(23514): invite pastexpires_atGIVE_ALREADY_CAMPAIGN_OWNER(23514): owner clicked their own invite (token not consumed)GIVE_ALREADY_CAMPAIGN_MEMBER(23505): caller is already an accepted editor (token not consumed)GIVE_CAMPAIGN_MEMBER_NOT_FOUND(P0002): user is not a member of the campaignGIVE_CAMPAIGN_NOT_EDITABLE(42501): campaign status is not editable or editor membership was revokedJOY commentedon Nov 22, 2026
claim: executor=Antigravity session=532bdd1f-f159-4548-8a59-a47af6a07c07 scope="apps/web co-organizer invites, editor workspace guards, /me/campaigns/[id] team tab & public team block" branch=antigravity/253-co-organizers target=2026-11-22
JOY commentedon Nov 22, 2026
checkpoint: session=532bdd1f-f159-4548-8a59-a47af6a07c07 PR #298 opened into
devat16f7c58ea96bef7b7680145cf0b208f8788f190e(rebased ontoorigin/devafter #250 and #251). Local checks pass (format:check,lint,typecheck,build, 179/179 Vitest files / 2,619 tests). Running independent security & DESIGN.md review and CI checks.fix(web): address independent review findings for #253 co-organizers
feat(web): co-organizers invites, editor workspace guards, team tab &…
JOY commentedon Nov 22, 2026
checkpoint: session=532bdd1f-f159-4548-8a59-a47af6a07c07 PR #298 squash-merged into
devat4a07a3da7ad47c8cf4c1cce651b4ed25d34cd12c(head SHA25aeabac45cb2678e41d21607c7bbc7fcfbc9e63after PO acceptance). Verceldev/beta (https://beta.give.vn) deployment completed: https://vercel.com/metados/give/8ezVFYbejtyjwFWeyfJfXC7Ukcf7. Keeping #253 open for Production promotion (dev -> main) by Give Product Owner onceDOS/DOS.Me#1856reachesmainand JOY approves.JOY commentedon Nov 22, 2026
handoff: session=532bdd1f-f159-4548-8a59-a47af6a07c07 to=83b36fa6-8c08-49d6-aeec-63bab02a5e52
Done: Implemented
apps/webco-organizers (editors) forDOS/Give#253in PR #298 (#298), squash-merged intoDOS/Givedevat4a07a3da7ad47c8cf4c1cce651b4ed25d34cd12c(head SHA25aeabac45cb2678e41d21607c7bbc7fcfbc9e63, PO acceptance posted). Worktree/Users/JOY/Projects/Give/.claude/worktrees/253-co-organizersand local branch removed.Evidence: Local
pnpm format:check,pnpm lint,pnpm typecheck,pnpm build, and 180/180 Vitest files (2,620/2,620 tests) passed. PR #298 required checks (Verify build / Lint,Verify build / Build all apps) passed on25aeabac45cb2678e41d21607c7bbc7fcfbc9e63. Independent fresh-context security/code review + PO flagship review approved with 0 blocking findings. Verceldev/beta (https://beta.give.vn) deployment completed: https://vercel.com/metados/give/8ezVFYbejtyjwFWeyfJfXC7Ukcf7.Remaining: Beta end-to-end verification (owner invites editor, editor edits content/posts update and is refused on money surfaces) and Production promotion (
dev -> main/give.vn) handled by Give Product Owner (Claude PO) onceDOS/DOS.Me#1856reachesmainand JOY approves.Next step: Coordinate beta E2E verification and Production promotion with Give Product Owner when
DOS/DOS.Me#1856is promoted tomain.Blockers:
DOS/DOS.Me#1856(20261129170000_give_campaign_members.sql) promotion toDOS/DOS.Memain+ JOY Production approval (cleared by Give Product Owner / JOY).Branch:
antigravity/253-co-organizersmerged intodevat4a07a3da7ad47c8cf4c1cce651b4ed25d34cd12c.JOY commentedon Nov 22, 2026
claim: executor=Antigravity session=83b36fa6-8c08-49d6-aeec-63bab02a5e52 scope="Production steps, waiting for Claude PO (Give Product Owner) DOS/DOS.Me#1856 + #298 dev -> main promotion" branch=antigravity/253-co-organizers target=2026-11-28
JOY commentedon Nov 22, 2026
checkpoint: session=83b36fa6-8c08-49d6-aeec-63bab02a5e52 waiting for Production promotion (DOS/DOS.Me main then DOS/Give main / give.vn) by Give Product Owner (Claude Code) after JOY approval; #298 merged at 4a07a3d and deployed to https://beta.give.vn (Vercel success).
docs(campaigns): sync CHANGELOG/README for #250-#253 wave and fix 2 P…
Merge pull request #301 from DOS/dev
JOY commentedon Nov 22, 2026
done: session=83b36fa6-8c08-49d6-aeec-63bab02a5e52
Promoted to Production and verified live: