feat(bot): add reminders topic binding command

This commit is contained in:
2026-03-10 02:01:56 +04:00
parent 29563c24eb
commit 9c4fe5cb52
15 changed files with 321 additions and 121 deletions

View File

@@ -89,12 +89,13 @@ Goal: automate key payment reminders.
Deliverables:
- Cloud Scheduler jobs.
- Reminder handlers for day 3/4 utilities, day 17 rent notice, day 20 due date.
- Reminder handlers that evaluate per-household utility and rent reminder dates.
- Dedicated topic posting for reminders.
Exit criteria:
- Scheduled reminders fire reliably.
- Household billing settings control when reminders are delivered.
- Duplicate sends are prevented.
## Phase 4 - Mini App V1

View File

@@ -66,6 +66,7 @@ bun run review:coderabbit
- purchase ingestion requires `DATABASE_URL` plus a bound purchase topic via `/bind_purchase_topic`
- anonymous feedback requires `DATABASE_URL` plus a bound feedback topic via `/bind_feedback_topic`
- reminders require `DATABASE_URL` plus `SCHEDULER_SHARED_SECRET` or `SCHEDULER_OIDC_ALLOWED_EMAILS`
and optionally use a dedicated reminders topic via `/bind_reminders_topic`
- mini app CORS can be constrained with `MINI_APP_ALLOWED_ORIGINS`
- Migration workflow is documented in `docs/runbooks/migrations.md`.
- First deploy flow is documented in `docs/runbooks/first-deploy.md`.

View File

@@ -17,7 +17,7 @@ Schedule and deliver household billing reminders to dedicated Telegram topics.
## Scope
- In: scheduler endpoints, reminder generation, send guards.
- In: scheduler endpoints, reminder generation, send guards, per-household reminder eligibility.
- Out: full statement rendering details.
## Interfaces and Contracts
@@ -30,10 +30,11 @@ Schedule and deliver household billing reminders to dedicated Telegram topics.
## Domain Rules
- Utilities reminder target: day 3 or 4 (configurable).
- Rent warning target: day 17.
- Rent due target: day 20.
- Utilities reminder target: household-configured utilities reminder day.
- Rent warning target: household-configured rent warning day.
- Rent due target: household-configured rent due day.
- Duplicate-send guard keyed by household + cycle + reminder type.
- Scheduler should run on a daily cadence and let the application decide which households are due today.
## Data Model Changes

View File

@@ -48,6 +48,6 @@ Reminder jobs must not require:
## Follow-ups
- per-household reminder settings
- daily scheduler cadence in infrastructure defaults
- localized reminder copy using persisted household/member locale
- scheduler fan-out observability metrics