Some checks failed
CI / lint-typecheck (pull_request) Failing after 4m50s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
23 lines
908 B
TypeScript
23 lines
908 B
TypeScript
import type { AvatarGenerationPort, AvatarGenerationOptions, AvatarGenerationResult } from '@core/media/application/ports/AvatarGenerationPort';
|
|
import type { Logger } from '@core/shared/domain/Logger';
|
|
|
|
export class InMemoryAvatarGenerationAdapter implements AvatarGenerationPort {
|
|
constructor(private readonly logger: Logger) {
|
|
this.logger.info('InMemoryAvatarGenerationAdapter initialized.');
|
|
}
|
|
|
|
async generateAvatars(options: AvatarGenerationOptions): Promise<AvatarGenerationResult> {
|
|
this.logger.debug('[InMemoryAvatarGenerationAdapter] Generating avatars (mock).', { options });
|
|
|
|
const avatars = Array.from({ length: options.count }, (_, i) => ({
|
|
url: `https://example.com/generated-avatar-${i + 1}.png`,
|
|
thumbnailUrl: `https://example.com/generated-avatar-${i + 1}-thumb.png`,
|
|
}));
|
|
|
|
return Promise.resolve({
|
|
success: true,
|
|
avatars,
|
|
});
|
|
}
|
|
}
|