Skip to content

Add admin claim-action API and claim status transition machine#302

Merged
GsCommand merged 1 commit into
mainfrom
codex/add-admin-approve/reject-controls-and-status-machine
May 23, 2026
Merged

Add admin claim-action API and claim status transition machine#302
GsCommand merged 1 commit into
mainfrom
codex/add-admin-approve/reject-controls-and-status-machine

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Introduce a strict claim provisioning lifecycle and admin controls so claims must be approved/rejected before downstream steps (cards/payouts/ENS/8004) run.
  • Record audit metadata and transitions for future automation and visibility.
  • Provide admin UI controls to perform reviewed actions safely without exposing them publicly.

Description

  • Add DB migration db/migrations/002_claim_status_machine.sql to extend claim_requests with review/rejection/approval/error fields and create claim_status_transitions with an index.
  • Add POST /api/admin/claim-action in api/admin/claim-action.js implementing supported actions approve, reject, mark_failed, and add_note with enforced transition rules, required reason checks, claim_events writes, and claim_status_transitions inserts.
  • Update GET /api/admin/claim (api/admin/claim.js) to include transitions in the detail response.
  • Update admin UI public/admin/claims.html to show current status badge, approve/reject/mark failed controls, notes/reason inputs, note saving, timeline refresh, and display of events/transitions (placeholder for next step).
  • Extend tests/api-admin-claims.test.js to cover admin config/auth checks, approve/reject/invalid transition behavior, mark_failed and add_note behavior, and assert event/transition queries are attempted.

Testing

  • Ran npm test (repo root) and all tests passed (73 tests, 0 failures).
  • Attempted npm install at repo root but it failed in this environment due to npm registry policy returning 403 for @neondatabase/serverless (external registry access issue).
  • cd examples/webhook-auto-verify && npm install and npm run check both succeeded.
  • npm run build was not run because a build script is not defined in package.json.

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

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

Project Deployment Actions Updated (UTC)
commandlayer-commandlayer-org Ready Ready Preview, Comment May 23, 2026 7:44pm
commandlayer-org Ready Ready Preview, Comment May 23, 2026 7:44pm
commandlayer-org111 Ready Ready Preview, Comment May 23, 2026 7:44pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant