This commit is contained in:
2025-12-13 11:43:09 +01:00
parent 4b6fc668b5
commit bb0497f429
38 changed files with 3838 additions and 55 deletions

View File

@@ -0,0 +1,41 @@
import type { NotificationType } from '../../domain/types/NotificationTypes';
import type { NotificationChannel } from '../../domain/types/NotificationTypes';
export interface NotificationData {
raceEventId?: string;
sessionId?: string;
leagueId?: string;
position?: number | 'DNF';
positionChange?: number;
incidents?: number;
provisionalRatingChange?: number;
finalRatingChange?: number;
hadPenaltiesApplied?: boolean;
deadline?: Date;
protestId?: string;
[key: string]: unknown;
}
export interface NotificationAction {
label: string;
type: 'primary' | 'secondary' | 'danger';
href?: string;
actionId?: string;
}
export interface SendNotificationCommand {
recipientId: string;
type: NotificationType;
title: string;
body: string;
channel: NotificationChannel;
urgency: 'silent' | 'toast' | 'modal';
data?: NotificationData;
actionUrl?: string;
actions?: NotificationAction[];
requiresResponse?: boolean;
}
export interface INotificationService {
sendNotification(command: SendNotificationCommand): Promise<void>;
}