Skip to content

Purav taking over for Sohail - Job form issues backend - #2318

Closed
bfire9989 wants to merge 2 commits into
developmentfrom
job-form-issues-backend
Closed

Purav taking over for Sohail - Job form issues backend#2318
bfire9989 wants to merge 2 commits into
developmentfrom
job-form-issues-backend

Conversation

@bfire9989

@bfire9989 bfire9989 commented Aug 25, 2026

Copy link
Copy Markdown

Description

Implements # (Priority High) — Backend support for the Job Application Page (/job-application) form. This PR adds all server-side functionality required by the frontend job application form fixes.

image

Related PRs

This backend PR is related to the #5469 frontend PR.

Main changes explained

  • Updated jobApplicationsModel.js — added email (String) and resumeUrl (String) fields to the response schema, required for duplicate detection and resume storage
  • Updated jobsController.js — added getActiveJobPositions, queries Job.distinct('title') and returns { positions: [...] } sorted alphabetically for the frontend dropdown
  • Updated jobsRouter.js — wired /positions to getActiveJobPositions; preserved old getPositions (JobPositionCategory) under /position-categories; fixed route ordering so named routes appear before /:id
  • Updated collaborationController.js — added submitFormResponse: returns 400 on missing fields, 404 if form not found, 409 on duplicate email per form, handles optional resume upload to Azure Blob Storage (non-fatal), parses answers as either array or JSON string (multipart support), sends confirmation email via emailSender after save (non-fatal), returns 201 on success
  • Updated collaborationRouter.js — added POST /jobforms/:formId/responses with upload.single('resume') multer middleware
  • Updated middleware.js — added public exemption for POST /api/jobforms/:id/responses so external applicants can submit without a JWT token

How to test

Refer to the frontend PR (#5469) for full setup and step-by-step testing instructions. The frontend PR must be checked out and running alongside this backend PR to test end-to-end.

To verify backend behaviour directly via Postman or Insomnia:

  1. Check out this branch and start the backend server
  2. GET /api/jobs/positions — should return { positions: ["Title A", "Title B", ...] } from the jobs collection
  3. POST /api/jobforms/:formId/responses with valid respondent, email, and answers — should return 201 and trigger a confirmation email
  4. Repeat the same request with the same email — should return 409 Conflict
  5. Submit with missing respondent or email — should return 400
  6. Submit with an invalid formId — should return 404
  7. Attach a resume file as multipart/form-data — verify resumeUrl is saved on the response document in the DB
  8. Confirm the route is accessible without a JWT token (public exemption in middleware)

Screenshots or videos of changes

Screenshot 2026-08-24 203215 Screenshot 2026-08-24 203159

Note

Email sending and resume upload are both non-fatal — a failure in either will not block the 201 response. Check server logs if emails are not arriving or resume URLs are not saving.

bfire9989 added 2 commits July 4, 2026 02:10
- Rename teamCode to teamName across WeeklyGrading schema, controller, and index
- Normalize save dates to Sunday midnight UTC to prevent duplicate records
- Update GET /api/weekly-grading to accept weekStart param for week range queries
- Add DELETE /api/weekly-grading/reviewer endpoint for reviewer removal
- Add POST /api/pr-grading-config/sync-reviewers to auto-populate team configs
  from SQ submissions, excluding promoted team members, split by last name A-M/N-Z
- Calculate prsNeeded from userProfile.weeklycommittedHours
- Add controller tests for weeklyGradingController and prGradingConfigController
@one-community one-community changed the title Job form issues backend XXX taking over for Sohail - Job form issues backend Aug 25, 2026
@one-community one-community changed the title XXX taking over for Sohail - Job form issues backend Purav taking over for Sohail - Job form issues backend Aug 25, 2026
@pixelpix13

Copy link
Copy Markdown
Contributor

now taken over by #2333

@pixelpix13 pixelpix13 closed this Sep 3, 2026
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.

2 participants