Commit graph

10 commits

Author SHA1 Message Date
347e4b342b feat(tasks): add preview-before-generate to policy group task generation
Extend the per-client preview flow to the per-group "Generate Tasks"
button on the client page, backfill missing templates instead of
skipping groups/policies that already have any template task, and add
a reusable searchable ClientSelect component.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-30 10:56:46 +00:00
6ab58dec68 docs: implementation plan for per-client generation + preview dialog
Bite-sized, TDD-ordered plan for docs/superpowers/specs/2026-07-18-task-generation-preview-and-per-client-design.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 09:21:20 +00:00
270c38ff19 docs: design for per-client task generation + preview-before-generate
Adds a clientId targeting mode and a dryRun flag to the admin
generate-and-assign tool, plus a confirmation dialog showing summary
counts before any tasks are actually created.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-18 02:19:48 +00:00
e7da36e7e7 docs: capture in-progress design for task change log & restore feature
Paused mid-brainstorm at user request. Records the approved architecture
shape (DB-trigger-based change capture, run-scoped restore, hourly rollup
for oversight) and the open items to pick up on resume.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-17 18:46:02 +00:00
835267c333 feat(automation): move task auto-generate to post-sync + admin config UI
Extracts the cron-only auto-generate logic into shared modules
(lib/sync/auto-generate.ts, automation-config.ts) and adds
group-auto-assign.ts, which attaches ungrouped policies to an existing
renewal group when their renewal dates are close. Both now also run
automatically after every AMS sync (sync-engine.ts), guarded by a
Postgres advisory lock so overlapping syncs cannot double-generate.
The external /api/cron/auto-generate endpoint remains for manual/
out-of-band triggering, delegating to the same shared engine.

Adds an admin settings UI + /api/admin/automation-settings route to
configure grace periods and toggles without a redeploy, and surfaces
the new audit actions (AUTO_GENERATE_TASKS_CLIENT, AUTO_ASSIGN_POLICY_GROUP)
in the audit log filters.

Includes a fixed AUTOMATION_GO_LIVE_AT floor (2026-07-07) in
automation-config.ts, applied to every candidate query in
auto-generate.ts and group-auto-assign.ts. Without it, the first run
after enabling this treated every historical policy/client/group that
happened to be old enough as newly eligible, generating tasks anchored
to old renewal/expiration dates in one burst (incident: 6,552 tasks
created 2026-07-07 02:01, most already 1-2 years overdue for Jeanne
Strong and Luke Billman; cleaned up same day after a verified backup).
The floor ensures automation only ever processes records created from
its go-live date forward.
2026-07-07 18:26:12 +00:00
bbdbe1ddc0 Rebrand: rename ondeck->horizon in package.json, docker-compose, SERVER.md, docs; production stack at /opt/stacks/horizon 2026-04-12 23:59:20 +00:00
4315f704c7 Renewal settings, client setup queue, manager setup page, combobox grouping, nav updates 2026-04-10 13:50:04 +00:00
25d1aa493c docs: SHAPE historical import documentation 2026-04-08 10:57:38 +00:00
8aa20ea751 feat: sync contacts from AMS 360 AFW_PolContact into ClientContact
- Add source, title, mobilePhone fields to ClientContact schema
- Add composite unique constraint for dedup (clientId, name, label, source)
- Add fetchAfwContacts() query with dedup by (CustId, Name, Responsibility)
- Add syncContacts() phase to sync engine with retry logic
- Update contacts UI to show title, mobile phone, AMS badge
- Disable edit/delete on AMS-synced contacts (source='ams')
2026-04-08 02:08:27 +00:00
b036a93da2 Initial commit: OnDeck project
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 13:20:52 +00:00