team rating
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* DTO: RecordTeamRaceRatingEventsDto
|
||||
*
|
||||
* Input for RecordTeamRaceRatingEventsUseCase
|
||||
*/
|
||||
|
||||
export interface RecordTeamRaceRatingEventsInput {
|
||||
raceId: string;
|
||||
}
|
||||
|
||||
export interface RecordTeamRaceRatingEventsOutput {
|
||||
success: boolean;
|
||||
raceId: string;
|
||||
eventsCreated: number;
|
||||
teamsUpdated: string[];
|
||||
errors: string[];
|
||||
}
|
||||
49
core/racing/application/dtos/TeamLedgerEntryDto.ts
Normal file
49
core/racing/application/dtos/TeamLedgerEntryDto.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* DTO: TeamLedgerEntryDto
|
||||
*
|
||||
* Simplified team rating event for ledger display/query.
|
||||
* Pragmatic read model - direct repo DTOs, no domain logic.
|
||||
*/
|
||||
|
||||
export interface TeamLedgerEntryDto {
|
||||
id: string;
|
||||
teamId: string;
|
||||
dimension: string; // 'driving', 'adminTrust'
|
||||
delta: number; // positive or negative change
|
||||
weight?: number;
|
||||
occurredAt: string; // ISO date string
|
||||
createdAt: string; // ISO date string
|
||||
|
||||
source: {
|
||||
type: 'race' | 'penalty' | 'vote' | 'adminAction' | 'manualAdjustment';
|
||||
id?: string;
|
||||
};
|
||||
|
||||
reason: {
|
||||
code: string;
|
||||
description?: string;
|
||||
};
|
||||
|
||||
visibility: {
|
||||
public: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface TeamLedgerFilter {
|
||||
dimensions?: string[]; // Filter by dimension keys
|
||||
sourceTypes?: ('race' | 'penalty' | 'vote' | 'adminAction' | 'manualAdjustment')[];
|
||||
from?: string; // ISO date string
|
||||
to?: string; // ISO date string
|
||||
reasonCodes?: string[];
|
||||
}
|
||||
|
||||
export interface PaginatedTeamLedgerResult {
|
||||
entries: TeamLedgerEntryDto[];
|
||||
pagination: {
|
||||
total: number;
|
||||
limit: number;
|
||||
offset: number;
|
||||
hasMore: boolean;
|
||||
nextOffset?: number | null;
|
||||
};
|
||||
}
|
||||
30
core/racing/application/dtos/TeamRatingSummaryDto.ts
Normal file
30
core/racing/application/dtos/TeamRatingSummaryDto.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* DTO: TeamRatingSummaryDto
|
||||
*
|
||||
* Comprehensive team rating summary with platform ratings.
|
||||
* Pragmatic read model - direct repo DTOs, no domain logic.
|
||||
*/
|
||||
|
||||
export interface TeamRatingDimension {
|
||||
value: number;
|
||||
confidence: number;
|
||||
sampleSize: number;
|
||||
trend: 'rising' | 'stable' | 'falling';
|
||||
lastUpdated: string; // ISO date string
|
||||
}
|
||||
|
||||
export interface TeamRatingSummaryDto {
|
||||
teamId: string;
|
||||
|
||||
// Platform ratings (from internal calculations)
|
||||
platform: {
|
||||
driving: TeamRatingDimension;
|
||||
adminTrust: TeamRatingDimension;
|
||||
overall: number;
|
||||
};
|
||||
|
||||
// Timestamps
|
||||
createdAt: string; // ISO date string
|
||||
updatedAt: string; // ISO date string
|
||||
lastRatingEventAt?: string; // ISO date string (optional)
|
||||
}
|
||||
Reference in New Issue
Block a user