diff --git a/core/admin/application/use-cases/ListUsersUseCase.test.ts b/core/admin/application/use-cases/ListUsersUseCase.test.ts index 8f343ae13..53522d098 100644 --- a/core/admin/application/use-cases/ListUsersUseCase.test.ts +++ b/core/admin/application/use-cases/ListUsersUseCase.test.ts @@ -17,7 +17,7 @@ const mockRepository = { create: vi.fn(), update: vi.fn(), delete: vi.fn(), -} as unknown as IAdminUserRepository; +} as unknown as AdminUserRepository; describe('ListUsersUseCase', () => { let useCase: ListUsersUseCase; diff --git a/core/admin/application/use-cases/ListUsersUseCase.ts b/core/admin/application/use-cases/ListUsersUseCase.ts index f12e93d44..2090c624e 100644 --- a/core/admin/application/use-cases/ListUsersUseCase.ts +++ b/core/admin/application/use-cases/ListUsersUseCase.ts @@ -44,7 +44,7 @@ export type ListUsersApplicationError = ApplicationErrorCode { - readonly id: UserId; +export class AdminUser extends Entity { private _email: Email; private _roles: UserRole[]; private _status: UserStatus; @@ -29,7 +28,8 @@ export class AdminUser implements Entity { private _primaryDriverId: string | undefined; private constructor(props: AdminUserProps) { - this.id = props.id; + super(props.id); + this._email = props.email; this._roles = props.roles; this._status = props.status; diff --git a/core/admin/domain/errors/AdminDomainError.ts b/core/admin/domain/errors/AdminDomainError.ts index eb342d58e..f8dcc0367 100644 --- a/core/admin/domain/errors/AdminDomainError.ts +++ b/core/admin/domain/errors/AdminDomainError.ts @@ -1,6 +1,6 @@ -import type { DomainError, CommonDomainErrorKind } from '@core/shared/errors'; +import type { DomainErrorProps, CommonDomainErrorKind } from '@core/shared/errors/DomainError'; -export abstract class AdminDomainError extends Error implements DomainError { +export abstract class AdminDomainError extends Error implements DomainErrorProps { readonly type = 'domain' as const; readonly context = 'admin-domain'; abstract readonly kind: CommonDomainErrorKind; diff --git a/core/admin/domain/value-objects/Email.ts b/core/admin/domain/value-objects/Email.ts index ed162c8f6..feba76232 100644 --- a/core/admin/domain/value-objects/Email.ts +++ b/core/admin/domain/value-objects/Email.ts @@ -1,4 +1,4 @@ -import { ValueObject } from '@core/shared/domain'; +import { ValueObject } from '@core/shared/domain/ValueObject'; import { AdminDomainValidationError } from '../errors/AdminDomainError'; export interface EmailProps { @@ -40,7 +40,7 @@ export class Email implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } } \ No newline at end of file diff --git a/core/admin/domain/value-objects/UserId.ts b/core/admin/domain/value-objects/UserId.ts index c0ff65e03..8e035f41e 100644 --- a/core/admin/domain/value-objects/UserId.ts +++ b/core/admin/domain/value-objects/UserId.ts @@ -1,4 +1,4 @@ -import { ValueObject } from '@core/shared/domain'; +import { ValueObject } from '@core/shared/domain/ValueObject'; import { AdminDomainValidationError } from '../errors/AdminDomainError'; export interface UserIdProps { @@ -28,7 +28,7 @@ export class UserId implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/admin/domain/value-objects/UserRole.ts b/core/admin/domain/value-objects/UserRole.ts index 21f777adf..b7af51f52 100644 --- a/core/admin/domain/value-objects/UserRole.ts +++ b/core/admin/domain/value-objects/UserRole.ts @@ -1,4 +1,4 @@ -import { ValueObject } from '@core/shared/domain'; +import { ValueObject } from '@core/shared/domain/ValueObject'; import { AdminDomainValidationError } from '../errors/AdminDomainError'; export type UserRoleValue = string; @@ -41,7 +41,7 @@ export class UserRole implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/admin/domain/value-objects/UserStatus.ts b/core/admin/domain/value-objects/UserStatus.ts index 50ccb1d40..82a7effcb 100644 --- a/core/admin/domain/value-objects/UserStatus.ts +++ b/core/admin/domain/value-objects/UserStatus.ts @@ -1,4 +1,4 @@ -import { ValueObject } from '@core/shared/domain'; +import { ValueObject } from '@core/shared/domain/ValueObject'; import { AdminDomainValidationError } from '../errors/AdminDomainError'; export type UserStatusValue = string; @@ -41,7 +41,7 @@ export class UserStatus implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/analytics/application/use-cases/GetAnalyticsMetricsUseCase.ts b/core/analytics/application/use-cases/GetAnalyticsMetricsUseCase.ts index 2a760deef..6564f2088 100644 --- a/core/analytics/application/use-cases/GetAnalyticsMetricsUseCase.ts +++ b/core/analytics/application/use-cases/GetAnalyticsMetricsUseCase.ts @@ -1,4 +1,5 @@ -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; import type { PageViewRepository } from '../repositories/PageViewRepository'; @@ -20,7 +21,7 @@ export type GetAnalyticsMetricsErrorCode = 'REPOSITORY_ERROR'; export class GetAnalyticsMetricsUseCase implements UseCase { constructor( private readonly logger: Logger, - private readonly pageViewRepository?: IPageViewRepository, + private readonly pageViewRepository?: PageViewRepository, ) {} async execute( diff --git a/core/analytics/application/use-cases/GetDashboardDataUseCase.ts b/core/analytics/application/use-cases/GetDashboardDataUseCase.ts index 3b09fd3e5..a73a16101 100644 --- a/core/analytics/application/use-cases/GetDashboardDataUseCase.ts +++ b/core/analytics/application/use-cases/GetDashboardDataUseCase.ts @@ -1,4 +1,5 @@ -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; diff --git a/core/analytics/application/use-cases/GetEntityAnalyticsQuery.test.ts b/core/analytics/application/use-cases/GetEntityAnalyticsQuery.test.ts index 69de23650..c4c374593 100644 --- a/core/analytics/application/use-cases/GetEntityAnalyticsQuery.test.ts +++ b/core/analytics/application/use-cases/GetEntityAnalyticsQuery.test.ts @@ -32,8 +32,8 @@ describe('GetEntityAnalyticsQuery', () => { } as unknown as Logger; useCase = new GetEntityAnalyticsQuery( - pageViewRepository as unknown as IPageViewRepository, - engagementRepository as unknown as IEngagementRepository, + pageViewRepository as unknown as PageViewRepository, + engagementRepository as unknown as EngagementRepository, logger, ); }); diff --git a/core/analytics/application/use-cases/GetEntityAnalyticsQuery.ts b/core/analytics/application/use-cases/GetEntityAnalyticsQuery.ts index 6cbdc668f..2477ae2e8 100644 --- a/core/analytics/application/use-cases/GetEntityAnalyticsQuery.ts +++ b/core/analytics/application/use-cases/GetEntityAnalyticsQuery.ts @@ -5,7 +5,8 @@ * Returns metrics formatted for display to sponsors and admins. */ -import type { AsyncUseCase , Logger } from '@core/shared/application'; +import type { AsyncUseCase } from '@core/shared/application/AsyncUseCase'; +import type { Logger } from '@core/shared/domain/Logger'; import type { PageViewRepository } from '../repositories/PageViewRepository'; import type { EngagementRepository } from '@core/analytics/domain/repositories/EngagementRepository'; import type { EntityType } from '../../domain/types/PageView'; @@ -48,8 +49,8 @@ export type GetEntityAnalyticsErrorCode = 'REPOSITORY_ERROR'; export class GetEntityAnalyticsQuery implements AsyncUseCase { constructor( - private readonly pageViewRepository: IPageViewRepository, - private readonly engagementRepository: IEngagementRepository, + private readonly pageViewRepository: PageViewRepository, + private readonly engagementRepository: EngagementRepository, private readonly logger: Logger ) {} diff --git a/core/analytics/application/use-cases/RecordEngagementUseCase.test.ts b/core/analytics/application/use-cases/RecordEngagementUseCase.test.ts index 56de058f1..7e682d568 100644 --- a/core/analytics/application/use-cases/RecordEngagementUseCase.test.ts +++ b/core/analytics/application/use-cases/RecordEngagementUseCase.test.ts @@ -24,7 +24,7 @@ describe('RecordEngagementUseCase', () => { } as unknown as Logger; useCase = new RecordEngagementUseCase( - engagementRepository as unknown as IEngagementRepository, + engagementRepository as unknown as EngagementRepository, logger, ); }); diff --git a/core/analytics/application/use-cases/RecordEngagementUseCase.ts b/core/analytics/application/use-cases/RecordEngagementUseCase.ts index 219ed778e..5d1a9d311 100644 --- a/core/analytics/application/use-cases/RecordEngagementUseCase.ts +++ b/core/analytics/application/use-cases/RecordEngagementUseCase.ts @@ -1,4 +1,5 @@ -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; import { EngagementEvent } from '../../domain/entities/EngagementEvent'; @@ -24,7 +25,7 @@ export type RecordEngagementErrorCode = 'REPOSITORY_ERROR'; export class RecordEngagementUseCase implements UseCase { constructor( - private readonly engagementRepository: IEngagementRepository, + private readonly engagementRepository: EngagementRepository, private readonly logger: Logger, ) {} diff --git a/core/analytics/application/use-cases/RecordPageViewUseCase.ts b/core/analytics/application/use-cases/RecordPageViewUseCase.ts index 4d94de311..086afc497 100644 --- a/core/analytics/application/use-cases/RecordPageViewUseCase.ts +++ b/core/analytics/application/use-cases/RecordPageViewUseCase.ts @@ -1,4 +1,5 @@ -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; import type { PageViewRepository } from '../repositories/PageViewRepository'; import { PageView } from '../../domain/entities/PageView'; import type { EntityType, VisitorType } from '../../domain/types/PageView'; @@ -24,7 +25,7 @@ export type RecordPageViewErrorCode = 'REPOSITORY_ERROR'; export class RecordPageViewUseCase implements UseCase { constructor( - private readonly pageViewRepository: IPageViewRepository, + private readonly pageViewRepository: PageViewRepository, private readonly logger: Logger, ) {} diff --git a/core/analytics/domain/entities/AnalyticsSnapshot.ts b/core/analytics/domain/entities/AnalyticsSnapshot.ts index ff2cd4542..59c38289d 100644 --- a/core/analytics/domain/entities/AnalyticsSnapshot.ts +++ b/core/analytics/domain/entities/AnalyticsSnapshot.ts @@ -5,7 +5,7 @@ * Pre-calculated metrics for sponsor dashboard and entity analytics. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import type { AnalyticsMetrics, AnalyticsSnapshotProps, @@ -15,8 +15,7 @@ import type { import { AnalyticsEntityId } from '../value-objects/AnalyticsEntityId'; export type { SnapshotEntityType, SnapshotPeriod } from '../types/AnalyticsSnapshot'; -export class AnalyticsSnapshot implements Entity { - readonly id: string; +export class AnalyticsSnapshot extends Entity { readonly entityType: SnapshotEntityType; readonly period: SnapshotPeriod; readonly startDate: Date; @@ -27,7 +26,7 @@ export class AnalyticsSnapshot implements Entity { private readonly entityIdVo: AnalyticsEntityId; private constructor(props: AnalyticsSnapshotProps) { - this.id = props.id; + super(props.id); this.entityType = props.entityType; this.entityIdVo = AnalyticsEntityId.create(props.entityId); this.period = props.period; diff --git a/core/analytics/domain/entities/EngagementEvent.ts b/core/analytics/domain/entities/EngagementEvent.ts index 8d80fe1ed..c9d100890 100644 --- a/core/analytics/domain/entities/EngagementEvent.ts +++ b/core/analytics/domain/entities/EngagementEvent.ts @@ -5,7 +5,7 @@ * Tracks clicks, downloads, sign-ups, and other engagement actions. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import type { EngagementAction, EngagementEntityType, @@ -15,8 +15,7 @@ import { AnalyticsEntityId } from '../value-objects/AnalyticsEntityId'; export type { EngagementAction, EngagementEntityType } from '../types/EngagementEvent'; -export class EngagementEvent implements Entity { - readonly id: string; +export class EngagementEvent extends Entity { readonly action: EngagementAction; readonly entityType: EngagementEntityType; readonly actorId: string | undefined; @@ -28,7 +27,8 @@ export class EngagementEvent implements Entity { private readonly entityIdVo: AnalyticsEntityId; private constructor(props: EngagementEventProps) { - this.id = props.id; + super(props.id); + this.action = props.action; this.entityType = props.entityType; this.entityIdVo = AnalyticsEntityId.create(props.entityId); diff --git a/core/analytics/domain/entities/PageView.ts b/core/analytics/domain/entities/PageView.ts index c300519e7..fe176de66 100644 --- a/core/analytics/domain/entities/PageView.ts +++ b/core/analytics/domain/entities/PageView.ts @@ -5,7 +5,7 @@ * Captures visitor interactions with leagues, drivers, teams, races. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import type { EntityType, PageViewProps, VisitorType } from '../types/PageView'; import { AnalyticsEntityId } from '../value-objects/AnalyticsEntityId'; import { AnalyticsSessionId } from '../value-objects/AnalyticsSessionId'; @@ -13,7 +13,7 @@ import { PageViewId } from '../value-objects/PageViewId'; export type { EntityType, VisitorType } from '../types/PageView'; -export class PageView implements Entity { +export class PageView extends Entity { readonly entityType: EntityType; readonly visitorId: string | undefined; readonly visitorType: VisitorType; @@ -28,6 +28,7 @@ export class PageView implements Entity { private readonly sessionIdVo: AnalyticsSessionId; private constructor(props: PageViewProps) { + super(props.id); this.idVo = PageViewId.create(props.id); this.entityType = props.entityType; this.entityIdVo = AnalyticsEntityId.create(props.entityId); @@ -41,10 +42,6 @@ export class PageView implements Entity { this.durationMs = props.durationMs; } - get id(): string { - return this.idVo.value; - } - get entityId(): string { return this.entityIdVo.value; } diff --git a/core/analytics/domain/repositories/AnalyticsSnapshotRepository.ts b/core/analytics/domain/repositories/AnalyticsSnapshotRepository.ts index 527c6271b..633acd4eb 100644 --- a/core/analytics/domain/repositories/AnalyticsSnapshotRepository.ts +++ b/core/analytics/domain/repositories/AnalyticsSnapshotRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IAnalyticsSnapshotRepository + * Repository Interface: AnalyticsSnapshotRepository * * Defines persistence operations for AnalyticsSnapshot entities. */ diff --git a/core/analytics/domain/value-objects/AnalyticsEntityId.ts b/core/analytics/domain/value-objects/AnalyticsEntityId.ts index 0a95db644..ac2331c78 100644 --- a/core/analytics/domain/value-objects/AnalyticsEntityId.ts +++ b/core/analytics/domain/value-objects/AnalyticsEntityId.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface AnalyticsEntityIdProps { value: string; @@ -31,7 +31,7 @@ export class AnalyticsEntityId implements ValueObject { return this.props.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.value === other.props.value; } } \ No newline at end of file diff --git a/core/analytics/domain/value-objects/AnalyticsSessionId.ts b/core/analytics/domain/value-objects/AnalyticsSessionId.ts index 1635531c5..f12754557 100644 --- a/core/analytics/domain/value-objects/AnalyticsSessionId.ts +++ b/core/analytics/domain/value-objects/AnalyticsSessionId.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface AnalyticsSessionIdProps { value: string; @@ -30,7 +30,7 @@ export class AnalyticsSessionId implements ValueObject return this.props.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.value === other.props.value; } } \ No newline at end of file diff --git a/core/analytics/domain/value-objects/PageViewId.ts b/core/analytics/domain/value-objects/PageViewId.ts index 0c54fea22..085f9890b 100644 --- a/core/analytics/domain/value-objects/PageViewId.ts +++ b/core/analytics/domain/value-objects/PageViewId.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface PageViewIdProps { value: string; @@ -30,7 +30,7 @@ export class PageViewId implements ValueObject { return this.props.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.value === other.props.value; } } \ No newline at end of file diff --git a/core/domain/media/MediaReference.ts b/core/domain/media/MediaReference.ts index 2586d7ec6..60bfb047d 100644 --- a/core/domain/media/MediaReference.ts +++ b/core/domain/media/MediaReference.ts @@ -10,7 +10,7 @@ * Follows clean architecture and TDD principles. */ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; // Variant types for system-default references export type MediaVariant = 'avatar' | 'logo'; @@ -236,7 +236,7 @@ export class MediaReference implements ValueObject { /** * Equality comparison */ - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { if (!(other instanceof MediaReference)) { return false; } diff --git a/core/identity/application/ports/RaceResultsProvider.ts b/core/identity/application/ports/RaceResultsProvider.ts index c275fc841..e2cc00482 100644 --- a/core/identity/application/ports/RaceResultsProvider.ts +++ b/core/identity/application/ports/RaceResultsProvider.ts @@ -1,5 +1,5 @@ /** - * Port: IRaceResultsProvider + * Port: RaceResultsProvider * * Provider interface for race results data needed for rating calculations. * This is an application layer port that bridges racing context to identity context. diff --git a/core/identity/application/queries/GetLeagueEligibilityPreviewQuery.test.ts b/core/identity/application/queries/GetLeagueEligibilityPreviewQuery.test.ts index 5864a839a..726522565 100644 --- a/core/identity/application/queries/GetLeagueEligibilityPreviewQuery.test.ts +++ b/core/identity/application/queries/GetLeagueEligibilityPreviewQuery.test.ts @@ -13,15 +13,15 @@ import { UserRatingRepository } from '../../domain/repositories/UserRatingReposi import { ExternalGameRatingRepository } from '../../domain/repositories/ExternalGameRatingRepository'; describe('GetLeagueEligibilityPreviewQuery', () => { - let mockUserRatingRepo: IUserRatingRepository; - let mockExternalRatingRepo: IExternalGameRatingRepository; + let mockUserRatingRepo: UserRatingRepository; + let mockExternalRatingRepo: ExternalGameRatingRepository; let handler: GetLeagueEligibilityPreviewQueryHandler; beforeEach(() => { mockUserRatingRepo = { findByUserId: vi.fn(), save: vi.fn(), - } as unknown as IUserRatingRepository; + } as unknown as UserRatingRepository; mockExternalRatingRepo = { findByUserId: vi.fn(), @@ -32,7 +32,7 @@ describe('GetLeagueEligibilityPreviewQuery', () => { delete: vi.fn(), exists: vi.fn(), findProfilesPaginated: vi.fn(), - } as unknown as IExternalGameRatingRepository; + } as unknown as ExternalGameRatingRepository; handler = new GetLeagueEligibilityPreviewQueryHandler( mockUserRatingRepo, diff --git a/core/identity/application/queries/GetLeagueEligibilityPreviewQuery.ts b/core/identity/application/queries/GetLeagueEligibilityPreviewQuery.ts index fc0e41fb4..ec370face 100644 --- a/core/identity/application/queries/GetLeagueEligibilityPreviewQuery.ts +++ b/core/identity/application/queries/GetLeagueEligibilityPreviewQuery.ts @@ -21,8 +21,8 @@ export class GetLeagueEligibilityPreviewQueryHandler { private readonly evaluator: EligibilityEvaluator; constructor( - private readonly userRatingRepo: IUserRatingRepository, - private readonly externalRatingRepo: IExternalGameRatingRepository + private readonly userRatingRepo: UserRatingRepository, + private readonly externalRatingRepo: ExternalGameRatingRepository ) { this.evaluator = new EligibilityEvaluator(); } diff --git a/core/identity/application/queries/GetUserRatingLedgerQuery.ts b/core/identity/application/queries/GetUserRatingLedgerQuery.ts index 89da33c3d..bcd0f4593 100644 --- a/core/identity/application/queries/GetUserRatingLedgerQuery.ts +++ b/core/identity/application/queries/GetUserRatingLedgerQuery.ts @@ -16,7 +16,7 @@ export interface GetUserRatingLedgerQuery { export class GetUserRatingLedgerQueryHandler { constructor( - private readonly ratingEventRepo: IRatingEventRepository + private readonly ratingEventRepo: RatingEventRepository ) {} async execute(query: GetUserRatingLedgerQuery): Promise { diff --git a/core/identity/application/queries/GetUserRatingsSummaryQuery.ts b/core/identity/application/queries/GetUserRatingsSummaryQuery.ts index 82eabb9b8..82f2bf5fb 100644 --- a/core/identity/application/queries/GetUserRatingsSummaryQuery.ts +++ b/core/identity/application/queries/GetUserRatingsSummaryQuery.ts @@ -16,9 +16,9 @@ export interface GetUserRatingsSummaryQuery { export class GetUserRatingsSummaryQueryHandler { constructor( - private readonly userRatingRepo: IUserRatingRepository, - private readonly externalRatingRepo: IExternalGameRatingRepository, - private readonly ratingEventRepo: IRatingEventRepository + private readonly userRatingRepo: UserRatingRepository, + private readonly externalRatingRepo: ExternalGameRatingRepository, + private readonly ratingEventRepo: RatingEventRepository ) {} async execute(query: GetUserRatingsSummaryQuery): Promise { diff --git a/core/identity/application/use-cases/AdminVoteSessionUseCases.test.ts b/core/identity/application/use-cases/AdminVoteSessionUseCases.test.ts index 128b7c701..283e8df70 100644 --- a/core/identity/application/use-cases/AdminVoteSessionUseCases.test.ts +++ b/core/identity/application/use-cases/AdminVoteSessionUseCases.test.ts @@ -71,7 +71,7 @@ class MockRatingEventRepository { return Array.from(this.events.values()).filter(e => e.userId === userId); } - async findEventsPaginated(userId: string, options?: import('@core/identity/domain/repositories/IRatingEventRepository').PaginatedQueryOptions): Promise> { + async findEventsPaginated(userId: string, options?: import('@core/identity/domain/repositories/RatingEventRepository').PaginatedQueryOptions): Promise> { const allEvents = await this.findByUserId(userId); // Apply filters @@ -105,7 +105,7 @@ class MockRatingEventRepository { const hasMore = offset + limit < total; const nextOffset = hasMore ? offset + limit : undefined; - const result: import('@core/identity/domain/repositories/IRatingEventRepository').PaginatedResult = { + const result: import('@core/identity/domain/repositories/RatingEventRepository').PaginatedResult = { items, total, limit, diff --git a/core/identity/application/use-cases/AppendRatingEventsUseCase.test.ts b/core/identity/application/use-cases/AppendRatingEventsUseCase.test.ts index d77531a4a..65305f606 100644 --- a/core/identity/application/use-cases/AppendRatingEventsUseCase.test.ts +++ b/core/identity/application/use-cases/AppendRatingEventsUseCase.test.ts @@ -8,8 +8,8 @@ import { UserRating } from '../../domain/value-objects/UserRating'; import { RatingEventId } from '../../domain/value-objects/RatingEventId'; describe('AppendRatingEventsUseCase', () => { - let mockEventRepo: Partial; - let mockRatingRepo: Partial; + let mockEventRepo: Partial; + let mockRatingRepo: Partial; beforeEach(() => { mockEventRepo = { @@ -24,16 +24,16 @@ describe('AppendRatingEventsUseCase', () => { it('should be constructed with repositories', () => { const useCase = new AppendRatingEventsUseCase( - mockEventRepo as IRatingEventRepository, - mockRatingRepo as IUserRatingRepository, + mockEventRepo as RatingEventRepository, + mockRatingRepo as UserRatingRepository, ); expect(useCase).toBeInstanceOf(AppendRatingEventsUseCase); }); it('should handle empty input (no events)', async () => { const useCase = new AppendRatingEventsUseCase( - mockEventRepo as IRatingEventRepository, - mockRatingRepo as IUserRatingRepository, + mockEventRepo as RatingEventRepository, + mockRatingRepo as UserRatingRepository, ); const input: AppendRatingEventsInput = { @@ -50,8 +50,8 @@ describe('AppendRatingEventsUseCase', () => { it('should create and save events from direct input', async () => { const useCase = new AppendRatingEventsUseCase( - mockEventRepo as IRatingEventRepository, - mockRatingRepo as IUserRatingRepository, + mockEventRepo as RatingEventRepository, + mockRatingRepo as UserRatingRepository, ); const input: AppendRatingEventsInput = { @@ -79,8 +79,8 @@ describe('AppendRatingEventsUseCase', () => { it('should create events from race results using factory', async () => { const useCase = new AppendRatingEventsUseCase( - mockEventRepo as IRatingEventRepository, - mockRatingRepo as IUserRatingRepository, + mockEventRepo as RatingEventRepository, + mockRatingRepo as UserRatingRepository, ); const input: AppendRatingEventsInput = { @@ -108,8 +108,8 @@ describe('AppendRatingEventsUseCase', () => { it('should handle multiple race results', async () => { const useCase = new AppendRatingEventsUseCase( - mockEventRepo as IRatingEventRepository, - mockRatingRepo as IUserRatingRepository, + mockEventRepo as RatingEventRepository, + mockRatingRepo as UserRatingRepository, ); const input: AppendRatingEventsInput = { @@ -129,8 +129,8 @@ describe('AppendRatingEventsUseCase', () => { it('should handle DNF status', async () => { const useCase = new AppendRatingEventsUseCase( - mockEventRepo as IRatingEventRepository, - mockRatingRepo as IUserRatingRepository, + mockEventRepo as RatingEventRepository, + mockRatingRepo as UserRatingRepository, ); const input: AppendRatingEventsInput = { @@ -159,8 +159,8 @@ describe('AppendRatingEventsUseCase', () => { }; const useCase = new AppendRatingEventsUseCase( - mockEventRepo as IRatingEventRepository, - mockRatingRepo as IUserRatingRepository, + mockEventRepo as RatingEventRepository, + mockRatingRepo as UserRatingRepository, ); const input: AppendRatingEventsInput = { diff --git a/core/identity/application/use-cases/AppendRatingEventsUseCase.ts b/core/identity/application/use-cases/AppendRatingEventsUseCase.ts index 345d47a02..26f3e047c 100644 --- a/core/identity/application/use-cases/AppendRatingEventsUseCase.ts +++ b/core/identity/application/use-cases/AppendRatingEventsUseCase.ts @@ -42,8 +42,8 @@ export interface AppendRatingEventsOutput { */ export class AppendRatingEventsUseCase { constructor( - private readonly ratingEventRepository: IRatingEventRepository, - private readonly userRatingRepository: IUserRatingRepository, + private readonly ratingEventRepository: RatingEventRepository, + private readonly userRatingRepository: UserRatingRepository, ) {} async execute(input: AppendRatingEventsInput): Promise { diff --git a/core/identity/application/use-cases/CastAdminVoteUseCase.ts b/core/identity/application/use-cases/CastAdminVoteUseCase.ts index bdba5189b..2db696592 100644 --- a/core/identity/application/use-cases/CastAdminVoteUseCase.ts +++ b/core/identity/application/use-cases/CastAdminVoteUseCase.ts @@ -11,7 +11,7 @@ import { CastAdminVoteInput, CastAdminVoteOutput } from '../dtos/AdminVoteSessio */ export class CastAdminVoteUseCase { constructor( - private readonly adminVoteSessionRepository: IAdminVoteSessionRepository, + private readonly adminVoteSessionRepository: AdminVoteSessionRepository, ) {} async execute(input: CastAdminVoteInput): Promise { diff --git a/core/identity/application/use-cases/CloseAdminVoteSessionUseCase.ts b/core/identity/application/use-cases/CloseAdminVoteSessionUseCase.ts index 82ab64b02..398a12365 100644 --- a/core/identity/application/use-cases/CloseAdminVoteSessionUseCase.ts +++ b/core/identity/application/use-cases/CloseAdminVoteSessionUseCase.ts @@ -23,9 +23,9 @@ import { CloseAdminVoteSessionInput, CloseAdminVoteSessionOutput } from '../dtos */ export class CloseAdminVoteSessionUseCase { constructor( - private readonly adminVoteSessionRepository: IAdminVoteSessionRepository, - private readonly ratingEventRepository: IRatingEventRepository, - private readonly userRatingRepository: IUserRatingRepository, + private readonly adminVoteSessionRepository: AdminVoteSessionRepository, + private readonly ratingEventRepository: RatingEventRepository, + private readonly userRatingRepository: UserRatingRepository, private readonly appendRatingEventsUseCase: any, // Will be typed properly in integration ) {} diff --git a/core/identity/application/use-cases/ForgotPasswordUseCase.test.ts b/core/identity/application/use-cases/ForgotPasswordUseCase.test.ts index 8ee905c15..c67152033 100644 --- a/core/identity/application/use-cases/ForgotPasswordUseCase.test.ts +++ b/core/identity/application/use-cases/ForgotPasswordUseCase.test.ts @@ -42,9 +42,9 @@ describe('ForgotPasswordUseCase', () => { } as unknown as Logger; useCase = new ForgotPasswordUseCase( - authRepo as unknown as IAuthRepository, - magicLinkRepo as unknown as IMagicLinkRepository, - notificationPort as unknown as IMagicLinkNotificationPort, + authRepo as unknown as AuthRepository, + magicLinkRepo as unknown as MagicLinkRepository, + notificationPort as unknown as MagicLinkNotificationPort, logger, ); }); diff --git a/core/identity/application/use-cases/ForgotPasswordUseCase.ts b/core/identity/application/use-cases/ForgotPasswordUseCase.ts index 7c9459a91..d962f91df 100644 --- a/core/identity/application/use-cases/ForgotPasswordUseCase.ts +++ b/core/identity/application/use-cases/ForgotPasswordUseCase.ts @@ -4,7 +4,8 @@ import { MagicLinkRepository } from '../../domain/repositories/MagicLinkReposito import { MagicLinkNotificationPort } from '../../domain/ports/MagicLinkNotificationPort'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; import { randomBytes } from 'crypto'; export type ForgotPasswordInput = { @@ -29,9 +30,9 @@ export type ForgotPasswordApplicationError = ApplicationErrorCode { constructor( - private readonly authRepo: IAuthRepository, - private readonly magicLinkRepo: IMagicLinkRepository, - private readonly notificationPort: IMagicLinkNotificationPort, + private readonly authRepo: AuthRepository, + private readonly magicLinkRepo: MagicLinkRepository, + private readonly notificationPort: MagicLinkNotificationPort, private readonly logger: Logger, ) {} diff --git a/core/identity/application/use-cases/GetCurrentSessionUseCase.test.ts b/core/identity/application/use-cases/GetCurrentSessionUseCase.test.ts index db40fcccf..1ad7ff1fc 100644 --- a/core/identity/application/use-cases/GetCurrentSessionUseCase.test.ts +++ b/core/identity/application/use-cases/GetCurrentSessionUseCase.test.ts @@ -30,7 +30,7 @@ describe('GetCurrentSessionUseCase', () => { error: vi.fn(), } as unknown as Logger; useCase = new GetCurrentSessionUseCase( - mockUserRepo as IUserRepository, + mockUserRepo as UserRepository, logger, ); }); diff --git a/core/identity/application/use-cases/GetCurrentSessionUseCase.ts b/core/identity/application/use-cases/GetCurrentSessionUseCase.ts index f5a945146..afa32ae38 100644 --- a/core/identity/application/use-cases/GetCurrentSessionUseCase.ts +++ b/core/identity/application/use-cases/GetCurrentSessionUseCase.ts @@ -25,7 +25,7 @@ export type GetCurrentSessionApplicationError = ApplicationErrorCode< */ export class GetCurrentSessionUseCase { constructor( - private readonly userRepo: IUserRepository, + private readonly userRepo: UserRepository, private readonly logger: Logger, ) {} diff --git a/core/identity/application/use-cases/GetUserUseCase.test.ts b/core/identity/application/use-cases/GetUserUseCase.test.ts index 76ad7e118..9252f8fcd 100644 --- a/core/identity/application/use-cases/GetUserUseCase.test.ts +++ b/core/identity/application/use-cases/GetUserUseCase.test.ts @@ -22,7 +22,7 @@ describe('GetUserUseCase', () => { } as unknown as Logger; useCase = new GetUserUseCase( - userRepo as unknown as IUserRepository, + userRepo as unknown as UserRepository, logger, ); }); diff --git a/core/identity/application/use-cases/GetUserUseCase.ts b/core/identity/application/use-cases/GetUserUseCase.ts index 303c4c398..a1adc48b0 100644 --- a/core/identity/application/use-cases/GetUserUseCase.ts +++ b/core/identity/application/use-cases/GetUserUseCase.ts @@ -2,7 +2,8 @@ import { User } from '../../domain/entities/User'; import { UserRepository } from '../../domain/repositories/UserRepository'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; export type GetUserInput = { userId: string; @@ -21,7 +22,7 @@ export type GetUserApplicationError = ApplicationErrorCode< export class GetUserUseCase implements UseCase { constructor( - private readonly userRepo: IUserRepository, + private readonly userRepo: UserRepository, private readonly logger: Logger, ) {} diff --git a/core/identity/application/use-cases/LoginUseCase.test.ts b/core/identity/application/use-cases/LoginUseCase.test.ts index 968c9af03..b05e096ae 100644 --- a/core/identity/application/use-cases/LoginUseCase.test.ts +++ b/core/identity/application/use-cases/LoginUseCase.test.ts @@ -32,8 +32,8 @@ describe('LoginUseCase', () => { } as unknown as Logger; useCase = new LoginUseCase( - authRepo as unknown as IAuthRepository, - passwordService as unknown as IPasswordHashingService, + authRepo as unknown as AuthRepository, + passwordService as unknown as PasswordHashingService, logger, ); }); diff --git a/core/identity/application/use-cases/LoginUseCase.ts b/core/identity/application/use-cases/LoginUseCase.ts index b22e3a75a..d0cff8be0 100644 --- a/core/identity/application/use-cases/LoginUseCase.ts +++ b/core/identity/application/use-cases/LoginUseCase.ts @@ -4,7 +4,8 @@ import { AuthRepository } from '../../domain/repositories/AuthRepository'; import { PasswordHashingService } from '../../domain/services/PasswordHashingService'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; export type LoginInput = { email: string; @@ -26,8 +27,8 @@ export type LoginApplicationError = ApplicationErrorCode { constructor( - private readonly authRepo: IAuthRepository, - private readonly passwordService: IPasswordHashingService, + private readonly authRepo: AuthRepository, + private readonly passwordService: PasswordHashingService, private readonly logger: Logger, ) {} diff --git a/core/identity/application/use-cases/LoginWithEmailUseCase.test.ts b/core/identity/application/use-cases/LoginWithEmailUseCase.test.ts index edf6d6a9f..640d508e5 100644 --- a/core/identity/application/use-cases/LoginWithEmailUseCase.test.ts +++ b/core/identity/application/use-cases/LoginWithEmailUseCase.test.ts @@ -40,7 +40,7 @@ describe('LoginWithEmailUseCase', () => { } as unknown as Logger; useCase = new LoginWithEmailUseCase( - userRepository as unknown as IUserRepository, + userRepository as unknown as UserRepository, sessionPort as unknown as IdentitySessionPort, logger, ); diff --git a/core/identity/application/use-cases/LoginWithEmailUseCase.ts b/core/identity/application/use-cases/LoginWithEmailUseCase.ts index 6cda9cdb5..7b86d835e 100644 --- a/core/identity/application/use-cases/LoginWithEmailUseCase.ts +++ b/core/identity/application/use-cases/LoginWithEmailUseCase.ts @@ -37,7 +37,7 @@ export type LoginWithEmailApplicationError = ApplicationErrorCode< export class LoginWithEmailUseCase { constructor( - private readonly userRepository: IUserRepository, + private readonly userRepository: UserRepository, private readonly sessionPort: IdentitySessionPort, private readonly logger: Logger, ) {} diff --git a/core/identity/application/use-cases/LogoutUseCase.ts b/core/identity/application/use-cases/LogoutUseCase.ts index 99529f799..cbd43d042 100644 --- a/core/identity/application/use-cases/LogoutUseCase.ts +++ b/core/identity/application/use-cases/LogoutUseCase.ts @@ -1,7 +1,8 @@ import type { IdentitySessionPort } from '../ports/IdentitySessionPort'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; export type LogoutInput = {}; diff --git a/core/identity/application/use-cases/OpenAdminVoteSessionUseCase.ts b/core/identity/application/use-cases/OpenAdminVoteSessionUseCase.ts index 51912f810..748d2596b 100644 --- a/core/identity/application/use-cases/OpenAdminVoteSessionUseCase.ts +++ b/core/identity/application/use-cases/OpenAdminVoteSessionUseCase.ts @@ -12,7 +12,7 @@ import { OpenAdminVoteSessionInput, OpenAdminVoteSessionOutput } from '../dtos/A */ export class OpenAdminVoteSessionUseCase { constructor( - private readonly adminVoteSessionRepository: IAdminVoteSessionRepository, + private readonly adminVoteSessionRepository: AdminVoteSessionRepository, ) {} async execute(input: OpenAdminVoteSessionInput): Promise { diff --git a/core/identity/application/use-cases/RecomputeUserRatingSnapshotUseCase.test.ts b/core/identity/application/use-cases/RecomputeUserRatingSnapshotUseCase.test.ts index c5e86c0fd..c469cfbf8 100644 --- a/core/identity/application/use-cases/RecomputeUserRatingSnapshotUseCase.test.ts +++ b/core/identity/application/use-cases/RecomputeUserRatingSnapshotUseCase.test.ts @@ -10,8 +10,8 @@ import { RatingDimensionKey } from '../../domain/value-objects/RatingDimensionKe import { RatingDelta } from '../../domain/value-objects/RatingDelta'; describe('RecomputeUserRatingSnapshotUseCase', () => { - let mockEventRepo: Partial; - let mockRatingRepo: Partial; + let mockEventRepo: Partial; + let mockRatingRepo: Partial; beforeEach(() => { mockEventRepo = { @@ -25,16 +25,16 @@ describe('RecomputeUserRatingSnapshotUseCase', () => { it('should be constructed with repositories', () => { const useCase = new RecomputeUserRatingSnapshotUseCase( - mockEventRepo as IRatingEventRepository, - mockRatingRepo as IUserRatingRepository, + mockEventRepo as RatingEventRepository, + mockRatingRepo as UserRatingRepository, ); expect(useCase).toBeInstanceOf(RecomputeUserRatingSnapshotUseCase); }); it('should compute snapshot from empty event list', async () => { const useCase = new RecomputeUserRatingSnapshotUseCase( - mockEventRepo as IRatingEventRepository, - mockRatingRepo as IUserRatingRepository, + mockEventRepo as RatingEventRepository, + mockRatingRepo as UserRatingRepository, ); const result = await useCase.execute({ userId: 'user-1' }); @@ -64,8 +64,8 @@ describe('RecomputeUserRatingSnapshotUseCase', () => { mockEventRepo.getAllByUserId = vi.fn().mockResolvedValue(events); const useCase = new RecomputeUserRatingSnapshotUseCase( - mockEventRepo as IRatingEventRepository, - mockRatingRepo as IUserRatingRepository, + mockEventRepo as RatingEventRepository, + mockRatingRepo as UserRatingRepository, ); const result = await useCase.execute({ userId: 'user-1' }); @@ -78,8 +78,8 @@ describe('RecomputeUserRatingSnapshotUseCase', () => { it('should return proper DTO format', async () => { const useCase = new RecomputeUserRatingSnapshotUseCase( - mockEventRepo as IRatingEventRepository, - mockRatingRepo as IUserRatingRepository, + mockEventRepo as RatingEventRepository, + mockRatingRepo as UserRatingRepository, ); const result = await useCase.execute({ userId: 'user-1' }); @@ -117,8 +117,8 @@ describe('RecomputeUserRatingSnapshotUseCase', () => { mockRatingRepo.save = vi.fn().mockResolvedValue(updated); const useCase = new RecomputeUserRatingSnapshotUseCase( - mockEventRepo as IRatingEventRepository, - mockRatingRepo as IUserRatingRepository, + mockEventRepo as RatingEventRepository, + mockRatingRepo as UserRatingRepository, ); const result = await useCase.execute({ userId: 'user-1' }); diff --git a/core/identity/application/use-cases/RecomputeUserRatingSnapshotUseCase.ts b/core/identity/application/use-cases/RecomputeUserRatingSnapshotUseCase.ts index 20636462e..99a6b2ab0 100644 --- a/core/identity/application/use-cases/RecomputeUserRatingSnapshotUseCase.ts +++ b/core/identity/application/use-cases/RecomputeUserRatingSnapshotUseCase.ts @@ -28,8 +28,8 @@ export interface RecomputeUserRatingSnapshotOutput { */ export class RecomputeUserRatingSnapshotUseCase { constructor( - private readonly ratingEventRepository: IRatingEventRepository, - private readonly userRatingRepository: IUserRatingRepository, + private readonly ratingEventRepository: RatingEventRepository, + private readonly userRatingRepository: UserRatingRepository, ) {} async execute(input: RecomputeUserRatingSnapshotInput): Promise { diff --git a/core/identity/application/use-cases/RecordRaceRatingEventsUseCase.ts b/core/identity/application/use-cases/RecordRaceRatingEventsUseCase.ts index 58f4b5acb..0af95d08d 100644 --- a/core/identity/application/use-cases/RecordRaceRatingEventsUseCase.ts +++ b/core/identity/application/use-cases/RecordRaceRatingEventsUseCase.ts @@ -24,9 +24,9 @@ import { RecordRaceRatingEventsInput, RecordRaceRatingEventsOutput } from '../dt */ export class RecordRaceRatingEventsUseCase { constructor( - private readonly raceResultsProvider: IRaceResultsProvider, - private readonly ratingEventRepository: IRatingEventRepository, - private readonly userRatingRepository: IUserRatingRepository, + private readonly raceResultsProvider: RaceResultsProvider, + private readonly ratingEventRepository: RatingEventRepository, + private readonly userRatingRepository: UserRatingRepository, private readonly appendRatingEventsUseCase: AppendRatingEventsUseCase, ) {} diff --git a/core/identity/application/use-cases/ResetPasswordUseCase.test.ts b/core/identity/application/use-cases/ResetPasswordUseCase.test.ts index 7fba61463..d8fd42e6d 100644 --- a/core/identity/application/use-cases/ResetPasswordUseCase.test.ts +++ b/core/identity/application/use-cases/ResetPasswordUseCase.test.ts @@ -43,9 +43,9 @@ describe('ResetPasswordUseCase', () => { } as unknown as Logger; useCase = new ResetPasswordUseCase( - authRepo as unknown as IAuthRepository, - magicLinkRepo as unknown as IMagicLinkRepository, - passwordService as unknown as IPasswordHashingService, + authRepo as unknown as AuthRepository, + magicLinkRepo as unknown as MagicLinkRepository, + passwordService as unknown as PasswordHashingService, logger, ); }); diff --git a/core/identity/application/use-cases/ResetPasswordUseCase.ts b/core/identity/application/use-cases/ResetPasswordUseCase.ts index 3038cbb5f..57931d1b3 100644 --- a/core/identity/application/use-cases/ResetPasswordUseCase.ts +++ b/core/identity/application/use-cases/ResetPasswordUseCase.ts @@ -5,7 +5,8 @@ import { EmailAddress } from '../../domain/value-objects/EmailAddress'; import { PasswordHash } from '../../domain/value-objects/PasswordHash'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; export type ResetPasswordInput = { token: string; @@ -28,9 +29,9 @@ export type ResetPasswordApplicationError = ApplicationErrorCode { constructor( - private readonly authRepo: IAuthRepository, - private readonly magicLinkRepo: IMagicLinkRepository, - private readonly passwordService: IPasswordHashingService, + private readonly authRepo: AuthRepository, + private readonly magicLinkRepo: MagicLinkRepository, + private readonly passwordService: PasswordHashingService, private readonly logger: Logger, ) {} diff --git a/core/identity/application/use-cases/SignupSponsorUseCase.test.ts b/core/identity/application/use-cases/SignupSponsorUseCase.test.ts index cacd6e702..800e4b0d6 100644 --- a/core/identity/application/use-cases/SignupSponsorUseCase.test.ts +++ b/core/identity/application/use-cases/SignupSponsorUseCase.test.ts @@ -42,9 +42,9 @@ describe('SignupSponsorUseCase', () => { } as unknown as Logger; useCase = new SignupSponsorUseCase( - authRepo as unknown as IAuthRepository, - companyRepo as unknown as ICompanyRepository, - passwordService as unknown as IPasswordHashingService, + authRepo as unknown as AuthRepository, + companyRepo as unknown as CompanyRepository, + passwordService as unknown as PasswordHashingService, logger, ); }); diff --git a/core/identity/application/use-cases/SignupSponsorUseCase.ts b/core/identity/application/use-cases/SignupSponsorUseCase.ts index 14bd2d0d0..35a531ab9 100644 --- a/core/identity/application/use-cases/SignupSponsorUseCase.ts +++ b/core/identity/application/use-cases/SignupSponsorUseCase.ts @@ -7,7 +7,8 @@ import { CompanyRepository } from '../../domain/repositories/CompanyRepository'; import { PasswordHashingService } from '../../domain/services/PasswordHashingService'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; export type SignupSponsorInput = { email: string; @@ -33,9 +34,9 @@ export type SignupSponsorApplicationError = ApplicationErrorCode { constructor( - private readonly authRepo: IAuthRepository, - private readonly companyRepo: ICompanyRepository, - private readonly passwordService: IPasswordHashingService, + private readonly authRepo: AuthRepository, + private readonly companyRepo: CompanyRepository, + private readonly passwordService: PasswordHashingService, private readonly logger: Logger, ) {} diff --git a/core/identity/application/use-cases/SignupUseCase.test.ts b/core/identity/application/use-cases/SignupUseCase.test.ts index 5641c337a..7241b19bd 100644 --- a/core/identity/application/use-cases/SignupUseCase.test.ts +++ b/core/identity/application/use-cases/SignupUseCase.test.ts @@ -34,8 +34,8 @@ describe('SignupUseCase', () => { } as unknown as Logger; useCase = new SignupUseCase( - authRepo as unknown as IAuthRepository, - passwordService as unknown as IPasswordHashingService, + authRepo as unknown as AuthRepository, + passwordService as unknown as PasswordHashingService, logger, ); }); diff --git a/core/identity/application/use-cases/SignupUseCase.ts b/core/identity/application/use-cases/SignupUseCase.ts index 49b3efd7f..394abca49 100644 --- a/core/identity/application/use-cases/SignupUseCase.ts +++ b/core/identity/application/use-cases/SignupUseCase.ts @@ -6,7 +6,8 @@ import { PasswordHashingService } from '../../domain/services/PasswordHashingSer import { PasswordHash } from '../../domain/value-objects/PasswordHash'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; export type SignupInput = { email: string; @@ -29,8 +30,8 @@ export type SignupApplicationError = ApplicationErrorCode { constructor( - private readonly authRepo: IAuthRepository, - private readonly passwordService: IPasswordHashingService, + private readonly authRepo: AuthRepository, + private readonly passwordService: PasswordHashingService, private readonly logger: Logger, ) {} diff --git a/core/identity/application/use-cases/SignupWithEmailUseCase.test.ts b/core/identity/application/use-cases/SignupWithEmailUseCase.test.ts index fa145024a..8dd121115 100644 --- a/core/identity/application/use-cases/SignupWithEmailUseCase.test.ts +++ b/core/identity/application/use-cases/SignupWithEmailUseCase.test.ts @@ -32,7 +32,7 @@ describe('SignupWithEmailUseCase', () => { } as unknown as Logger; useCase = new SignupWithEmailUseCase( - userRepository as unknown as IUserRepository, + userRepository as unknown as UserRepository, sessionPort as unknown as IdentitySessionPort, logger, ); diff --git a/core/identity/application/use-cases/SignupWithEmailUseCase.ts b/core/identity/application/use-cases/SignupWithEmailUseCase.ts index e0543c6db..f8546f9bd 100644 --- a/core/identity/application/use-cases/SignupWithEmailUseCase.ts +++ b/core/identity/application/use-cases/SignupWithEmailUseCase.ts @@ -33,7 +33,7 @@ export type SignupWithEmailApplicationError = ApplicationErrorCode< export class SignupWithEmailUseCase { constructor( - private readonly userRepository: IUserRepository, + private readonly userRepository: UserRepository, private readonly sessionPort: IdentitySessionPort, private readonly logger: Logger, ) {} diff --git a/core/identity/application/use-cases/UpsertExternalGameRatingUseCase.test.ts b/core/identity/application/use-cases/UpsertExternalGameRatingUseCase.test.ts index 1ff312024..1a05c7f45 100644 --- a/core/identity/application/use-cases/UpsertExternalGameRatingUseCase.test.ts +++ b/core/identity/application/use-cases/UpsertExternalGameRatingUseCase.test.ts @@ -10,7 +10,7 @@ import { vi, describe, it, expect, beforeEach } from 'vitest'; describe('UpsertExternalGameRatingUseCase', () => { let useCase: UpsertExternalGameRatingUseCase; - let mockRepository: IExternalGameRatingRepository; + let mockRepository: ExternalGameRatingRepository; beforeEach(() => { mockRepository = { diff --git a/core/identity/application/use-cases/UpsertExternalGameRatingUseCase.ts b/core/identity/application/use-cases/UpsertExternalGameRatingUseCase.ts index 99ec8f56a..9bdc5568e 100644 --- a/core/identity/application/use-cases/UpsertExternalGameRatingUseCase.ts +++ b/core/identity/application/use-cases/UpsertExternalGameRatingUseCase.ts @@ -23,7 +23,7 @@ import { UpsertExternalGameRatingInput, UpsertExternalGameRatingOutput } from '. */ export class UpsertExternalGameRatingUseCase { constructor( - private readonly externalGameRatingRepository: IExternalGameRatingRepository + private readonly externalGameRatingRepository: ExternalGameRatingRepository ) {} async execute(input: UpsertExternalGameRatingInput): Promise { diff --git a/core/identity/application/use-cases/achievement/CreateAchievementUseCase.test.ts b/core/identity/application/use-cases/achievement/CreateAchievementUseCase.test.ts index dbb6725ae..e40ebad28 100644 --- a/core/identity/application/use-cases/achievement/CreateAchievementUseCase.test.ts +++ b/core/identity/application/use-cases/achievement/CreateAchievementUseCase.test.ts @@ -1,6 +1,6 @@ import type { Logger } from '@core/shared/domain/Logger'; import { describe, expect, it, vi, type Mock } from 'vitest'; -import { CreateAchievementUseCase, type IAchievementRepository } from './CreateAchievementUseCase'; +import { CreateAchievementUseCase, type AchievementRepository } from './CreateAchievementUseCase'; describe('CreateAchievementUseCase', () => { let achievementRepository: { @@ -24,7 +24,7 @@ describe('CreateAchievementUseCase', () => { } as unknown as Logger; useCase = new CreateAchievementUseCase( - achievementRepository as unknown as IAchievementRepository, + achievementRepository as unknown as AchievementRepository, logger, ); }); diff --git a/core/identity/application/use-cases/achievement/CreateAchievementUseCase.ts b/core/identity/application/use-cases/achievement/CreateAchievementUseCase.ts index bc42a75a9..28c2270fe 100644 --- a/core/identity/application/use-cases/achievement/CreateAchievementUseCase.ts +++ b/core/identity/application/use-cases/achievement/CreateAchievementUseCase.ts @@ -23,7 +23,7 @@ export type CreateAchievementApplicationError = ApplicationErrorCode< export class CreateAchievementUseCase { constructor( - private readonly achievementRepository: IAchievementRepository, + private readonly achievementRepository: AchievementRepository, private readonly logger: Logger, ) {} diff --git a/core/identity/domain/entities/Achievement.ts b/core/identity/domain/entities/Achievement.ts index 6cff622e3..5c4fc83a2 100644 --- a/core/identity/domain/entities/Achievement.ts +++ b/core/identity/domain/entities/Achievement.ts @@ -5,7 +5,7 @@ * Achievements are categorized by role (driver, steward, admin) and type. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; export type AchievementCategory = 'driver' | 'steward' | 'admin' | 'community'; @@ -32,8 +32,7 @@ export interface AchievementRequirement { operator: '>=' | '>' | '=' | '<' | '<='; } -export class Achievement implements Entity { - readonly id: string; +export class Achievement extends Entity { readonly name: string; readonly description: string; readonly category: AchievementCategory; @@ -45,7 +44,8 @@ export class Achievement implements Entity { readonly createdAt: Date; private constructor(props: AchievementProps) { - this.id = props.id; + super(props.id); + this.name = props.name; this.description = props.description; this.category = props.category; diff --git a/core/identity/domain/entities/AdminVoteSession.ts b/core/identity/domain/entities/AdminVoteSession.ts index cb69ff207..a68fc7409 100644 --- a/core/identity/domain/entities/AdminVoteSession.ts +++ b/core/identity/domain/entities/AdminVoteSession.ts @@ -1,4 +1,4 @@ -import type { Entity, IEntity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { IdentityDomainInvariantError, IdentityDomainValidationError } from '../errors/IdentityDomainError'; export interface AdminVote { @@ -42,8 +42,7 @@ export interface AdminVoteSessionProps { * * Based on ratings-architecture-concept.md sections 5.2.1 and 7.1.1 */ -export class AdminVoteSession implements Entity { - readonly id: string; +export class AdminVoteSession extends Entity { readonly leagueId: string; readonly adminId: string; readonly startDate: Date; @@ -56,7 +55,7 @@ export class AdminVoteSession implements Entity { private _updatedAt: Date; private constructor(props: AdminVoteSessionProps) { - this.id = props.voteSessionId; + super(props.voteSessionId); this.leagueId = props.leagueId; this.adminId = props.adminId; this.startDate = props.startDate; @@ -269,7 +268,7 @@ export class AdminVoteSession implements Entity { return now >= this.startDate && now <= this.endDate && !this._closed; } - equals(other: IEntity): boolean { + equals(other: Entity): boolean { return this.id === other.id; } diff --git a/core/identity/domain/entities/RatingEvent.ts b/core/identity/domain/entities/RatingEvent.ts index dfd21bf6f..bbd2f576d 100644 --- a/core/identity/domain/entities/RatingEvent.ts +++ b/core/identity/domain/entities/RatingEvent.ts @@ -1,4 +1,4 @@ -import type { Entity, IEntity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { IdentityDomainInvariantError, IdentityDomainValidationError } from '../errors/IdentityDomainError'; import { RatingDelta } from '../value-objects/RatingDelta'; import { RatingDimensionKey } from '../value-objects/RatingDimensionKey'; @@ -34,8 +34,7 @@ export interface RatingEventProps { version: number; } -export class RatingEvent implements Entity { - readonly id: RatingEventId; +export class RatingEvent extends Entity { readonly userId: string; readonly dimension: RatingDimensionKey; readonly delta: RatingDelta; @@ -48,7 +47,8 @@ export class RatingEvent implements Entity { readonly version: number; private constructor(props: RatingEventProps) { - this.id = props.id; + super(props.id); + this.userId = props.userId; this.dimension = props.dimension; this.delta = props.delta; @@ -118,7 +118,7 @@ export class RatingEvent implements Entity { return new RatingEvent(props); } - equals(other: IEntity): boolean { + equals(other: Entity): boolean { return this.id.equals(other.id); } diff --git a/core/identity/domain/entities/UserAchievement.ts b/core/identity/domain/entities/UserAchievement.ts index 7ed3e830d..ecc72c67a 100644 --- a/core/identity/domain/entities/UserAchievement.ts +++ b/core/identity/domain/entities/UserAchievement.ts @@ -4,7 +4,7 @@ * Represents an achievement earned by a specific user. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; export interface UserAchievementProps { id: string; @@ -15,8 +15,7 @@ export interface UserAchievementProps { progress?: number; // For partial progress tracking (0-100) } -export class UserAchievement implements Entity { - readonly id: string; +export class UserAchievement extends Entity { readonly userId: string; readonly achievementId: string; readonly earnedAt: Date; @@ -24,7 +23,8 @@ export class UserAchievement implements Entity { readonly progress: number; private constructor(props: UserAchievementProps) { - this.id = props.id; + super(props.id); + this.userId = props.userId; this.achievementId = props.achievementId; this.earnedAt = props.earnedAt; diff --git a/core/identity/domain/errors/IdentityDomainError.ts b/core/identity/domain/errors/IdentityDomainError.ts index 026d18274..a1ef8954c 100644 --- a/core/identity/domain/errors/IdentityDomainError.ts +++ b/core/identity/domain/errors/IdentityDomainError.ts @@ -1,4 +1,5 @@ -import type { DomainError, CommonDomainErrorKind } from '@core/shared/errors'; +import type { DomainError } from '@core/shared/errors/DomainError'; +import type { CommonDomainErrorKind } from '@core/shared/errors/DomainError'; export abstract class IdentityDomainError extends Error implements DomainError { readonly type = 'domain' as const; diff --git a/core/identity/domain/repositories/AchievementRepository.ts b/core/identity/domain/repositories/AchievementRepository.ts index 452b1c609..d6dc2cfee 100644 --- a/core/identity/domain/repositories/AchievementRepository.ts +++ b/core/identity/domain/repositories/AchievementRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IAchievementRepository + * Repository Interface: AchievementRepository * * Defines operations for Achievement and UserAchievement entities */ diff --git a/core/identity/domain/repositories/AdminVoteSessionRepository.ts b/core/identity/domain/repositories/AdminVoteSessionRepository.ts index d432a25d7..1a650f8ee 100644 --- a/core/identity/domain/repositories/AdminVoteSessionRepository.ts +++ b/core/identity/domain/repositories/AdminVoteSessionRepository.ts @@ -1,7 +1,7 @@ import type { AdminVoteSession } from '../entities/AdminVoteSession'; /** - * Repository Interface: IAdminVoteSessionRepository + * Repository Interface: AdminVoteSessionRepository * * Port for persisting and retrieving admin vote sessions. * Sessions are scoped to leagues and control voting windows. diff --git a/core/identity/domain/repositories/AuthRepository.ts b/core/identity/domain/repositories/AuthRepository.ts index 11bacb958..5fe413484 100644 --- a/core/identity/domain/repositories/AuthRepository.ts +++ b/core/identity/domain/repositories/AuthRepository.ts @@ -2,7 +2,7 @@ import { EmailAddress } from '../value-objects/EmailAddress'; import { User } from '../entities/User'; /** - * Domain Repository: IAuthRepository + * Domain Repository: AuthRepository * * Repository interface for authentication operations. */ diff --git a/core/identity/domain/repositories/CompanyRepository.ts b/core/identity/domain/repositories/CompanyRepository.ts index 85d7e9ed1..25e99fee3 100644 --- a/core/identity/domain/repositories/CompanyRepository.ts +++ b/core/identity/domain/repositories/CompanyRepository.ts @@ -1,7 +1,7 @@ import { Company } from '../entities/Company'; /** - * Domain Repository: ICompanyRepository + * Domain Repository: CompanyRepository * * Repository interface for Company entity operations. */ diff --git a/core/identity/domain/repositories/ExternalGameRatingRepository.test.ts b/core/identity/domain/repositories/ExternalGameRatingRepository.test.ts index 811f9c7dc..78c5398e0 100644 --- a/core/identity/domain/repositories/ExternalGameRatingRepository.test.ts +++ b/core/identity/domain/repositories/ExternalGameRatingRepository.test.ts @@ -6,10 +6,10 @@ import { ExternalRating } from '../value-objects/ExternalRating'; import { ExternalRatingProvenance } from '../value-objects/ExternalRatingProvenance'; /** - * Test suite for IExternalGameRatingRepository interface + * Test suite for ExternalGameRatingRepository interface * This tests the contract that all implementations must satisfy */ -describe('IExternalGameRatingRepository', () => { +describe('ExternalGameRatingRepository', () => { // Mock implementation for testing class MockExternalGameRatingRepository implements ExternalGameRatingRepository { private profiles: Map = new Map(); @@ -105,7 +105,7 @@ describe('IExternalGameRatingRepository', () => { } } - let repository: IExternalGameRatingRepository; + let repository: ExternalGameRatingRepository; beforeEach(() => { repository = new MockExternalGameRatingRepository(); diff --git a/core/identity/domain/repositories/ExternalGameRatingRepository.ts b/core/identity/domain/repositories/ExternalGameRatingRepository.ts index ca1d9054c..609e2efa1 100644 --- a/core/identity/domain/repositories/ExternalGameRatingRepository.ts +++ b/core/identity/domain/repositories/ExternalGameRatingRepository.ts @@ -1,7 +1,7 @@ import { ExternalGameRatingProfile } from '../entities/ExternalGameRatingProfile'; /** - * Repository Interface: IExternalGameRatingRepository + * Repository Interface: ExternalGameRatingRepository * * Port for persisting and retrieving external game rating profiles. * Store/display only, no compute. diff --git a/core/identity/domain/repositories/RatingEventRepository.test.ts b/core/identity/domain/repositories/RatingEventRepository.test.ts index c24beb286..21afa89ab 100644 --- a/core/identity/domain/repositories/RatingEventRepository.test.ts +++ b/core/identity/domain/repositories/RatingEventRepository.test.ts @@ -1,5 +1,5 @@ /** - * Unit tests for IRatingEventRepository + * Unit tests for RatingEventRepository */ import { RatingEvent } from '../entities/RatingEvent'; @@ -110,7 +110,7 @@ class InMemoryRatingEventRepository implements RatingEventRepository { } } -describe('IRatingEventRepository', () => { +describe('RatingEventRepository', () => { let repository: InMemoryRatingEventRepository; beforeEach(() => { diff --git a/core/identity/domain/repositories/RatingEventRepository.ts b/core/identity/domain/repositories/RatingEventRepository.ts index 521b3040c..4f7473b21 100644 --- a/core/identity/domain/repositories/RatingEventRepository.ts +++ b/core/identity/domain/repositories/RatingEventRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IRatingEventRepository + * Repository Interface: RatingEventRepository * * Port for persisting and retrieving rating events (ledger). * Events are immutable and ordered by occurredAt for deterministic snapshot computation. diff --git a/core/identity/domain/repositories/SponsorAccountRepository.ts b/core/identity/domain/repositories/SponsorAccountRepository.ts index 6a3e42f66..e53240938 100644 --- a/core/identity/domain/repositories/SponsorAccountRepository.ts +++ b/core/identity/domain/repositories/SponsorAccountRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: ISponsorAccountRepository + * Repository Interface: SponsorAccountRepository * * Defines persistence operations for SponsorAccount entities. */ diff --git a/core/identity/domain/repositories/UserRatingRepository.test.ts b/core/identity/domain/repositories/UserRatingRepository.test.ts index d3fcbd9f3..e58fddb9f 100644 --- a/core/identity/domain/repositories/UserRatingRepository.test.ts +++ b/core/identity/domain/repositories/UserRatingRepository.test.ts @@ -1,5 +1,5 @@ /** - * Unit tests for IUserRatingRepository + * Unit tests for UserRatingRepository */ import { UserRating } from '../value-objects/UserRating'; @@ -19,7 +19,7 @@ class InMemoryUserRatingRepository implements UserRatingRepository { } } -describe('IUserRatingRepository', () => { +describe('UserRatingRepository', () => { let repository: InMemoryUserRatingRepository; beforeEach(() => { diff --git a/core/identity/domain/repositories/UserRatingRepository.ts b/core/identity/domain/repositories/UserRatingRepository.ts index 0ae09c628..4f5673f36 100644 --- a/core/identity/domain/repositories/UserRatingRepository.ts +++ b/core/identity/domain/repositories/UserRatingRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IUserRatingRepository + * Repository Interface: UserRatingRepository * * Port for persisting and retrieving UserRating snapshots. * Snapshots are derived from rating events for fast reads. diff --git a/core/identity/domain/repositories/UserRepository.ts b/core/identity/domain/repositories/UserRepository.ts index 71f1c8112..c0fba7b60 100644 --- a/core/identity/domain/repositories/UserRepository.ts +++ b/core/identity/domain/repositories/UserRepository.ts @@ -1,5 +1,5 @@ /** - * Domain Repository: IUserRepository + * Domain Repository: UserRepository * * Repository interface for User entity operations. */ diff --git a/core/identity/domain/services/RatingUpdateService.ts b/core/identity/domain/services/RatingUpdateService.ts index d0e82dd2a..3d4037db4 100644 --- a/core/identity/domain/services/RatingUpdateService.ts +++ b/core/identity/domain/services/RatingUpdateService.ts @@ -1,4 +1,4 @@ -import type { DomainService } from '@core/shared/domain'; +import type { DomainService } from '@core/shared/domain/Service'; import type { UserRatingRepository } from '../repositories/UserRatingRepository'; import type { RatingEventRepository } from '../repositories/RatingEventRepository'; import { RatingEventFactory } from './RatingEventFactory'; @@ -21,8 +21,8 @@ export class RatingUpdateService implements DomainService { readonly serviceName = 'RatingUpdateService'; constructor( - private readonly userRatingRepository: IUserRatingRepository, - private readonly ratingEventRepository: IRatingEventRepository + private readonly userRatingRepository: UserRatingRepository, + private readonly ratingEventRepository: RatingEventRepository ) {} /** diff --git a/core/identity/domain/value-objects/AdminTrustReasonCode.ts b/core/identity/domain/value-objects/AdminTrustReasonCode.ts index 858b7c5b2..3eaa31097 100644 --- a/core/identity/domain/value-objects/AdminTrustReasonCode.ts +++ b/core/identity/domain/value-objects/AdminTrustReasonCode.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { IdentityDomainValidationError } from '../errors/IdentityDomainError'; /** @@ -68,7 +68,7 @@ export class AdminTrustReasonCode implements ValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/identity/domain/value-objects/DrivingReasonCode.ts b/core/identity/domain/value-objects/DrivingReasonCode.ts index 9a4eebb22..4c7fe6d26 100644 --- a/core/identity/domain/value-objects/DrivingReasonCode.ts +++ b/core/identity/domain/value-objects/DrivingReasonCode.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { IdentityDomainValidationError } from '../errors/IdentityDomainError'; /** @@ -80,7 +80,7 @@ export class DrivingReasonCode implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/identity/domain/value-objects/EmailAddress.ts b/core/identity/domain/value-objects/EmailAddress.ts index daafb927c..700f587d0 100644 --- a/core/identity/domain/value-objects/EmailAddress.ts +++ b/core/identity/domain/value-objects/EmailAddress.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import type { EmailValidationResult } from '../types/EmailAddress'; import { validateEmail, isDisposableEmail } from '../types/EmailAddress'; @@ -35,7 +35,7 @@ export class EmailAddress implements ValueObject { return this.props.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.value === other.props.value; } diff --git a/core/identity/domain/value-objects/ExternalRating.ts b/core/identity/domain/value-objects/ExternalRating.ts index f33aa8ec0..2140a9167 100644 --- a/core/identity/domain/value-objects/ExternalRating.ts +++ b/core/identity/domain/value-objects/ExternalRating.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { IdentityDomainValidationError } from '../errors/IdentityDomainError'; import { GameKey } from './GameKey'; @@ -40,7 +40,7 @@ export class ExternalRating implements ValueObject { }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return ( this.gameKey.equals(other.props.gameKey) && this.type === other.props.type && diff --git a/core/identity/domain/value-objects/ExternalRatingProvenance.ts b/core/identity/domain/value-objects/ExternalRatingProvenance.ts index b25aef2fb..3461bc132 100644 --- a/core/identity/domain/value-objects/ExternalRatingProvenance.ts +++ b/core/identity/domain/value-objects/ExternalRatingProvenance.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { IdentityDomainValidationError } from '../errors/IdentityDomainError'; export interface ExternalRatingProvenanceProps { @@ -45,7 +45,7 @@ export class ExternalRatingProvenance implements ValueObject): boolean { + equals(other: ValueObject): boolean { return ( this.source === other.props.source && this.lastSyncedAt.getTime() === other.props.lastSyncedAt.getTime() && diff --git a/core/identity/domain/value-objects/GameKey.ts b/core/identity/domain/value-objects/GameKey.ts index 74290cb41..d3353f40e 100644 --- a/core/identity/domain/value-objects/GameKey.ts +++ b/core/identity/domain/value-objects/GameKey.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { IdentityDomainValidationError } from '../errors/IdentityDomainError'; export interface GameKeyProps { @@ -33,7 +33,7 @@ export class GameKey implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/identity/domain/value-objects/PasswordHash.ts b/core/identity/domain/value-objects/PasswordHash.ts index aa7cc8882..25d89508b 100644 --- a/core/identity/domain/value-objects/PasswordHash.ts +++ b/core/identity/domain/value-objects/PasswordHash.ts @@ -1,5 +1,5 @@ import bcrypt from 'bcrypt'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface PasswordHashProps { value: string; @@ -35,7 +35,7 @@ export class PasswordHash implements ValueObject { return bcrypt.compare(plain, this.props.value); } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.value === other.props.value; } } \ No newline at end of file diff --git a/core/identity/domain/value-objects/RatingDelta.ts b/core/identity/domain/value-objects/RatingDelta.ts index 39ce87e42..976713c12 100644 --- a/core/identity/domain/value-objects/RatingDelta.ts +++ b/core/identity/domain/value-objects/RatingDelta.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { IdentityDomainValidationError } from '../errors/IdentityDomainError'; export interface RatingDeltaProps { @@ -30,7 +30,7 @@ export class RatingDelta implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/identity/domain/value-objects/RatingDimensionKey.ts b/core/identity/domain/value-objects/RatingDimensionKey.ts index 4651088af..650a2006d 100644 --- a/core/identity/domain/value-objects/RatingDimensionKey.ts +++ b/core/identity/domain/value-objects/RatingDimensionKey.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { IdentityDomainValidationError } from '../errors/IdentityDomainError'; export interface RatingDimensionKeyProps { @@ -39,7 +39,7 @@ export class RatingDimensionKey implements ValueObject return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/identity/domain/value-objects/RatingEventId.ts b/core/identity/domain/value-objects/RatingEventId.ts index 592ea4d13..fce65c2ae 100644 --- a/core/identity/domain/value-objects/RatingEventId.ts +++ b/core/identity/domain/value-objects/RatingEventId.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { IdentityDomainValidationError } from '../errors/IdentityDomainError'; import { v4 as uuidv4 } from 'uuid'; @@ -38,7 +38,7 @@ export class RatingEventId implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/identity/domain/value-objects/RatingReference.ts b/core/identity/domain/value-objects/RatingReference.ts index b625f067d..f782b30dc 100644 --- a/core/identity/domain/value-objects/RatingReference.ts +++ b/core/identity/domain/value-objects/RatingReference.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { IdentityDomainValidationError } from '../errors/IdentityDomainError'; export type RatingReferenceType = 'race' | 'penalty' | 'vote' | 'adminAction'; @@ -38,7 +38,7 @@ export class RatingReference implements ValueObject { return { type: this.type, id: this.id }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.type === other.props.type && this.id === other.props.id; } diff --git a/core/identity/domain/value-objects/RatingValue.ts b/core/identity/domain/value-objects/RatingValue.ts index 7c184a6d2..5c1af181e 100644 --- a/core/identity/domain/value-objects/RatingValue.ts +++ b/core/identity/domain/value-objects/RatingValue.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { IdentityDomainValidationError } from '../errors/IdentityDomainError'; export interface RatingValueProps { @@ -30,7 +30,7 @@ export class RatingValue implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/identity/domain/value-objects/UserId.ts b/core/identity/domain/value-objects/UserId.ts index dee596de8..0277bc33e 100644 --- a/core/identity/domain/value-objects/UserId.ts +++ b/core/identity/domain/value-objects/UserId.ts @@ -1,5 +1,5 @@ import { v4 as uuidv4 } from 'uuid'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface UserIdProps { value: string; @@ -31,7 +31,7 @@ export class UserId implements ValueObject { return this.props.value; } - public equals(other: IValueObject): boolean { + public equals(other: ValueObject): boolean { return this.props.value === other.props.value; } } \ No newline at end of file diff --git a/core/identity/domain/value-objects/UserRating.ts b/core/identity/domain/value-objects/UserRating.ts index ffdfa847f..748c7ad9e 100644 --- a/core/identity/domain/value-objects/UserRating.ts +++ b/core/identity/domain/value-objects/UserRating.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; /** * Value Object: UserRating @@ -111,7 +111,7 @@ export class UserRating implements ValueObject { return new UserRating(props); } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.userId === other.props.userId; } diff --git a/core/media/application/use-cases/DeleteMediaUseCase.test.ts b/core/media/application/use-cases/DeleteMediaUseCase.test.ts index 6aafe7972..00d370f64 100644 --- a/core/media/application/use-cases/DeleteMediaUseCase.test.ts +++ b/core/media/application/use-cases/DeleteMediaUseCase.test.ts @@ -39,7 +39,7 @@ describe('DeleteMediaUseCase', () => { } as unknown as Logger; useCase = new DeleteMediaUseCase( - mediaRepo as unknown as IMediaRepository, + mediaRepo as unknown as MediaRepository, mediaStorage as unknown as MediaStoragePort, logger, ); diff --git a/core/media/application/use-cases/DeleteMediaUseCase.ts b/core/media/application/use-cases/DeleteMediaUseCase.ts index c9dabf045..261a9ad4d 100644 --- a/core/media/application/use-cases/DeleteMediaUseCase.ts +++ b/core/media/application/use-cases/DeleteMediaUseCase.ts @@ -26,7 +26,7 @@ export type DeleteMediaApplicationError = ApplicationErrorCode< export class DeleteMediaUseCase { constructor( - private readonly mediaRepo: IMediaRepository, + private readonly mediaRepo: MediaRepository, private readonly mediaStorage: MediaStoragePort, private readonly logger: Logger, ) {} diff --git a/core/media/application/use-cases/GetAvatarUseCase.test.ts b/core/media/application/use-cases/GetAvatarUseCase.test.ts index 0d84744ef..c3dfddea9 100644 --- a/core/media/application/use-cases/GetAvatarUseCase.test.ts +++ b/core/media/application/use-cases/GetAvatarUseCase.test.ts @@ -31,7 +31,7 @@ describe('GetAvatarUseCase', () => { } as unknown as Logger; useCase = new GetAvatarUseCase( - avatarRepo as unknown as IAvatarRepository, + avatarRepo as unknown as AvatarRepository, logger, ); }); diff --git a/core/media/application/use-cases/GetAvatarUseCase.ts b/core/media/application/use-cases/GetAvatarUseCase.ts index 42ec6caaa..1271465bf 100644 --- a/core/media/application/use-cases/GetAvatarUseCase.ts +++ b/core/media/application/use-cases/GetAvatarUseCase.ts @@ -29,7 +29,7 @@ export type GetAvatarApplicationError = ApplicationErrorCode< export class GetAvatarUseCase { constructor( - private readonly avatarRepo: IAvatarRepository, + private readonly avatarRepo: AvatarRepository, private readonly logger: Logger, ) {} diff --git a/core/media/application/use-cases/GetMediaUseCase.test.ts b/core/media/application/use-cases/GetMediaUseCase.test.ts index 121dde98e..7de1e2b15 100644 --- a/core/media/application/use-cases/GetMediaUseCase.test.ts +++ b/core/media/application/use-cases/GetMediaUseCase.test.ts @@ -29,7 +29,7 @@ describe('GetMediaUseCase', () => { } as unknown as Logger; useCase = new GetMediaUseCase( - mediaRepo as unknown as IMediaRepository, + mediaRepo as unknown as MediaRepository, logger, ); }); diff --git a/core/media/application/use-cases/GetMediaUseCase.ts b/core/media/application/use-cases/GetMediaUseCase.ts index 44588eb6d..eac5196ea 100644 --- a/core/media/application/use-cases/GetMediaUseCase.ts +++ b/core/media/application/use-cases/GetMediaUseCase.ts @@ -30,7 +30,7 @@ export type GetMediaErrorCode = 'MEDIA_NOT_FOUND' | 'REPOSITORY_ERROR'; export class GetMediaUseCase { constructor( - private readonly mediaRepo: IMediaRepository, + private readonly mediaRepo: MediaRepository, private readonly logger: Logger, ) {} diff --git a/core/media/application/use-cases/RequestAvatarGenerationUseCase.test.ts b/core/media/application/use-cases/RequestAvatarGenerationUseCase.test.ts index 94e4907b1..f08c4bda1 100644 --- a/core/media/application/use-cases/RequestAvatarGenerationUseCase.test.ts +++ b/core/media/application/use-cases/RequestAvatarGenerationUseCase.test.ts @@ -43,7 +43,7 @@ describe('RequestAvatarGenerationUseCase', () => { } as unknown as Logger; useCase = new RequestAvatarGenerationUseCase( - avatarRepo as unknown as IAvatarGenerationRepository, + avatarRepo as unknown as AvatarGenerationRepository, faceValidation as unknown as FaceValidationPort, avatarGeneration as unknown as AvatarGenerationPort, logger, diff --git a/core/media/application/use-cases/RequestAvatarGenerationUseCase.ts b/core/media/application/use-cases/RequestAvatarGenerationUseCase.ts index 183cd1765..cc51f3e1e 100644 --- a/core/media/application/use-cases/RequestAvatarGenerationUseCase.ts +++ b/core/media/application/use-cases/RequestAvatarGenerationUseCase.ts @@ -38,7 +38,7 @@ export type RequestAvatarGenerationApplicationError = ApplicationErrorCode< export class RequestAvatarGenerationUseCase { constructor( - private readonly avatarRepo: IAvatarGenerationRepository, + private readonly avatarRepo: AvatarGenerationRepository, private readonly faceValidation: FaceValidationPort, private readonly avatarGeneration: AvatarGenerationPort, private readonly logger: Logger, diff --git a/core/media/application/use-cases/SelectAvatarUseCase.test.ts b/core/media/application/use-cases/SelectAvatarUseCase.test.ts index f6700a137..9ce10def9 100644 --- a/core/media/application/use-cases/SelectAvatarUseCase.test.ts +++ b/core/media/application/use-cases/SelectAvatarUseCase.test.ts @@ -28,7 +28,7 @@ describe('SelectAvatarUseCase', () => { } as unknown as Logger; useCase = new SelectAvatarUseCase( - avatarRepo as unknown as IAvatarGenerationRepository, + avatarRepo as unknown as AvatarGenerationRepository, logger, ); }); diff --git a/core/media/application/use-cases/SelectAvatarUseCase.ts b/core/media/application/use-cases/SelectAvatarUseCase.ts index 448510b7c..489cc6dfb 100644 --- a/core/media/application/use-cases/SelectAvatarUseCase.ts +++ b/core/media/application/use-cases/SelectAvatarUseCase.ts @@ -29,7 +29,7 @@ export type SelectAvatarApplicationError = ApplicationErrorCode< export class SelectAvatarUseCase { constructor( - private readonly avatarRepo: IAvatarGenerationRepository, + private readonly avatarRepo: AvatarGenerationRepository, private readonly logger: Logger, ) {} diff --git a/core/media/application/use-cases/UpdateAvatarUseCase.test.ts b/core/media/application/use-cases/UpdateAvatarUseCase.test.ts index 2806307c6..e793087d6 100644 --- a/core/media/application/use-cases/UpdateAvatarUseCase.test.ts +++ b/core/media/application/use-cases/UpdateAvatarUseCase.test.ts @@ -33,7 +33,7 @@ describe('UpdateAvatarUseCase', () => { } as unknown as Logger; useCase = new UpdateAvatarUseCase( - avatarRepo as unknown as IAvatarRepository, + avatarRepo as unknown as AvatarRepository, logger, ); }); diff --git a/core/media/application/use-cases/UpdateAvatarUseCase.ts b/core/media/application/use-cases/UpdateAvatarUseCase.ts index 4e719f0d1..2abdde85c 100644 --- a/core/media/application/use-cases/UpdateAvatarUseCase.ts +++ b/core/media/application/use-cases/UpdateAvatarUseCase.ts @@ -30,7 +30,7 @@ export type UpdateAvatarApplicationError = ApplicationErrorCode< export class UpdateAvatarUseCase { constructor( - private readonly avatarRepo: IAvatarRepository, + private readonly avatarRepo: AvatarRepository, private readonly logger: Logger, ) {} diff --git a/core/media/application/use-cases/UploadMediaUseCase.test.ts b/core/media/application/use-cases/UploadMediaUseCase.test.ts index 037e889bd..342bfe15a 100644 --- a/core/media/application/use-cases/UploadMediaUseCase.test.ts +++ b/core/media/application/use-cases/UploadMediaUseCase.test.ts @@ -53,7 +53,7 @@ describe('UploadMediaUseCase', () => { } as unknown as Logger; useCase = new UploadMediaUseCase( - mediaRepo as unknown as IMediaRepository, + mediaRepo as unknown as MediaRepository, mediaStorage as unknown as MediaStoragePort, logger, ); diff --git a/core/media/application/use-cases/UploadMediaUseCase.ts b/core/media/application/use-cases/UploadMediaUseCase.ts index 5aeb966f0..1a7888509 100644 --- a/core/media/application/use-cases/UploadMediaUseCase.ts +++ b/core/media/application/use-cases/UploadMediaUseCase.ts @@ -41,7 +41,7 @@ export type UploadMediaErrorCode = export class UploadMediaUseCase { constructor( - private readonly mediaRepo: IMediaRepository, + private readonly mediaRepo: MediaRepository, private readonly mediaStorage: MediaStoragePort, private readonly logger: Logger, ) {} diff --git a/core/media/domain/entities/Avatar.ts b/core/media/domain/entities/Avatar.ts index 25f0947ff..28bfd7a3d 100644 --- a/core/media/domain/entities/Avatar.ts +++ b/core/media/domain/entities/Avatar.ts @@ -4,7 +4,7 @@ * Represents a user's selected avatar. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { MediaUrl } from '../value-objects/MediaUrl'; export interface AvatarProps { @@ -15,15 +15,15 @@ export interface AvatarProps { isActive: boolean; } -export class Avatar implements Entity { - readonly id: string; +export class Avatar extends Entity { readonly driverId: string; readonly mediaUrl: MediaUrl; readonly selectedAt: Date; private _isActive: boolean; private constructor(props: AvatarProps) { - this.id = props.id; + super(props.id); + this.driverId = props.driverId; this.mediaUrl = MediaUrl.create(props.mediaUrl); this.selectedAt = props.selectedAt; diff --git a/core/media/domain/entities/AvatarGenerationRequest.ts b/core/media/domain/entities/AvatarGenerationRequest.ts index 8d131d87b..618050553 100644 --- a/core/media/domain/entities/AvatarGenerationRequest.ts +++ b/core/media/domain/entities/AvatarGenerationRequest.ts @@ -4,7 +4,7 @@ * Represents a request to generate a racing avatar from a face photo. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import type { AvatarGenerationRequestProps, AvatarGenerationStatus, @@ -13,8 +13,7 @@ import type { } from '../types/AvatarGenerationRequest'; import { MediaUrl } from '../value-objects/MediaUrl'; -export class AvatarGenerationRequest implements Entity { - readonly id: string; +export class AvatarGenerationRequest extends Entity { readonly userId: string; readonly facePhotoUrl: MediaUrl; readonly suitColor: RacingSuitColor; @@ -27,7 +26,8 @@ export class AvatarGenerationRequest implements Entity { private _updatedAt: Date; private constructor(props: AvatarGenerationRequestProps) { - this.id = props.id; + super(props.id); + this.userId = props.userId; this.facePhotoUrl = MediaUrl.create(props.facePhotoUrl); this.suitColor = props.suitColor; diff --git a/core/media/domain/entities/Media.ts b/core/media/domain/entities/Media.ts index 230f9fd3d..7c13b27ff 100644 --- a/core/media/domain/entities/Media.ts +++ b/core/media/domain/entities/Media.ts @@ -4,7 +4,7 @@ * Represents a media file (image, video, etc.) stored in the system. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { MediaUrl } from '../value-objects/MediaUrl'; export type MediaType = 'image' | 'video' | 'document'; @@ -22,8 +22,7 @@ export interface MediaProps { metadata?: Record | undefined; } -export class Media implements Entity { - readonly id: string; +export class Media extends Entity { readonly filename: string; readonly originalName: string; readonly mimeType: string; @@ -35,7 +34,8 @@ export class Media implements Entity { readonly metadata?: Record | undefined; private constructor(props: MediaProps) { - this.id = props.id; + super(props.id); + this.filename = props.filename; this.originalName = props.originalName; this.mimeType = props.mimeType; diff --git a/core/media/domain/repositories/AvatarGenerationRepository.ts b/core/media/domain/repositories/AvatarGenerationRepository.ts index f329df2fd..8bc18c0ac 100644 --- a/core/media/domain/repositories/AvatarGenerationRepository.ts +++ b/core/media/domain/repositories/AvatarGenerationRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IAvatarGenerationRepository + * Repository Interface: AvatarGenerationRepository * * Defines the contract for avatar generation request persistence. */ diff --git a/core/media/domain/repositories/AvatarRepository.ts b/core/media/domain/repositories/AvatarRepository.ts index 8453c52cb..cf0367545 100644 --- a/core/media/domain/repositories/AvatarRepository.ts +++ b/core/media/domain/repositories/AvatarRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IAvatarRepository + * Repository Interface: AvatarRepository * * Defines the contract for avatar persistence. */ diff --git a/core/media/domain/repositories/MediaRepository.ts b/core/media/domain/repositories/MediaRepository.ts index c6558c8b3..c3675ba5b 100644 --- a/core/media/domain/repositories/MediaRepository.ts +++ b/core/media/domain/repositories/MediaRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IMediaRepository + * Repository Interface: MediaRepository * * Defines the contract for media file persistence. */ diff --git a/core/media/domain/value-objects/AvatarId.ts b/core/media/domain/value-objects/AvatarId.ts index a49f0c21a..00a9d7027 100644 --- a/core/media/domain/value-objects/AvatarId.ts +++ b/core/media/domain/value-objects/AvatarId.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface AvatarIdProps { value: string; @@ -25,7 +25,7 @@ export class AvatarId implements ValueObject { return this.props.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.value === other.props.value; } } \ No newline at end of file diff --git a/core/media/domain/value-objects/MediaUrl.ts b/core/media/domain/value-objects/MediaUrl.ts index cf2288186..25ea05826 100644 --- a/core/media/domain/value-objects/MediaUrl.ts +++ b/core/media/domain/value-objects/MediaUrl.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; /** * Value Object: MediaUrl @@ -40,7 +40,7 @@ export class MediaUrl implements ValueObject { return this.props.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.value === other.props.value; } } \ No newline at end of file diff --git a/core/notifications/application/use-cases/GetUnreadNotificationsUseCase.test.ts b/core/notifications/application/use-cases/GetUnreadNotificationsUseCase.test.ts index dcb524a9b..c93874cd2 100644 --- a/core/notifications/application/use-cases/GetUnreadNotificationsUseCase.test.ts +++ b/core/notifications/application/use-cases/GetUnreadNotificationsUseCase.test.ts @@ -30,7 +30,7 @@ describe('GetUnreadNotificationsUseCase', () => { } as unknown as Logger; useCase = new GetUnreadNotificationsUseCase( - notificationRepository as unknown as INotificationRepository, + notificationRepository as unknown as NotificationRepository, logger, ); }); diff --git a/core/notifications/application/use-cases/MarkNotificationReadUseCase.test.ts b/core/notifications/application/use-cases/MarkNotificationReadUseCase.test.ts index 49fe446e8..1444bf177 100644 --- a/core/notifications/application/use-cases/MarkNotificationReadUseCase.test.ts +++ b/core/notifications/application/use-cases/MarkNotificationReadUseCase.test.ts @@ -38,7 +38,7 @@ describe('MarkNotificationReadUseCase', () => { } as unknown as Logger; useCase = new MarkNotificationReadUseCase( - notificationRepository as unknown as INotificationRepository, + notificationRepository as unknown as NotificationRepository, logger, ); }); @@ -152,7 +152,7 @@ describe('MarkAllNotificationsReadUseCase', () => { }; useCase = new MarkAllNotificationsReadUseCase( - notificationRepository as unknown as INotificationRepository, + notificationRepository as unknown as NotificationRepository, ); }); @@ -197,7 +197,7 @@ describe('DismissNotificationUseCase', () => { }; useCase = new DismissNotificationUseCase( - notificationRepository as unknown as INotificationRepository, + notificationRepository as unknown as NotificationRepository, ); }); diff --git a/core/notifications/application/use-cases/MarkNotificationReadUseCase.ts b/core/notifications/application/use-cases/MarkNotificationReadUseCase.ts index 86a1f9ebc..78acae2f2 100644 --- a/core/notifications/application/use-cases/MarkNotificationReadUseCase.ts +++ b/core/notifications/application/use-cases/MarkNotificationReadUseCase.ts @@ -107,7 +107,7 @@ export type MarkAllNotificationsReadErrorCode = 'REPOSITORY_ERROR'; export class MarkAllNotificationsReadUseCase { constructor( - private readonly notificationRepository: INotificationRepository, + private readonly notificationRepository: NotificationRepository, ) {} async execute( @@ -152,7 +152,7 @@ export type DismissNotificationErrorCode = export class DismissNotificationUseCase { constructor( - private readonly notificationRepository: INotificationRepository, + private readonly notificationRepository: NotificationRepository, ) {} async execute( diff --git a/core/notifications/application/use-cases/NotificationPreferencesUseCases.test.ts b/core/notifications/application/use-cases/NotificationPreferencesUseCases.test.ts index 470129104..05899bb11 100644 --- a/core/notifications/application/use-cases/NotificationPreferencesUseCases.test.ts +++ b/core/notifications/application/use-cases/NotificationPreferencesUseCases.test.ts @@ -46,7 +46,7 @@ describe('NotificationPreferencesUseCases', () => { preferenceRepository.getOrCreateDefault.mockResolvedValue(preference); const useCase = new GetNotificationPreferencesQuery( - preferenceRepository as unknown as INotificationPreferenceRepository, + preferenceRepository as unknown as NotificationPreferenceRepository, logger, ); @@ -69,7 +69,7 @@ describe('NotificationPreferencesUseCases', () => { preferenceRepository.getOrCreateDefault.mockResolvedValue(preference); const useCase = new UpdateChannelPreferenceUseCase( - preferenceRepository as unknown as INotificationPreferenceRepository, + preferenceRepository as unknown as NotificationPreferenceRepository, logger, ); @@ -98,7 +98,7 @@ describe('NotificationPreferencesUseCases', () => { preferenceRepository.getOrCreateDefault.mockResolvedValue(preference); const useCase = new UpdateTypePreferenceUseCase( - preferenceRepository as unknown as INotificationPreferenceRepository, + preferenceRepository as unknown as NotificationPreferenceRepository, logger, ); @@ -127,7 +127,7 @@ describe('NotificationPreferencesUseCases', () => { preferenceRepository.getOrCreateDefault.mockResolvedValue(preference); const useCase = new UpdateQuietHoursUseCase( - preferenceRepository as unknown as INotificationPreferenceRepository, + preferenceRepository as unknown as NotificationPreferenceRepository, logger, ); @@ -151,7 +151,7 @@ describe('NotificationPreferencesUseCases', () => { it('UpdateQuietHoursUseCase returns error on invalid hours', async () => { const useCase = new UpdateQuietHoursUseCase( - preferenceRepository as unknown as INotificationPreferenceRepository, + preferenceRepository as unknown as NotificationPreferenceRepository, logger, ); @@ -176,7 +176,7 @@ describe('NotificationPreferencesUseCases', () => { preferenceRepository.getOrCreateDefault.mockResolvedValue(preference); const useCase = new SetDigestModeUseCase( - preferenceRepository as unknown as INotificationPreferenceRepository, + preferenceRepository as unknown as NotificationPreferenceRepository, ); const command: SetDigestModeCommand = { @@ -199,7 +199,7 @@ describe('NotificationPreferencesUseCases', () => { it('SetDigestModeUseCase returns error on invalid frequency', async () => { const useCase = new SetDigestModeUseCase( - preferenceRepository as unknown as INotificationPreferenceRepository, + preferenceRepository as unknown as NotificationPreferenceRepository, ); const command: SetDigestModeCommand = { diff --git a/core/notifications/application/use-cases/NotificationPreferencesUseCases.ts b/core/notifications/application/use-cases/NotificationPreferencesUseCases.ts index 53c4ca335..0af2351db 100644 --- a/core/notifications/application/use-cases/NotificationPreferencesUseCases.ts +++ b/core/notifications/application/use-cases/NotificationPreferencesUseCases.ts @@ -70,7 +70,7 @@ export type UpdateChannelPreferenceErrorCode = export class UpdateChannelPreferenceUseCase { constructor( - private readonly preferenceRepository: INotificationPreferenceRepository, + private readonly preferenceRepository: NotificationPreferenceRepository, private readonly logger: Logger, ) {} @@ -125,7 +125,7 @@ export type UpdateTypePreferenceErrorCode = 'REPOSITORY_ERROR'; export class UpdateTypePreferenceUseCase { constructor( - private readonly preferenceRepository: INotificationPreferenceRepository, + private readonly preferenceRepository: NotificationPreferenceRepository, private readonly logger: Logger, ) {} @@ -184,7 +184,7 @@ export type UpdateQuietHoursErrorCode = export class UpdateQuietHoursUseCase { constructor( - private readonly preferenceRepository: INotificationPreferenceRepository, + private readonly preferenceRepository: NotificationPreferenceRepository, private readonly logger: Logger, ) {} @@ -261,7 +261,7 @@ export type SetDigestModeErrorCode = export class SetDigestModeUseCase { constructor( - private readonly preferenceRepository: INotificationPreferenceRepository, + private readonly preferenceRepository: NotificationPreferenceRepository, ) {} async execute( diff --git a/core/notifications/application/use-cases/SendNotificationUseCase.test.ts b/core/notifications/application/use-cases/SendNotificationUseCase.test.ts index 9de7d1ba7..f3a4603aa 100644 --- a/core/notifications/application/use-cases/SendNotificationUseCase.test.ts +++ b/core/notifications/application/use-cases/SendNotificationUseCase.test.ts @@ -45,8 +45,8 @@ describe('SendNotificationUseCase', () => { } as unknown as Logger; useCase = new SendNotificationUseCase( - notificationRepository as unknown as INotificationRepository, - preferenceRepository as unknown as INotificationPreferenceRepository, + notificationRepository as unknown as NotificationRepository, + preferenceRepository as unknown as NotificationPreferenceRepository, gatewayRegistry as unknown as NotificationGatewayRegistry, logger, ); diff --git a/core/notifications/application/use-cases/SendNotificationUseCase.ts b/core/notifications/application/use-cases/SendNotificationUseCase.ts index 5765813e4..a108e2593 100644 --- a/core/notifications/application/use-cases/SendNotificationUseCase.ts +++ b/core/notifications/application/use-cases/SendNotificationUseCase.ts @@ -47,8 +47,8 @@ export type SendNotificationErrorCode = 'REPOSITORY_ERROR'; export class SendNotificationUseCase { constructor( - private readonly notificationRepository: INotificationRepository, - private readonly preferenceRepository: INotificationPreferenceRepository, + private readonly notificationRepository: NotificationRepository, + private readonly preferenceRepository: NotificationPreferenceRepository, private readonly gatewayRegistry: NotificationGatewayRegistry, private readonly logger: Logger, ) { diff --git a/core/notifications/domain/entities/Notification.ts b/core/notifications/domain/entities/Notification.ts index 8381073b1..1cc57df67 100644 --- a/core/notifications/domain/entities/Notification.ts +++ b/core/notifications/domain/entities/Notification.ts @@ -5,7 +5,7 @@ * Immutable entity with factory methods and domain validation. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { NotificationDomainError } from '../errors/NotificationDomainError'; import { NotificationId } from '../value-objects/NotificationId'; @@ -86,8 +86,9 @@ export interface NotificationProps { respondedAt?: Date; } -export class Notification implements Entity { - private constructor(private readonly props: NotificationProps) {} +export class Notification extends Entity { + private constructor(private readonly props: NotificationProps) { + super(props.id);} static create(props: Omit & { id: string; @@ -115,7 +116,6 @@ export class Notification implements Entity { }); } - get id(): string { return this.props.id.value; } get recipientId(): string { return this.props.recipientId; } get type(): NotificationType { return this.props.type; } get title(): string { return this.props.title; } diff --git a/core/notifications/domain/entities/NotificationPreference.ts b/core/notifications/domain/entities/NotificationPreference.ts index cbf89f59c..6515ef634 100644 --- a/core/notifications/domain/entities/NotificationPreference.ts +++ b/core/notifications/domain/entities/NotificationPreference.ts @@ -4,7 +4,7 @@ * Represents a user's notification preferences for different channels and types. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { NotificationDomainError } from '../errors/NotificationDomainError'; import type { NotificationChannel, NotificationType } from '../types/NotificationTypes'; import { QuietHours } from '../value-objects/QuietHours'; @@ -44,8 +44,9 @@ export interface NotificationPreferenceProps { updatedAt: Date; } -export class NotificationPreference implements Entity { - private constructor(private readonly props: NotificationPreferenceProps) {} +export class NotificationPreference extends Entity { + private constructor(private readonly props: NotificationPreferenceProps) { + super(props.id);} static create( props: Omit & { updatedAt?: Date }, @@ -78,7 +79,6 @@ export class NotificationPreference implements Entity { }); } - get id(): string { return this.props.id; } get driverId(): string { return this.props.driverId; } get channels(): Record { return { ...this.props.channels }; } get typePreferences(): Partial> | undefined { diff --git a/core/notifications/domain/errors/NotificationDomainError.ts b/core/notifications/domain/errors/NotificationDomainError.ts index 3049b2210..a5898f17c 100644 --- a/core/notifications/domain/errors/NotificationDomainError.ts +++ b/core/notifications/domain/errors/NotificationDomainError.ts @@ -1,9 +1,10 @@ -import type { DomainError, CommonDomainErrorKind } from '@core/shared/errors'; +import type { DomainError } from '@core/shared/errors/DomainError'; +import type { CommonDomainErrorKind } from '@core/shared/errors/DomainError'; /** * Domain Error: NotificationDomainError * - * Implements the shared IDomainError contract for notification domain failures. + * Implements the shared DomainError contract for notification domain failures. */ export class NotificationDomainError extends Error implements DomainError { readonly name = 'NotificationDomainError'; diff --git a/core/notifications/domain/repositories/NotificationPreferenceRepository.ts b/core/notifications/domain/repositories/NotificationPreferenceRepository.ts index 1f2d84ff5..d4778cbfd 100644 --- a/core/notifications/domain/repositories/NotificationPreferenceRepository.ts +++ b/core/notifications/domain/repositories/NotificationPreferenceRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: INotificationPreferenceRepository + * Repository Interface: NotificationPreferenceRepository * * Defines the contract for persisting and retrieving NotificationPreference entities. */ diff --git a/core/notifications/domain/repositories/NotificationRepository.ts b/core/notifications/domain/repositories/NotificationRepository.ts index 2176dd263..2e5012b2a 100644 --- a/core/notifications/domain/repositories/NotificationRepository.ts +++ b/core/notifications/domain/repositories/NotificationRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: INotificationRepository + * Repository Interface: NotificationRepository * * Defines the contract for persisting and retrieving Notification entities. */ diff --git a/core/notifications/domain/value-objects/NotificationId.ts b/core/notifications/domain/value-objects/NotificationId.ts index a9085c72f..0b516ccff 100644 --- a/core/notifications/domain/value-objects/NotificationId.ts +++ b/core/notifications/domain/value-objects/NotificationId.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { NotificationDomainError } from '../errors/NotificationDomainError'; export interface NotificationIdProps { @@ -37,7 +37,7 @@ export class NotificationId implements ValueObject { return this.props.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.value === other.props.value; } } \ No newline at end of file diff --git a/core/notifications/domain/value-objects/QuietHours.ts b/core/notifications/domain/value-objects/QuietHours.ts index a92ab4ce0..5acc6fd25 100644 --- a/core/notifications/domain/value-objects/QuietHours.ts +++ b/core/notifications/domain/value-objects/QuietHours.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { NotificationDomainError } from '../errors/NotificationDomainError'; export interface QuietHoursProps { @@ -63,7 +63,7 @@ export class QuietHours implements ValueObject { return hour >= startHour || hour < endHour; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return ( this.props.startHour === other.props.startHour && this.props.endHour === other.props.endHour diff --git a/core/payments/application/use-cases/AwardPrizeUseCase.test.ts b/core/payments/application/use-cases/AwardPrizeUseCase.test.ts index 5a277fc47..4fd50147c 100644 --- a/core/payments/application/use-cases/AwardPrizeUseCase.test.ts +++ b/core/payments/application/use-cases/AwardPrizeUseCase.test.ts @@ -14,7 +14,7 @@ describe('AwardPrizeUseCase', () => { }; useCase = new AwardPrizeUseCase( - prizeRepository as unknown as IPrizeRepository, + prizeRepository as unknown as PrizeRepository, ); }); diff --git a/core/payments/application/use-cases/AwardPrizeUseCase.ts b/core/payments/application/use-cases/AwardPrizeUseCase.ts index 2934a2d5c..3b3ed9d00 100644 --- a/core/payments/application/use-cases/AwardPrizeUseCase.ts +++ b/core/payments/application/use-cases/AwardPrizeUseCase.ts @@ -25,7 +25,7 @@ export class AwardPrizeUseCase implements UseCase { constructor( - private readonly prizeRepository: IPrizeRepository, + private readonly prizeRepository: PrizeRepository, ) {} async execute(input: AwardPrizeInput): Promise>> { diff --git a/core/payments/application/use-cases/CreatePaymentUseCase.test.ts b/core/payments/application/use-cases/CreatePaymentUseCase.test.ts index c0ae458d0..710e1bd90 100644 --- a/core/payments/application/use-cases/CreatePaymentUseCase.test.ts +++ b/core/payments/application/use-cases/CreatePaymentUseCase.test.ts @@ -15,7 +15,7 @@ describe('CreatePaymentUseCase', () => { }; useCase = new CreatePaymentUseCase( - paymentRepository as unknown as IPaymentRepository, + paymentRepository as unknown as PaymentRepository, ); }); diff --git a/core/payments/application/use-cases/CreatePaymentUseCase.ts b/core/payments/application/use-cases/CreatePaymentUseCase.ts index 67dd9a6f0..070d79d5c 100644 --- a/core/payments/application/use-cases/CreatePaymentUseCase.ts +++ b/core/payments/application/use-cases/CreatePaymentUseCase.ts @@ -30,7 +30,7 @@ export class CreatePaymentUseCase implements UseCase { constructor( - private readonly paymentRepository: IPaymentRepository, + private readonly paymentRepository: PaymentRepository, ) {} async execute(input: CreatePaymentInput): Promise>> { diff --git a/core/payments/application/use-cases/CreatePrizeUseCase.test.ts b/core/payments/application/use-cases/CreatePrizeUseCase.test.ts index 5718906c2..72c5f747c 100644 --- a/core/payments/application/use-cases/CreatePrizeUseCase.test.ts +++ b/core/payments/application/use-cases/CreatePrizeUseCase.test.ts @@ -14,7 +14,7 @@ describe('CreatePrizeUseCase', () => { }; useCase = new CreatePrizeUseCase( - prizeRepository as unknown as IPrizeRepository, + prizeRepository as unknown as PrizeRepository, ); }); diff --git a/core/payments/application/use-cases/CreatePrizeUseCase.ts b/core/payments/application/use-cases/CreatePrizeUseCase.ts index 86a5d7752..0ceff5bcc 100644 --- a/core/payments/application/use-cases/CreatePrizeUseCase.ts +++ b/core/payments/application/use-cases/CreatePrizeUseCase.ts @@ -30,7 +30,7 @@ export class CreatePrizeUseCase implements UseCase { constructor( - private readonly prizeRepository: IPrizeRepository, + private readonly prizeRepository: PrizeRepository, ) {} async execute(input: CreatePrizeInput): Promise>> { diff --git a/core/payments/application/use-cases/DeletePrizeUseCase.test.ts b/core/payments/application/use-cases/DeletePrizeUseCase.test.ts index 509295781..77cc525f0 100644 --- a/core/payments/application/use-cases/DeletePrizeUseCase.test.ts +++ b/core/payments/application/use-cases/DeletePrizeUseCase.test.ts @@ -14,7 +14,7 @@ describe('DeletePrizeUseCase', () => { }; useCase = new DeletePrizeUseCase( - prizeRepository as unknown as IPrizeRepository, + prizeRepository as unknown as PrizeRepository, ); }); diff --git a/core/payments/application/use-cases/DeletePrizeUseCase.ts b/core/payments/application/use-cases/DeletePrizeUseCase.ts index f21776e3a..80e49c97e 100644 --- a/core/payments/application/use-cases/DeletePrizeUseCase.ts +++ b/core/payments/application/use-cases/DeletePrizeUseCase.ts @@ -23,7 +23,7 @@ export class DeletePrizeUseCase implements UseCase { constructor( - private readonly prizeRepository: IPrizeRepository, + private readonly prizeRepository: PrizeRepository, ) {} async execute(input: DeletePrizeInput): Promise>> { diff --git a/core/payments/application/use-cases/GetMembershipFeesUseCase.test.ts b/core/payments/application/use-cases/GetMembershipFeesUseCase.test.ts index ce1f0eb57..a8480036f 100644 --- a/core/payments/application/use-cases/GetMembershipFeesUseCase.test.ts +++ b/core/payments/application/use-cases/GetMembershipFeesUseCase.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, vi, type Mock } from 'vitest'; import { GetMembershipFeesUseCase, type GetMembershipFeesInput } from './GetMembershipFeesUseCase'; -import type { MembershipFeeRepository, IMemberPaymentRepository } from '../../domain/repositories/MembershipFeeRepository'; +import type { MembershipFeeRepository, MemberPaymentRepository } from '../../domain/repositories/MembershipFeeRepository'; describe('GetMembershipFeesUseCase', () => { let membershipFeeRepository: { @@ -20,8 +20,8 @@ describe('GetMembershipFeesUseCase', () => { }; useCase = new GetMembershipFeesUseCase( - membershipFeeRepository as unknown as IMembershipFeeRepository, - memberPaymentRepository as unknown as IMemberPaymentRepository, + membershipFeeRepository as unknown as MembershipFeeRepository, + memberPaymentRepository as unknown as MemberPaymentRepository, ); }); diff --git a/core/payments/application/use-cases/GetMembershipFeesUseCase.ts b/core/payments/application/use-cases/GetMembershipFeesUseCase.ts index ec5481f6c..8865c28a0 100644 --- a/core/payments/application/use-cases/GetMembershipFeesUseCase.ts +++ b/core/payments/application/use-cases/GetMembershipFeesUseCase.ts @@ -4,7 +4,7 @@ * Retrieves membership fees and member payments. */ -import type { MembershipFeeRepository, IMemberPaymentRepository } from '../../domain/repositories/MembershipFeeRepository'; +import type { MembershipFeeRepository, MemberPaymentRepository } from '../../domain/repositories/MembershipFeeRepository'; import type { MembershipFee } from '../../domain/entities/MembershipFee'; import type { MemberPayment } from '../../domain/entities/MemberPayment'; import type { UseCase } from '@core/shared/application/UseCase'; @@ -27,8 +27,8 @@ export class GetMembershipFeesUseCase implements UseCase { constructor( - private readonly membershipFeeRepository: IMembershipFeeRepository, - private readonly memberPaymentRepository: IMemberPaymentRepository, + private readonly membershipFeeRepository: MembershipFeeRepository, + private readonly memberPaymentRepository: MemberPaymentRepository, ) {} async execute(input: GetMembershipFeesInput): Promise>> { diff --git a/core/payments/application/use-cases/GetPaymentsUseCase.test.ts b/core/payments/application/use-cases/GetPaymentsUseCase.test.ts index 42594cd9a..813bbbc12 100644 --- a/core/payments/application/use-cases/GetPaymentsUseCase.test.ts +++ b/core/payments/application/use-cases/GetPaymentsUseCase.test.ts @@ -15,7 +15,7 @@ describe('GetPaymentsUseCase', () => { }; useCase = new GetPaymentsUseCase( - paymentRepository as unknown as IPaymentRepository, + paymentRepository as unknown as PaymentRepository, ); }); diff --git a/core/payments/application/use-cases/GetPaymentsUseCase.ts b/core/payments/application/use-cases/GetPaymentsUseCase.ts index a44bf7f56..44a6656e1 100644 --- a/core/payments/application/use-cases/GetPaymentsUseCase.ts +++ b/core/payments/application/use-cases/GetPaymentsUseCase.ts @@ -26,7 +26,7 @@ export class GetPaymentsUseCase implements UseCase { constructor( - private readonly paymentRepository: IPaymentRepository, + private readonly paymentRepository: PaymentRepository, ) {} async execute(input: GetPaymentsInput): Promise>> { diff --git a/core/payments/application/use-cases/GetPrizesUseCase.test.ts b/core/payments/application/use-cases/GetPrizesUseCase.test.ts index 69990ee33..3f12a1cac 100644 --- a/core/payments/application/use-cases/GetPrizesUseCase.test.ts +++ b/core/payments/application/use-cases/GetPrizesUseCase.test.ts @@ -17,7 +17,7 @@ describe('GetPrizesUseCase', () => { }; useCase = new GetPrizesUseCase( - prizeRepository as unknown as IPrizeRepository, + prizeRepository as unknown as PrizeRepository, ); }); diff --git a/core/payments/application/use-cases/GetPrizesUseCase.ts b/core/payments/application/use-cases/GetPrizesUseCase.ts index 322c1c839..de3aabf16 100644 --- a/core/payments/application/use-cases/GetPrizesUseCase.ts +++ b/core/payments/application/use-cases/GetPrizesUseCase.ts @@ -22,7 +22,7 @@ export class GetPrizesUseCase implements UseCase { constructor( - private readonly prizeRepository: IPrizeRepository, + private readonly prizeRepository: PrizeRepository, ) {} async execute(input: GetPrizesInput): Promise> { diff --git a/core/payments/application/use-cases/GetSponsorBillingUseCase.test.ts b/core/payments/application/use-cases/GetSponsorBillingUseCase.test.ts index ab1bd374c..310f89360 100644 --- a/core/payments/application/use-cases/GetSponsorBillingUseCase.test.ts +++ b/core/payments/application/use-cases/GetSponsorBillingUseCase.test.ts @@ -22,8 +22,8 @@ describe('GetSponsorBillingUseCase', () => { }; useCase = new GetSponsorBillingUseCase( - paymentRepository as unknown as IPaymentRepository, - seasonSponsorshipRepository as unknown as ISeasonSponsorshipRepository, + paymentRepository as unknown as PaymentRepository, + seasonSponsorshipRepository as unknown as SeasonSponsorshipRepository, ); }); diff --git a/core/payments/application/use-cases/GetSponsorBillingUseCase.ts b/core/payments/application/use-cases/GetSponsorBillingUseCase.ts index 42b55d68f..467df84c4 100644 --- a/core/payments/application/use-cases/GetSponsorBillingUseCase.ts +++ b/core/payments/application/use-cases/GetSponsorBillingUseCase.ts @@ -61,8 +61,8 @@ export class GetSponsorBillingUseCase implements UseCase { constructor( - private readonly paymentRepository: IPaymentRepository, - private readonly seasonSponsorshipRepository: ISeasonSponsorshipRepository, + private readonly paymentRepository: PaymentRepository, + private readonly seasonSponsorshipRepository: SeasonSponsorshipRepository, ) {} async execute(input: GetSponsorBillingInput): Promise>> { diff --git a/core/payments/application/use-cases/GetWalletUseCase.test.ts b/core/payments/application/use-cases/GetWalletUseCase.test.ts index 41fafc204..c961185e7 100644 --- a/core/payments/application/use-cases/GetWalletUseCase.test.ts +++ b/core/payments/application/use-cases/GetWalletUseCase.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi, type Mock } from 'vitest'; import { GetWalletUseCase, type GetWalletInput } from './GetWalletUseCase'; -import type { TransactionRepository, IWalletRepository } from '../../domain/repositories/WalletRepository'; +import type { TransactionRepository, WalletRepository } from '../../domain/repositories/WalletRepository'; import type { Transaction, Wallet } from '../../domain/entities/Wallet'; import { TransactionType } from '../../domain/entities/Wallet'; @@ -27,8 +27,8 @@ describe('GetWalletUseCase', () => { }; useCase = new GetWalletUseCase( - walletRepository as unknown as IWalletRepository, - transactionRepository as unknown as ITransactionRepository, + walletRepository as unknown as WalletRepository, + transactionRepository as unknown as TransactionRepository, ); }); diff --git a/core/payments/application/use-cases/GetWalletUseCase.ts b/core/payments/application/use-cases/GetWalletUseCase.ts index 71edd7236..a72b64955 100644 --- a/core/payments/application/use-cases/GetWalletUseCase.ts +++ b/core/payments/application/use-cases/GetWalletUseCase.ts @@ -4,7 +4,7 @@ * Retrieves wallet information and transactions. */ -import type { WalletRepository, ITransactionRepository } from '../../domain/repositories/WalletRepository'; +import type { WalletRepository, TransactionRepository } from '../../domain/repositories/WalletRepository'; import type { Wallet, Transaction } from '../../domain/entities/Wallet'; import type { UseCase } from '@core/shared/application/UseCase'; import { Result } from '@core/shared/domain/Result'; @@ -25,8 +25,8 @@ export class GetWalletUseCase implements UseCase { constructor( - private readonly walletRepository: IWalletRepository, - private readonly transactionRepository: ITransactionRepository, + private readonly walletRepository: WalletRepository, + private readonly transactionRepository: TransactionRepository, ) {} async execute(input: GetWalletInput): Promise>> { diff --git a/core/payments/application/use-cases/ProcessWalletTransactionUseCase.test.ts b/core/payments/application/use-cases/ProcessWalletTransactionUseCase.test.ts index e306c907b..d67767d15 100644 --- a/core/payments/application/use-cases/ProcessWalletTransactionUseCase.test.ts +++ b/core/payments/application/use-cases/ProcessWalletTransactionUseCase.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect, vi, type Mock } from 'vitest'; import { ProcessWalletTransactionUseCase, type ProcessWalletTransactionInput } from './ProcessWalletTransactionUseCase'; -import type { WalletRepository, ITransactionRepository } from '../../domain/repositories/WalletRepository'; +import type { WalletRepository, TransactionRepository } from '../../domain/repositories/WalletRepository'; import { TransactionType, ReferenceType } from '../../domain/entities/Wallet'; describe('ProcessWalletTransactionUseCase', () => { @@ -26,8 +26,8 @@ describe('ProcessWalletTransactionUseCase', () => { }; useCase = new ProcessWalletTransactionUseCase( - walletRepository as unknown as IWalletRepository, - transactionRepository as unknown as ITransactionRepository, + walletRepository as unknown as WalletRepository, + transactionRepository as unknown as TransactionRepository, ); }); diff --git a/core/payments/application/use-cases/ProcessWalletTransactionUseCase.ts b/core/payments/application/use-cases/ProcessWalletTransactionUseCase.ts index dda178b4e..71a876923 100644 --- a/core/payments/application/use-cases/ProcessWalletTransactionUseCase.ts +++ b/core/payments/application/use-cases/ProcessWalletTransactionUseCase.ts @@ -4,7 +4,7 @@ * Processes a wallet transaction (deposit or withdrawal). */ -import type { WalletRepository, ITransactionRepository } from '../../domain/repositories/WalletRepository'; +import type { WalletRepository, TransactionRepository } from '../../domain/repositories/WalletRepository'; import type { Wallet, Transaction } from '../../domain/entities/Wallet'; import { TransactionType, ReferenceType } from '../../domain/entities/Wallet'; import type { UseCase } from '@core/shared/application/UseCase'; @@ -31,8 +31,8 @@ export class ProcessWalletTransactionUseCase implements UseCase { constructor( - private readonly walletRepository: IWalletRepository, - private readonly transactionRepository: ITransactionRepository, + private readonly walletRepository: WalletRepository, + private readonly transactionRepository: TransactionRepository, ) {} async execute(input: ProcessWalletTransactionInput): Promise>> { diff --git a/core/payments/application/use-cases/UpdateMemberPaymentUseCase.test.ts b/core/payments/application/use-cases/UpdateMemberPaymentUseCase.test.ts index d1217183c..aa3e43bf8 100644 --- a/core/payments/application/use-cases/UpdateMemberPaymentUseCase.test.ts +++ b/core/payments/application/use-cases/UpdateMemberPaymentUseCase.test.ts @@ -1,6 +1,6 @@ import { beforeEach, describe, expect, it, vi, type Mock } from 'vitest'; import { UpdateMemberPaymentUseCase, type UpdateMemberPaymentInput } from './UpdateMemberPaymentUseCase'; -import type { MembershipFeeRepository, IMemberPaymentRepository } from '../../domain/repositories/MembershipFeeRepository'; +import type { MembershipFeeRepository, MemberPaymentRepository } from '../../domain/repositories/MembershipFeeRepository'; import { MemberPaymentStatus, type MemberPayment } from '../../domain/entities/MemberPayment'; describe('UpdateMemberPaymentUseCase', () => { @@ -28,8 +28,8 @@ describe('UpdateMemberPaymentUseCase', () => { }; useCase = new UpdateMemberPaymentUseCase( - membershipFeeRepository as unknown as IMembershipFeeRepository, - memberPaymentRepository as unknown as IMemberPaymentRepository, + membershipFeeRepository as unknown as MembershipFeeRepository, + memberPaymentRepository as unknown as MemberPaymentRepository, ); }); diff --git a/core/payments/application/use-cases/UpdateMemberPaymentUseCase.ts b/core/payments/application/use-cases/UpdateMemberPaymentUseCase.ts index d64621abb..05aef4fd3 100644 --- a/core/payments/application/use-cases/UpdateMemberPaymentUseCase.ts +++ b/core/payments/application/use-cases/UpdateMemberPaymentUseCase.ts @@ -4,7 +4,7 @@ * Updates a member payment record. */ -import type { MembershipFeeRepository, IMemberPaymentRepository } from '../../domain/repositories/MembershipFeeRepository'; +import type { MembershipFeeRepository, MemberPaymentRepository } from '../../domain/repositories/MembershipFeeRepository'; import type { MemberPayment } from '../../domain/entities/MemberPayment'; import { MemberPaymentStatus } from '../../domain/entities/MemberPayment'; import type { UseCase } from '@core/shared/application/UseCase'; @@ -30,8 +30,8 @@ export class UpdateMemberPaymentUseCase implements UseCase { constructor( - private readonly membershipFeeRepository: IMembershipFeeRepository, - private readonly memberPaymentRepository: IMemberPaymentRepository, + private readonly membershipFeeRepository: MembershipFeeRepository, + private readonly memberPaymentRepository: MemberPaymentRepository, ) {} async execute(input: UpdateMemberPaymentInput): Promise>> { diff --git a/core/payments/application/use-cases/UpdatePaymentStatusUseCase.test.ts b/core/payments/application/use-cases/UpdatePaymentStatusUseCase.test.ts index 7e6226ba1..bcdd3bbfe 100644 --- a/core/payments/application/use-cases/UpdatePaymentStatusUseCase.test.ts +++ b/core/payments/application/use-cases/UpdatePaymentStatusUseCase.test.ts @@ -17,7 +17,7 @@ describe('UpdatePaymentStatusUseCase', () => { }; useCase = new UpdatePaymentStatusUseCase( - paymentRepository as unknown as IPaymentRepository, + paymentRepository as unknown as PaymentRepository, ); }); diff --git a/core/payments/application/use-cases/UpdatePaymentStatusUseCase.ts b/core/payments/application/use-cases/UpdatePaymentStatusUseCase.ts index 29c28e932..6e4329a2e 100644 --- a/core/payments/application/use-cases/UpdatePaymentStatusUseCase.ts +++ b/core/payments/application/use-cases/UpdatePaymentStatusUseCase.ts @@ -26,7 +26,7 @@ export class UpdatePaymentStatusUseCase implements UseCase { constructor( - private readonly paymentRepository: IPaymentRepository, + private readonly paymentRepository: PaymentRepository, ) {} async execute(input: UpdatePaymentStatusInput): Promise>> { diff --git a/core/payments/application/use-cases/UpsertMembershipFeeUseCase.test.ts b/core/payments/application/use-cases/UpsertMembershipFeeUseCase.test.ts index e46389944..0e37142d1 100644 --- a/core/payments/application/use-cases/UpsertMembershipFeeUseCase.test.ts +++ b/core/payments/application/use-cases/UpsertMembershipFeeUseCase.test.ts @@ -19,7 +19,7 @@ describe('UpsertMembershipFeeUseCase', () => { }; useCase = new UpsertMembershipFeeUseCase( - membershipFeeRepository as unknown as IMembershipFeeRepository, + membershipFeeRepository as unknown as MembershipFeeRepository, ); }); diff --git a/core/payments/application/use-cases/UpsertMembershipFeeUseCase.ts b/core/payments/application/use-cases/UpsertMembershipFeeUseCase.ts index 709cc9585..487ba3dfb 100644 --- a/core/payments/application/use-cases/UpsertMembershipFeeUseCase.ts +++ b/core/payments/application/use-cases/UpsertMembershipFeeUseCase.ts @@ -26,7 +26,7 @@ export class UpsertMembershipFeeUseCase implements UseCase { constructor( - private readonly membershipFeeRepository: IMembershipFeeRepository, + private readonly membershipFeeRepository: MembershipFeeRepository, ) {} async execute(input: UpsertMembershipFeeInput): Promise> { diff --git a/core/payments/domain/repositories/MembershipFeeRepository.ts b/core/payments/domain/repositories/MembershipFeeRepository.ts index 63de68caf..73cd40763 100644 --- a/core/payments/domain/repositories/MembershipFeeRepository.ts +++ b/core/payments/domain/repositories/MembershipFeeRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IMembershipFeeRepository + * Repository Interface: MembershipFeeRepository */ import type { MembershipFee } from '../entities/MembershipFee'; @@ -15,7 +15,7 @@ export interface MembershipFeeRepository { export interface MemberPaymentRepository { findById(id: string): Promise; findByFeeIdAndDriverId(feeId: string, driverId: string): Promise; - findByLeagueIdAndDriverId(leagueId: string, driverId: string, membershipFeeRepo: IMembershipFeeRepository): Promise; + findByLeagueIdAndDriverId(leagueId: string, driverId: string, membershipFeeRepo: MembershipFeeRepository): Promise; create(payment: MemberPayment): Promise; update(payment: MemberPayment): Promise; } \ No newline at end of file diff --git a/core/payments/domain/repositories/PaymentRepository.ts b/core/payments/domain/repositories/PaymentRepository.ts index e76113015..186e0d33b 100644 --- a/core/payments/domain/repositories/PaymentRepository.ts +++ b/core/payments/domain/repositories/PaymentRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IPaymentRepository + * Repository Interface: PaymentRepository */ import type { Payment, PaymentType } from '../entities/Payment'; diff --git a/core/payments/domain/repositories/PrizeRepository.ts b/core/payments/domain/repositories/PrizeRepository.ts index 8be82c095..e106372e1 100644 --- a/core/payments/domain/repositories/PrizeRepository.ts +++ b/core/payments/domain/repositories/PrizeRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IPrizeRepository + * Repository Interface: PrizeRepository */ import type { Prize } from '../entities/Prize'; diff --git a/core/payments/domain/repositories/WalletRepository.ts b/core/payments/domain/repositories/WalletRepository.ts index fadabe0de..51618ccd9 100644 --- a/core/payments/domain/repositories/WalletRepository.ts +++ b/core/payments/domain/repositories/WalletRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IWalletRepository + * Repository Interface: WalletRepository */ import type { Wallet, Transaction } from '../entities/Wallet'; diff --git a/core/racing/application/errors/RacingApplicationError.ts b/core/racing/application/errors/RacingApplicationError.ts index 67104a79a..b2b085691 100644 --- a/core/racing/application/errors/RacingApplicationError.ts +++ b/core/racing/application/errors/RacingApplicationError.ts @@ -1,4 +1,5 @@ -import type { ApplicationError, CommonApplicationErrorKind } from '@core/shared/errors'; +import type { ApplicationError } from '@core/shared/errors/ApplicationError'; +import type { CommonApplicationErrorKind } from '@core/shared/errors/ApplicationError'; export abstract class RacingApplicationError extends Error diff --git a/core/racing/application/ports/TeamRaceResultsProvider.ts b/core/racing/application/ports/TeamRaceResultsProvider.ts index 49d83fc08..e4119d8bf 100644 --- a/core/racing/application/ports/TeamRaceResultsProvider.ts +++ b/core/racing/application/ports/TeamRaceResultsProvider.ts @@ -1,7 +1,7 @@ import { TeamDrivingRaceFactsDto } from '../../domain/services/TeamDrivingRatingEventFactory'; /** - * Port: ITeamRaceResultsProvider + * Port: TeamRaceResultsProvider * * Provides race results for teams from the racing context. * This is a port that adapts the racing domain data to the rating system. diff --git a/core/racing/application/queries/GetTeamRatingLedgerQuery.ts b/core/racing/application/queries/GetTeamRatingLedgerQuery.ts index bb1ceefb4..0f210ca27 100644 --- a/core/racing/application/queries/GetTeamRatingLedgerQuery.ts +++ b/core/racing/application/queries/GetTeamRatingLedgerQuery.ts @@ -17,7 +17,7 @@ export interface GetTeamRatingLedgerQuery { export class GetTeamRatingLedgerQueryHandler { constructor( - private readonly ratingEventRepo: ITeamRatingEventRepository + private readonly ratingEventRepo: TeamRatingEventRepository ) {} async execute(query: GetTeamRatingLedgerQuery): Promise { diff --git a/core/racing/application/queries/GetTeamRatingsSummaryQuery.ts b/core/racing/application/queries/GetTeamRatingsSummaryQuery.ts index 396c6fba9..ef83ad677 100644 --- a/core/racing/application/queries/GetTeamRatingsSummaryQuery.ts +++ b/core/racing/application/queries/GetTeamRatingsSummaryQuery.ts @@ -15,8 +15,8 @@ export interface GetTeamRatingsSummaryQuery { export class GetTeamRatingsSummaryQueryHandler { constructor( - private readonly teamRatingRepo: ITeamRatingRepository, - private readonly ratingEventRepo: ITeamRatingEventRepository + private readonly teamRatingRepo: TeamRatingRepository, + private readonly ratingEventRepo: TeamRatingEventRepository ) {} async execute(query: GetTeamRatingsSummaryQuery): Promise { diff --git a/core/racing/application/use-cases/AcceptSponsorshipRequestUseCase.test.ts b/core/racing/application/use-cases/AcceptSponsorshipRequestUseCase.test.ts index a3810b23a..951e4a25b 100644 --- a/core/racing/application/use-cases/AcceptSponsorshipRequestUseCase.test.ts +++ b/core/racing/application/use-cases/AcceptSponsorshipRequestUseCase.test.ts @@ -70,13 +70,13 @@ describe('AcceptSponsorshipRequestUseCase', () => { it('should send notification to sponsor, process payment, update wallets, and return result when accepting season sponsorship', async () => { const useCase = new AcceptSponsorshipRequestUseCase( - mockSponsorshipRequestRepo as unknown as ISponsorshipRequestRepository, - mockSeasonSponsorshipRepo as unknown as ISeasonSponsorshipRepository, - mockSeasonRepo as unknown as ISeasonRepository, + mockSponsorshipRequestRepo as unknown as SponsorshipRequestRepository, + mockSeasonSponsorshipRepo as unknown as SeasonSponsorshipRepository, + mockSeasonRepo as unknown as SeasonRepository, mockNotificationService as unknown as NotificationService, processPayment, - mockWalletRepo as unknown as IWalletRepository, - mockLeagueWalletRepo as unknown as ILeagueWalletRepository, + mockWalletRepo as unknown as WalletRepository, + mockLeagueWalletRepo as unknown as LeagueWalletRepository, mockLogger as unknown as Logger, ); @@ -189,13 +189,13 @@ describe('AcceptSponsorshipRequestUseCase', () => { it('should return error when sponsorship request not found', async () => { const useCase = new AcceptSponsorshipRequestUseCase( - mockSponsorshipRequestRepo as unknown as ISponsorshipRequestRepository, - mockSeasonSponsorshipRepo as unknown as ISeasonSponsorshipRepository, - mockSeasonRepo as unknown as ISeasonRepository, + mockSponsorshipRequestRepo as unknown as SponsorshipRequestRepository, + mockSeasonSponsorshipRepo as unknown as SeasonSponsorshipRepository, + mockSeasonRepo as unknown as SeasonRepository, mockNotificationService as unknown as NotificationService, processPayment, - mockWalletRepo as unknown as IWalletRepository, - mockLeagueWalletRepo as unknown as ILeagueWalletRepository, + mockWalletRepo as unknown as WalletRepository, + mockLeagueWalletRepo as unknown as LeagueWalletRepository, mockLogger as unknown as Logger, ); @@ -212,13 +212,13 @@ describe('AcceptSponsorshipRequestUseCase', () => { it('should return error when sponsorship request is not pending', async () => { const useCase = new AcceptSponsorshipRequestUseCase( - mockSponsorshipRequestRepo as unknown as ISponsorshipRequestRepository, - mockSeasonSponsorshipRepo as unknown as ISeasonSponsorshipRepository, - mockSeasonRepo as unknown as ISeasonRepository, + mockSponsorshipRequestRepo as unknown as SponsorshipRequestRepository, + mockSeasonSponsorshipRepo as unknown as SeasonSponsorshipRepository, + mockSeasonRepo as unknown as SeasonRepository, mockNotificationService as unknown as NotificationService, processPayment, - mockWalletRepo as unknown as IWalletRepository, - mockLeagueWalletRepo as unknown as ILeagueWalletRepository, + mockWalletRepo as unknown as WalletRepository, + mockLeagueWalletRepo as unknown as LeagueWalletRepository, mockLogger as unknown as Logger, ); diff --git a/core/racing/application/use-cases/AcceptSponsorshipRequestUseCase.ts b/core/racing/application/use-cases/AcceptSponsorshipRequestUseCase.ts index 5ae9c6023..14e07eadb 100644 --- a/core/racing/application/use-cases/AcceptSponsorshipRequestUseCase.ts +++ b/core/racing/application/use-cases/AcceptSponsorshipRequestUseCase.ts @@ -39,13 +39,13 @@ export interface ProcessPaymentResult { export class AcceptSponsorshipRequestUseCase { constructor( - private readonly sponsorshipRequestRepo: ISponsorshipRequestRepository, - private readonly seasonSponsorshipRepo: ISeasonSponsorshipRepository, - private readonly seasonRepository: ISeasonRepository, + private readonly sponsorshipRequestRepo: SponsorshipRequestRepository, + private readonly seasonSponsorshipRepo: SeasonSponsorshipRepository, + private readonly seasonRepository: SeasonRepository, private readonly notificationService: NotificationService, private readonly paymentProcessor: (input: ProcessPaymentInput) => Promise, - private readonly walletRepository: IWalletRepository, - private readonly leagueWalletRepository: ILeagueWalletRepository, + private readonly walletRepository: WalletRepository, + private readonly leagueWalletRepository: LeagueWalletRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/AppendTeamRatingEventsUseCase.ts b/core/racing/application/use-cases/AppendTeamRatingEventsUseCase.ts index 407c20b97..e23c91582 100644 --- a/core/racing/application/use-cases/AppendTeamRatingEventsUseCase.ts +++ b/core/racing/application/use-cases/AppendTeamRatingEventsUseCase.ts @@ -11,8 +11,8 @@ import { TeamRatingSnapshotCalculator } from '@core/racing/domain/services/TeamR */ export class AppendTeamRatingEventsUseCase { constructor( - private readonly ratingEventRepository: ITeamRatingEventRepository, - private readonly ratingRepository: ITeamRatingRepository, + private readonly ratingEventRepository: TeamRatingEventRepository, + private readonly ratingRepository: TeamRatingRepository, ) {} /** diff --git a/core/racing/application/use-cases/ApplyForSponsorshipUseCase.test.ts b/core/racing/application/use-cases/ApplyForSponsorshipUseCase.test.ts index 53d51c370..7dee2372e 100644 --- a/core/racing/application/use-cases/ApplyForSponsorshipUseCase.test.ts +++ b/core/racing/application/use-cases/ApplyForSponsorshipUseCase.test.ts @@ -40,9 +40,9 @@ describe('ApplyForSponsorshipUseCase', () => { it('should return error when sponsor does not exist', async () => { - const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as ISponsorshipRequestRepository, - mockSponsorshipPricingRepo as unknown as ISponsorshipPricingRepository, - mockSponsorRepo as unknown as ISponsorRepository, + const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as SponsorshipRequestRepository, + mockSponsorshipPricingRepo as unknown as SponsorshipPricingRepository, + mockSponsorRepo as unknown as SponsorRepository, mockLogger as unknown as Logger); mockSponsorRepo.findById.mockResolvedValue(null); @@ -61,9 +61,9 @@ describe('ApplyForSponsorshipUseCase', () => { it('should return error when sponsorship pricing is not set up', async () => { - const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as ISponsorshipRequestRepository, - mockSponsorshipPricingRepo as unknown as ISponsorshipPricingRepository, - mockSponsorRepo as unknown as ISponsorRepository, + const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as SponsorshipRequestRepository, + mockSponsorshipPricingRepo as unknown as SponsorshipPricingRepository, + mockSponsorRepo as unknown as SponsorRepository, mockLogger as unknown as Logger); mockSponsorRepo.findById.mockResolvedValue({ id: 'sponsor1' }); @@ -83,9 +83,9 @@ describe('ApplyForSponsorshipUseCase', () => { it('should return error when entity is not accepting applications', async () => { - const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as ISponsorshipRequestRepository, - mockSponsorshipPricingRepo as unknown as ISponsorshipPricingRepository, - mockSponsorRepo as unknown as ISponsorRepository, + const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as SponsorshipRequestRepository, + mockSponsorshipPricingRepo as unknown as SponsorshipPricingRepository, + mockSponsorRepo as unknown as SponsorRepository, mockLogger as unknown as Logger); mockSponsorRepo.findById.mockResolvedValue({ id: 'sponsor1' }); @@ -109,9 +109,9 @@ describe('ApplyForSponsorshipUseCase', () => { it('should return error when no slots are available', async () => { - const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as ISponsorshipRequestRepository, - mockSponsorshipPricingRepo as unknown as ISponsorshipPricingRepository, - mockSponsorRepo as unknown as ISponsorRepository, + const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as SponsorshipRequestRepository, + mockSponsorshipPricingRepo as unknown as SponsorshipPricingRepository, + mockSponsorRepo as unknown as SponsorRepository, mockLogger as unknown as Logger); mockSponsorRepo.findById.mockResolvedValue({ id: 'sponsor1' }); @@ -135,9 +135,9 @@ describe('ApplyForSponsorshipUseCase', () => { it('should return error when sponsor has pending request', async () => { - const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as ISponsorshipRequestRepository, - mockSponsorshipPricingRepo as unknown as ISponsorshipPricingRepository, - mockSponsorRepo as unknown as ISponsorRepository, + const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as SponsorshipRequestRepository, + mockSponsorshipPricingRepo as unknown as SponsorshipPricingRepository, + mockSponsorRepo as unknown as SponsorRepository, mockLogger as unknown as Logger); mockSponsorRepo.findById.mockResolvedValue({ id: 'sponsor1' }); @@ -162,9 +162,9 @@ describe('ApplyForSponsorshipUseCase', () => { it('should return error when offered amount is less than minimum', async () => { - const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as ISponsorshipRequestRepository, - mockSponsorshipPricingRepo as unknown as ISponsorshipPricingRepository, - mockSponsorRepo as unknown as ISponsorRepository, + const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as SponsorshipRequestRepository, + mockSponsorshipPricingRepo as unknown as SponsorshipPricingRepository, + mockSponsorRepo as unknown as SponsorRepository, mockLogger as unknown as Logger); mockSponsorRepo.findById.mockResolvedValue({ id: 'sponsor1' }); @@ -189,9 +189,9 @@ describe('ApplyForSponsorshipUseCase', () => { it('should create sponsorship request and return result on success', async () => { - const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as ISponsorshipRequestRepository, - mockSponsorshipPricingRepo as unknown as ISponsorshipPricingRepository, - mockSponsorRepo as unknown as ISponsorRepository, + const useCase = new ApplyForSponsorshipUseCase(mockSponsorshipRequestRepo as unknown as SponsorshipRequestRepository, + mockSponsorshipPricingRepo as unknown as SponsorshipPricingRepository, + mockSponsorRepo as unknown as SponsorRepository, mockLogger as unknown as Logger); mockSponsorRepo.findById.mockResolvedValue({ id: 'sponsor1' }); diff --git a/core/racing/application/use-cases/ApplyForSponsorshipUseCase.ts b/core/racing/application/use-cases/ApplyForSponsorshipUseCase.ts index 2f5f8731b..be50c82eb 100644 --- a/core/racing/application/use-cases/ApplyForSponsorshipUseCase.ts +++ b/core/racing/application/use-cases/ApplyForSponsorshipUseCase.ts @@ -29,9 +29,9 @@ export interface ApplyForSponsorshipResult { export class ApplyForSponsorshipUseCase { constructor( - private readonly sponsorshipRequestRepo: ISponsorshipRequestRepository, - private readonly sponsorshipPricingRepo: ISponsorshipPricingRepository, - private readonly sponsorRepo: ISponsorRepository, + private readonly sponsorshipRequestRepo: SponsorshipRequestRepository, + private readonly sponsorshipPricingRepo: SponsorshipPricingRepository, + private readonly sponsorRepo: SponsorRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/ApplyPenaltyUseCase.ts b/core/racing/application/use-cases/ApplyPenaltyUseCase.ts index d3bd70d88..96939ff9b 100644 --- a/core/racing/application/use-cases/ApplyPenaltyUseCase.ts +++ b/core/racing/application/use-cases/ApplyPenaltyUseCase.ts @@ -28,10 +28,10 @@ export interface ApplyPenaltyResult { export class ApplyPenaltyUseCase { constructor( - private readonly penaltyRepository: IPenaltyRepository, - private readonly protestRepository: IProtestRepository, - private readonly raceRepository: IRaceRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, + private readonly penaltyRepository: PenaltyRepository, + private readonly protestRepository: ProtestRepository, + private readonly raceRepository: RaceRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/ApproveLeagueJoinRequestUseCase.test.ts b/core/racing/application/use-cases/ApproveLeagueJoinRequestUseCase.test.ts index 55f0e63a7..ca553ddf5 100644 --- a/core/racing/application/use-cases/ApproveLeagueJoinRequestUseCase.test.ts +++ b/core/racing/application/use-cases/ApproveLeagueJoinRequestUseCase.test.ts @@ -33,8 +33,8 @@ describe('ApproveLeagueJoinRequestUseCase', () => { it('approve removes request and adds member', async () => { - const useCase = new ApproveLeagueJoinRequestUseCase(mockLeagueMembershipRepo as unknown as ILeagueMembershipRepository, - mockLeagueRepo as unknown as ILeagueRepository); + const useCase = new ApproveLeagueJoinRequestUseCase(mockLeagueMembershipRepo as unknown as LeagueMembershipRepository, + mockLeagueRepo as unknown as LeagueRepository); const leagueId = 'league-1'; const joinRequestId = 'req-1'; @@ -83,8 +83,8 @@ describe('ApproveLeagueJoinRequestUseCase', () => { it('approve returns error when request missing', async () => { - const useCase = new ApproveLeagueJoinRequestUseCase(mockLeagueMembershipRepo as unknown as ILeagueMembershipRepository, - mockLeagueRepo as unknown as ILeagueRepository); + const useCase = new ApproveLeagueJoinRequestUseCase(mockLeagueMembershipRepo as unknown as LeagueMembershipRepository, + mockLeagueRepo as unknown as LeagueRepository); mockLeagueRepo.findById.mockResolvedValue( League.create({ @@ -112,8 +112,8 @@ describe('ApproveLeagueJoinRequestUseCase', () => { it('rejects approval when league is at capacity and does not mutate state', async () => { - const useCase = new ApproveLeagueJoinRequestUseCase(mockLeagueMembershipRepo as unknown as ILeagueMembershipRepository, - mockLeagueRepo as unknown as ILeagueRepository); + const useCase = new ApproveLeagueJoinRequestUseCase(mockLeagueMembershipRepo as unknown as LeagueMembershipRepository, + mockLeagueRepo as unknown as LeagueRepository); const leagueId = 'league-1'; const joinRequestId = 'req-1'; diff --git a/core/racing/application/use-cases/ApproveLeagueJoinRequestUseCase.ts b/core/racing/application/use-cases/ApproveLeagueJoinRequestUseCase.ts index 18c98e3c6..716957ea2 100644 --- a/core/racing/application/use-cases/ApproveLeagueJoinRequestUseCase.ts +++ b/core/racing/application/use-cases/ApproveLeagueJoinRequestUseCase.ts @@ -21,8 +21,8 @@ export interface ApproveLeagueJoinRequestResult { export class ApproveLeagueJoinRequestUseCase { constructor( - private readonly leagueMembershipRepository: ILeagueMembershipRepository, - private readonly leagueRepository: ILeagueRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, + private readonly leagueRepository: LeagueRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/ApproveTeamJoinRequestUseCase.test.ts b/core/racing/application/use-cases/ApproveTeamJoinRequestUseCase.test.ts index dda537f74..f4509d683 100644 --- a/core/racing/application/use-cases/ApproveTeamJoinRequestUseCase.test.ts +++ b/core/racing/application/use-cases/ApproveTeamJoinRequestUseCase.test.ts @@ -17,7 +17,7 @@ describe('ApproveTeamJoinRequestUseCase', () => { saveMembership: vi.fn(), }; useCase = new ApproveTeamJoinRequestUseCase( - membershipRepository as unknown as ITeamMembershipRepository, + membershipRepository as unknown as TeamMembershipRepository, ); }); diff --git a/core/racing/application/use-cases/ApproveTeamJoinRequestUseCase.ts b/core/racing/application/use-cases/ApproveTeamJoinRequestUseCase.ts index 840da77a5..ea0ebec9e 100644 --- a/core/racing/application/use-cases/ApproveTeamJoinRequestUseCase.ts +++ b/core/racing/application/use-cases/ApproveTeamJoinRequestUseCase.ts @@ -23,7 +23,7 @@ export type ApproveTeamJoinRequestErrorCode = export class ApproveTeamJoinRequestUseCase { constructor( - private readonly membershipRepository: ITeamMembershipRepository, + private readonly membershipRepository: TeamMembershipRepository, ) {} async execute(command: ApproveTeamJoinRequestInput): Promise< diff --git a/core/racing/application/use-cases/CancelRaceUseCase.ts b/core/racing/application/use-cases/CancelRaceUseCase.ts index f60a3a5e1..10829ec60 100644 --- a/core/racing/application/use-cases/CancelRaceUseCase.ts +++ b/core/racing/application/use-cases/CancelRaceUseCase.ts @@ -24,7 +24,7 @@ export type CancelRaceResult = { */ export class CancelRaceUseCase { constructor( - private readonly raceRepository: IRaceRepository, + private readonly raceRepository: RaceRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/CloseRaceEventStewardingUseCase.ts b/core/racing/application/use-cases/CloseRaceEventStewardingUseCase.ts index d18be8d04..91eed1a8b 100644 --- a/core/racing/application/use-cases/CloseRaceEventStewardingUseCase.ts +++ b/core/racing/application/use-cases/CloseRaceEventStewardingUseCase.ts @@ -26,9 +26,9 @@ export type CloseRaceEventStewardingResult = { export class CloseRaceEventStewardingUseCase { constructor( private readonly logger: Logger, - private readonly raceEventRepository: IRaceEventRepository, - private readonly raceRegistrationRepository: IRaceRegistrationRepository, - private readonly penaltyRepository: IPenaltyRepository, + private readonly raceEventRepository: RaceEventRepository, + private readonly raceRegistrationRepository: RaceRegistrationRepository, + private readonly penaltyRepository: PenaltyRepository, private readonly domainEventPublisher: DomainEventPublisher, ) {} diff --git a/core/racing/application/use-cases/CompleteDriverOnboardingUseCase.test.ts b/core/racing/application/use-cases/CompleteDriverOnboardingUseCase.test.ts index fd47d1661..e212ed421 100644 --- a/core/racing/application/use-cases/CompleteDriverOnboardingUseCase.test.ts +++ b/core/racing/application/use-cases/CompleteDriverOnboardingUseCase.test.ts @@ -31,7 +31,7 @@ describe('CompleteDriverOnboardingUseCase', () => { error: vi.fn(), } as unknown as Logger & { error: Mock }; output = { present: vi.fn() } as unknown as typeof output; - useCase = new CompleteDriverOnboardingUseCase(driverRepository as unknown as IDriverRepository, + useCase = new CompleteDriverOnboardingUseCase(driverRepository as unknown as DriverRepository, logger); }); diff --git a/core/racing/application/use-cases/CompleteDriverOnboardingUseCase.ts b/core/racing/application/use-cases/CompleteDriverOnboardingUseCase.ts index 5f268c280..96a511103 100644 --- a/core/racing/application/use-cases/CompleteDriverOnboardingUseCase.ts +++ b/core/racing/application/use-cases/CompleteDriverOnboardingUseCase.ts @@ -31,7 +31,7 @@ export type CompleteDriverOnboardingApplicationError = ApplicationErrorCode< */ export class CompleteDriverOnboardingUseCase { constructor( - private readonly driverRepository: IDriverRepository, + private readonly driverRepository: DriverRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/CompleteRaceUseCase.ts b/core/racing/application/use-cases/CompleteRaceUseCase.ts index ae826f2d1..15ccd5ac6 100644 --- a/core/racing/application/use-cases/CompleteRaceUseCase.ts +++ b/core/racing/application/use-cases/CompleteRaceUseCase.ts @@ -40,10 +40,10 @@ interface DriverRatingOutput { export class CompleteRaceUseCase { constructor( - private readonly raceRepository: IRaceRepository, - private readonly raceRegistrationRepository: IRaceRegistrationRepository, - private readonly resultRepository: IResultRepository, - private readonly standingRepository: IStandingRepository, + private readonly raceRepository: RaceRepository, + private readonly raceRegistrationRepository: RaceRegistrationRepository, + private readonly resultRepository: ResultRepository, + private readonly standingRepository: StandingRepository, private readonly getDriverRating: (input: DriverRatingInput) => Promise, ) {} diff --git a/core/racing/application/use-cases/CompleteRaceUseCaseWithRatings.test.ts b/core/racing/application/use-cases/CompleteRaceUseCaseWithRatings.test.ts index 06ded6556..c3e22e512 100644 --- a/core/racing/application/use-cases/CompleteRaceUseCaseWithRatings.test.ts +++ b/core/racing/application/use-cases/CompleteRaceUseCaseWithRatings.test.ts @@ -69,10 +69,10 @@ describe('CompleteRaceUseCaseWithRatings', () => { // Test without raceResultsProvider (backward compatible mode) useCase = new CompleteRaceUseCaseWithRatings( - raceRepository as unknown as IRaceRepository, - raceRegistrationRepository as unknown as IRaceRegistrationRepository, - resultRepository as unknown as IResultRepository, - standingRepository as unknown as IStandingRepository, + raceRepository as unknown as RaceRepository, + raceRegistrationRepository as unknown as RaceRegistrationRepository, + resultRepository as unknown as ResultRepository, + standingRepository as unknown as StandingRepository, driverRatingProvider, ratingUpdateService as unknown as RatingUpdateService, ); @@ -232,13 +232,13 @@ describe('CompleteRaceUseCaseWithRatings', () => { beforeEach(() => { // Create use case with raceResultsProvider for ledger mode useCaseWithLedger = new CompleteRaceUseCaseWithRatings( - raceRepository as unknown as IRaceRepository, - raceRegistrationRepository as unknown as IRaceRegistrationRepository, - resultRepository as unknown as IResultRepository, - standingRepository as unknown as IStandingRepository, + raceRepository as unknown as RaceRepository, + raceRegistrationRepository as unknown as RaceRegistrationRepository, + resultRepository as unknown as ResultRepository, + standingRepository as unknown as StandingRepository, driverRatingProvider, ratingUpdateService as unknown as RatingUpdateService, - raceResultsProvider as unknown as IRaceResultsProvider, + raceResultsProvider as unknown as RaceResultsProvider, ); }); diff --git a/core/racing/application/use-cases/CompleteRaceUseCaseWithRatings.ts b/core/racing/application/use-cases/CompleteRaceUseCaseWithRatings.ts index 09ef1d3f5..7df522329 100644 --- a/core/racing/application/use-cases/CompleteRaceUseCaseWithRatings.ts +++ b/core/racing/application/use-cases/CompleteRaceUseCaseWithRatings.ts @@ -35,13 +35,13 @@ interface DriverRatingProvider { * EVOLVED (Slice 7): Now uses ledger-based rating updates for transparency and auditability. */ export class CompleteRaceUseCaseWithRatings { - constructor(private readonly raceRepository: IRaceRepository, - private readonly raceRegistrationRepository: IRaceRegistrationRepository, - private readonly resultRepository: IResultRepository, - private readonly standingRepository: IStandingRepository, + constructor(private readonly raceRepository: RaceRepository, + private readonly raceRegistrationRepository: RaceRegistrationRepository, + private readonly resultRepository: ResultRepository, + private readonly standingRepository: StandingRepository, private readonly driverRatingProvider: DriverRatingProvider, private readonly ratingUpdateService: RatingUpdateService, - private readonly raceResultsProvider?: IRaceResultsProvider, // Optional: for new ledger flow + private readonly raceResultsProvider?: RaceResultsProvider, // Optional: for new ledger flow ) {} async execute(command: CompleteRaceWithRatingsInput): Promise< diff --git a/core/racing/application/use-cases/CreateLeagueSeasonScheduleRaceUseCase.test.ts b/core/racing/application/use-cases/CreateLeagueSeasonScheduleRaceUseCase.test.ts index edfcd4247..8bd8db195 100644 --- a/core/racing/application/use-cases/CreateLeagueSeasonScheduleRaceUseCase.test.ts +++ b/core/racing/application/use-cases/CreateLeagueSeasonScheduleRaceUseCase.test.ts @@ -48,8 +48,8 @@ describe('CreateLeagueSeasonScheduleRaceUseCase', () => { seasonRepository.findById.mockResolvedValue(season); raceRepository.create.mockImplementation(async (race: Race) => race); - const useCase = new CreateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new CreateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger, { generateRaceId: () => 'race-123' }, ); @@ -77,8 +77,8 @@ describe('CreateLeagueSeasonScheduleRaceUseCase', () => { const season = createSeasonWithinWindow({ leagueId: 'other-league' }); seasonRepository.findById.mockResolvedValue(season); - const useCase = new CreateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new CreateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger, { generateRaceId: () => 'race-123' }, ); @@ -105,8 +105,8 @@ describe('CreateLeagueSeasonScheduleRaceUseCase', () => { const season = createSeasonWithinWindow(); seasonRepository.findById.mockResolvedValue(season); - const useCase = new CreateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new CreateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger, { generateRaceId: () => 'race-123' }, ); @@ -144,8 +144,8 @@ describe('CreateLeagueSeasonScheduleRaceUseCase', () => { seasonRepository.findById.mockResolvedValue(season); raceRepository.create.mockRejectedValue(repositoryError); - const useCase = new CreateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new CreateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger, { generateRaceId: () => 'race-123' }, ); @@ -170,8 +170,8 @@ describe('CreateLeagueSeasonScheduleRaceUseCase', () => { it('returns SEASON_NOT_FOUND when season does not exist', async () => { seasonRepository.findById.mockResolvedValue(null); - const useCase = new CreateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new CreateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger, { generateRaceId: () => 'race-123' }, ); @@ -197,8 +197,8 @@ describe('CreateLeagueSeasonScheduleRaceUseCase', () => { const repositoryError = new Error('DB connection failed'); seasonRepository.findById.mockRejectedValue(repositoryError); - const useCase = new CreateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new CreateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger, { generateRaceId: () => 'race-123' }, ); diff --git a/core/racing/application/use-cases/CreateLeagueSeasonScheduleRaceUseCase.ts b/core/racing/application/use-cases/CreateLeagueSeasonScheduleRaceUseCase.ts index b09dd8834..8909cce99 100644 --- a/core/racing/application/use-cases/CreateLeagueSeasonScheduleRaceUseCase.ts +++ b/core/racing/application/use-cases/CreateLeagueSeasonScheduleRaceUseCase.ts @@ -18,8 +18,8 @@ export type CreateLeagueSeasonScheduleRaceErrorCode = export class CreateLeagueSeasonScheduleRaceUseCase { constructor( - private readonly seasonRepository: ISeasonRepository, - private readonly raceRepository: IRaceRepository, + private readonly seasonRepository: SeasonRepository, + private readonly raceRepository: RaceRepository, private readonly logger: Logger, private readonly deps: { generateRaceId: () => string }, ) {} diff --git a/core/racing/application/use-cases/CreateLeagueWithSeasonAndScoringUseCase.ts b/core/racing/application/use-cases/CreateLeagueWithSeasonAndScoringUseCase.ts index 8ce87a399..cb36a5473 100644 --- a/core/racing/application/use-cases/CreateLeagueWithSeasonAndScoringUseCase.ts +++ b/core/racing/application/use-cases/CreateLeagueWithSeasonAndScoringUseCase.ts @@ -52,9 +52,9 @@ type ScoringPreset = { export class CreateLeagueWithSeasonAndScoringUseCase { constructor( - private readonly leagueRepository: ILeagueRepository, - private readonly seasonRepository: ISeasonRepository, - private readonly leagueScoringConfigRepository: ILeagueScoringConfigRepository, + private readonly leagueRepository: LeagueRepository, + private readonly seasonRepository: SeasonRepository, + private readonly leagueScoringConfigRepository: LeagueScoringConfigRepository, private readonly getLeagueScoringPresetById: (input: { presetId: string }) => Promise, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/CreateSeasonForLeagueUseCase.ts b/core/racing/application/use-cases/CreateSeasonForLeagueUseCase.ts index 4d5a59435..be5b07878 100644 --- a/core/racing/application/use-cases/CreateSeasonForLeagueUseCase.ts +++ b/core/racing/application/use-cases/CreateSeasonForLeagueUseCase.ts @@ -96,8 +96,8 @@ type CreateSeasonForLeagueErrorCode = 'LEAGUE_NOT_FOUND' | 'VALIDATION_ERROR' | */ export class CreateSeasonForLeagueUseCase { constructor( - private readonly leagueRepository: ILeagueRepository, - private readonly seasonRepository: ISeasonRepository, + private readonly leagueRepository: LeagueRepository, + private readonly seasonRepository: SeasonRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/CreateSponsorUseCase.test.ts b/core/racing/application/use-cases/CreateSponsorUseCase.test.ts index 1721f5cd4..c63689f40 100644 --- a/core/racing/application/use-cases/CreateSponsorUseCase.test.ts +++ b/core/racing/application/use-cases/CreateSponsorUseCase.test.ts @@ -25,7 +25,7 @@ describe('CreateSponsorUseCase', () => { error: vi.fn(), }; useCase = new CreateSponsorUseCase( - sponsorRepository as unknown as ISponsorRepository, + sponsorRepository as unknown as SponsorRepository, logger as unknown as Logger, ); }); diff --git a/core/racing/application/use-cases/CreateSponsorUseCase.ts b/core/racing/application/use-cases/CreateSponsorUseCase.ts index af106c990..30b65ca6f 100644 --- a/core/racing/application/use-cases/CreateSponsorUseCase.ts +++ b/core/racing/application/use-cases/CreateSponsorUseCase.ts @@ -22,7 +22,7 @@ export type CreateSponsorResult = { export class CreateSponsorUseCase { constructor( - private readonly sponsorRepository: ISponsorRepository, + private readonly sponsorRepository: SponsorRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/CreateTeamUseCase.ts b/core/racing/application/use-cases/CreateTeamUseCase.ts index f50d1d5d2..3f7a05e1c 100644 --- a/core/racing/application/use-cases/CreateTeamUseCase.ts +++ b/core/racing/application/use-cases/CreateTeamUseCase.ts @@ -31,8 +31,8 @@ export type CreateTeamErrorCode = | 'REPOSITORY_ERROR'; export class CreateTeamUseCase { - constructor(private readonly teamRepository: ITeamRepository, - private readonly membershipRepository: ITeamMembershipRepository, + constructor(private readonly teamRepository: TeamRepository, + private readonly membershipRepository: TeamMembershipRepository, private readonly logger: Logger) {} async execute( diff --git a/core/racing/application/use-cases/DashboardOverviewUseCase.ts b/core/racing/application/use-cases/DashboardOverviewUseCase.ts index e884bfeaa..9a5b88c4c 100644 --- a/core/racing/application/use-cases/DashboardOverviewUseCase.ts +++ b/core/racing/application/use-cases/DashboardOverviewUseCase.ts @@ -83,15 +83,15 @@ export interface DashboardOverviewResult { export class DashboardOverviewUseCase { constructor( - private readonly driverRepository: IDriverRepository, - private readonly raceRepository: IRaceRepository, - private readonly resultRepository: IResultRepository, - private readonly leagueRepository: ILeagueRepository, - private readonly standingRepository: IStandingRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, - private readonly raceRegistrationRepository: IRaceRegistrationRepository, - private readonly feedRepository: IFeedRepository, - private readonly socialRepository: ISocialGraphRepository, + private readonly driverRepository: DriverRepository, + private readonly raceRepository: RaceRepository, + private readonly resultRepository: ResultRepository, + private readonly leagueRepository: LeagueRepository, + private readonly standingRepository: StandingRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, + private readonly raceRegistrationRepository: RaceRegistrationRepository, + private readonly feedRepository: FeedRepository, + private readonly socialRepository: SocialGraphRepository, private readonly getDriverAvatar: (driverId: string) => Promise, private readonly getDriverStats: ( driverId: string, diff --git a/core/racing/application/use-cases/DeleteLeagueSeasonScheduleRaceUseCase.test.ts b/core/racing/application/use-cases/DeleteLeagueSeasonScheduleRaceUseCase.test.ts index ecfd0ccfe..8c2bfffb4 100644 --- a/core/racing/application/use-cases/DeleteLeagueSeasonScheduleRaceUseCase.test.ts +++ b/core/racing/application/use-cases/DeleteLeagueSeasonScheduleRaceUseCase.test.ts @@ -57,8 +57,8 @@ describe('DeleteLeagueSeasonScheduleRaceUseCase', () => { raceRepository.findById.mockResolvedValue(existing); raceRepository.delete.mockResolvedValue(undefined); - const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -76,8 +76,8 @@ describe('DeleteLeagueSeasonScheduleRaceUseCase', () => { const season = createSeasonWithinWindow({ leagueId: 'other-league' }); seasonRepository.findById.mockResolvedValue(season); - const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -101,8 +101,8 @@ describe('DeleteLeagueSeasonScheduleRaceUseCase', () => { seasonRepository.findById.mockResolvedValue(season); raceRepository.findById.mockResolvedValue(null); - const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -133,8 +133,8 @@ describe('DeleteLeagueSeasonScheduleRaceUseCase', () => { }); raceRepository.findById.mockResolvedValue(existing); - const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -155,8 +155,8 @@ describe('DeleteLeagueSeasonScheduleRaceUseCase', () => { it('returns SEASON_NOT_FOUND when season does not exist', async () => { seasonRepository.findById.mockResolvedValue(null); - const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -179,8 +179,8 @@ describe('DeleteLeagueSeasonScheduleRaceUseCase', () => { const repositoryError = new Error('DB connection failed'); seasonRepository.findById.mockRejectedValue(repositoryError); - const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -212,8 +212,8 @@ describe('DeleteLeagueSeasonScheduleRaceUseCase', () => { raceRepository.findById.mockResolvedValue(existing); raceRepository.delete.mockRejectedValue(repositoryError); - const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -237,8 +237,8 @@ describe('DeleteLeagueSeasonScheduleRaceUseCase', () => { seasonRepository.findById.mockResolvedValue(season); raceRepository.findById.mockRejectedValue(repositoryError); - const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new DeleteLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ diff --git a/core/racing/application/use-cases/DeleteLeagueSeasonScheduleRaceUseCase.ts b/core/racing/application/use-cases/DeleteLeagueSeasonScheduleRaceUseCase.ts index 74ed6cd6f..8f0b13085 100644 --- a/core/racing/application/use-cases/DeleteLeagueSeasonScheduleRaceUseCase.ts +++ b/core/racing/application/use-cases/DeleteLeagueSeasonScheduleRaceUseCase.ts @@ -15,8 +15,8 @@ export type DeleteLeagueSeasonScheduleRaceErrorCode = export class DeleteLeagueSeasonScheduleRaceUseCase { constructor( - private readonly seasonRepository: ISeasonRepository, - private readonly raceRepository: IRaceRepository, + private readonly seasonRepository: SeasonRepository, + private readonly raceRepository: RaceRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/DriverStatsUseCase.ts b/core/racing/application/use-cases/DriverStatsUseCase.ts index 0f2f4959e..a035c42d6 100644 --- a/core/racing/application/use-cases/DriverStatsUseCase.ts +++ b/core/racing/application/use-cases/DriverStatsUseCase.ts @@ -1,5 +1,5 @@ /** - * Application Use Case Interface: IDriverStatsUseCase + * Application Use Case Interface: DriverStatsUseCase * * Use case for computing detailed driver statistics from race results and standings. * This is an application layer concern that orchestrates domain data. diff --git a/core/racing/application/use-cases/FileProtestUseCase.ts b/core/racing/application/use-cases/FileProtestUseCase.ts index 1ca7d8f94..beba1466b 100644 --- a/core/racing/application/use-cases/FileProtestUseCase.ts +++ b/core/racing/application/use-cases/FileProtestUseCase.ts @@ -33,9 +33,9 @@ export interface FileProtestResult { export class FileProtestUseCase { constructor( - private readonly protestRepository: IProtestRepository, - private readonly raceRepository: IRaceRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, + private readonly protestRepository: ProtestRepository, + private readonly raceRepository: RaceRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, ) {} async execute(command: FileProtestInput): Promise>> { diff --git a/core/racing/application/use-cases/GetAllLeaguesWithCapacityAndScoringUseCase.ts b/core/racing/application/use-cases/GetAllLeaguesWithCapacityAndScoringUseCase.ts index 2160fd0b0..fb7d48a91 100644 --- a/core/racing/application/use-cases/GetAllLeaguesWithCapacityAndScoringUseCase.ts +++ b/core/racing/application/use-cases/GetAllLeaguesWithCapacityAndScoringUseCase.ts @@ -34,11 +34,11 @@ export type GetAllLeaguesWithCapacityAndScoringErrorCode = 'REPOSITORY_ERROR'; */ export class GetAllLeaguesWithCapacityAndScoringUseCase { constructor( - private readonly leagueRepository: ILeagueRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, - private readonly seasonRepository: ISeasonRepository, - private readonly leagueScoringConfigRepository: ILeagueScoringConfigRepository, - private readonly gameRepository: IGameRepository, + private readonly leagueRepository: LeagueRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, + private readonly seasonRepository: SeasonRepository, + private readonly leagueScoringConfigRepository: LeagueScoringConfigRepository, + private readonly gameRepository: GameRepository, private readonly presetProvider: { getPresetById(presetId: string): LeagueScoringPreset | undefined }, ) {} diff --git a/core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase.test.ts b/core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase.test.ts index ed22c65ba..8bc3b41d2 100644 --- a/core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase.test.ts +++ b/core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase.test.ts @@ -17,8 +17,8 @@ describe('GetAllLeaguesWithCapacityUseCase', () => { it('should return leagues with capacity information', async () => { const useCase = new GetAllLeaguesWithCapacityUseCase( - mockLeagueRepo as unknown as ILeagueRepository, - mockMembershipRepo as unknown as ILeagueMembershipRepository, + mockLeagueRepo as unknown as LeagueRepository, + mockMembershipRepo as unknown as LeagueMembershipRepository, ); const league1 = { id: 'league1', name: 'Test League 1', settings: { maxDrivers: 10 } }; @@ -56,8 +56,8 @@ describe('GetAllLeaguesWithCapacityUseCase', () => { it('should return empty result when no leagues', async () => { const useCase = new GetAllLeaguesWithCapacityUseCase( - mockLeagueRepo as unknown as ILeagueRepository, - mockMembershipRepo as unknown as ILeagueMembershipRepository, + mockLeagueRepo as unknown as LeagueRepository, + mockMembershipRepo as unknown as LeagueMembershipRepository, ); mockLeagueRepo.findAll.mockResolvedValue([]); diff --git a/core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase.ts b/core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase.ts index e4838ff98..eeb6f21b6 100644 --- a/core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase.ts +++ b/core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase.ts @@ -24,8 +24,8 @@ export type GetAllLeaguesWithCapacityErrorCode = 'REPOSITORY_ERROR'; */ export class GetAllLeaguesWithCapacityUseCase { constructor( - private readonly leagueRepository: ILeagueRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, + private readonly leagueRepository: LeagueRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetAllRacesPageDataUseCase.ts b/core/racing/application/use-cases/GetAllRacesPageDataUseCase.ts index 602533be5..3b88e82c5 100644 --- a/core/racing/application/use-cases/GetAllRacesPageDataUseCase.ts +++ b/core/racing/application/use-cases/GetAllRacesPageDataUseCase.ts @@ -29,8 +29,8 @@ export type GetAllRacesPageDataErrorCode = 'REPOSITORY_ERROR'; export class GetAllRacesPageDataUseCase { constructor( - private readonly raceRepository: IRaceRepository, - private readonly leagueRepository: ILeagueRepository, + private readonly raceRepository: RaceRepository, + private readonly leagueRepository: LeagueRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/GetAllRacesUseCase.ts b/core/racing/application/use-cases/GetAllRacesUseCase.ts index 7a5f18373..414af5a3c 100644 --- a/core/racing/application/use-cases/GetAllRacesUseCase.ts +++ b/core/racing/application/use-cases/GetAllRacesUseCase.ts @@ -15,8 +15,8 @@ export type GetAllRacesErrorCode = 'REPOSITORY_ERROR'; export class GetAllRacesUseCase { constructor( - private readonly raceRepository: IRaceRepository, - private readonly leagueRepository: ILeagueRepository, + private readonly raceRepository: RaceRepository, + private readonly leagueRepository: LeagueRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/GetAllTeamsUseCase.ts b/core/racing/application/use-cases/GetAllTeamsUseCase.ts index ad3e91a2a..968de87fb 100644 --- a/core/racing/application/use-cases/GetAllTeamsUseCase.ts +++ b/core/racing/application/use-cases/GetAllTeamsUseCase.ts @@ -30,9 +30,9 @@ export interface GetAllTeamsResult { export class GetAllTeamsUseCase { constructor( - private readonly teamRepository: ITeamRepository, - private readonly membershipRepository: ITeamMembershipRepository, - private readonly statsRepository: ITeamStatsRepository, + private readonly teamRepository: TeamRepository, + private readonly membershipRepository: TeamMembershipRepository, + private readonly statsRepository: TeamStatsRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/GetDriverLiveriesUseCase.test.ts b/core/racing/application/use-cases/GetDriverLiveriesUseCase.test.ts index 6dcda03b4..3bedb3078 100644 --- a/core/racing/application/use-cases/GetDriverLiveriesUseCase.test.ts +++ b/core/racing/application/use-cases/GetDriverLiveriesUseCase.test.ts @@ -4,7 +4,7 @@ import type { DriverLivery } from '../../domain/entities/DriverLivery'; import { GetDriverLiveriesUseCase, type GetDriverLiveriesInput } from './GetDriverLiveriesUseCase'; describe('GetDriverLiveriesUseCase', () => { - const mockLiveryRepository: ILiveryRepository = { + const mockLiveryRepository: LiveryRepository = { findDriverLiveryById: vi.fn(), findDriverLiveriesByDriverId: vi.fn(), findDriverLiveryByDriverAndCar: vi.fn(), diff --git a/core/racing/application/use-cases/GetDriverLiveriesUseCase.ts b/core/racing/application/use-cases/GetDriverLiveriesUseCase.ts index 1090296a7..f80e35015 100644 --- a/core/racing/application/use-cases/GetDriverLiveriesUseCase.ts +++ b/core/racing/application/use-cases/GetDriverLiveriesUseCase.ts @@ -20,7 +20,7 @@ export type GetDriverLiveriesErrorCode = 'REPOSITORY_ERROR'; export class GetDriverLiveriesUseCase implements UseCase { constructor( - private readonly liveryRepository: ILiveryRepository, + private readonly liveryRepository: LiveryRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/GetDriverTeamUseCase.ts b/core/racing/application/use-cases/GetDriverTeamUseCase.ts index 748d74956..d52abbbe2 100644 --- a/core/racing/application/use-cases/GetDriverTeamUseCase.ts +++ b/core/racing/application/use-cases/GetDriverTeamUseCase.ts @@ -18,8 +18,8 @@ export interface GetDriverTeamResult { export class GetDriverTeamUseCase { constructor( - private readonly teamRepository: ITeamRepository, - private readonly membershipRepository: ITeamMembershipRepository, + private readonly teamRepository: TeamRepository, + private readonly membershipRepository: TeamMembershipRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/GetDriverUseCase.ts b/core/racing/application/use-cases/GetDriverUseCase.ts index 4a317f3c6..167c80982 100644 --- a/core/racing/application/use-cases/GetDriverUseCase.ts +++ b/core/racing/application/use-cases/GetDriverUseCase.ts @@ -7,7 +7,7 @@ export type GetDriverInput = { }; export class GetDriverUseCase { - constructor(private readonly driverRepository: IDriverRepository) {} + constructor(private readonly driverRepository: DriverRepository) {} async execute(input: GetDriverInput): Promise> { try { diff --git a/core/racing/application/use-cases/GetDriversLeaderboardUseCase.test.ts b/core/racing/application/use-cases/GetDriversLeaderboardUseCase.test.ts index 16fd46812..46f0e9874 100644 --- a/core/racing/application/use-cases/GetDriversLeaderboardUseCase.test.ts +++ b/core/racing/application/use-cases/GetDriversLeaderboardUseCase.test.ts @@ -7,7 +7,7 @@ import { describe('GetDriversLeaderboardUseCase', () => { const mockDriverFindAll = vi.fn(); - const mockDriverRepo: IDriverRepository = { + const mockDriverRepo: DriverRepository = { findById: vi.fn(), findByIRacingId: vi.fn(), existsByIRacingId: vi.fn(), @@ -19,12 +19,12 @@ describe('GetDriversLeaderboardUseCase', () => { }; const mockRankingGetAllDriverRankings = vi.fn(); - const mockRankingUseCase: IRankingUseCase = { + const mockRankingUseCase: RankingUseCase = { getAllDriverRankings: mockRankingGetAllDriverRankings, }; const mockDriverStatsGetDriverStats = vi.fn(); - const mockDriverStatsUseCase: IDriverStatsUseCase = { + const mockDriverStatsUseCase: DriverStatsUseCase = { getDriverStats: mockDriverStatsGetDriverStats, }; diff --git a/core/racing/application/use-cases/GetDriversLeaderboardUseCase.ts b/core/racing/application/use-cases/GetDriversLeaderboardUseCase.ts index 5babdcf4c..e0adecd49 100644 --- a/core/racing/application/use-cases/GetDriversLeaderboardUseCase.ts +++ b/core/racing/application/use-cases/GetDriversLeaderboardUseCase.ts @@ -1,4 +1,5 @@ -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; import type { Driver } from '../../domain/entities/Driver'; @@ -45,9 +46,9 @@ export type GetDriversLeaderboardErrorCode = */ export class GetDriversLeaderboardUseCase implements UseCase { constructor( - private readonly driverRepository: IDriverRepository, - private readonly rankingUseCase: IRankingUseCase, - private readonly driverStatsUseCase: IDriverStatsUseCase, + private readonly driverRepository: DriverRepository, + private readonly rankingUseCase: RankingUseCase, + private readonly driverStatsUseCase: DriverStatsUseCase, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/GetEntitySponsorshipPricingUseCase.ts b/core/racing/application/use-cases/GetEntitySponsorshipPricingUseCase.ts index 572d883bb..bd528e39a 100644 --- a/core/racing/application/use-cases/GetEntitySponsorshipPricingUseCase.ts +++ b/core/racing/application/use-cases/GetEntitySponsorshipPricingUseCase.ts @@ -39,7 +39,7 @@ export type GetEntitySponsorshipPricingErrorCode = | 'REPOSITORY_ERROR'; export class GetEntitySponsorshipPricingUseCase { - constructor(private readonly sponsorshipPricingRepo: ISponsorshipPricingRepository, + constructor(private readonly sponsorshipPricingRepo: SponsorshipPricingRepository, private readonly logger: Logger) {} async execute( diff --git a/core/racing/application/use-cases/GetLeagueAdminPermissionsUseCase.ts b/core/racing/application/use-cases/GetLeagueAdminPermissionsUseCase.ts index 2a4c1f877..6a6d05107 100644 --- a/core/racing/application/use-cases/GetLeagueAdminPermissionsUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueAdminPermissionsUseCase.ts @@ -23,8 +23,8 @@ export type GetLeagueAdminPermissionsErrorCode = export class GetLeagueAdminPermissionsUseCase { constructor( - private readonly leagueRepository: ILeagueRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, + private readonly leagueRepository: LeagueRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/GetLeagueAdminUseCase.ts b/core/racing/application/use-cases/GetLeagueAdminUseCase.ts index 54340d647..7dc7164d6 100644 --- a/core/racing/application/use-cases/GetLeagueAdminUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueAdminUseCase.ts @@ -15,7 +15,7 @@ export type GetLeagueAdminErrorCode = 'LEAGUE_NOT_FOUND' | 'REPOSITORY_ERROR'; export class GetLeagueAdminUseCase { constructor( - private readonly leagueRepository: ILeagueRepository, + private readonly leagueRepository: LeagueRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetLeagueDriverSeasonStatsUseCase.ts b/core/racing/application/use-cases/GetLeagueDriverSeasonStatsUseCase.ts index 67f25613e..20b080835 100644 --- a/core/racing/application/use-cases/GetLeagueDriverSeasonStatsUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueDriverSeasonStatsUseCase.ts @@ -48,11 +48,11 @@ export type GetLeagueDriverSeasonStatsErrorCode = * Orchestrates domain logic and returns the result. */ export class GetLeagueDriverSeasonStatsUseCase { - constructor(private readonly standingRepository: IStandingRepository, - private readonly resultRepository: IResultRepository, - private readonly penaltyRepository: IPenaltyRepository, - private readonly raceRepository: IRaceRepository, - private readonly driverRepository: IDriverRepository, + constructor(private readonly standingRepository: StandingRepository, + private readonly resultRepository: ResultRepository, + private readonly penaltyRepository: PenaltyRepository, + private readonly raceRepository: RaceRepository, + private readonly driverRepository: DriverRepository, private readonly driverRatingPort: DriverRatingPort) {} async execute( diff --git a/core/racing/application/use-cases/GetLeagueFullConfigUseCase.ts b/core/racing/application/use-cases/GetLeagueFullConfigUseCase.ts index d092bb153..39b217430 100644 --- a/core/racing/application/use-cases/GetLeagueFullConfigUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueFullConfigUseCase.ts @@ -27,10 +27,10 @@ export type GetLeagueFullConfigErrorCode = 'LEAGUE_NOT_FOUND' | 'REPOSITORY_ERRO * Orchestrates domain logic and returns the configuration data. */ export class GetLeagueFullConfigUseCase { - constructor(private readonly leagueRepository: ILeagueRepository, - private readonly seasonRepository: ISeasonRepository, - private readonly leagueScoringConfigRepository: ILeagueScoringConfigRepository, - private readonly gameRepository: IGameRepository) {} + constructor(private readonly leagueRepository: LeagueRepository, + private readonly seasonRepository: SeasonRepository, + private readonly leagueScoringConfigRepository: LeagueScoringConfigRepository, + private readonly gameRepository: GameRepository) {} async execute( input: GetLeagueFullConfigInput, diff --git a/core/racing/application/use-cases/GetLeagueJoinRequestsUseCase.test.ts b/core/racing/application/use-cases/GetLeagueJoinRequestsUseCase.test.ts index 566a15093..ca388ea94 100644 --- a/core/racing/application/use-cases/GetLeagueJoinRequestsUseCase.test.ts +++ b/core/racing/application/use-cases/GetLeagueJoinRequestsUseCase.test.ts @@ -35,9 +35,9 @@ describe('GetLeagueJoinRequestsUseCase', () => { }; useCase = new GetLeagueJoinRequestsUseCase( - leagueMembershipRepository as unknown as ILeagueMembershipRepository, - driverRepository as unknown as IDriverRepository, - leagueRepository as unknown as ILeagueRepository, + leagueMembershipRepository as unknown as LeagueMembershipRepository, + driverRepository as unknown as DriverRepository, + leagueRepository as unknown as LeagueRepository, ); }); diff --git a/core/racing/application/use-cases/GetLeagueJoinRequestsUseCase.ts b/core/racing/application/use-cases/GetLeagueJoinRequestsUseCase.ts index 20accd76f..65568ff9a 100644 --- a/core/racing/application/use-cases/GetLeagueJoinRequestsUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueJoinRequestsUseCase.ts @@ -26,9 +26,9 @@ export interface GetLeagueJoinRequestsResult { export class GetLeagueJoinRequestsUseCase { constructor( - private readonly leagueMembershipRepository: ILeagueMembershipRepository, - private readonly driverRepository: IDriverRepository, - private readonly leagueRepository: ILeagueRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, + private readonly driverRepository: DriverRepository, + private readonly leagueRepository: LeagueRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetLeagueMembershipsUseCase.ts b/core/racing/application/use-cases/GetLeagueMembershipsUseCase.ts index dbb7a6c54..6f1ab70f5 100644 --- a/core/racing/application/use-cases/GetLeagueMembershipsUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueMembershipsUseCase.ts @@ -25,9 +25,9 @@ export interface GetLeagueMembershipsResult { export class GetLeagueMembershipsUseCase { constructor( - private readonly leagueMembershipRepository: ILeagueMembershipRepository, - private readonly driverRepository: IDriverRepository, - private readonly leagueRepository: ILeagueRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, + private readonly driverRepository: DriverRepository, + private readonly leagueRepository: LeagueRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetLeagueOwnerSummaryUseCase.ts b/core/racing/application/use-cases/GetLeagueOwnerSummaryUseCase.ts index 1405168e5..3a818c60c 100644 --- a/core/racing/application/use-cases/GetLeagueOwnerSummaryUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueOwnerSummaryUseCase.ts @@ -24,10 +24,10 @@ export interface GetLeagueOwnerSummaryResult { export class GetLeagueOwnerSummaryUseCase { constructor( - private readonly leagueRepository: ILeagueRepository, - private readonly driverRepository: IDriverRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, - private readonly standingRepository: IStandingRepository, + private readonly leagueRepository: LeagueRepository, + private readonly driverRepository: DriverRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, + private readonly standingRepository: StandingRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetLeagueProtestsUseCase.test.ts b/core/racing/application/use-cases/GetLeagueProtestsUseCase.test.ts index da9d06ca8..436d62076 100644 --- a/core/racing/application/use-cases/GetLeagueProtestsUseCase.test.ts +++ b/core/racing/application/use-cases/GetLeagueProtestsUseCase.test.ts @@ -42,10 +42,10 @@ describe('GetLeagueProtestsUseCase', () => { leagueRepository = { findById: vi.fn(), }; - useCase = new GetLeagueProtestsUseCase(raceRepository as unknown as IRaceRepository, - protestRepository as unknown as IProtestRepository, - driverRepository as unknown as IDriverRepository, - leagueRepository as unknown as ILeagueRepository); + useCase = new GetLeagueProtestsUseCase(raceRepository as unknown as RaceRepository, + protestRepository as unknown as ProtestRepository, + driverRepository as unknown as DriverRepository, + leagueRepository as unknown as LeagueRepository); }); it('should return protests with races and drivers', async () => { diff --git a/core/racing/application/use-cases/GetLeagueProtestsUseCase.ts b/core/racing/application/use-cases/GetLeagueProtestsUseCase.ts index 36d786d99..8425fa9f0 100644 --- a/core/racing/application/use-cases/GetLeagueProtestsUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueProtestsUseCase.ts @@ -29,10 +29,10 @@ export interface GetLeagueProtestsResult { export class GetLeagueProtestsUseCase { constructor( - private readonly raceRepository: IRaceRepository, - private readonly protestRepository: IProtestRepository, - private readonly driverRepository: IDriverRepository, - private readonly leagueRepository: ILeagueRepository, + private readonly raceRepository: RaceRepository, + private readonly protestRepository: ProtestRepository, + private readonly driverRepository: DriverRepository, + private readonly leagueRepository: LeagueRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase.test.ts b/core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase.test.ts index b31bc8830..c7a2d8135 100644 --- a/core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase.test.ts +++ b/core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase.test.ts @@ -38,9 +38,9 @@ describe('GetLeagueRosterJoinRequestsUseCase', () => { }; useCase = new GetLeagueRosterJoinRequestsUseCase( - leagueMembershipRepository as unknown as ILeagueMembershipRepository, - driverRepository as unknown as IDriverRepository, - leagueRepository as unknown as ILeagueRepository, + leagueMembershipRepository as unknown as LeagueMembershipRepository, + driverRepository as unknown as DriverRepository, + leagueRepository as unknown as LeagueRepository, ); }); diff --git a/core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase.ts b/core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase.ts index 9bd0b7fbd..76ff05c41 100644 --- a/core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase.ts @@ -26,9 +26,9 @@ export interface GetLeagueRosterJoinRequestsResult { export class GetLeagueRosterJoinRequestsUseCase { constructor( - private readonly leagueMembershipRepository: ILeagueMembershipRepository, - private readonly driverRepository: IDriverRepository, - private readonly leagueRepository: ILeagueRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, + private readonly driverRepository: DriverRepository, + private readonly leagueRepository: LeagueRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetLeagueRosterMembersUseCase.test.ts b/core/racing/application/use-cases/GetLeagueRosterMembersUseCase.test.ts index 6437754b2..67c739997 100644 --- a/core/racing/application/use-cases/GetLeagueRosterMembersUseCase.test.ts +++ b/core/racing/application/use-cases/GetLeagueRosterMembersUseCase.test.ts @@ -39,9 +39,9 @@ describe('GetLeagueRosterMembersUseCase', () => { }; useCase = new GetLeagueRosterMembersUseCase( - leagueMembershipRepository as unknown as ILeagueMembershipRepository, - driverRepository as unknown as IDriverRepository, - leagueRepository as unknown as ILeagueRepository, + leagueMembershipRepository as unknown as LeagueMembershipRepository, + driverRepository as unknown as DriverRepository, + leagueRepository as unknown as LeagueRepository, ); }); diff --git a/core/racing/application/use-cases/GetLeagueRosterMembersUseCase.ts b/core/racing/application/use-cases/GetLeagueRosterMembersUseCase.ts index e23dce7c4..42a4533cf 100644 --- a/core/racing/application/use-cases/GetLeagueRosterMembersUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueRosterMembersUseCase.ts @@ -23,9 +23,9 @@ export interface GetLeagueRosterMembersResult { export class GetLeagueRosterMembersUseCase { constructor( - private readonly leagueMembershipRepository: ILeagueMembershipRepository, - private readonly driverRepository: IDriverRepository, - private readonly leagueRepository: ILeagueRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, + private readonly driverRepository: DriverRepository, + private readonly leagueRepository: LeagueRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetLeagueScheduleUseCase.test.ts b/core/racing/application/use-cases/GetLeagueScheduleUseCase.test.ts index f31bf5805..7a483bd07 100644 --- a/core/racing/application/use-cases/GetLeagueScheduleUseCase.test.ts +++ b/core/racing/application/use-cases/GetLeagueScheduleUseCase.test.ts @@ -41,9 +41,9 @@ describe('GetLeagueScheduleUseCase', () => { warn: vi.fn(), error: vi.fn(), } as unknown as Logger; - useCase = new GetLeagueScheduleUseCase(leagueRepository as unknown as ILeagueRepository, + useCase = new GetLeagueScheduleUseCase(leagueRepository as unknown as LeagueRepository, seasonRepository as any, - raceRepository as unknown as IRaceRepository, + raceRepository as unknown as RaceRepository, logger); }); diff --git a/core/racing/application/use-cases/GetLeagueScheduleUseCase.ts b/core/racing/application/use-cases/GetLeagueScheduleUseCase.ts index 0c9042c34..9322a30fa 100644 --- a/core/racing/application/use-cases/GetLeagueScheduleUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueScheduleUseCase.ts @@ -29,9 +29,9 @@ export interface GetLeagueScheduleResult { export class GetLeagueScheduleUseCase { constructor( - private readonly leagueRepository: ILeagueRepository, - private readonly seasonRepository: ISeasonRepository, - private readonly raceRepository: IRaceRepository, + private readonly leagueRepository: LeagueRepository, + private readonly seasonRepository: SeasonRepository, + private readonly raceRepository: RaceRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/GetLeagueScoringConfigUseCase.ts b/core/racing/application/use-cases/GetLeagueScoringConfigUseCase.ts index 38adab913..3495c9915 100644 --- a/core/racing/application/use-cases/GetLeagueScoringConfigUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueScoringConfigUseCase.ts @@ -32,10 +32,10 @@ export interface GetLeagueScoringConfigResult { export class GetLeagueScoringConfigUseCase { constructor( - private readonly leagueRepository: ILeagueRepository, - private readonly seasonRepository: ISeasonRepository, - private readonly leagueScoringConfigRepository: ILeagueScoringConfigRepository, - private readonly gameRepository: IGameRepository, + private readonly leagueRepository: LeagueRepository, + private readonly seasonRepository: SeasonRepository, + private readonly leagueScoringConfigRepository: LeagueScoringConfigRepository, + private readonly gameRepository: GameRepository, private readonly presetProvider: { getPresetById(presetId: string): LeagueScoringPreset | undefined; }, diff --git a/core/racing/application/use-cases/GetLeagueSeasonsUseCase.ts b/core/racing/application/use-cases/GetLeagueSeasonsUseCase.ts index 69c753ad2..b92aae87b 100644 --- a/core/racing/application/use-cases/GetLeagueSeasonsUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueSeasonsUseCase.ts @@ -22,8 +22,8 @@ export interface GetLeagueSeasonsResult { export class GetLeagueSeasonsUseCase { constructor( - private readonly leagueRepository: ILeagueRepository, - private readonly seasonRepository: ISeasonRepository, + private readonly leagueRepository: LeagueRepository, + private readonly seasonRepository: SeasonRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetLeagueStandingsUseCase.ts b/core/racing/application/use-cases/GetLeagueStandingsUseCase.ts index b5c0c831b..2a8b3c5a6 100644 --- a/core/racing/application/use-cases/GetLeagueStandingsUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueStandingsUseCase.ts @@ -26,8 +26,8 @@ export type GetLeagueStandingsResult = { */ export class GetLeagueStandingsUseCase { constructor( - private readonly standingRepository: IStandingRepository, - private readonly driverRepository: IDriverRepository, + private readonly standingRepository: StandingRepository, + private readonly driverRepository: DriverRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetLeagueStatsUseCase.ts b/core/racing/application/use-cases/GetLeagueStatsUseCase.ts index 9934b159b..667f569cb 100644 --- a/core/racing/application/use-cases/GetLeagueStatsUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueStatsUseCase.ts @@ -18,8 +18,8 @@ export type GetLeagueStatsErrorCode = 'LEAGUE_NOT_FOUND' | 'REPOSITORY_ERROR'; export class GetLeagueStatsUseCase { constructor( - private readonly leagueMembershipRepository: ILeagueMembershipRepository, - private readonly raceRepository: IRaceRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, + private readonly raceRepository: RaceRepository, private readonly getDriverRating: (input: { driverId: string; }) => Promise<{ rating: number | null; ratingChange: number | null }>, diff --git a/core/racing/application/use-cases/GetLeagueWalletUseCase.ts b/core/racing/application/use-cases/GetLeagueWalletUseCase.ts index bdfc993f2..b35ba8a61 100644 --- a/core/racing/application/use-cases/GetLeagueWalletUseCase.ts +++ b/core/racing/application/use-cases/GetLeagueWalletUseCase.ts @@ -35,9 +35,9 @@ export interface GetLeagueWalletResult { */ export class GetLeagueWalletUseCase { constructor( - private readonly leagueRepository: ILeagueRepository, - private readonly leagueWalletRepository: ILeagueWalletRepository, - private readonly transactionRepository: ITransactionRepository, + private readonly leagueRepository: LeagueRepository, + private readonly leagueWalletRepository: LeagueWalletRepository, + private readonly transactionRepository: TransactionRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetPendingSponsorshipRequestsUseCase.test.ts b/core/racing/application/use-cases/GetPendingSponsorshipRequestsUseCase.test.ts index 8086b65cb..6a576c24c 100644 --- a/core/racing/application/use-cases/GetPendingSponsorshipRequestsUseCase.test.ts +++ b/core/racing/application/use-cases/GetPendingSponsorshipRequestsUseCase.test.ts @@ -29,8 +29,8 @@ describe('GetPendingSponsorshipRequestsUseCase', () => { findById: vi.fn(), }; useCase = new GetPendingSponsorshipRequestsUseCase( - sponsorshipRequestRepo as unknown as ISponsorshipRequestRepository, - sponsorRepo as unknown as ISponsorRepository, + sponsorshipRequestRepo as unknown as SponsorshipRequestRepository, + sponsorRepo as unknown as SponsorRepository, ); }); diff --git a/core/racing/application/use-cases/GetPendingSponsorshipRequestsUseCase.ts b/core/racing/application/use-cases/GetPendingSponsorshipRequestsUseCase.ts index 0d5ad6889..e7e582e85 100644 --- a/core/racing/application/use-cases/GetPendingSponsorshipRequestsUseCase.ts +++ b/core/racing/application/use-cases/GetPendingSponsorshipRequestsUseCase.ts @@ -40,8 +40,8 @@ export type GetPendingSponsorshipRequestsErrorCode = 'REPOSITORY_ERROR'; export class GetPendingSponsorshipRequestsUseCase { constructor( - private readonly sponsorshipRequestRepo: ISponsorshipRequestRepository, - private readonly sponsorRepo: ISponsorRepository, + private readonly sponsorshipRequestRepo: SponsorshipRequestRepository, + private readonly sponsorRepo: SponsorRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetProfileOverviewUseCase.test.ts b/core/racing/application/use-cases/GetProfileOverviewUseCase.test.ts index d0eb508f3..0b6bcf201 100644 --- a/core/racing/application/use-cases/GetProfileOverviewUseCase.test.ts +++ b/core/racing/application/use-cases/GetProfileOverviewUseCase.test.ts @@ -60,10 +60,10 @@ describe('GetProfileOverviewUseCase', () => { getExtendedProfile: vi.fn(), }; - useCase = new GetProfileOverviewUseCase(driverRepository as unknown as IDriverRepository, - teamRepository as unknown as ITeamRepository, - teamMembershipRepository as unknown as ITeamMembershipRepository, - socialRepository as unknown as ISocialGraphRepository, + useCase = new GetProfileOverviewUseCase(driverRepository as unknown as DriverRepository, + teamRepository as unknown as TeamRepository, + teamMembershipRepository as unknown as TeamMembershipRepository, + socialRepository as unknown as SocialGraphRepository, driverExtendedProfileProvider, driverStatsUseCase as unknown as any, rankingUseCase as unknown as any); diff --git a/core/racing/application/use-cases/GetProfileOverviewUseCase.ts b/core/racing/application/use-cases/GetProfileOverviewUseCase.ts index bf669e123..0eb8239aa 100644 --- a/core/racing/application/use-cases/GetProfileOverviewUseCase.ts +++ b/core/racing/application/use-cases/GetProfileOverviewUseCase.ts @@ -72,13 +72,13 @@ export type GetProfileOverviewErrorCode = | 'REPOSITORY_ERROR'; export class GetProfileOverviewUseCase { - constructor(private readonly driverRepository: IDriverRepository, - private readonly teamRepository: ITeamRepository, - private readonly teamMembershipRepository: ITeamMembershipRepository, - private readonly socialRepository: ISocialGraphRepository, + constructor(private readonly driverRepository: DriverRepository, + private readonly teamRepository: TeamRepository, + private readonly teamMembershipRepository: TeamMembershipRepository, + private readonly socialRepository: SocialGraphRepository, private readonly driverExtendedProfileProvider: DriverExtendedProfileProvider, - private readonly driverStatsUseCase: IDriverStatsUseCase, - private readonly rankingUseCase: IRankingUseCase) {} + private readonly driverStatsUseCase: DriverStatsUseCase, + private readonly rankingUseCase: RankingUseCase) {} async execute( input: GetProfileOverviewInput, diff --git a/core/racing/application/use-cases/GetRaceDetailUseCase.test.ts b/core/racing/application/use-cases/GetRaceDetailUseCase.test.ts index 1094f3ded..5bc39f8f9 100644 --- a/core/racing/application/use-cases/GetRaceDetailUseCase.test.ts +++ b/core/racing/application/use-cases/GetRaceDetailUseCase.test.ts @@ -32,12 +32,12 @@ describe('GetRaceDetailUseCase', () => { leagueMembershipRepository = { getMembership: vi.fn() }; useCase = new GetRaceDetailUseCase( - raceRepository as unknown as IRaceRepository, - leagueRepository as unknown as ILeagueRepository, - driverRepository as unknown as IDriverRepository, - raceRegistrationRepository as unknown as IRaceRegistrationRepository, - resultRepository as unknown as IResultRepository, - leagueMembershipRepository as unknown as ILeagueMembershipRepository, + raceRepository as unknown as RaceRepository, + leagueRepository as unknown as LeagueRepository, + driverRepository as unknown as DriverRepository, + raceRegistrationRepository as unknown as RaceRegistrationRepository, + resultRepository as unknown as ResultRepository, + leagueMembershipRepository as unknown as LeagueMembershipRepository, ); }); diff --git a/core/racing/application/use-cases/GetRaceDetailUseCase.ts b/core/racing/application/use-cases/GetRaceDetailUseCase.ts index 0bd32bd5e..9293ede66 100644 --- a/core/racing/application/use-cases/GetRaceDetailUseCase.ts +++ b/core/racing/application/use-cases/GetRaceDetailUseCase.ts @@ -25,7 +25,7 @@ export type GetRaceDetailResult = { race: Race; league: League | null; registrations: RaceRegistration[]; - drivers: NonNullable>>[]; + drivers: NonNullable>>[]; userResult: RaceResult | null; isUserRegistered: boolean; canRegister: boolean; @@ -33,12 +33,12 @@ export type GetRaceDetailResult = { export class GetRaceDetailUseCase { constructor( - private readonly raceRepository: IRaceRepository, - private readonly leagueRepository: ILeagueRepository, - private readonly driverRepository: IDriverRepository, - private readonly raceRegistrationRepository: IRaceRegistrationRepository, - private readonly resultRepository: IResultRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, + private readonly raceRepository: RaceRepository, + private readonly leagueRepository: LeagueRepository, + private readonly driverRepository: DriverRepository, + private readonly raceRegistrationRepository: RaceRegistrationRepository, + private readonly resultRepository: ResultRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetRacePenaltiesUseCase.test.ts b/core/racing/application/use-cases/GetRacePenaltiesUseCase.test.ts index b7d2d2593..8dcc44ad0 100644 --- a/core/racing/application/use-cases/GetRacePenaltiesUseCase.test.ts +++ b/core/racing/application/use-cases/GetRacePenaltiesUseCase.test.ts @@ -16,8 +16,8 @@ describe('GetRacePenaltiesUseCase', () => { beforeEach(() => { penaltyRepository = { findByRaceId: vi.fn() }; driverRepository = { findById: vi.fn() }; - useCase = new GetRacePenaltiesUseCase(penaltyRepository as unknown as IPenaltyRepository, - driverRepository as unknown as IDriverRepository); + useCase = new GetRacePenaltiesUseCase(penaltyRepository as unknown as PenaltyRepository, + driverRepository as unknown as DriverRepository); }); it('should return penalties with drivers', async () => { diff --git a/core/racing/application/use-cases/GetRacePenaltiesUseCase.ts b/core/racing/application/use-cases/GetRacePenaltiesUseCase.ts index da31f6cc2..ac8d12c39 100644 --- a/core/racing/application/use-cases/GetRacePenaltiesUseCase.ts +++ b/core/racing/application/use-cases/GetRacePenaltiesUseCase.ts @@ -25,8 +25,8 @@ export type GetRacePenaltiesErrorCode = 'REPOSITORY_ERROR'; export class GetRacePenaltiesUseCase { constructor( - private readonly penaltyRepository: IPenaltyRepository, - private readonly driverRepository: IDriverRepository, + private readonly penaltyRepository: PenaltyRepository, + private readonly driverRepository: DriverRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetRaceProtestsUseCase.ts b/core/racing/application/use-cases/GetRaceProtestsUseCase.ts index e119a7939..18cacba92 100644 --- a/core/racing/application/use-cases/GetRaceProtestsUseCase.ts +++ b/core/racing/application/use-cases/GetRaceProtestsUseCase.ts @@ -25,8 +25,8 @@ export interface GetRaceProtestsResult { export class GetRaceProtestsUseCase { constructor( - private readonly protestRepository: IProtestRepository, - private readonly driverRepository: IDriverRepository, + private readonly protestRepository: ProtestRepository, + private readonly driverRepository: DriverRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetRaceRegistrationsUseCase.ts b/core/racing/application/use-cases/GetRaceRegistrationsUseCase.ts index 2397ea722..ff52910bb 100644 --- a/core/racing/application/use-cases/GetRaceRegistrationsUseCase.ts +++ b/core/racing/application/use-cases/GetRaceRegistrationsUseCase.ts @@ -22,8 +22,8 @@ export type GetRaceRegistrationsErrorCode = 'RACE_NOT_FOUND' | 'REPOSITORY_ERROR export class GetRaceRegistrationsUseCase { constructor( - private readonly raceRepository: IRaceRepository, - private readonly registrationRepository: IRaceRegistrationRepository, + private readonly raceRepository: RaceRepository, + private readonly registrationRepository: RaceRegistrationRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetRaceResultsDetailUseCase.ts b/core/racing/application/use-cases/GetRaceResultsDetailUseCase.ts index 09cae45a3..bfd1dc53b 100644 --- a/core/racing/application/use-cases/GetRaceResultsDetailUseCase.ts +++ b/core/racing/application/use-cases/GetRaceResultsDetailUseCase.ts @@ -33,11 +33,11 @@ export type GetRaceResultsDetailResult = { export class GetRaceResultsDetailUseCase { constructor( - private readonly raceRepository: IRaceRepository, - private readonly leagueRepository: ILeagueRepository, - private readonly resultRepository: IResultRepository, - private readonly driverRepository: IDriverRepository, - private readonly penaltyRepository: IPenaltyRepository, + private readonly raceRepository: RaceRepository, + private readonly leagueRepository: LeagueRepository, + private readonly resultRepository: ResultRepository, + private readonly driverRepository: DriverRepository, + private readonly penaltyRepository: PenaltyRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetRaceWithSOFUseCase.ts b/core/racing/application/use-cases/GetRaceWithSOFUseCase.ts index 4b3efa9cd..2a74f3c1b 100644 --- a/core/racing/application/use-cases/GetRaceWithSOFUseCase.ts +++ b/core/racing/application/use-cases/GetRaceWithSOFUseCase.ts @@ -36,9 +36,9 @@ export class GetRaceWithSOFUseCase { private readonly sofCalculator: StrengthOfFieldCalculator; constructor( - private readonly raceRepository: IRaceRepository, - private readonly registrationRepository: IRaceRegistrationRepository, - private readonly resultRepository: IResultRepository, + private readonly raceRepository: RaceRepository, + private readonly registrationRepository: RaceRegistrationRepository, + private readonly resultRepository: ResultRepository, private readonly getDriverRating: GetDriverRating, sofCalculator?: StrengthOfFieldCalculator, ) { diff --git a/core/racing/application/use-cases/GetRacesPageDataUseCase.test.ts b/core/racing/application/use-cases/GetRacesPageDataUseCase.test.ts index 25b6ba511..d2b5de33a 100644 --- a/core/racing/application/use-cases/GetRacesPageDataUseCase.test.ts +++ b/core/racing/application/use-cases/GetRacesPageDataUseCase.test.ts @@ -11,8 +11,8 @@ import { describe('GetRacesPageDataUseCase', () => { let useCase: GetRacesPageDataUseCase; - let raceRepository: IRaceRepository; - let leagueRepository: ILeagueRepository; + let raceRepository: RaceRepository; + let leagueRepository: LeagueRepository; let logger: Logger; beforeEach(() => { const raceFindAll = vi.fn(); @@ -30,7 +30,7 @@ describe('GetRacesPageDataUseCase', () => { update: vi.fn(), delete: vi.fn(), exists: vi.fn(), - } as unknown as IRaceRepository; + } as unknown as RaceRepository; leagueRepository = { findById: vi.fn(), @@ -41,7 +41,7 @@ describe('GetRacesPageDataUseCase', () => { delete: vi.fn(), exists: vi.fn(), searchByName: vi.fn(), - } as unknown as ILeagueRepository; + } as unknown as LeagueRepository; logger = { debug: vi.fn(), diff --git a/core/racing/application/use-cases/GetRacesPageDataUseCase.ts b/core/racing/application/use-cases/GetRacesPageDataUseCase.ts index e064a2231..a020fa5ab 100644 --- a/core/racing/application/use-cases/GetRacesPageDataUseCase.ts +++ b/core/racing/application/use-cases/GetRacesPageDataUseCase.ts @@ -18,8 +18,8 @@ export type GetRacesPageDataErrorCode = 'REPOSITORY_ERROR'; export class GetRacesPageDataUseCase { constructor( - private readonly raceRepository: IRaceRepository, - private readonly leagueRepository: ILeagueRepository, + private readonly raceRepository: RaceRepository, + private readonly leagueRepository: LeagueRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/GetSeasonDetailsUseCase.ts b/core/racing/application/use-cases/GetSeasonDetailsUseCase.ts index 71ec05430..e7eca203b 100644 --- a/core/racing/application/use-cases/GetSeasonDetailsUseCase.ts +++ b/core/racing/application/use-cases/GetSeasonDetailsUseCase.ts @@ -14,7 +14,7 @@ export interface GetSeasonDetailsResult { } export class GetSeasonDetailsUseCase { - constructor(private readonly seasonRepository: ISeasonRepository) {} + constructor(private readonly seasonRepository: SeasonRepository) {} async execute( input: GetSeasonDetailsInput, diff --git a/core/racing/application/use-cases/GetSeasonSponsorshipsUseCase.ts b/core/racing/application/use-cases/GetSeasonSponsorshipsUseCase.ts index a31b4a506..07a98d94a 100644 --- a/core/racing/application/use-cases/GetSeasonSponsorshipsUseCase.ts +++ b/core/racing/application/use-cases/GetSeasonSponsorshipsUseCase.ts @@ -50,11 +50,11 @@ export type GetSeasonSponsorshipsErrorCode = | 'REPOSITORY_ERROR'; export class GetSeasonSponsorshipsUseCase { - constructor(private readonly seasonSponsorshipRepository: ISeasonSponsorshipRepository, - private readonly seasonRepository: ISeasonRepository, - private readonly leagueRepository: ILeagueRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, - private readonly raceRepository: IRaceRepository) {} + constructor(private readonly seasonSponsorshipRepository: SeasonSponsorshipRepository, + private readonly seasonRepository: SeasonRepository, + private readonly leagueRepository: LeagueRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, + private readonly raceRepository: RaceRepository) {} async execute( input: GetSeasonSponsorshipsInput, diff --git a/core/racing/application/use-cases/GetSponsorDashboardUseCase.test.ts b/core/racing/application/use-cases/GetSponsorDashboardUseCase.test.ts index f032e286e..5893ae6cc 100644 --- a/core/racing/application/use-cases/GetSponsorDashboardUseCase.test.ts +++ b/core/racing/application/use-cases/GetSponsorDashboardUseCase.test.ts @@ -60,12 +60,12 @@ describe('GetSponsorDashboardUseCase', () => { }; useCase = new GetSponsorDashboardUseCase( - sponsorRepository as unknown as ISponsorRepository, - seasonSponsorshipRepository as unknown as ISeasonSponsorshipRepository, - seasonRepository as unknown as ISeasonRepository, - leagueRepository as unknown as ILeagueRepository, - leagueMembershipRepository as unknown as ILeagueMembershipRepository, - raceRepository as unknown as IRaceRepository, + sponsorRepository as unknown as SponsorRepository, + seasonSponsorshipRepository as unknown as SeasonSponsorshipRepository, + seasonRepository as unknown as SeasonRepository, + leagueRepository as unknown as LeagueRepository, + leagueMembershipRepository as unknown as LeagueMembershipRepository, + raceRepository as unknown as RaceRepository, ); }); diff --git a/core/racing/application/use-cases/GetSponsorDashboardUseCase.ts b/core/racing/application/use-cases/GetSponsorDashboardUseCase.ts index 126e928c2..f0eb858da 100644 --- a/core/racing/application/use-cases/GetSponsorDashboardUseCase.ts +++ b/core/racing/application/use-cases/GetSponsorDashboardUseCase.ts @@ -63,12 +63,12 @@ export type GetSponsorDashboardErrorCode = 'SPONSOR_NOT_FOUND' | 'REPOSITORY_ERR export class GetSponsorDashboardUseCase { constructor( - private readonly sponsorRepository: ISponsorRepository, - private readonly seasonSponsorshipRepository: ISeasonSponsorshipRepository, - private readonly seasonRepository: ISeasonRepository, - private readonly leagueRepository: ILeagueRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, - private readonly raceRepository: IRaceRepository, + private readonly sponsorRepository: SponsorRepository, + private readonly seasonSponsorshipRepository: SeasonSponsorshipRepository, + private readonly seasonRepository: SeasonRepository, + private readonly leagueRepository: LeagueRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, + private readonly raceRepository: RaceRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetSponsorSponsorshipsUseCase.test.ts b/core/racing/application/use-cases/GetSponsorSponsorshipsUseCase.test.ts index e650e10c8..01b6d7e95 100644 --- a/core/racing/application/use-cases/GetSponsorSponsorshipsUseCase.test.ts +++ b/core/racing/application/use-cases/GetSponsorSponsorshipsUseCase.test.ts @@ -60,12 +60,12 @@ describe('GetSponsorSponsorshipsUseCase', () => { }; useCase = new GetSponsorSponsorshipsUseCase( - sponsorRepository as unknown as ISponsorRepository, - seasonSponsorshipRepository as unknown as ISeasonSponsorshipRepository, - seasonRepository as unknown as ISeasonRepository, - leagueRepository as unknown as ILeagueRepository, - leagueMembershipRepository as unknown as ILeagueMembershipRepository, - raceRepository as unknown as IRaceRepository, + sponsorRepository as unknown as SponsorRepository, + seasonSponsorshipRepository as unknown as SeasonSponsorshipRepository, + seasonRepository as unknown as SeasonRepository, + leagueRepository as unknown as LeagueRepository, + leagueMembershipRepository as unknown as LeagueMembershipRepository, + raceRepository as unknown as RaceRepository, ); }); diff --git a/core/racing/application/use-cases/GetSponsorSponsorshipsUseCase.ts b/core/racing/application/use-cases/GetSponsorSponsorshipsUseCase.ts index 5904ed03b..06e96e4a7 100644 --- a/core/racing/application/use-cases/GetSponsorSponsorshipsUseCase.ts +++ b/core/racing/application/use-cases/GetSponsorSponsorshipsUseCase.ts @@ -60,12 +60,12 @@ export type GetSponsorSponsorshipsErrorCode = 'SPONSOR_NOT_FOUND' | 'REPOSITORY_ export class GetSponsorSponsorshipsUseCase { constructor( - private readonly sponsorRepository: ISponsorRepository, - private readonly seasonSponsorshipRepository: ISeasonSponsorshipRepository, - private readonly seasonRepository: ISeasonRepository, - private readonly leagueRepository: ILeagueRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, - private readonly raceRepository: IRaceRepository, + private readonly sponsorRepository: SponsorRepository, + private readonly seasonSponsorshipRepository: SeasonSponsorshipRepository, + private readonly seasonRepository: SeasonRepository, + private readonly leagueRepository: LeagueRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, + private readonly raceRepository: RaceRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetSponsorUseCase.test.ts b/core/racing/application/use-cases/GetSponsorUseCase.test.ts index 63bbc3b3d..c2288df15 100644 --- a/core/racing/application/use-cases/GetSponsorUseCase.test.ts +++ b/core/racing/application/use-cases/GetSponsorUseCase.test.ts @@ -22,7 +22,7 @@ describe('GetSponsorUseCase', () => { }; useCase = new GetSponsorUseCase( - sponsorRepository as unknown as ISponsorRepository, + sponsorRepository as unknown as SponsorRepository, ); }); diff --git a/core/racing/application/use-cases/GetSponsorUseCase.ts b/core/racing/application/use-cases/GetSponsorUseCase.ts index 574146b33..ee3b93e61 100644 --- a/core/racing/application/use-cases/GetSponsorUseCase.ts +++ b/core/racing/application/use-cases/GetSponsorUseCase.ts @@ -21,7 +21,7 @@ export type GetSponsorErrorCode = 'SPONSOR_NOT_FOUND' | 'REPOSITORY_ERROR'; export class GetSponsorUseCase { constructor( - private readonly sponsorRepository: ISponsorRepository, + private readonly sponsorRepository: SponsorRepository, ) {} async execute(input: GetSponsorInput): Promise>> { diff --git a/core/racing/application/use-cases/GetTeamDetailsUseCase.ts b/core/racing/application/use-cases/GetTeamDetailsUseCase.ts index 118c0992f..61c3bf6a2 100644 --- a/core/racing/application/use-cases/GetTeamDetailsUseCase.ts +++ b/core/racing/application/use-cases/GetTeamDetailsUseCase.ts @@ -20,8 +20,8 @@ export interface GetTeamDetailsResult { export class GetTeamDetailsUseCase { constructor( - private readonly teamRepository: ITeamRepository, - private readonly membershipRepository: ITeamMembershipRepository, + private readonly teamRepository: TeamRepository, + private readonly membershipRepository: TeamMembershipRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/GetTeamJoinRequestsUseCase.ts b/core/racing/application/use-cases/GetTeamJoinRequestsUseCase.ts index 850903b5a..5ca5266a7 100644 --- a/core/racing/application/use-cases/GetTeamJoinRequestsUseCase.ts +++ b/core/racing/application/use-cases/GetTeamJoinRequestsUseCase.ts @@ -23,9 +23,9 @@ export type GetTeamJoinRequestsResult = { }; export class GetTeamJoinRequestsUseCase { - constructor(private readonly membershipRepository: ITeamMembershipRepository, - private readonly driverRepository: IDriverRepository, - private readonly teamRepository: ITeamRepository) {} + constructor(private readonly membershipRepository: TeamMembershipRepository, + private readonly driverRepository: DriverRepository, + private readonly teamRepository: TeamRepository) {} async execute( input: GetTeamJoinRequestsInput, diff --git a/core/racing/application/use-cases/GetTeamMembersUseCase.ts b/core/racing/application/use-cases/GetTeamMembersUseCase.ts index 03577c1b8..a20702dfc 100644 --- a/core/racing/application/use-cases/GetTeamMembersUseCase.ts +++ b/core/racing/application/use-cases/GetTeamMembersUseCase.ts @@ -24,9 +24,9 @@ export type GetTeamMembersErrorCode = 'TEAM_NOT_FOUND' | 'REPOSITORY_ERROR'; * Use Case for retrieving team members. */ export class GetTeamMembersUseCase { - constructor(private readonly membershipRepository: ITeamMembershipRepository, - private readonly driverRepository: IDriverRepository, - private readonly teamRepository: ITeamRepository, + constructor(private readonly membershipRepository: TeamMembershipRepository, + private readonly driverRepository: DriverRepository, + private readonly teamRepository: TeamRepository, private readonly logger: Logger) {} async execute( diff --git a/core/racing/application/use-cases/GetTeamMembershipUseCase.ts b/core/racing/application/use-cases/GetTeamMembershipUseCase.ts index 0f9c5730c..a8c8dee3a 100644 --- a/core/racing/application/use-cases/GetTeamMembershipUseCase.ts +++ b/core/racing/application/use-cases/GetTeamMembershipUseCase.ts @@ -21,7 +21,7 @@ export type GetTeamMembershipErrorCode = 'REPOSITORY_ERROR'; * Use Case for retrieving a driver's membership in a team. */ export class GetTeamMembershipUseCase { - constructor(private readonly membershipRepository: ITeamMembershipRepository, + constructor(private readonly membershipRepository: TeamMembershipRepository, private readonly logger: Logger) {} async execute( diff --git a/core/racing/application/use-cases/GetTeamsLeaderboardUseCase.ts b/core/racing/application/use-cases/GetTeamsLeaderboardUseCase.ts index 366e8cfcd..df3642012 100644 --- a/core/racing/application/use-cases/GetTeamsLeaderboardUseCase.ts +++ b/core/racing/application/use-cases/GetTeamsLeaderboardUseCase.ts @@ -40,8 +40,8 @@ export type GetTeamsLeaderboardErrorCode = 'LEAGUE_NOT_FOUND' | 'SEASON_NOT_FOUN */ export class GetTeamsLeaderboardUseCase { constructor( - private readonly teamRepository: ITeamRepository, - private readonly teamMembershipRepository: ITeamMembershipRepository, + private readonly teamRepository: TeamRepository, + private readonly teamMembershipRepository: TeamMembershipRepository, private readonly getDriverStats: (driverId: string) => DriverStatsAdapter | null, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/GetTotalDriversUseCase.test.ts b/core/racing/application/use-cases/GetTotalDriversUseCase.test.ts index 46e10ea12..99593937d 100644 --- a/core/racing/application/use-cases/GetTotalDriversUseCase.test.ts +++ b/core/racing/application/use-cases/GetTotalDriversUseCase.test.ts @@ -17,7 +17,7 @@ describe('GetTotalDriversUseCase', () => { findAll: vi.fn(), }; - useCase = new GetTotalDriversUseCase(driverRepository as unknown as IDriverRepository); + useCase = new GetTotalDriversUseCase(driverRepository as unknown as DriverRepository); }); it('should return total number of drivers', async () => { diff --git a/core/racing/application/use-cases/GetTotalDriversUseCase.ts b/core/racing/application/use-cases/GetTotalDriversUseCase.ts index 5cea324f8..bb70968a7 100644 --- a/core/racing/application/use-cases/GetTotalDriversUseCase.ts +++ b/core/racing/application/use-cases/GetTotalDriversUseCase.ts @@ -11,7 +11,7 @@ export interface GetTotalDriversResult { } export class GetTotalDriversUseCase { - constructor(private readonly driverRepository: IDriverRepository) {} + constructor(private readonly driverRepository: DriverRepository) {} async execute( _input: GetTotalDriversInput, diff --git a/core/racing/application/use-cases/GetTotalLeaguesUseCase.test.ts b/core/racing/application/use-cases/GetTotalLeaguesUseCase.test.ts index e0bbb3cdf..bbb06f97e 100644 --- a/core/racing/application/use-cases/GetTotalLeaguesUseCase.test.ts +++ b/core/racing/application/use-cases/GetTotalLeaguesUseCase.test.ts @@ -18,7 +18,7 @@ describe('GetTotalLeaguesUseCase', () => { findAll: vi.fn(), }; - useCase = new GetTotalLeaguesUseCase(leagueRepository as unknown as ILeagueRepository); + useCase = new GetTotalLeaguesUseCase(leagueRepository as unknown as LeagueRepository); }); it('should return total number of leagues', async () => { diff --git a/core/racing/application/use-cases/GetTotalLeaguesUseCase.ts b/core/racing/application/use-cases/GetTotalLeaguesUseCase.ts index 565aff316..64c60b316 100644 --- a/core/racing/application/use-cases/GetTotalLeaguesUseCase.ts +++ b/core/racing/application/use-cases/GetTotalLeaguesUseCase.ts @@ -11,7 +11,7 @@ export interface GetTotalLeaguesResult { } export class GetTotalLeaguesUseCase { - constructor(private readonly leagueRepository: ILeagueRepository) {} + constructor(private readonly leagueRepository: LeagueRepository) {} async execute( _input: GetTotalLeaguesInput, diff --git a/core/racing/application/use-cases/GetTotalRacesUseCase.test.ts b/core/racing/application/use-cases/GetTotalRacesUseCase.test.ts index e7a17de5c..2af30a8ad 100644 --- a/core/racing/application/use-cases/GetTotalRacesUseCase.test.ts +++ b/core/racing/application/use-cases/GetTotalRacesUseCase.test.ts @@ -29,7 +29,7 @@ describe('GetTotalRacesUseCase', () => { warn: vi.fn(), error: vi.fn(), }; - useCase = new GetTotalRacesUseCase(raceRepository as unknown as IRaceRepository, + useCase = new GetTotalRacesUseCase(raceRepository as unknown as RaceRepository, logger as unknown as Logger); }); diff --git a/core/racing/application/use-cases/GetTotalRacesUseCase.ts b/core/racing/application/use-cases/GetTotalRacesUseCase.ts index b5e03601c..f7ea6c8e1 100644 --- a/core/racing/application/use-cases/GetTotalRacesUseCase.ts +++ b/core/racing/application/use-cases/GetTotalRacesUseCase.ts @@ -11,7 +11,7 @@ export interface GetTotalRacesResult { } export class GetTotalRacesUseCase { - constructor(private readonly raceRepository: IRaceRepository) {} + constructor(private readonly raceRepository: RaceRepository) {} async execute( _input: GetTotalRacesInput, diff --git a/core/racing/application/use-cases/ImportRaceResultsApiUseCase.test.ts b/core/racing/application/use-cases/ImportRaceResultsApiUseCase.test.ts index a0566cd28..1b4eb49de 100644 --- a/core/racing/application/use-cases/ImportRaceResultsApiUseCase.test.ts +++ b/core/racing/application/use-cases/ImportRaceResultsApiUseCase.test.ts @@ -29,11 +29,11 @@ describe('ImportRaceResultsApiUseCase', () => { warn: vi.fn(), error: vi.fn(), }; - useCase = new ImportRaceResultsApiUseCase(raceRepository as unknown as IRaceRepository, - leagueRepository as unknown as ILeagueRepository, - resultRepository as unknown as IResultRepository, - driverRepository as unknown as IDriverRepository, - standingRepository as unknown as IStandingRepository, + useCase = new ImportRaceResultsApiUseCase(raceRepository as unknown as RaceRepository, + leagueRepository as unknown as LeagueRepository, + resultRepository as unknown as ResultRepository, + driverRepository as unknown as DriverRepository, + standingRepository as unknown as StandingRepository, logger as unknown as Logger); }); diff --git a/core/racing/application/use-cases/ImportRaceResultsApiUseCase.ts b/core/racing/application/use-cases/ImportRaceResultsApiUseCase.ts index 368478fa9..3a7f94b71 100644 --- a/core/racing/application/use-cases/ImportRaceResultsApiUseCase.ts +++ b/core/racing/application/use-cases/ImportRaceResultsApiUseCase.ts @@ -41,11 +41,11 @@ type ImportRaceResultsApiApplicationError = ApplicationErrorCode< export class ImportRaceResultsApiUseCase { constructor( - private readonly raceRepository: IRaceRepository, - private readonly leagueRepository: ILeagueRepository, - private readonly resultRepository: IResultRepository, - private readonly driverRepository: IDriverRepository, - private readonly standingRepository: IStandingRepository, + private readonly raceRepository: RaceRepository, + private readonly leagueRepository: LeagueRepository, + private readonly resultRepository: ResultRepository, + private readonly driverRepository: DriverRepository, + private readonly standingRepository: StandingRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/ImportRaceResultsUseCase.test.ts b/core/racing/application/use-cases/ImportRaceResultsUseCase.test.ts index 54cbeb88a..2bb322102 100644 --- a/core/racing/application/use-cases/ImportRaceResultsUseCase.test.ts +++ b/core/racing/application/use-cases/ImportRaceResultsUseCase.test.ts @@ -54,11 +54,11 @@ describe('ImportRaceResultsUseCase', () => { warn: vi.fn(), error: vi.fn(), }; - useCase = new ImportRaceResultsUseCase(raceRepository as unknown as IRaceRepository, - leagueRepository as unknown as ILeagueRepository, - resultRepository as unknown as IResultRepository, - driverRepository as unknown as IDriverRepository, - standingRepository as unknown as IStandingRepository, + useCase = new ImportRaceResultsUseCase(raceRepository as unknown as RaceRepository, + leagueRepository as unknown as LeagueRepository, + resultRepository as unknown as ResultRepository, + driverRepository as unknown as DriverRepository, + standingRepository as unknown as StandingRepository, logger as unknown as Logger); }); diff --git a/core/racing/application/use-cases/ImportRaceResultsUseCase.ts b/core/racing/application/use-cases/ImportRaceResultsUseCase.ts index 8428219de..ff9271e97 100644 --- a/core/racing/application/use-cases/ImportRaceResultsUseCase.ts +++ b/core/racing/application/use-cases/ImportRaceResultsUseCase.ts @@ -38,11 +38,11 @@ type ImportRaceResultsApplicationError = ApplicationErrorCode< export class ImportRaceResultsUseCase { constructor( - private readonly raceRepository: IRaceRepository, - private readonly leagueRepository: ILeagueRepository, - private readonly resultRepository: IResultRepository, - private readonly driverRepository: IDriverRepository, - private readonly standingRepository: IStandingRepository, + private readonly raceRepository: RaceRepository, + private readonly leagueRepository: LeagueRepository, + private readonly resultRepository: ResultRepository, + private readonly driverRepository: DriverRepository, + private readonly standingRepository: StandingRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/IsDriverRegisteredForRaceUseCase.ts b/core/racing/application/use-cases/IsDriverRegisteredForRaceUseCase.ts index 84393bffd..bb67a4f77 100644 --- a/core/racing/application/use-cases/IsDriverRegisteredForRaceUseCase.ts +++ b/core/racing/application/use-cases/IsDriverRegisteredForRaceUseCase.ts @@ -1,5 +1,6 @@ import type { RaceRegistrationRepository } from '../../domain/repositories/RaceRegistrationRepository'; -import type { Logger, UseCase } from '@core/shared/application'; +import type { Logger } from '@core/shared/domain/Logger'; +import type { UseCase } from '@core/shared/application/UseCase'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; @@ -28,7 +29,7 @@ export type IsDriverRegisteredForRaceResult = { */ export class IsDriverRegisteredForRaceUseCase implements UseCase { constructor( - private readonly registrationRepository: IRaceRegistrationRepository, + private readonly registrationRepository: RaceRegistrationRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/JoinLeagueUseCase.test.ts b/core/racing/application/use-cases/JoinLeagueUseCase.test.ts index 5e9e5059a..b60f99077 100644 --- a/core/racing/application/use-cases/JoinLeagueUseCase.test.ts +++ b/core/racing/application/use-cases/JoinLeagueUseCase.test.ts @@ -27,7 +27,7 @@ describe('JoinLeagueUseCase', () => { warn: vi.fn(), error: vi.fn(), }; - useCase = new JoinLeagueUseCase(membershipRepository as unknown as ILeagueMembershipRepository, + useCase = new JoinLeagueUseCase(membershipRepository as unknown as LeagueMembershipRepository, logger as unknown as Logger); }); diff --git a/core/racing/application/use-cases/JoinLeagueUseCase.ts b/core/racing/application/use-cases/JoinLeagueUseCase.ts index b552ba053..7d03c1532 100644 --- a/core/racing/application/use-cases/JoinLeagueUseCase.ts +++ b/core/racing/application/use-cases/JoinLeagueUseCase.ts @@ -16,7 +16,7 @@ export interface JoinLeagueResult { export class JoinLeagueUseCase { constructor( - private readonly membershipRepository: ILeagueMembershipRepository, + private readonly membershipRepository: LeagueMembershipRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/JoinTeamUseCase.test.ts b/core/racing/application/use-cases/JoinTeamUseCase.test.ts index b68f5b6a3..5c660c2a3 100644 --- a/core/racing/application/use-cases/JoinTeamUseCase.test.ts +++ b/core/racing/application/use-cases/JoinTeamUseCase.test.ts @@ -35,8 +35,8 @@ describe('JoinTeamUseCase', () => { }; useCase = new JoinTeamUseCase( - teamRepository as unknown as ITeamRepository, - membershipRepository as unknown as ITeamMembershipRepository, + teamRepository as unknown as TeamRepository, + membershipRepository as unknown as TeamMembershipRepository, logger, ); }); diff --git a/core/racing/application/use-cases/JoinTeamUseCase.ts b/core/racing/application/use-cases/JoinTeamUseCase.ts index a4eddeff9..e6f1b6902 100644 --- a/core/racing/application/use-cases/JoinTeamUseCase.ts +++ b/core/racing/application/use-cases/JoinTeamUseCase.ts @@ -22,8 +22,8 @@ export interface JoinTeamResult { export class JoinTeamUseCase { constructor( - private readonly teamRepository: ITeamRepository, - private readonly membershipRepository: ITeamMembershipRepository, + private readonly teamRepository: TeamRepository, + private readonly membershipRepository: TeamMembershipRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/LeagueSeasonScheduleMutationsUseCases.test.ts b/core/racing/application/use-cases/LeagueSeasonScheduleMutationsUseCases.test.ts index df3b8831a..85a81b4d2 100644 --- a/core/racing/application/use-cases/LeagueSeasonScheduleMutationsUseCases.test.ts +++ b/core/racing/application/use-cases/LeagueSeasonScheduleMutationsUseCases.test.ts @@ -10,19 +10,15 @@ import { CreateLeagueSeasonScheduleRaceUseCase, type CreateLeagueSeasonScheduleRaceErrorCode } from './CreateLeagueSeasonScheduleRaceUseCase'; -import { DeleteLeagueSeasonScheduleRaceUseCase, type DeleteLeagueSeasonScheduleRaceErrorCode } from './DeleteLeagueSeasonScheduleRaceUseCase'; -import { PublishLeagueSeasonScheduleUseCase, type PublishLeagueSeasonScheduleErrorCode } from './PublishLeagueSeasonScheduleUseCase'; -import { UnpublishLeagueSeasonScheduleUseCase, type UnpublishLeagueSeasonScheduleErrorCode } from './UnpublishLeagueSeasonScheduleUseCase'; -import { UpdateLeagueSeasonScheduleRaceUseCase, type UpdateLeagueSeasonScheduleRaceErrorCode } from './UpdateLeagueSeasonScheduleRaceUseCase'; diff --git a/core/racing/application/use-cases/LeaveTeamUseCase.test.ts b/core/racing/application/use-cases/LeaveTeamUseCase.test.ts index 9e77c4d57..4a4cd8a77 100644 --- a/core/racing/application/use-cases/LeaveTeamUseCase.test.ts +++ b/core/racing/application/use-cases/LeaveTeamUseCase.test.ts @@ -31,8 +31,8 @@ describe('LeaveTeamUseCase', () => { warn: vi.fn(), error: vi.fn(), } as unknown as Logger; - useCase = new LeaveTeamUseCase(teamRepository as unknown as ITeamRepository, - membershipRepository as unknown as ITeamMembershipRepository, + useCase = new LeaveTeamUseCase(teamRepository as unknown as TeamRepository, + membershipRepository as unknown as TeamMembershipRepository, logger); }); diff --git a/core/racing/application/use-cases/LeaveTeamUseCase.ts b/core/racing/application/use-cases/LeaveTeamUseCase.ts index da6fbd531..1fbd86a48 100644 --- a/core/racing/application/use-cases/LeaveTeamUseCase.ts +++ b/core/racing/application/use-cases/LeaveTeamUseCase.ts @@ -22,8 +22,8 @@ export interface LeaveTeamResult { export class LeaveTeamUseCase { constructor( - private readonly teamRepository: ITeamRepository, - private readonly membershipRepository: ITeamMembershipRepository, + private readonly teamRepository: TeamRepository, + private readonly membershipRepository: TeamMembershipRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/ListSeasonsForLeagueUseCase.test.ts b/core/racing/application/use-cases/ListSeasonsForLeagueUseCase.test.ts index 12931b142..24b0af14f 100644 --- a/core/racing/application/use-cases/ListSeasonsForLeagueUseCase.test.ts +++ b/core/racing/application/use-cases/ListSeasonsForLeagueUseCase.test.ts @@ -27,8 +27,8 @@ describe('ListSeasonsForLeagueUseCase', () => { findByLeagueId: vi.fn(), }; useCase = new ListSeasonsForLeagueUseCase( - seasonRepository as unknown as ISeasonRepository, - leagueRepository as unknown as ILeagueRepository + seasonRepository as unknown as SeasonRepository, + leagueRepository as unknown as LeagueRepository ); }); diff --git a/core/racing/application/use-cases/ListSeasonsForLeagueUseCase.ts b/core/racing/application/use-cases/ListSeasonsForLeagueUseCase.ts index b2b5b7f75..68cdde2cb 100644 --- a/core/racing/application/use-cases/ListSeasonsForLeagueUseCase.ts +++ b/core/racing/application/use-cases/ListSeasonsForLeagueUseCase.ts @@ -16,8 +16,8 @@ export interface ListSeasonsForLeagueResult { export class ListSeasonsForLeagueUseCase { constructor( - private readonly seasonRepository: ISeasonRepository, - private readonly leagueRepository: ILeagueRepository, + private readonly seasonRepository: SeasonRepository, + private readonly leagueRepository: LeagueRepository, ) {} async execute( diff --git a/core/racing/application/use-cases/ManageSeasonLifecycleUseCase.ts b/core/racing/application/use-cases/ManageSeasonLifecycleUseCase.ts index 78334fe47..7dc813034 100644 --- a/core/racing/application/use-cases/ManageSeasonLifecycleUseCase.ts +++ b/core/racing/application/use-cases/ManageSeasonLifecycleUseCase.ts @@ -37,8 +37,8 @@ export type ManageSeasonLifecycleErrorCode = * ManageSeasonLifecycleUseCase */ export class ManageSeasonLifecycleUseCase { - constructor(private readonly leagueRepository: ILeagueRepository, - private readonly seasonRepository: ISeasonRepository) {} + constructor(private readonly leagueRepository: LeagueRepository, + private readonly seasonRepository: SeasonRepository) {} async execute( input: ManageSeasonLifecycleInput, diff --git a/core/racing/application/use-cases/PublishLeagueSeasonScheduleUseCase.test.ts b/core/racing/application/use-cases/PublishLeagueSeasonScheduleUseCase.test.ts index 4dcfc9759..c4a764325 100644 --- a/core/racing/application/use-cases/PublishLeagueSeasonScheduleUseCase.test.ts +++ b/core/racing/application/use-cases/PublishLeagueSeasonScheduleUseCase.test.ts @@ -44,7 +44,7 @@ describe('PublishLeagueSeasonScheduleUseCase', () => { seasonRepository.findById.mockResolvedValue(season); seasonRepository.update.mockResolvedValue(undefined); - const useCase = new PublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as ISeasonRepository, + const useCase = new PublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as SeasonRepository, logger); const result = await useCase.execute({ leagueId: 'league-1', seasonId: 'season-1' }); @@ -61,7 +61,7 @@ describe('PublishLeagueSeasonScheduleUseCase', () => { const season = createSeasonWithinWindow({ leagueId: 'other-league' }); seasonRepository.findById.mockResolvedValue(season); - const useCase = new PublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as ISeasonRepository, + const useCase = new PublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as SeasonRepository, logger); const result = await useCase.execute({ leagueId: 'league-1', seasonId: 'season-1' }); @@ -78,7 +78,7 @@ describe('PublishLeagueSeasonScheduleUseCase', () => { it('returns SEASON_NOT_FOUND when season does not exist', async () => { seasonRepository.findById.mockResolvedValue(null); - const useCase = new PublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as ISeasonRepository, + const useCase = new PublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as SeasonRepository, logger); const result = await useCase.execute({ leagueId: 'league-1', seasonId: 'season-1' }); @@ -96,7 +96,7 @@ describe('PublishLeagueSeasonScheduleUseCase', () => { const repositoryError = new Error('DB connection failed'); seasonRepository.findById.mockRejectedValue(repositoryError); - const useCase = new PublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as ISeasonRepository, + const useCase = new PublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as SeasonRepository, logger); const result = await useCase.execute({ leagueId: 'league-1', seasonId: 'season-1' }); @@ -116,7 +116,7 @@ describe('PublishLeagueSeasonScheduleUseCase', () => { seasonRepository.findById.mockResolvedValue(season); seasonRepository.update.mockRejectedValue(repositoryError); - const useCase = new PublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as ISeasonRepository, + const useCase = new PublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as SeasonRepository, logger); const result = await useCase.execute({ leagueId: 'league-1', seasonId: 'season-1' }); diff --git a/core/racing/application/use-cases/PublishLeagueSeasonScheduleUseCase.ts b/core/racing/application/use-cases/PublishLeagueSeasonScheduleUseCase.ts index b256756bc..d3e96f3d0 100644 --- a/core/racing/application/use-cases/PublishLeagueSeasonScheduleUseCase.ts +++ b/core/racing/application/use-cases/PublishLeagueSeasonScheduleUseCase.ts @@ -16,7 +16,7 @@ export type PublishLeagueSeasonScheduleErrorCode = export class PublishLeagueSeasonScheduleUseCase { constructor( - private readonly seasonRepository: ISeasonRepository, + private readonly seasonRepository: SeasonRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/QuickPenaltyUseCase.test.ts b/core/racing/application/use-cases/QuickPenaltyUseCase.test.ts index c60a729e0..13ce0371c 100644 --- a/core/racing/application/use-cases/QuickPenaltyUseCase.test.ts +++ b/core/racing/application/use-cases/QuickPenaltyUseCase.test.ts @@ -37,9 +37,9 @@ describe('QuickPenaltyUseCase', () => { warn: vi.fn(), error: vi.fn(), }; - useCase = new QuickPenaltyUseCase(penaltyRepository as unknown as IPenaltyRepository, - raceRepository as unknown as IRaceRepository, - leagueMembershipRepository as unknown as ILeagueMembershipRepository, + useCase = new QuickPenaltyUseCase(penaltyRepository as unknown as PenaltyRepository, + raceRepository as unknown as RaceRepository, + leagueMembershipRepository as unknown as LeagueMembershipRepository, logger as unknown as Logger); }); diff --git a/core/racing/application/use-cases/QuickPenaltyUseCase.ts b/core/racing/application/use-cases/QuickPenaltyUseCase.ts index 51c859320..0fdeb51ef 100644 --- a/core/racing/application/use-cases/QuickPenaltyUseCase.ts +++ b/core/racing/application/use-cases/QuickPenaltyUseCase.ts @@ -35,9 +35,9 @@ export type QuickPenaltyResult = { export class QuickPenaltyUseCase { constructor( - private readonly penaltyRepository: IPenaltyRepository, - private readonly raceRepository: IRaceRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, + private readonly penaltyRepository: PenaltyRepository, + private readonly raceRepository: RaceRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/RankingUseCase.ts b/core/racing/application/use-cases/RankingUseCase.ts index c336c397a..a7d4195a6 100644 --- a/core/racing/application/use-cases/RankingUseCase.ts +++ b/core/racing/application/use-cases/RankingUseCase.ts @@ -1,5 +1,5 @@ /** - * Application Use Case Interface: IRankingUseCase + * Application Use Case Interface: RankingUseCase * * Use case for computing driver rankings from standings and results. * This is an application layer concern that orchestrates domain data. diff --git a/core/racing/application/use-cases/RecalculateChampionshipStandingsUseCase.ts b/core/racing/application/use-cases/RecalculateChampionshipStandingsUseCase.ts index e96f8dfc3..78ca8376d 100644 --- a/core/racing/application/use-cases/RecalculateChampionshipStandingsUseCase.ts +++ b/core/racing/application/use-cases/RecalculateChampionshipStandingsUseCase.ts @@ -33,13 +33,13 @@ export type RecalculateChampionshipStandingsErrorCode = | 'REPOSITORY_ERROR'; export class RecalculateChampionshipStandingsUseCase { - constructor(private readonly leagueRepository: ILeagueRepository, - private readonly seasonRepository: ISeasonRepository, - private readonly leagueScoringConfigRepository: ILeagueScoringConfigRepository, - private readonly raceRepository: IRaceRepository, - private readonly resultRepository: IResultRepository, - private readonly penaltyRepository: IPenaltyRepository, - private readonly championshipStandingRepository: IChampionshipStandingRepository, + constructor(private readonly leagueRepository: LeagueRepository, + private readonly seasonRepository: SeasonRepository, + private readonly leagueScoringConfigRepository: LeagueScoringConfigRepository, + private readonly raceRepository: RaceRepository, + private readonly resultRepository: ResultRepository, + private readonly penaltyRepository: PenaltyRepository, + private readonly championshipStandingRepository: ChampionshipStandingRepository, private readonly eventScoringService: EventScoringService, private readonly championshipAggregator: ChampionshipAggregator, private readonly logger: Logger) {} diff --git a/core/racing/application/use-cases/RecomputeTeamRatingSnapshotUseCase.ts b/core/racing/application/use-cases/RecomputeTeamRatingSnapshotUseCase.ts index 9af64535b..0e9483132 100644 --- a/core/racing/application/use-cases/RecomputeTeamRatingSnapshotUseCase.ts +++ b/core/racing/application/use-cases/RecomputeTeamRatingSnapshotUseCase.ts @@ -11,8 +11,8 @@ import { TeamRatingSnapshotCalculator } from '@core/racing/domain/services/TeamR */ export class RecomputeTeamRatingSnapshotUseCase { constructor( - private readonly ratingEventRepository: ITeamRatingEventRepository, - private readonly ratingRepository: ITeamRatingRepository, + private readonly ratingEventRepository: TeamRatingEventRepository, + private readonly ratingRepository: TeamRatingRepository, ) {} /** diff --git a/core/racing/application/use-cases/RecordTeamRaceRatingEventsUseCase.ts b/core/racing/application/use-cases/RecordTeamRaceRatingEventsUseCase.ts index c6bb9aead..e26b7850b 100644 --- a/core/racing/application/use-cases/RecordTeamRaceRatingEventsUseCase.ts +++ b/core/racing/application/use-cases/RecordTeamRaceRatingEventsUseCase.ts @@ -19,9 +19,9 @@ import type { TeamRatingRepository } from '@core/racing/domain/repositories/Team */ export class RecordTeamRaceRatingEventsUseCase { constructor( - private readonly teamRaceResultsProvider: ITeamRaceResultsProvider, - private readonly ratingEventRepository: ITeamRatingEventRepository, - private readonly ratingRepository: ITeamRatingRepository, + private readonly teamRaceResultsProvider: TeamRaceResultsProvider, + private readonly ratingEventRepository: TeamRatingEventRepository, + private readonly ratingRepository: TeamRatingRepository, private readonly appendTeamRatingEventsUseCase: AppendTeamRatingEventsUseCase, ) {} diff --git a/core/racing/application/use-cases/RegisterForRaceUseCase.test.ts b/core/racing/application/use-cases/RegisterForRaceUseCase.test.ts index 8946162be..a094f1698 100644 --- a/core/racing/application/use-cases/RegisterForRaceUseCase.test.ts +++ b/core/racing/application/use-cases/RegisterForRaceUseCase.test.ts @@ -19,8 +19,8 @@ describe('RegisterForRaceUseCase', () => { registrationRepository = { isRegistered: vi.fn(), register: vi.fn() }; membershipRepository = { getMembership: vi.fn() }; logger = { debug: vi.fn(), warn: vi.fn(), error: vi.fn(), info: vi.fn() }; - useCase = new RegisterForRaceUseCase(registrationRepository as unknown as IRaceRegistrationRepository, - membershipRepository as unknown as ILeagueMembershipRepository, + useCase = new RegisterForRaceUseCase(registrationRepository as unknown as RaceRegistrationRepository, + membershipRepository as unknown as LeagueMembershipRepository, logger as unknown as Logger); }); diff --git a/core/racing/application/use-cases/RegisterForRaceUseCase.ts b/core/racing/application/use-cases/RegisterForRaceUseCase.ts index 5db0c6189..ea2d26cbc 100644 --- a/core/racing/application/use-cases/RegisterForRaceUseCase.ts +++ b/core/racing/application/use-cases/RegisterForRaceUseCase.ts @@ -1,7 +1,7 @@ import type { RaceRegistrationRepository } from '@core/racing/domain/repositories/RaceRegistrationRepository'; import type { LeagueMembershipRepository } from '@core/racing/domain/repositories/LeagueMembershipRepository'; import { RaceRegistration } from '@core/racing/domain/entities/RaceRegistration'; -import { Logger } from '@core/shared/application'; +import { Logger } from '@core/shared/domain/Logger'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; @@ -24,8 +24,8 @@ export type RegisterForRaceErrorCode = export class RegisterForRaceUseCase { constructor( - private readonly registrationRepository: IRaceRegistrationRepository, - private readonly membershipRepository: ILeagueMembershipRepository, + private readonly registrationRepository: RaceRegistrationRepository, + private readonly membershipRepository: LeagueMembershipRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/RejectLeagueJoinRequestUseCase.test.ts b/core/racing/application/use-cases/RejectLeagueJoinRequestUseCase.test.ts index c7381c58e..8c3ecdf14 100644 --- a/core/racing/application/use-cases/RejectLeagueJoinRequestUseCase.test.ts +++ b/core/racing/application/use-cases/RejectLeagueJoinRequestUseCase.test.ts @@ -24,7 +24,7 @@ describe('RejectLeagueJoinRequestUseCase', () => { present: vi.fn(), } as any; - const useCase = new RejectLeagueJoinRequestUseCase(leagueMembershipRepository as unknown as ILeagueMembershipRepository); + const useCase = new RejectLeagueJoinRequestUseCase(leagueMembershipRepository as unknown as LeagueMembershipRepository); leagueMembershipRepository.getJoinRequests.mockResolvedValue([ { id: 'jr-1', leagueId: 'league-1', driverId: 'driver-1' }, @@ -44,7 +44,7 @@ describe('RejectLeagueJoinRequestUseCase', () => { present: vi.fn(), } as any; - const useCase = new RejectLeagueJoinRequestUseCase(leagueMembershipRepository as unknown as ILeagueMembershipRepository); + const useCase = new RejectLeagueJoinRequestUseCase(leagueMembershipRepository as unknown as LeagueMembershipRepository); leagueMembershipRepository.getJoinRequests.mockResolvedValue([]); diff --git a/core/racing/application/use-cases/RejectLeagueJoinRequestUseCase.ts b/core/racing/application/use-cases/RejectLeagueJoinRequestUseCase.ts index 573942a63..82973ab07 100644 --- a/core/racing/application/use-cases/RejectLeagueJoinRequestUseCase.ts +++ b/core/racing/application/use-cases/RejectLeagueJoinRequestUseCase.ts @@ -13,7 +13,7 @@ export type RejectLeagueJoinRequestResult = { }; export class RejectLeagueJoinRequestUseCase { - constructor(private readonly leagueMembershipRepository: ILeagueMembershipRepository) {} + constructor(private readonly leagueMembershipRepository: LeagueMembershipRepository) {} async execute( input: RejectLeagueJoinRequestInput, diff --git a/core/racing/application/use-cases/RejectSponsorshipRequestUseCase.test.ts b/core/racing/application/use-cases/RejectSponsorshipRequestUseCase.test.ts index 0c8f29702..9b88885b2 100644 --- a/core/racing/application/use-cases/RejectSponsorshipRequestUseCase.test.ts +++ b/core/racing/application/use-cases/RejectSponsorshipRequestUseCase.test.ts @@ -24,7 +24,7 @@ describe('RejectSponsorshipRequestUseCase', () => { }; useCase = new RejectSponsorshipRequestUseCase( - sponsorshipRequestRepo as unknown as ISponsorshipRequestRepository, + sponsorshipRequestRepo as unknown as SponsorshipRequestRepository, logger, ); }); diff --git a/core/racing/application/use-cases/RejectSponsorshipRequestUseCase.ts b/core/racing/application/use-cases/RejectSponsorshipRequestUseCase.ts index f2a0aa399..20245b25b 100644 --- a/core/racing/application/use-cases/RejectSponsorshipRequestUseCase.ts +++ b/core/racing/application/use-cases/RejectSponsorshipRequestUseCase.ts @@ -23,7 +23,7 @@ export type RejectSponsorshipRequestErrorCode = export class RejectSponsorshipRequestUseCase { constructor( - private readonly sponsorshipRequestRepo: ISponsorshipRequestRepository, + private readonly sponsorshipRequestRepo: SponsorshipRequestRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/RejectTeamJoinRequestUseCase.test.ts b/core/racing/application/use-cases/RejectTeamJoinRequestUseCase.test.ts index fd100afe3..7185d42ec 100644 --- a/core/racing/application/use-cases/RejectTeamJoinRequestUseCase.test.ts +++ b/core/racing/application/use-cases/RejectTeamJoinRequestUseCase.test.ts @@ -43,8 +43,8 @@ describe('RejectTeamJoinRequestUseCase', () => { error: vi.fn(), } as unknown as Logger & { info: Mock; warn: Mock; error: Mock; debug: Mock }; - useCase = new RejectTeamJoinRequestUseCase(teamRepository as unknown as ITeamRepository, - membershipRepository as unknown as ITeamMembershipRepository, + useCase = new RejectTeamJoinRequestUseCase(teamRepository as unknown as TeamRepository, + membershipRepository as unknown as TeamMembershipRepository, logger); }); diff --git a/core/racing/application/use-cases/RejectTeamJoinRequestUseCase.ts b/core/racing/application/use-cases/RejectTeamJoinRequestUseCase.ts index 17bb9e7df..110186596 100644 --- a/core/racing/application/use-cases/RejectTeamJoinRequestUseCase.ts +++ b/core/racing/application/use-cases/RejectTeamJoinRequestUseCase.ts @@ -18,8 +18,8 @@ export type RejectTeamJoinRequestErrorCode = export class RejectTeamJoinRequestUseCase { constructor( - private readonly teamRepository: ITeamRepository, - private readonly membershipRepository: ITeamMembershipRepository, + private readonly teamRepository: TeamRepository, + private readonly membershipRepository: TeamMembershipRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/RemoveLeagueMemberUseCase.test.ts b/core/racing/application/use-cases/RemoveLeagueMemberUseCase.test.ts index 74a53bc3e..87c2f3245 100644 --- a/core/racing/application/use-cases/RemoveLeagueMemberUseCase.test.ts +++ b/core/racing/application/use-cases/RemoveLeagueMemberUseCase.test.ts @@ -17,7 +17,7 @@ describe('RemoveLeagueMemberUseCase', () => { getLeagueMembers: vi.fn(), saveMembership: vi.fn(), }; - useCase = new RemoveLeagueMemberUseCase(leagueMembershipRepository as unknown as ILeagueMembershipRepository); + useCase = new RemoveLeagueMemberUseCase(leagueMembershipRepository as unknown as LeagueMembershipRepository); }); it('should remove league member by setting status to inactive', async () => { diff --git a/core/racing/application/use-cases/RemoveLeagueMemberUseCase.ts b/core/racing/application/use-cases/RemoveLeagueMemberUseCase.ts index 60e2d9f30..f8b02b759 100644 --- a/core/racing/application/use-cases/RemoveLeagueMemberUseCase.ts +++ b/core/racing/application/use-cases/RemoveLeagueMemberUseCase.ts @@ -20,7 +20,7 @@ export type RemoveLeagueMemberErrorCode = | 'REPOSITORY_ERROR'; export class RemoveLeagueMemberUseCase { - constructor(private readonly leagueMembershipRepository: ILeagueMembershipRepository) {} + constructor(private readonly leagueMembershipRepository: LeagueMembershipRepository) {} async execute( params: RemoveLeagueMemberInput, diff --git a/core/racing/application/use-cases/ReopenRaceUseCase.ts b/core/racing/application/use-cases/ReopenRaceUseCase.ts index 1bf6168eb..e9ae53c7f 100644 --- a/core/racing/application/use-cases/ReopenRaceUseCase.ts +++ b/core/racing/application/use-cases/ReopenRaceUseCase.ts @@ -28,7 +28,7 @@ export type ReopenRaceResult = { */ export class ReopenRaceUseCase { constructor( - private readonly raceRepository: IRaceRepository, + private readonly raceRepository: RaceRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/RequestProtestDefenseUseCase.test.ts b/core/racing/application/use-cases/RequestProtestDefenseUseCase.test.ts index a367f7fd4..118e1b9b4 100644 --- a/core/racing/application/use-cases/RequestProtestDefenseUseCase.test.ts +++ b/core/racing/application/use-cases/RequestProtestDefenseUseCase.test.ts @@ -28,9 +28,9 @@ describe('RequestProtestDefenseUseCase', () => { warn: vi.fn(), error: vi.fn(), }; - useCase = new RequestProtestDefenseUseCase(protestRepository as unknown as IProtestRepository, - raceRepository as unknown as IRaceRepository, - membershipRepository as unknown as ILeagueMembershipRepository, + useCase = new RequestProtestDefenseUseCase(protestRepository as unknown as ProtestRepository, + raceRepository as unknown as RaceRepository, + membershipRepository as unknown as LeagueMembershipRepository, logger); }); diff --git a/core/racing/application/use-cases/RequestProtestDefenseUseCase.ts b/core/racing/application/use-cases/RequestProtestDefenseUseCase.ts index 30697bee1..74940f3a5 100644 --- a/core/racing/application/use-cases/RequestProtestDefenseUseCase.ts +++ b/core/racing/application/use-cases/RequestProtestDefenseUseCase.ts @@ -10,7 +10,7 @@ import type { RaceRepository } from '../../domain/repositories/RaceRepository'; import type { LeagueMembershipRepository } from '../../domain/repositories/LeagueMembershipRepository'; import { isLeagueStewardOrHigherRole } from '../../domain/types/LeagueRoles'; import { Result } from '@core/shared/domain/Result'; -import { Logger } from '@core/shared/application'; +import { Logger } from '@core/shared/domain/Logger'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; export type RequestProtestDefenseInput = { @@ -34,9 +34,9 @@ export type RequestProtestDefenseErrorCode = export class RequestProtestDefenseUseCase { constructor( - private readonly protestRepository: IProtestRepository, - private readonly raceRepository: IRaceRepository, - private readonly membershipRepository: ILeagueMembershipRepository, + private readonly protestRepository: ProtestRepository, + private readonly raceRepository: RaceRepository, + private readonly membershipRepository: LeagueMembershipRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/ReviewProtestUseCase.test.ts b/core/racing/application/use-cases/ReviewProtestUseCase.test.ts index 0cb8fdf55..ef90e0173 100644 --- a/core/racing/application/use-cases/ReviewProtestUseCase.test.ts +++ b/core/racing/application/use-cases/ReviewProtestUseCase.test.ts @@ -21,9 +21,9 @@ describe('ReviewProtestUseCase', () => { warn: vi.fn(), error: vi.fn(), }; - useCase = new ReviewProtestUseCase(protestRepository as unknown as IProtestRepository, - raceRepository as unknown as IRaceRepository, - leagueMembershipRepository as unknown as ILeagueMembershipRepository, + useCase = new ReviewProtestUseCase(protestRepository as unknown as ProtestRepository, + raceRepository as unknown as RaceRepository, + leagueMembershipRepository as unknown as LeagueMembershipRepository, logger as unknown as Logger); }); diff --git a/core/racing/application/use-cases/ReviewProtestUseCase.ts b/core/racing/application/use-cases/ReviewProtestUseCase.ts index a453f6c5b..f223c0c1b 100644 --- a/core/racing/application/use-cases/ReviewProtestUseCase.ts +++ b/core/racing/application/use-cases/ReviewProtestUseCase.ts @@ -26,9 +26,9 @@ export interface ReviewProtestResult { export class ReviewProtestUseCase { constructor( - private readonly protestRepository: IProtestRepository, - private readonly raceRepository: IRaceRepository, - private readonly leagueMembershipRepository: ILeagueMembershipRepository, + private readonly protestRepository: ProtestRepository, + private readonly raceRepository: RaceRepository, + private readonly leagueMembershipRepository: LeagueMembershipRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/SeasonUseCases.test.ts b/core/racing/application/use-cases/SeasonUseCases.test.ts index bb41801c2..605b22354 100644 --- a/core/racing/application/use-cases/SeasonUseCases.test.ts +++ b/core/racing/application/use-cases/SeasonUseCases.test.ts @@ -36,7 +36,7 @@ function getUnknownString(value: unknown): string | null { return null; } -function createFakeLeagueRepository(seed: Array<{ id: string }>): ILeagueRepository { +function createFakeLeagueRepository(seed: Array<{ id: string }>): LeagueRepository { const leagues: League[] = seed.map(({ id }) => League.create({ id, @@ -120,13 +120,13 @@ function createLeagueConfigFormModel(overrides?: Partial) describe('CreateSeasonForLeagueUseCase', () => { function setup() { const leagueRepo = createFakeLeagueRepository([{ id: 'league-1' }]); - const seasonRepo: ISeasonRepository = { + const seasonRepo: SeasonRepository = { add: vi.fn(), findById: vi.fn(), update: vi.fn(), listByLeague: vi.fn(), listActiveByLeague: vi.fn(), - } as unknown as ISeasonRepository; + } as unknown as SeasonRepository; const useCase = new CreateSeasonForLeagueUseCase(leagueRepo, seasonRepo); @@ -233,13 +233,13 @@ describe('CreateSeasonForLeagueUseCase', () => { it('returns LEAGUE_NOT_FOUND error when league does not exist', async () => { const leagueRepo = createFakeLeagueRepository([]); - const seasonRepo: ISeasonRepository = { + const seasonRepo: SeasonRepository = { add: vi.fn(), findById: vi.fn(), update: vi.fn(), listByLeague: vi.fn(), listActiveByLeague: vi.fn(), - } as unknown as ISeasonRepository; + } as unknown as SeasonRepository; const useCase = new CreateSeasonForLeagueUseCase(leagueRepo, seasonRepo); @@ -261,13 +261,13 @@ describe('CreateSeasonForLeagueUseCase', () => { describe('ListSeasonsForLeagueUseCase', () => { function setup() { const leagueRepo = createFakeLeagueRepository([{ id: 'league-1' }]); - const seasonRepo: ISeasonRepository = { + const seasonRepo: SeasonRepository = { add: vi.fn(), findById: vi.fn(), update: vi.fn(), listByLeague: vi.fn(), listActiveByLeague: vi.fn(), - } as unknown as ISeasonRepository; + } as unknown as SeasonRepository; const useCase = new ListSeasonsForLeagueUseCase(leagueRepo, seasonRepo); @@ -317,13 +317,13 @@ describe('ListSeasonsForLeagueUseCase', () => { it('returns LEAGUE_NOT_FOUND error when league does not exist', async () => { const leagueRepo = createFakeLeagueRepository([]); - const seasonRepo: ISeasonRepository = { + const seasonRepo: SeasonRepository = { add: vi.fn(), findById: vi.fn(), update: vi.fn(), listByLeague: vi.fn(), listActiveByLeague: vi.fn(), - } as unknown as ISeasonRepository; + } as unknown as SeasonRepository; const useCase = new ListSeasonsForLeagueUseCase(leagueRepo, seasonRepo); @@ -339,13 +339,13 @@ describe('ListSeasonsForLeagueUseCase', () => { describe('GetSeasonDetailsUseCase', () => { function setup(leagueSeed: Array<{ id: string }>) { const leagueRepo = createFakeLeagueRepository(leagueSeed); - const seasonRepo: ISeasonRepository = { + const seasonRepo: SeasonRepository = { add: vi.fn(), findById: vi.fn(), update: vi.fn(), listByLeague: vi.fn(), listActiveByLeague: vi.fn(), - } as unknown as ISeasonRepository; + } as unknown as SeasonRepository; const useCase = new GetSeasonDetailsUseCase(leagueRepo, seasonRepo); @@ -424,13 +424,13 @@ describe('GetSeasonDetailsUseCase', () => { describe('ManageSeasonLifecycleUseCase', () => { function setup() { const leagueRepo = createFakeLeagueRepository([{ id: 'league-1' }]); - const seasonRepo: ISeasonRepository = { + const seasonRepo: SeasonRepository = { add: vi.fn(), findById: vi.fn(), update: vi.fn(), listByLeague: vi.fn(), listActiveByLeague: vi.fn(), - } as unknown as ISeasonRepository; + } as unknown as SeasonRepository; const useCase = new ManageSeasonLifecycleUseCase(leagueRepo, seasonRepo); @@ -519,13 +519,13 @@ describe('ManageSeasonLifecycleUseCase', () => { it('returns LEAGUE_NOT_FOUND when league does not exist', async () => { const leagueRepo = createFakeLeagueRepository([]); - const seasonRepo: ISeasonRepository = { + const seasonRepo: SeasonRepository = { add: vi.fn(), findById: vi.fn(), update: vi.fn(), listByLeague: vi.fn(), listActiveByLeague: vi.fn(), - } as unknown as ISeasonRepository; + } as unknown as SeasonRepository; const useCase = new ManageSeasonLifecycleUseCase(leagueRepo, seasonRepo); @@ -545,13 +545,13 @@ describe('ManageSeasonLifecycleUseCase', () => { it('returns SEASON_NOT_FOUND when season does not belong to league', async () => { const leagueRepo = createFakeLeagueRepository([{ id: 'league-1' }]); - const seasonRepo: ISeasonRepository = { + const seasonRepo: SeasonRepository = { add: vi.fn(), findById: vi.fn(), update: vi.fn(), listByLeague: vi.fn(), listActiveByLeague: vi.fn(), - } as unknown as ISeasonRepository; + } as unknown as SeasonRepository; const useCase = new ManageSeasonLifecycleUseCase(leagueRepo, seasonRepo); diff --git a/core/racing/application/use-cases/SeasonUseCases.ts b/core/racing/application/use-cases/SeasonUseCases.ts index e9d88f2c5..917c21d27 100644 --- a/core/racing/application/use-cases/SeasonUseCases.ts +++ b/core/racing/application/use-cases/SeasonUseCases.ts @@ -178,8 +178,8 @@ export type ManageSeasonLifecycleApplicationError = ApplicationErrorCode< * configuration from a source Season or a league config form. */ export class CreateSeasonForLeagueUseCase { - constructor(private readonly leagueRepository: ILeagueRepository, - private readonly seasonRepository: ISeasonRepository) {} + constructor(private readonly leagueRepository: LeagueRepository, + private readonly seasonRepository: SeasonRepository) {} async execute( command: CreateSeasonForLeagueCommand, @@ -401,8 +401,8 @@ export class CreateSeasonForLeagueUseCase { * ListSeasonsForLeagueUseCase */ export class ListSeasonsForLeagueUseCase { - constructor(private readonly leagueRepository: ILeagueRepository, - private readonly seasonRepository: ISeasonRepository) {} + constructor(private readonly leagueRepository: LeagueRepository, + private readonly seasonRepository: SeasonRepository) {} async execute( query: ListSeasonsForLeagueQuery, @@ -436,8 +436,8 @@ export class ListSeasonsForLeagueUseCase { * GetSeasonDetailsUseCase */ export class GetSeasonDetailsUseCase { - constructor(private readonly leagueRepository: ILeagueRepository, - private readonly seasonRepository: ISeasonRepository) {} + constructor(private readonly leagueRepository: LeagueRepository, + private readonly seasonRepository: SeasonRepository) {} async execute( query: GetSeasonDetailsQuery, @@ -479,8 +479,8 @@ export class GetSeasonDetailsUseCase { * ManageSeasonLifecycleUseCase */ export class ManageSeasonLifecycleUseCase { - constructor(private readonly leagueRepository: ILeagueRepository, - private readonly seasonRepository: ISeasonRepository) {} + constructor(private readonly leagueRepository: LeagueRepository, + private readonly seasonRepository: SeasonRepository) {} async execute( command: ManageSeasonLifecycleCommand, diff --git a/core/racing/application/use-cases/SendFinalResultsUseCase.test.ts b/core/racing/application/use-cases/SendFinalResultsUseCase.test.ts index 46fff35f4..68777ad65 100644 --- a/core/racing/application/use-cases/SendFinalResultsUseCase.test.ts +++ b/core/racing/application/use-cases/SendFinalResultsUseCase.test.ts @@ -43,10 +43,10 @@ describe('SendFinalResultsUseCase', () => { error: vi.fn(), }; useCase = new SendFinalResultsUseCase(notificationService as unknown as NotificationService, - raceEventRepository as unknown as IRaceEventRepository, - resultRepository as unknown as IResultRepository, - leagueRepository as unknown as ILeagueRepository, - membershipRepository as unknown as ILeagueMembershipRepository, + raceEventRepository as unknown as RaceEventRepository, + resultRepository as unknown as ResultRepository, + leagueRepository as unknown as LeagueRepository, + membershipRepository as unknown as LeagueMembershipRepository, logger); }); diff --git a/core/racing/application/use-cases/SendFinalResultsUseCase.ts b/core/racing/application/use-cases/SendFinalResultsUseCase.ts index 77b0aa2c8..4b348e65c 100644 --- a/core/racing/application/use-cases/SendFinalResultsUseCase.ts +++ b/core/racing/application/use-cases/SendFinalResultsUseCase.ts @@ -36,10 +36,10 @@ export type SendFinalResultsErrorCode = */ export class SendFinalResultsUseCase { constructor(private readonly notificationService: NotificationService, - private readonly raceEventRepository: IRaceEventRepository, - private readonly resultRepository: IResultRepository, - private readonly leagueRepository: ILeagueRepository, - private readonly membershipRepository: ILeagueMembershipRepository, + private readonly raceEventRepository: RaceEventRepository, + private readonly resultRepository: ResultRepository, + private readonly leagueRepository: LeagueRepository, + private readonly membershipRepository: LeagueMembershipRepository, private readonly logger: Logger) {} async execute( diff --git a/core/racing/application/use-cases/SendPerformanceSummaryUseCase.test.ts b/core/racing/application/use-cases/SendPerformanceSummaryUseCase.test.ts index 11bce9fe2..ba88787ee 100644 --- a/core/racing/application/use-cases/SendPerformanceSummaryUseCase.test.ts +++ b/core/racing/application/use-cases/SendPerformanceSummaryUseCase.test.ts @@ -46,11 +46,11 @@ describe('SendPerformanceSummaryUseCase', () => { error: vi.fn(), }; useCase = new SendPerformanceSummaryUseCase(notificationService as unknown as NotificationService, - raceEventRepository as unknown as IRaceEventRepository, - resultRepository as unknown as IResultRepository, - leagueRepository as unknown as ILeagueRepository, - membershipRepository as unknown as ILeagueMembershipRepository, - driverRepository as unknown as IDriverRepository, + raceEventRepository as unknown as RaceEventRepository, + resultRepository as unknown as ResultRepository, + leagueRepository as unknown as LeagueRepository, + membershipRepository as unknown as LeagueMembershipRepository, + driverRepository as unknown as DriverRepository, logger); }); diff --git a/core/racing/application/use-cases/SendPerformanceSummaryUseCase.ts b/core/racing/application/use-cases/SendPerformanceSummaryUseCase.ts index af37aeab5..7c382dcf5 100644 --- a/core/racing/application/use-cases/SendPerformanceSummaryUseCase.ts +++ b/core/racing/application/use-cases/SendPerformanceSummaryUseCase.ts @@ -39,11 +39,11 @@ export type SendPerformanceSummaryErrorCode = */ export class SendPerformanceSummaryUseCase { constructor(private readonly notificationService: NotificationService, - private readonly raceEventRepository: IRaceEventRepository, - private readonly resultRepository: IResultRepository, - private readonly leagueRepository: ILeagueRepository, - private readonly membershipRepository: ILeagueMembershipRepository, - private readonly driverRepository: IDriverRepository, + private readonly raceEventRepository: RaceEventRepository, + private readonly resultRepository: ResultRepository, + private readonly leagueRepository: LeagueRepository, + private readonly membershipRepository: LeagueMembershipRepository, + private readonly driverRepository: DriverRepository, private readonly logger: Logger) {} async execute( diff --git a/core/racing/application/use-cases/SubmitProtestDefenseUseCase.test.ts b/core/racing/application/use-cases/SubmitProtestDefenseUseCase.test.ts index 0776757c8..1f1250c45 100644 --- a/core/racing/application/use-cases/SubmitProtestDefenseUseCase.test.ts +++ b/core/racing/application/use-cases/SubmitProtestDefenseUseCase.test.ts @@ -17,8 +17,8 @@ interface MockProtest { } describe('SubmitProtestDefenseUseCase', () => { - let leagueRepository: ILeagueRepository & { findById: ReturnType }; - let protestRepository: IProtestRepository & { findById: ReturnType; update: ReturnType }; + let leagueRepository: LeagueRepository & { findById: ReturnType }; + let protestRepository: ProtestRepository & { findById: ReturnType; update: ReturnType }; let logger: Logger & { error: ReturnType }; let useCase: SubmitProtestDefenseUseCase; @@ -48,7 +48,7 @@ describe('SubmitProtestDefenseUseCase', () => { delete: vi.fn(), exists: vi.fn(), searchByName: vi.fn(), - } as unknown as ILeagueRepository & { findById: ReturnType }; + } as unknown as LeagueRepository & { findById: ReturnType }; protestRepository = { findById: vi.fn(), @@ -60,7 +60,7 @@ describe('SubmitProtestDefenseUseCase', () => { create: vi.fn(), update: vi.fn(), exists: vi.fn(), - } as unknown as IProtestRepository & { + } as unknown as ProtestRepository & { findById: ReturnType; update: ReturnType; }; @@ -72,8 +72,8 @@ describe('SubmitProtestDefenseUseCase', () => { error: vi.fn(), } as unknown as Logger & { error: ReturnType }; - useCase = new SubmitProtestDefenseUseCase(leagueRepository as unknown as ILeagueRepository, - protestRepository as unknown as IProtestRepository, + useCase = new SubmitProtestDefenseUseCase(leagueRepository as unknown as LeagueRepository, + protestRepository as unknown as ProtestRepository, logger as unknown as Logger); }); diff --git a/core/racing/application/use-cases/SubmitProtestDefenseUseCase.ts b/core/racing/application/use-cases/SubmitProtestDefenseUseCase.ts index ab7b9d9a7..c785be8a0 100644 --- a/core/racing/application/use-cases/SubmitProtestDefenseUseCase.ts +++ b/core/racing/application/use-cases/SubmitProtestDefenseUseCase.ts @@ -5,7 +5,7 @@ */ import { Result } from '@core/shared/domain/Result'; -import { Logger } from '@core/shared/application'; +import { Logger } from '@core/shared/domain/Logger'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; import type { LeagueRepository } from '../../domain/repositories/LeagueRepository'; import type { ProtestRepository } from '../../domain/repositories/ProtestRepository'; @@ -33,8 +33,8 @@ export type SubmitProtestDefenseErrorCode = | 'REPOSITORY_ERROR'; export class SubmitProtestDefenseUseCase { - constructor(private readonly leagueRepository: ILeagueRepository, - private readonly protestRepository: IProtestRepository, + constructor(private readonly leagueRepository: LeagueRepository, + private readonly protestRepository: ProtestRepository, private readonly logger: Logger) {} async execute( diff --git a/core/racing/application/use-cases/TeamRatingFactoryUseCase.ts b/core/racing/application/use-cases/TeamRatingFactoryUseCase.ts index 87c6f0c86..42873b84c 100644 --- a/core/racing/application/use-cases/TeamRatingFactoryUseCase.ts +++ b/core/racing/application/use-cases/TeamRatingFactoryUseCase.ts @@ -26,7 +26,7 @@ export interface TeamRatingFactoryOutput { export class TeamRatingFactoryUseCase { constructor( - private readonly teamRaceResultsProvider: ITeamRaceResultsProvider, + private readonly teamRaceResultsProvider: TeamRaceResultsProvider, private readonly logger: Logger ) { this.logger.info('[TeamRatingFactoryUseCase] Initialized'); diff --git a/core/racing/application/use-cases/TeamRatingIntegrationAdapter.ts b/core/racing/application/use-cases/TeamRatingIntegrationAdapter.ts index 0c78cf734..e81024bcf 100644 --- a/core/racing/application/use-cases/TeamRatingIntegrationAdapter.ts +++ b/core/racing/application/use-cases/TeamRatingIntegrationAdapter.ts @@ -26,9 +26,9 @@ export class TeamRatingIntegrationAdapter { private appendUseCase: AppendTeamRatingEventsUseCase; constructor( - private readonly teamRaceResultsProvider: ITeamRaceResultsProvider, - ratingEventRepository: ITeamRatingEventRepository, - ratingRepository: ITeamRatingRepository, + private readonly teamRaceResultsProvider: TeamRaceResultsProvider, + ratingEventRepository: TeamRatingEventRepository, + ratingRepository: TeamRatingRepository, ) { this.appendUseCase = new AppendTeamRatingEventsUseCase( ratingEventRepository, diff --git a/core/racing/application/use-cases/TransferLeagueOwnershipUseCase.ts b/core/racing/application/use-cases/TransferLeagueOwnershipUseCase.ts index 405fb995e..53398bc32 100644 --- a/core/racing/application/use-cases/TransferLeagueOwnershipUseCase.ts +++ b/core/racing/application/use-cases/TransferLeagueOwnershipUseCase.ts @@ -1,5 +1,5 @@ import type { - ILeagueMembershipRepository, + LeagueMembershipRepository, } from '@core/racing/domain/repositories/LeagueMembershipRepository'; import type { Logger } from '@core/shared/domain/Logger'; import { Result } from '@core/shared/domain/Result'; @@ -20,8 +20,8 @@ export type TransferLeagueOwnershipErrorCode = export class TransferLeagueOwnershipUseCase { constructor( - private readonly leagueRepository: ILeagueRepository, - private readonly membershipRepository: ILeagueMembershipRepository, + private readonly leagueRepository: LeagueRepository, + private readonly membershipRepository: LeagueMembershipRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/application/use-cases/UnpublishLeagueSeasonScheduleUseCase.test.ts b/core/racing/application/use-cases/UnpublishLeagueSeasonScheduleUseCase.test.ts index 532e9d1ae..1f336971f 100644 --- a/core/racing/application/use-cases/UnpublishLeagueSeasonScheduleUseCase.test.ts +++ b/core/racing/application/use-cases/UnpublishLeagueSeasonScheduleUseCase.test.ts @@ -44,7 +44,7 @@ describe('UnpublishLeagueSeasonScheduleUseCase', () => { seasonRepository.findById.mockResolvedValue(season); seasonRepository.update.mockResolvedValue(undefined); - const useCase = new UnpublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as ISeasonRepository, + const useCase = new UnpublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as SeasonRepository, logger); const result = await useCase.execute({ leagueId: 'league-1', seasonId: 'season-1' }); @@ -61,7 +61,7 @@ describe('UnpublishLeagueSeasonScheduleUseCase', () => { const season = createSeasonWithinWindow({ leagueId: 'other-league' }).withSchedulePublished(true); seasonRepository.findById.mockResolvedValue(season); - const useCase = new UnpublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as ISeasonRepository, + const useCase = new UnpublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as SeasonRepository, logger); const result = await useCase.execute({ leagueId: 'league-1', seasonId: 'season-1' }); @@ -78,7 +78,7 @@ describe('UnpublishLeagueSeasonScheduleUseCase', () => { it('returns SEASON_NOT_FOUND when season does not exist', async () => { seasonRepository.findById.mockResolvedValue(null); - const useCase = new UnpublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as ISeasonRepository, + const useCase = new UnpublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as SeasonRepository, logger); const result = await useCase.execute({ leagueId: 'league-1', seasonId: 'season-1' }); @@ -96,7 +96,7 @@ describe('UnpublishLeagueSeasonScheduleUseCase', () => { const repositoryError = new Error('DB connection failed'); seasonRepository.findById.mockRejectedValue(repositoryError); - const useCase = new UnpublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as ISeasonRepository, + const useCase = new UnpublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as SeasonRepository, logger); const result = await useCase.execute({ leagueId: 'league-1', seasonId: 'season-1' }); @@ -116,7 +116,7 @@ describe('UnpublishLeagueSeasonScheduleUseCase', () => { seasonRepository.findById.mockResolvedValue(season); seasonRepository.update.mockRejectedValue(repositoryError); - const useCase = new UnpublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as ISeasonRepository, + const useCase = new UnpublishLeagueSeasonScheduleUseCase(seasonRepository as unknown as SeasonRepository, logger); const result = await useCase.execute({ leagueId: 'league-1', seasonId: 'season-1' }); diff --git a/core/racing/application/use-cases/UnpublishLeagueSeasonScheduleUseCase.ts b/core/racing/application/use-cases/UnpublishLeagueSeasonScheduleUseCase.ts index b89a5fd6c..13ef952cb 100644 --- a/core/racing/application/use-cases/UnpublishLeagueSeasonScheduleUseCase.ts +++ b/core/racing/application/use-cases/UnpublishLeagueSeasonScheduleUseCase.ts @@ -15,7 +15,7 @@ export type UnpublishLeagueSeasonScheduleErrorCode = | 'REPOSITORY_ERROR'; export class UnpublishLeagueSeasonScheduleUseCase { - constructor(private readonly seasonRepository: ISeasonRepository, + constructor(private readonly seasonRepository: SeasonRepository, private readonly logger: Logger) {} async execute( diff --git a/core/racing/application/use-cases/UpdateDriverProfileUseCase.test.ts b/core/racing/application/use-cases/UpdateDriverProfileUseCase.test.ts index 29516d92a..0eced0605 100644 --- a/core/racing/application/use-cases/UpdateDriverProfileUseCase.test.ts +++ b/core/racing/application/use-cases/UpdateDriverProfileUseCase.test.ts @@ -12,7 +12,7 @@ import { Result } from '@core/shared/domain/Result'; import type { Logger } from '@core/shared/application/Logger'; describe('UpdateDriverProfileUseCase', () => { - let driverRepository: IDriverRepository; + let driverRepository: DriverRepository; let logger: Logger & { error: ReturnType }; let useCase: UpdateDriverProfileUseCase; @@ -20,7 +20,7 @@ describe('UpdateDriverProfileUseCase', () => { driverRepository = { findById: vi.fn(), update: vi.fn(), - } as unknown as IDriverRepository; + } as unknown as DriverRepository; logger = { debug: vi.fn(), diff --git a/core/racing/application/use-cases/UpdateDriverProfileUseCase.ts b/core/racing/application/use-cases/UpdateDriverProfileUseCase.ts index 41e9b997f..d3c38fa38 100644 --- a/core/racing/application/use-cases/UpdateDriverProfileUseCase.ts +++ b/core/racing/application/use-cases/UpdateDriverProfileUseCase.ts @@ -1,5 +1,5 @@ import { Result } from '@core/shared/domain/Result'; -import type { UseCase } from '@core/shared/application'; +import type { UseCase } from '@core/shared/application/UseCase'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; import type { Logger } from '@core/shared/application/Logger'; import type { DriverRepository } from '../../domain/repositories/DriverRepository'; @@ -26,7 +26,7 @@ export type UpdateDriverProfileErrorCode = export class UpdateDriverProfileUseCase implements UseCase { - constructor(private readonly driverRepository: IDriverRepository, + constructor(private readonly driverRepository: DriverRepository, private readonly logger: Logger) {} async execute( diff --git a/core/racing/application/use-cases/UpdateLeagueMemberRoleUseCase.ts b/core/racing/application/use-cases/UpdateLeagueMemberRoleUseCase.ts index 67eb791c2..ed462dc87 100644 --- a/core/racing/application/use-cases/UpdateLeagueMemberRoleUseCase.ts +++ b/core/racing/application/use-cases/UpdateLeagueMemberRoleUseCase.ts @@ -21,7 +21,7 @@ export type UpdateLeagueMemberRoleErrorCode = | 'REPOSITORY_ERROR'; export class UpdateLeagueMemberRoleUseCase { - constructor(private readonly leagueMembershipRepository: ILeagueMembershipRepository) {} + constructor(private readonly leagueMembershipRepository: LeagueMembershipRepository) {} async execute( input: UpdateLeagueMemberRoleInput, diff --git a/core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase.test.ts b/core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase.test.ts index fb75596cd..a198bf681 100644 --- a/core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase.test.ts +++ b/core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase.test.ts @@ -57,8 +57,8 @@ describe('UpdateLeagueSeasonScheduleRaceUseCase', () => { raceRepository.findById.mockResolvedValue(existing); raceRepository.update.mockImplementation(async (race: Race) => race); - const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const newScheduledAt = new Date('2025-01-20T20:00:00Z'); @@ -95,8 +95,8 @@ describe('UpdateLeagueSeasonScheduleRaceUseCase', () => { raceRepository.findById.mockResolvedValue(existing); raceRepository.update.mockImplementation(async (race: Race) => race); - const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -128,8 +128,8 @@ describe('UpdateLeagueSeasonScheduleRaceUseCase', () => { raceRepository.findById.mockResolvedValue(existing); raceRepository.update.mockImplementation(async (race: Race) => race); - const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -161,8 +161,8 @@ describe('UpdateLeagueSeasonScheduleRaceUseCase', () => { raceRepository.findById.mockResolvedValue(existing); raceRepository.update.mockImplementation(async (race: Race) => race); - const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const newScheduledAt = new Date('2025-01-15T20:00:00Z'); @@ -185,8 +185,8 @@ describe('UpdateLeagueSeasonScheduleRaceUseCase', () => { const season = createSeasonWithinWindow({ leagueId: 'other-league' }); seasonRepository.findById.mockResolvedValue(season); - const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -219,8 +219,8 @@ describe('UpdateLeagueSeasonScheduleRaceUseCase', () => { }); raceRepository.findById.mockResolvedValue(existing); - const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -244,8 +244,8 @@ describe('UpdateLeagueSeasonScheduleRaceUseCase', () => { seasonRepository.findById.mockResolvedValue(season); raceRepository.findById.mockResolvedValue(null); - const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -277,8 +277,8 @@ describe('UpdateLeagueSeasonScheduleRaceUseCase', () => { }); raceRepository.findById.mockResolvedValue(existing); - const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -310,8 +310,8 @@ describe('UpdateLeagueSeasonScheduleRaceUseCase', () => { }); raceRepository.findById.mockResolvedValue(existing); - const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); // Mock Race.create to throw @@ -345,8 +345,8 @@ describe('UpdateLeagueSeasonScheduleRaceUseCase', () => { seasonRepository.findById.mockResolvedValue(season); raceRepository.findById.mockRejectedValue(repositoryError); - const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -379,8 +379,8 @@ describe('UpdateLeagueSeasonScheduleRaceUseCase', () => { raceRepository.findById.mockResolvedValue(existing); raceRepository.update.mockRejectedValue(repositoryError); - const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ @@ -402,8 +402,8 @@ describe('UpdateLeagueSeasonScheduleRaceUseCase', () => { it('returns SEASON_NOT_FOUND when season does not exist', async () => { seasonRepository.findById.mockResolvedValue(null); - const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as ISeasonRepository, - raceRepository as unknown as IRaceRepository, + const useCase = new UpdateLeagueSeasonScheduleRaceUseCase(seasonRepository as unknown as SeasonRepository, + raceRepository as unknown as RaceRepository, logger); const result = await useCase.execute({ diff --git a/core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase.ts b/core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase.ts index ac5daa126..52c9d0a32 100644 --- a/core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase.ts +++ b/core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase.ts @@ -27,8 +27,8 @@ export type UpdateLeagueSeasonScheduleRaceErrorCode = | 'REPOSITORY_ERROR'; export class UpdateLeagueSeasonScheduleRaceUseCase { - constructor(private readonly seasonRepository: ISeasonRepository, - private readonly raceRepository: IRaceRepository, + constructor(private readonly seasonRepository: SeasonRepository, + private readonly raceRepository: RaceRepository, private readonly logger: Logger) {} async execute( diff --git a/core/racing/application/use-cases/UpdateTeamUseCase.test.ts b/core/racing/application/use-cases/UpdateTeamUseCase.test.ts index 2c8039b95..498c53414 100644 --- a/core/racing/application/use-cases/UpdateTeamUseCase.test.ts +++ b/core/racing/application/use-cases/UpdateTeamUseCase.test.ts @@ -20,11 +20,11 @@ describe('UpdateTeamUseCase', () => { const mockTeamRepository = { findById: vi.fn().mockResolvedValue(mockTeam), update: vi.fn().mockResolvedValue(undefined), - } as unknown as ITeamRepository; + } as unknown as TeamRepository; const mockMembershipRepository = { getMembership: vi.fn().mockResolvedValue(mockMembership), - } as unknown as ITeamMembershipRepository; + } as unknown as TeamMembershipRepository; const present = vi.fn<(data: UpdateTeamResult) => void>(); const output: { present: typeof present } = { @@ -57,14 +57,14 @@ describe('UpdateTeamUseCase', () => { const mockMembershipRepository = { getMembership: vi.fn().mockResolvedValue(mockMembership), - } as unknown as ITeamMembershipRepository; + } as unknown as TeamMembershipRepository; const present = vi.fn<(data: UpdateTeamResult) => void>(); const output: { present: typeof present } = { present, }; - const useCase = new UpdateTeamUseCase({} as unknown as ITeamRepository, mockMembershipRepository); + const useCase = new UpdateTeamUseCase({} as unknown as TeamRepository, mockMembershipRepository); const command: UpdateTeamInput = { teamId: 'team-1', @@ -88,11 +88,11 @@ describe('UpdateTeamUseCase', () => { const mockTeamRepository = { findById: vi.fn().mockResolvedValue(null), - } as unknown as ITeamRepository; + } as unknown as TeamRepository; const mockMembershipRepository = { getMembership: vi.fn().mockResolvedValue(mockMembership), - } as unknown as ITeamMembershipRepository; + } as unknown as TeamMembershipRepository; const present = vi.fn<(data: UpdateTeamResult) => void>(); const output: { present: typeof present } = { @@ -123,11 +123,11 @@ describe('UpdateTeamUseCase', () => { const mockTeamRepository = { findById: vi.fn().mockRejectedValue(new Error('db error')), - } as unknown as ITeamRepository; + } as unknown as TeamRepository; const mockMembershipRepository = { getMembership: vi.fn().mockResolvedValue(mockMembership), - } as unknown as ITeamMembershipRepository; + } as unknown as TeamMembershipRepository; const present = vi.fn<(data: UpdateTeamResult) => void>(); const output: { present: typeof present } = { diff --git a/core/racing/application/use-cases/UpdateTeamUseCase.ts b/core/racing/application/use-cases/UpdateTeamUseCase.ts index f65b64210..94730a138 100644 --- a/core/racing/application/use-cases/UpdateTeamUseCase.ts +++ b/core/racing/application/use-cases/UpdateTeamUseCase.ts @@ -22,8 +22,8 @@ export type UpdateTeamResult = { export type UpdateTeamErrorCode = 'TEAM_NOT_FOUND' | 'PERMISSION_DENIED' | 'REPOSITORY_ERROR'; export class UpdateTeamUseCase { - constructor(private readonly teamRepository: ITeamRepository, - private readonly membershipRepository: ITeamMembershipRepository) {} + constructor(private readonly teamRepository: TeamRepository, + private readonly membershipRepository: TeamMembershipRepository) {} async execute( command: UpdateTeamInput, diff --git a/core/racing/application/use-cases/WithdrawFromLeagueWalletUseCase.ts b/core/racing/application/use-cases/WithdrawFromLeagueWalletUseCase.ts index a1881f1b5..bb5931e41 100644 --- a/core/racing/application/use-cases/WithdrawFromLeagueWalletUseCase.ts +++ b/core/racing/application/use-cases/WithdrawFromLeagueWalletUseCase.ts @@ -32,9 +32,9 @@ export type WithdrawFromLeagueWalletErrorCode = * Use Case for withdrawing from league wallet. */ export class WithdrawFromLeagueWalletUseCase { - constructor(private readonly leagueRepository: ILeagueRepository, - private readonly walletRepository: ILeagueWalletRepository, - private readonly transactionRepository: ITransactionRepository, + constructor(private readonly leagueRepository: LeagueRepository, + private readonly walletRepository: LeagueWalletRepository, + private readonly transactionRepository: TransactionRepository, private readonly logger: Logger) {} async execute( diff --git a/core/racing/application/use-cases/WithdrawFromRaceUseCase.ts b/core/racing/application/use-cases/WithdrawFromRaceUseCase.ts index d992a44b3..06d67c008 100644 --- a/core/racing/application/use-cases/WithdrawFromRaceUseCase.ts +++ b/core/racing/application/use-cases/WithdrawFromRaceUseCase.ts @@ -26,8 +26,8 @@ export type WithdrawFromRaceErrorCode = */ export class WithdrawFromRaceUseCase { constructor( - private readonly raceRepository: IRaceRepository, - private readonly registrationRepository: IRaceRegistrationRepository, + private readonly raceRepository: RaceRepository, + private readonly registrationRepository: RaceRegistrationRepository, private readonly logger: Logger, ) {} diff --git a/core/racing/domain/entities/Car.ts b/core/racing/domain/entities/Car.ts index 28b0efe29..7d22ca164 100644 --- a/core/racing/domain/entities/Car.ts +++ b/core/racing/domain/entities/Car.ts @@ -5,7 +5,7 @@ * Immutable entity with factory methods and domain validation. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; import { CarClass, CarClassType } from './CarClass'; import { CarId } from './CarId'; @@ -18,8 +18,7 @@ import { Manufacturer } from './Manufacturer'; import { Weight } from './Weight'; import { Year } from './Year'; -export class Car implements Entity { - readonly id: CarId; +export class Car extends Entity { readonly name: CarName; readonly shortName: string; readonly manufacturer: Manufacturer; @@ -44,7 +43,8 @@ export class Car implements Entity { imageUrl?: ImageUrl; gameId: GameId; }) { - this.id = props.id; + super(props.id); + this.name = props.name; this.shortName = props.shortName; this.manufacturer = props.manufacturer; diff --git a/core/racing/domain/entities/Driver.ts b/core/racing/domain/entities/Driver.ts index 8547d5a54..bcd8636b5 100644 --- a/core/racing/domain/entities/Driver.ts +++ b/core/racing/domain/entities/Driver.ts @@ -6,7 +6,7 @@ */ import { MediaReference } from '@core/domain/media/MediaReference'; -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; import { CountryCode } from '../value-objects/CountryCode'; import { DriverBio } from '../value-objects/driver/DriverBio'; @@ -14,8 +14,7 @@ import { DriverName } from '../value-objects/driver/DriverName'; import { JoinedAt } from '../value-objects/JoinedAt'; import { IRacingId } from '../value-objects/RacingId'; -export class Driver implements Entity { - readonly id: string; +export class Driver extends Entity { readonly iracingId: IRacingId; readonly name: DriverName; readonly country: CountryCode; @@ -34,7 +33,8 @@ export class Driver implements Entity { category?: string; avatarRef: MediaReference; }) { - this.id = props.id; + super(props.id); + this.iracingId = props.iracingId; this.name = props.name; this.country = props.country; diff --git a/core/racing/domain/entities/DriverLivery.ts b/core/racing/domain/entities/DriverLivery.ts index 04c149605..584ce92b5 100644 --- a/core/racing/domain/entities/DriverLivery.ts +++ b/core/racing/domain/entities/DriverLivery.ts @@ -5,7 +5,7 @@ * Includes user-placed decals and league-specific overrides. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError'; import { CarId } from '../value-objects/CarId'; @@ -28,8 +28,7 @@ export interface DriverLiveryProps { validatedAt: Date | undefined; } -export class DriverLivery implements Entity { - readonly id: string; +export class DriverLivery extends Entity { readonly driverId: DriverId; readonly gameId: GameId; readonly carId: CarId; @@ -41,7 +40,8 @@ export class DriverLivery implements Entity { readonly validatedAt: Date | undefined; private constructor(props: DriverLiveryProps) { - this.id = props.id; + super(props.id); + this.driverId = props.driverId; this.gameId = props.gameId; this.carId = props.carId; diff --git a/core/racing/domain/entities/Game.ts b/core/racing/domain/entities/Game.ts index 8a49d5e2d..c0e4a27f7 100644 --- a/core/racing/domain/entities/Game.ts +++ b/core/racing/domain/entities/Game.ts @@ -1,13 +1,13 @@ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { GameId } from './GameId'; import { GameName } from './GameName'; -export class Game implements Entity { - readonly id: GameId; +export class Game extends Entity { readonly name: GameName; private constructor(props: { id: GameId; name: GameName }) { - this.id = props.id; + super(props.id); + this.name = props.name; } diff --git a/core/racing/domain/entities/JoinRequest.ts b/core/racing/domain/entities/JoinRequest.ts index c7eb0d70e..36f142a27 100644 --- a/core/racing/domain/entities/JoinRequest.ts +++ b/core/racing/domain/entities/JoinRequest.ts @@ -4,7 +4,7 @@ * Represents a request to join a league. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; import { JoinedAt } from '../value-objects/JoinedAt'; import { LeagueId } from './LeagueId'; @@ -18,15 +18,15 @@ export interface JoinRequestProps { message?: string; } -export class JoinRequest implements Entity { - readonly id: string; +export class JoinRequest extends Entity { readonly leagueId: LeagueId; readonly driverId: LeagueOwnerId; readonly requestedAt: JoinedAt; readonly message: string | undefined; private constructor(props: { id: string; leagueId: string; driverId: string; requestedAt: Date; message?: string }) { - this.id = props.id; + super(props.id); + this.leagueId = LeagueId.create(props.leagueId); this.driverId = LeagueOwnerId.create(props.driverId); this.requestedAt = JoinedAt.create(props.requestedAt); diff --git a/core/racing/domain/entities/League.ts b/core/racing/domain/entities/League.ts index 7ac3359d4..a22489f68 100644 --- a/core/racing/domain/entities/League.ts +++ b/core/racing/domain/entities/League.ts @@ -6,7 +6,7 @@ */ import { MediaReference } from '@core/domain/media/MediaReference'; -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError'; import { LeagueVisibility, LeagueVisibilityType } from '../value-objects/LeagueVisibility'; import { MaxParticipants } from '../value-objects/MaxParticipants'; @@ -91,8 +91,7 @@ export interface LeagueSettings { visibility?: LeagueVisibilityType; } -export class League implements Entity { - readonly id: LeagueId; +export class League extends Entity { readonly name: LeagueName; readonly description: LeagueDescription; readonly ownerId: LeagueOwnerId; @@ -119,7 +118,8 @@ export class League implements Entity { visibility: LeagueVisibility; logoRef: MediaReference; }) { - this.id = props.id; + super(props.id); + this.name = props.name; this.description = props.description; this.ownerId = props.ownerId; diff --git a/core/racing/domain/entities/LeagueMembership.ts b/core/racing/domain/entities/LeagueMembership.ts index 32fb9240b..daca55f94 100644 --- a/core/racing/domain/entities/LeagueMembership.ts +++ b/core/racing/domain/entities/LeagueMembership.ts @@ -4,7 +4,7 @@ * Represents a driver's membership in a league. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; import { JoinedAt } from '../value-objects/JoinedAt'; import { DriverId } from './DriverId'; @@ -22,8 +22,7 @@ export interface LeagueMembershipProps { joinedAt?: Date; } -export class LeagueMembership implements Entity { - readonly id: string; +export class LeagueMembership extends Entity { readonly leagueId: LeagueId; readonly driverId: DriverId; readonly role: MembershipRole; @@ -38,7 +37,8 @@ export class LeagueMembership implements Entity { status: MembershipStatus; joinedAt: JoinedAt; }) { - this.id = props.id; + super(props.id); + this.leagueId = props.leagueId; this.driverId = props.driverId; this.role = props.role; diff --git a/core/racing/domain/entities/LeagueScoringConfig.ts b/core/racing/domain/entities/LeagueScoringConfig.ts index 4ae74ef83..846d55bc6 100644 --- a/core/racing/domain/entities/LeagueScoringConfig.ts +++ b/core/racing/domain/entities/LeagueScoringConfig.ts @@ -4,7 +4,7 @@ * Represents the scoring configuration for a league season. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; import type { ChampionshipConfig } from '../types/ChampionshipConfig'; import { LeagueScoringConfigId } from './LeagueScoringConfigId'; @@ -25,8 +25,7 @@ export interface LeagueScoringConfigRehydrateProps { championships: ChampionshipConfig[]; } -export class LeagueScoringConfig implements Entity { - readonly id: LeagueScoringConfigId; +export class LeagueScoringConfig extends Entity { readonly seasonId: SeasonId; readonly scoringPresetId: ScoringPresetId | undefined; readonly championships: ChampionshipConfig[]; @@ -37,7 +36,8 @@ export class LeagueScoringConfig implements Entity { scoringPresetId?: ScoringPresetId; championships: ChampionshipConfig[]; }) { - this.id = props.id; + super(props.id); + this.seasonId = props.seasonId; this.scoringPresetId = props.scoringPresetId; this.championships = props.championships; diff --git a/core/racing/domain/entities/LiveryTemplate.ts b/core/racing/domain/entities/LiveryTemplate.ts index 1b7e4433e..209d45609 100644 --- a/core/racing/domain/entities/LiveryTemplate.ts +++ b/core/racing/domain/entities/LiveryTemplate.ts @@ -5,7 +5,7 @@ * Contains base image and sponsor decal placements. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError'; import { CarId } from '../value-objects/CarId'; import type { LiveryDecal } from '../value-objects/LiveryDecal'; @@ -16,8 +16,7 @@ import { LiveryTemplateId } from './LiveryTemplateId'; import { LiveryTemplateUpdatedAt } from './LiveryTemplateUpdatedAt'; import { SeasonId } from './season/SeasonId'; -export class LiveryTemplate implements Entity { - readonly id: LiveryTemplateId; +export class LiveryTemplate extends Entity { readonly leagueId: LeagueId; readonly seasonId: SeasonId; readonly carId: CarId; @@ -36,7 +35,8 @@ export class LiveryTemplate implements Entity { createdAt: LiveryTemplateCreatedAt; updatedAt?: LiveryTemplateUpdatedAt; }) { - this.id = props.id; + super(props.id); + this.leagueId = props.leagueId; this.seasonId = props.seasonId; this.carId = props.carId; diff --git a/core/racing/domain/entities/Protest.ts b/core/racing/domain/entities/Protest.ts index 37074ef49..48b4784be 100644 --- a/core/racing/domain/entities/Protest.ts +++ b/core/racing/domain/entities/Protest.ts @@ -11,7 +11,7 @@ * - dismissed: Protest was dismissed (no action taken) * - withdrawn: Protesting driver withdrew the protest */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError'; import { DecisionNotes } from './DecisionNotes'; import { DefenseRequestedAt } from './DefenseRequestedAt'; @@ -58,8 +58,9 @@ export interface ProtestProps { defenseRequestedBy?: StewardId; } -export class Protest implements Entity { - private constructor(private readonly props: ProtestProps) {} +export class Protest extends Entity { + private constructor(private readonly props: ProtestProps) { + super(props.id);} static create(props: { id: string; diff --git a/core/racing/domain/entities/Race.ts b/core/racing/domain/entities/Race.ts index 705365e02..9567f30fe 100644 --- a/core/racing/domain/entities/Race.ts +++ b/core/racing/domain/entities/Race.ts @@ -5,7 +5,7 @@ * Immutable entity with factory methods and domain validation. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError'; import { MaxParticipants } from '../value-objects/MaxParticipants'; import { ParticipantCount } from '../value-objects/ParticipantCount'; @@ -15,8 +15,7 @@ import { StrengthOfField } from '../value-objects/StrengthOfField'; export type { RaceStatus, RaceStatusValue } from '../value-objects/RaceStatus'; -export class Race implements Entity { - readonly id: string; +export class Race extends Entity { readonly leagueId: string; readonly scheduledAt: Date; readonly track: string; @@ -60,7 +59,8 @@ export class Race implements Entity { registeredCount?: ParticipantCount; maxParticipants?: MaxParticipants; }) { - this.id = props.id; + super(props.id); + this.leagueId = props.leagueId; this.scheduledAt = props.scheduledAt; this.track = props.track; diff --git a/core/racing/domain/entities/RaceEvent.ts b/core/racing/domain/entities/RaceEvent.ts index 6aef807c2..da1474602 100644 --- a/core/racing/domain/entities/RaceEvent.ts +++ b/core/racing/domain/entities/RaceEvent.ts @@ -5,15 +5,14 @@ * Immutable aggregate root with factory methods and domain validation. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError'; import { SessionType } from '../value-objects/SessionType'; import type { Session } from './Session'; export type RaceEventStatus = 'scheduled' | 'in_progress' | 'awaiting_stewarding' | 'closed' | 'cancelled'; -export class RaceEvent implements Entity { - readonly id: string; +export class RaceEvent extends Entity { readonly seasonId: string; readonly leagueId: string; readonly name: string; @@ -30,7 +29,8 @@ export class RaceEvent implements Entity { status: RaceEventStatus; stewardingClosesAt?: Date; }) { - this.id = props.id; + super(props.id); + this.seasonId = props.seasonId; this.leagueId = props.leagueId; this.name = props.name; diff --git a/core/racing/domain/entities/RaceRegistration.ts b/core/racing/domain/entities/RaceRegistration.ts index 3c6485ecd..d57ae44ba 100644 --- a/core/racing/domain/entities/RaceRegistration.ts +++ b/core/racing/domain/entities/RaceRegistration.ts @@ -4,7 +4,7 @@ * Represents a registration of a driver for a specific race. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; import { DriverId } from './DriverId'; import { RaceId } from './RaceId'; @@ -17,9 +17,8 @@ export interface RaceRegistrationProps { registeredAt?: Date; } -export class RaceRegistration implements Entity { - readonly id: string; - readonly raceId: RaceId; +export class RaceRegistration extends Entity { + readonly raceId: RaceId; readonly driverId: DriverId; readonly registeredAt: RegisteredAt; @@ -29,7 +28,8 @@ export class RaceRegistration implements Entity { driverId: DriverId; registeredAt: RegisteredAt; }) { - this.id = props.id; + super(props.id); + this.raceId = props.raceId; this.driverId = props.driverId; this.registeredAt = props.registeredAt; diff --git a/core/racing/domain/entities/ResultWithIncidents.ts b/core/racing/domain/entities/ResultWithIncidents.ts index 6472ffe10..fe09daaa5 100644 --- a/core/racing/domain/entities/ResultWithIncidents.ts +++ b/core/racing/domain/entities/ResultWithIncidents.ts @@ -2,7 +2,7 @@ * Enhanced Result entity with detailed incident tracking */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; import { RaceIncidents, type IncidentRecord } from '../value-objects/RaceIncidents'; import { DriverId } from './DriverId'; @@ -10,8 +10,7 @@ import { RaceId } from './RaceId'; import { LapTime } from './result/LapTime'; import { Position } from './result/Position'; -export class ResultWithIncidents implements Entity { - readonly id: string; +export class ResultWithIncidents extends Entity { readonly raceId: RaceId; readonly driverId: DriverId; readonly position: Position; @@ -28,7 +27,8 @@ export class ResultWithIncidents implements Entity { incidents: RaceIncidents; startPosition: Position; }) { - this.id = props.id; + super(props.id); + this.raceId = props.raceId; this.driverId = props.driverId; this.position = props.position; diff --git a/core/racing/domain/entities/Session.ts b/core/racing/domain/entities/Session.ts index 78956e7f0..f131eddcb 100644 --- a/core/racing/domain/entities/Session.ts +++ b/core/racing/domain/entities/Session.ts @@ -5,14 +5,13 @@ * Immutable entity with factory methods and domain validation. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError'; import type { SessionType } from '../value-objects/SessionType'; export type SessionStatus = 'scheduled' | 'running' | 'completed' | 'cancelled'; -export class Session implements Entity { - readonly id: string; +export class Session extends Entity { readonly raceEventId: string; readonly scheduledAt: Date; readonly track: string; @@ -39,7 +38,8 @@ export class Session implements Entity { registeredCount?: number; maxParticipants?: number; }) { - this.id = props.id; + super(props.id); + this.raceEventId = props.raceEventId; this.scheduledAt = props.scheduledAt; this.track = props.track; diff --git a/core/racing/domain/entities/SponsorshipRequest.ts b/core/racing/domain/entities/SponsorshipRequest.ts index ad68cbbef..4bb0b99b5 100644 --- a/core/racing/domain/entities/SponsorshipRequest.ts +++ b/core/racing/domain/entities/SponsorshipRequest.ts @@ -5,7 +5,7 @@ * (driver, team, race, or league/season). The entity owner must approve/reject. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError'; import type { Money } from '../value-objects/Money'; @@ -29,8 +29,7 @@ export interface SponsorshipRequestProps { rejectionReason?: string; } -export class SponsorshipRequest implements Entity { - readonly id: string; +export class SponsorshipRequest extends Entity { readonly sponsorId: string; readonly entityType: SponsorableEntityType; readonly entityId: string; @@ -44,7 +43,8 @@ export class SponsorshipRequest implements Entity { readonly rejectionReason: string | undefined; private constructor(props: SponsorshipRequestProps) { - this.id = props.id; + super(props.id); + this.sponsorId = props.sponsorId; this.entityType = props.entityType; this.entityId = props.entityId; diff --git a/core/racing/domain/entities/Standing.ts b/core/racing/domain/entities/Standing.ts index e72f5d41e..17ae79d34 100644 --- a/core/racing/domain/entities/Standing.ts +++ b/core/racing/domain/entities/Standing.ts @@ -6,15 +6,14 @@ */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; import { Points } from '../value-objects/Points'; import { Position } from './championship/Position'; import { DriverId } from './DriverId'; import { LeagueId } from './LeagueId'; -export class Standing implements Entity { - readonly id: string; +export class Standing extends Entity { readonly leagueId: LeagueId; readonly driverId: DriverId; readonly points: Points; @@ -31,7 +30,8 @@ export class Standing implements Entity { position: Position; racesCompleted: number; }) { - this.id = props.id; + super(props.id); + this.leagueId = props.leagueId; this.driverId = props.driverId; this.points = props.points; diff --git a/core/racing/domain/entities/Team.ts b/core/racing/domain/entities/Team.ts index 0558e146b..ec1e7d330 100644 --- a/core/racing/domain/entities/Team.ts +++ b/core/racing/domain/entities/Team.ts @@ -2,12 +2,12 @@ * Domain Entity: Team * * Represents a racing team in the GridPilot platform. - * Implements the shared IEntity contract and encapsulates + * Implements the shared Entity contract and encapsulates * basic invariants around identity and core properties. */ import { MediaReference } from '@core/domain/media/MediaReference'; -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; import { TeamCreatedAt } from '../value-objects/TeamCreatedAt'; import { TeamDescription } from '../value-objects/TeamDescription'; @@ -16,8 +16,7 @@ import { TeamTag } from '../value-objects/TeamTag'; import { DriverId } from './DriverId'; import { LeagueId } from './LeagueId'; -export class Team implements Entity { - readonly id: string; +export class Team extends Entity { readonly name: TeamName; readonly tag: TeamTag; readonly description: TeamDescription; @@ -40,7 +39,8 @@ export class Team implements Entity { createdAt: TeamCreatedAt; logoRef: MediaReference; }) { - this.id = props.id; + super(props.id); + this.name = props.name; this.tag = props.tag; this.description = props.description; diff --git a/core/racing/domain/entities/TeamRatingEvent.ts b/core/racing/domain/entities/TeamRatingEvent.ts index 7b3743d59..4ce25b5c4 100644 --- a/core/racing/domain/entities/TeamRatingEvent.ts +++ b/core/racing/domain/entities/TeamRatingEvent.ts @@ -1,4 +1,4 @@ -import type { Entity, IEntity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError'; import { TeamRatingDelta } from '../value-objects/TeamRatingDelta'; import { TeamRatingDimensionKey } from '../value-objects/TeamRatingDimensionKey'; @@ -32,8 +32,7 @@ export interface TeamRatingEventProps { version: number; } -export class TeamRatingEvent implements Entity { - readonly id: TeamRatingEventId; +export class TeamRatingEvent extends Entity { readonly teamId: string; readonly dimension: TeamRatingDimensionKey; readonly delta: TeamRatingDelta; @@ -46,7 +45,8 @@ export class TeamRatingEvent implements Entity { readonly version: number; private constructor(props: TeamRatingEventProps) { - this.id = props.id; + super(props.id); + this.teamId = props.teamId; this.dimension = props.dimension; this.delta = props.delta; @@ -156,7 +156,7 @@ export class TeamRatingEvent implements Entity { /** * Compare with another event. */ - equals(other: IEntity): boolean { + equals(other: Entity): boolean { return this.id.equals(other.id); } diff --git a/core/racing/domain/entities/Track.ts b/core/racing/domain/entities/Track.ts index 121f7cbb9..6d063d781 100644 --- a/core/racing/domain/entities/Track.ts +++ b/core/racing/domain/entities/Track.ts @@ -5,7 +5,7 @@ * Immutable entity with factory methods and domain validation. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; import { TrackCountry } from '../value-objects/TrackCountry'; import { TrackGameId } from '../value-objects/TrackGameId'; @@ -18,8 +18,7 @@ import { TrackTurns } from '../value-objects/TrackTurns'; export type TrackCategory = 'oval' | 'road' | 'street' | 'dirt'; export type TrackDifficulty = 'beginner' | 'intermediate' | 'advanced' | 'expert'; -export class Track implements Entity { - readonly id: string; +export class Track extends Entity { readonly name: TrackName; readonly shortName: TrackShortName; readonly country: TrackCountry; @@ -42,7 +41,8 @@ export class Track implements Entity { imageUrl: TrackImageUrl; gameId: TrackGameId; }) { - this.id = props.id; + super(props.id); + this.name = props.name; this.shortName = props.shortName; this.country = props.country; diff --git a/core/racing/domain/entities/championship/ChampionshipStanding.ts b/core/racing/domain/entities/championship/ChampionshipStanding.ts index c7b13af64..52afae42d 100644 --- a/core/racing/domain/entities/championship/ChampionshipStanding.ts +++ b/core/racing/domain/entities/championship/ChampionshipStanding.ts @@ -1,12 +1,11 @@ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainValidationError } from '../../errors/RacingDomainError'; import type { ParticipantRef } from '../../types/ParticipantRef'; import { Points } from '../../value-objects/Points'; import { Position } from './Position'; import { ResultsCount } from './ResultsCount'; -export class ChampionshipStanding implements Entity { - readonly id: string; +export class ChampionshipStanding extends Entity { readonly seasonId: string; readonly championshipId: string; readonly participant: ParticipantRef; @@ -24,6 +23,7 @@ export class ChampionshipStanding implements Entity { resultsDropped: number; position: number; }) { + super(props.id); this.seasonId = props.seasonId; this.championshipId = props.championshipId; this.participant = props.participant; diff --git a/core/racing/domain/entities/league-wallet/LeagueWallet.ts b/core/racing/domain/entities/league-wallet/LeagueWallet.ts index 7ae952d13..852cb1195 100644 --- a/core/racing/domain/entities/league-wallet/LeagueWallet.ts +++ b/core/racing/domain/entities/league-wallet/LeagueWallet.ts @@ -5,7 +5,7 @@ * Aggregate root for managing league finances and transactions. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../../errors/RacingDomainError'; import type { Money } from '../../value-objects/Money'; @@ -21,15 +21,15 @@ export interface LeagueWalletProps { createdAt: Date; } -export class LeagueWallet implements Entity { - readonly id: LeagueWalletId; +export class LeagueWallet extends Entity { readonly leagueId: LeagueId; readonly balance: Money; readonly transactionIds: TransactionId[]; readonly createdAt: Date; private constructor(props: LeagueWalletProps) { - this.id = props.id; + super(props.id); + this.leagueId = props.leagueId; this.balance = props.balance; this.transactionIds = props.transactionIds; diff --git a/core/racing/domain/entities/league-wallet/Transaction.ts b/core/racing/domain/entities/league-wallet/Transaction.ts index 2467f9576..b144a8a79 100644 --- a/core/racing/domain/entities/league-wallet/Transaction.ts +++ b/core/racing/domain/entities/league-wallet/Transaction.ts @@ -6,7 +6,7 @@ import { RacingDomainInvariantError, RacingDomainValidationError } from '../../errors/RacingDomainError'; -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import type { Money } from '../../value-objects/Money'; import { LeagueWalletId } from './LeagueWalletId'; import { TransactionId } from './TransactionId'; @@ -34,8 +34,7 @@ export interface TransactionProps { metadata: Record | undefined; } -export class Transaction implements Entity { - readonly id: TransactionId; +export class Transaction extends Entity { readonly walletId: LeagueWalletId; readonly type: TransactionType; readonly amount: Money; @@ -48,7 +47,8 @@ export class Transaction implements Entity { readonly metadata: Record | undefined; private constructor(props: TransactionProps) { - this.id = props.id; + super(props.id); + this.walletId = props.walletId; this.type = props.type; this.amount = props.amount; diff --git a/core/racing/domain/entities/penalty/Penalty.ts b/core/racing/domain/entities/penalty/Penalty.ts index 5265a0377..5d105d1b3 100644 --- a/core/racing/domain/entities/penalty/Penalty.ts +++ b/core/racing/domain/entities/penalty/Penalty.ts @@ -5,7 +5,7 @@ * Penalties can be applied as a result of an upheld protest or directly by stewards. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../../errors/RacingDomainError'; import { AppliedAt } from '../AppliedAt'; import { DriverId } from '../DriverId'; @@ -60,8 +60,9 @@ export function penaltyTypeRequiresValue(type: PenaltyTypeValue): boolean { return PENALTY_TYPES_REQUIRING_VALUE.includes(type); } -export class Penalty implements Entity { - private constructor(private readonly props: PenaltyProps) {} +export class Penalty extends Entity { + private constructor(private readonly props: PenaltyProps) { + super(props.id);} static create(props: { id: string; @@ -154,7 +155,6 @@ export class Penalty implements Entity { }); } - get id(): string { return this.props.id.toString(); } get leagueId(): string { return this.props.leagueId.toString(); } get raceId(): string { return this.props.raceId.toString(); } get driverId(): string { return this.props.driverId.toString(); } diff --git a/core/racing/domain/entities/prize/Prize.ts b/core/racing/domain/entities/prize/Prize.ts index f5c68059c..24f318bcd 100644 --- a/core/racing/domain/entities/prize/Prize.ts +++ b/core/racing/domain/entities/prize/Prize.ts @@ -4,7 +4,7 @@ * Represents a prize awarded to a driver for a specific position in a season. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../../errors/RacingDomainError'; import type { Money } from '../../value-objects/Money'; @@ -27,8 +27,7 @@ export interface PrizeProps { description: string | undefined; } -export class Prize implements Entity { - readonly id: PrizeId; +export class Prize extends Entity { readonly seasonId: SeasonId; readonly position: Position; readonly amount: Money; @@ -40,7 +39,8 @@ export class Prize implements Entity { readonly description: string | undefined; private constructor(props: PrizeProps) { - this.id = props.id; + super(props.id); + this.seasonId = props.seasonId; this.position = props.position; this.amount = props.amount; diff --git a/core/racing/domain/entities/result/Result.ts b/core/racing/domain/entities/result/Result.ts index f4847afb1..70ac2370d 100644 --- a/core/racing/domain/entities/result/Result.ts +++ b/core/racing/domain/entities/result/Result.ts @@ -5,7 +5,7 @@ * Immutable entity with factory methods and domain validation. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainValidationError } from '../../errors/RacingDomainError'; import { DriverId } from '../DriverId'; import { RaceId } from '../RaceId'; @@ -13,8 +13,7 @@ import { IncidentCount } from './IncidentCount'; import { LapTime } from './LapTime'; import { Position } from './Position'; -export class Result implements Entity { - readonly id: string; +export class Result extends Entity { readonly raceId: RaceId; readonly driverId: DriverId; readonly position: Position; @@ -31,7 +30,8 @@ export class Result implements Entity { incidents: IncidentCount; startPosition: Position; }) { - this.id = props.id; + super(props.id); + this.raceId = props.raceId; this.driverId = props.driverId; this.position = props.position; diff --git a/core/racing/domain/entities/season/Season.test.ts b/core/racing/domain/entities/season/Season.test.ts index a804d6150..75dcbacba 100644 --- a/core/racing/domain/entities/season/Season.test.ts +++ b/core/racing/domain/entities/season/Season.test.ts @@ -6,7 +6,6 @@ import { } from '@core/racing/domain/errors/RacingDomainError'; import { SeasonScoringConfig } from '@core/racing/domain/value-objects/SeasonScoringConfig'; -import { SeasonDropPolicy, } from '@core/racing/domain/value-objects/SeasonDropPolicy'; import { SeasonStewardingConfig } from '@core/racing/domain/value-objects/SeasonStewardingConfig'; diff --git a/core/racing/domain/entities/season/Season.ts b/core/racing/domain/entities/season/Season.ts index d27fd974c..e2e77f964 100644 --- a/core/racing/domain/entities/season/Season.ts +++ b/core/racing/domain/entities/season/Season.ts @@ -1,4 +1,4 @@ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError, @@ -11,8 +11,7 @@ import type { SeasonScoringConfig } from '../../value-objects/SeasonScoringConfi import { SeasonStatus, SeasonStatusValue } from '../../value-objects/SeasonStatus'; import type { SeasonStewardingConfig } from '../../value-objects/SeasonStewardingConfig'; -export class Season implements Entity { - readonly id: string; +export class Season extends Entity { readonly leagueId: string; readonly gameId: string; readonly name: string; @@ -49,7 +48,8 @@ export class Season implements Entity { maxDrivers?: number; participantCount: ParticipantCount; }) { - this.id = props.id; + super(props.id); + this.leagueId = props.leagueId; this.gameId = props.gameId; this.name = props.name; diff --git a/core/racing/domain/entities/season/SeasonSponsorship.ts b/core/racing/domain/entities/season/SeasonSponsorship.ts index ed3a86f89..06d171d2f 100644 --- a/core/racing/domain/entities/season/SeasonSponsorship.ts +++ b/core/racing/domain/entities/season/SeasonSponsorship.ts @@ -5,7 +5,7 @@ * Aggregate root for managing sponsorship slots and pricing. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { RacingDomainInvariantError, RacingDomainValidationError } from '../../errors/RacingDomainError'; import type { Money } from '../../value-objects/Money'; @@ -32,8 +32,7 @@ export interface SeasonSponsorshipProps { description?: string; } -export class SeasonSponsorship implements Entity { - readonly id: string; +export class SeasonSponsorship extends Entity { readonly seasonId: string; readonly leagueId: string | undefined; readonly sponsorId: string; @@ -47,7 +46,8 @@ export class SeasonSponsorship implements Entity { readonly description: string | undefined; private constructor(props: SeasonSponsorshipProps) { - this.id = props.id; + super(props.id); + this.seasonId = props.seasonId; this.leagueId = props.leagueId; this.sponsorId = props.sponsorId; diff --git a/core/racing/domain/entities/sponsor/Sponsor.ts b/core/racing/domain/entities/sponsor/Sponsor.ts index ad5c37b87..8db649865 100644 --- a/core/racing/domain/entities/sponsor/Sponsor.ts +++ b/core/racing/domain/entities/sponsor/Sponsor.ts @@ -4,7 +4,7 @@ * Represents a sponsor that can sponsor leagues/seasons. * Aggregate root for sponsor information. */ -import type { Entity } from '@core/shared/domain/Entity'; +import { Entity } from '@core/shared/domain/Entity'; import { SponsorCreatedAt } from './SponsorCreatedAt'; import { SponsorEmail } from './SponsorEmail'; import { SponsorId } from './SponsorId'; @@ -13,8 +13,7 @@ import { Url } from './Url'; // TODO sponsor is not actually the racing domain in my opinion -export class Sponsor implements Entity { - readonly id: SponsorId; +export class Sponsor extends Entity { readonly name: SponsorName; readonly contactEmail: SponsorEmail; readonly logoUrl: Url | undefined; @@ -29,7 +28,8 @@ export class Sponsor implements Entity { websiteUrl?: Url; createdAt: SponsorCreatedAt; }) { - this.id = props.id; + super(props.id); + this.name = props.name; this.contactEmail = props.contactEmail; this.logoUrl = props.logoUrl ?? undefined; diff --git a/core/racing/domain/errors/RacingDomainError.ts b/core/racing/domain/errors/RacingDomainError.ts index 2be100854..a037391ad 100644 --- a/core/racing/domain/errors/RacingDomainError.ts +++ b/core/racing/domain/errors/RacingDomainError.ts @@ -1,4 +1,5 @@ -import type { DomainError, CommonDomainErrorKind } from '@core/shared/errors'; +import type { DomainError } from '@core/shared/errors/DomainError'; +import type { CommonDomainErrorKind } from '@core/shared/errors/DomainError'; export abstract class RacingDomainError extends Error implements DomainError { readonly type = 'domain' as const; diff --git a/core/racing/domain/events/MainRaceCompleted.ts b/core/racing/domain/events/MainRaceCompleted.ts index a720f9da5..70f782452 100644 --- a/core/racing/domain/events/MainRaceCompleted.ts +++ b/core/racing/domain/events/MainRaceCompleted.ts @@ -1,4 +1,4 @@ -import type { DomainEvent } from '@core/shared/domain'; +import type { DomainEvent } from '@core/shared/domain/DomainEvent'; /** * Domain Event: MainRaceCompleted diff --git a/core/racing/domain/events/RaceEventStewardingClosed.ts b/core/racing/domain/events/RaceEventStewardingClosed.ts index 6a2f7ee6d..20d1a458a 100644 --- a/core/racing/domain/events/RaceEventStewardingClosed.ts +++ b/core/racing/domain/events/RaceEventStewardingClosed.ts @@ -1,4 +1,4 @@ -import type { DomainEvent } from '@core/shared/domain'; +import type { DomainEvent } from '@core/shared/domain/DomainEvent'; /** * Domain Event: RaceEventStewardingClosed diff --git a/core/racing/domain/repositories/CarRepository.ts b/core/racing/domain/repositories/CarRepository.ts index e243ef120..dc936a81d 100644 --- a/core/racing/domain/repositories/CarRepository.ts +++ b/core/racing/domain/repositories/CarRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: ICarRepository + * Application Port: CarRepository * * Repository interface for Car entity CRUD operations. * Defines async methods using domain entities as types. diff --git a/core/racing/domain/repositories/DriverRepository.ts b/core/racing/domain/repositories/DriverRepository.ts index 8d307d314..3b6449a97 100644 --- a/core/racing/domain/repositories/DriverRepository.ts +++ b/core/racing/domain/repositories/DriverRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: IDriverRepository + * Application Port: DriverRepository * * Repository interface for Driver entity CRUD operations. * Defines async methods using domain entities as types. diff --git a/core/racing/domain/repositories/DriverStatsRepository.ts b/core/racing/domain/repositories/DriverStatsRepository.ts index 3f9b14906..2213c1cd0 100644 --- a/core/racing/domain/repositories/DriverStatsRepository.ts +++ b/core/racing/domain/repositories/DriverStatsRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: IDriverStatsRepository + * Application Port: DriverStatsRepository * * Repository interface for storing and retrieving computed driver statistics. * This is used for caching computed stats and serving frontend data. diff --git a/core/racing/domain/repositories/LeagueMembershipRepository.ts b/core/racing/domain/repositories/LeagueMembershipRepository.ts index 14fdb6424..5d27ac994 100644 --- a/core/racing/domain/repositories/LeagueMembershipRepository.ts +++ b/core/racing/domain/repositories/LeagueMembershipRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: ILeagueMembershipRepository + * Application Port: LeagueMembershipRepository * * Repository interface for league membership and join request operations. * This defines the persistence boundary for membership-related domain entities. diff --git a/core/racing/domain/repositories/LeagueRepository.ts b/core/racing/domain/repositories/LeagueRepository.ts index 0b89b68b0..b0310881d 100644 --- a/core/racing/domain/repositories/LeagueRepository.ts +++ b/core/racing/domain/repositories/LeagueRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: ILeagueRepository + * Application Port: LeagueRepository * * Repository interface for League entity CRUD operations. * Defines async methods using domain entities as types. diff --git a/core/racing/domain/repositories/LeagueWalletRepository.ts b/core/racing/domain/repositories/LeagueWalletRepository.ts index 442b4fb2f..1d3049469 100644 --- a/core/racing/domain/repositories/LeagueWalletRepository.ts +++ b/core/racing/domain/repositories/LeagueWalletRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: ILeagueWalletRepository + * Repository Interface: LeagueWalletRepository * * Defines operations for LeagueWallet aggregate persistence */ diff --git a/core/racing/domain/repositories/LiveryRepository.ts b/core/racing/domain/repositories/LiveryRepository.ts index d161f2a4b..898ef8494 100644 --- a/core/racing/domain/repositories/LiveryRepository.ts +++ b/core/racing/domain/repositories/LiveryRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: ILiveryRepository + * Repository Interface: LiveryRepository * * Defines operations for livery-related entities */ diff --git a/core/racing/domain/repositories/MediaRepository.ts b/core/racing/domain/repositories/MediaRepository.ts index 72a00bd67..8b4911ac3 100644 --- a/core/racing/domain/repositories/MediaRepository.ts +++ b/core/racing/domain/repositories/MediaRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: IMediaRepository + * Application Port: MediaRepository * * Repository interface for media assets (logos, avatars). * Handles frontend assets like team logos and driver avatars. diff --git a/core/racing/domain/repositories/PenaltyRepository.ts b/core/racing/domain/repositories/PenaltyRepository.ts index 98cb588c3..d4052a88b 100644 --- a/core/racing/domain/repositories/PenaltyRepository.ts +++ b/core/racing/domain/repositories/PenaltyRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IPenaltyRepository + * Repository Interface: PenaltyRepository * * Defines the contract for persisting and retrieving Penalty entities. */ diff --git a/core/racing/domain/repositories/PrizeRepository.ts b/core/racing/domain/repositories/PrizeRepository.ts index 6597055db..7d27789a0 100644 --- a/core/racing/domain/repositories/PrizeRepository.ts +++ b/core/racing/domain/repositories/PrizeRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IPrizeRepository + * Repository Interface: PrizeRepository * * Defines operations for Prize entity persistence */ diff --git a/core/racing/domain/repositories/ProtestRepository.ts b/core/racing/domain/repositories/ProtestRepository.ts index a18c941dd..533cda4ca 100644 --- a/core/racing/domain/repositories/ProtestRepository.ts +++ b/core/racing/domain/repositories/ProtestRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: IProtestRepository + * Repository Interface: ProtestRepository * * Defines the contract for persisting and retrieving Protest entities. */ diff --git a/core/racing/domain/repositories/RaceRegistrationRepository.ts b/core/racing/domain/repositories/RaceRegistrationRepository.ts index 5b3180854..772d74ff0 100644 --- a/core/racing/domain/repositories/RaceRegistrationRepository.ts +++ b/core/racing/domain/repositories/RaceRegistrationRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: IRaceRegistrationRepository + * Application Port: RaceRegistrationRepository * * Repository interface for race registration operations. * This defines the persistence boundary for RaceRegistration entities. diff --git a/core/racing/domain/repositories/RaceRepository.ts b/core/racing/domain/repositories/RaceRepository.ts index d779ec7e9..c40540ff4 100644 --- a/core/racing/domain/repositories/RaceRepository.ts +++ b/core/racing/domain/repositories/RaceRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: IRaceRepository + * Application Port: RaceRepository * * Repository interface for Race entity CRUD operations. * Defines async methods using domain entities as types. diff --git a/core/racing/domain/repositories/ResultRepository.ts b/core/racing/domain/repositories/ResultRepository.ts index 0f43549ee..f21291f52 100644 --- a/core/racing/domain/repositories/ResultRepository.ts +++ b/core/racing/domain/repositories/ResultRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: IResultRepository + * Application Port: ResultRepository * * Repository interface for Result entity CRUD operations. * Defines async methods using domain entities as types. diff --git a/core/racing/domain/repositories/SeasonSponsorshipRepository.ts b/core/racing/domain/repositories/SeasonSponsorshipRepository.ts index abb5a44e4..b002f0b3f 100644 --- a/core/racing/domain/repositories/SeasonSponsorshipRepository.ts +++ b/core/racing/domain/repositories/SeasonSponsorshipRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: ISeasonSponsorshipRepository + * Repository Interface: SeasonSponsorshipRepository * * Defines operations for SeasonSponsorship aggregate persistence */ diff --git a/core/racing/domain/repositories/SponsorRepository.ts b/core/racing/domain/repositories/SponsorRepository.ts index e1ec5f486..272ddc7ee 100644 --- a/core/racing/domain/repositories/SponsorRepository.ts +++ b/core/racing/domain/repositories/SponsorRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: ISponsorRepository + * Repository Interface: SponsorRepository * * Defines operations for Sponsor aggregate persistence */ diff --git a/core/racing/domain/repositories/SponsorshipPricingRepository.ts b/core/racing/domain/repositories/SponsorshipPricingRepository.ts index cea8a2825..86b6bca4a 100644 --- a/core/racing/domain/repositories/SponsorshipPricingRepository.ts +++ b/core/racing/domain/repositories/SponsorshipPricingRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: ISponsorshipPricingRepository + * Repository Interface: SponsorshipPricingRepository * * Stores sponsorship pricing configuration for any sponsorable entity. * This allows drivers, teams, races, and leagues to define their sponsorship slots. diff --git a/core/racing/domain/repositories/SponsorshipRequestRepository.ts b/core/racing/domain/repositories/SponsorshipRequestRepository.ts index 80deb8b88..e363213ea 100644 --- a/core/racing/domain/repositories/SponsorshipRequestRepository.ts +++ b/core/racing/domain/repositories/SponsorshipRequestRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: ISponsorshipRequestRepository + * Repository Interface: SponsorshipRequestRepository * * Defines operations for SponsorshipRequest aggregate persistence */ diff --git a/core/racing/domain/repositories/StandingRepository.ts b/core/racing/domain/repositories/StandingRepository.ts index 4fc8dbd4c..474500d99 100644 --- a/core/racing/domain/repositories/StandingRepository.ts +++ b/core/racing/domain/repositories/StandingRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: IStandingRepository + * Application Port: StandingRepository * * Repository interface for Standing entity operations. * Includes methods for calculating and retrieving standings. diff --git a/core/racing/domain/repositories/TeamMembershipRepository.ts b/core/racing/domain/repositories/TeamMembershipRepository.ts index 3193b1529..e508a99d9 100644 --- a/core/racing/domain/repositories/TeamMembershipRepository.ts +++ b/core/racing/domain/repositories/TeamMembershipRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: ITeamMembershipRepository + * Application Port: TeamMembershipRepository * * Repository interface for team membership and join request operations. * This defines the persistence boundary for team membership-related entities. diff --git a/core/racing/domain/repositories/TeamRatingEventRepository.ts b/core/racing/domain/repositories/TeamRatingEventRepository.ts index 7d1708374..fdb2091d5 100644 --- a/core/racing/domain/repositories/TeamRatingEventRepository.ts +++ b/core/racing/domain/repositories/TeamRatingEventRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: ITeamRatingEventRepository + * Repository Interface: TeamRatingEventRepository * * Port for persisting and retrieving team rating events (ledger). * Events are immutable and ordered by occurredAt for deterministic snapshot computation. diff --git a/core/racing/domain/repositories/TeamRatingRepository.ts b/core/racing/domain/repositories/TeamRatingRepository.ts index f0668efed..24e5459ee 100644 --- a/core/racing/domain/repositories/TeamRatingRepository.ts +++ b/core/racing/domain/repositories/TeamRatingRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: ITeamRatingRepository + * Repository Interface: TeamRatingRepository * * Port for persisting and retrieving TeamRating snapshots. * Snapshots are derived from rating events for fast reads. diff --git a/core/racing/domain/repositories/TeamRepository.ts b/core/racing/domain/repositories/TeamRepository.ts index 0517ccefc..f8450e37d 100644 --- a/core/racing/domain/repositories/TeamRepository.ts +++ b/core/racing/domain/repositories/TeamRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: ITeamRepository + * Application Port: TeamRepository * * Repository interface for Team aggregate operations. * This defines the persistence boundary for Team entities. diff --git a/core/racing/domain/repositories/TeamStatsRepository.ts b/core/racing/domain/repositories/TeamStatsRepository.ts index eac8ad646..446ceba8d 100644 --- a/core/racing/domain/repositories/TeamStatsRepository.ts +++ b/core/racing/domain/repositories/TeamStatsRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: ITeamStatsRepository + * Application Port: TeamStatsRepository * * Repository interface for storing and retrieving computed team statistics. * This is used for caching computed stats and serving frontend data. diff --git a/core/racing/domain/repositories/TrackRepository.ts b/core/racing/domain/repositories/TrackRepository.ts index 45d1560eb..e5a2979c2 100644 --- a/core/racing/domain/repositories/TrackRepository.ts +++ b/core/racing/domain/repositories/TrackRepository.ts @@ -1,5 +1,5 @@ /** - * Application Port: ITrackRepository + * Application Port: TrackRepository * * Repository interface for Track entity CRUD operations. * Defines async methods using domain entities as types. diff --git a/core/racing/domain/repositories/TransactionRepository.ts b/core/racing/domain/repositories/TransactionRepository.ts index 3ae6e523a..7571fd908 100644 --- a/core/racing/domain/repositories/TransactionRepository.ts +++ b/core/racing/domain/repositories/TransactionRepository.ts @@ -1,5 +1,5 @@ /** - * Repository Interface: ITransactionRepository + * Repository Interface: TransactionRepository * * Defines operations for Transaction entity persistence */ diff --git a/core/racing/domain/services/DropScoreApplier.ts b/core/racing/domain/services/DropScoreApplier.ts index f3b9fdecf..5d432c498 100644 --- a/core/racing/domain/services/DropScoreApplier.ts +++ b/core/racing/domain/services/DropScoreApplier.ts @@ -1,5 +1,5 @@ import type { DropScorePolicy } from '../types/DropScorePolicy'; -import type { DomainCalculationService } from '@core/shared/domain'; +import type { DomainCalculationService } from '@core/shared/domain/Service'; export interface EventPointsEntry { eventId: string; diff --git a/core/racing/domain/services/EventScoringService.ts b/core/racing/domain/services/EventScoringService.ts index 59db53bd8..9aec2622d 100644 --- a/core/racing/domain/services/EventScoringService.ts +++ b/core/racing/domain/services/EventScoringService.ts @@ -7,7 +7,7 @@ import type { BonusRule } from '../types/BonusRule'; import type { ChampionshipType } from '../types/ChampionshipType'; import type { PointsTable } from '../value-objects/PointsTable'; -import type { DomainCalculationService } from '@core/shared/domain'; +import type { DomainCalculationService } from '@core/shared/domain/Service'; export interface ParticipantEventPoints { participant: ParticipantRef; diff --git a/core/racing/domain/services/SeasonScheduleGenerator.ts b/core/racing/domain/services/SeasonScheduleGenerator.ts index 5a2836093..8e55464a2 100644 --- a/core/racing/domain/services/SeasonScheduleGenerator.ts +++ b/core/racing/domain/services/SeasonScheduleGenerator.ts @@ -5,7 +5,7 @@ import type { RecurrenceStrategy } from '../value-objects/RecurrenceStrategy'; import { RaceTimeOfDay } from '../value-objects/RaceTimeOfDay'; import type { Weekday } from '../types/Weekday'; import { weekdayToIndex } from '../types/Weekday'; -import type { DomainCalculationService } from '@core/shared/domain'; +import type { DomainCalculationService } from '@core/shared/domain/Service'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; function cloneDate(date: Date): Date { diff --git a/core/racing/domain/services/SkillLevelService.ts b/core/racing/domain/services/SkillLevelService.ts index 7643572e9..2bc2542e1 100644 --- a/core/racing/domain/services/SkillLevelService.ts +++ b/core/racing/domain/services/SkillLevelService.ts @@ -1,4 +1,4 @@ -import type { DomainService } from '@core/shared/domain'; +import type { DomainService } from '@core/shared/domain/Service'; export type SkillLevel = 'beginner' | 'intermediate' | 'advanced' | 'pro'; diff --git a/core/racing/domain/services/StrengthOfFieldCalculator.ts b/core/racing/domain/services/StrengthOfFieldCalculator.ts index bcc2e2730..2e15d26a1 100644 --- a/core/racing/domain/services/StrengthOfFieldCalculator.ts +++ b/core/racing/domain/services/StrengthOfFieldCalculator.ts @@ -1,4 +1,4 @@ -import type { DomainCalculationService } from '@core/shared/domain'; +import type { DomainCalculationService } from '@core/shared/domain/Service'; /** * Domain Service: StrengthOfFieldCalculator @@ -24,7 +24,7 @@ export interface StrengthOfFieldCalculator { * Default implementation using simple average */ export class AverageStrengthOfFieldCalculator - implements StrengthOfFieldCalculator, IDomainCalculationService + implements StrengthOfFieldCalculator, DomainCalculationService { calculate(driverRatings: DriverRating[]): number | null { if (driverRatings.length === 0) { diff --git a/core/racing/domain/value-objects/CarId.ts b/core/racing/domain/value-objects/CarId.ts index fc74e1662..47cd880b7 100644 --- a/core/racing/domain/value-objects/CarId.ts +++ b/core/racing/domain/value-objects/CarId.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export class CarId implements ValueObject { private constructor(private readonly value: string) {} @@ -15,7 +15,7 @@ export class CarId implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props; } diff --git a/core/racing/domain/value-objects/DecalOverride.ts b/core/racing/domain/value-objects/DecalOverride.ts index 578ee92da..9c2ccc593 100644 --- a/core/racing/domain/value-objects/DecalOverride.ts +++ b/core/racing/domain/value-objects/DecalOverride.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface DecalOverrideProps { leagueId: string; @@ -47,7 +47,7 @@ export class DecalOverride implements ValueObject { } } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props; const b = other.props; return ( diff --git a/core/racing/domain/value-objects/DriverName.ts b/core/racing/domain/value-objects/DriverName.ts index a465df414..bbd20d4dd 100644 --- a/core/racing/domain/value-objects/DriverName.ts +++ b/core/racing/domain/value-objects/DriverName.ts @@ -29,7 +29,7 @@ export class DriverName implements ValueObject { return new DriverName({ value: trimmed }); } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { if (!(other instanceof DriverName)) { return false; } diff --git a/core/racing/domain/value-objects/GameConstraints.ts b/core/racing/domain/value-objects/GameConstraints.ts index d5d2f80a3..7f906acd6 100644 --- a/core/racing/domain/value-objects/GameConstraints.ts +++ b/core/racing/domain/value-objects/GameConstraints.ts @@ -5,7 +5,7 @@ * Different sim racing games have different maximum grid sizes. */ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface GameConstraintsData { readonly maxDrivers: number; @@ -37,7 +37,7 @@ export class GameConstraints implements ValueObject { }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.gameId === other.props.gameId; } diff --git a/core/racing/domain/value-objects/ImageUrl.ts b/core/racing/domain/value-objects/ImageUrl.ts index a4ca11dc2..0db9bd3d5 100644 --- a/core/racing/domain/value-objects/ImageUrl.ts +++ b/core/racing/domain/value-objects/ImageUrl.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export class ImageUrl implements ValueObject { private constructor(private readonly value: string) {} @@ -21,7 +21,7 @@ export class ImageUrl implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props === other.props; } diff --git a/core/racing/domain/value-objects/LeagueDescription.ts b/core/racing/domain/value-objects/LeagueDescription.ts index 702d1987e..74004c15f 100644 --- a/core/racing/domain/value-objects/LeagueDescription.ts +++ b/core/racing/domain/value-objects/LeagueDescription.ts @@ -5,7 +5,7 @@ */ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface LeagueDescriptionValidationResult { valid: boolean; @@ -94,7 +94,7 @@ export class LeagueDescription implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.value === other.props.value; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/LeagueName.ts b/core/racing/domain/value-objects/LeagueName.ts index 1b04bae15..394e51a66 100644 --- a/core/racing/domain/value-objects/LeagueName.ts +++ b/core/racing/domain/value-objects/LeagueName.ts @@ -5,7 +5,7 @@ */ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface LeagueNameValidationResult { valid: boolean; @@ -107,7 +107,7 @@ export class LeagueName implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.value === other.props.value; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/LeagueTimezone.ts b/core/racing/domain/value-objects/LeagueTimezone.ts index 802ebf0ad..9622d2fe1 100644 --- a/core/racing/domain/value-objects/LeagueTimezone.ts +++ b/core/racing/domain/value-objects/LeagueTimezone.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface LeagueTimezoneProps { id: string; @@ -27,7 +27,7 @@ export class LeagueTimezone implements ValueObject { return this.id; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.id === other.props.id; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/LeagueVisibility.ts b/core/racing/domain/value-objects/LeagueVisibility.ts index c150a15b7..4dfced509 100644 --- a/core/racing/domain/value-objects/LeagueVisibility.ts +++ b/core/racing/domain/value-objects/LeagueVisibility.ts @@ -5,7 +5,7 @@ * This is a hardened version that enforces strict business rules. */ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export type LeagueVisibilityType = 'ranked' | 'unranked'; @@ -157,7 +157,7 @@ export class LeagueVisibility implements ValueObject { return { type: this.type }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.type === other.props.type; } } diff --git a/core/racing/domain/value-objects/LiveryDecal.ts b/core/racing/domain/value-objects/LiveryDecal.ts index 0f08997b5..423f746af 100644 --- a/core/racing/domain/value-objects/LiveryDecal.ts +++ b/core/racing/domain/value-objects/LiveryDecal.ts @@ -4,7 +4,7 @@ */ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export type DecalType = 'sponsor' | 'user'; @@ -165,7 +165,7 @@ export class LiveryDecal implements ValueObject { ); } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props; const b = other.props; return ( diff --git a/core/racing/domain/value-objects/MaxParticipants.ts b/core/racing/domain/value-objects/MaxParticipants.ts index c8de8f115..72161a4f9 100644 --- a/core/racing/domain/value-objects/MaxParticipants.ts +++ b/core/racing/domain/value-objects/MaxParticipants.ts @@ -5,7 +5,7 @@ * Enforces reasonable limits and constraints. */ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export interface MaxParticipantsProps { @@ -83,7 +83,7 @@ export class MaxParticipants implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/racing/domain/value-objects/MembershipFee.ts b/core/racing/domain/value-objects/MembershipFee.ts index a44d8355c..497a8f7b0 100644 --- a/core/racing/domain/value-objects/MembershipFee.ts +++ b/core/racing/domain/value-objects/MembershipFee.ts @@ -6,7 +6,7 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; import type { Money } from './Money'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export type MembershipFeeType = 'season' | 'monthly' | 'per_race'; @@ -64,7 +64,7 @@ export class MembershipFee implements ValueObject { return this.type === 'monthly'; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props; const b = other.props; return a.type === b.type && a.amount.equals(b.amount); diff --git a/core/racing/domain/value-objects/Money.ts b/core/racing/domain/value-objects/Money.ts index 2cb2bade2..d0b687555 100644 --- a/core/racing/domain/value-objects/Money.ts +++ b/core/racing/domain/value-objects/Money.ts @@ -3,7 +3,7 @@ * Represents a monetary amount with currency and platform fee calculation */ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export type Currency = 'USD' | 'EUR' | 'GBP'; @@ -102,7 +102,7 @@ export class Money implements ValueObject { /** * Check if this money equals another */ - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props; const b = other.props; return a.amount === b.amount && a.currency === b.currency; diff --git a/core/racing/domain/value-objects/MonthlyRecurrencePattern.ts b/core/racing/domain/value-objects/MonthlyRecurrencePattern.ts index 296478ffc..1275dd0ae 100644 --- a/core/racing/domain/value-objects/MonthlyRecurrencePattern.ts +++ b/core/racing/domain/value-objects/MonthlyRecurrencePattern.ts @@ -1,7 +1,7 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; import { ALL_WEEKDAYS } from '../types/Weekday'; import type { Weekday } from '../types/Weekday'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface MonthlyRecurrencePatternProps { ordinal: 1 | 2 | 3 | 4; @@ -57,7 +57,7 @@ export class MonthlyRecurrencePattern implements ValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props; const b = other.props; return a.ordinal === b.ordinal && a.weekday === b.weekday; diff --git a/core/racing/domain/value-objects/ParticipantCount.ts b/core/racing/domain/value-objects/ParticipantCount.ts index cbe224118..5c9247ceb 100644 --- a/core/racing/domain/value-objects/ParticipantCount.ts +++ b/core/racing/domain/value-objects/ParticipantCount.ts @@ -5,7 +5,7 @@ * Enforces constraints based on league visibility and other business rules. */ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export interface ParticipantCountProps { @@ -107,7 +107,7 @@ export class ParticipantCount implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/racing/domain/value-objects/Points.ts b/core/racing/domain/value-objects/Points.ts index 8beece3c9..b2c2a8c7c 100644 --- a/core/racing/domain/value-objects/Points.ts +++ b/core/racing/domain/value-objects/Points.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export class Points implements ValueObject<{ value: number }> { diff --git a/core/racing/domain/value-objects/PointsTable.ts b/core/racing/domain/value-objects/PointsTable.ts index 15a1c3368..336686647 100644 --- a/core/racing/domain/value-objects/PointsTable.ts +++ b/core/racing/domain/value-objects/PointsTable.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface PointsTableProps { pointsByPosition: ReadonlyMap; @@ -31,7 +31,7 @@ export class PointsTable implements ValueObject { }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props.pointsByPosition; const b = other.props.pointsByPosition; diff --git a/core/racing/domain/value-objects/RaceIncidents.ts b/core/racing/domain/value-objects/RaceIncidents.ts index c2eaf8a43..bebae30ff 100644 --- a/core/racing/domain/value-objects/RaceIncidents.ts +++ b/core/racing/domain/value-objects/RaceIncidents.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; /** * Incident types that can occur during a race @@ -136,7 +136,7 @@ export class RaceIncidents implements ValueObject { return typeSummary.length > 0 ? `${total} incidents (${typeSummary})` : `${total} incidents`; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const otherIncidents = other.props; if (this.incidents.length !== otherIncidents.length) { return false; diff --git a/core/racing/domain/value-objects/RaceName.ts b/core/racing/domain/value-objects/RaceName.ts index 180bfac6c..b8f6fcab7 100644 --- a/core/racing/domain/value-objects/RaceName.ts +++ b/core/racing/domain/value-objects/RaceName.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface RaceNameProps { value: string; @@ -32,7 +32,7 @@ export class RaceName implements ValueObject { return this.props.value; } - public equals(other: IValueObject): boolean { + public equals(other: ValueObject): boolean { return this.props.value === other.props.value; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/RaceStatus.ts b/core/racing/domain/value-objects/RaceStatus.ts index 1e0061115..a492b7a0c 100644 --- a/core/racing/domain/value-objects/RaceStatus.ts +++ b/core/racing/domain/value-objects/RaceStatus.ts @@ -4,7 +4,7 @@ * Represents the status of a race with strict lifecycle rules. */ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export type RaceStatusValue = 'scheduled' | 'running' | 'completed' | 'cancelled'; @@ -118,7 +118,7 @@ export class RaceStatus implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/racing/domain/value-objects/RaceTimeOfDay.ts b/core/racing/domain/value-objects/RaceTimeOfDay.ts index 00a080e0e..5c3525b16 100644 --- a/core/racing/domain/value-objects/RaceTimeOfDay.ts +++ b/core/racing/domain/value-objects/RaceTimeOfDay.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface RaceTimeOfDayProps { hour: number; @@ -47,7 +47,7 @@ export class RaceTimeOfDay implements ValueObject { return `${hh}:${mm}`; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props; const b = other.props; return a.hour === b.hour && a.minute === b.minute; diff --git a/core/racing/domain/value-objects/RecurrenceStrategy.ts b/core/racing/domain/value-objects/RecurrenceStrategy.ts index 33186563a..c1a8b36e6 100644 --- a/core/racing/domain/value-objects/RecurrenceStrategy.ts +++ b/core/racing/domain/value-objects/RecurrenceStrategy.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { WeekdaySet } from './WeekdaySet'; import { MonthlyRecurrencePattern } from './MonthlyRecurrencePattern'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; @@ -64,7 +64,7 @@ export class RecurrenceStrategy implements ValueObject }); } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const otherProps = other.props; if (this.strategy.kind !== otherProps.kind) { return false; diff --git a/core/racing/domain/value-objects/ScheduledRaceSlot.ts b/core/racing/domain/value-objects/ScheduledRaceSlot.ts index e1304d849..f8c610726 100644 --- a/core/racing/domain/value-objects/ScheduledRaceSlot.ts +++ b/core/racing/domain/value-objects/ScheduledRaceSlot.ts @@ -1,7 +1,7 @@ import { LeagueTimezone } from './LeagueTimezone'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface ScheduledRaceSlotProps { roundNumber: number; @@ -35,7 +35,7 @@ export class ScheduledRaceSlot implements ValueObject { }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props; const b = other.props; return ( diff --git a/core/racing/domain/value-objects/SeasonDropPolicy.test.ts b/core/racing/domain/value-objects/SeasonDropPolicy.test.ts index 320d55029..c5f8c095d 100644 --- a/core/racing/domain/value-objects/SeasonDropPolicy.test.ts +++ b/core/racing/domain/value-objects/SeasonDropPolicy.test.ts @@ -4,7 +4,6 @@ import { RacingDomainValidationError, } from '../errors/RacingDomainError'; -import { SeasonDropPolicy, type SeasonDropStrategy, } from './SeasonDropPolicy'; diff --git a/core/racing/domain/value-objects/SeasonDropPolicy.ts b/core/racing/domain/value-objects/SeasonDropPolicy.ts index 629946981..076d6aa61 100644 --- a/core/racing/domain/value-objects/SeasonDropPolicy.ts +++ b/core/racing/domain/value-objects/SeasonDropPolicy.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export type SeasonDropStrategy = 'none' | 'bestNResults' | 'dropWorstN'; @@ -51,7 +51,7 @@ export class SeasonDropPolicy implements ValueObject { }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props; const b = other.props; return a.strategy === b.strategy && a.n === b.n; diff --git a/core/racing/domain/value-objects/SeasonSchedule.ts b/core/racing/domain/value-objects/SeasonSchedule.ts index 52f16d51c..0c44bca29 100644 --- a/core/racing/domain/value-objects/SeasonSchedule.ts +++ b/core/racing/domain/value-objects/SeasonSchedule.ts @@ -2,7 +2,7 @@ import { RaceTimeOfDay } from './RaceTimeOfDay'; import { LeagueTimezone } from './LeagueTimezone'; import type { RecurrenceStrategy } from './RecurrenceStrategy'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface SeasonScheduleProps { startDate: Date; @@ -54,7 +54,7 @@ export class SeasonSchedule implements ValueObject { }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props; const b = other.props; return ( diff --git a/core/racing/domain/value-objects/SeasonScoringConfig.ts b/core/racing/domain/value-objects/SeasonScoringConfig.ts index c08eec739..6a6aafdd7 100644 --- a/core/racing/domain/value-objects/SeasonScoringConfig.ts +++ b/core/racing/domain/value-objects/SeasonScoringConfig.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; /** * Value Object: SeasonScoringConfig @@ -55,7 +55,7 @@ export class SeasonScoringConfig }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props; const b = other.props; return ( diff --git a/core/racing/domain/value-objects/SeasonStatus.ts b/core/racing/domain/value-objects/SeasonStatus.ts index d3652d642..7fdd1f3fe 100644 --- a/core/racing/domain/value-objects/SeasonStatus.ts +++ b/core/racing/domain/value-objects/SeasonStatus.ts @@ -4,7 +4,7 @@ * Represents the status of a season with strict lifecycle rules. */ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export type SeasonStatusValue = 'planned' | 'active' | 'completed' | 'archived' | 'cancelled'; @@ -126,7 +126,7 @@ export class SeasonStatus implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/racing/domain/value-objects/SeasonStewardingConfig.ts b/core/racing/domain/value-objects/SeasonStewardingConfig.ts index c750ebd4e..1fcd80ed7 100644 --- a/core/racing/domain/value-objects/SeasonStewardingConfig.ts +++ b/core/racing/domain/value-objects/SeasonStewardingConfig.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import type { StewardingDecisionMode } from '../entities/League'; export interface SeasonStewardingConfigProps { @@ -124,7 +124,7 @@ export class SeasonStewardingConfig }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props; const b = other.props; return ( diff --git a/core/racing/domain/value-objects/SessionDuration.ts b/core/racing/domain/value-objects/SessionDuration.ts index e20cad8f5..7d66a3c23 100644 --- a/core/racing/domain/value-objects/SessionDuration.ts +++ b/core/racing/domain/value-objects/SessionDuration.ts @@ -5,7 +5,7 @@ * Enforces reasonable limits for different session types. */ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export interface SessionDurationProps { @@ -84,7 +84,7 @@ export class SessionDuration implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/racing/domain/value-objects/SessionType.ts b/core/racing/domain/value-objects/SessionType.ts index c894a3f12..aeacd5cf3 100644 --- a/core/racing/domain/value-objects/SessionType.ts +++ b/core/racing/domain/value-objects/SessionType.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; /** * Value Object: SessionType @@ -28,7 +28,7 @@ export class SessionType implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props; } diff --git a/core/racing/domain/value-objects/SponsorshipPricing.ts b/core/racing/domain/value-objects/SponsorshipPricing.ts index 841ca8f5a..bcf6a8c78 100644 --- a/core/racing/domain/value-objects/SponsorshipPricing.ts +++ b/core/racing/domain/value-objects/SponsorshipPricing.ts @@ -6,7 +6,7 @@ */ import { Money } from './Money'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface SponsorshipSlotConfig { tier: 'main' | 'secondary'; @@ -45,7 +45,7 @@ export class SponsorshipPricing implements ValueObject }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props; const b = other.props; diff --git a/core/racing/domain/value-objects/StrengthOfField.ts b/core/racing/domain/value-objects/StrengthOfField.ts index 32a77ec3c..92ef32822 100644 --- a/core/racing/domain/value-objects/StrengthOfField.ts +++ b/core/racing/domain/value-objects/StrengthOfField.ts @@ -5,7 +5,7 @@ * Enforces valid range and provides domain-specific operations. */ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export interface StrengthOfFieldProps { @@ -68,7 +68,7 @@ export class StrengthOfField implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/racing/domain/value-objects/TeamCreatedAt.ts b/core/racing/domain/value-objects/TeamCreatedAt.ts index e719112d0..76c89e67b 100644 --- a/core/racing/domain/value-objects/TeamCreatedAt.ts +++ b/core/racing/domain/value-objects/TeamCreatedAt.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export class TeamCreatedAt implements ValueObject { private constructor(private readonly value: Date) {} @@ -20,7 +20,7 @@ export class TeamCreatedAt implements ValueObject { return new Date(this.value); } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value.getTime() === other.props.getTime(); } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/TeamDescription.ts b/core/racing/domain/value-objects/TeamDescription.ts index cd4874cb6..b8ee50ede 100644 --- a/core/racing/domain/value-objects/TeamDescription.ts +++ b/core/racing/domain/value-objects/TeamDescription.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export class TeamDescription implements ValueObject { private constructor(private readonly value: string) {} @@ -19,7 +19,7 @@ export class TeamDescription implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/TeamDrivingReasonCode.ts b/core/racing/domain/value-objects/TeamDrivingReasonCode.ts index 67599870f..03bc4df9b 100644 --- a/core/racing/domain/value-objects/TeamDrivingReasonCode.ts +++ b/core/racing/domain/value-objects/TeamDrivingReasonCode.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export interface TeamDrivingReasonCodeProps { @@ -62,7 +62,7 @@ export class TeamDrivingReasonCode implements ValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/racing/domain/value-objects/TeamName.ts b/core/racing/domain/value-objects/TeamName.ts index 3c029beae..977cf2041 100644 --- a/core/racing/domain/value-objects/TeamName.ts +++ b/core/racing/domain/value-objects/TeamName.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export class TeamName implements ValueObject { private constructor(private readonly value: string) {} @@ -19,7 +19,7 @@ export class TeamName implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/TeamRating.ts b/core/racing/domain/value-objects/TeamRating.ts index c273e9dbc..9e56acbb0 100644 --- a/core/racing/domain/value-objects/TeamRating.ts +++ b/core/racing/domain/value-objects/TeamRating.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; /** * Value Object: TeamRating @@ -90,7 +90,7 @@ export class TeamRating implements ValueObject { return new TeamRating(props); } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.teamId === other.props.teamId; } diff --git a/core/racing/domain/value-objects/TeamRatingDelta.ts b/core/racing/domain/value-objects/TeamRatingDelta.ts index 46e2096e4..612900c75 100644 --- a/core/racing/domain/value-objects/TeamRatingDelta.ts +++ b/core/racing/domain/value-objects/TeamRatingDelta.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export interface TeamRatingDeltaProps { @@ -31,7 +31,7 @@ export class TeamRatingDelta implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/racing/domain/value-objects/TeamRatingDimensionKey.ts b/core/racing/domain/value-objects/TeamRatingDimensionKey.ts index 0a5e9776d..461da3d2a 100644 --- a/core/racing/domain/value-objects/TeamRatingDimensionKey.ts +++ b/core/racing/domain/value-objects/TeamRatingDimensionKey.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export interface TeamRatingDimensionKeyProps { @@ -39,7 +39,7 @@ export class TeamRatingDimensionKey implements ValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/racing/domain/value-objects/TeamRatingEventId.ts b/core/racing/domain/value-objects/TeamRatingEventId.ts index e88ae14c3..6022034a2 100644 --- a/core/racing/domain/value-objects/TeamRatingEventId.ts +++ b/core/racing/domain/value-objects/TeamRatingEventId.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; // Simple UUID v4 generator @@ -52,7 +52,7 @@ export class TeamRatingEventId implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/racing/domain/value-objects/TeamRatingValue.ts b/core/racing/domain/value-objects/TeamRatingValue.ts index 9cde292fe..941df4559 100644 --- a/core/racing/domain/value-objects/TeamRatingValue.ts +++ b/core/racing/domain/value-objects/TeamRatingValue.ts @@ -1,4 +1,4 @@ -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; export interface TeamRatingValueProps { @@ -30,7 +30,7 @@ export class TeamRatingValue implements ValueObject { return { value: this.value }; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props.value; } diff --git a/core/racing/domain/value-objects/TeamTag.ts b/core/racing/domain/value-objects/TeamTag.ts index e56f5fc38..2557864c5 100644 --- a/core/racing/domain/value-objects/TeamTag.ts +++ b/core/racing/domain/value-objects/TeamTag.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export class TeamTag implements ValueObject { private constructor(private readonly value: string) {} @@ -19,7 +19,7 @@ export class TeamTag implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/TrackCountry.ts b/core/racing/domain/value-objects/TrackCountry.ts index 75839036b..e00666480 100644 --- a/core/racing/domain/value-objects/TrackCountry.ts +++ b/core/racing/domain/value-objects/TrackCountry.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export class TrackCountry implements ValueObject { private constructor(private readonly value: string) {} @@ -19,7 +19,7 @@ export class TrackCountry implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/TrackGameId.ts b/core/racing/domain/value-objects/TrackGameId.ts index d28dc1dc4..a64b29d9d 100644 --- a/core/racing/domain/value-objects/TrackGameId.ts +++ b/core/racing/domain/value-objects/TrackGameId.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export class TrackGameId implements ValueObject { private constructor(private readonly value: string) {} @@ -19,7 +19,7 @@ export class TrackGameId implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/TrackImageUrl.ts b/core/racing/domain/value-objects/TrackImageUrl.ts index 2f6ed73f2..64598d161 100644 --- a/core/racing/domain/value-objects/TrackImageUrl.ts +++ b/core/racing/domain/value-objects/TrackImageUrl.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export class TrackImageUrl implements ValueObject { private constructor(private readonly value: string | undefined) {} @@ -20,7 +20,7 @@ export class TrackImageUrl implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/TrackLength.ts b/core/racing/domain/value-objects/TrackLength.ts index 05500b13b..9d14848d6 100644 --- a/core/racing/domain/value-objects/TrackLength.ts +++ b/core/racing/domain/value-objects/TrackLength.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export class TrackLength implements ValueObject { private constructor(private readonly value: number) {} @@ -19,7 +19,7 @@ export class TrackLength implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/TrackShortName.ts b/core/racing/domain/value-objects/TrackShortName.ts index 393d85ca0..7709adfc6 100644 --- a/core/racing/domain/value-objects/TrackShortName.ts +++ b/core/racing/domain/value-objects/TrackShortName.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export class TrackShortName implements ValueObject { private constructor(private readonly value: string) {} @@ -19,7 +19,7 @@ export class TrackShortName implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/TrackTurns.ts b/core/racing/domain/value-objects/TrackTurns.ts index fba8595eb..976d000c1 100644 --- a/core/racing/domain/value-objects/TrackTurns.ts +++ b/core/racing/domain/value-objects/TrackTurns.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export class TrackTurns implements ValueObject { private constructor(private readonly value: number) {} @@ -19,7 +19,7 @@ export class TrackTurns implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.value === other.props; } } \ No newline at end of file diff --git a/core/racing/domain/value-objects/WeekdaySet.ts b/core/racing/domain/value-objects/WeekdaySet.ts index 4899788d1..6f23ddefa 100644 --- a/core/racing/domain/value-objects/WeekdaySet.ts +++ b/core/racing/domain/value-objects/WeekdaySet.ts @@ -1,7 +1,7 @@ import type { Weekday } from '../types/Weekday'; import { weekdayToIndex } from '../types/Weekday'; import { RacingDomainValidationError } from '../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface WeekdaySetProps { days: Weekday[]; @@ -35,7 +35,7 @@ export class WeekdaySet implements ValueObject { return this.days.includes(day); } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { const a = this.props.days; const b = other.props.days; if (a.length !== b.length) return false; diff --git a/core/racing/domain/value-objects/driver/DriverId.ts b/core/racing/domain/value-objects/driver/DriverId.ts index 5d058b7fd..cc654ba46 100644 --- a/core/racing/domain/value-objects/driver/DriverId.ts +++ b/core/racing/domain/value-objects/driver/DriverId.ts @@ -1,5 +1,5 @@ import { RacingDomainValidationError } from '../../errors/RacingDomainError'; -import type { ValueObject } from '@core/shared/domain'; +import type { ValueObject } from '@core/shared/domain/ValueObject'; export interface DriverIdProps { value: string; @@ -19,7 +19,7 @@ export class DriverId implements ValueObject { return this.value; } - equals(other: IValueObject): boolean { + equals(other: ValueObject): boolean { return this.props.value === other.props.value; } diff --git a/core/shared/domain/DomainEvent.ts b/core/shared/domain/DomainEvent.ts index c587c119d..6ff27aaa3 100644 --- a/core/shared/domain/DomainEvent.ts +++ b/core/shared/domain/DomainEvent.ts @@ -10,4 +10,4 @@ export interface DomainEventPublisher { } // Alias for backward compatibility -export type IDomainEvent = DomainEvent; +export type DomainEventAlias = DomainEvent; diff --git a/core/shared/domain/Entity.ts b/core/shared/domain/Entity.ts index d80ec3ca1..50ea8972b 100644 --- a/core/shared/domain/Entity.ts +++ b/core/shared/domain/Entity.ts @@ -11,4 +11,4 @@ export abstract class Entity implements EntityProps { } // Alias for backward compatibility -export type IEntity = EntityProps; +export type EntityAlias = EntityProps; diff --git a/core/shared/domain/Service.ts b/core/shared/domain/Service.ts index e261c48e7..c28a98cc6 100644 --- a/core/shared/domain/Service.ts +++ b/core/shared/domain/Service.ts @@ -24,8 +24,8 @@ export interface DomainFactoryService extends DomainService { } // Alias for backward compatibility -export type IDomainService = DomainService; -export type IDomainCalculationService = DomainCalculationService; -export type IResultDomainCalculationService = ResultDomainCalculationService; -export type IDomainValidationService = DomainValidationService; -export type IDomainFactoryService = DomainFactoryService; +export type DomainServiceAlias = DomainService; +export type DomainCalculationServiceAlias = DomainCalculationService; +export type ResultDomainCalculationServiceAlias = ResultDomainCalculationService; +export type DomainValidationServiceAlias = DomainValidationService; +export type DomainFactoryServiceAlias = DomainFactoryService; diff --git a/core/shared/domain/ValueObject.ts b/core/shared/domain/ValueObject.ts index 09ab392a9..c4fd73486 100644 --- a/core/shared/domain/ValueObject.ts +++ b/core/shared/domain/ValueObject.ts @@ -3,4 +3,4 @@ export interface ValueObject { equals(other: ValueObject): boolean; } -export type IValueObject = ValueObject; +export type ValueObjectAlias = ValueObject; diff --git a/core/shared/errors/DomainError.ts b/core/shared/errors/DomainError.ts index 1fe09731b..3e3867cfb 100644 --- a/core/shared/errors/DomainError.ts +++ b/core/shared/errors/DomainError.ts @@ -8,3 +8,4 @@ export interface DomainErrorProps exte // Alias for backward compatibility export type IDomainError = DomainErrorProps; +export type DomainErrorAlias = DomainErrorProps; diff --git a/core/social/application/use-cases/GetCurrentUserSocialUseCase.test.ts b/core/social/application/use-cases/GetCurrentUserSocialUseCase.test.ts index de5ec6204..b8f2b6f28 100644 --- a/core/social/application/use-cases/GetCurrentUserSocialUseCase.test.ts +++ b/core/social/application/use-cases/GetCurrentUserSocialUseCase.test.ts @@ -8,7 +8,7 @@ import { } from './GetCurrentUserSocialUseCase'; describe('GetCurrentUserSocialUseCase', () => { - let socialGraphRepository: ISocialGraphRepository & { getFriends: Mock }; + let socialGraphRepository: SocialGraphRepository & { getFriends: Mock }; let logger: Logger & { debug: Mock; info: Mock; warn: Mock; error: Mock }; let useCase: GetCurrentUserSocialUseCase; diff --git a/core/social/application/use-cases/GetCurrentUserSocialUseCase.ts b/core/social/application/use-cases/GetCurrentUserSocialUseCase.ts index 2307d0842..bf04e1fa6 100644 --- a/core/social/application/use-cases/GetCurrentUserSocialUseCase.ts +++ b/core/social/application/use-cases/GetCurrentUserSocialUseCase.ts @@ -1,4 +1,4 @@ -import { ISocialGraphRepository } from '@/social/domain/repositories/SocialGraphRepository'; +import { SocialGraphRepository } from '@/social/domain/repositories/SocialGraphRepository'; import type { Logger } from '@core/shared/domain/Logger'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; @@ -31,7 +31,7 @@ export type GetCurrentUserSocialApplicationError = ApplicationErrorCode< */ export class GetCurrentUserSocialUseCase { constructor( - private readonly socialGraphRepository: ISocialGraphRepository, + private readonly socialGraphRepository: SocialGraphRepository, private readonly logger: Logger, ) {} diff --git a/core/social/application/use-cases/GetUserFeedUseCase.test.ts b/core/social/application/use-cases/GetUserFeedUseCase.test.ts index 681af083c..b21d968e6 100644 --- a/core/social/application/use-cases/GetUserFeedUseCase.test.ts +++ b/core/social/application/use-cases/GetUserFeedUseCase.test.ts @@ -8,7 +8,7 @@ import { } from './GetUserFeedUseCase'; describe('GetUserFeedUseCase', () => { - let feedRepository: IFeedRepository & { getFeedForDriver: Mock }; + let feedRepository: FeedRepository & { getFeedForDriver: Mock }; let logger: Logger & { debug: Mock; info: Mock; warn: Mock; error: Mock }; let useCase: GetUserFeedUseCase; @@ -16,7 +16,7 @@ describe('GetUserFeedUseCase', () => { feedRepository = { getFeedForDriver: vi.fn(), getGlobalFeed: vi.fn(), - } as unknown as IFeedRepository & { getFeedForDriver: Mock }; + } as unknown as FeedRepository & { getFeedForDriver: Mock }; logger = { debug: vi.fn(), diff --git a/core/social/application/use-cases/GetUserFeedUseCase.ts b/core/social/application/use-cases/GetUserFeedUseCase.ts index 705713835..88c72c417 100644 --- a/core/social/application/use-cases/GetUserFeedUseCase.ts +++ b/core/social/application/use-cases/GetUserFeedUseCase.ts @@ -1,4 +1,4 @@ -import { IFeedRepository } from '@/social/domain/repositories/FeedRepository'; +import { FeedRepository } from '@/social/domain/repositories/FeedRepository'; import type { Logger } from '@core/shared/domain/Logger'; import { Result } from '@core/shared/domain/Result'; import type { ApplicationErrorCode } from '@core/shared/errors/ApplicationErrorCode'; @@ -24,7 +24,7 @@ export type GetUserFeedApplicationError = ApplicationErrorCode< export class GetUserFeedUseCase { constructor( - private readonly feedRepository: IFeedRepository, + private readonly feedRepository: FeedRepository, private readonly logger: Logger, ) {} diff --git a/core/social/domain/errors/SocialDomainError.ts b/core/social/domain/errors/SocialDomainError.ts index 1878a999d..25110e5c9 100644 --- a/core/social/domain/errors/SocialDomainError.ts +++ b/core/social/domain/errors/SocialDomainError.ts @@ -1,9 +1,10 @@ -import type { DomainError, CommonDomainErrorKind } from '@core/shared/errors'; +import type { DomainError } from '@core/shared/errors/DomainError'; +import type { CommonDomainErrorKind } from '@core/shared/errors/DomainError'; /** * Domain Error: SocialDomainError * - * Implements the shared IDomainError contract for social domain failures. + * Implements the shared DomainError contract for social domain failures. */ export class SocialDomainError extends Error implements DomainError { readonly name = 'SocialDomainError'; diff --git a/core/social/domain/repositories/FeedRepository.ts b/core/social/domain/repositories/FeedRepository.ts index d5cb3aa51..1e7e31338 100644 --- a/core/social/domain/repositories/FeedRepository.ts +++ b/core/social/domain/repositories/FeedRepository.ts @@ -6,4 +6,4 @@ export interface FeedRepository { } // Alias for backward compatibility -export type IFeedRepository = FeedRepository; +export type FeedRepositoryAlias = FeedRepository; diff --git a/core/social/domain/repositories/SocialGraphRepository.ts b/core/social/domain/repositories/SocialGraphRepository.ts index 8024c603e..c6731b8b9 100644 --- a/core/social/domain/repositories/SocialGraphRepository.ts +++ b/core/social/domain/repositories/SocialGraphRepository.ts @@ -7,4 +7,4 @@ export interface SocialGraphRepository { } // Alias for backward compatibility -export type ISocialGraphRepository = SocialGraphRepository; +export type SocialGraphRepositoryAlias = SocialGraphRepository;