wip
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* Defines the contract for AI-powered avatar generation.
|
||||
*/
|
||||
|
||||
import type { RacingSuitColor, AvatarStyle } from '../../domain/entities/AvatarGenerationRequest';
|
||||
import type { RacingSuitColor, AvatarStyle } from '../../domain/types/AvatarGenerationRequest';
|
||||
|
||||
export interface AvatarGenerationOptions {
|
||||
facePhotoUrl: string;
|
||||
|
||||
@@ -42,7 +42,7 @@ export class RequestAvatarGenerationUseCase
|
||||
userId: command.userId,
|
||||
facePhotoUrl: `data:image/jpeg;base64,${command.facePhotoData}`,
|
||||
suitColor: command.suitColor,
|
||||
style: command.style,
|
||||
...(command.style ? { style: command.style } : {}),
|
||||
});
|
||||
|
||||
// Mark as validating
|
||||
|
||||
@@ -53,10 +53,13 @@ export class SelectAvatarUseCase
|
||||
request.selectAvatar(command.avatarIndex);
|
||||
await this.avatarRepository.save(request);
|
||||
|
||||
return {
|
||||
success: true,
|
||||
selectedAvatarUrl: request.selectedAvatarUrl,
|
||||
};
|
||||
const selectedAvatarUrl = request.selectedAvatarUrl;
|
||||
const result: SelectAvatarResult =
|
||||
selectedAvatarUrl !== undefined
|
||||
? { success: true, selectedAvatarUrl }
|
||||
: { success: true };
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
return {
|
||||
success: false,
|
||||
|
||||
Reference in New Issue
Block a user