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

Aishwarya_Purchase-Tool-Request-Form-Backend #670

Merged
merged 14 commits into from
Feb 11, 2024

Conversation

Aishwaryak01
Copy link
Contributor

@Aishwaryak01 Aishwaryak01 commented Dec 28, 2023

Aish_Purchase-Tool-Request-Form-(Backend)

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

Related PRS (if any):
This PR must be checked out to test #1752 frontend PR

Main changes explained:
Add BM Dashboard collections to the dev database: buildingTool
Add Mongoose schema file buildingTool
Add POST route to either create a new document in buildingTool collection (if the tool 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:
git checkout Aish_Purchase-Tool-Request-Form-(Backend)
npm install
npm run dev
check the related frontend PR for further instructions

Optional: connect to the dev db via Mongo Compass, open the buildingTool 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 the front and backend branches after you have finished testing!

Aish_Purchase-Tool-Request-Form-(Backend)
Copy link

@Alforoan Alforoan left a comment

Choose a reason for hiding this comment

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

I left a comment on the fe #1752.

Copy link
Contributor

@abdel-lall abdel-lall left a comment

Choose a reason for hiding this comment

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

LGTM.

tdkent
tdkent previously requested changes Jan 5, 2024
Copy link
Contributor

@tdkent tdkent left a comment

Choose a reason for hiding this comment

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

Please fix the merge conflicts. Also, Olga added new Tool router and controller files in her Tool Details branch. Can you merge your code into those files?

@Aishwaryak01 Aishwaryak01 changed the title Aish_Purchase-Tool-Request-Form-(Backend) Aish_Purchase-Tool-Request-Form-Backend Jan 6, 2024
@Aishwaryak01
Copy link
Contributor Author

Please fix the merge conflicts. Also, Olga added new Tool router and controller files in her Tool Details branch. Can you merge your code into those files?

I have made the suggested changes in both frontend and backend files. Files are now synced with the current dev branch. Can you check?

@Aishwaryak01 Aishwaryak01 requested a review from tdkent January 12, 2024 18:34
@Aishwaryak01 Aishwaryak01 changed the title Aish_Purchase-Tool-Request-Form-Backend Aishwarya_Purchase-Tool-Request-Form-Backend Jan 23, 2024
Copy link

@Renanluizssx Renanluizssx left a comment

Choose a reason for hiding this comment

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

Copy link

@KevHnh KevHnh left a comment

Choose a reason for hiding this comment

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

I tested this backend with the corresponding frontend pr and everything works as expected. I was able to submit a tool purchase request successfully.

OneCommunityGlobal/HighestGoodNetworkApp#1752 (review)

@xmyoot
Copy link

xmyoot commented Feb 4, 2024

See comment on front end pr: OneCommunityGlobal/HighestGoodNetworkApp#1752 (comment)

Copy link
Contributor

@Pandani07 Pandani07 left a comment

Choose a reason for hiding this comment

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

The functionality in this PR work as intended. I have left a review on the frontend PR

Copy link
Contributor

@ilyaflaks ilyaflaks left a comment

Choose a reason for hiding this comment

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

More detailed review on PR1752. I reviewed this code and found that it works perfectly. Good work!

Copy link

@SaiDeepak-NEU SaiDeepak-NEU left a comment

Choose a reason for hiding this comment

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

Hello Aishwarya,

Tested the purchase request :tools form submission and the submission worked pretty smooth. Status code 201 was being displayed in the network tab on successful submission as expected.
Screenshot (72)
Please review the frontend PR for additional pictures and comments.

Copy link
Contributor

@mohabbasd mohabbasd left a comment

Choose a reason for hiding this comment

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

Hello, tested this PR using the front end branch 1752 and this PR works as expected.

Copy link

@SRamen1999 SRamen1999 left a comment

Choose a reason for hiding this comment

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

I tested this backend with the corresponding frontend pr and everything works as expected.

OneCommunityGlobal/HighestGoodNetworkApp#1752 (review)

@one-community
Copy link
Member

Thank you all, merging!

@one-community one-community merged commit a0191e8 into development Feb 11, 2024
3 checks passed
@20chen-7
Copy link
Contributor

20chen-7 commented Mar 18, 2024

left review in the frontend, good job!

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.