- New lib/services/ticket-reconciliation-service.ts: reconcileStaleTickets()
scans tickets where is_deleted=false AND status<>5 AND synced_at older than
7 days (capped at 500), re-fetches each from Autotask, and either upserts
via the webhook SQL pattern or soft-deletes when Autotask returns null.
- Returns { scanned, updated, statusFlippedToComplete, softDeleted, errors }.
- New POST /api/sync/reconcile-tickets — fire-and-forget trigger mirroring
/api/sync/incremental (public per existing middleware allowlist).
|
||
|---|---|---|
| .. | ||
| classifications | ||
| entity | ||
| full | ||
| history | ||
| incremental | ||
| last-sync | ||
| mimecast | ||
| progress | ||
| reconcile-tickets | ||
| schedules | ||
| status | ||
| tenants-sites | ||
| tickets-chunked | ||