refactor driver module (wip)
This commit is contained in:
@@ -8,9 +8,9 @@ export class AllLeaguesWithCapacityAndScoringDTO {
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => LeagueSummaryDTO)
|
||||
leagues: LeagueSummaryDTO[];
|
||||
leagues!: LeagueSummaryDTO[];
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
totalCount: number;
|
||||
totalCount!: number;
|
||||
}
|
||||
@@ -1,5 +1,17 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export interface LeagueSettings {
|
||||
maxDrivers: number;
|
||||
sessionDuration?: number;
|
||||
visibility?: string;
|
||||
}
|
||||
|
||||
export interface SocialLinks {
|
||||
discordUrl?: string;
|
||||
youtubeUrl?: string;
|
||||
websiteUrl?: string;
|
||||
}
|
||||
|
||||
export class LeagueWithCapacityDTO {
|
||||
@ApiProperty()
|
||||
id!: string;
|
||||
@@ -14,21 +26,13 @@ export class LeagueWithCapacityDTO {
|
||||
ownerId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
settings!: {
|
||||
maxDrivers: number;
|
||||
sessionDuration?: number;
|
||||
visibility?: string;
|
||||
};
|
||||
settings!: LeagueSettings;
|
||||
|
||||
@ApiProperty()
|
||||
createdAt!: string;
|
||||
|
||||
@ApiProperty({ nullable: true })
|
||||
socialLinks?: {
|
||||
discordUrl?: string;
|
||||
youtubeUrl?: string;
|
||||
websiteUrl?: string;
|
||||
};
|
||||
socialLinks?: SocialLinks;
|
||||
|
||||
@ApiProperty()
|
||||
usedSlots!: number;
|
||||
|
||||
@@ -4,9 +4,9 @@ import { IsString } from 'class-validator';
|
||||
export class ApproveJoinRequestInputDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
requestId: string;
|
||||
requestId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { IsString, IsBoolean } from 'class-validator';
|
||||
export class ApproveJoinRequestOutputDTO {
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
success: boolean;
|
||||
success!: boolean;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsString()
|
||||
|
||||
@@ -4,17 +4,17 @@ import { IsString, IsEnum } from 'class-validator';
|
||||
export class CreateLeagueInputDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
name: string;
|
||||
name!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
description: string;
|
||||
description!: string;
|
||||
|
||||
@ApiProperty({ enum: ['public', 'private'] })
|
||||
@IsEnum(['public', 'private'])
|
||||
visibility: 'public' | 'private';
|
||||
visibility!: 'public' | 'private';
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
ownerId: string;
|
||||
ownerId!: string;
|
||||
}
|
||||
@@ -4,9 +4,9 @@ import { IsString, IsBoolean } from 'class-validator';
|
||||
export class CreateLeagueOutputDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
success: boolean;
|
||||
success!: boolean;
|
||||
}
|
||||
@@ -8,5 +8,5 @@ export class GetLeagueAdminConfigOutputDTO {
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => LeagueConfigFormModelDTO)
|
||||
form: LeagueConfigFormModelDTO | null;
|
||||
form!: LeagueConfigFormModelDTO | null;
|
||||
}
|
||||
@@ -4,5 +4,5 @@ import { IsString } from 'class-validator';
|
||||
export class GetLeagueAdminConfigQueryDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
}
|
||||
@@ -4,9 +4,9 @@ import { IsString } from 'class-validator';
|
||||
export class GetLeagueAdminPermissionsInputDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
performerDriverId: string;
|
||||
performerDriverId!: string;
|
||||
}
|
||||
@@ -4,5 +4,5 @@ import { IsString } from 'class-validator';
|
||||
export class GetLeagueJoinRequestsQueryDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
}
|
||||
@@ -4,9 +4,9 @@ import { IsString } from 'class-validator';
|
||||
export class GetLeagueOwnerSummaryQueryDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
ownerId: string;
|
||||
ownerId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
}
|
||||
@@ -4,5 +4,5 @@ import { IsString } from 'class-validator';
|
||||
export class GetLeagueProtestsQueryDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
}
|
||||
@@ -3,5 +3,5 @@ import { RaceDTO } from '../../race/dtos/RaceDTO';
|
||||
|
||||
export class GetLeagueRacesOutputDTO {
|
||||
@ApiProperty({ type: [RaceDTO] })
|
||||
races: RaceDTO[];
|
||||
races!: RaceDTO[];
|
||||
}
|
||||
@@ -4,5 +4,5 @@ import { IsString } from 'class-validator';
|
||||
export class GetLeagueSeasonsQueryDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
}
|
||||
@@ -2,28 +2,28 @@ import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class WalletTransactionDTO {
|
||||
@ApiProperty()
|
||||
id: string;
|
||||
id!: string;
|
||||
|
||||
@ApiProperty({ enum: ['sponsorship', 'membership', 'withdrawal', 'prize'] })
|
||||
type: 'sponsorship' | 'membership' | 'withdrawal' | 'prize';
|
||||
type!: 'sponsorship' | 'membership' | 'withdrawal' | 'prize';
|
||||
|
||||
@ApiProperty()
|
||||
description: string;
|
||||
description!: string;
|
||||
|
||||
@ApiProperty()
|
||||
amount: number;
|
||||
amount!: number;
|
||||
|
||||
@ApiProperty()
|
||||
fee: number;
|
||||
fee!: number;
|
||||
|
||||
@ApiProperty()
|
||||
netAmount: number;
|
||||
netAmount!: number;
|
||||
|
||||
@ApiProperty()
|
||||
date: string;
|
||||
date!: string;
|
||||
|
||||
@ApiProperty({ enum: ['completed', 'pending', 'failed'] })
|
||||
status: 'completed' | 'pending' | 'failed';
|
||||
status!: 'completed' | 'pending' | 'failed';
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
reference?: string;
|
||||
@@ -31,29 +31,29 @@ export class WalletTransactionDTO {
|
||||
|
||||
export class GetLeagueWalletOutputDTO {
|
||||
@ApiProperty()
|
||||
balance: number;
|
||||
balance!: number;
|
||||
|
||||
@ApiProperty()
|
||||
currency: string;
|
||||
currency!: string;
|
||||
|
||||
@ApiProperty()
|
||||
totalRevenue: number;
|
||||
totalRevenue!: number;
|
||||
|
||||
@ApiProperty()
|
||||
totalFees: number;
|
||||
totalFees!: number;
|
||||
|
||||
@ApiProperty()
|
||||
totalWithdrawals: number;
|
||||
totalWithdrawals!: number;
|
||||
|
||||
@ApiProperty()
|
||||
pendingPayouts: number;
|
||||
pendingPayouts!: number;
|
||||
|
||||
@ApiProperty()
|
||||
canWithdraw: boolean;
|
||||
canWithdraw!: boolean;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
withdrawalBlockReason?: string;
|
||||
|
||||
@ApiProperty({ type: [WalletTransactionDTO] })
|
||||
transactions: WalletTransactionDTO[];
|
||||
transactions!: WalletTransactionDTO[];
|
||||
}
|
||||
@@ -3,5 +3,5 @@ import { SponsorshipDetailDTO } from '../../sponsor/dtos/SponsorshipDetailDTO';
|
||||
|
||||
export class GetSeasonSponsorshipsOutputDTO {
|
||||
@ApiProperty({ type: [SponsorshipDetailDTO] })
|
||||
sponsorships: SponsorshipDetailDTO[];
|
||||
sponsorships!: SponsorshipDetailDTO[];
|
||||
}
|
||||
@@ -8,5 +8,5 @@ export class LeagueAdminConfigDTO {
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => LeagueConfigFormModelDTO)
|
||||
form: LeagueConfigFormModelDTO | null;
|
||||
form!: LeagueConfigFormModelDTO | null;
|
||||
}
|
||||
@@ -12,27 +12,27 @@ export class LeagueAdminDTO {
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => LeagueJoinRequestDTO)
|
||||
joinRequests: LeagueJoinRequestDTO[];
|
||||
joinRequests!: LeagueJoinRequestDTO[];
|
||||
|
||||
@ApiProperty({ type: () => LeagueOwnerSummaryDTO, nullable: true })
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => LeagueOwnerSummaryDTO)
|
||||
ownerSummary: LeagueOwnerSummaryDTO | null;
|
||||
ownerSummary!: LeagueOwnerSummaryDTO | null;
|
||||
|
||||
@ApiProperty({ type: () => LeagueAdminConfigDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => LeagueAdminConfigDTO)
|
||||
config: LeagueAdminConfigDTO;
|
||||
config!: LeagueAdminConfigDTO;
|
||||
|
||||
@ApiProperty({ type: () => LeagueAdminProtestsDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => LeagueAdminProtestsDTO)
|
||||
protests: LeagueAdminProtestsDTO;
|
||||
protests!: LeagueAdminProtestsDTO;
|
||||
|
||||
@ApiProperty({ type: [LeagueSeasonSummaryDTO] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => LeagueSeasonSummaryDTO)
|
||||
seasons: LeagueSeasonSummaryDTO[];
|
||||
seasons!: LeagueSeasonSummaryDTO[];
|
||||
}
|
||||
@@ -4,9 +4,9 @@ import { IsBoolean } from 'class-validator';
|
||||
export class LeagueAdminPermissionsDTO {
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
canRemoveMember: boolean;
|
||||
canRemoveMember!: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
canUpdateRoles: boolean;
|
||||
canUpdateRoles!: boolean;
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsArray, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { DriverDto } from '../../driver/dto/DriverDto';
|
||||
import { RaceDto } from '../../race/dto/RaceDto';
|
||||
import { DriverDTO } from '../../driver/dtos/DriverDTO';
|
||||
import { RaceDTO } from '../../race/dtos/RaceDTO';
|
||||
import { ProtestDTO } from './ProtestDTO';
|
||||
|
||||
export class LeagueAdminProtestsDTO {
|
||||
@ApiProperty({ type: [ProtestDTO] })
|
||||
@ApiProperty({ type: [ProtestDTO] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => ProtestDTO)
|
||||
protests: ProtestDTO[];
|
||||
protests!: ProtestDTO[];
|
||||
|
||||
@ApiProperty({ type: () => RaceDto })
|
||||
@ApiProperty({ type: () => RaceDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => RaceDto)
|
||||
racesById: { [raceId: string]: RaceDto };
|
||||
@Type(() => RaceDTO)
|
||||
racesById!: { [raceId: string]: RaceDTO };
|
||||
|
||||
@ApiProperty({ type: () => DriverDto })
|
||||
@ApiProperty({ type: () => DriverDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => DriverDto)
|
||||
driversById: { [driverId: string]: DriverDto };
|
||||
@Type(() => DriverDTO)
|
||||
driversById!: { [driverId: string]: DriverDTO };
|
||||
}
|
||||
@@ -4,13 +4,13 @@ import { IsString, IsEnum } from 'class-validator';
|
||||
export class LeagueConfigFormModelBasicsDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
name: string;
|
||||
name!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
description: string;
|
||||
description!: string;
|
||||
|
||||
@ApiProperty({ enum: ['public', 'private'] })
|
||||
@IsEnum(['public', 'private'])
|
||||
visibility: 'public' | 'private';
|
||||
visibility!: 'public' | 'private';
|
||||
}
|
||||
@@ -11,39 +11,39 @@ import { LeagueConfigFormModelTimingsDTO } from './LeagueConfigFormModelTimingsD
|
||||
export class LeagueConfigFormModelDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
|
||||
@ApiProperty({ type: LeagueConfigFormModelBasicsDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => LeagueConfigFormModelBasicsDTO)
|
||||
basics: LeagueConfigFormModelBasicsDTO;
|
||||
basics!: LeagueConfigFormModelBasicsDTO;
|
||||
|
||||
@ApiProperty({ type: LeagueConfigFormModelStructureDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => LeagueConfigFormModelStructureDTO)
|
||||
structure: LeagueConfigFormModelStructureDTO;
|
||||
structure!: LeagueConfigFormModelStructureDTO;
|
||||
|
||||
@ApiProperty({ type: [Object] })
|
||||
@IsArray()
|
||||
championships: Object[];
|
||||
championships!: Object[];
|
||||
|
||||
@ApiProperty({ type: LeagueConfigFormModelScoringDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => LeagueConfigFormModelScoringDTO)
|
||||
scoring: LeagueConfigFormModelScoringDTO;
|
||||
scoring!: LeagueConfigFormModelScoringDTO;
|
||||
|
||||
@ApiProperty({ type: LeagueConfigFormModelDropPolicyDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => LeagueConfigFormModelDropPolicyDTO)
|
||||
dropPolicy: LeagueConfigFormModelDropPolicyDTO;
|
||||
dropPolicy!: LeagueConfigFormModelDropPolicyDTO;
|
||||
|
||||
@ApiProperty({ type: LeagueConfigFormModelTimingsDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => LeagueConfigFormModelTimingsDTO)
|
||||
timings: LeagueConfigFormModelTimingsDTO;
|
||||
timings!: LeagueConfigFormModelTimingsDTO;
|
||||
|
||||
@ApiProperty({ type: LeagueConfigFormModelStewardingDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => LeagueConfigFormModelStewardingDTO)
|
||||
stewarding: LeagueConfigFormModelStewardingDTO;
|
||||
stewarding!: LeagueConfigFormModelStewardingDTO;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { IsNumber, IsOptional, IsEnum } from 'class-validator';
|
||||
export class LeagueConfigFormModelDropPolicyDTO {
|
||||
@ApiProperty({ enum: ['none', 'worst_n'] })
|
||||
@IsEnum(['none', 'worst_n'])
|
||||
strategy: 'none' | 'worst_n';
|
||||
strategy!: 'none' | 'worst_n';
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
|
||||
@@ -4,9 +4,9 @@ import { IsString, IsNumber } from 'class-validator';
|
||||
export class LeagueConfigFormModelScoringDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
type: string;
|
||||
type!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
points: number;
|
||||
points!: number;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { IsNumber, IsBoolean, IsOptional, IsEnum } from 'class-validator';
|
||||
export class LeagueConfigFormModelStewardingDTO {
|
||||
@ApiProperty({ enum: ['single_steward', 'committee_vote'] })
|
||||
@IsEnum(['single_steward', 'committee_vote'])
|
||||
decisionMode: 'single_steward' | 'committee_vote';
|
||||
decisionMode!: 'single_steward' | 'committee_vote';
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@@ -13,29 +13,29 @@ export class LeagueConfigFormModelStewardingDTO {
|
||||
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
requireDefense: boolean;
|
||||
requireDefense!: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
defenseTimeLimit: number;
|
||||
defenseTimeLimit!: number;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
voteTimeLimit: number;
|
||||
voteTimeLimit!: number;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
protestDeadlineHours: number;
|
||||
protestDeadlineHours!: number;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
stewardingClosesHours: number;
|
||||
stewardingClosesHours!: number;
|
||||
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
notifyAccusedOnProtest: boolean;
|
||||
notifyAccusedOnProtest!: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
notifyOnVoteRequired: boolean;
|
||||
notifyOnVoteRequired!: boolean;
|
||||
}
|
||||
@@ -5,5 +5,5 @@ export class LeagueConfigFormModelStructureDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
@IsEnum(['solo', 'team'])
|
||||
mode: 'solo' | 'team';
|
||||
mode!: 'solo' | 'team';
|
||||
}
|
||||
@@ -4,13 +4,13 @@ import { IsString, IsNumber } from 'class-validator';
|
||||
export class LeagueConfigFormModelTimingsDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
raceDayOfWeek: string;
|
||||
raceDayOfWeek!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
raceTimeHour: number;
|
||||
raceTimeHour!: number;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
raceTimeMinute: number;
|
||||
raceTimeMinute!: number;
|
||||
}
|
||||
@@ -2,23 +2,28 @@ import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsDate, IsOptional } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
|
||||
export interface DriverInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export class LeagueJoinRequestDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
id: string;
|
||||
id!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
driverId: string;
|
||||
driverId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsDate()
|
||||
@Type(() => Date)
|
||||
requestedAt: Date;
|
||||
requestedAt!: Date;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@@ -30,8 +35,5 @@ export class LeagueJoinRequestDTO {
|
||||
type: () => Object,
|
||||
})
|
||||
@IsOptional()
|
||||
driver?: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
driver?: DriverInfo;
|
||||
}
|
||||
@@ -1,24 +1,24 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsDate, IsEnum, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { DriverDto } from '../../driver/dto/DriverDto';
|
||||
import { DriverDTO } from '../../driver/dtos/DriverDTO';
|
||||
|
||||
export class LeagueMemberDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
driverId: string;
|
||||
driverId!: string;
|
||||
|
||||
@ApiProperty({ type: () => DriverDto })
|
||||
@ApiProperty({ type: () => DriverDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => DriverDto)
|
||||
driver: DriverDto;
|
||||
@Type(() => DriverDTO)
|
||||
driver!: DriverDTO;
|
||||
|
||||
@ApiProperty({ enum: ['owner', 'manager', 'member'] })
|
||||
@IsEnum(['owner', 'manager', 'member'])
|
||||
role: 'owner' | 'manager' | 'member';
|
||||
role!: 'owner' | 'manager' | 'member';
|
||||
|
||||
@ApiProperty()
|
||||
@IsDate()
|
||||
@Type(() => Date)
|
||||
joinedAt: Date;
|
||||
joinedAt!: Date;
|
||||
}
|
||||
@@ -4,25 +4,25 @@ import { IsString, IsEnum } from 'class-validator';
|
||||
export class LeagueMembershipDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
id: string;
|
||||
id!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
driverId: string;
|
||||
driverId!: string;
|
||||
|
||||
@ApiProperty({ enum: ['owner', 'admin', 'steward', 'member'] })
|
||||
@IsEnum(['owner', 'admin', 'steward', 'member'])
|
||||
role: 'owner' | 'admin' | 'steward' | 'member';
|
||||
role!: 'owner' | 'admin' | 'steward' | 'member';
|
||||
|
||||
@ApiProperty({ enum: ['active', 'inactive', 'pending'] })
|
||||
@IsEnum(['active', 'inactive', 'pending'])
|
||||
status: 'active' | 'inactive' | 'pending';
|
||||
status!: 'active' | 'inactive' | 'pending';
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
joinedAt: string;
|
||||
joinedAt!: string;
|
||||
}
|
||||
@@ -8,5 +8,5 @@ export class LeagueMembershipsDTO {
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => LeagueMemberDTO)
|
||||
members: LeagueMemberDTO[];
|
||||
members!: LeagueMemberDTO[];
|
||||
}
|
||||
@@ -1,21 +1,21 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNumber, IsOptional, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { DriverDto } from '../../driver/dto/DriverDto';
|
||||
import { DriverDTO } from '../../driver/dtos/DriverDTO';
|
||||
|
||||
export class LeagueOwnerSummaryDTO {
|
||||
@ApiProperty({ type: () => DriverDto })
|
||||
@ApiProperty({ type: () => DriverDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => DriverDto)
|
||||
driver: DriverDto;
|
||||
@Type(() => DriverDTO)
|
||||
driver!: DriverDTO;
|
||||
|
||||
@ApiProperty({ nullable: true })
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
rating: number | null;
|
||||
rating!: number | null;
|
||||
|
||||
@ApiProperty({ nullable: true })
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
rank: number | null;
|
||||
rank!: number | null;
|
||||
}
|
||||
@@ -4,5 +4,5 @@ import { IsEnum } from 'class-validator';
|
||||
export class LeagueRoleDTO {
|
||||
@ApiProperty({ enum: ['owner', 'admin', 'steward', 'member'] })
|
||||
@IsEnum(['owner', 'admin', 'steward', 'member'])
|
||||
value: 'owner' | 'admin' | 'steward' | 'member';
|
||||
value!: 'owner' | 'admin' | 'steward' | 'member';
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsArray, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { RaceDto } from '../../race/dto/RaceDto';
|
||||
import { RaceDTO } from '../../race/dtos/RaceDTO';
|
||||
|
||||
export class LeagueScheduleDTO {
|
||||
@ApiProperty({ type: [RaceDto] })
|
||||
@ApiProperty({ type: [RaceDTO] })
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => RaceDto)
|
||||
races: RaceDto[];
|
||||
@Type(() => RaceDTO)
|
||||
races!: RaceDTO[];
|
||||
}
|
||||
@@ -4,29 +4,29 @@ import { IsString, IsEnum } from 'class-validator';
|
||||
export class LeagueScoringPresetDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
id: string;
|
||||
id!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
name: string;
|
||||
name!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
description: string;
|
||||
description!: string;
|
||||
|
||||
@ApiProperty({ enum: ['driver', 'team', 'nations', 'trophy'] })
|
||||
@IsEnum(['driver', 'team', 'nations', 'trophy'])
|
||||
primaryChampionshipType: 'driver' | 'team' | 'nations' | 'trophy';
|
||||
primaryChampionshipType!: 'driver' | 'team' | 'nations' | 'trophy';
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
sessionSummary: string;
|
||||
sessionSummary!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
bonusSummary: string;
|
||||
bonusSummary!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
dropPolicySummary: string;
|
||||
dropPolicySummary!: string;
|
||||
}
|
||||
@@ -5,15 +5,15 @@ import { Type } from 'class-transformer';
|
||||
export class LeagueSeasonSummaryDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
seasonId: string;
|
||||
seasonId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
name: string;
|
||||
name!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
status: string;
|
||||
status!: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@@ -29,9 +29,9 @@ export class LeagueSeasonSummaryDTO {
|
||||
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
isPrimary: boolean;
|
||||
isPrimary!: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
isParallelActive: boolean;
|
||||
isParallelActive!: boolean;
|
||||
}
|
||||
@@ -1,23 +1,23 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsNumber, ValidateNested } from 'class-validator';
|
||||
import { Type } from 'class-transformer';
|
||||
import { DriverDto } from '../../driver/dto/DriverDto';
|
||||
import { DriverDTO } from '../../driver/dtos/DriverDTO';
|
||||
|
||||
export class LeagueStandingDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
driverId: string;
|
||||
driverId!: string;
|
||||
|
||||
@ApiProperty({ type: () => DriverDto })
|
||||
@ApiProperty({ type: () => DriverDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => DriverDto)
|
||||
driver: DriverDto;
|
||||
@Type(() => DriverDTO)
|
||||
driver!: DriverDTO;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
points: number;
|
||||
points!: number;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
rank: number;
|
||||
rank!: number;
|
||||
}
|
||||
@@ -8,5 +8,5 @@ export class LeagueStandingsDTO {
|
||||
@IsArray()
|
||||
@ValidateNested({ each: true })
|
||||
@Type(() => LeagueStandingDTO)
|
||||
standings: LeagueStandingDTO[];
|
||||
standings!: LeagueStandingDTO[];
|
||||
}
|
||||
@@ -4,13 +4,13 @@ import { IsNumber } from 'class-validator';
|
||||
export class LeagueStatsDTO {
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
totalMembers: number;
|
||||
totalMembers!: number;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
totalRaces: number;
|
||||
totalRaces!: number;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
averageRating: number;
|
||||
averageRating!: number;
|
||||
}
|
||||
@@ -4,11 +4,11 @@ import { IsString, IsNumber, IsBoolean, IsOptional } from 'class-validator';
|
||||
export class LeagueSummaryDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
id: string;
|
||||
id!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
name: string;
|
||||
name!: string;
|
||||
|
||||
@ApiProperty({ nullable: true })
|
||||
@IsOptional()
|
||||
@@ -27,19 +27,19 @@ export class LeagueSummaryDTO {
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
memberCount: number;
|
||||
memberCount!: number;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
maxMembers: number;
|
||||
maxMembers!: number;
|
||||
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
isPublic: boolean;
|
||||
isPublic!: boolean;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
ownerId: string;
|
||||
ownerId!: string;
|
||||
|
||||
@ApiProperty({ nullable: true })
|
||||
@IsOptional()
|
||||
|
||||
@@ -6,11 +6,11 @@ import { LeagueSettingsDTO } from './LeagueSettingsDTO';
|
||||
export class LeagueWithCapacityDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
id: string;
|
||||
id!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
name: string;
|
||||
name!: string;
|
||||
|
||||
// ... other properties of LeagueWithCapacityDTO
|
||||
@ApiProperty({ nullable: true })
|
||||
@@ -20,20 +20,20 @@ export class LeagueWithCapacityDTO {
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
ownerId: string;
|
||||
ownerId!: string;
|
||||
|
||||
@ApiProperty({ type: () => LeagueSettingsDTO })
|
||||
@ValidateNested()
|
||||
@Type(() => LeagueSettingsDTO)
|
||||
settings: LeagueSettingsDTO;
|
||||
settings!: LeagueSettingsDTO;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
createdAt: string;
|
||||
createdAt!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
usedSlots: number;
|
||||
usedSlots!: number;
|
||||
|
||||
@ApiProperty({ type: () => Object, nullable: true }) // Using Object for generic social links
|
||||
@IsOptional()
|
||||
|
||||
@@ -4,5 +4,5 @@ import { IsEnum } from 'class-validator';
|
||||
export class MembershipRoleDTO {
|
||||
@ApiProperty({ enum: ['owner', 'admin', 'steward', 'member'] })
|
||||
@IsEnum(['owner', 'admin', 'steward', 'member'])
|
||||
value: 'owner' | 'admin' | 'steward' | 'member';
|
||||
value!: 'owner' | 'admin' | 'steward' | 'member';
|
||||
}
|
||||
@@ -4,5 +4,5 @@ import { IsEnum } from 'class-validator';
|
||||
export class MembershipStatusDTO {
|
||||
@ApiProperty({ enum: ['active', 'inactive', 'pending'] })
|
||||
@IsEnum(['active', 'inactive', 'pending'])
|
||||
value: 'active' | 'inactive' | 'pending';
|
||||
value!: 'active' | 'inactive' | 'pending';
|
||||
}
|
||||
@@ -13,34 +13,34 @@ import { Type } from 'class-transformer';
|
||||
export class ProtestDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
id: string;
|
||||
id!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
raceId: string;
|
||||
raceId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
protestingDriverId: string;
|
||||
protestingDriverId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
accusedDriverId: string;
|
||||
accusedDriverId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsDate()
|
||||
@Type(() => Date)
|
||||
submittedAt: Date;
|
||||
submittedAt!: Date;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
description: string;
|
||||
description!: string;
|
||||
|
||||
@ApiProperty({ enum: ['pending', 'accepted', 'rejected'] })
|
||||
@IsEnum(['pending', 'accepted', 'rejected'])
|
||||
status: 'pending' | 'accepted' | 'rejected';
|
||||
status!: 'pending' | 'accepted' | 'rejected';
|
||||
}
|
||||
@@ -4,9 +4,9 @@ import { IsString } from 'class-validator';
|
||||
export class RejectJoinRequestInputDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
requestId: string;
|
||||
requestId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { IsString, IsBoolean } from 'class-validator';
|
||||
export class RejectJoinRequestOutputDTO {
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
success: boolean;
|
||||
success!: boolean;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsString()
|
||||
|
||||
@@ -4,13 +4,13 @@ import { IsString } from 'class-validator';
|
||||
export class RemoveLeagueMemberInputDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
performerDriverId: string;
|
||||
performerDriverId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
targetDriverId: string;
|
||||
targetDriverId!: string;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { IsBoolean, IsOptional, IsString } from 'class-validator';
|
||||
export class RemoveLeagueMemberOutputDTO {
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
success: boolean;
|
||||
success!: boolean;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
|
||||
@@ -5,15 +5,15 @@ import { Type } from 'class-transformer';
|
||||
export class SeasonDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
seasonId: string;
|
||||
seasonId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
name: string;
|
||||
name!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@@ -29,11 +29,11 @@ export class SeasonDTO {
|
||||
|
||||
@ApiProperty({ enum: ['planned', 'active', 'completed'] })
|
||||
@IsEnum(['planned', 'active', 'completed'])
|
||||
status: 'planned' | 'active' | 'completed';
|
||||
status!: 'planned' | 'active' | 'completed';
|
||||
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
isPrimary: boolean;
|
||||
isPrimary!: boolean;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
|
||||
@@ -4,5 +4,5 @@ import { IsNumber } from 'class-validator';
|
||||
export class TotalLeaguesDTO {
|
||||
@ApiProperty()
|
||||
@IsNumber()
|
||||
totalLeagues: number;
|
||||
totalLeagues!: number;
|
||||
}
|
||||
@@ -4,17 +4,17 @@ import { IsString, IsEnum } from 'class-validator';
|
||||
export class UpdateLeagueMemberRoleInputDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
leagueId: string;
|
||||
leagueId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
performerDriverId: string;
|
||||
performerDriverId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
targetDriverId: string;
|
||||
targetDriverId!: string;
|
||||
|
||||
@ApiProperty({ enum: ['owner', 'manager', 'member'] })
|
||||
@IsEnum(['owner', 'manager', 'member'])
|
||||
newRole: 'owner' | 'manager' | 'member';
|
||||
newRole!: 'owner' | 'manager' | 'member';
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import { IsBoolean, IsOptional, IsString } from 'class-validator';
|
||||
export class UpdateLeagueMemberRoleOutputDTO {
|
||||
@ApiProperty()
|
||||
@IsBoolean()
|
||||
success: boolean;
|
||||
success!: boolean;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
|
||||
@@ -2,14 +2,14 @@ import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class WithdrawFromLeagueWalletInputDTO {
|
||||
@ApiProperty()
|
||||
amount: number;
|
||||
amount!: number;
|
||||
|
||||
@ApiProperty()
|
||||
currency: string;
|
||||
currency!: string;
|
||||
|
||||
@ApiProperty()
|
||||
seasonId: string;
|
||||
seasonId!: string;
|
||||
|
||||
@ApiProperty()
|
||||
destinationAccount: string;
|
||||
destinationAccount!: string;
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class WithdrawFromLeagueWalletOutputDTO {
|
||||
@ApiProperty()
|
||||
success: boolean;
|
||||
success!: boolean;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
message?: string;
|
||||
|
||||
@@ -4,5 +4,5 @@ import { IsEnum } from 'class-validator';
|
||||
export class WizardStepDTO {
|
||||
@ApiProperty({ enum: [1, 2, 3, 4, 5, 6, 7] })
|
||||
@IsEnum([1, 2, 3, 4, 5, 6, 7])
|
||||
value: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
||||
value!: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
||||
}
|
||||
Reference in New Issue
Block a user