Skip to content

feat(reimbursement): public request form, status lookup, and admin review - #513

Merged
gregv merged 3 commits into
developfrom
feat/reimbursement-form
Nov 17, 2026
Merged

gregv merged 3 commits into
developfrom
feat/reimbursement-form

Conversation

@gregv

@gregv gregv commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Code written by Tarry (Muse) - Model: Muse Wonder, Effort: xhigh

What was built

Public reimbursement flow at /reimbursement plus an admin review view at /admin/reimbursements, following the IRS accountable-plan rules (business connection, substantiation, itemized receipt).

  • Public page src/pages/reimbursement/index.js (RefinedRoot/RefinedPage, one h1, short direct copy): name, email, optional phone, purchase date, vendor, amount, optional hackathon event (from the public events list), business purpose, who the food fed, payment method, reimbursement method (ACH or check), itemized receipt upload, and an attestation checkbox. Client validation mirrors the backend: amount over $0 and up to $10,000, date not in the future and not more than 120 days old, receipt required. Success screen shows the reference ID with a copy button and what happens next (treasurer review; ACH details collected separately by the treasurer). No bank account or routing fields anywhere.
  • Status lookup on the same page: email + reference ID shows status, amount, and purchase date.
  • Receipt upload src/components/Reimbursement/ReceiptUploadField.js: JPG/PNG/WebP/PDF, max 10MB, show filename with remove/replace, adapted from the jobs ResumeUploadField mint + XHR PUT flow. The mint endpoint here is public with a reCAPTCHA token and no auth header.
  • API client src/lib/reimbursementApi.js: the one client for these endpoints (submit, mint upload URL + GCS PUT, status lookup, admin list/get/review). Throws ReimbursementApiError on failure, same error-shape handling as the judge API client.
  • Validation + transitions src/lib/reimbursementValidation.js: pure, tested helpers for the form rules, the allowed status transitions, cents-to-dollars, and self-approval blocking.
  • Admin page src/pages/admin/reimbursements/index.js (gated on volunteer.admin, token + X-Org-Id like the other admin calls): status filter + event filter, table with reference ID, submitter, purchase date, vendor, amount, status, submitted date. Detail dialog with receipt link, business purpose, who it fed, payment/reimbursement method, status history, review note, and action buttons per allowed transition. Approve and Mark paid are disabled with a clear note when the logged-in reviewer's email matches the submitter email (no self-approval; also enforced server-side).
  • Admin dashboard: added a Reimbursements card to src/pages/admin/index.js (default volunteer.admin permission, same as the other cards).

Route and endpoints used

  • Route: /reimbursement (public), /admin/reimbursements (admin)
  • POST /api/reimbursements (public, reCAPTCHA)
  • POST /api/reimbursements/receipt-upload-url (public, reCAPTCHA)
  • GET /api/reimbursements/status?email=&reference_id= (public)
  • GET /api/reimbursements/admin, GET /api/reimbursements/admin/<id>, PATCH /api/reimbursements/admin/<id> (volunteer.admin)

Diagrams

  • Architecture: docs/diagrams/reimbursement-20261116-0930/reimbursement-architecture.html
  • Claim status lifecycle: docs/diagrams/reimbursement-20261116-0950/reimbursement-status-lifecycle.html
  • Archify 3.2.0 (latest release checked 2026-11-16; no newer release). Both diagrams passed validate/deliver/check. Browser-check could not run in this VM (the sandboxed Chrome refuses headless startup with a WebGL domain policy error), so no browser evidence; not visually reviewed.

Tests run

  • npx jest src/lib/__tests__/reimbursementValidation.test.js src/lib/__tests__/reimbursementApi.test.js: 23 passed, 0 failed (validation rules, status transitions, self-approval blocking, API client request shapes and error handling).
  • npx eslint on all touched source files: 0 errors. (Jest test files are eslint-ignored in this repo, same as the existing lib tests.)
  • npm run build with stub env vars (this checkout has no .env; the first build failed on missing env vars at page-data collection, which is pre-existing): compiled successfully, 162/162 static pages generated, with /reimbursement and /admin/reimbursements both in the route list. The build's postbuild step had added a line to public/robots.txt; that was reverted before pushing, so it is not in this PR.

Blockers

  • Backend endpoints are not live yet. The backend builder has api/reimbursements/ in progress locally (uncommitted) and GET https://api.ohack.dev/api/reimbursements/status returns 404. This frontend was verified against mocked API calls only; the live submit, upload, lookup, and admin flows need an end-to-end check once the backend deploys.

Open decisions for Greg

  • Public no-login vs login-required submissions: v1 is public (no login), guarded by reCAPTCHA only, per the brief. Say the word if submissions should require a login instead.
  • ACH details: v1 collects the reimbursement method only (ACH or check). ACH details are collected separately by the treasurer after approval. Is that the right split, or should there be a secure post-approval form for bank details?
  • Admin link placement: the Reimbursements card was added to the admin dashboard index. Is that the right spot, or should it live under an existing section?

…view

Public /reimbursement form with itemized receipt upload (signed-URL mint
+ GCS PUT), reCAPTCHA, accountable-plan validation, and a reference-ID
success screen, plus an email + reference-ID status lookup on the same
page. Admin /admin/reimbursements review table and detail dialog gated
on volunteer.admin, with server-mirrored status transitions and
approve/paid disabled on the reviewer's own claims. Includes
src/lib/reimbursementApi.js, src/lib/reimbursementValidation.js, Jest
tests, and Archify architecture + status-lifecycle diagrams.

Code written by Tarry (Muse) - Model: Muse Wonder, Effort: xhigh
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
frontend-ohack-dev Ready Ready Preview Nov 17, 2026 4:56am UTC

Request Review

- email field could not be typed into (name did not match its state key)
- admin dialog never showed the receipt (backend nests it); show images inline
- own claims: disable every action, matching the backend's 403
- require a note to deny / ask for info; mailto the submitter
- admin list: one fetch filtered on screen so chips stay stable; unpaid total;
  no refetch on token rotation
- form: focus first invalid field, date max, decimal keypad amount, length
  caps, two-decimal check, MIME-type receipt check, check-vs-ACH next steps,
  status hints on lookup

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
- form: three app methods with a payout block (handle typed twice, name on
  the account, optional Venmo phone last 4); switching method clears it
- admin: payout destination with copy + verification guidance; marking paid
  requires a payment reference, shown on the claim afterwards
- validation twinned with the backend; never sends the confirm entry

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@gregv
gregv marked this pull request as ready for review November 17, 2026 05:37
@gregv
gregv merged commit 9e00052 into develop Nov 17, 2026
5 checks passed
@gregv
gregv deleted the feat/reimbursement-form branch November 17, 2026 05:37

This branch was successfully deployed

1 active deployment
Preview — 6f496a77 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant