Refactor calendar V2 core with DI and new features
Introduces dependency injection container and composition root Adds core services like DateService and NavigationAnimator Simplifies CalendarOrchestrator with improved store handling Implements mock stores and demo application for V2 calendar
This commit is contained in:
parent
1ad7d10266
commit
a0c0ef9e8d
17 changed files with 331 additions and 134 deletions
40
src/v2/demo/MockStores.ts
Normal file
40
src/v2/demo/MockStores.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { IGroupingStore } from '../core/IGroupingStore';
|
||||
|
||||
export interface Team {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface Resource {
|
||||
id: string;
|
||||
name: string;
|
||||
teamId: string;
|
||||
}
|
||||
|
||||
export class MockTeamStore implements IGroupingStore<Team> {
|
||||
readonly type = 'team';
|
||||
|
||||
private teams: Team[] = [
|
||||
{ id: 'alpha', name: 'Team Alpha' },
|
||||
{ id: 'beta', name: 'Team Beta' }
|
||||
];
|
||||
|
||||
getByIds(ids: string[]): Team[] {
|
||||
return this.teams.filter(t => ids.includes(t.id));
|
||||
}
|
||||
}
|
||||
|
||||
export class MockResourceStore implements IGroupingStore<Resource> {
|
||||
readonly type = 'resource';
|
||||
|
||||
private resources: Resource[] = [
|
||||
{ id: 'alice', name: 'Alice', teamId: 'alpha' },
|
||||
{ id: 'bob', name: 'Bob', teamId: 'alpha' },
|
||||
{ id: 'carol', name: 'Carol', teamId: 'beta' },
|
||||
{ id: 'dave', name: 'Dave', teamId: 'beta' }
|
||||
];
|
||||
|
||||
getByIds(ids: string[]): Resource[] {
|
||||
return this.resources.filter(r => ids.includes(r.id));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue