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

Gary add materials page #577

Merged
merged 14 commits into from
Nov 26, 2023
Merged

Gary add materials page #577

merged 14 commits into from
Nov 26, 2023

Conversation

GaryB93
Copy link
Contributor

@GaryB93 GaryB93 commented Oct 18, 2023

Description

This pull request adds the backend logic for the Purchase Request: Material form in the BM Dashboard (Phase 2).

Related PRS (if any):

This PR must be checked out to test #1427 frontend PR

Main changes explained:

  • Add BM Dashboard collections to dev database: buildingInventoryTypes, buildingMaterials
  • Add Mongoose schema files buildingInventoryType, buildingMaterial
  • Add GET route to return item type data
  • Add POST route to either create a new document in buildingMaterials collection (if the material is being ordered to the project for the first time), or update purchase record sub-document in an existing document (if the material has been ordered previously for the project). In either case, the purchaseRecord sub-document will have default values added to date, requestedBy and status fields, in addition to the submitted form data.

How to test:

  1. git checkout gary_add_materials_page
  2. npm install
  3. npm run dev
  4. check the related frontend PR for further instructions
  5. Optional: connect to the dev db via Mongo Compass, open the buildingMaterials collection, and observe that documents and sub-documents are being updated correctly.

Notes

  • Please remember to either Approve or Request Changes. Do not just leave a comment.
  • Please leave a review for BOTH front and backend branches after you have finished testing!
  • Gary began work on this branch and has since left the project. The branch and pull request are currently being managed by Tim.

@GaryB93 GaryB93 added the Do Not Review Do not review or look at code without full context label Oct 18, 2023
@tdkent tdkent removed the Do Not Review Do not review or look at code without full context label Nov 16, 2023
@Cavein254
Copy link

This pr works as expected check #1427 for testing details

Copy link
Contributor

@cvtqx cvtqx left a comment

Choose a reason for hiding this comment

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

Works as described, left my review in the front end PR. Great job!

Copy link

@Changhao3220K Changhao3220K left a comment

Choose a reason for hiding this comment

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

Hi @GaryB93
I left the review for BE in the FE part, these features works well. Thank you for the nice work!

@Aishwaryak01 Aishwaryak01 self-requested a review November 25, 2023 23:33
@Aishwaryak01 Aishwaryak01 reopened this Nov 25, 2023
@Aishwaryak01 Aishwaryak01 removed their request for review November 25, 2023 23:35
Copy link
Contributor

@Aishwaryak01 Aishwaryak01 left a comment

Choose a reason for hiding this comment

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

The code looks good to me! Great job @tdkent! Also tested FE part and it works as expected!

@one-community one-community merged commit 809f0d2 into development Nov 26, 2023
6 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.

7 participants