39 lines
868 B
TypeScript
39 lines
868 B
TypeScript
import type {
|
|
GetAvatarOutputDto,
|
|
RequestAvatarGenerationOutputDto,
|
|
UpdateAvatarOutputDto
|
|
} from '../dtos';
|
|
import type {
|
|
AvatarViewModel,
|
|
RequestAvatarGenerationViewModel,
|
|
UpdateAvatarViewModel
|
|
} from '../view-models';
|
|
|
|
/**
|
|
* Avatar Presenter
|
|
* Transforms avatar DTOs to ViewModels
|
|
*/
|
|
export class AvatarPresenter {
|
|
presentAvatar(dto: GetAvatarOutputDto): AvatarViewModel {
|
|
return {
|
|
driverId: dto.driverId,
|
|
avatarUrl: dto.avatarUrl,
|
|
hasAvatar: dto.hasAvatar,
|
|
};
|
|
}
|
|
|
|
presentRequestGeneration(dto: RequestAvatarGenerationOutputDto): RequestAvatarGenerationViewModel {
|
|
return {
|
|
success: dto.success,
|
|
avatarUrl: dto.avatarUrl,
|
|
error: dto.error,
|
|
};
|
|
}
|
|
|
|
presentUpdate(dto: UpdateAvatarOutputDto): UpdateAvatarViewModel {
|
|
return {
|
|
success: dto.success,
|
|
error: dto.error,
|
|
};
|
|
}
|
|
} |