Skip to content

[INTW26] Implement backend updates for interview scheduling feature - #130

Merged
mxc-maggiechen merged 2 commits into
mainfrom
INTW26-interview-scheduling-feature
May 10, 2026
Merged

[INTW26] Implement backend updates for interview scheduling feature#130
mxc-maggiechen merged 2 commits into
mainfrom
INTW26-interview-scheduling-feature

Conversation

@chene0

@chene0 chene0 commented Apr 4, 2026

Copy link
Copy Markdown
Member

THIS BRANCH IS CURRENTLY BASED OFF OF INTW26-build-interview-delegation-algorithm, REBASE ONTO MAIN ONCE #127 GETS MERGED

Notion ticket link

Implement Interview Scheduling Feature

Implementation description

  • In the model User, add a fk profilePictureFileId to firebase_files
  • Define and implement new resolvers getInterviewedApplicantsByGroupId and getInterviewersByGroupId for the interview review page

Steps to test

  1. docker compose up and docker exec recruitment_tools_backend node migrate up, ensure that the migrations ran successfully and in pgAdmin the users table now has a profilePictureFileId fk to firebase_files
  2. Run the following sql queries separately and in order to create copies of each existing seeded applicant record
CREATE EXTENSION IF NOT EXISTS pgcrypto;
INSERT INTO public.interviewed_applicant_records (id, "applicantRecordId", status, "createdAt", "updatedAt")
SELECT
	gen_random_uuid(),
	id,
	'NeedsReview',
	NOW(),
	NOW()
FROM public.applicant_records
ON CONFLICT ("applicantRecordId") DO NOTHING;
  1. Run the following sql query to create a bunch of dummy users with position "Developer"
INSERT INTO users (first_name, last_name, email, auth_id, role, position, "isActive")
VALUES
  ('Test', 'User1',  'testuser1@test.com',  'test_auth_1',  'User', 'Developer', true),
  ('Test', 'User2',  'testuser2@test.com',  'test_auth_2',  'User', 'Developer', true),
  ('Test', 'User3',  'testuser3@test.com',  'test_auth_3',  'User', 'Developer', true),
  ('Test', 'User4',  'testuser4@test.com',  'test_auth_4',  'User', 'Developer', true),
  ('Test', 'User5',  'testuser5@test.com',  'test_auth_5',  'User', 'Developer', true),
  ('Test', 'User6',  'testuser6@test.com',  'test_auth_6',  'User', 'Developer', true),
  ('Test', 'User7',  'testuser7@test.com',  'test_auth_7',  'User', 'Developer', true),
  ('Test', 'User8',  'testuser8@test.com',  'test_auth_8',  'User', 'Developer', true),
  ('Test', 'User9',  'testuser9@test.com',  'test_auth_9',  'User', 'Developer', true),
  ('Test', 'User10', 'testuser10@test.com', 'test_auth_10', 'User', 'Developer', true),
  ('Test', 'User11', 'testuser11@test.com', 'test_auth_11', 'User', 'Developer', true);
  1. Run the following mutator, copy any one of the returned groupId in the response
mutation DelegateInterviewers {
    delegateInterviewers(positions: ["Developer", "VP Engineering"]) {
        interviewedApplicantRecordId
        interviewerId
        interviewHasConflict
        groupId
    }
}
  1. Call the following queries and confirm they work with the copied group id
query GetInterviewedApplicantsByGroupId {
    getInterviewedApplicantsByGroupId(
        groupId: "<copied group id>"
    ) {
        applicantRecordId
        firstName
        lastName
    }
}
query GetInterviewersByGroupId {
    getInterviewersByGroupId(groupId: "<copied group id>") {
        id
        firstName
        lastName
        email
        role
        position
        profilePictureFileId
    }
}

What should reviewers focus on?

  • Queries return error response for group ids with invalid uuid syntax

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

defaultValue: DataType.NOW,
})
updatedAt!: Date;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added this BelongsTo decorator so i could do joins for getInterviewedApplicantsByGroupId

@chene0
chene0 force-pushed the INTW26-interview-scheduling-feature branch 2 times, most recently from a88e490 to 91894e7 Compare April 11, 2026 17:22
@chene0
chene0 force-pushed the INTW26-interview-scheduling-feature branch 2 times, most recently from 94e41e8 to 87f41e6 Compare April 19, 2026 02:27
@chene0
chene0 marked this pull request as ready for review April 19, 2026 19:23
@chene0 chene0 changed the title [INTW26] Backend updates for interview scheduling feature [INTW26] Implement backend updates for interview scheduling feature Apr 19, 2026
@SaqAsh SaqAsh self-assigned this May 5, 2026
@SaqAsh
SaqAsh force-pushed the INTW26-interview-scheduling-feature branch 2 times, most recently from 892b33b to 61376b4 Compare May 8, 2026 04:03
@SaqAsh
SaqAsh changed the base branch from main to INTW26-build-interview-delegation-algorithm May 9, 2026 03:06
@SaqAsh
SaqAsh changed the base branch from INTW26-build-interview-delegation-algorithm to main May 9, 2026 03:07
@mxc-maggiechen
mxc-maggiechen force-pushed the INTW26-interview-scheduling-feature branch from 61376b4 to cda1ec9 Compare May 10, 2026 04:41
Comment on lines +128 to +144
const interviewers = delegations.map(
(delegation) => delegation.interviewer,
);
if (interviewers.length === 0) {
return [];
}

const uniqueByInterviewerId = new Set<number>();
const uniqueInterviewers = interviewers.filter((interviewer) => {
if (uniqueByInterviewerId.has(interviewer.id)) {
return false;
}
uniqueByInterviewerId.add(interviewer.id);
return true;
});

return uniqueInterviewers.map((interviewer) => toUserDTO(interviewer));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

idk if there is a better way to dedupe this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

update is required for the scheduling PR, create and delete are added as well bc it's just nice to have CRUD on a model all set

@mxc-maggiechen
mxc-maggiechen merged commit fa78636 into main May 10, 2026
1 check passed
@mxc-maggiechen
mxc-maggiechen deleted the INTW26-interview-scheduling-feature branch May 10, 2026 20:51
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