Files
node_learning_module_1/day1
bolade 7b3fd1298d Add order, shipping dock, and transaction routes with CRUD operations and Swagger documentation
- Implemented GET, POST, PUT, and DELETE endpoints for orders, shipping docks, and transactions.
- Added Swagger annotations for API documentation.
- Included error handling for database operations.
- Configured pnpm workspace to ignore built dependencies for sqlite3.
2025-11-12 11:12:05 +01:00
..
2022-02-06 20:59:48 -05:00
2022-02-06 20:59:48 -05:00
2022-02-06 21:41:19 -05:00
2022-02-06 20:59:48 -05:00

day 1

Instructions

shipping_dock
- id
- name
-status ENUM(active, inactive) (integer mapping)

transaction
- id
- order_id
- user_id
- shipping_dock_id
- amount
- notes

order
- id
- user_id
- amount
- tax
- notes
- status (paid, not paid) (integer mapping)
  • Make the CRUD API for these tables
GET /api/v1/shipping_dock (get all)
GET /api/v1/shipping_dock/:id (get one)
POST /api/v1/shipping_dock/:id (add one)
PUT /api/v1/shipping_dock/:id (update one)
DELETE /api/v1/shipping_dock/:id (delete one)

GET /api/v1/order (get all)
GET /api/v1/order/:id (get one)
POST /api/v1/order/:id (add one)
PUT /api/v1/order/:id (update one)
DELETE /api/v1/order/:id (delete one)

GET /api/v1/transaction (get all)
GET /api/v1/transaction/:id (get one)
POST /api/v1/transaction/:id (add one)
PUT /api/v1/transaction/:id (update one)
DELETE /api/v1/transaction/:id (delete one)
  • Everything must be done by end of date