Skip to content

[INTF25] Build Mutator to Create Reviewed Applicant Record#84

Merged
isabellehuangg merged 14 commits intomainfrom
application-status-mutator
Nov 22, 2025
Merged

[INTF25] Build Mutator to Create Reviewed Applicant Record#84
isabellehuangg merged 14 commits intomainfrom
application-status-mutator

Conversation

@isabellehuangg
Copy link
Collaborator

@isabellehuangg isabellehuangg commented Nov 5, 2025

Notion ticket link

Ticket Name

Implementation description

  • Added service functions under that update using Sequelize for creating and deleting one/multiple review records
  • Created a GraphQL resolver file and types
  • Imported new resolver and types into backend/typescript/graphql/index.ts
  • Migration added to add createdAt and updatedAt columns to reviewed_applicant_records DB

In the graphQL playground, I ran the following:

  1. Single create:
mutation {
  createReviewedApplicantRecord(
    input: {
      applicantRecordId: "0dae4a96-df1b-4e8d-9555-cd98335cb9c4",
      reviewerId: 1,
      review: {
        passionFSG: 5,
        teamPlayer: 4,
        desireToLearn: 5,
        skill: 3,
        skillCategory: INTERMEDIATE
      },
      status: "PENDING"
    }
  ) {
    applicantRecordId
    reviewerId
    review {
      passionFSG
      teamPlayer
      desireToLearn
      skill
      skillCategory
    }
    status
    score
    reviewerHasConflict
  }
}
  1. Bulk create: This tests null fields for status and review too
mutation {
  bulkCreateReviewedApplicantRecord(
    inputs: [
      { 
        applicantRecordId: "0bdb339f-4321-4bd4-9cb7-6b9dcde5771a", 
        reviewerId: 2,
        review: {
        	passionFSG: 5,
        },
        status: "PENDING"
      },
      { 
        applicantRecordId: "0bdb339f-4321-4bd4-9cb7-6b9dcde5771a", 
        reviewerId: 3,
      }
    ]
  ) {
    applicantRecordId
    reviewerId
    review {
      passionFSG
      teamPlayer
      desireToLearn
      skill
      skillCategory
    }
    status
    score
    reviewerHasConflict
  }
}
  1. Single Delete
mutation {
  deleteReviewedApplicantRecord(
    input: {
      applicantRecordId: "0bdb339f-4321-4bd4-9cb7-6b9dcde5771a",
      reviewerId: 3 
    }
  ) {
    applicantRecordId
    reviewerId
    review {
      passionFSG
      teamPlayer
      desireToLearn
      skill
      skillCategory
    }
    status
  }
}
  1. Bulk delete
mutation {
  bulkDeleteReviewedApplicantRecord(
    inputs:[
      {
        applicantRecordId:"0dae4a96-df1b-4e8d-9555-cd98335cb9c4"
        reviewerId: 1
      },
      {
        applicantRecordId:"0bdb339f-4321-4bd4-9cb7-6b9dcde5771a",
        reviewerId: 2
      }
    ]
  ) {
    applicantRecordId
    reviewerId
    review {
      passionFSG
      teamPlayer
      desireToLearn
      skill
      skillCategory
    }
    status
  }
}

What should reviewers focus on?

  • There was no previous support that I could find for JSON fields, so lines 43-67 of backend/typescript/graphql/index.ts

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

isabelle huang and others added 2 commits November 4, 2025 21:37
@isabellehuangg isabellehuangg changed the title current draft [INTF25] Build Mutator to Create Reviewed Applicant Record Nov 8, 2025
@isabellehuangg isabellehuangg marked this pull request as ready for review November 8, 2025 18:57
@mxc-maggiechen mxc-maggiechen marked this pull request as draft November 12, 2025 01:45
@ruiichen ruiichen self-requested a review November 12, 2025 01:53
@isabellehuangg isabellehuangg marked this pull request as ready for review November 12, 2025 02:47
Comment on lines 218 to 221
export type DeleteReviewedApplicantRecord = {
applicantRecordId: string;
reviewerId: number;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: just to keep with naming conventions, this type should be DeleteReviewedApplicantRecord

Copy link
Contributor

Choose a reason for hiding this comment

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

DeleteReviewedApplicantRecordDTO

Comment on lines 121 to 124
changeRating: authorizedByAllRoles(),
changeSkillCategory: authorizedByAllRoles(),
updateApplications: authorizedByAllRoles(),
modifyFinalComments: authorizedByAllRoles(),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is legacy code I deleted in another PR... would you mind merging to main to get rid of this LOL, sorry I forgot everyone to pull main when I merged that PR in

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!

Copy link
Collaborator

@gavxue gavxue left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

return record.toJSON() as ReviewedApplicantRecordDTO;
} catch (error: unknown) {
Logger.error(
`Failed to bulk create reviewed applicant records. Reason = ${getErrorMessage(
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: error message should be "failed to delete"

);
} catch (error: unknown) {
Logger.error(
`Failed to bulk create reviewed applicant records. Reason = ${getErrorMessage(
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: error message should be "failed to bulk delete"

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.

LGTM!

@isabellehuangg isabellehuangg merged commit 8de11bd into main Nov 22, 2025
1 check passed
@isabellehuangg isabellehuangg deleted the application-status-mutator branch November 22, 2025 19:24
@isabellehuangg isabellehuangg restored the application-status-mutator branch November 22, 2025 19:24
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.

4 participants