Enhance training unit sections handling and documentation for parallel training streams
Deploy Development / deploy (push) Successful in 39s
Test Suite / pytest-backend (push) Successful in 36s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m9s

- Updated the backend to improve the fetching and insertion of training unit sections, including a new function for handling section items.
- Added documentation notes regarding the unique constraint on `training_unit_sections` and the implications for parallel training streams.
- Updated frontend components and utility functions to reflect changes in the training planning API and to prepare for future enhancements related to parallel streams.
This commit is contained in:
Lars committed 2026-05-14 22:24:55 +02:00
1 parent e759076a6c
commit 220a16429c
11 files changed
+437 -54

No files matched your search

+2 -1
View File
@@ -20,7 +20,8 @@ export function itemStableKey(it, secOrder, ix) {
return `${secOrder}-${it?.item_type || 'row'}-${ix}`
}
/** Flache Reihenfolge wie auf der Matte: alle Notizen und Übungen nacheinander. */
/** Flache Reihenfolge wie auf der Matte: alle Notizen und Übungen nacheinander.
* Parallele Streams: aktuell strikt linear (sortedSections × sortedItems); für Breakout phase/stream‑aware erweitern. */
export function flattenPlanTimeline(unit) {
const list = []
sortedSections(unit).forEach((sec, si) => {
@@ -398,6 +398,7 @@ export function parseMin(v) {
return Number.isFinite(n) ? n : null
}
/** PUT /api/training-units/:id `sections` — flache order_index pro Einheit; Parallelität bricht am DB-UNIQUE (training_unit_id, order_index) bis Migration. */
export function buildSectionsPayload(sections) {
return sections.map((sec, si) => ({
order_index: si,