Project

General

Profile

Actions

Torque Vault Server


Plans

  • Migrate the source code from Gitlab to Gitea.
  • Switch to develop branch to continue development.
  • 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",
        "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.
  • Display target torque in range +-4%
  • Migrate to Django 5.2, MariaDB database
  • Migrate the Help / Instructions feature from walmart branch to develop branch.
  • Improve Backend, cache, rate limit,..
  • CI CD integration.

Updated by Trần Lâm Trường 25 days ago · 11 revisions