view models
This commit is contained in:
26
apps/website/lib/view-models/DriverTeamViewModel.ts
Normal file
26
apps/website/lib/view-models/DriverTeamViewModel.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* View Model for Driver's Team
|
||||
*
|
||||
* Represents a driver's team membership in a UI-ready format.
|
||||
*/
|
||||
export class DriverTeamViewModel {
|
||||
teamId: string;
|
||||
teamName: string;
|
||||
role: string;
|
||||
|
||||
constructor(dto: { teamId: string; teamName: string; role: string }) {
|
||||
this.teamId = dto.teamId;
|
||||
this.teamName = dto.teamName;
|
||||
this.role = dto.role;
|
||||
}
|
||||
|
||||
/** UI-specific: Display role */
|
||||
get displayRole(): string {
|
||||
return this.role.charAt(0).toUpperCase() + this.role.slice(1);
|
||||
}
|
||||
|
||||
/** UI-specific: Is owner */
|
||||
get isOwner(): boolean {
|
||||
return this.role === 'owner';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user