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: add voyage project submission status to /me endpoint #158

Merged
merged 7 commits into from
May 29, 2024

Conversation

timDeHof
Copy link
Collaborator

@timDeHof timDeHof commented May 24, 2024

Description

Features and Fixes

feat(users): Added support for the projectSubmitted field in the VoyageTeam entity and response.
fix(users): Updated the user object with sprintCheckInIds and projectStatus.

Summary of Changes

Database Changes:

Added a new column projectSubmitted to the VoyageTeam table with a default value of false.
Updated schema.prisma to include the new projectSubmitted field in the VoyageTeam model.

Backend Modifications:

Updated users.select.ts to include the projectSubmitted field in the select query for private user details.
Updated team.entity.ts to include the projectSubmitted field in the VoyageTeamEntity class.
Modified users.response.ts to include the projectSubmitted field in the VoyageTeam class.
Updated users.service.ts to fetch the projectSubmitted field from the database and update the user object with the sprintCheckInIds and projectStatus.

Issue link

closes Add voyage project submission status in /me endpoint

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature updates / changes
  • Tests
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Testing can be done by inspecting the response for the /me endpoint in swagger for the field.It would be either "True" or "False".

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have updated the change log

…ity and response

fix(users): update user object with sprintCheckInIds and projectStatus
The migration.sql file adds a new column "projectSubmitted" to the VoyageTeam table in the database. This column is set to a default value of false. The schema.prisma file is updated to include the new "projectSubmitted" field in the VoyageTeam model. The users.select.ts file is modified to include the "projectSubmitted" field in the select query for private user details. The team.entity.ts file is updated to include the "projectSubmitted" field in the VoyageTeamEntity class. The users.response.ts file is modified to include the "projectSubmitted" field in the VoyageTeam class. The users.service.ts file is updated to fetch the "projectSubmitted" field from the database and update the user object with the sprintCheckInIds and projectStatus.

These changes are done to support the functionality of tracking whether a project has been submitted by a VoyageTeam. The "projectSubmitted" field allows for easy retrieval of this information and the updated user object provides the necessary data for displaying the project status to the user.
…point

The `/me` endpoint now includes the voyage project submission status. This change was made to provide users with information about the status of their voyage project submission.
Copy link
Collaborator

@cherylli cherylli left a comment

Choose a reason for hiding this comment

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

we won't need projectSubmitted in the database as we can tell if the team has submitted the project if they have a record in the formResponseVoyageProject table

another thing is voyageTeam and teamMemberId are in user.req so we can save 2 two extra db calls

…UserDetailSelect

The FormResponseVoyageProject field is added to the privateUserDetailSelect object. This change allows the private user details to include the FormResponseVoyageProject field when selecting user data.
…ser object

feat(users.service.ts): update user object with sprintCheckInIds and modify voyageTeamMembers based on project submission status
The code now includes a check for the existence of the user before updating the user object. This prevents any potential errors when trying to update a non-existent user. The user object is then updated with the sprintCheckInIds. Additionally, the voyageTeamMembers are modified based on the project submission status. If the team member has a voyage team with a FormResponseVoyageProject, the projectSubmitted property is set to true. Otherwise, it is set to false.
@timDeHof
Copy link
Collaborator Author

we won't need projectSubmitted in the database as we can tell if the team has submitted the project if they have a record in the formResponseVoyageProject table

another thing is voyageTeam and teamMemberId are in user.req so we can save 2 two extra db calls

Ok, I was able to check and modify the voyageTeam with the projectSubmitted field to be set to true if the formResponseVoyageProject is not null in the voyageTeam. otherwise, it is set to false. This is now done without adding projectSubmitted in the database.

cherylli
cherylli previously approved these changes May 26, 2024
Copy link
Collaborator

@cherylli cherylli left a comment

Choose a reason for hiding this comment

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

thanks, this is perfect

Ajen07
Ajen07 previously approved these changes May 26, 2024
Copy link
Collaborator

@Ajen07 Ajen07 left a comment

Choose a reason for hiding this comment

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

Everything looks great ! The Swagger responses are functioning as expected.

timDeHof and others added 2 commits May 27, 2024 10:30
The console.log statement was removed as it was not providing any useful information and was cluttering the code.
@timDeHof timDeHof dismissed stale reviews from Ajen07 and cherylli via 250f0ce May 28, 2024 13:11
@timDeHof timDeHof requested review from cherylli and Ajen07 May 28, 2024 13:12
@timDeHof timDeHof merged commit fc0dde7 into dev May 29, 2024
1 check passed
@timDeHof timDeHof deleted the feat/add_voyage_project_submission_status branch May 29, 2024 15:07
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