Project

General

Profile

Torque Vault Server » History » Version 9

Trần Lâm Trường, 08/26/2026 03:46 PM

1 1 Trần Lâm Trường
# Torque Vault Server
2 2 Trần Lâm Trường
---
3
4
## Plans
5 3 Trần Lâm Trường
- [x] Migrate the source code from Gitlab to Gitea.
6 2 Trần Lâm Trường
- [x] Switch to `develop` branch to continue development.
7 8 Trần Lâm Trường
- [x] Standardize responses from API:
8 7 Trần Lâm Trường
  + **Overview**:
9
  All APIs in the system follow a consistent response contract based on RESTful principles.
10
  **Principles**:
11
    
12
      + HTTP status codes are the source of truth for the outcome of a request.
13
      + Successful responses return data in the `data` field.
14
      + Error responses return a standardized `code` and `message`.
15
      + Paginated collection responses include a `meta` object containing pagination information.
16
      + Validation errors include an additional `errors` field with field-level validation details.
17
      + All endpoints must follow the same response structure to ensure consistency across frontend, backend, and external integrations.  
18
19 4 Trần Lâm Trường
  + **Success response**:
20
    - *List resource (no pagination)*:
21
     `GET /api/v1/able-work-order?wo_id=1`
22
     => `200 OK`
23
    ```
24
    {
25
      "data": [
26
        WorkOrder_Object,
27
        WorkOrder_Object,
28
      ]
29
    }
30
    ```
31
    - *List resource (pagination)*:
32
    `GET /api/v1/work-orders?page=1&page_size=20`
33
    => `200 OK`
34
    ```
35
    {
36
      "data": [
37
        WorkOrder_Object,
38
        WorkOrder_Object,
39
      ],
40
      "meta": {
41
        "page": 1,
42
        "page_size": 20,
43
        "total_pages": 7
44
      }
45
    }
46
    ```
47
    - *Retrieve detail*:
48
    `GET /api/v1/work-orders/1`
49
    => `200 OK`
50
    ```
51
    {
52
     "data": WorkOrder_Object
53
    }
54
    ```
55
    - *Create resource*:
56
    `POST /api/v1/work-orders`
57
    => `201 Created`
58
    ```
59
    {
60
     "data": WorkOrder_Object
61
    }
62
    ```
63
    - *Update resource*:
64
    ` PUT/PATCH /api/v1/work-orders/1`
65
    => `200 OK`
66
    ```
67
    {
68
     "data": WorkOrder_Object
69
    }
70
    ```
71
    - *Delete resource*:
72
    ` DELETE /api/v1/work-orders/1`
73
    => `204 No Content`
74
    ```
75
    (Empty)
76
    ```
77
  + **Error response**:
78
    ```
79
    {
80
      "code": "string",
81
      "message": "string"
82
    }
83
    ```
84
      - *Validation Error*:
85
      `POST /api/v1/work-orders`
86
      => `400 Bad Request`
87
      ```
88
      {
89
        "code": "VALIDATION_ERROR",
90
        "message": "Validation failed",
91
        "errors": {
92
          "make": [
93
            "This field is required."
94
          ],
95
          "employee": [
96
            "This field is required."
97
          ]
98
        }
99
      }
100
      ```
101
      - *Resource Not Found*:
102
      `PATCH /api/v1/work-orders/1`
103
      => `404 Not Found`
104
      ```
105
      {
106 9 Trần Lâm Trường
        "code": "NOT_FOUND",
107 4 Trần Lâm Trường
        "message": "Work order not found"
108
      }
109
      ```
110 2 Trần Lâm Trường
- [ ] Develop an API endpoint for the mobile app home screen to retrieve all work orders whose status is Open, Retorque, Servicing, or Re-servicing.
111
- [ ] Migrate the `Help / Instructions` feature from `walmart` branch to `develop` branch.
112 6 Trần Lâm Trường
- [ ] Improve Backend, cache, rate limit,..
113 2 Trần Lâm Trường
- [ ] CI CD integration.