OfficeGest
Workshop/Reports/Vehicles in park by day

Vehicles in park on the day

Returns how many service orders are in park as of the end of the current server day, plus the cut-off date that was queried. Draft, cancelled, invoiced, delivered and appointment service orders are excluded; every other status counts, and there is no lower date bound, so this is the whole park minus the orders dated in the future rather than the orders opened today. Counting is per service order with no DISTINCT on the vehicle, so two orders for the same vehicle count twice. The count is zero when the park is empty, never a 404. Every parameter is optional and additive: with none of them the payload is just the date and the count. warehouse_id restricts every number to one warehouse and is echoed back; compare_days adds a comparison block for an earlier day; history_days adds a daily series ending on the response date. The series is non-decreasing by construction -- see the history field description before plotting it as a park-over-time chart.

GET
/workshop/reports/vehicles-in-park-by-day
AuthorizationBearer <token>

In: header

Query Parameters

warehouse_id?integer

Restrict every number in the response to one warehouse (lojas.CodLoja). Omit for the whole park, which is what the legacy widget counts. An id that is not a real warehouse is a 422, never a silent zero.

history_days?integer

Number of daily points to return in history, ending on the response date. One of 0, 7, 30 or 90; 0 (the default) omits history entirely.

Value in0 | 7 | 30 | 90
compare_days?integer

Return a comparison block for the day this many days before the response date -- 1 is yesterday. Omit to leave comparison out of the payload.

Response Body

curl -X GET "https://og-tenant1.test:8003/api/v2/workshop/reports/vehicles-in-park-by-day?warehouse_id=0&history_days=0&compare_days=0"
{
  "data": {
    "date": "string",
    "count": 0,
    "warehouse_id": 0,
    "comparison": {
      "date": "string",
      "count": 0
    },
    "history": [
      {
        "date": "string",
        "count": 0
      }
    ]
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}