mitai-jinkendo/backend
Lars 829edecbdc
All checks were successful
Deploy Development / deploy (push) Successful in 43s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 12s
feat: learnable activity type mapping system (DB-based, auto-learning)
Replaces hardcoded mappings with database-driven, self-learning system.

Backend:
- Migration 007: activity_type_mappings table
  - Supports global and user-specific mappings
  - Seeded with 40+ default mappings (German + English)
  - Unique constraint: (activity_type, profile_id)
- Refactored: get_training_type_for_activity() queries DB
  - Priority: user-specific → global → NULL
- Bulk categorization now saves mapping automatically
  - Source: 'bulk' for learned mappings
- admin_activity_mappings.py: Full CRUD endpoints
  - List, Get, Create, Update, Delete
  - Coverage stats endpoint
- CSV import uses DB mappings (no hardcoded logic)

Frontend:
- AdminActivityMappingsPage: Full mapping management UI
  - Coverage stats (% mapped, unmapped count)
  - Filter: All / Global
  - Create/Edit/Delete mappings
  - Tip: System learns from bulk categorization
- Added route + admin link
- API methods: adminList/Get/Create/Update/DeleteActivityMapping

Benefits:
- No code changes needed for new activity types
- System learns from user bulk categorizations
- User-specific mappings override global defaults
- Admin can manage all mappings via UI
- Migration pre-populates 40+ common German/English types

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 19:31:58 +01:00
..
migrations feat: learnable activity type mapping system (DB-based, auto-learning) 2026-03-21 19:31:58 +01:00
routers feat: learnable activity type mapping system (DB-based, auto-learning) 2026-03-21 19:31:58 +01:00
apply_v9c_migration.py feat: v9c Phase 1 - Feature consolidation & cleanup migration 2026-03-20 18:57:39 +01:00
auth.py fix: correct indentation in auth.py _check_impl function 2026-03-21 07:06:53 +01:00
check_features.py fix: pipeline typo and add features diagnostic script 2026-03-20 22:32:09 +01:00
db_init.py fix: only process numbered migrations (XXX_*.sql pattern) 2026-03-21 10:08:56 +01:00
db.py refactor: move init_db() to db.py 2026-03-19 09:49:46 +01:00
Dockerfile fix: replace psql with Python for DB checks (no apt-get needed!) 2026-03-18 10:01:19 +01:00
feature_logger.py feat: add structured JSON logging for all feature usage (Phase 2) 2026-03-20 22:18:12 +01:00
main_old.py refactor: modular backend architecture with 14 router modules 2026-03-19 11:15:35 +01:00
main.py feat: learnable activity type mapping system (DB-based, auto-learning) 2026-03-21 19:31:58 +01:00
migrate_to_postgres.py fix: Migration-Fehler - meas_id Spalte in ai_insights 2026-03-19 08:39:36 +01:00
models.py feat(v9d): add training types system + logout button 2026-03-21 13:05:33 +01:00
requirements.txt 9b 2026-03-18 08:27:33 +01:00
schema.sql fix: add missing meas_id column to photos table 2026-03-18 12:23:13 +01:00
startup.sh fix: replace psql with Python for DB checks (no apt-get needed!) 2026-03-18 10:01:19 +01:00