1.7 KiB
1.7 KiB
Agents.md
Current Task
Build a simple Telegram time‑tracking bot in Go.
Context Summary
- User requirements: only clock‑in / clock‑out, auto‑infer breaks, onsite/remote flag (ask after first clock‑in), i18n (fa/en), SQLite storage, monthly .xlsx export, HTTP proxy support, Docker, CI via Gitea.
- Design decisions: single user, event pairing logic, minimal SQLite schema, on‑demand Excel download, Docker multi‑stage, CI/CD workflow.
- Implementation plan: 11 phases (scaffold → Docker → CI), with edge‑case handling (multiple clock‑outs, missed clock‑out, midnight sessions, time‑zone).
Edge Cases Covered
- Multiple clock‑outs → treat middle clock‑out as break start.
- No clock‑out → blocked unless clock‑in first.
- Midnight or overnight sessions → attributed to originating day.
- Unpaired final event → indicates currently clocked‑in.
- Remote work flag set after first clock‑in (default onsite).
Edge Cases Checklist
- Clock‑in/out validation (no duplicate in/out).
- Onsite/remote flag storage.
- i18n message loading (fa/en).
- Excel file saved monthly and on demand.
- Proxy configuration respected for all outbound traffic.
Next Steps (TODO)
- Scaffold repo & config loader.
- Initialize SQLite DB and event models.
- Implement Telegram bot core with proxy transport.
- Add clock‑in / clock‑out handlers with validation.
- Build event pairing & daily/weekly/monthly totals logic.
- Create monthly .xlsx template and generation.
- Implement day‑off handling and edit‑event UI.
- Add Dockerfile, docker‑compose, and Gitea CI workflow.
- Polish i18n, error handling, and edge‑case tests.