Commit Graph

29 Commits

Author SHA1 Message Date
9d123316e6 feat: Hijri calendar, virtual midnight crossover, overlap rejection, WAL mode
- Hijri (قمری) calendar added as 3rd calendar option with tabular conversion
- Calendar type select menu (like accent) with gregorian/jalali/hijri
- Calendar type applied to exports and reports
- Midnight crossover: virtual splits at computation time (no synthetic DB events)
  - Handles both UTC and local timezone boundaries
  - Timezone changes handled naturally (recomputed on-the-fly)
- Rate limiting per user ID instead of chat ID
- WAL mode enabled for SQLite
- Smart reply keyboard updates after every state change
- Overlapping time edits rejected (must preserve in/out alternation)
- Single event deletion warns if timeline needs repair
- Day off no longer prevents clock in/out
- Accent colors shown with descriptive names in select menu
- Delete button label changed to DEL for visual distinction
2026-06-24 09:39:15 +03:30
6f6cc6f184 feat: midnight crossover, rate limit, smart keyboard, status menu, settings
- Midnight crossover: auto-close previous day session on clock-in
- Rate limiting: 2s cooldown per chat_id in both messages and callbacks
- Smart reply keyboard: single button changes to Clock In/Out based on state
- Status info on main menu shows: date, work type, working status, today's total
- Settings sub-menu with inline buttons for accent, report toggle, report time
- Accent selection inline keyboard with > indicator and back button
- Notes displayed in daily report (e.g. 'auto midnight')
- Back buttons on all sub-menus (work type, accent, settings)
- Settings button added to main menu
2026-06-24 07:56:04 +03:30
2970b7d3fc feat: redesigned DB schema with users, work_types, days, events 2026-06-24 00:36:16 +03:30
8616ed0867 feat: multi-user isolation and graceful shutdown
- Add chat_id to events, settings, and days_off for per-user data
- Add proper graceful shutdown (signal handling, WaitGroup)
- Separate polling and webhook modes with goroutine management
- Add schema migration from single-user to multi-user schema
- Refactor handlers with shared actionFunc pattern (msg + callback)
- Fix schema path for Docker deployment (/app/db/schema.sql)
- Remove emoji from output text for cleaner formatting
2026-06-24 00:14:41 +03:30
7aada8d118 Add README.md
Some checks failed
CI / build (push) Has been cancelled
2026-06-23 22:36:41 +03:30
b4fab29d45 Clean up: remove unused packages, switch to slog, tidy Makefile 2026-06-23 22:34:01 +03:30
32446a99d1 Fix break tracking (out→in gap), add startup log, clean up /start message 2026-06-23 22:00:25 +03:30
7da6f4cb49 Add BOT_ALLOWED_USERS, fix SetColWidth params, drop fmt import, save chat_id on start 2026-06-23 21:56:18 +03:30
a92c72f46a feat: add persistent reply keyboard with Clock In / Clock Out buttons
Also handle button text (English + Persian) in message router.
2026-06-23 21:44:41 +03:30
5009bb130c chore: remove AGENTS.md (all tasks implemented) 2026-06-23 21:42:55 +03:30
4a5778afe5 feat: add inline keyboard, /start command, and callback handlers
- Show main menu with Clock In/Out, Report, Export, Remote, Day Off buttons
- Each action result includes a 'Back to Menu' button
- Handle callback queries alongside text commands
- Delete stale webhook before switching to polling
- Log i18n initialization error instead of silently ignoring it
2026-06-23 21:42:52 +03:30
0be03f7078 chore: connect bot container to proxy_net for nginx reverse-proxy
This allows nginx-edge to reach the bot via service name
on the shared proxy_net external network.
2026-06-23 21:42:45 +03:30
c4e8c8dc3a fix: make schema idempotent with IF NOT EXISTS
Add i18n locale files to Docker image and fix all CREATE
statements to use IF NOT EXISTS to survive container restarts.
2026-06-23 21:42:39 +03:30
b0fcb7a6c3 main: pass correct APIEndpoint to NewBotAPIWithClient 2026-06-23 21:00:27 +03:30
3aaf5b326d main: use default HTTP client (proxy via env) 2026-06-23 20:58:52 +03:30
f6d6e994aa Docker: proxy args for go mod download (temporary) 2026-06-23 20:53:58 +03:30
7d03a4d8fc Docker: use explicit Go 1.26.4 image to match go.mod 2026-06-23 20:52:52 +03:30
0a9175add4 handlers: replace fmt.Errorf with errors.New to satisfy vet
All checks were successful
CI / build (push) Successful in 55s
2026-06-23 20:50:03 +03:30
0909cbac7d CI: add HTTP_PROXY/HTTPS_PROXY to reach Golang toolchain (temporary solution)
Some checks failed
CI / build (push) Failing after 40s
2026-06-23 20:48:21 +03:30
a447e127ec CI: install git and ca-certificates for VCS module fetch
Some checks failed
CI / build (push) Failing after 8m34s
2026-06-23 20:38:28 +03:30
316d8446ee CI: set GOPROXY=direct to avoid proxy block
Some checks failed
CI / build (push) Failing after 4m54s
2026-06-23 20:32:57 +03:30
070b59f976 Docker: update builder to Go 1.26 to match go.mod
Some checks failed
CI / build (push) Has been cancelled
2026-06-23 20:31:42 +03:30
292516fcd3 CI: use Go 1.26 to match go.mod toolchain
Some checks failed
CI / build (push) Has been cancelled
2026-06-23 20:27:53 +03:30
5666170824 CI: remove sudo from install step (root in act)
Some checks failed
CI / build (push) Failing after 19s
2026-06-23 20:26:08 +03:30
9ed38c7514 CI: install Node.js before using JavaScript actions
Some checks failed
CI / build (push) Failing after 2s
2026-06-23 20:25:22 +03:30
0bb5db46d0 Dockerfile, docker-compose, Gitea CI, Makefile, i18n (en/fa)
Some checks failed
CI / build (push) Failing after 27s
2026-06-23 20:23:04 +03:30
7176f9b81d Bot handlers: clock‑in/out, remote flag, day‑off toggle, daily report, monthly Excel export 2026-06-23 20:22:54 +03:30
4146e35f35 Initial scaffold: Go module, SQLite schema, config loader, Telegram bot with webhook/polling modes 2026-06-23 20:22:46 +03:30
c803239193 init 2026-06-23 19:10:42 +03:30