51f0b32cb3
feat(260521-fci-01): add ticket reconciliation service + API route
...
- 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).
2026-05-21 11:08:24 -04:00
1112a06afe
feat: RMM Overshell, IT Glue audit/write-back, LogLift, link-aware bundles, dashboard overhaul
...
- RMM Overshell (migration 077): admin page, dispatch UI, executor/worker, target
resolver, script registry (AD/DHCP/DNS/event-log/services/software/network/loglift)
- LogLift evidence pipeline (migration 078): upload webhook, B2 storage client,
receiver/matcher, EventLogCollector PowerShell script
- IT Glue audit + write-back (migrations 075, 076): asset-audit runner, ticket
xrefs, applications/configurations browse pages + apply/revert/audit endpoints
- Link-aware analyzer bundles (migration 073) + provider toggle (migration 074):
link-discovery service, OpenRouter LLM provider, related-tickets/itglue-suggestion
panels, analyze-bundle endpoint
- Endpoint data model + device-link reconciliation (migrations 079, 080): conflicts
admin page, reconciler service, resolve endpoints
- Dashboard overhaul: integration-health service + alerts, overview/health endpoints
- Permissions: add itglue + rmm scopes; middleware: public /api/rmm/loglift route
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 07:13:18 -04:00
fcdec8e38b
feat: Mimecast multi-tenant held mail viewer
...
- migration 062: mimecast_tenants table (company_id, client_id/secret, account_code)
- Seed Wulf (CUSA13A95) + Seubert (CUSA96A181) tenants
- MimecastClient.getHeldMessages(): full pagination via meta.pagination.next cursor
(API always returns 10/page regardless of pageSize param, totalCount in meta)
- getMimecastClientForTenant() factory for per-tenant instantiation
- GET /api/mimecast/held?tenantId=&recipient= — fetches all tenants in parallel,
merges + sorts by date, returns per-tenant counts + combined messages[]
- Held Mail tab on /admin/sync/mimecast (on-demand load, recipient filter,
tenant badges, policy filter dropdown, DMARC/impersonation highlighted red)
2026-03-31 22:38:22 -04:00
25bb70cfa6
feat: Mimecast email integration — message logs, threat events, 120d retention, admin UI
2026-03-17 16:23:47 -04:00
b222d97225
feat: add classification icons sync from Autotask
...
- Created company_classifications table to store Autotask classification icons
- Added getClassificationIcons() method to AutotaskClient
- Created /api/sync/classifications endpoint (GET/POST)
- Updated kiosk settings UI to dynamically load classifications
- Added 'Sync from Autotask' button to pull latest classifications
- Removed hardcoded classification list
- Display classification name and description in checkboxes
- Allow excluding any classification synced from Autotask
2026-02-03 20:48:08 -05:00
root
c0190c7dd1
feat: add tenants/sites sync for accurate dashboard stats
...
- Created auvik_tenants and rmm_sites tables
- Added /api/sync/tenants-sites endpoint to sync all tenants from Auvik
and all sites from Datto RMM for accurate mapped/unmapped counts
2026-02-02 23:02:34 -05:00
root
bac9797845
fix: update API route params for Next.js 15+ async params
...
Next.js 15+ changed dynamic route params to be async Promises.
Updated all schedule API routes to await params before accessing id.
Changes:
- GET /api/sync/schedules/[id] - await params
- PATCH /api/sync/schedules/[id] - await params
- DELETE /api/sync/schedules/[id] - await params
- POST /api/sync/schedules/[id]/trigger - await params
This fixes TypeScript compilation errors during Docker build.
2026-01-26 10:31:46 -05:00
root
f117210c9d
feat: add scheduled sync system with admin UI
...
Implements comprehensive scheduled sync system using node-cron with
full admin interface for configuration and monitoring.
Features:
- Configurable sync schedules with cron expressions
- Enable/disable schedules without deletion
- Manual trigger for testing
- Status monitoring (last run, next run, success/failure)
- Error tracking and display
- Incremental and full sync support
- Multiple concurrent schedules
- Admin UI with schedule management
Components:
1. Sync Scheduler Service (lib/services/sync-scheduler.ts)
- node-cron integration for scheduling
- Database-backed schedule configuration
- Automatic initialization on startup
- Prevents concurrent runs of same schedule
- Calculates next run times
- Tracks execution status and errors
2. Database Schema (sync_schedules table)
- Schedule configuration storage
- Execution history tracking
- Last run status and errors
- Next run calculation
3. API Endpoints
- GET /api/sync/schedules - List all schedules
- POST /api/sync/schedules - Create schedule
- GET /api/sync/schedules/[id] - Get schedule
- PATCH /api/sync/schedules/[id] - Update schedule
- DELETE /api/sync/schedules/[id] - Delete schedule
- POST /api/sync/schedules/[id]/trigger - Manual trigger
4. Admin UI (components/admin/SyncScheduler.tsx)
- View all schedules with status
- Create/edit/delete schedules
- Enable/disable toggle
- Manual trigger button
- Cron expression presets
- Real-time status updates
- Error message display
- Next run countdown
5. Default Schedules (created on first startup, disabled)
- Daily Incremental: 2 AM daily (0 2 * * *)
- Weekly Full: 3 AM Sunday (0 3 * * 0)
Admin Interface:
- New 'Schedules' tab in sync page
- Schedule cards with status badges
- Enable/disable with play/pause button
- Manual trigger with clock button
- Edit dialog with cron presets
- Create dialog for new schedules
- Real-time status (running, next run, last run)
- Success/failure indicators
- Error message alerts
Cron Features:
- Full cron expression support
- Validation before saving
- Common presets (daily, weekly, hourly)
- Next run time calculation
- Automatic schedule restart on config change
Monitoring:
- Last run timestamp
- Next run countdown (e.g., 'in 2h 15m')
- Success/failure status with icons
- Error messages for failed syncs
- Running indicator (animated badge)
- Schedule validity check
Dependencies:
- node-cron: ^3.0.3
- @types/node-cron: ^3.0.11
UI Components:
- Alert component added (components/ui/alert.tsx)
- Integrated into sync page tabs
- Responsive design
Documentation:
- Complete guide (docs/SCHEDULED_SYNCS.md)
- Cron expression reference
- Best practices
- Troubleshooting guide
- API reference
- Database schema
Use Cases:
1. Daily incremental sync for recent changes
2. Weekly full sync for data integrity
3. Custom schedules for specific needs
4. Off-peak hour automation
5. Backup for webhook failures
Benefits:
- No manual intervention required
- Consistent data freshness
- Flexible scheduling
- Easy monitoring
- Error tracking
- Manual override available
Next Steps:
1. Restart application to initialize scheduler
2. Navigate to Admin → Sync → Schedules tab
3. Enable default schedules or create custom ones
4. Monitor first runs for success
5. Adjust schedules as needed
Files Added/Modified:
- lib/services/sync-scheduler.ts (new)
- app/api/sync/schedules/route.ts (new)
- app/api/sync/schedules/[id]/route.ts (new)
- app/api/sync/schedules/[id]/trigger/route.ts (new)
- components/admin/SyncScheduler.tsx (new)
- components/ui/alert.tsx (new)
- app/admin/sync/page.tsx (modified - added Schedules tab)
- docs/SCHEDULED_SYNCS.md (new)
- package.json (node-cron added)
2026-01-26 10:24:58 -05:00
root
f85741c993
feat: add tabs to sync page and fix pagination
...
- Separate Sync Status and Sync History into tabs with icons
- Fix pagination in sync history by adding offset parameter
- Update getSyncHistory to support offset for proper pagination
- Update API endpoint to pass offset parameter
- Previous/Next buttons now work correctly to navigate pages
This improves UX by organizing the sync page into logical sections
and enables users to browse through historical sync records.
2026-01-24 07:57:09 -05:00
root
6eee14f8af
Add comprehensive admin features and multi-system integration
...
- Add admin dashboard with sync controls and data browser
- Implement RMM, Auvik, and Addigy organization mappings
- Add chunked ticket sync with progress tracking
- Implement entity sync service with rate limiting
- Add analytics engine and performance optimizer
- Create data browser for all PSA entities
- Add navigation components and UI improvements
- Implement background processing and sync services
- Add comprehensive documentation and migration scripts
- Update configuration items with multi-system support
- Enhance contact management and purchase history
- Add issue type assignment and LLM analyzer
- Improve error handling and logging utilities
2025-11-19 14:18:16 -05:00