Closed faid-terence closed 5 months ago
@aimedivin Please make a clear description and attach an implementation plan for this issue !
The task will deliver API endpoints in two parties: one to get order status and another to update order status, with real-time updates using WebSocket. as these routes are protected, Security features will be added to verify user identity and permissions, and there will be checks to ensure the data sent in requests is correct.
Description:
The backend must manage the retrieval and updating of order status information, Information retrieved will be used on frontend, This involves handling GET request to fetch order status and POST request to update order status by either admin or Vendor. The system should also push real-time updates to the frontend whenever the order status changes.
Acceptance Criteria:
GIVEN a get request for order status information [Get single/ all order(s)] WHEN the requesting user/token is a admin or vendor the request is validated THEN: The appropriate order status information should be retrieved from the database The order status information should be sent to the frontend to be displayed to the buyer [ For Admin ]: retrieve all orders in DB [ For Vendor]: retrieve all orders related to the vendor.
GIVEN a post request to update order status WHEN the request body is validated and the requesting user/token is an admin/vendor THEN: The order status in the database should be updated [ Completed status is only set by admin ]; The updated order status should be sent to the frontend to be displayed to the buyer
Dev notes: