Commit Graph

6 Commits

Author SHA1 Message Date
Kamil 'Kamaś' Bruchal 7f5bc8454a style: thank duty crew in reminders instead of urging them to clean 2026-07-20 17:37:32 +02:00
Kamil 'Kamaś' Bruchal 66364c044a feat: warn 2 weeks early and auto-assign 1 week early for empty duty weeks 2026-07-13 17:45:41 +02:00
Kamil 'Kamaś' Bruchal 6573144b14 feat: auto-assign empty duty weeks via service-account sheet writes
Migrate Sheets auth from an API key to a service-account credential
(GOOGLE_CREDENTIALS_FILE) with the read+write spreadsheets scope, add a
WriteSheet primitive, and use it to actively manage empty duty weeks in
the weekly reminder.

Each fire now handles a fixed this-week/next-week model (replacing the
DUTY_AHEAD_DAYS announce):
- this week empty -> pick the two people with the fewest duties (random
  tie-break), write their names into cols B/C, and announce
- this week filled -> announce who is on duty
- next week empty -> ask people to volunteer before it is auto-assigned

Col G ("Liczba dyżurów") is a live formula, so names-only writes keep the
fewest-duties selection fair across weeks. Selection, row tracking, range
building, and every fire() branch are unit-tested; live tests for sheet
read/write are env-gated.
2026-06-19 03:48:59 +02:00
Kamil 'Kamaś' Bruchal 816aa45c86 style: gofmt scheduler_test.go 2026-06-19 02:05:56 +02:00
Kamil 'Kamaś' Bruchal 15b2fc9093 feat: ping on-duty members by Telegram handle in reminders
Read each member's Telegram handle from the new sheet column F (duty
count moves to G) and mention on-duty people as @handle in the weekly
reminder, so they get a real notification. Names without a handle, or
not found in the people list, fall back to plain text.

- sheet.go: add colHandle, Person.Handle; parse handle column
- scheduler.go: resolve names to @mentions via handlesByName/mention
- service.go: widen default SHEET_RANGE to column G
2026-06-19 01:40:20 +02:00
Kamil 'Kamaś' Bruchal 74cb302f64 chore: track go.mod, go.sum, and missing test files
These were never committed (hidden by status.showUntrackedFiles=no): without
go.mod/go.sum a fresh clone would not build, and the source files committed in
abb38e3 were missing their accompanying tests.
2026-06-18 21:40:41 +02:00