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