104 lines
2.8 KiB
Markdown
104 lines
2.8 KiB
Markdown
# Trainingsplan-Backend
|
|
|
|
Dieses Plugin ist nur noch das Eintragebackend fuer Trainingsplaene.
|
|
|
|
Es verwaltet:
|
|
|
|
- Plaene
|
|
- Uebungen in einer zentralen Uebungsbibliothek
|
|
- einfache Progressionsvarianten pro Uebung
|
|
- Trainingstage
|
|
- Warm-up und Cool-down pro Trainingstag
|
|
- Uebungen, die an Trainingstagen hinterlegt sind
|
|
|
|
Nicht mehr enthalten sind PDF-Erzeugung, Rezeptsammlungen,
|
|
Progressionsregeln, Wochenlogik, Tracking, Pruefungen, Planvorschlaege,
|
|
Analyse-/ChatGPT-Anbindungen und Farbdefinitionen fuer eine Ausgabeoberflaeche.
|
|
|
|
## Datenvertrag
|
|
|
|
Trainingsplaene verwenden:
|
|
|
|
```text
|
|
schema_version: 5
|
|
contract_version: 4
|
|
```
|
|
|
|
Eine Plan-Config ist bewusst flach:
|
|
|
|
```json
|
|
{
|
|
"schema_version": 5,
|
|
"contract_version": 4,
|
|
"plan_id": "basis-plan",
|
|
"meta": {
|
|
"title": "Basis-Plan"
|
|
},
|
|
"exercises": [
|
|
{
|
|
"id": "exercise-squat",
|
|
"name": "Squat",
|
|
"progressions": [
|
|
{ "id": "progression-deep-squat-hold", "name": "Deep Squat Hold" },
|
|
{ "id": "progression-negative-squat", "name": "Negative Squat" },
|
|
{ "id": "progression-full-squat", "name": "Full Squat" }
|
|
],
|
|
"current_progression_id": "progression-deep-squat-hold"
|
|
}
|
|
],
|
|
"days": [
|
|
{
|
|
"id": "day-1",
|
|
"num": 1,
|
|
"name": "Tag 1",
|
|
"warmup": { "items": ["Gelenke mobilisieren"] },
|
|
"cooldown": { "items": ["Locker auslaufen"] },
|
|
"exercises": [
|
|
{
|
|
"id": "day-exercise-1",
|
|
"exercise_id": "exercise-squat"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## API
|
|
|
|
- `GET /api/plans`
|
|
- `POST /api/plans`
|
|
- `GET /api/plans/<plan>`
|
|
- `POST /api/plans/<plan>`
|
|
- `POST /api/plans/<plan>/publish`
|
|
- `POST /api/plans/<plan>/rename`
|
|
- `DELETE /api/plans/<plan>`
|
|
- `GET /api/plans/<plan>/exercises`
|
|
- `POST /api/plans/<plan>/exercises`
|
|
- `PATCH /api/plans/<plan>/exercises/<exercise>`
|
|
- `DELETE /api/plans/<plan>/exercises/<exercise>`
|
|
- `GET /api/plans/<plan>/days`
|
|
- `POST /api/plans/<plan>/days`
|
|
- `PATCH /api/plans/<plan>/days/<day>`
|
|
- `DELETE /api/plans/<plan>/days/<day>`
|
|
- `POST /api/plans/<plan>/days/<day>/exercises`
|
|
- `PATCH /api/plans/<plan>/days/<day>/exercises/<item>`
|
|
- `DELETE /api/plans/<plan>/days/<day>/exercises/<item>`
|
|
|
|
Der alte aktive Config-Zugriff bleibt fuer einfache Clients erhalten:
|
|
|
|
- `GET /api/config`
|
|
- `POST /api/config`
|
|
- `GET /api/default`
|
|
- `POST /api/reset`
|
|
|
|
## Migration
|
|
|
|
Aeltere Trainingsplaene werden beim Laden auf den flachen Vertrag reduziert.
|
|
Uebungen aus alten Rotationen werden in die Uebungsbibliothek uebernommen und
|
|
als Tagesuebungen referenziert. Alte `stages.steps` oder `variants` werden
|
|
dedupliziert als einfache Progressionsvarianten an die Uebung gehaengt; die
|
|
erste Variante wird als aktuelle Wahrheit gesetzt, wenn noch keine aktuelle
|
|
Progression gespeichert ist. Warm-up und Cool-down werden aus den bisherigen
|
|
Tages- oder `prepost`-Feldern uebernommen.
|