integration tests
Some checks failed
CI / lint-typecheck (pull_request) Failing after 4m50s
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

This commit is contained in:
2026-01-22 23:55:28 +01:00
parent 853ec7b0ce
commit eaf51712a7
29 changed files with 2625 additions and 280 deletions

View File

@@ -0,0 +1,4 @@
export interface ApproveMembershipRequestCommand {
leagueId: string;
requestId: string;
}

View File

@@ -0,0 +1,4 @@
export interface DemoteAdminCommand {
leagueId: string;
targetDriverId: string;
}

View File

@@ -0,0 +1,4 @@
export interface JoinLeagueCommand {
leagueId: string;
driverId: string;
}

View File

@@ -25,16 +25,24 @@ export interface LeagueAccessedEvent {
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;
}

View File

@@ -128,6 +128,20 @@ export interface LeagueComplexResolutionTimeMetrics {
stewardingActionAppealPenaltyProtestResolutionTime2: number;
}
export interface LeagueMember {
driverId: string;
name: string;
role: 'owner' | 'admin' | 'steward' | 'member';
joinDate: Date;
}
export interface LeaguePendingRequest {
id: string;
driverId: string;
name: string;
requestDate: Date;
}
export interface LeagueRepository {
create(league: LeagueData): Promise<LeagueData>;
findById(id: string): Promise<LeagueData | null>;
@@ -166,4 +180,7 @@ export interface LeagueRepository {
getComplexResolutionTimeMetrics(leagueId: string): Promise<LeagueComplexResolutionTimeMetrics>;
updateComplexResolutionTimeMetrics(leagueId: string, metrics: LeagueComplexResolutionTimeMetrics): Promise<LeagueComplexResolutionTimeMetrics>;
getLeagueMembers(leagueId: string): Promise<LeagueMember[]>;
getPendingRequests(leagueId: string): Promise<LeaguePendingRequest[]>;
}

View File

@@ -0,0 +1,3 @@
export interface LeagueRosterQuery {
leagueId: string;
}

View File

@@ -0,0 +1,4 @@
export interface LeaveLeagueCommand {
leagueId: string;
driverId: string;
}

View File

@@ -0,0 +1,4 @@
export interface PromoteMemberCommand {
leagueId: string;
targetDriverId: string;
}

View File

@@ -0,0 +1,4 @@
export interface RejectMembershipRequestCommand {
leagueId: string;
requestId: string;
}

View File

@@ -0,0 +1,4 @@
export interface RemoveMemberCommand {
leagueId: string;
targetDriverId: string;
}