feat: založení základní stránky příjem/výdej + import a statistiky

This commit is contained in:
Ondřej Anděl
2026-09-07 14:58:49 +02:00
commit a5711f3e1e
98 changed files with 15505 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
post:
operationId: addActivity
summary: Přidá pohybovou aktivitu do zvoleného dne.
requestBody:
required: true
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/ActivityInput"
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
+29
View File
@@ -0,0 +1,29 @@
post:
operationId: deleteActivity
summary: Smaže aktivitu.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [id, date]
properties:
id:
type: string
date:
type: string
format: date
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: Záznam neexistuje
+28
View File
@@ -0,0 +1,28 @@
post:
operationId: updateActivity
summary: Upraví existující aktivitu.
requestBody:
required: true
content:
application/json:
schema:
allOf:
- type: object
required: [id]
properties:
id:
type: string
- $ref: "../../schemas/_index.yml#/ActivityInput"
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: Záznam neexistuje
+23
View File
@@ -0,0 +1,23 @@
get:
operationId: searchCalories
summary: |
Najde návrhy energetické hodnoty pro název jídla — z vlastní knihovny
dřívějších zadání a od externího poskytovatele.
parameters:
- in: query
name: q
required: true
schema:
type: string
description: Název jídla, ke kterému se hledá energetická hodnota
responses:
"200":
description: Nalezené návrhy
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/CalorieSearchResult"
"400":
description: Nebyl předán hledaný název
"401":
description: Neautentizovaný uživatel
+11
View File
@@ -0,0 +1,11 @@
get:
operationId: getConfig
summary: Vrátí veřejnou runtime konfiguraci klienta.
security: []
responses:
"200":
description: Runtime konfigurace
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/Config"
+22
View File
@@ -0,0 +1,22 @@
get:
operationId: getDayOverview
summary: Vrátí kompletní přehled dne — jídlo, pohyb a energetickou bilanci.
parameters:
- in: query
name: date
required: false
schema:
type: string
format: date
description: Datum ve formátu YYYY-MM-DD. Výchozí je dnešek.
responses:
"200":
description: Přehled dne
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/DayOverview"
"400":
description: Neplatné datum
"401":
description: Neautentizovaný uživatel
+22
View File
@@ -0,0 +1,22 @@
post:
operationId: importLuncher
summary: |
Naimportuje měsíční přehled vyexportovaný z Luncheru (XLSX, CSV nebo JSON).
Řádky se založí do dnů, ke kterým patří, ve výchozím stavu jako oběd.
requestBody:
required: true
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/ImportRequest"
responses:
"200":
description: Výsledek importu, nebo jeho náhled při dryRun
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/ImportResult"
"400":
description: Nepodporovaný formát nebo poškozený soubor
"401":
description: Neautentizovaný uživatel
+22
View File
@@ -0,0 +1,22 @@
post:
operationId: login
summary: Přihlásí uživatele a vrátí JWT token.
security: []
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
login:
type: string
responses:
"200":
description: JWT token přihlášeného uživatele
content:
application/json:
schema:
type: string
"500":
description: Nebyl předán login
+20
View File
@@ -0,0 +1,20 @@
post:
operationId: addMeal
summary: Přidá jídlo do zvoleného dne.
requestBody:
required: true
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/MealInput"
responses:
"200":
description: Aktualizovaný přehled dne
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/DayRecord"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel
+22
View File
@@ -0,0 +1,22 @@
get:
operationId: getDay
summary: Vrátí jídla přihlášeného uživatele za jeden den.
parameters:
- in: query
name: date
required: false
schema:
type: string
format: date
description: Datum ve formátu YYYY-MM-DD. Výchozí je dnešek.
responses:
"200":
description: Přehled jídel daného dne
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/DayRecord"
"400":
description: Neplatné datum
"401":
description: Neautentizovaný uživatel
+31
View File
@@ -0,0 +1,31 @@
post:
operationId: deleteMeal
summary: Smaže záznam o jídle.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [id, date]
properties:
id:
description: Identifikátor mazaného záznamu
type: string
date:
description: Datum záznamu (YYYY-MM-DD)
type: string
format: date
responses:
"200":
description: Aktualizovaný přehled dne
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/DayRecord"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel
"404":
description: Záznam neexistuje
+31
View File
@@ -0,0 +1,31 @@
get:
operationId: getRange
summary: Vrátí jídla přihlášeného uživatele za rozsah dnů.
parameters:
- in: query
name: from
required: true
schema:
type: string
format: date
description: První den rozsahu (včetně), YYYY-MM-DD
- in: query
name: to
required: true
schema:
type: string
format: date
description: Poslední den rozsahu (včetně), YYYY-MM-DD
responses:
"200":
description: Dny s alespoň jedním záznamem, vzestupně dle data
content:
application/json:
schema:
type: array
items:
$ref: "../../schemas/_index.yml#/DayRecord"
"400":
description: Neplatný rozsah
"401":
description: Neautentizovaný uživatel
+29
View File
@@ -0,0 +1,29 @@
post:
operationId: updateMeal
summary: Upraví existující záznam o jídle.
requestBody:
required: true
content:
application/json:
schema:
allOf:
- type: object
required: [id]
properties:
id:
description: Identifikátor upravovaného záznamu
type: string
- $ref: "../../schemas/_index.yml#/MealInput"
responses:
"200":
description: Aktualizovaný přehled dne
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/DayRecord"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel
"404":
description: Záznam neexistuje
+25
View File
@@ -0,0 +1,25 @@
post:
operationId: saveBasalCalories
summary: Uloží klidový výdej (bazální metabolismus) přihlášeného uživatele.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
basalCalories:
description: Klidový výdej v kcal za den. Null nebo 0 ho odstraní.
type: integer
nullable: true
responses:
"200":
description: Aktualizované nastavení
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/UserSettings"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel
+41
View File
@@ -0,0 +1,41 @@
get:
operationId: getSettings
summary: Vrátí nastavení přihlášeného uživatele.
responses:
"200":
description: Nastavení uživatele
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/UserSettings"
"401":
description: Neautentizovaný uživatel
post:
operationId: saveSourceRate
summary: Uloží nebo smaže cenu za 100 g u jednoho zdroje.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [source]
properties:
source:
description: Název zdroje (podniku)
type: string
pricePer100g:
description: Cena za 100 g v haléřích. Null nebo 0 sazbu odstraní.
type: integer
nullable: true
responses:
"200":
description: Aktualizované nastavení
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/UserSettings"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel
+29
View File
@@ -0,0 +1,29 @@
get:
operationId: getFoodStats
summary: Vrátí statistiky útraty a jídel za zvolené období.
parameters:
- in: query
name: from
required: true
schema:
type: string
format: date
description: První den období (včetně), YYYY-MM-DD
- in: query
name: to
required: true
schema:
type: string
format: date
description: Poslední den období (včetně), YYYY-MM-DD
responses:
"200":
description: Statistiky za období
content:
application/json:
schema:
$ref: "../../schemas/_index.yml#/FoodStats"
"400":
description: Neplatný rozsah
"401":
description: Neautentizovaný uživatel
+31
View File
@@ -0,0 +1,31 @@
post:
operationId: applyWorkoutTemplate
summary: Založí do zvoleného dne všechny položky šablony tréninku.
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 položky založí
type: string
format: date
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: deleteWorkoutTemplate
summary: Smaže šablonu tréninku.
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#/WorkoutTemplate"
"400":
description: Neplatná data
"401":
description: Neautentizovaný uživatel
+14
View File
@@ -0,0 +1,14 @@
get:
operationId: getWorkoutTemplates
summary: Vrátí šablony tréninků 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#/WorkoutTemplate"
"401":
description: Neautentizovaný uživatel
+33
View File
@@ -0,0 +1,33 @@
post:
operationId: saveWorkoutTemplate
summary: Založí novou šablonu tréninku, nebo upraví existující.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [name, items]
properties:
id:
description: Identifikátor upravované šablony. Bez něj se založí nová.
type: string
name:
type: string
items:
type: array
items:
$ref: "../../schemas/_index.yml#/WorkoutTemplateItem"
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