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
40 lines
983 B
TypeScript
40 lines
983 B
TypeScript
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));
|
|
}
|
|
}
|