Timezone (all users EST):
- lib/utils: hardcode APP_TIME_ZONE (America/New_York) in formatDate/
formatRenewalDate, add formatDateTime and todayInAppTimeZone helpers
- Replace every ad-hoc toLocaleDateString/toLocaleString call across the app
(task notes, audit log, backups, shape import, renewal groups, client
detail) with the shared EST-aware helpers
- Fix UTC "today" bug in date-input defaults/min/max (completion date,
reminder date) that rolled to the next calendar day after ~7-8pm ET
Task provenance:
- Task card info icon (now visible to all users, not just privileged) shows
full origin: template, level, renewal anchor, due-date math, and who/what
generated the task
- Include template.daysOffset and creator in task queries
Setup N/A:
- New setupNaAt/setupNaReason fields on Client; mark/restore UI and API to
exclude non-Shape/lost-business clients from the setup queue everywhere
it's counted (queue page, API, manager dashboard, metrics gauge)
Task generation fixes:
- auto-generate: client-level branch now gated on the renewal anchor's
(group/policy) createdAt instead of the client's, so pre-go-live clients
with new post-go-live groups are no longer skipped forever
- New auto-assign-tasks sweep run after every sync to assign advocates to
tasks created by paths that don't assign directly (e.g. setup wizard)
- Deletes tasks where POLICY/RENEWAL_GROUP template has no policy_id/policy_group_id
- Gap Fill creates missing tasks per group/policy/client without overwriting existing ones
- Existence check within 5-day window prevents duplicates
- Gap Fill button added to shape-import admin panel with inline result summary
- GET /api/admin/shape-import/browse: lists sites, drives, and folders via Graph API
- ShapeImportPanel: cascading Site / Document Library / Folder selects
with loading states, error display, and Reset to default
- folderPath stored on ShapeImportRun, passed through to runShapeImport
- discoverFiles accepts dynamic folderPath instead of hardcoded path
- Prisma: added folderPath field to ShapeImportRun model
- New DB tables: shape_import_runs, shape_import_logs (raw SQL applied)
- src/lib/shape-import/run-import.ts: importable core logic extracted from CLI script
- POST /api/admin/shape-import: starts run async, returns runId immediately
- GET /api/admin/shape-import: lists last 20 runs
- GET /api/admin/shape-import/[id]: polls log lines and run status
- /admin/shape-import page: drive ID config, dry run / execute (with confirmation),
live log panel (2s poll), stats summary, run history with log replay
- Admin index: added SHAPE Historical Import card