integration tests
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
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
This commit is contained in:
@@ -18,6 +18,12 @@ export class InMemoryAvatarGenerationRepository implements AvatarGenerationRepos
|
||||
}
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
this.requests.clear();
|
||||
this.userRequests.clear();
|
||||
this.logger.info('InMemoryAvatarGenerationRepository cleared.');
|
||||
}
|
||||
|
||||
async save(request: AvatarGenerationRequest): Promise<void> {
|
||||
this.logger.debug(`[InMemoryAvatarGenerationRepository] Saving avatar generation request: ${request.id} for user ${request.userId}.`);
|
||||
this.requests.set(request.id, request);
|
||||
|
||||
22
adapters/media/ports/InMemoryAvatarGenerationAdapter.ts
Normal file
22
adapters/media/ports/InMemoryAvatarGenerationAdapter.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
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,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export class InMemoryMediaStorageAdapter implements MediaStoragePort {
|
||||
}
|
||||
|
||||
// Generate storage key
|
||||
const storageKey = `uploaded/${Date.now()}-${options.filename.replace(/[^a-zA-Z0-9.-]/g, '_')}`;
|
||||
const storageKey = `/media/uploaded/${Date.now()}-${options.filename.replace(/[^a-zA-Z0-9.-]/g, '_')}`;
|
||||
|
||||
// Store buffer and metadata
|
||||
this.storage.set(storageKey, buffer);
|
||||
|
||||
Reference in New Issue
Block a user