Skip to content

[INTF25] Adds applicant record and reviews query#81

Merged
gavxue merged 9 commits intomainfrom
INTF25-applicant-record-review-query
Nov 26, 2025
Merged

[INTF25] Adds applicant record and reviews query#81
gavxue merged 9 commits intomainfrom
INTF25-applicant-record-review-query

Conversation

@gavxue
Copy link
Collaborator

@gavxue gavxue commented Nov 2, 2025

Notion ticket link

Build queries for applicant record and review query

Implementation description

  • implemented getReviewDashboardSidePanel query to fetch detailed applicant information including review data
  • created toSidePanelDTO helper function in reviewDashboardService.ts to transform ApplicantRecord models into ReviewDashboardSidePanelDTO objects, following the same pattern as the existing toDTO helper
  • added ReviewDashboardSidePanelDTO GraphQL type and corresponding TypeScript type definitions to support the side panel query
  • query uses Sequelize associations to join applicant_records, applicants, reviewed_applicant_records, and users tables to return comprehensive applicant data
  • Added default value handling for skillCategory field (defaults to "Junior" when null) to ensure non-nullable GraphQL field requirements are met

Steps to test

We don't actually have correctly formatted review data in the db right now so we will have to insert some test data via sql queries.

  1. Get existing applicant_record ids using this query. Choose any id.
SELECT id, position, status 
FROM applicant_records 
LIMIT 10;
  1. Insert test data. Replace YOUR_APPLICANT_RECORD_ID with the one chosen from step 1.
INSERT INTO reviewed_applicant_records (
  "applicantRecordId",
  "reviewerId",
  review,
  status,
  score,
  "reviewerHasConflict"
) VALUES
(
  'YOUR_APPLICANT_RECORD_ID',
  1,
  '{"passionFSG": 5, "teamPlayer": 4, "desireToLearn": 5, "skill": 4, "skillCategory": "Senior", "comments": "Excellent candidate!"}',
  'Done',
  90,
  false
);
  1. Get the applicant id to test the new graphql query. Replace YOUR_APPLICANT_RECORD_ID with the one chosen from step 1.
SELECT 
  ar."applicantId",
  ar.id as "applicantRecordId",
  ar.position,
  a."firstName",
  a."lastName",
  rar.status as "reviewStatus",
  rar.score
FROM applicant_records ar
JOIN applicants a ON ar."applicantId" = a.id
JOIN reviewed_applicant_records rar ON ar.id = rar."applicantRecordId"
WHERE rar."applicantRecordId" = 'YOUR_APPLICANT_RECORD_ID';
  1. In graphql playground run the following query:
query {
  reviewDashboardSidePanel(applicantId: "YOUR_APPLICANT_ID") {
    firstName
    lastName
    positionTitle
    program
    resumeUrl
    applicationStatus
    skillCategory
    reviewDetails {
      reviewerFirstName
      reviewerLastName
      review {
        passionFSG
        teamPlayer
        desireToLearn
        skill
        skillCategory
        comments
      }
    }
  }
}

For example, the result should resemble the following (with different applicant details obviously, but reviewer details should be similar):

{
  "data": {
    "reviewDashboardSidePanel": {
      "firstName": "Emma",
      "lastName": "Huang",
      "positionTitle": "Developer",
      "program": "Software Engineering",
      "resumeUrl": "https://firebasestorage.googleapis.com/v0/b/uw-blueprint.appspot.com/o/resumes%2F0cbd71b7-8c06-43ce-8082-5d68908bfba3?alt=media&token=5c6b1c10-2f2b-47d7-9768-df709b9e51cd",
      "applicationStatus": "pending",
      "skillCategory": null,
      "reviewDetails": [
        {
          "reviewerFirstName": "Carolyn",
          "reviewerLastName": "Zhang",
          "review": {
            "passionFSG": 5,
            "teamPlayer": 4,
            "desireToLearn": 5,
            "skill": 4,
            "skillCategory": "Senior",
            "comments": "Excellent candidate!"
          }
        }
      ]
    }
  }
}
  1. verify that applicant details are returned correctly
  2. test with multiple different ids

What should reviewers focus on?

  • consistency with other areas of codebase, such as getReviewDashboard()
  • the graphql query returns the correct information

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@gavxue gavxue self-assigned this Nov 2, 2025
@gavxue gavxue changed the title Intf25 applicant record review query Applicant records and review query Nov 2, 2025
@gavxue gavxue changed the title Applicant records and review query [INTF25] Adds applicant records and review query Nov 2, 2025
@gavxue gavxue changed the title [INTF25] Adds applicant records and review query [INTF25] Adds applicant record and reviews query Nov 2, 2025
…nto INTF25-applicant-record-review-query
@gavxue gavxue marked this pull request as ready for review November 2, 2025 18:36
@gavxue gavxue requested a review from mxc-maggiechen November 2, 2025 18:37
@gavxue gavxue requested a review from mxc-maggiechen November 9, 2025 18:30
…nto INTF25-applicant-record-review-query
): Promise<ReviewDashboardSidePanelDTO> {
try {
const applicantRecord: ApplicantRecord | null =
await ApplicantRecord.findOne({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥹 looks familiar

Copy link
Collaborator

@ruiichen ruiichen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 works on my machine

Copy link
Contributor

@mxc-maggiechen mxc-maggiechen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for doing this Gavin!

…nto INTF25-applicant-record-review-query
@gavxue gavxue merged commit 5f0672b into main Nov 26, 2025
1 check passed
@gavxue gavxue deleted the INTF25-applicant-record-review-query branch November 26, 2025 02:13
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.

3 participants