rename to core
This commit is contained in:
35
core/media/application/ports/AvatarGenerationPort.ts
Normal file
35
core/media/application/ports/AvatarGenerationPort.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Port: AvatarGenerationPort
|
||||
*
|
||||
* Defines the contract for AI-powered avatar generation.
|
||||
*/
|
||||
|
||||
import type { RacingSuitColor, AvatarStyle } from '../../domain/types/AvatarGenerationRequest';
|
||||
|
||||
export interface AvatarGenerationOptions {
|
||||
facePhotoUrl: string;
|
||||
prompt: string;
|
||||
suitColor: RacingSuitColor;
|
||||
style: AvatarStyle;
|
||||
count: number;
|
||||
}
|
||||
|
||||
export interface GeneratedAvatar {
|
||||
url: string;
|
||||
thumbnailUrl?: string;
|
||||
}
|
||||
|
||||
export interface AvatarGenerationResult {
|
||||
success: boolean;
|
||||
avatars: GeneratedAvatar[];
|
||||
errorMessage?: string;
|
||||
}
|
||||
|
||||
export interface AvatarGenerationPort {
|
||||
/**
|
||||
* Generate racing avatars from a face photo
|
||||
* @param options Generation options including face photo and styling preferences
|
||||
* @returns Generated avatar URLs
|
||||
*/
|
||||
generateAvatars(options: AvatarGenerationOptions): Promise<AvatarGenerationResult>;
|
||||
}
|
||||
20
core/media/application/ports/FaceValidationPort.ts
Normal file
20
core/media/application/ports/FaceValidationPort.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Port: FaceValidationPort
|
||||
*
|
||||
* Defines the contract for validating face photos.
|
||||
*/
|
||||
|
||||
export interface FaceValidationResult {
|
||||
isValid: boolean;
|
||||
hasFace: boolean;
|
||||
faceCount: number;
|
||||
confidence: number;
|
||||
errorMessage?: string;
|
||||
}
|
||||
|
||||
export interface FaceValidationPort {
|
||||
/**
|
||||
* Validate that an image contains exactly one valid face
|
||||
*/
|
||||
validateFacePhoto(imageData: string | Buffer): Promise<FaceValidationResult>;
|
||||
}
|
||||
6
core/media/application/ports/ImageServicePort.ts
Normal file
6
core/media/application/ports/ImageServicePort.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export interface ImageServicePort {
|
||||
getDriverAvatar(driverId: string): string;
|
||||
getTeamLogo(teamId: string): string;
|
||||
getLeagueCover(leagueId: string): string;
|
||||
getLeagueLogo(leagueId: string): string;
|
||||
}
|
||||
Reference in New Issue
Block a user