rename to core
This commit is contained in:
29
core/racing/domain/events/MainRaceCompleted.ts
Normal file
29
core/racing/domain/events/MainRaceCompleted.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { IDomainEvent } from '@gridpilot/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();
|
||||
}
|
||||
}
|
||||
29
core/racing/domain/events/RaceEventStewardingClosed.ts
Normal file
29
core/racing/domain/events/RaceEventStewardingClosed.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { IDomainEvent } from '@gridpilot/shared/domain';
|
||||
|
||||
/**
|
||||
* Domain Event: RaceEventStewardingClosed
|
||||
*
|
||||
* Fired when the stewarding window closes for a race event.
|
||||
* This triggers final results notifications to drivers with any penalty adjustments.
|
||||
*/
|
||||
export interface RaceEventStewardingClosedEventData {
|
||||
raceEventId: string;
|
||||
leagueId: string;
|
||||
seasonId: string;
|
||||
closedAt: Date;
|
||||
driverIds: string[]; // Drivers who participated in the race event
|
||||
hadPenaltiesApplied: boolean; // Whether any penalties were applied during stewarding
|
||||
}
|
||||
|
||||
export class RaceEventStewardingClosedEvent implements IDomainEvent<RaceEventStewardingClosedEventData> {
|
||||
readonly eventType = 'RaceEventStewardingClosed';
|
||||
readonly aggregateId: string;
|
||||
readonly eventData: RaceEventStewardingClosedEventData;
|
||||
readonly occurredAt: Date;
|
||||
|
||||
constructor(data: RaceEventStewardingClosedEventData) {
|
||||
this.aggregateId = data.raceEventId;
|
||||
this.eventData = { ...data };
|
||||
this.occurredAt = new Date();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user