Refactors repository layer and IndexedDB architecture
Eliminates redundant repository abstraction layer by directly using EntityService methods Implements key improvements: - Removes unnecessary repository wrappers - Introduces polymorphic DataSeeder for mock data loading - Renames IndexedDBService to IndexedDBContext - Fixes database injection timing with lazy access pattern - Simplifies EventManager to use services directly Reduces code complexity and improves separation of concerns
This commit is contained in:
parent
5648c7c304
commit
dcd76836bd
10 changed files with 1260 additions and 574 deletions
|
|
@ -1,8 +1,6 @@
|
|||
import { IEventBus, EntityType, ISync } from '../types/CalendarTypes';
|
||||
import { CoreEvents } from '../constants/CoreEvents';
|
||||
import { OperationQueue } from '../storage/OperationQueue';
|
||||
import { IQueueOperation } from '../storage/IndexedDBService';
|
||||
import { IndexedDBService } from '../storage/IndexedDBService';
|
||||
import { OperationQueue, IQueueOperation } from '../storage/OperationQueue';
|
||||
import { IApiRepository } from '../repositories/IApiRepository';
|
||||
import { IEntityService } from '../storage/IEntityService';
|
||||
|
||||
|
|
@ -33,7 +31,6 @@ import { IEntityService } from '../storage/IEntityService';
|
|||
export class SyncManager {
|
||||
private eventBus: IEventBus;
|
||||
private queue: OperationQueue;
|
||||
private indexedDB: IndexedDBService;
|
||||
private repositories: Map<EntityType, IApiRepository<any>>;
|
||||
private entityServices: IEntityService<any>[];
|
||||
|
||||
|
|
@ -46,13 +43,11 @@ export class SyncManager {
|
|||
constructor(
|
||||
eventBus: IEventBus,
|
||||
queue: OperationQueue,
|
||||
indexedDB: IndexedDBService,
|
||||
apiRepositories: IApiRepository<any>[],
|
||||
entityServices: IEntityService<any>[]
|
||||
) {
|
||||
this.eventBus = eventBus;
|
||||
this.queue = queue;
|
||||
this.indexedDB = indexedDB;
|
||||
this.entityServices = entityServices;
|
||||
|
||||
// Build map: EntityType → IApiRepository
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue