rating
This commit is contained in:
56
core/identity/application/dtos/RatingSummaryDto.ts
Normal file
56
core/identity/application/dtos/RatingSummaryDto.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* 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)
|
||||
}
|
||||
Reference in New Issue
Block a user