website refactor
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import type { GetDriverProfileOutputDTO } from '@/lib/types/generated/GetDriverProfileOutputDTO';
|
||||
import type { DriverProfileViewData } from './DriverProfileViewData';
|
||||
|
||||
/**
|
||||
* DriverProfileViewDataBuilder
|
||||
*
|
||||
* Transforms GetDriverProfileOutputDTO into ViewData for the driver profile page.
|
||||
* Deterministic, side-effect free, no HTTP calls.
|
||||
*/
|
||||
export class DriverProfileViewDataBuilder {
|
||||
static build(apiDto: GetDriverProfileOutputDTO): DriverProfileViewData {
|
||||
return {
|
||||
currentDriver: apiDto.currentDriver || null,
|
||||
stats: apiDto.stats || null,
|
||||
finishDistribution: apiDto.finishDistribution || null,
|
||||
teamMemberships: apiDto.teamMemberships,
|
||||
socialSummary: apiDto.socialSummary,
|
||||
extendedProfile: apiDto.extendedProfile || null,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user