Skip to content

Read endpoint with fsm#492

Open
shreeyaadhikari wants to merge 5 commits into
devfrom
read-endpoint-with-fsm
Open

Read endpoint with fsm#492
shreeyaadhikari wants to merge 5 commits into
devfrom
read-endpoint-with-fsm

Conversation

@shreeyaadhikari

@shreeyaadhikari shreeyaadhikari commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Implement status state machine and wire GET /api/v1/status

🎫 Issue #488

▶ Changelist:

  • Defined MachineInput type in status/types.ts and changed ApplicationStatus, DecisionStatus, and RsvpStatus to import from lib/types/user.ts instead of redefining them locally
  • Rewrote returnDashboardBranch in machine.ts to accept a single MachineInput object
  • Updated service.ts to fetch user from applicant_data Mongo collection via getDb(), read dates and showDecision from mock-singletons.ts, and return full PortalStatusResponse
  • Updated route.ts to read userId from query string and call getPortalStatus
  • Updated fetchPortalStatus.ts fallback to use new MachineInput signature
  • Added 8 unit tests in machine.test.ts covering all branch logic cases
  • Added jest.config.ts and Jest dependencies to enable TypeScript test running

📝 Notes + 🚧 TODO:

  • Aligning RsvpStatus to user.ts required changing "submitted" to "confirmed" and "not-submitted" to "unconfirmed" across several dashboard components (AdmittedView.tsx, SubmittedView.tsx, rsvp/page.tsx, InProgressView.tsx, mock-singletons.ts).
  • TODO: replace with getSingleton() calls once Ticket 5 lands real singleton service. Dates and showDecision currently read from mock-singletons
  • TODO: gate with requireUser() once Ticket 1 ships its helpers. userId currently reads from query string as placeholder

🧪 Testing:

  • 8 unit tests covering all branch logic cases, all passing (yarn jest)

🎥 Screenshots & Screencasts:

Tests:
image

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
core-live Ready Ready Preview, Comment Jul 1, 2026 8:32pm
core-main Ready Ready Preview, Comment Jul 1, 2026 8:32pm

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