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

Create new PATCH partner endpoint #418

Open
5 tasks
eleanorreem opened this issue May 6, 2024 · 3 comments
Open
5 tasks

Create new PATCH partner endpoint #418

eleanorreem opened this issue May 6, 2024 · 3 comments
Assignees
Labels
complexity: moderate Time needed to do this ticket will be moderate e.g. 1-2 days help wanted Extra attention is needed maintenance Maintenance / chore work

Comments

@eleanorreem
Copy link
Contributor

Overview

We want to at some point be using Rest properly. Currently, this is not the case. Each endpoint which deviates from REST patterns should be duplicated and corrected. We can later migrate the frontend over to the correct endpoint and delete the incorrect usage. We don't need to be super strict but just better than where we are now.

Our current url POST /v1/partner/delete does not make sense. Firstly, this is because functionally it is a soft delete. We merely set the status of the partner from active to inactive. Secondly the usage of POST is incorrect.

Action Items

  • See /bloom-backend/src/partner/partner.controller.ts. Look for the POST /v1/partner/delete endpoint. We want to replicate the functionality of this endpoint.
  • We want this url to be a PATCH request with the url /v1/partner/:id and with a body that accepts {active: boolean} .
  • You will also need to create a new service method with a different name. Instead of deletePartner, it should be updatePartner. updatePartner should take both the partnerId and a body DTO which all the changes inside. Please see bloom-backend/src/partner-feature/partner-feature.service.ts. Look at updatePartnerFeature as an example.
  • Please feel free to delete the old version.
  • Create a test file with a new test for the new service method. It would be good to cover the pass and fail scenario.

Resources/Instructions

  • the bloom-backend/src/partner-feature/partner-feature.service.ts folder is a better example of how we want our controllers and services to be structured. Take a look at those so you have an understanding of our preferred patterns.
@eleanorreem eleanorreem added help wanted Extra attention is needed complexity: moderate Time needed to do this ticket will be moderate e.g. 1-2 days maintenance Maintenance / chore work labels May 6, 2024
@chinmaym07
Copy link

chinmaym07 commented May 11, 2024

Hey @eleanorreem Can I give it a try ?

@eleanorreem
Copy link
Contributor Author

@chinmaym07 sorry for the delay! I missed this notification. You have been assigned 😄

Copy link

Thank you for your interest in contributing to Chayn! Please carefully read the CONTRIBUTING.md file and the README.md file for guidance. Let us know if you have any questions. Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: moderate Time needed to do this ticket will be moderate e.g. 1-2 days help wanted Extra attention is needed maintenance Maintenance / chore work
Projects
None yet
Development

No branches or pull requests

3 participants