atlp-rwanda / knights-ecomm-be

Knights ecommerce backend APIs
https://knights-ecomm-be-lcdh.onrender.com
0 stars 0 forks source link

feat: check product availablity status update PR #81

Closed Ndevu12 closed 6 months ago

Ndevu12 commented 6 months ago

Description:

This Pull Request introduces a new feature that allows VENDOR to check and update the availability status of a product.

Changes include:

  1. Added a new endpoint that accepts a product ID as a parameter and isAvailable in the body as status of the product.
  2. The endpoint checks if the product exists and if the user has the necessary permissions to access and update the product's availability status.
  3. If the product does not exist or the user does not have the necessary permissions, the endpoint returns an appropriate error message and status code.
  4. If the product exists and the user has the necessary permissions, the endpoint update product's availability status according to the vender's input and returns appropriate message.
  5. Product availability status will be auto updated when product is out of stock or is expired once the vender requested for product availability status update.
  6. Added error handling to ensure all required fields are provided in the request body.
  7. Added tests to ensure the feature works as expected and handles edge cases.

This feature enhances the application's functionality by allowing users to check and update the availability status of a product, which can be useful for inventory management and planning purposes.

coveralls commented 6 months ago

Pull Request Test Coverage Report for Build 9090502983

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/services/productServices/productStatus.ts 34 40 85.0%
<!-- Total: 41 47 87.23% -->
Totals Coverage Status
Change from base Build 9067538715: 0.3%
Covered Lines: 847
Relevant Lines: 995

💛 - Coveralls