mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-04-24 21:49:51 -05:00
d530ce48b0
Implemented a comprehensive Weekly Time Goals system that allows users to set and track weekly hour targets with real-time progress monitoring. Features: - WeeklyTimeGoal model with status tracking (active, completed, failed, cancelled) - Full CRUD interface for managing weekly goals - Real-time progress calculation based on logged time entries - Dashboard widget showing current week's goal progress - Daily breakdown view with detailed statistics - Automatic status updates based on goal completion and week end - API endpoints for goal data and progress tracking Technical changes: - Added app/models/weekly_time_goal.py with local timezone support - Created migration 027_add_weekly_time_goals.py for database schema - Added app/routes/weekly_goals.py blueprint with all CRUD routes - Created templates: index.html, create.html, edit.html, view.html - Integrated weekly goal widget into main dashboard - Added "Weekly Goals" navigation item to sidebar - Implemented comprehensive test suite in tests/test_weekly_goals.py - Added feature documentation in docs/WEEKLY_TIME_GOALS.md Bug fixes: - Fixed timezone handling to use TZ environment variable instead of Config.TIMEZONE - Corrected log_event() calls to use proper signature (event name as first positional argument) - Manually created database table via SQL when Alembic migration didn't execute Database schema: - weekly_time_goals table with user_id, target_hours, week_start_date, week_end_date, status, notes - Indexes on user_id, week_start_date, status, and composite (user_id, week_start_date) - Foreign key constraint to users table with CASCADE delete The feature supports flexible week start days per user, calculates remaining hours, provides daily average targets, and automatically updates goal status based on progress.