feat: zlepšení šablon, přidány osobní údaje a spánkový režim

This commit is contained in:
Ondřej Anděl
2026-09-15 14:16:42 +02:00
parent a5711f3e1e
commit 21b01528e9
51 changed files with 3739 additions and 504 deletions
+29
View File
@@ -0,0 +1,29 @@
post:
operationId: saveSleep
summary: Uloží délku spánku pro zvolený den.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [date]
properties:
date:
type: string
format: date
sleepMinutes:
description: Délka spánku v minutách. Null nebo 0 záznam odstraní.
type: integer
nullable: true
responses:
"200":
description: Aktualizovaný přehled dne
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/DayOverview"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel
+35
View File
@@ -0,0 +1,35 @@
post:
operationId: applyMealTemplate
summary: Založí jídlo ze šablony do zvoleného dne.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [id, date]
properties:
id:
description: Identifikátor šablony
type: string
date:
description: Den, do kterého se jídlo založí
type: string
format: date
mealType:
description: Chod. Bez něj se použije chod ze šablony, jinak oběd.
allOf:
- $ref: "../../schemas/_index.yml#/MealType"
responses:
"200":
description: Aktualizovaný přehled dne
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/DayOverview"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel
"404":
description: Šablona neexistuje
+26
View File
@@ -0,0 +1,26 @@
post:
operationId: deleteMealTemplate
summary: Smaže šablonu jídla.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [id]
properties:
id:
type: string
responses:
"200":
description: Aktualizovaný seznam šablon
content:
application/json:
schema:
type: array
items:
$ref: "../../schemas/_index.yml#/MealTemplate"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel
+33
View File
@@ -0,0 +1,33 @@
post:
operationId: createMealTemplateFromMeal
summary: Vytvoří šablonu jídla z existujícího záznamu v přehledu dne.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [id, date]
properties:
id:
description: Identifikátor jídla, ze kterého se šablona vytvoří
type: string
date:
description: Den, ve kterém jídlo je
type: string
format: date
responses:
"200":
description: Aktualizovaný seznam šablon
content:
application/json:
schema:
type: array
items:
$ref: "../../schemas/_index.yml#/MealTemplate"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel
"404":
description: Jídlo neexistuje
+14
View File
@@ -0,0 +1,14 @@
get:
operationId: getMealTemplates
summary: Vrátí šablony jídel přihlášeného uživatele.
responses:
"200":
description: Šablony seřazené podle názvu
content:
application/json:
schema:
type: array
items:
$ref: "../../schemas/_index.yml#/MealTemplate"
"401":
description: Neautentizovaný uživatel
+22
View File
@@ -0,0 +1,22 @@
post:
operationId: saveMealTemplate
summary: Založí novou šablonu jídla, nebo upraví existující.
requestBody:
required: true
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/MealTemplateInput"
responses:
"200":
description: Aktualizovaný seznam šablon
content:
application/json:
schema:
type: array
items:
$ref: "../../schemas/_index.yml#/MealTemplate"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel
+20
View File
@@ -0,0 +1,20 @@
post:
operationId: saveProfile
summary: Uloží tělesné údaje uživatele a přepočte z nich klidový výdej.
requestBody:
required: true
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/PersonalProfile"
responses:
"200":
description: Aktualizované nastavení včetně dopočteného klidového výdeje
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/UserSettings"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel
+40
View File
@@ -0,0 +1,40 @@
post:
operationId: createWorkoutTemplateFromActivities
summary: |
Vytvoří šablonu tréninku z aktivit zaznamenaných v přehledu dne.
Bez výčtu identifikátorů se použijí všechny aktivity daného dne.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [date, name]
properties:
date:
description: Den, ze kterého se aktivity berou
type: string
format: date
name:
description: Název nové šablony
type: string
ids:
description: |
Identifikátory aktivit, které se do šablony dostanou.
Bez nich se použijí všechny aktivity dne.
type: array
items:
type: string
responses:
"200":
description: Aktualizovaný seznam šablon
content:
application/json:
schema:
type: array
items:
$ref: "../../schemas/_index.yml#/WorkoutTemplate"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel