hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
182 stars 105 forks source link

[FEAT] Endpoints for Fetch Product Stock management #284

Closed JumongComputers closed 2 weeks ago

JumongComputers commented 1 month ago

Description

Develop new API endpoints for managing product stock within the application. These endpoints will allow for retrieving current stock levels. This will provide flexibility and control over product inventory directly through the API.

Acceptance Criteria

Requirements

-Create three API endpoints: --GET /api/v1/products/:productId/stock: Fetch the current stock level for a specific product. -The GET endpoint should return the following fields in JSON format: -productId (string): The ID of the product. -currentStock (number): The current stock level of the product. -lastUpdated (string, date-time): The last time the stock level was updated. -Implement proper error handling for potential issues such as database connection errors, validation errors, and insufficient permissions.

Expected Outcome

-Functional and reliable GET /api/v1/products/:productId/stock, -The endpoints return the required fields in JSON format. -Proper error handling mechanisms are in place.

Endpoints

GET /api/v1/products/stock

- Success Response

**- Failure Response**
- Status: ` 400 Bad`
- Body:
```json
{
"statusCode": 400,
"message": "Bad Request"

}
highb33kay commented 1 month ago

This is too many endpoints in one ticket. You need to pick one and check for duplicate

JumongComputers commented 1 month ago

The last ticket that ended up being a duplicate had similar issue.i choose just the PUT but the other teams implemented the full CRUD and it was accepted i had to close it for them since they covered what i was implementing, however i will pick one

Neche-Stephen commented 1 month ago

Hi @zxenonx @highb33kay @JumongComputers @buka4rill @Homoakin619

I'd like to take on this issue and implement it in the Java repo. Please assign it to me.

Thank you!