29 lines
875 B
TypeScript
29 lines
875 B
TypeScript
import type { IDomainEvent } from '@core/shared/domain';
|
|
|
|
/**
|
|
* Domain Event: MainRaceCompleted
|
|
*
|
|
* Fired when the main race session of a race event is completed.
|
|
* This triggers immediate performance summary notifications to drivers.
|
|
*/
|
|
export interface MainRaceCompletedEventData {
|
|
raceEventId: string;
|
|
sessionId: string;
|
|
leagueId: string;
|
|
seasonId: string;
|
|
completedAt: Date;
|
|
driverIds: string[]; // Drivers who participated in the main race
|
|
}
|
|
|
|
export class MainRaceCompletedEvent implements IDomainEvent<MainRaceCompletedEventData> {
|
|
readonly eventType = 'MainRaceCompleted';
|
|
readonly aggregateId: string;
|
|
readonly eventData: MainRaceCompletedEventData;
|
|
readonly occurredAt: Date;
|
|
|
|
constructor(data: MainRaceCompletedEventData) {
|
|
this.aggregateId = data.raceEventId;
|
|
this.eventData = { ...data };
|
|
this.occurredAt = new Date();
|
|
}
|
|
} |