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: Product Availability #38

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

Feat: Product Availability #38

mukunzidd opened this issue Apr 29, 2024 · 1 comment · Fixed by #74
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 mark a product as available or unavailable manually, so that buyers can view and purchase the available products. Products may need to be marked as unavailable due to reasons such as expiry date or out-of-stock situations.

Acceptance Criteria

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

Developer Notes

  • Document the API endpoint with Swagger
  • Define the request payload structure for updating product availability
  • Implement necessary validation checks for the request payload
  • Update the product availability status in the database
  • Handle scenarios where the product does not exist or does not belong to the requesting vendor
  • Write unit tests to cover different scenarios and edge cases

Related Issues

Definition of Done

  • API endpoint for updating product availability is implemented and functional
  • Validation checks are implemented for the requesting user's role and request payload
  • Product availability status is updated in the database
  • Appropriate error handling and response messages are implemented
  • Input sanitization measures are in place
  • 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: Vendor Product Availability Management Feat: Product Availability May 8, 2024
@niyobern
Copy link
Contributor

niyobern commented May 9, 2024

Deliverables at the end of the week:

  • Implement an API endpoint for updating product availability.
  • Handle authentication and authorization for vendors.
  • Ensure validation, error handling, and input sanitization.
  • Write unit tests, adhere to coding standards, and complete API documentation with Swagger.

Data Flow / Flowchart / Pseudocode / ERD Diagrams:

Flow Chat

product_availability drawio

Database ERD

er drawio (1)

Day 1: Thursday (09/05/2024)

  • Set up the project environment with necessary dependencies by 08:00 PM.
  • Update the database schema for storing product availability status.

Day 2: Friday (10/05/2024)

  • Implement authentication mechanisms to validate vendor roles.
  • Design the API endpoint for product availability update and implement basic validation checks by 5:00 PM.

Day 3: Saturday (11/05/2024)

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

Day 4: Sunday (12/05/2024)

Implement logic to handle product availability status in the database by 5:00 PM.

Day 5: Monday (13/05/2024)

  • Write unit tests for product availability update operation to ensure functionality.
  • Ensure adherence to coding standards and best practices.
  • Document API endpoint with Swagger and deploy to staging environment by 5:00 PM.

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.

External services or libraries to be used:

  • Swagger for API documentation.
  • Jest for unit testing.
  • Express.js for API endpoint creation.

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.

2 participants