Files
gridpilot.gg/core/racing/application/dtos/TeamLedgerEntryDto.ts
2025-12-30 12:25:45 +01:00

49 lines
1.1 KiB
TypeScript

/**
* 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;
};
}