Completed task for the Core PHP/GO position.
To run the project Docker needs to be installed within the system.
Steps:
- Download the project from the Github.
- Open the terminal within the downloaded project folder.
- Type:
docker compose up
- Wait until Docker finishes executing the command.
Within this project there are 6 available RESTful endpoints.
These enpoints are:
POST http://127.0.0.1/orders
Used to create a new order.
Required parameters within the request body - user_id, title, email.
POST http://127.0.0.1/order/product
Used to assign a product to the order.
Required parameters within the request body - order_id, product_id.
GET http://127.0.0.1/orders
Used to list all orders and filter them by user_id, email and sort by created_at.
Optional parameters within the URI - user_id, email, sort.
GET http://127.0.0.1/order/{order_id}
Used to show specific order with assigned products.
Required parameter within the URI - order_id.
PATCH http://127.0.0.1/product/{product_id}
Used to update product name or amount.
Required parameter within the URI - product_id.
Optional parameters within the request body - name, amount.
DELETE http://127.0.0.1/order/{order_id}/product/{product_id}
Used to delete assigned product from order.
Required parameters within the URI - order_id, product_id.