Refactors calendar data management and sync infrastructure

Introduces comprehensive data management system for calendar V2
- Adds IndexedDB storage with pluggable entity services
- Implements EventBus for decoupled event communication
- Creates data seeding mechanism for initial application setup
- Establishes sync and repository abstractions for flexible data handling
This commit is contained in:
Janus C. H. Knudsen 2025-12-08 00:26:16 +01:00
parent dee977d4df
commit e581039b62
17 changed files with 1076 additions and 4 deletions

View file

@ -0,0 +1,47 @@
/**
* CoreEvents - Consolidated essential events for the calendar V2
*/
export const CoreEvents = {
// Lifecycle events
INITIALIZED: 'core:initialized',
READY: 'core:ready',
DESTROYED: 'core:destroyed',
// View events
VIEW_CHANGED: 'view:changed',
VIEW_RENDERED: 'view:rendered',
// Navigation events
DATE_CHANGED: 'nav:date-changed',
NAVIGATION_COMPLETED: 'nav:navigation-completed',
// Data events
DATA_LOADING: 'data:loading',
DATA_LOADED: 'data:loaded',
DATA_ERROR: 'data:error',
// Grid events
GRID_RENDERED: 'grid:rendered',
GRID_CLICKED: 'grid:clicked',
// Event management
EVENT_CREATED: 'event:created',
EVENT_UPDATED: 'event:updated',
EVENT_DELETED: 'event:deleted',
EVENT_SELECTED: 'event:selected',
// System events
ERROR: 'system:error',
// Sync events
SYNC_STARTED: 'sync:started',
SYNC_COMPLETED: 'sync:completed',
SYNC_FAILED: 'sync:failed',
// Entity events - for audit and sync
ENTITY_SAVED: 'entity:saved',
ENTITY_DELETED: 'entity:deleted',
// Rendering events
EVENTS_RENDERED: 'events:rendered'
} as const;