fix: resolve go vet error and dayStart logic in ComputeDailyTotals

- Fix 'string(d)' int-to-rune conversion in rpg_test.go by using fmt.Sprintf
- Fix ComputeDailyTotals dayStart logic: initial state should be StateWorking
  when dayStart > 0, correctly counting work from dayStart to first out event
- Update README project structure to reflect new domain/handler/repo layout
- Implement missing achievements: rpg_pioneer (on RPG enable) and
  salary_setter (on first rate set)
- Add tryUnlockAchievement helper to Handler
This commit is contained in:
2026-06-25 09:54:22 +03:30
parent 3835b002a7
commit d15ed46066
45 changed files with 4947 additions and 5430 deletions

View File

@@ -147,24 +147,35 @@ Four color themes are available in settings: **Ocean**, **Beach**, **Rose**, **C
│ ├── main.go Entrypoint, polling/webhook, scheduler
│ └── webhook.go Webhook mode with TLS support
├── internal/
│ ├── bot/
│ │ ├── handlers.go Message/callback routing, views, menu builders
│ │ ├── clock.go Clock in/out, day off, report
│ ├── domain/ Pure business logic, no external dependencies
│ │ ├── types.go Core domain types (User, Event, Day, RPGStats, ...)
│ │ ├── constants.go App-wide constants and thresholds
│ │ ├── dateutil.go Gregorian/Jalali/Hijri calendar conversions
│ │ ├── totals.go Break/work computation state machine
│ │ ├── rpg.go XP curves, levels, streaks
│ │ ├── burnout.go Burnout trend computation
│ │ ├── salary.go Salary estimation, currency helpers
│ │ └── sanitize.go Input sanitization helpers
│ ├── handler/ Telegram bot handlers (one per feature)
│ │ ├── handler.go Core handler, routing, helpers
│ │ ├── clock.go Clock in/out, day off, report
│ │ ├── calendar.go History view and inline event editing
│ │ ├── export.go Excel (.xlsx) report generation
│ │ ├── dateutil.go Gregorian/Jalali/Hijri conversions & calendars
│ │ ├── rpg.go XP, levels, streaks, achievements
│ │ ├── rpg.go RPG stats, achievements, aggregates
│ │ ├── league.go WorkTime League leaderboard
│ │ ├── salary.go Salary estimation, rate/currency commands
│ │ ├── burnout.go Burnout assessment model
│ │ ├── salary.go Salary estimation view
│ │ ├── burnout.go Burnout assessment view
│ │ ├── settings.go Settings menu with inline pickers
│ │ ├── summary.go Monthly summary
│ │ ├── report.go Daily report builder
│ │ ── sanitize.go Input sanitization helpers
└── db/
── store.go SQLite store (data access layer)
└── migrations/ Goose-managed SQL migrations
│ │ ├── report.go Daily report builder, status text
│ │ ── note.go Note command, edit command
│ ├── worktype.go Work type selection
── keyboard.go Inline keyboard builders
└── repo/ Data access layer
│ ├── interface.go Repository interface
│ ├── store.go SQLite implementation
│ └── migrations.go Goose-managed migration runner
│ └── migrations/ SQL migration files
│ ├── 001_init.sql Initial schema
│ └── 002_features.sql RPG, achievements, user_settings
├── .gitea/workflows/