Project

General

Profile

Torque Vault Server » History » Revision 9

Revision 8 (Trần Lâm Trường, 08/26/2026 03:33 PM) → Revision 9/11 (Trần Lâm Trường, 08/26/2026 03:46 PM)

# Torque Vault Server 
 --- 

 

 ## Plans 
 - [x] Migrate the source code from Gitlab to Gitea. 
 - [x] Switch to `develop` branch to continue development. 
 - [x] Standardize responses from API: 
   + **Overview**: 
   All APIs in the system follow a consistent response contract based on RESTful principles. 
   **Principles**: 
    
       + HTTP status codes are the source of truth for the outcome of a request. 
       + Successful responses return data in the `data` field. 
       + Error responses return a standardized `code` and `message`. 
       + Paginated collection responses include a `meta` object containing pagination information. 
       + Validation errors include an additional `errors` field with field-level validation details. 
       + All endpoints must follow the same response structure to ensure consistency across frontend, backend, and external integrations.   

   + **Success response**: 
     - *List resource (no pagination)*: 
      `GET /api/v1/able-work-order?wo_id=1` 
      => `200 OK` 
     ``` 
     { 
       "data": [ 
         WorkOrder_Object, 
         WorkOrder_Object, 
       ] 
     } 
     ``` 
     - *List resource (pagination)*: 
     `GET /api/v1/work-orders?page=1&page_size=20` 
     => `200 OK` 
     ``` 
     { 
       "data": [ 
         WorkOrder_Object, 
         WorkOrder_Object, 
       ], 
       "meta": { 
         "page": 1, 
         "page_size": 20, 
         "total_pages": 7 
       } 
     } 
     ``` 
     - *Retrieve detail*: 
     `GET /api/v1/work-orders/1` 
     => `200 OK` 
     ``` 
     { 
      "data": WorkOrder_Object 
     } 
     ``` 
     - *Create resource*: 
     `POST /api/v1/work-orders` 
     => `201 Created` 
     ``` 
     { 
      "data": WorkOrder_Object 
     } 
     ``` 
     - *Update resource*: 
     ` PUT/PATCH /api/v1/work-orders/1` 
     => `200 OK` 
     ``` 
     { 
      "data": WorkOrder_Object 
     } 
     ``` 
     - *Delete resource*: 
     ` DELETE /api/v1/work-orders/1` 
     => `204 No Content` 
     ``` 
     (Empty) 
     ``` 
   + **Error response**: 
     ``` 
     { 
       "code": "string", 
       "message": "string" 
     } 
     ``` 
       - *Validation Error*: 
       `POST /api/v1/work-orders` 
       => `400 Bad Request` 
       ``` 
       { 
         "code": "VALIDATION_ERROR", 
         "message": "Validation failed", 
         "errors": { 
           "make": [ 
             "This field is required." 
           ], 
           "employee": [ 
             "This field is required." 
           ] 
         } 
       } 
       ``` 
       - *Resource Not Found*: 
       `PATCH /api/v1/work-orders/1` 
       => `404 Not Found` 
       ``` 
       { 
         "code": "NOT_FOUND", "404_NOT_FOUND", 
         "message": "Work order not found" 
       } 
       ``` 
 - [ ] Develop an API endpoint for the mobile app home screen to retrieve all work orders whose status is Open, Retorque, Servicing, or Re-servicing. 
 - [ ] Migrate the `Help / Instructions` feature from `walmart` branch to `develop` branch. 
 - [ ] Improve Backend, cache, rate limit,.. 
 - [ ] CI CD integration.