Repository navigation
feat(admin): atomic expected-status guard and pre-launch recovery queue (#77) - #306
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
PO acceptance: merge at 8a3421b Verified on GitHub:
|
Refs #77
Summary
Phase 2 (
apps/web) companion to merged DB PR DOS/DOS.Me#1872 (20261130120000_give_campaign_sendback_and_suspended_recovery.sql, squash-merged ata280fcf01c2181c7a74ba6d3f5d79c88cbc8fa8b, BetaSupabase Previewgreencheck-run 137157543189), closing the remaining items of #77:apps/web/src/app/admin/actions.ts,apps/web/src/lib/errors.ts):approveCampaignpassesp_expected_status: "in_review"on approval andp_expected_status: "approved"on immediate live opening, preventing stale approvals and accidental un-suspension if another moderator suspended the campaign in between.requestChangesacceptsfrom_statusin("in_review", "approved", "suspended"), passesp_expected_status: fromStatusatomically togive.transition_campaign, and keeps read-error vs not-found distinction.GIVE_CAMPAIGN_STATUS_CHANGED(40001) andsuspended -> changes_requestedrefusals (SUSPENDED_SEND_BACK_MESSAGES) to clear Vietnamese messages./admin(apps/web/src/lib/campaigns.ts,apps/web/src/app/admin/page.tsx):listCampaignsNeedingRecovery(backed bygive.campaigns_needing_recovery(), disjoint fromgive.campaigns_waiting_for_account()) andrecoveryAdvicecovering:approved_past_end: approved campaigns pastends_atwhose receiving account is usable (skipped by activation cron and absent from#waiting);suspended_before_start: campaigns suspended withstarts_at > now()(never live, no contributions), with tailored guidance for usable accounts, unusable accounts without transactions (release & rebind),giveaccounts with transactions (#55swap, with#organizersre-verification guidance when unverified), foreign accounts with transactions (admin/cancel), andbackaccounts with transactions (no dead-end send-back).#recovery("Cần xử lý trước khi mở") on/adminwith error isolation, self-review guards,<StatusHistory>, secondary submit buttons (DESIGN.md6), andfrom_status="suspended"/"approved"hidden inputs.CHANGELOG.md,apps/web/src/app/admin/actions.test.ts,apps/web/src/lib/campaigns.test.ts, andapps/web/src/app/admin/page.test.ts.Verification (
8a3421b218c583929460d7dc5d46bed43f33f247)pnpm format:check: PASSpnpm lint: PASSpnpm typecheck: PASSpnpm test: PASS (180 Vitest files / 2,631 tests)pnpm build: PASS (Next.js 16.4.6 production build)LintSUCCESS,Build all appsSUCCESS,VercelSUCCESS,DOScoutSUCCESS (mergeable: MERGEABLE,mergeStateStatus: CLEAN).Review Record (
8a3421b218c583929460d7dc5d46bed43f33f247)dos[bot]):APPROVED(CLEAN_PASS, 0 findings) on both1913c4aband8a3421b2.9e65e286-829c-422b-a970-6beb714b6ce0):1913c4ab): 2 P2 + 1 P3 findings inrecoveryAdvice(money && account_not_owned,money && give && !verified,organizer_not_verified && money).8a3421b2): all 3 fixed with unit test coverage ->CLEAN_PASS(0 remaining findings).