Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: getAllApplications #50

Merged
merged 7 commits into from
Mar 19, 2024
Merged

feat: getAllApplications #50

merged 7 commits into from
Mar 19, 2024

Conversation

ojn03
Copy link

@ojn03 ojn03 commented Feb 20, 2024

ℹ️ Issue

Closes #44 #59

📝 Description

Added GET endpoint at route "api/apps/"

If calling user is not a recruiter or admin, return 401 unauthurized. otherwise returns all applications of current cycle

response is an array of GetApplicationResponseDTO:
[
GetApplicationResponseDTO,
GetApplicationResponseDTO,
...
]

this is a bit different from what was specified in the ticket:
{
"applications": GetApplicationResponseDTO[]
}

because I believe it falls more in line with the existing endpoints and type definitions. If necessary I can change it to follow the ticket more exactly.

Comments/Questions:

  • I was unsure how to test this with postman. Im not sure how to emulate a recruiter/admin/other role as the calling user through postman. How would I do so?

  • Does req.user.status hold the calling users role (admin, Member, recruiter, etc)? I assumed so by looking at other endpoints, but Im not certain

  • Is there a reason the fields in the Cycle class were made private? I had to make them public to make this work

  • What is the numapps parameter in the application.toGetApplicationResponseDTO() function supposed to represent?

Copy link

@kimharr24 kimharr24 left a comment

Choose a reason for hiding this comment

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

Nice work! Added a few comments addressing your TODOs.

  1. For testing, you can sign up using your email and sign in, at which point your user information should be stored as a row in the Users table. You can directly modify your status field to be an Admin/Recruiter in pgAdmin for testing this endpoint. You can also add applications to the Applications table directly in pgAdmin.
  2. Yes
  3. Not sure, generally keeping fields private is good practice - I think @chromium-52 made this design decision
  4. The number of times an applicant has applied in the past

apps/backend/src/applications/applications.service.ts Outdated Show resolved Hide resolved
apps/backend/src/applications/applications.controller.ts Outdated Show resolved Hide resolved
apps/backend/src/applications/dto/cycle.ts Outdated Show resolved Hide resolved
apps/backend/src/applications/applications.service.ts Outdated Show resolved Hide resolved
@kimharr24 kimharr24 changed the title feat: getAllAplications endpoint resolves #44 feat: getAllApplications Mar 17, 2024
This was linked to issues Mar 17, 2024
Copy link
Member

@chromium-52 chromium-52 left a comment

Choose a reason for hiding this comment

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

💯 Just some quick comments but lgtm otherwise!

apps/backend/src/applications/utils.ts Outdated Show resolved Hide resolved
apps/backend/src/applications/applications.service.ts Outdated Show resolved Hide resolved
@kimharr24 kimharr24 merged commit 756de32 into main Mar 19, 2024
3 checks passed
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.

Current Year/Current Semester Env Variables GetApplicationSummary Create get all applications endpoint
4 participants