Repository navigation
feat(reimbursement): public request form, status lookup, and admin review - #513
Merged
Merged
Conversation
…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
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- 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>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code written by Tarry (Muse) - Model: Muse Wonder, Effort: xhigh
What was built
Public reimbursement flow at
/reimbursementplus an admin review view at/admin/reimbursements, following the IRS accountable-plan rules (business connection, substantiation, itemized receipt).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.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.src/lib/reimbursementApi.js: the one client for these endpoints (submit, mint upload URL + GCS PUT, status lookup, admin list/get/review). ThrowsReimbursementApiErroron failure, same error-shape handling as the judge API client.src/lib/reimbursementValidation.js: pure, tested helpers for the form rules, the allowed status transitions, cents-to-dollars, and self-approval blocking.src/pages/admin/reimbursements/index.js(gated onvolunteer.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).src/pages/admin/index.js(defaultvolunteer.adminpermission, same as the other cards).Route and endpoints used
/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
docs/diagrams/reimbursement-20261116-0930/reimbursement-architecture.htmldocs/diagrams/reimbursement-20261116-0950/reimbursement-status-lifecycle.htmlTests 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 eslinton all touched source files: 0 errors. (Jest test files are eslint-ignored in this repo, same as the existing lib tests.)npm run buildwith 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/reimbursementand/admin/reimbursementsboth in the route list. The build's postbuild step had added a line topublic/robots.txt; that was reverted before pushing, so it is not in this PR.Blockers
api/reimbursements/in progress locally (uncommitted) andGET https://api.ohack.dev/api/reimbursements/statusreturns 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