Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
74 lines
1.8 KiB
TypeScript
74 lines
1.8 KiB
TypeScript
import { ScoringSystem } from './LeagueCreateCommand';
|
|
|
|
export interface LeagueCreatedEvent {
|
|
type: 'LeagueCreatedEvent';
|
|
leagueId: string;
|
|
ownerId: string;
|
|
timestamp: Date;
|
|
}
|
|
|
|
export interface LeagueUpdates {
|
|
name?: string;
|
|
description?: string;
|
|
visibility?: 'public' | 'private';
|
|
maxDrivers?: number;
|
|
approvalRequired?: boolean;
|
|
lateJoinAllowed?: boolean;
|
|
raceFrequency?: string;
|
|
raceDay?: string;
|
|
raceTime?: string;
|
|
tracks?: string[];
|
|
scoringSystem?: ScoringSystem;
|
|
bonusPointsEnabled?: boolean;
|
|
penaltiesEnabled?: boolean;
|
|
protestsEnabled?: boolean;
|
|
appealsEnabled?: boolean;
|
|
stewardTeam?: string[];
|
|
gameType?: string;
|
|
skillLevel?: string;
|
|
category?: string;
|
|
tags?: string[];
|
|
}
|
|
|
|
export interface LeagueUpdatedEvent {
|
|
type: 'LeagueUpdatedEvent';
|
|
leagueId: string;
|
|
updates: Partial<LeagueUpdates>;
|
|
timestamp: Date;
|
|
}
|
|
|
|
export interface LeagueDeletedEvent {
|
|
type: 'LeagueDeletedEvent';
|
|
leagueId: string;
|
|
timestamp: Date;
|
|
}
|
|
|
|
export interface LeagueAccessedEvent {
|
|
type: 'LeagueAccessedEvent';
|
|
leagueId: string;
|
|
driverId: string;
|
|
timestamp: Date;
|
|
}
|
|
|
|
export interface LeagueRosterAccessedEvent {
|
|
type: 'LeagueRosterAccessedEvent';
|
|
leagueId: string;
|
|
timestamp: Date;
|
|
}
|
|
|
|
export interface LeagueEventPublisher {
|
|
emitLeagueCreated(event: LeagueCreatedEvent): Promise<void>;
|
|
emitLeagueUpdated(event: LeagueUpdatedEvent): Promise<void>;
|
|
emitLeagueDeleted(event: LeagueDeletedEvent): Promise<void>;
|
|
emitLeagueAccessed(event: LeagueAccessedEvent): Promise<void>;
|
|
emitLeagueRosterAccessed(event: LeagueRosterAccessedEvent): Promise<void>;
|
|
|
|
getLeagueCreatedEventCount(): number;
|
|
getLeagueUpdatedEventCount(): number;
|
|
getLeagueDeletedEventCount(): number;
|
|
getLeagueAccessedEventCount(): number;
|
|
getLeagueRosterAccessedEventCount(): number;
|
|
|
|
clear(): void;
|
|
}
|