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:
parent
dee977d4df
commit
e581039b62
17 changed files with 1076 additions and 4 deletions
|
|
@ -14,6 +14,24 @@ import { HeaderDrawerManager } from './core/HeaderDrawerManager';
|
|||
import { MockTeamStore, MockResourceStore } from './demo/MockStores';
|
||||
import { DemoApp } from './demo/DemoApp';
|
||||
|
||||
// Event system
|
||||
import { EventBus } from './core/EventBus';
|
||||
import { IEventBus, ICalendarEvent, ISync } from './types/CalendarTypes';
|
||||
|
||||
// Storage
|
||||
import { IndexedDBContext } from './storage/IndexedDBContext';
|
||||
import { IStore } from './storage/IStore';
|
||||
import { IEntityService } from './storage/IEntityService';
|
||||
import { EventStore } from './storage/events/EventStore';
|
||||
import { EventService } from './storage/events/EventService';
|
||||
|
||||
// Repositories
|
||||
import { IApiRepository } from './repositories/IApiRepository';
|
||||
import { MockEventRepository } from './repositories/MockEventRepository';
|
||||
|
||||
// Workers
|
||||
import { DataSeeder } from './workers/DataSeeder';
|
||||
|
||||
const defaultTimeFormatConfig: ITimeFormatConfig = {
|
||||
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
use24HourFormat: true,
|
||||
|
|
@ -29,9 +47,29 @@ export function createV2Container(): Container {
|
|||
// Config
|
||||
builder.registerInstance(defaultTimeFormatConfig).as<ITimeFormatConfig>();
|
||||
|
||||
// Core - EventBus
|
||||
builder.registerType(EventBus).as<EventBus>();
|
||||
builder.registerType(EventBus).as<IEventBus>();
|
||||
|
||||
// Services
|
||||
builder.registerType(DateService).as<DateService>();
|
||||
|
||||
// Storage infrastructure
|
||||
builder.registerType(IndexedDBContext).as<IndexedDBContext>();
|
||||
builder.registerType(EventStore).as<IStore>();
|
||||
|
||||
// Entity services
|
||||
builder.registerType(EventService).as<IEntityService<ICalendarEvent>>();
|
||||
builder.registerType(EventService).as<IEntityService<ISync>>();
|
||||
builder.registerType(EventService).as<EventService>();
|
||||
|
||||
// Repositories
|
||||
builder.registerType(MockEventRepository).as<IApiRepository<ICalendarEvent>>();
|
||||
builder.registerType(MockEventRepository).as<IApiRepository<ISync>>();
|
||||
|
||||
// Workers
|
||||
builder.registerType(DataSeeder).as<DataSeeder>();
|
||||
|
||||
// Renderers - registreres som IGroupingRenderer
|
||||
builder.registerType(DateRenderer).as<IGroupingRenderer>();
|
||||
builder.registerType(ResourceRenderer).as<IGroupingRenderer>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue