# Bedarfsraster ersetzen

`PUT https://{tenant}.stamp.eu/rest/units/{unit}/shift_requirements`

Atomically replace the whole staffing requirement grid of a unit:
rows missing from the payload are deleted, existing ones updated and
new ones created (diff by (shift_id, weekday)). Skill requirements
are synced per row when provided

## Pfadparameter

| Name | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `unit` | string | ja | The unit ID |

## Request-Body

| Feld | Typ | Pflicht |
| --- | --- | --- |
| `requirements` | object[] | ja |
| `requirements[].shift_id` | string | ja |
| `requirements[].weekday` | integer | ja |
| `requirements[].min_count` | integer | ja |
| `requirements[].optimal_count` | integer \| null | nein |
| `requirements[].skill_requirements` | object[] \| null | nein |

## Antworten

### 200: Array of `ShiftRequirementResource`

| Feld | Typ | Pflicht |
| --- | --- | --- |
| `data` | object[] | ja |
| `data[].id` | string | ja |
| `data[].unit_id` | string | ja |
| `data[].shift_id` | string | ja |
| `data[].shift` | object | nein |
| `data[].shift.id` | string | ja |
| `data[].shift.name` | string | ja |
| `data[].shift.abbreviation` | string | ja |
| `data[].shift.color` | string | ja |
| `data[].shift.start_time` | string | ja |
| `data[].shift.end_time` | string | ja |
| `data[].shift.break_duration` | string | ja |
| `data[].shift.is_overnight` | string | ja |
| `data[].shift.schedule_model_id` | string | ja |
| `data[].shift.work_area_id` | string | ja |
| `data[].shift.tags` | string \| string[] | ja |
| `data[].shift.note` | string | ja |
| `data[].shift.fairness_weight` | integer | ja |
| `data[].shift.net_duration_ms` | integer | ja |
| `data[].weekday` | string | ja |
| `data[].min_count` | string | ja |
| `data[].optimal_count` | string | ja |
| `data[].skills` | string | nein |

### 401: Unauthenticated

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `message` | string | ja | Error overview. |

### 403: Authorization error

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `message` | string | ja | Error overview. |

### 404: Not found

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `message` | string | ja | Error overview. |

### 422: Validation error

| Feld | Typ | Pflicht | Beschreibung |
| --- | --- | --- | --- |
| `message` | string | ja | Errors overview. |
| `errors` | object | ja | A detailed description of each field that failed validation. |
