feat: add extended training types (cardio walk/dance, mind & meditation)
- Migration 005: Add cardio subcategories (Gehen, Tanzen) - Migration 005: Add new category "Geist & Meditation" with 4 subcategories (Meditation, Atemarbeit, Achtsamkeit, Visualisierung) - Update categories endpoint with mind category metadata - Update Apple Health mapping: dance → dance, add meditation/mindfulness - 6 new training types total Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
96b0acacd2
commit
d164ab932d
24
backend/migrations/005_training_types_extended.sql
Normal file
24
backend/migrations/005_training_types_extended.sql
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
-- Migration 005: Extended Training Types
|
||||||
|
-- Add: Cardio (Gehen, Tanzen), Mind & Meditation category
|
||||||
|
-- Created: 2026-03-21
|
||||||
|
|
||||||
|
-- ========================================
|
||||||
|
-- Add new cardio subcategories
|
||||||
|
-- ========================================
|
||||||
|
INSERT INTO training_types (category, subcategory, name_de, name_en, icon, sort_order) VALUES
|
||||||
|
('cardio', 'walk', 'Gehen', 'Walking', '🚶', 105),
|
||||||
|
('cardio', 'dance', 'Tanzen', 'Dance', '💃', 106);
|
||||||
|
|
||||||
|
-- ========================================
|
||||||
|
-- Add new category: Geist & Meditation
|
||||||
|
-- ========================================
|
||||||
|
INSERT INTO training_types (category, subcategory, name_de, name_en, icon, sort_order) VALUES
|
||||||
|
('mind', 'meditation', 'Meditation', 'Meditation', '🧘♂️', 700),
|
||||||
|
('mind', 'breathwork', 'Atemarbeit', 'Breathwork', '🫁', 701),
|
||||||
|
('mind', 'mindfulness', 'Achtsamkeit', 'Mindfulness', '☮️', 702),
|
||||||
|
('mind', 'visualization', 'Visualisierung', 'Visualization', '🎨', 703);
|
||||||
|
|
||||||
|
-- ========================================
|
||||||
|
-- Add comment
|
||||||
|
-- ========================================
|
||||||
|
COMMENT ON TABLE training_types IS 'v9d Phase 1b: Extended with cardio walk/dance and mind category';
|
||||||
|
|
@ -135,10 +135,12 @@ def get_training_type_for_apple_health(workout_type: str):
|
||||||
'martial arts': 'technique',
|
'martial arts': 'technique',
|
||||||
'boxing': 'sparring',
|
'boxing': 'sparring',
|
||||||
'rowing': 'rowing',
|
'rowing': 'rowing',
|
||||||
'dance': 'other',
|
'dance': 'dance',
|
||||||
'core training': 'functional',
|
'core training': 'functional',
|
||||||
'flexibility': 'static',
|
'flexibility': 'static',
|
||||||
'cooldown': 'regeneration',
|
'cooldown': 'regeneration',
|
||||||
|
'meditation': 'meditation',
|
||||||
|
'mindfulness': 'mindfulness',
|
||||||
}
|
}
|
||||||
|
|
||||||
subcategory = mapping.get(workout_type.lower())
|
subcategory = mapping.get(workout_type.lower())
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,12 @@ def list_categories(session: dict = Depends(require_auth)):
|
||||||
'icon': '💆',
|
'icon': '💆',
|
||||||
'color': '#6B7280'
|
'color': '#6B7280'
|
||||||
},
|
},
|
||||||
|
'mind': {
|
||||||
|
'name_de': 'Geist & Meditation',
|
||||||
|
'name_en': 'Mind & Meditation',
|
||||||
|
'icon': '🧘♂️',
|
||||||
|
'color': '#A78BFA'
|
||||||
|
},
|
||||||
'other': {
|
'other': {
|
||||||
'name_de': 'Sonstiges',
|
'name_de': 'Sonstiges',
|
||||||
'name_en': 'Other',
|
'name_en': 'Other',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user