wulf-pulse/lib/services
root 5b7532ee59 fix: prevent incorrect soft deletes of billing items
CRITICAL BUG FIX: Billing items were being incorrectly soft-deleted during
full sync because BILLING_ITEMS was missing from the hasDateFilter check.

The Issue:
- Billing items have a date filter (itemDate >= now - yearsBack)
- Full sync with 90-day range fetched only recent billing items
- Soft delete logic saw 89,714 older items not in fetched set
- Incorrectly marked them as deleted (outside sync window)

The Fix:
- Added EntityType.BILLING_ITEMS to hasDateFilter check
- Now billing items skip soft deletes (like tickets, tasks, time entries)
- Prevents deletion of records outside the sync date range

Recovery:
- Restored all 89,714 incorrectly deleted billing items
- UPDATE billing_items SET is_deleted = false WHERE is_deleted = true

This is the same pattern used for tickets, tasks, and time entries which
also have date filters and skip soft deletes.
2026-01-24 09:53:45 -05:00
..
addigy-client.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
addigy-factory.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
analytics-engine.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
analytics-integration.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
autotask-client.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
autotask-factory.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
auvik-client.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
auvik-factory.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
background-processor.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
cache.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
datto-rmm-client-simple.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
datto-rmm-client.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
datto-rmm-factory.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
entity-sync.ts fix: prevent incorrect soft deletes of billing items 2026-01-24 09:53:45 -05:00
issue-type-assignment.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
llm-analyzer.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
performance-optimizer.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
postgres-client.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
rate-limiter.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
redis-client.ts Restructure: rename to Pulse and move app to root 2025-10-28 23:08:54 -04:00
sync-progress-tracker.ts Add comprehensive admin features and multi-system integration 2025-11-19 14:18:16 -05:00
sync-service.ts feat: add tabs to sync page and fix pagination 2026-01-24 07:57:09 -05:00