27 lines
766 B
TypeScript
27 lines
766 B
TypeScript
import { CompleteOnboardingOutputDTO } from '@/lib/types/generated/CompleteOnboardingOutputDTO';
|
|
|
|
/**
|
|
* Complete onboarding view model
|
|
* UI representation of onboarding completion result
|
|
*/
|
|
export class CompleteOnboardingViewModel {
|
|
success: boolean;
|
|
driverId?: string;
|
|
errorMessage?: string;
|
|
|
|
constructor(dto: CompleteOnboardingOutputDTO) {
|
|
this.success = dto.success;
|
|
if (dto.driverId !== undefined) this.driverId = dto.driverId;
|
|
if (dto.errorMessage !== undefined) this.errorMessage = dto.errorMessage;
|
|
}
|
|
|
|
/** UI-specific: Whether onboarding was successful */
|
|
get isSuccessful(): boolean {
|
|
return this.success;
|
|
}
|
|
|
|
/** UI-specific: Whether there was an error */
|
|
get hasError(): boolean {
|
|
return !!this.errorMessage;
|
|
}
|
|
} |