website cleanup

This commit is contained in:
2025-12-24 21:44:58 +01:00
parent 9b683a59d3
commit d78854a4c6
277 changed files with 6141 additions and 2693 deletions

View File

@@ -1,33 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
class TeamListItemDTO {
@ApiProperty()
id!: string;
@ApiProperty()
name!: string;
@ApiProperty()
tag!: string;
@ApiProperty()
description!: string;
@ApiProperty()
memberCount!: number;
@ApiProperty({ type: [String] })
leagues!: string[];
@ApiProperty({ required: false })
specialization?: 'endurance' | 'sprint' | 'mixed';
@ApiProperty({ required: false })
region?: string;
@ApiProperty({ type: [String], required: false })
languages?: string[];
}
import { TeamListItemDTO } from './TeamListItemDTO';
export class GetAllTeamsOutputDTO {
@ApiProperty({ type: [TeamListItemDTO] })
@@ -35,4 +8,4 @@ export class GetAllTeamsOutputDTO {
@ApiProperty()
totalCount!: number;
}
}

View File

@@ -1,58 +1,18 @@
import { ApiProperty } from '@nestjs/swagger';
class TeamDTO {
@ApiProperty()
id!: string;
@ApiProperty()
name!: string;
@ApiProperty()
tag!: string;
@ApiProperty()
description!: string;
@ApiProperty()
ownerId!: string;
@ApiProperty({ type: [String] })
leagues!: string[];
@ApiProperty({ required: false })
createdAt?: string;
@ApiProperty({ required: false })
specialization?: 'endurance' | 'sprint' | 'mixed';
@ApiProperty({ required: false })
region?: string;
@ApiProperty({ type: [String], required: false })
languages?: string[];
}
class MembershipDTO {
@ApiProperty()
role!: 'owner' | 'manager' | 'member';
@ApiProperty()
joinedAt!: string;
@ApiProperty()
isActive!: boolean;
}
import { TeamDTO } from './TeamDTO';
import { TeamMembershipDTO } from './TeamMembershipDTO';
export class GetDriverTeamOutputDTO {
@ApiProperty({ type: TeamDTO })
team!: TeamDTO;
@ApiProperty({ type: MembershipDTO })
membership!: MembershipDTO;
@ApiProperty({ type: TeamMembershipDTO })
membership!: TeamMembershipDTO;
@ApiProperty()
isOwner!: boolean;
@ApiProperty()
canManage!: boolean;
}
}

View File

@@ -1,55 +1,15 @@
import { ApiProperty } from '@nestjs/swagger';
class TeamDTO {
@ApiProperty()
id!: string;
@ApiProperty()
name!: string;
@ApiProperty()
tag!: string;
@ApiProperty()
description!: string;
@ApiProperty()
ownerId!: string;
@ApiProperty({ type: [String] })
leagues!: string[];
@ApiProperty({ required: false })
createdAt?: string;
@ApiProperty({ required: false })
specialization?: 'endurance' | 'sprint' | 'mixed';
@ApiProperty({ required: false })
region?: string;
@ApiProperty({ type: [String], required: false })
languages?: string[];
}
class MembershipDTO {
@ApiProperty()
role!: 'owner' | 'manager' | 'member';
@ApiProperty()
joinedAt!: string;
@ApiProperty()
isActive!: boolean;
}
import { TeamDTO } from './TeamDTO';
import { TeamMembershipDTO } from './TeamMembershipDTO';
export class GetTeamDetailsOutputDTO {
@ApiProperty({ type: TeamDTO })
team!: TeamDTO;
@ApiProperty({ type: MembershipDTO, nullable: true })
membership!: MembershipDTO | null;
@ApiProperty({ type: TeamMembershipDTO, nullable: true })
membership!: TeamMembershipDTO | null;
@ApiProperty()
canManage!: boolean;
}
}

View File

@@ -1,27 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
class TeamJoinRequestDTO {
@ApiProperty()
requestId!: string;
@ApiProperty()
driverId!: string;
@ApiProperty()
driverName!: string;
@ApiProperty()
teamId!: string;
@ApiProperty()
status!: 'pending' | 'approved' | 'rejected';
@ApiProperty()
requestedAt!: string;
@ApiProperty()
avatarUrl!: string;
}
import { TeamJoinRequestDTO } from './TeamJoinRequestDTO';
export class GetTeamJoinRequestsOutputDTO {
@ApiProperty({ type: [TeamJoinRequestDTO] })
@@ -32,4 +11,4 @@ export class GetTeamJoinRequestsOutputDTO {
@ApiProperty()
totalCount!: number;
}
}

View File

@@ -1,24 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
class TeamMemberDTO {
@ApiProperty()
driverId!: string;
@ApiProperty()
driverName!: string;
@ApiProperty()
role!: 'owner' | 'manager' | 'member';
@ApiProperty()
joinedAt!: string;
@ApiProperty()
isActive!: boolean;
@ApiProperty()
avatarUrl!: string;
}
import { TeamMemberDTO } from './TeamMemberDTO';
export class GetTeamMembersOutputDTO {
@ApiProperty({ type: [TeamMemberDTO] })
@@ -35,4 +17,4 @@ export class GetTeamMembersOutputDTO {
@ApiProperty()
memberCount!: number;
}
}

View File

@@ -1,47 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
export type SkillLevel = 'beginner' | 'intermediate' | 'advanced' | 'pro';
class TeamLeaderboardItemDTO {
@ApiProperty()
id!: string;
@ApiProperty()
name!: string;
@ApiProperty()
memberCount!: number;
@ApiProperty({ nullable: true })
rating!: number | null;
@ApiProperty()
totalWins!: number;
@ApiProperty()
totalRaces!: number;
@ApiProperty({ enum: ['beginner', 'intermediate', 'advanced', 'pro'] })
performanceLevel!: SkillLevel;
@ApiProperty()
isRecruiting!: boolean;
@ApiProperty()
createdAt!: string;
@ApiProperty({ required: false })
description?: string;
@ApiProperty({ enum: ['endurance', 'sprint', 'mixed'], required: false })
specialization?: 'endurance' | 'sprint' | 'mixed';
@ApiProperty({ required: false })
region?: string;
@ApiProperty({ type: [String], required: false })
languages?: string[];
}
import { TeamLeaderboardItemDTO, type SkillLevel } from './TeamLeaderboardItemDTO';
export class GetTeamsLeaderboardOutputDTO {
@ApiProperty({ type: [TeamLeaderboardItemDTO] })
@@ -55,4 +14,4 @@ export class GetTeamsLeaderboardOutputDTO {
@ApiProperty({ type: [TeamLeaderboardItemDTO] })
topTeams!: TeamLeaderboardItemDTO[];
}
}

View File

@@ -1,5 +1,5 @@
import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNotEmpty, IsBoolean, IsOptional } from 'class-validator';
import { IsString, IsNotEmpty, IsBoolean, IsOptional, IsArray } from 'class-validator';
export class TeamListItemViewModel {
@ApiProperty()
@@ -296,3 +296,38 @@ export class RejectTeamJoinRequestOutput {
@IsBoolean()
success!: boolean;
}
// ---
// DTOs used by the public API surface (consumed by the website via generated types)
// ---
export class TeamDTO {
@ApiProperty()
@IsString()
id!: string;
@ApiProperty()
@IsString()
name!: string;
@ApiProperty()
@IsString()
tag!: string;
@ApiProperty()
@IsString()
description!: string;
@ApiProperty()
@IsString()
ownerId!: string;
@ApiProperty({ type: [String] })
@IsArray()
leagues!: string[];
@ApiProperty({ required: false })
@IsOptional()
@IsString()
createdAt?: string;
}

View File

@@ -0,0 +1,25 @@
import { ApiProperty } from '@nestjs/swagger';
export class TeamJoinRequestDTO {
@ApiProperty()
requestId!: string;
@ApiProperty()
driverId!: string;
@ApiProperty()
driverName!: string;
@ApiProperty()
teamId!: string;
@ApiProperty({ enum: ['pending', 'approved', 'rejected'] })
status!: 'pending' | 'approved' | 'rejected';
@ApiProperty()
requestedAt!: string;
@ApiProperty()
avatarUrl!: string;
}

View File

@@ -0,0 +1,45 @@
import { ApiProperty } from '@nestjs/swagger';
export type SkillLevel = 'beginner' | 'intermediate' | 'advanced' | 'pro';
export class TeamLeaderboardItemDTO {
@ApiProperty()
id!: string;
@ApiProperty()
name!: string;
@ApiProperty()
memberCount!: number;
@ApiProperty({ nullable: true })
rating!: number | null;
@ApiProperty()
totalWins!: number;
@ApiProperty()
totalRaces!: number;
@ApiProperty({ enum: ['beginner', 'intermediate', 'advanced', 'pro'] })
performanceLevel!: SkillLevel;
@ApiProperty()
isRecruiting!: boolean;
@ApiProperty()
createdAt!: string;
@ApiProperty({ required: false })
description?: string;
@ApiProperty({ enum: ['endurance', 'sprint', 'mixed'], required: false })
specialization?: 'endurance' | 'sprint' | 'mixed';
@ApiProperty({ required: false })
region?: string;
@ApiProperty({ type: [String], required: false })
languages?: string[];
}

View File

@@ -0,0 +1,31 @@
import { ApiProperty } from '@nestjs/swagger';
export class TeamListItemDTO {
@ApiProperty()
id!: string;
@ApiProperty()
name!: string;
@ApiProperty()
tag!: string;
@ApiProperty()
description!: string;
@ApiProperty()
memberCount!: number;
@ApiProperty({ type: [String] })
leagues!: string[];
@ApiProperty({ required: false, enum: ['endurance', 'sprint', 'mixed'] })
specialization?: 'endurance' | 'sprint' | 'mixed';
@ApiProperty({ required: false })
region?: string;
@ApiProperty({ type: [String], required: false })
languages?: string[];
}

View File

@@ -0,0 +1,22 @@
import { ApiProperty } from '@nestjs/swagger';
export class TeamMemberDTO {
@ApiProperty()
driverId!: string;
@ApiProperty()
driverName!: string;
@ApiProperty({ enum: ['owner', 'manager', 'member'] })
role!: 'owner' | 'manager' | 'member';
@ApiProperty()
joinedAt!: string;
@ApiProperty()
isActive!: boolean;
@ApiProperty()
avatarUrl!: string;
}

View File

@@ -0,0 +1,13 @@
import { ApiProperty } from '@nestjs/swagger';
export class TeamMembershipDTO {
@ApiProperty({ enum: ['owner', 'manager', 'member'] })
role!: 'owner' | 'manager' | 'member';
@ApiProperty()
joinedAt!: string;
@ApiProperty()
isActive!: boolean;
}