api client refactor

This commit is contained in:
2025-12-17 18:01:47 +01:00
parent bab55955e1
commit 4177644b18
190 changed files with 6403 additions and 1624 deletions

View File

@@ -0,0 +1,48 @@
import { TeamJoinRequestItemDto } from '../dtos';
export class TeamJoinRequestViewModel implements TeamJoinRequestItemDto {
id: string;
teamId: string;
driverId: string;
requestedAt: string;
message?: string;
private currentUserId: string;
private isOwner: boolean;
constructor(dto: TeamJoinRequestItemDto, currentUserId: string, isOwner: boolean) {
Object.assign(this, dto);
this.currentUserId = currentUserId;
this.isOwner = isOwner;
}
/** UI-specific: Whether current user can approve */
get canApprove(): boolean {
return this.isOwner;
}
/** UI-specific: Formatted requested date */
get formattedRequestedAt(): string {
return new Date(this.requestedAt).toLocaleString();
}
/** UI-specific: Request status (pending) */
get status(): string {
return 'Pending';
}
/** UI-specific: Status color */
get statusColor(): string {
return 'yellow';
}
/** UI-specific: Approve button text */
get approveButtonText(): string {
return 'Approve';
}
/** UI-specific: Reject button text */
get rejectButtonText(): string {
return 'Reject';
}
}