fix issues in core
This commit is contained in:
@@ -10,6 +10,7 @@ import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorC
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { Avatar } from '../../domain/entities/Avatar';
|
||||
import type { IAvatarRepository } from '../../domain/repositories/IAvatarRepository';
|
||||
import { AvatarId } from '../../domain/value-objects/AvatarId';
|
||||
|
||||
export interface UpdateAvatarInput {
|
||||
driverId: string;
|
||||
@@ -48,9 +49,9 @@ export class UpdateAvatarUseCase {
|
||||
await this.avatarRepo.save(currentAvatar);
|
||||
}
|
||||
|
||||
const avatarId = uuidv4(); // TODO this ID should be a value object
|
||||
const avatarId = AvatarId.create(uuidv4());
|
||||
const newAvatar = Avatar.create({
|
||||
id: avatarId,
|
||||
id: avatarId.toString(),
|
||||
driverId: input.driverId,
|
||||
mediaUrl: input.mediaUrl,
|
||||
});
|
||||
@@ -58,13 +59,13 @@ export class UpdateAvatarUseCase {
|
||||
await this.avatarRepo.save(newAvatar);
|
||||
|
||||
this.output.present({
|
||||
avatarId,
|
||||
avatarId: avatarId.toString(),
|
||||
driverId: input.driverId,
|
||||
});
|
||||
|
||||
this.logger.info('[UpdateAvatarUseCase] Avatar updated successfully', {
|
||||
driverId: input.driverId,
|
||||
avatarId,
|
||||
avatarId: avatarId.toString(),
|
||||
});
|
||||
|
||||
return Result.ok(undefined);
|
||||
|
||||
Reference in New Issue
Block a user