view models
This commit is contained in:
@@ -4,7 +4,7 @@ import { CompleteOnboardingOutputDTO } from '../types/generated/CompleteOnboardi
|
||||
* Complete onboarding view model
|
||||
* UI representation of onboarding completion result
|
||||
*/
|
||||
export class CompleteOnboardingViewModel implements CompleteOnboardingOutputDTO {
|
||||
export class CompleteOnboardingViewModel {
|
||||
success: boolean;
|
||||
driverId?: string;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { CreateLeagueOutputDTO } from '../types/generated/CreateLeagueOutputDTO'
|
||||
*
|
||||
* Represents the result of creating a league in a UI-ready format.
|
||||
*/
|
||||
export class CreateLeagueViewModel implements CreateLeagueOutputDTO {
|
||||
export class CreateLeagueViewModel {
|
||||
leagueId: string;
|
||||
success: boolean;
|
||||
|
||||
@@ -18,4 +18,5 @@ export class CreateLeagueViewModel implements CreateLeagueOutputDTO {
|
||||
get successMessage(): string {
|
||||
return this.success ? 'League created successfully!' : 'Failed to create league.';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DriverLeaderboardItemDTO } from '../types/generated/DriverLeaderboardItemDTO';
|
||||
|
||||
export class DriverLeaderboardItemViewModel implements DriverLeaderboardItemDTO {
|
||||
export class DriverLeaderboardItemViewModel {
|
||||
id: string;
|
||||
name: string;
|
||||
rating: number;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DriverRegistrationStatusDTO } from '../types/generated/DriverRegistrationStatusDTO';
|
||||
|
||||
export class DriverRegistrationStatusViewModel implements DriverRegistrationStatusDTO {
|
||||
export class DriverRegistrationStatusViewModel {
|
||||
isRegistered: boolean;
|
||||
raceId: string;
|
||||
driverId: string;
|
||||
|
||||
@@ -5,7 +5,7 @@ interface ImportRaceResultsSummaryDTO {
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
export class ImportRaceResultsSummaryViewModel implements ImportRaceResultsSummaryDTO {
|
||||
export class ImportRaceResultsSummaryViewModel {
|
||||
raceId: string;
|
||||
importedCount: number;
|
||||
errors: string[];
|
||||
|
||||
@@ -4,13 +4,12 @@ import type { LeagueJoinRequestDTO } from '../types/generated/LeagueJoinRequestD
|
||||
* League join request view model
|
||||
* Transform from DTO to ViewModel with UI fields
|
||||
*/
|
||||
export class LeagueJoinRequestViewModel implements LeagueJoinRequestDTO {
|
||||
export class LeagueJoinRequestViewModel {
|
||||
id: string;
|
||||
leagueId: string;
|
||||
driverId: string;
|
||||
requestedAt: string;
|
||||
|
||||
private currentUserId: string;
|
||||
private isAdmin: boolean;
|
||||
|
||||
constructor(dto: LeagueJoinRequestDTO, currentUserId: string, isAdmin: boolean) {
|
||||
@@ -18,7 +17,6 @@ export class LeagueJoinRequestViewModel implements LeagueJoinRequestDTO {
|
||||
this.leagueId = dto.leagueId;
|
||||
this.driverId = dto.driverId;
|
||||
this.requestedAt = dto.requestedAt;
|
||||
this.currentUserId = currentUserId;
|
||||
this.isAdmin = isAdmin;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { LeagueMemberDTO } from '../types/generated/LeagueMemberDTO';
|
||||
import { DriverViewModel } from './DriverViewModel';
|
||||
|
||||
export class LeagueMemberViewModel implements LeagueMemberDTO {
|
||||
export class LeagueMemberViewModel {
|
||||
driverId: string;
|
||||
|
||||
private currentUserId: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { LeagueSummaryDTO } from '../types/generated/LeagueSummaryDTO';
|
||||
|
||||
export class LeagueSummaryViewModel implements LeagueSummaryDTO {
|
||||
export class LeagueSummaryViewModel {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ProtestDTO } from '../types/generated/ProtestDTO';
|
||||
* Protest view model
|
||||
* Represents a race protest
|
||||
*/
|
||||
export class ProtestViewModel implements ProtestDTO {
|
||||
export class ProtestViewModel {
|
||||
id: string;
|
||||
raceId: string;
|
||||
complainantId: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { RaceResultDTO } from '../types/generated/RaceResultDTO';
|
||||
|
||||
export class RaceResultViewModel implements RaceResultDTO {
|
||||
export class RaceResultViewModel {
|
||||
driverId: string;
|
||||
driverName: string;
|
||||
avatarUrl: string;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { RaceResultsDetailDTO } from '../types/generated/RaceResultsDetailDTO';
|
||||
import { RaceResultDTO } from '../types/generated/RaceResultDTO';
|
||||
import { RaceResultsDetailDTO } from '../types/generated/RaceResultsDetailDTO';
|
||||
import { RaceResultViewModel } from './RaceResultViewModel';
|
||||
|
||||
export class RaceResultsDetailViewModel implements RaceResultsDetailDTO {
|
||||
export class RaceResultsDetailViewModel {
|
||||
raceId: string;
|
||||
track: string;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { RaceWithSOFDTO } from '../types/generated/RaceWithSOFDTO';
|
||||
|
||||
export class RaceWithSOFViewModel implements RaceWithSOFDTO {
|
||||
export class RaceWithSOFViewModel {
|
||||
id: string;
|
||||
track: string;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { RemoveLeagueMemberOutputDTO } from '../types/generated/RemoveLeagueMemb
|
||||
*
|
||||
* Represents the result of removing a member from a league in a UI-ready format.
|
||||
*/
|
||||
export class RemoveMemberViewModel implements RemoveLeagueMemberOutputDTO {
|
||||
export class RemoveMemberViewModel {
|
||||
success: boolean;
|
||||
|
||||
constructor(dto: RemoveLeagueMemberOutputDTO) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AuthenticatedUserDTO } from '../types/generated/AuthenticatedUserDTO';
|
||||
|
||||
export class SessionViewModel implements AuthenticatedUserDTO {
|
||||
export class SessionViewModel {
|
||||
userId: string;
|
||||
email: string;
|
||||
displayName: string;
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { SponsorDashboardDTO } from '../types/generated/SponsorDashboardDTO
|
||||
*
|
||||
* View model for sponsor dashboard data with UI-specific transformations.
|
||||
*/
|
||||
export class SponsorDashboardViewModel implements SponsorDashboardDTO {
|
||||
export class SponsorDashboardViewModel {
|
||||
sponsorId: string;
|
||||
sponsorName: string;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { SponsorshipDetailViewModel } from './SponsorshipDetailViewModel';
|
||||
*
|
||||
* View model for sponsor sponsorships data with UI-specific transformations.
|
||||
*/
|
||||
export class SponsorSponsorshipsViewModel implements SponsorSponsorshipsDTO {
|
||||
export class SponsorSponsorshipsViewModel {
|
||||
sponsorId: string;
|
||||
sponsorName: string;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { SponsorshipDetailDTO } from '../types/generated/SponsorshipDetailDTO';
|
||||
|
||||
export class SponsorshipDetailViewModel implements SponsorshipDetailDTO {
|
||||
export class SponsorshipDetailViewModel {
|
||||
id: string;
|
||||
leagueId: string;
|
||||
leagueName: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { LeagueStandingDTO } from '../types/generated/LeagueStandingDTO';
|
||||
|
||||
export class StandingEntryViewModel implements LeagueStandingDTO {
|
||||
export class StandingEntryViewModel {
|
||||
driverId: string;
|
||||
position: number;
|
||||
points: number;
|
||||
|
||||
@@ -8,7 +8,7 @@ export type FullTransactionDto = TransactionDto & {
|
||||
type: 'deposit' | 'withdrawal';
|
||||
};
|
||||
|
||||
export class WalletTransactionViewModel implements FullTransactionDto {
|
||||
export class WalletTransactionViewModel {
|
||||
id: string;
|
||||
walletId: string;
|
||||
amount: number;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { WalletDto } from '../types/generated/WalletDto';
|
||||
import { WalletTransactionViewModel, FullTransactionDto } from './WalletTransactionViewModel';
|
||||
import { FullTransactionDto, WalletTransactionViewModel } from './WalletTransactionViewModel';
|
||||
|
||||
export class WalletViewModel implements WalletDto {
|
||||
export class WalletViewModel {
|
||||
id: string;
|
||||
leagueId: string;
|
||||
balance: number;
|
||||
|
||||
Reference in New Issue
Block a user