view data fixes
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 6m4s
Contract Testing / contract-snapshot (pull_request) Has been skipped

This commit is contained in:
2026-01-23 11:59:49 +01:00
parent ae58839eb2
commit d97f50ed72
191 changed files with 2889 additions and 1019 deletions

View File

@@ -19,9 +19,10 @@ export class AvatarDisplay {
/**
* Determines if avatar data is valid for display.
* Accepts base64-encoded string buffer.
*/
static hasValidData(buffer: ArrayBuffer, contentType: string): boolean {
return buffer.byteLength > 0 && contentType.length > 0;
static hasValidData(buffer: string, contentType: string): boolean {
return buffer.length > 0 && contentType.length > 0;
}
/**

View File

@@ -0,0 +1,14 @@
/**
* LeagueCreationStatusDisplay
*
* Deterministic mapping of league creation status to display messages.
*/
export class LeagueCreationStatusDisplay {
/**
* Maps league creation success status to display message.
*/
static statusMessage(success: boolean): string {
return success ? 'League created successfully!' : 'Failed to create league.';
}
}

View File

@@ -0,0 +1,15 @@
export class RatingTrendDisplay {
static getTrend(currentRating: number, previousRating: number | undefined): 'up' | 'down' | 'same' {
if (!previousRating) return 'same';
if (currentRating > previousRating) return 'up';
if (currentRating < previousRating) return 'down';
return 'same';
}
static getChangeIndicator(currentRating: number, previousRating: number | undefined): string {
const change = previousRating ? currentRating - previousRating : 0;
if (change > 0) return `+${change}`;
if (change < 0) return `${change}`;
return '0';
}
}

View File

@@ -0,0 +1,11 @@
export class SkillLevelIconDisplay {
static getIcon(skillLevel: string): string {
const icons: Record<string, string> = {
beginner: '🥉',
intermediate: '🥈',
advanced: '🥇',
expert: '👑',
};
return icons[skillLevel] || '🏁';
}
}

View File

@@ -0,0 +1,14 @@
/**
* TeamCreationStatusDisplay
*
* Deterministic mapping of team creation status to display messages.
*/
export class TeamCreationStatusDisplay {
/**
* Maps team creation success status to display message.
*/
static statusMessage(success: boolean): string {
return success ? 'Team created successfully!' : 'Failed to create team.';
}
}