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: Manage a Product #37

Closed
31 tasks done
mukunzidd opened this issue Apr 29, 2024 · 1 comment · Fixed by #62
Closed
31 tasks done

Feat: Manage a Product #37

mukunzidd opened this issue Apr 29, 2024 · 1 comment · Fixed by #62
Assignees
Labels
backend Good for newcomers

Comments

@mukunzidd
Copy link
Contributor

mukunzidd commented Apr 29, 2024

Description

As a Vendor, I should be able to perform Create, Read, Update, and Delete (CRUD) operations on products in my collection, so that I can effectively manage my inventory and make products available for sale to buyers.

Acceptance Criteria

Create

  • Implement a seller product creation API endpoint
  • Validate the requesting user's role as a seller
  • Validate the request body (price, name, category, expiry date, bonus, etc.)
  • Check if the target item already exists in the seller's collection
  • If the item does not exist, add it to the seller's collection
  • If the item exists, return a response suggesting an update of stock levels
  • Implement error handling and appropriate response messages for validation failures
  • Implement input sanitization
  • Ensure the product has a reference to the associated seller
  • Handle product images as reference URLs in the database (4 - 8 images)

Read

  • Implement an API endpoint for retrieving a seller's product collection
  • Validate the requesting user's role as a seller
  • Retrieve and return the list of products associated with the seller
  • Implement pagination and filtering options (if necessary)
  • Implement error handling and appropriate response messages

Update

  • Implement an API endpoint for updating a seller's product details
  • Validate the requesting user's role as a seller
  • Validate the request payload (product ID, updated fields)
  • Retrieve the product from the database based on the provided product ID
  • Ensure the product belongs to the requesting seller
  • Update the product details in the database
  • Implement error handling and appropriate response messages for validation failures
  • Implement input sanitization

Delete

  • Implement an API endpoint for deleting a seller's product
  • Validate the requesting user's role as a seller
  • Validate the request payload (product ID)
  • Retrieve the product from the database based on the provided product ID
  • Ensure the product belongs to the requesting seller
  • Delete the product from the database
  • Implement error handling and appropriate response messages for validation failures
  • Implement input sanitization

Developer Notes

  • Document with Swagger
  • All inputs should be validated for sanity
  • Only reference URLs may be stored in the database for the case of file uploads
  • The product should have a reference to the seller

Related Issues

  • #xx Add any related issues (User Authentication and Authorization)

Definition of Done

  • CRUD API endpoints for seller product management are implemented and functional
  • Appropriate responses are sent to the requesting client based on scenarios
  • Validation checks are implemented for request body and user role
  • Product images are handled as reference URLs in the database
  • Products have a reference to the associated seller
  • Unit tests are written and passing
  • Code adheres to coding standards and best practices
  • API documentation with Swagger is completed
@mukunzidd mukunzidd added the backend Good for newcomers label Apr 29, 2024
@mukunzidd mukunzidd changed the title Feat: A Vendor Should be Able to Create/Add a Product Feat: Vendor Should be Able to Manage a Product Apr 29, 2024
@mukunzidd mukunzidd changed the title Feat: Vendor Should be Able to Manage a Product Feat: Vendor should be Able to Manage a Product Apr 29, 2024
@mukunzidd mukunzidd changed the title Feat: Vendor should be Able to Manage a Product Feat: Manage a Product May 8, 2024
@mukunzidd mukunzidd added this to the Product Management milestone May 8, 2024
@wayneleon1
Copy link
Contributor

wayneleon1 commented May 9, 2024

Implementation plan for our task:

1. Deliverables at the end of the week:

  • Implement CRUD API endpoints for seller product management.
  • Handle authentication and authorization for sellers.
  • Ensure validation, error handling, and input sanitization.
  • Manage product images as reference URLs in the database.
  • Write unit tests, adhere to coding standards, and complete API documentation with Swagger.

2. Data Flow / Flowchart / Pseudocode / ERD Diagrams:

  • a flowchart illustrating the flow of data and operations within the CRUD operations for seller product management.
    flowchart illustrating the flow of data

-an ERD diagram to visualize the database schema for storing seller products and associated information.
Good One

3. Schedule of Implementation of Various Parts:

Day 1: Thursday (09/05/2024)

  • Set up the project environment with necessary dependencies by 5:00 PM.
  • Design the database schema for storing seller products and related information.

Day 2: Friday (10/05/2024)

  • Implement authentication mechanisms to validate seller roles.
  • Design API endpoints for seller product creation and implement basic validation checks by 5:00 PM.

Day 3: Saturday (11/05/2024)

  • Complete integration of seller product creation endpoint with authentication.
  • Implement error handling for validation failures and input sanitization by 5:00 PM.

Day 4: Sunday (12/05/2024)

  • Extend API endpoints for reading, updating, and deleting seller products.
  • Implement logic to handle product images as reference URLs in the database by 5:00 PM.

Day 5: Monday (11/05/2024)

  • Write unit tests for CRUD operations to ensure functionality.
  • Ensure adherence to coding standards and best practices.
  • Document API endpoints with Swagger and deploy to staging environment by 5:00 PM.

4.Additional Notes:

  • Conduct regular reviews and testing throughout the week to identify and address any issues promptly.
  • Collaborate closely with team members to ensure smooth integration of different components.
  • Maintain clear communication channels for feedback and updates on progress.
  • Allocate time for any unexpected challenges or additional requirements that may arise during implementation.

5. External services or libraries to be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants