> ## Documentation Index
> Fetch the complete documentation index at: https://docs.solvice.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Solution

The solution endpoint returns the solution of the solve job. It contains the score, the trips and the violations.

| Name                          | Type                         | Description                                                                                                                  |
| ----------------------------- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `id`                          | string                       | Id of the solve job                                                                                                          |
| `status`                      | String                       | Status of the Response (`QUEUED`, `SOLVING`, `SOLVED` or `ERROR`)                                                            |
| `score`                       | \[[Score](#score)]           | Score tells you how good a solution is.                                                                                      |
| `trips`                       | \[[Trip](#trip)]             | Actual solution: trips per workingtime/day and per resource                                                                  |
| `totalWaitTimeInSeconds`      | integer                      | Wait time for all resources                                                                                                  |
| `totalTravelTimeInSeconds`    | integer                      | Travel time for all resources                                                                                                |
| `totalTravelDistanceInMeters` | integer                      | Travel distance for all resources                                                                                            |
| `totalServiceTimeInSeconds`   | integer                      | Service time for all resources                                                                                               |
| `unserved`                    | \[string]                    | When `options.partialPlanning` is set, then this might result in a list of jobs that are unserved and not in the planning.   |
| `unservedReasons`             | object                       | Map of job names to reasons why they could not be served                                                                     |
| `violations`                  | \[[Violation](#violation)]   | A constraint that is broken in the current solution with a certain value (penalty) and a certain level (hard, soft, medium). |
| `workloadFairness`            | number                       | How fair a certain workload is divided over the resources (0-1, where 1 is perfectly fair).                                  |
| `occupancy`                   | number                       | How full this schedule is in terms of work time (incl travel) over capacity. Eg 0.80 for 80%                                 |
| `messages`                    | \[string]                    | Events and warnings generated during the solver execution                                                                    |
| `suggestions`                 | \[[Suggestion](#suggestion)] | List of suggested assignments returned by suggest api call                                                                   |

Example:

```json solution [expandable] theme={null}
{
  "id": "0000-00000-00000-0000",
  "score": {
    "hard": 0,
    "soft": -6924,
    "feasible": true
  },
  "trips": [
    {
      "visits": [
        {
          "arrival": "2023-01-13T08:44:54",
          "job": "JOB-6",
          "location": "50.89633806889935;4.45161298168845"
        },
        {
          "arrival": "2023-01-13T10:21:25",
          "job": "JOB-5",
          "location": "50.94837893617721;4.001604640663746"
        },
        {
          "arrival": "2023-01-13T11:55:17",
          "job": "JOB-10",
          "location": "50.78868282668716;4.167956383823208"
        }
      ],
      "resource": "R-1",
      "date": "2023-01-13",
      "departureTime": "2023-01-13T08:00:00",
      "waitTime": 0,
      "travelTime": 6917,
      "workTime": 17717,
      "serviceTime": 10800
    }
  ],
  "totalTravelTimeInSeconds": 6917,
  "totalServiceTimeInSeconds": 10800,
  "workloadFairness": 0.5,
  "unserved": [
    "JOB-1",
    "JOB-2",
    "JOB-3",
    "JOB-4",
    "JOB-7",
    "JOB-8",
    "JOB-9"
  ],
  "status": "SOLVED",
  "occupancy": 0.65,
  "messages": ["Solution found in 2.5 seconds"],
  "unservedReasons": {
    "JOB-1": ["DATE_TIME_WINDOW_CONFLICT"],
    "JOB-2": ["NO_MATCHING_TAGS"]
  }
}
```
