# 6. Pachtobjekte

### `GET /patchobjekte`

Liste aller Pachtobjekte.

**Query-Parameter:**

<table data-sourcepos="268:1-274:26" id="bkmrk-parameter-typ-beschr"><thead data-sourcepos="268:1-268:35"><tr data-sourcepos="268:1-268:35"><th data-sourcepos="268:1-268:14">Parameter</th><th data-sourcepos="268:14-268:20">Typ</th><th data-sourcepos="268:20-268:35">Beschreibung</th></tr></thead><tbody data-sourcepos="270:1-274:26"><tr data-sourcepos="270:1-270:68"><td data-sourcepos="270:1-270:13">`search`</td><td data-sourcepos="270:13-270:22">string</td><td data-sourcepos="270:22-270:68">Suche in Objektnummer, Bezeichnung, Adresse</td></tr><tr data-sourcepos="271:1-271:75"><td data-sourcepos="271:1-271:13">`status`</td><td data-sourcepos="271:13-271:22">string</td><td data-sourcepos="271:22-271:75">`aktuell` | `veraltet` | `kritisch` | `geplant`</td></tr><tr data-sourcepos="272:1-272:72"><td data-sourcepos="272:1-272:19">`pachtkontoId`</td><td data-sourcepos="272:19-272:29">integer</td><td data-sourcepos="272:29-272:72">Nur Objekte eines bestimmten Pachtkontos</td></tr><tr data-sourcepos="273:1-273:25"><td data-sourcepos="273:1-273:11">`page`</td><td data-sourcepos="273:11-273:21">integer</td><td data-sourcepos="273:21-273:25">—</td></tr><tr data-sourcepos="274:1-274:26"><td data-sourcepos="274:1-274:12">`limit`</td><td data-sourcepos="274:12-274:22">integer</td><td data-sourcepos="274:22-274:26">—</td></tr></tbody></table>

**Antwort `200`:** Paginierte Liste von `Patchobjekt`-Objekten.

---

### `GET /patchobjekte/status-overview`

Statusverteilung aller Pachtobjekte.

**Antwort `200`:**

<div class=" useView-module__vOh_Ha__view css-1p8y1um" id="bkmrk-%5B-%7B%22status%22%3A-%22aktuel"><div class=" useView-module__vOh_Ha__view _sdz_surface-bg _sdz_surface css-apx1o7"><div class="CodeViewer2-module___Y4KcW__line"><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1n">\[</span></div><div class="CodeViewer2-module___Y4KcW__line"><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1m">{</span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ26">"status"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">: </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1t">"aktuell"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">, </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ26">"count"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">: </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ23">52</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">, </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ26">"label"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">: </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1t">"Aktuell"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1m">}</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">,</span></div><div class="CodeViewer2-module___Y4KcW__line"><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1m">{</span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ26">"status"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">: </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1t">"kritisch"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">, </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ26">"count"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">: </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ23">3</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">, </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ26">"label"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">: </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1t">"Kritisch"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1m">}</span></div><div class="CodeViewer2-module___Y4KcW__line"><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1n">\]</span></div><div class="css-1ath0al"><div class="css-ggepfv"><button aria-label="Copy code to clipboard" class=" useView-module__vOh_Ha__view IconButton-module__eEtQNq__root Interactive2-module__BR3hWq__shades Interactive2-module__BR3hWq__root Interactive2-module__BR3hWq__transition Interactive2-module__BR3hWq__disabled _sdz_text _sdz_surface-bg _sdz_custom-hover:shades-up-2 _sdz_custom-pressed:shades-up-3 Interactive2-module__BR3hWq__borderRadius Interactive2-module__BR3hWq__focus" data-react-aria-pressable="true" type="button"><svg aria-hidden="true" class="Icon-module__CwnszW__icon " fill="currentColor" height="16" preserveaspectratio="xMidYMin" viewbox="0 0 24 24" width="16"><path clip-rule="evenodd" d="M20 7.25A2.75 2.75 0 0 1 22.75 10v10A2.75 2.75 0 0 1 20 22.75H10A2.75 2.75 0 0 1 7.25 20V10A2.75 2.75 0 0 1 10 7.25h10Zm-10 1.5c-.69 0-1.25.56-1.25 1.25v10c0 .69.56 1.25 1.25 1.25h10c.69 0 1.25-.56 1.25-1.25V10c0-.69-.56-1.25-1.25-1.25H10Z" fill-rule="evenodd"></path><path d="M14 1.25A2.756 2.756 0 0 1 16.75 4a.75.75 0 0 1-1.5 0c0-.686-.564-1.25-1.25-1.25H4c-.686 0-1.25.564-1.25 1.25v10c0 .686.564 1.25 1.25 1.25a.75.75 0 0 1 0 1.5A2.756 2.756 0 0 1 1.25 14V4A2.756 2.756 0 0 1 4 1.25h10Z"></path></svg></button></div></div></div></div>---

### `POST /patchobjekte`

Neues Pachtobjekt anlegen.

**Pflichtfelder:**

<div class=" useView-module__vOh_Ha__view css-1p8y1um" id="bkmrk-%7B-%22objektnummer%22%3A-%22o"><div class=" useView-module__vOh_Ha__view _sdz_surface-bg _sdz_surface css-apx1o7"><div class="CodeViewer2-module___Y4KcW__line"><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1m">{</span></div><div class="CodeViewer2-module___Y4KcW__line"><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ26">"objektnummer"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">: </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1t">"OBJ-2025-042"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">,</span></div><div class="CodeViewer2-module___Y4KcW__line"><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ26">"bezeichnung"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">: </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1t">"Scheune Nordfeld"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">,</span></div><div class="CodeViewer2-module___Y4KcW__line"><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ26">"typ"</span><span class="CodeViewer2-module___Y4KcW__span cv2-span">: </span><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1t">"gebaeude"</span></div><div class="CodeViewer2-module___Y4KcW__line"><span class="CodeViewer2-module___Y4KcW__span cv2-span ͼ1m">}</span></div><div class="css-1ath0al"><div class="css-ggepfv"><button aria-label="Copy code to clipboard" class=" useView-module__vOh_Ha__view IconButton-module__eEtQNq__root Interactive2-module__BR3hWq__shades Interactive2-module__BR3hWq__root Interactive2-module__BR3hWq__transition Interactive2-module__BR3hWq__disabled _sdz_text _sdz_surface-bg _sdz_custom-hover:shades-up-2 _sdz_custom-pressed:shades-up-3 Interactive2-module__BR3hWq__borderRadius Interactive2-module__BR3hWq__focus" data-react-aria-pressable="true" type="button"><svg aria-hidden="true" class="Icon-module__CwnszW__icon " fill="currentColor" height="16" preserveaspectratio="xMidYMin" viewbox="0 0 24 24" width="16"><path clip-rule="evenodd" d="M20 7.25A2.75 2.75 0 0 1 22.75 10v10A2.75 2.75 0 0 1 20 22.75H10A2.75 2.75 0 0 1 7.25 20V10A2.75 2.75 0 0 1 10 7.25h10Zm-10 1.5c-.69 0-1.25.56-1.25 1.25v10c0 .69.56 1.25 1.25 1.25h10c.69 0 1.25-.56 1.25-1.25V10c0-.69-.56-1.25-1.25-1.25H10Z" fill-rule="evenodd"></path><path d="M14 1.25A2.756 2.756 0 0 1 16.75 4a.75.75 0 0 1-1.5 0c0-.686-.564-1.25-1.25-1.25H4c-.686 0-1.25.564-1.25 1.25v10c0 .686.564 1.25 1.25 1.25a.75.75 0 0 1 0 1.5A2.756 2.756 0 0 1 1.25 14V4A2.756 2.756 0 0 1 4 1.25h10Z"></path></svg></button></div></div></div></div>**Typ-Werte:** `gebaeude` | `flaeche` | `anlage` | `infrastruktur` | `sonstiges`  
**Status-Werte:** `aktuell` | `veraltet` | `kritisch` | `geplant` (Standard: `aktuell`)

**Optionale Felder:** `status`, `pachtkontoId`, `besitzerId`, `betreuerId`, `adresse`, `strasse`, `hausnummer`, `plz`, `ort`, `bundesland`, `land`, `gemeinde`, `flur`, `flurstueck`, `flaeche`, `einheit`, `baujahr`, `letzterPatch`, `naechsterPatch`, `version`, `beschreibung`

**Antwort `201`:** Angelegtes `Patchobjekt`-Objekt.

---

### `GET /patchobjekte/{id}`

Einzelnes Pachtobjekt abrufen.

**Antwort `200`:** `Patchobjekt`-Objekt.  
**Antwort `404`:** Nicht gefunden.

---

### `PUT /patchobjekte/{id}` / `DELETE /patchobjekte/{id}`

Wie bei Pachtkonten — Aktualisieren (`200`) bzw. Löschen (`204`).