website refactor
This commit is contained in:
@@ -4,10 +4,10 @@ import {
|
||||
type DeleteMediaInput,
|
||||
type DeleteMediaErrorCode,
|
||||
} from './DeleteMediaUseCase';
|
||||
import type { IMediaRepository } from '../../domain/repositories/IMediaRepository';
|
||||
import type { MediaRepository } from '../../domain/repositories/MediaRepository';
|
||||
import type { MediaStoragePort } from '../ports/MediaStoragePort';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import { Media } from '../../domain/entities/Media';
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
* Handles the business logic for deleting media files.
|
||||
*/
|
||||
|
||||
import type { IMediaRepository } from '../../domain/repositories/IMediaRepository';
|
||||
import type { MediaRepository } from '../../domain/repositories/MediaRepository';
|
||||
import type { MediaStoragePort } from '../ports/MediaStoragePort';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
|
||||
export interface DeleteMediaInput {
|
||||
|
||||
@@ -4,9 +4,9 @@ import {
|
||||
type GetAvatarInput,
|
||||
type GetAvatarErrorCode,
|
||||
} from './GetAvatarUseCase';
|
||||
import type { IAvatarRepository } from '../../domain/repositories/IAvatarRepository';
|
||||
import type { AvatarRepository } from '../../domain/repositories/AvatarRepository';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import { Avatar } from '../../domain/entities/Avatar';
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Handles the business logic for retrieving a driver's avatar.
|
||||
*/
|
||||
|
||||
import type { IAvatarRepository } from '../../domain/repositories/IAvatarRepository';
|
||||
import type { AvatarRepository } from '../../domain/repositories/AvatarRepository';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
|
||||
export interface GetAvatarInput {
|
||||
|
||||
@@ -4,9 +4,9 @@ import {
|
||||
type GetMediaInput,
|
||||
type GetMediaErrorCode,
|
||||
} from './GetMediaUseCase';
|
||||
import type { IMediaRepository } from '../../domain/repositories/IMediaRepository';
|
||||
import type { MediaRepository } from '../../domain/repositories/MediaRepository';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import { Media } from '../../domain/entities/Media';
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Handles the business logic for retrieving media information.
|
||||
*/
|
||||
|
||||
import type { IMediaRepository } from '../../domain/repositories/IMediaRepository';
|
||||
import type { MediaRepository } from '../../domain/repositories/MediaRepository';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
|
||||
export interface GetMediaInput {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { MediaStoragePort } from '../ports/MediaStoragePort';
|
||||
|
||||
export type GetUploadedMediaInput = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, it, expect, vi, type Mock } from 'vitest';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import {
|
||||
RequestAvatarGenerationUseCase,
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
type RequestAvatarGenerationErrorCode,
|
||||
type RequestAvatarGenerationResult,
|
||||
} from './RequestAvatarGenerationUseCase';
|
||||
import type { IAvatarGenerationRepository } from '../../domain/repositories/IAvatarGenerationRepository';
|
||||
import type { AvatarGenerationRepository } from '../../domain/repositories/AvatarGenerationRepository';
|
||||
import type { FaceValidationPort } from '../ports/FaceValidationPort';
|
||||
import type { AvatarGenerationPort } from '../ports/AvatarGenerationPort';
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
*/
|
||||
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import type { IAvatarGenerationRepository } from '../../domain/repositories/IAvatarGenerationRepository';
|
||||
import type { AvatarGenerationRepository } from '../../domain/repositories/AvatarGenerationRepository';
|
||||
import type { FaceValidationPort } from '../ports/FaceValidationPort';
|
||||
import type { AvatarGenerationPort } from '../ports/AvatarGenerationPort';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { AvatarGenerationRequest } from '../../domain/entities/AvatarGenerationRequest';
|
||||
import type { RacingSuitColor } from '../../domain/types/AvatarGenerationRequest';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
|
||||
export interface RequestAvatarGenerationInput {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { MediaReference } from '@core/domain/media/MediaReference';
|
||||
import type { MediaResolverPort } from '@core/ports/media/MediaResolverPort';
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { describe, it, expect, vi, type Mock } from 'vitest';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import {
|
||||
SelectAvatarUseCase,
|
||||
type SelectAvatarErrorCode,
|
||||
type SelectAvatarInput,
|
||||
} from './SelectAvatarUseCase';
|
||||
import type { IAvatarGenerationRepository } from '../../domain/repositories/IAvatarGenerationRepository';
|
||||
import type { AvatarGenerationRepository } from '../../domain/repositories/AvatarGenerationRepository';
|
||||
import { AvatarGenerationRequest } from '../../domain/entities/AvatarGenerationRequest';
|
||||
|
||||
describe('SelectAvatarUseCase', () => {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Handles the business logic for selecting a generated avatar from the options.
|
||||
*/
|
||||
|
||||
import type { IAvatarGenerationRepository } from '../../domain/repositories/IAvatarGenerationRepository';
|
||||
import type { AvatarGenerationRepository } from '../../domain/repositories/AvatarGenerationRepository';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
|
||||
export interface SelectAvatarInput {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, it, expect, vi, type Mock } from 'vitest';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import {
|
||||
UpdateAvatarUseCase,
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
type UpdateAvatarInput,
|
||||
type UpdateAvatarResult,
|
||||
} from './UpdateAvatarUseCase';
|
||||
import type { IAvatarRepository } from '../../domain/repositories/IAvatarRepository';
|
||||
import type { AvatarRepository } from '../../domain/repositories/AvatarRepository';
|
||||
import { Avatar } from '../../domain/entities/Avatar';
|
||||
|
||||
vi.mock('uuid', () => ({
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*/
|
||||
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { Avatar } from '../../domain/entities/Avatar';
|
||||
import type { IAvatarRepository } from '../../domain/repositories/IAvatarRepository';
|
||||
import type { AvatarRepository } from '../../domain/repositories/AvatarRepository';
|
||||
import { AvatarId } from '../../domain/value-objects/AvatarId';
|
||||
|
||||
export interface UpdateAvatarInput {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { describe, it, expect, vi, type Mock } from 'vitest';
|
||||
import { Readable } from 'node:stream';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import {
|
||||
UploadMediaUseCase,
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
type UploadMediaInput,
|
||||
type UploadMediaResult,
|
||||
} from './UploadMediaUseCase';
|
||||
import type { IMediaRepository } from '../../domain/repositories/IMediaRepository';
|
||||
import type { MediaRepository } from '../../domain/repositories/MediaRepository';
|
||||
import type { MediaStoragePort } from '../ports/MediaStoragePort';
|
||||
import { Media } from '../../domain/entities/Media';
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
* Handles the business logic for uploading media files.
|
||||
*/
|
||||
|
||||
import type { IMediaRepository } from '../../domain/repositories/IMediaRepository';
|
||||
import type { MediaRepository } from '../../domain/repositories/MediaRepository';
|
||||
import type { MediaStoragePort } from '../ports/MediaStoragePort';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Result } from '@core/shared/application/Result';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode';
|
||||
import { Media } from '../../domain/entities/Media';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Represents a user's selected avatar.
|
||||
*/
|
||||
|
||||
import type { IEntity } from '@core/shared/domain';
|
||||
import type { Entity } from '@core/shared/domain';
|
||||
import { MediaUrl } from '../value-objects/MediaUrl';
|
||||
|
||||
export interface AvatarProps {
|
||||
@@ -15,7 +15,7 @@ export interface AvatarProps {
|
||||
isActive: boolean;
|
||||
}
|
||||
|
||||
export class Avatar implements IEntity<string> {
|
||||
export class Avatar implements Entity<string> {
|
||||
readonly id: string;
|
||||
readonly driverId: string;
|
||||
readonly mediaUrl: MediaUrl;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Represents a request to generate a racing avatar from a face photo.
|
||||
*/
|
||||
|
||||
import type { IEntity } from '@core/shared/domain';
|
||||
import type { Entity } from '@core/shared/domain';
|
||||
import type {
|
||||
AvatarGenerationRequestProps,
|
||||
AvatarGenerationStatus,
|
||||
@@ -13,7 +13,7 @@ import type {
|
||||
} from '../types/AvatarGenerationRequest';
|
||||
import { MediaUrl } from '../value-objects/MediaUrl';
|
||||
|
||||
export class AvatarGenerationRequest implements IEntity<string> {
|
||||
export class AvatarGenerationRequest implements Entity<string> {
|
||||
readonly id: string;
|
||||
readonly userId: string;
|
||||
readonly facePhotoUrl: MediaUrl;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Represents a media file (image, video, etc.) stored in the system.
|
||||
*/
|
||||
|
||||
import type { IEntity } from '@core/shared/domain';
|
||||
import type { Entity } from '@core/shared/domain';
|
||||
import { MediaUrl } from '../value-objects/MediaUrl';
|
||||
|
||||
export type MediaType = 'image' | 'video' | 'document';
|
||||
@@ -22,7 +22,7 @@ export interface MediaProps {
|
||||
metadata?: Record<string, unknown> | undefined;
|
||||
}
|
||||
|
||||
export class Media implements IEntity<string> {
|
||||
export class Media implements Entity<string> {
|
||||
readonly id: string;
|
||||
readonly filename: string;
|
||||
readonly originalName: string;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { AvatarGenerationRequest } from '../entities/AvatarGenerationRequest';
|
||||
|
||||
export interface IAvatarGenerationRepository {
|
||||
export interface AvatarGenerationRepository {
|
||||
/**
|
||||
* Save an avatar generation request
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { Avatar } from '../entities/Avatar';
|
||||
|
||||
export interface IAvatarRepository {
|
||||
export interface AvatarRepository {
|
||||
/**
|
||||
* Save an avatar
|
||||
*/
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { Media } from '../entities/Media';
|
||||
|
||||
export interface IMediaRepository {
|
||||
export interface MediaRepository {
|
||||
/**
|
||||
* Save a media file
|
||||
*/
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
|
||||
export interface AvatarIdProps {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export class AvatarId implements IValueObject<AvatarIdProps> {
|
||||
export class AvatarId implements ValueObject<AvatarIdProps> {
|
||||
public readonly props: AvatarIdProps;
|
||||
|
||||
private constructor(value: string) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
|
||||
/**
|
||||
* Value Object: MediaUrl
|
||||
@@ -12,7 +12,7 @@ export interface MediaUrlProps {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export class MediaUrl implements IValueObject<MediaUrlProps> {
|
||||
export class MediaUrl implements ValueObject<MediaUrlProps> {
|
||||
public readonly props: MediaUrlProps;
|
||||
|
||||
private constructor(value: string) {
|
||||
|
||||
Reference in New Issue
Block a user