Skip to content

Integrate Jotform API for Waiver Status - #112

Open
lheutchy wants to merge 5 commits into
developfrom
jotform
Open

lheutchy wants to merge 5 commits into
developfrom
jotform

Conversation

@lheutchy

Copy link
Copy Markdown
Collaborator

Developer: Lorinc Heutchy

Closes #7

Pull Request Summary

Implemented Jotform waiver status integration end-to-end for the volunteer event-card experience.
The backend now exposes GET /api/me/waiver-status, which checks Clerk-authenticated user identity, reads/writes waiver status in MongoDB, and falls back to Jotform submissions matching by email when cache is missing/stale.
Frontend volunteer event-card views now consume this status instead of relying only on hardcoded waiver placeholders.

Modifications

route.ts

  • Created new API route to:
    -validate required Jotform env vars
    -authenticate current user via Clerk
    -load app user from MongoDB
    -check cached waiver status in waivers
    -fetch Jotform submissions and match by normalized email when needed
    -upsert waiver record and return status response

Waiver.ts
-Created new Mongoose model/collection for cached waiver status metadata (status, waiverSubmissionId, waiverLastCheckedAt, etc.).

useWaiverStatus.ts
-Added client hook to fetch /api/me/waiver-status and helper mapping logic to convert API waiver status into card status display state.

VolunteerEventsPage.tsx
-Wired volunteer event-card data to use fetched waiver status mapping.

page.tsx
-Wired calendar volunteer event cards to use fetched waiver status mapping.

Testing Considerations

I tested on my account that the waiver status is incomplete for everything and that Mongo updated the Waiver table with my information

Reviewer should verify:
-End-to-end complete path with a known account/email that exists in Jotform submissions.
-End-to-end incomplete path with a non-matching account/email.
-Mongo waivers collection updates correctly after endpoint calls.

Pull Request Checklist

  • Code is neat, readable, and works
  • Comments are appropriate
  • The commit messages follows our guidelines
  • The developer name is specified
  • The summary is completed
  • Assign reviewers

Screenshots/Screencast

@vercel

vercel Bot commented May 13, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
one-cool-earth Error Error Jun 3, 2026 11:30pm
one-cool-earth-25 Error Error Jun 3, 2026 11:30pm

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.

Jotform Research

2 participants