Files
gridpilot.gg/core/identity/application/dtos/RatingSummaryDto.ts
2025-12-29 22:27:33 +01:00

57 lines
1.3 KiB
TypeScript

/**
* DTO: RatingSummaryDto
*
* Comprehensive rating summary with platform and external game ratings.
* Pragmatic read model - direct repo DTOs, no domain logic.
*/
export interface PlatformRatingDimension {
value: number;
confidence: number;
sampleSize: number;
trend: 'rising' | 'stable' | 'falling';
lastUpdated: string; // ISO date string
}
export interface ExternalGameRating {
gameKey: string;
type: string;
value: number;
lastUpdated: string; // ISO date string
}
export interface ExternalGameRatings {
gameKey: string;
ratings: Map<string, number>; // type -> value
source: string;
lastSyncedAt: string; // ISO date string
verified: boolean;
}
export interface RatingSummaryDto {
userId: string;
// Platform ratings (from internal calculations)
platform: {
driving: PlatformRatingDimension;
admin: PlatformRatingDimension;
steward: PlatformRatingDimension;
trust: PlatformRatingDimension;
fairness: PlatformRatingDimension;
overallReputation: number;
};
// External game ratings (from third-party sources)
external: {
// gameKey -> { type -> value }
[gameKey: string]: {
[type: string]: number;
};
};
// Timestamps
createdAt: string; // ISO date string
updatedAt: string; // ISO date string
lastRatingEventAt?: string; // ISO date string (optional)
}