website refactor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { AnalyticsSnapshot } from '@core/analytics/domain/entities/AnalyticsSnapshot';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { AnalyticsSnapshot } from '@core/analytics/application/repositories/PageViewRepository';
|
||||
import { InMemoryAnalyticsSnapshotRepository } from './InMemoryAnalyticsSnapshotRepository';
|
||||
|
||||
describe('InMemoryAnalyticsSnapshotRepository', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EngagementEvent } from '@core/analytics/domain/entities/EngagementEvent';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { EngagementEvent } from '@core/analytics/application/repositories/PageViewRepository';
|
||||
import { InMemoryEngagementRepository } from './InMemoryEngagementRepository';
|
||||
|
||||
describe('InMemoryEngagementRepository', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { PageView } from '@core/analytics/domain/entities/PageView';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { PageView } from '@core/analytics/application/repositories/PageViewRepository';
|
||||
import { InMemoryPageViewRepository } from './InMemoryPageViewRepository';
|
||||
|
||||
describe('InMemoryPageViewRepository', () => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
import { SignupWithEmailUseCase } from '@core/identity/application/use-cases/SignupWithEmailUseCase';
|
||||
import { CreateAchievementUseCase } from '@core/identity/application/use-cases/achievement/CreateAchievementUseCase';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import {
|
||||
DRIVER_ACHIEVEMENTS,
|
||||
STEWARD_ACHIEVEMENTS,
|
||||
ADMIN_ACHIEVEMENTS,
|
||||
COMMUNITY_ACHIEVEMENTS,
|
||||
ADMIN_ACHIEVEMENTS,
|
||||
COMMUNITY_ACHIEVEMENTS,
|
||||
DRIVER_ACHIEVEMENTS,
|
||||
STEWARD_ACHIEVEMENTS,
|
||||
} from '@core/identity/domain/AchievementConstants';
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Game } from '@core/racing/domain/entities/Game';
|
||||
import { Season } from '@core/racing/domain/entities/season/Season';
|
||||
import type { LeagueScoringConfig } from '@core/racing/domain/entities/LeagueScoringConfig';
|
||||
import { Season } from '@core/racing/domain/entities/season/Season';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import {
|
||||
InMemoryChampionshipStandingRepository,
|
||||
InMemoryGameRepository,
|
||||
InMemoryLeagueScoringConfigRepository,
|
||||
InMemorySeasonRepository,
|
||||
InMemoryChampionshipStandingRepository,
|
||||
InMemoryGameRepository,
|
||||
InMemoryLeagueScoringConfigRepository,
|
||||
InMemorySeasonRepository,
|
||||
} from '../racing/persistence/inmemory/InMemoryScoringRepositories';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { getLeagueScoringPresetById } from './LeagueScoringPresets';
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { AuthRepository } from '@core/identity/domain/repositories/AuthRepository';
|
||||
import type { PasswordHashingService } from '@core/identity/domain/services/PasswordHashingService';
|
||||
import type { AdminUserRepository } from '@core/admin/domain/repositories/AdminUserRepository';
|
||||
import { User } from '@core/identity/domain/entities/User';
|
||||
import { AdminUser } from '@core/admin/domain/entities/AdminUser';
|
||||
import { EmailAddress } from '@core/identity/domain/value-objects/EmailAddress';
|
||||
import { UserId } from '@core/identity/domain/value-objects/UserId';
|
||||
import { Email } from '@core/admin/domain/value-objects/Email';
|
||||
import { UserRole } from '@core/admin/domain/value-objects/UserRole';
|
||||
import { UserStatus } from '@core/admin/domain/value-objects/UserStatus';
|
||||
import { User } from '@core/identity/domain/entities/User';
|
||||
import { EmailAddress } from '@core/identity/domain/value-objects/EmailAddress';
|
||||
import { PasswordHash } from '@core/identity/domain/value-objects/PasswordHash';
|
||||
import { UserId } from '@core/identity/domain/value-objects/UserId';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
// Import the class we're testing (will be created)
|
||||
import { SeedDemoUsers } from './SeedDemoUsers';
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { AuthRepository } from '@core/identity/domain/repositories/AuthRepository';
|
||||
import type { PasswordHashingService } from '@core/identity/domain/services/PasswordHashingService';
|
||||
import type { AdminUserRepository } from '@core/admin/domain/repositories/AdminUserRepository';
|
||||
import { User } from '@core/identity/domain/entities/User';
|
||||
import { AdminUser } from '@core/admin/domain/entities/AdminUser';
|
||||
import { EmailAddress } from '@core/identity/domain/value-objects/EmailAddress';
|
||||
import { UserId } from '@core/identity/domain/value-objects/UserId';
|
||||
import { Email } from '@core/admin/domain/value-objects/Email';
|
||||
import { User } from '@core/identity/domain/entities/User';
|
||||
import { EmailAddress } from '@core/identity/domain/value-objects/EmailAddress';
|
||||
import { PasswordHash } from '@core/identity/domain/value-objects/PasswordHash';
|
||||
import { UserId } from '@core/identity/domain/value-objects/UserId';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { stableUuidFromSeedKey } from './racing/SeedIdHelper';
|
||||
|
||||
interface DemoUserSpec {
|
||||
@@ -38,7 +35,7 @@ export class SeedDemoUsers {
|
||||
{
|
||||
email: 'demo.sponsor@example.com',
|
||||
password: 'Demo1234!',
|
||||
needsAdminUser: true,
|
||||
needsAdminUser: false,
|
||||
needsPrimaryDriverId: false,
|
||||
roles: ['sponsor'],
|
||||
displayName: 'Jane Sponsor',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
// IMPORTANT: SeedRacingData imports createRacingSeed from ./racing/RacingSeed
|
||||
// We mock it to avoid heavy seed generation and to keep the test focused on
|
||||
@@ -34,7 +34,7 @@ vi.mock('./racing/RacingSeed', () => {
|
||||
};
|
||||
});
|
||||
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { SeedRacingData, type RacingSeedDependencies } from './SeedRacingData';
|
||||
|
||||
describe('SeedRacingData force reseed behavior', () => {
|
||||
|
||||
@@ -1,39 +1,14 @@
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { DriverRepository } from '@core/racing/domain/repositories/DriverRepository';
|
||||
import type { LeagueRepository } from '@core/racing/domain/repositories/LeagueRepository';
|
||||
import type { RaceRepository } from '@core/racing/domain/repositories/RaceRepository';
|
||||
import type { ResultRepository } from '@core/racing/domain/repositories/ResultRepository';
|
||||
import type { StandingRepository } from '@core/racing/domain/repositories/StandingRepository';
|
||||
import type { LeagueMembershipRepository } from '@core/racing/domain/repositories/LeagueMembershipRepository';
|
||||
import type { RaceRegistrationRepository } from '@core/racing/domain/repositories/RaceRegistrationRepository';
|
||||
import type { TeamRepository } from '@core/racing/domain/repositories/TeamRepository';
|
||||
import type { TeamMembershipRepository } from '@core/racing/domain/repositories/TeamMembershipRepository';
|
||||
import type { SponsorRepository } from '@core/racing/domain/repositories/SponsorRepository';
|
||||
import type { SeasonRepository } from '@core/racing/domain/repositories/SeasonRepository';
|
||||
import type { LeagueScoringConfigRepository } from '@core/racing/domain/repositories/LeagueScoringConfigRepository';
|
||||
import type { SeasonSponsorshipRepository } from '@core/racing/domain/repositories/SeasonSponsorshipRepository';
|
||||
import type { SponsorshipRequestRepository } from '@core/racing/domain/repositories/SponsorshipRequestRepository';
|
||||
import type { LeagueWalletRepository } from '@core/racing/domain/repositories/LeagueWalletRepository';
|
||||
import type { TransactionRepository } from '@core/racing/domain/repositories/TransactionRepository';
|
||||
import type { Season } from '@core/racing/domain/entities/season/Season';
|
||||
import { getLeagueScoringPresetById } from './LeagueScoringPresets';
|
||||
import type { ProtestRepository } from '@core/racing/domain/repositories/ProtestRepository';
|
||||
import type { PenaltyRepository } from '@core/racing/domain/repositories/PenaltyRepository';
|
||||
import type { FeedRepository } from '@core/social/domain/repositories/FeedRepository';
|
||||
import type { SocialGraphRepository } from '@core/social/domain/repositories/SocialGraphRepository';
|
||||
import type { DriverStatsRepository } from '@core/racing/domain/repositories/DriverStatsRepository';
|
||||
import type { TeamStatsRepository, TeamStats } from '@core/racing/domain/repositories/TeamStatsRepository';
|
||||
import type { MediaRepository } from '@core/racing/domain/repositories/MediaRepository';
|
||||
import type { AuthRepository } from '@core/identity/domain/repositories/AuthRepository';
|
||||
import type { PasswordHashingService } from '@core/identity/domain/services/PasswordHashingService';
|
||||
import type { AdminUserRepository } from '@core/admin/domain/repositories/AdminUserRepository';
|
||||
import { createRacingSeed } from './racing/RacingSeed';
|
||||
import { seedId } from './racing/SeedIdHelper';
|
||||
import type { DriverStats } from '@core/racing/application/use-cases/DriverStatsUseCase';
|
||||
import { Driver } from '@core/racing/domain/entities/Driver';
|
||||
import { Result } from '@core/racing/domain/entities/result/Result';
|
||||
import type { Season } from '@core/racing/domain/entities/season/Season';
|
||||
import { Standing } from '@core/racing/domain/entities/Standing';
|
||||
import { Team } from '@core/racing/domain/entities/Team';
|
||||
import type { DriverStats } from '@core/racing/application/use-cases/DriverStatsUseCase';
|
||||
import type { TeamStats } from '@core/racing/domain/repositories/TeamStatsRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { getLeagueScoringPresetById } from './LeagueScoringPresets';
|
||||
import { createRacingSeed } from './racing/RacingSeed';
|
||||
import { seedId } from './racing/SeedIdHelper';
|
||||
|
||||
export type RacingSeedDependencies = {
|
||||
driverRepository: IDriverRepository;
|
||||
|
||||
@@ -62,7 +62,7 @@ export class RacingDriverFactory {
|
||||
}
|
||||
|
||||
// Create system-default reference with avatar variant
|
||||
return MediaReference.systemDefault(avatarVariant);
|
||||
return MediaReference.createSystemDefault('avatar', avatarVariant);
|
||||
}
|
||||
|
||||
create(): Driver[] {
|
||||
|
||||
@@ -48,7 +48,7 @@ export class RacingTeamFactory {
|
||||
leagues: teamLeagues,
|
||||
isRecruiting,
|
||||
createdAt: faker.date.past({ years: 2, refDate: this.baseDate }),
|
||||
logoRef: MediaReference.generated('team', teamId),
|
||||
logoRef: MediaReference.createGenerated(`team-${teamId}`),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ module.exports = {
|
||||
fixable: null,
|
||||
schema: [],
|
||||
messages: {
|
||||
invalidNaming: 'Adapter classes should end with "Adapter", "Repository", "Service", or "Entity". Found: {{name}}',
|
||||
invalidNaming: 'Adapter classes should end with "Adapter", "Repository", "Service", "Factory" or "Entity". Found: {{name}}',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = {
|
||||
if (!filename.includes('adapters/')) return;
|
||||
|
||||
const name = node.id.name;
|
||||
const isValidName = /(.+)(Adapter|Repository|Service|Entity|Mapper|Schema|Guard|Module|Controller)$/.test(name);
|
||||
const isValidName = /(.+)(Adapter|Factory|Repository|Service|Entity|Mapper|Schema|Guard|Module|Controller)$/.test(name);
|
||||
|
||||
if (!isValidName) {
|
||||
context.report({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { UserAchievement } from '@core/identity';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryAchievementRepository } from './InMemoryAchievementRepository';
|
||||
|
||||
describe('InMemoryAchievementRepository (identity)', () => {
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
* In-memory implementation of IAchievementRepository
|
||||
*/
|
||||
|
||||
import { Achievement, AchievementCategory, IAchievementRepository, UserAchievement } from "@core/identity";
|
||||
import { Achievement } from "@core/identity/domain/entities/Achievement";
|
||||
import { AchievementCategory } from "@core/identity/domain/types/AchievementTypes";
|
||||
import { AchievementRepository } from "@core/identity/domain/repositories/AchievementRepository";
|
||||
import { UserAchievement } from "@core/identity/domain/entities/UserAchievement";
|
||||
import { ADMIN_ACHIEVEMENTS, COMMUNITY_ACHIEVEMENTS, DRIVER_ACHIEVEMENTS, STEWARD_ACHIEVEMENTS } from "@core/identity/domain/AchievementConstants";
|
||||
import { Logger } from "@core/shared/domain";
|
||||
|
||||
|
||||
|
||||
export class InMemoryAchievementRepository implements AchievementRepository {
|
||||
private achievements: Map<string, Achievement> = new Map();
|
||||
private userAchievements: Map<string, UserAchievement> = new Map();
|
||||
@@ -282,4 +283,4 @@ export class InMemoryAchievementRepository implements AchievementRepository {
|
||||
this.userAchievements.clear();
|
||||
this.logger.info('All achievement data cleared.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { UserId } from '@core/identity';
|
||||
import { User } from '@core/identity/domain/entities/User';
|
||||
import { InMemoryUserRepository } from './InMemoryUserRepository';
|
||||
import { InMemoryAuthRepository } from './InMemoryAuthRepository';
|
||||
import { UserId } from '@core/identity/domain/value-objects/UserId';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryPasswordHashingService } from '../../services/InMemoryPasswordHashingService';
|
||||
import { InMemoryAuthRepository } from './InMemoryAuthRepository';
|
||||
import { InMemoryUserRepository } from './InMemoryUserRepository';
|
||||
|
||||
describe('InMemoryAuthRepository', () => {
|
||||
let mockLogger: Logger;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { SponsorAccount } from '@core/identity/domain/entities/SponsorAccount';
|
||||
import { UserId } from '@core/identity/domain/value-objects/UserId';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { UserId, type SponsorAccount } from '@core/identity';
|
||||
import { InMemorySponsorAccountRepository } from './InMemorySponsorAccountRepository';
|
||||
|
||||
describe('InMemorySponsorAccountRepository', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { UserRating } from '@core/identity';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryUserRatingRepository } from './InMemoryUserRatingRepository';
|
||||
|
||||
describe('InMemoryUserRatingRepository', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { StoredUser } from '@core/identity/domain/repositories/UserRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryUserRepository } from './InMemoryUserRepository';
|
||||
|
||||
describe('InMemoryUserRepository', () => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { randomUUID } from 'node:crypto';
|
||||
|
||||
import { tryGetHttpRequestContext } from '@adapters/http/RequestContext';
|
||||
import type { AuthenticatedUser } from '@core/identity/application/ports/IdentityProviderPort';
|
||||
import type { AuthSession, IdentitySessionPort } from '@core/identity/application/ports/IdentitySessionPort';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { tryGetHttpRequestContext } from '@adapters/http/RequestContext';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
const COOKIE_NAME = 'gp_session';
|
||||
const SESSION_TTL_MS = 3600 * 1000; // 1 hour
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { AvatarGenerationRequest } from '@core/media/domain/entities/AvatarGenerationRequest';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryAvatarGenerationRepository } from './InMemoryAvatarGenerationRepository';
|
||||
|
||||
describe('InMemoryAvatarGenerationRepository', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { InMemoryFaceValidationAdapter } from './InMemoryFaceValidationAdapter';
|
||||
|
||||
describe('InMemoryFaceValidationAdapter', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { FaceValidationPort, FaceValidationResult } from '@core/media/application/ports/FaceValidationPort';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemoryFaceValidationAdapter implements FaceValidationPort {
|
||||
constructor(private readonly logger: Logger) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { InMemoryImageServiceAdapter } from './InMemoryImageServiceAdapter';
|
||||
|
||||
describe('InMemoryImageServiceAdapter', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { ImageServicePort } from '@core/racing/application/ports/ImageServicePort';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemoryImageServiceAdapter implements ImageServicePort {
|
||||
constructor(private readonly logger: Logger) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { NotificationPreference } from '@core/notifications/domain/entities/NotificationPreference';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryNotificationPreferenceRepository } from './InMemoryNotificationPreferenceRepository';
|
||||
|
||||
describe('InMemoryNotificationPreferenceRepository', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryNotificationRepository } from './InMemoryNotificationRepository';
|
||||
|
||||
describe('InMemoryNotificationRepository', () => {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { Notification } from '@core/notifications/domain/entities/Notification';
|
||||
import type { NotificationRepository } from '@core/notifications/domain/repositories/NotificationRepository';
|
||||
import type { NotificationType } from '@core/notifications/domain/types/NotificationTypes';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemoryNotificationRepository implements NotificationRepository {
|
||||
private notifications: Map<string, Notification> = new Map();
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import type { NotificationService, SendNotificationCommand } from '@core/notifications/application/ports/NotificationService';
|
||||
import type { NotificationRepository } from '@core/notifications/domain/repositories/NotificationRepository';
|
||||
import type { NotificationPreferenceRepository } from '@core/notifications/domain/repositories/NotificationPreferenceRepository';
|
||||
import type { NotificationGatewayRegistry } from '@core/notifications/application/ports/NotificationGateway';
|
||||
import type { NotificationService, SendNotificationCommand } from '@core/notifications/application/ports/NotificationService';
|
||||
import { SendNotificationUseCase } from '@core/notifications/application/use-cases/SendNotificationUseCase';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class NotificationServiceAdapter implements NotificationService {
|
||||
private readonly useCase: SendNotificationUseCase;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryCarRepository } from './InMemoryCarRepository';
|
||||
import { Car } from '@core/racing/domain/entities/Car';
|
||||
import { CarClass } from '@core/racing/domain/entities/CarClass';
|
||||
import { CarLicense } from '@core/racing/domain/entities/CarLicense';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryCarRepository } from './InMemoryCarRepository';
|
||||
|
||||
describe('InMemoryCarRepository', () => {
|
||||
let repository: InMemoryCarRepository;
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
* Stores data in Map structure with UUID generation.
|
||||
*/
|
||||
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { Car } from '@core/racing/domain/entities/Car';
|
||||
import { CarClass } from '@core/racing/domain/entities/CarClass';
|
||||
import { CarLicense } from '@core/racing/domain/entities/CarLicense';
|
||||
import type { CarRepository } from '@core/racing/domain/repositories/CarRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
export class InMemoryCarRepository implements CarRepository {
|
||||
private cars: Map<string, Car>;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryDriverRepository } from './InMemoryDriverRepository';
|
||||
import { Driver } from '@core/racing/domain/entities/Driver';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { MediaReference } from '@core/domain/media/MediaReference';
|
||||
import { Driver } from '@core/racing/domain/entities/Driver';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryDriverRepository } from './InMemoryDriverRepository';
|
||||
|
||||
describe('InMemoryDriverRepository', () => {
|
||||
let repository: InMemoryDriverRepository;
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
* Stores computed driver statistics for caching and frontend queries.
|
||||
*/
|
||||
|
||||
import type { DriverStatsRepository } from '@core/racing/domain/repositories/DriverStatsRepository';
|
||||
import type { DriverStats } from '@core/racing/application/use-cases/DriverStatsUseCase';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { DriverStatsRepository } from '@core/racing/domain/repositories/DriverStatsRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemoryDriverStatsRepository implements DriverStatsRepository {
|
||||
private stats = new Map<string, DriverStats>();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryGameRepository } from './InMemoryGameRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
|
||||
describe('InMemoryGameRepository', () => {
|
||||
let repository: InMemoryGameRepository;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { InMemoryLeagueMembershipRepository } from './InMemoryLeagueMembershipRepository';
|
||||
|
||||
describe('InMemoryLeagueMembershipRepository', () => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryLeagueRepository } from './InMemoryLeagueRepository';
|
||||
import { League } from '@core/racing/domain/entities/League';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryLeagueRepository } from './InMemoryLeagueRepository';
|
||||
|
||||
describe('InMemoryLeagueRepository', () => {
|
||||
let repository: InMemoryLeagueRepository;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryLeagueScoringConfigRepository } from './InMemoryLeagueScoringConfigRepository';
|
||||
import { LeagueScoringConfig, type LeagueScoringConfigProps } from '@core/racing/domain/entities/LeagueScoringConfig';
|
||||
import type { ChampionshipConfig } from '@core/racing/domain/types/ChampionshipConfig';
|
||||
import { PointsTable } from '@core/racing/domain/value-objects/PointsTable';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryLeagueScoringConfigRepository } from './InMemoryLeagueScoringConfigRepository';
|
||||
|
||||
const mockPointsTable = new PointsTable({ 1: 25, 2: 18, 3: 15 });
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryLeagueStandingsRepository } from './InMemoryLeagueStandingsRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { RawStanding } from '@core/league/application/ports/LeagueStandingsRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryLeagueStandingsRepository } from './InMemoryLeagueStandingsRepository';
|
||||
|
||||
describe('InMemoryLeagueStandingsRepository', () => {
|
||||
let repository: InMemoryLeagueStandingsRepository;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryLeagueWalletRepository } from './InMemoryLeagueWalletRepository';
|
||||
import { LeagueWallet } from '@core/racing/domain/entities/league-wallet/LeagueWallet';
|
||||
import { Money } from '@core/racing/domain/value-objects/Money';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryLeagueWalletRepository } from './InMemoryLeagueWalletRepository';
|
||||
|
||||
describe('InMemoryLeagueWalletRepository', () => {
|
||||
let repository: InMemoryLeagueWalletRepository;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { LeagueWallet } from '@core/racing/domain/entities/league-wallet/LeagueWallet';
|
||||
import type { LeagueWalletRepository } from '@core/racing/domain/repositories/LeagueWalletRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemoryLeagueWalletRepository implements LeagueWalletRepository {
|
||||
private wallets: Map<string, LeagueWallet> = new Map();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryLiveryRepository } from './InMemoryLiveryRepository';
|
||||
import { DriverLivery } from '@core/racing/domain/entities/DriverLivery';
|
||||
import { LiveryTemplate } from '@core/racing/domain/entities/LiveryTemplate';
|
||||
import { LiveryDecal } from '@core/racing/domain/value-objects/LiveryDecal';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryLiveryRepository } from './InMemoryLiveryRepository';
|
||||
|
||||
describe('InMemoryLiveryRepository', () => {
|
||||
let repository: InMemoryLiveryRepository;
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
* Mock repository for testing and development
|
||||
*/
|
||||
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import type { DriverLivery } from '../../../../core/racing/domain/entities/DriverLivery';
|
||||
import type { LiveryTemplate } from '../../../../core/racing/domain/entities/LiveryTemplate';
|
||||
import type { LiveryRepository } from '../../../../core/racing/domain/repositories/LiveryRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
|
||||
export class InMemoryLiveryRepository implements LiveryRepository {
|
||||
private driverLiveries: Map<string, DriverLivery> = new Map();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryPenaltyRepository } from './InMemoryPenaltyRepository';
|
||||
import { Penalty } from '@core/racing/domain/entities/penalty/Penalty';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryPenaltyRepository } from './InMemoryPenaltyRepository';
|
||||
|
||||
describe('InMemoryPenaltyRepository', () => {
|
||||
let repository: InMemoryPenaltyRepository;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { Penalty } from '@core/racing/domain/entities/penalty/Penalty';
|
||||
import type { PenaltyRepository } from '@core/racing/domain/repositories/PenaltyRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemoryPenaltyRepository implements PenaltyRepository {
|
||||
private penalties: Map<string, Penalty> = new Map();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryProtestRepository } from './InMemoryProtestRepository';
|
||||
import { Protest } from '@core/racing/domain/entities/Protest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryProtestRepository } from './InMemoryProtestRepository';
|
||||
|
||||
describe('InMemoryProtestRepository', () => {
|
||||
let repository: InMemoryProtestRepository;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryRaceEventRepository } from './InMemoryRaceEventRepository';
|
||||
import { RaceEvent } from '@core/racing/domain/entities/RaceEvent';
|
||||
import { Session } from '@core/racing/domain/entities/Session';
|
||||
import { SessionType } from '@core/racing/domain/value-objects/SessionType';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryRaceEventRepository } from './InMemoryRaceEventRepository';
|
||||
|
||||
describe('InMemoryRaceEventRepository', () => {
|
||||
let repository: InMemoryRaceEventRepository;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* In-memory implementation of IRaceEventRepository for development/testing.
|
||||
*/
|
||||
import type { RaceEventRepository } from '@core/racing/domain/repositories/RaceEventRepository';
|
||||
import type { RaceEvent } from '@core/racing/domain/entities/RaceEvent';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { RaceEventRepository } from '@core/racing/domain/repositories/RaceEventRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemoryRaceEventRepository implements RaceEventRepository {
|
||||
private raceEvents: Map<string, RaceEvent> = new Map();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryRaceRegistrationRepository } from './InMemoryRaceRegistrationRepository';
|
||||
import { RaceRegistration } from '@core/racing/domain/entities/RaceRegistration';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryRaceRegistrationRepository } from './InMemoryRaceRegistrationRepository';
|
||||
|
||||
describe('InMemoryRaceRegistrationRepository', () => {
|
||||
let repository: InMemoryRaceRegistrationRepository;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryRaceRepository } from './InMemoryRaceRepository';
|
||||
import { Race, type RaceStatusValue } from '@core/racing/domain/entities/Race';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryRaceRepository } from './InMemoryRaceRepository';
|
||||
|
||||
describe('InMemoryRaceRepository', () => {
|
||||
let repository: InMemoryRaceRepository;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryResultRepository } from './InMemoryResultRepository';
|
||||
import { Result } from '@core/racing/domain/entities/result/Result';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { RaceRepository } from '@core/racing/domain/repositories/RaceRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryResultRepository } from './InMemoryResultRepository';
|
||||
|
||||
describe('InMemoryResultRepository', () => {
|
||||
let repository: InMemoryResultRepository;
|
||||
|
||||
@@ -5,11 +5,10 @@
|
||||
* Stores data in Map structure with UUID generation.
|
||||
*/
|
||||
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { Result } from '@core/racing/domain/entities/result/Result';
|
||||
import type { ResultRepository } from '@core/racing/domain/repositories/ResultRepository';
|
||||
import type { RaceRepository } from '@core/racing/domain/repositories/RaceRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
export class InMemoryResultRepository implements ResultRepository {
|
||||
private results: Map<string, Result>;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import {
|
||||
InMemoryGameRepository,
|
||||
InMemorySeasonRepository,
|
||||
InMemoryLeagueScoringConfigRepository,
|
||||
InMemoryChampionshipStandingRepository,
|
||||
} from './InMemoryScoringRepositories';
|
||||
import { Game } from '@core/racing/domain/entities/Game';
|
||||
import { Season } from '@core/racing/domain/entities/season/Season';
|
||||
import { LeagueScoringConfig } from '@core/racing/domain/entities/LeagueScoringConfig';
|
||||
import { ChampionshipStanding } from '@core/racing/domain/entities/championship/ChampionshipStanding';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { Season } from '@core/racing/domain/entities/season/Season';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import {
|
||||
InMemoryChampionshipStandingRepository,
|
||||
InMemoryGameRepository,
|
||||
InMemoryLeagueScoringConfigRepository,
|
||||
InMemorySeasonRepository,
|
||||
} from './InMemoryScoringRepositories';
|
||||
|
||||
describe('InMemoryScoringRepositories', () => {
|
||||
let mockLogger: Logger;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Game } from '@core/racing/domain/entities/Game';
|
||||
import { Season } from '@core/racing/domain/entities/season/Season';
|
||||
import type { LeagueScoringConfig } from '@core/racing/domain/entities/LeagueScoringConfig';
|
||||
import type { GameRepository } from '@core/racing/domain/repositories/GameRepository';
|
||||
import type { SeasonRepository } from '@core/racing/domain/repositories/SeasonRepository';
|
||||
import type { LeagueScoringConfigRepository } from '@core/racing/domain/repositories/LeagueScoringConfigRepository';
|
||||
import type { ChampionshipStandingRepository } from '@core/racing/domain/repositories/ChampionshipStandingRepository';
|
||||
import { ChampionshipStanding } from '@core/racing/domain/entities/championship/ChampionshipStanding';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { Game } from '@core/racing/domain/entities/Game';
|
||||
import type { LeagueScoringConfig } from '@core/racing/domain/entities/LeagueScoringConfig';
|
||||
import { Season } from '@core/racing/domain/entities/season/Season';
|
||||
import type { ChampionshipStandingRepository } from '@core/racing/domain/repositories/ChampionshipStandingRepository';
|
||||
import type { GameRepository } from '@core/racing/domain/repositories/GameRepository';
|
||||
import type { LeagueScoringConfigRepository } from '@core/racing/domain/repositories/LeagueScoringConfigRepository';
|
||||
import type { SeasonRepository } from '@core/racing/domain/repositories/SeasonRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
|
||||
export class InMemoryGameRepository implements GameRepository {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemorySeasonRepository } from './InMemorySeasonRepository';
|
||||
import { Season } from '@core/racing/domain/entities/season/Season';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemorySeasonRepository } from './InMemorySeasonRepository';
|
||||
|
||||
describe('InMemorySeasonRepository', () => {
|
||||
let repository: InMemorySeasonRepository;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemorySeasonSponsorshipRepository } from './InMemorySeasonSponsorshipRepository';
|
||||
import { SeasonSponsorship, type SponsorshipTier } from '@core/racing/domain/entities/season/SeasonSponsorship';
|
||||
import { Money } from '@core/racing/domain/value-objects/Money';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemorySeasonSponsorshipRepository } from './InMemorySeasonSponsorshipRepository';
|
||||
|
||||
describe('InMemorySeasonSponsorshipRepository', () => {
|
||||
let repository: InMemorySeasonSponsorshipRepository;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { SeasonSponsorship, SponsorshipTier } from '@core/racing/domain/entities/season/SeasonSponsorship';
|
||||
import type { SeasonSponsorshipRepository } from '@core/racing/domain/repositories/SeasonSponsorshipRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemorySeasonSponsorshipRepository implements SeasonSponsorshipRepository {
|
||||
private sponsorships: Map<string, SeasonSponsorship> = new Map();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemorySessionRepository } from './InMemorySessionRepository';
|
||||
import { Session, SessionStatus } from '@core/racing/domain/entities/Session';
|
||||
import { SessionType } from '@core/racing/domain/value-objects/SessionType';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemorySessionRepository } from './InMemorySessionRepository';
|
||||
|
||||
describe('InMemorySessionRepository', () => {
|
||||
let repository: InMemorySessionRepository;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/**
|
||||
* In-memory implementation of ISessionRepository for development/testing.
|
||||
*/
|
||||
import type { SessionRepository } from '@core/racing/domain/repositories/SessionRepository';
|
||||
import type { Session } from '@core/racing/domain/entities/Session';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { SessionRepository } from '@core/racing/domain/repositories/SessionRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemorySessionRepository implements SessionRepository {
|
||||
private sessions: Map<string, Session> = new Map();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemorySponsorRepository } from './InMemorySponsorRepository';
|
||||
import { Sponsor } from '@core/racing/domain/entities/sponsor/Sponsor';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemorySponsorRepository } from './InMemorySponsorRepository';
|
||||
|
||||
describe('InMemorySponsorRepository', () => {
|
||||
let repository: InMemorySponsorRepository;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemorySponsorshipPricingRepository } from './InMemorySponsorshipPricingRepository';
|
||||
import { SponsorshipPricing } from '@core/racing/domain/value-objects/SponsorshipPricing';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemorySponsorshipPricingRepository } from './InMemorySponsorshipPricingRepository';
|
||||
|
||||
describe('InMemorySponsorshipPricingRepository', () => {
|
||||
let repository: InMemorySponsorshipPricingRepository;
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
* InMemory implementation of ISponsorshipPricingRepository
|
||||
*/
|
||||
|
||||
import type { SponsorableEntityType } from '@core/racing/domain/entities/SponsorshipRequest';
|
||||
import type { SponsorshipPricingRepository } from '@core/racing/domain/repositories/SponsorshipPricingRepository';
|
||||
import { SponsorshipPricing } from '@core/racing/domain/value-objects/SponsorshipPricing';
|
||||
import type { SponsorableEntityType } from '@core/racing/domain/entities/SponsorshipRequest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemorySponsorshipPricingRepository implements SponsorshipPricingRepository {
|
||||
private pricings: Map<string, { entityType: SponsorableEntityType; entityId: string; pricing: SponsorshipPricing }> = new Map();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemorySponsorshipRequestRepository } from './InMemorySponsorshipRequestRepository';
|
||||
import { SponsorshipRequest, SponsorableEntityType, SponsorshipRequestStatus } from '@core/racing/domain/entities/SponsorshipRequest';
|
||||
import { Money } from '@core/racing/domain/value-objects/Money';
|
||||
import { SponsorshipTier } from '@core/racing/domain/entities/season/SeasonSponsorship';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { SponsorableEntityType, SponsorshipRequest, SponsorshipRequestStatus } from '@core/racing/domain/entities/SponsorshipRequest';
|
||||
import { Money } from '@core/racing/domain/value-objects/Money';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemorySponsorshipRequestRepository } from './InMemorySponsorshipRequestRepository';
|
||||
|
||||
describe('InMemorySponsorshipRequestRepository', () => {
|
||||
let repository: InMemorySponsorshipRequestRepository;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryStandingRepository } from './InMemoryStandingRepository';
|
||||
import { Standing } from '@core/racing/domain/entities/Standing';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryStandingRepository } from './InMemoryStandingRepository';
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
|
||||
@@ -7,10 +7,7 @@
|
||||
|
||||
import { Standing } from '@core/racing/domain/entities/Standing';
|
||||
import type { StandingRepository } from '@core/racing/domain/repositories/StandingRepository';
|
||||
import type { ResultRepository } from '@core/racing/domain/repositories/ResultRepository';
|
||||
import type { RaceRepository } from '@core/racing/domain/repositories/RaceRepository';
|
||||
import type { LeagueRepository } from '@core/racing/domain/repositories/LeagueRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemoryStandingRepository implements StandingRepository {
|
||||
private standings: Map<string, Standing>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import type { TeamJoinRequest, TeamMembership } from '@core/racing/domain/types/TeamMembership';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryTeamMembershipRepository } from './InMemoryTeamMembershipRepository';
|
||||
import type { TeamMembership, TeamJoinRequest } from '@core/racing/domain/types/TeamMembership';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
* Stores memberships and join requests in Map structures.
|
||||
*/
|
||||
|
||||
import type {
|
||||
TeamMembership,
|
||||
TeamJoinRequest,
|
||||
} from '@core/racing/domain/types/TeamMembership';
|
||||
import type { TeamMembershipRepository } from '@core/racing/domain/repositories/TeamMembershipRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type {
|
||||
TeamJoinRequest,
|
||||
TeamMembership,
|
||||
} from '@core/racing/domain/types/TeamMembership';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemoryTeamMembershipRepository implements TeamMembershipRepository {
|
||||
private membershipsByTeam: Map<string, TeamMembership[]>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryTeamRepository } from './InMemoryTeamRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { Team } from '@core/racing/domain/entities/Team';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryTeamRepository } from './InMemoryTeamRepository';
|
||||
|
||||
describe('InMemoryTeamRepository', () => {
|
||||
let repository: InMemoryTeamRepository;
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
* Stores data in a Map structure.
|
||||
*/
|
||||
|
||||
import { MediaReference } from '@core/domain/media/MediaReference';
|
||||
import { Team } from '@core/racing/domain/entities/Team';
|
||||
import type { TeamRepository } from '@core/racing/domain/repositories/TeamRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { MediaReference } from '@core/domain/media/MediaReference';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemoryTeamRepository implements TeamRepository {
|
||||
private teams: Map<string, Team>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryTrackRepository } from './InMemoryTrackRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { Track } from '@core/racing/domain/entities/Track';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryTrackRepository } from './InMemoryTrackRepository';
|
||||
|
||||
describe('InMemoryTrackRepository', () => {
|
||||
let repository: InMemoryTrackRepository;
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
* Stores data in Map structure with UUID generation.
|
||||
*/
|
||||
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { Track, TrackCategory } from '@core/racing/domain/entities/Track';
|
||||
import type { TrackRepository } from '@core/racing/domain/repositories/TrackRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
export class InMemoryTrackRepository implements TrackRepository {
|
||||
private tracks: Map<string, Track>;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { vi, describe, it, expect, beforeEach } from 'vitest';
|
||||
import { InMemoryTransactionRepository } from './InMemoryTransactionRepository';
|
||||
import { LeagueWalletId } from '@core/racing/domain/entities/league-wallet/LeagueWalletId';
|
||||
import { Transaction, TransactionType } from '@core/racing/domain/entities/league-wallet/Transaction';
|
||||
import { TransactionId } from '@core/racing/domain/entities/league-wallet/TransactionId';
|
||||
import { LeagueWalletId } from '@core/racing/domain/entities/league-wallet/LeagueWalletId';
|
||||
import { Money } from '@core/racing/domain/value-objects/Money';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { InMemoryTransactionRepository } from './InMemoryTransactionRepository';
|
||||
|
||||
describe('InMemoryTransactionRepository', () => {
|
||||
let repository: InMemoryTransactionRepository;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import type { Transaction, TransactionType } from '@core/racing/domain/entities/league-wallet/Transaction';
|
||||
import type { TransactionRepository } from '@core/racing/domain/repositories/TransactionRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemoryTransactionRepository implements TransactionRepository {
|
||||
private transactions: Map<string, Transaction> = new Map();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import type { MediaRepository } from '@core/racing/domain/repositories/MediaRepository';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
export class InMemoryMediaRepository implements MediaRepository {
|
||||
private driverAvatars = new Map<string, string>();
|
||||
|
||||
@@ -22,9 +22,9 @@ describe('TypeOrmTeamRepository', () => {
|
||||
|
||||
const teamRepo = new TypeOrmTeamRepository(repo as any, mapper as any);
|
||||
|
||||
const team = await teamRepo.findById('team-1');
|
||||
const team = await teamRepo.findById('550e8400-e29b-41d4-a716-446655440000');
|
||||
|
||||
expect(repo.findOne).toHaveBeenCalledWith({ where: { id: 'team-1' } });
|
||||
expect(repo.findOne).toHaveBeenCalledWith({ where: { id: '550e8400-e29b-41d4-a716-446655440000' } });
|
||||
expect(mapper.toDomain).toHaveBeenCalledWith(ormEntity);
|
||||
expect(team).toEqual({ id: 'domain-team' });
|
||||
});
|
||||
|
||||
@@ -33,31 +33,20 @@ describe('TypeOrmDriverRepository', () => {
|
||||
|
||||
const repo = new TypeOrmDriverRepository(dataSource, mapper);
|
||||
|
||||
await expect(repo.findById('driver-1')).resolves.toBeNull();
|
||||
await expect(repo.findById('00000000-0000-0000-0000-000000000001')).resolves.toBeNull();
|
||||
});
|
||||
|
||||
it('persists and retrieves driver with avatarRef (roundtrip test)', async () => {
|
||||
const driverId = '00000000-0000-0000-0000-000000000123';
|
||||
// Create a driver with a specific avatar reference
|
||||
const driver = Driver.create({
|
||||
id: 'driver-123',
|
||||
id: driverId,
|
||||
iracingId: '456789',
|
||||
name: 'Test Driver',
|
||||
country: 'US',
|
||||
avatarRef: MediaReference.createUploaded('media-abc-123'),
|
||||
});
|
||||
|
||||
// Mock entity that would be saved
|
||||
const mockEntity = {
|
||||
id: 'driver-123',
|
||||
iracingId: '456789',
|
||||
name: 'Test Driver',
|
||||
country: 'US',
|
||||
bio: null,
|
||||
joinedAt: driver.joinedAt.toDate(),
|
||||
category: null,
|
||||
avatarRef: { type: 'uploaded', mediaId: 'media-abc-123' },
|
||||
};
|
||||
|
||||
const savedEntities: any[] = [];
|
||||
|
||||
const repo = {
|
||||
@@ -82,32 +71,22 @@ describe('TypeOrmDriverRepository', () => {
|
||||
expect(savedEntities[0].avatarRef).toEqual({ type: 'uploaded', mediaId: 'media-abc-123' });
|
||||
|
||||
// Test load
|
||||
const loaded = await typeOrmRepo.findById('driver-123');
|
||||
const loaded = await typeOrmRepo.findById(driverId);
|
||||
expect(loaded).not.toBeNull();
|
||||
expect(loaded!.avatarRef.type).toBe('uploaded');
|
||||
expect(loaded!.avatarRef.mediaId).toBe('media-abc-123');
|
||||
});
|
||||
|
||||
it('handles system-default avatarRef correctly', async () => {
|
||||
const driverId = '00000000-0000-0000-0000-000000000456';
|
||||
const driver = Driver.create({
|
||||
id: 'driver-456',
|
||||
id: driverId,
|
||||
iracingId: '98765',
|
||||
name: 'Default Driver',
|
||||
country: 'UK',
|
||||
avatarRef: MediaReference.createSystemDefault('avatar'),
|
||||
});
|
||||
|
||||
const mockEntity = {
|
||||
id: 'driver-456',
|
||||
iracingId: '98765',
|
||||
name: 'Default Driver',
|
||||
country: 'UK',
|
||||
bio: null,
|
||||
joinedAt: driver.joinedAt.toDate(),
|
||||
category: null,
|
||||
avatarRef: { type: 'system-default', variant: 'avatar' },
|
||||
};
|
||||
|
||||
const savedEntities: any[] = [];
|
||||
|
||||
const repo = {
|
||||
@@ -129,31 +108,22 @@ describe('TypeOrmDriverRepository', () => {
|
||||
|
||||
expect(savedEntities[0].avatarRef).toEqual({ type: 'system-default', variant: 'avatar' });
|
||||
|
||||
const loaded = await typeOrmRepo.findById('driver-456');
|
||||
const loaded = await typeOrmRepo.findById(driverId);
|
||||
expect(loaded).not.toBeNull();
|
||||
expect(loaded!.avatarRef.type).toBe('system-default');
|
||||
expect(loaded!.avatarRef.variant).toBe('avatar');
|
||||
});
|
||||
|
||||
it('handles generated avatarRef correctly', async () => {
|
||||
const driverId = '00000000-0000-0000-0000-000000000789';
|
||||
const driver = Driver.create({
|
||||
id: 'driver-789',
|
||||
id: driverId,
|
||||
iracingId: '11111',
|
||||
name: 'Generated Driver',
|
||||
country: 'DE',
|
||||
avatarRef: MediaReference.createGenerated('gen-req-xyz'),
|
||||
});
|
||||
|
||||
const mockEntity = {
|
||||
id: 'driver-789',
|
||||
iracingId: '11111',
|
||||
name: 'Generated Driver',
|
||||
country: 'DE',
|
||||
bio: null,
|
||||
joinedAt: driver.joinedAt.toDate(),
|
||||
category: null,
|
||||
avatarRef: { type: 'generated', generationRequestId: 'gen-req-xyz' },
|
||||
};
|
||||
|
||||
const savedEntities: any[] = [];
|
||||
|
||||
const repo = {
|
||||
@@ -175,14 +145,16 @@ describe('TypeOrmDriverRepository', () => {
|
||||
|
||||
expect(savedEntities[0].avatarRef).toEqual({ type: 'generated', generationRequestId: 'gen-req-xyz' });
|
||||
|
||||
const loaded = await typeOrmRepo.findById('driver-789');
|
||||
const loaded = await typeOrmRepo.findById(driverId);
|
||||
expect(loaded).not.toBeNull();
|
||||
expect(loaded!.avatarRef.type).toBe('generated');
|
||||
expect(loaded!.avatarRef.generationRequestId).toBe('gen-req-xyz');
|
||||
});
|
||||
|
||||
it('handles update with changed avatarRef', async () => {
|
||||
const driverId = '00000000-0000-0000-0000-000000000000';
|
||||
const driver = Driver.create({
|
||||
id: 'driver-update',
|
||||
id: driverId,
|
||||
iracingId: '22222',
|
||||
name: 'Update Driver',
|
||||
country: 'FR',
|
||||
@@ -220,8 +192,9 @@ describe('TypeOrmDriverRepository', () => {
|
||||
expect(savedEntities).toHaveLength(2);
|
||||
expect(savedEntities[1].avatarRef).toEqual({ type: 'uploaded', mediaId: 'new-media-id' });
|
||||
|
||||
const loaded = await typeOrmRepo.findById('driver-update');
|
||||
const loaded = await typeOrmRepo.findById(driverId);
|
||||
expect(loaded).not.toBeNull();
|
||||
expect(loaded!.avatarRef.type).toBe('uploaded');
|
||||
expect(loaded!.avatarRef.mediaId).toBe('new-media-id');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { InMemoryDriverExtendedProfileProvider } from './InMemoryDriverExtendedProfileProvider';
|
||||
|
||||
describe('InMemoryDriverExtendedProfileProvider', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DriverExtendedProfileProvider } from '@core/racing/application/ports/DriverExtendedProfileProvider';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
// TODO Provider doesnt exist in Clean Architecture
|
||||
// TODO Hardcoded data here must be moved to a better place
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import { InMemoryDriverRatingProvider } from './InMemoryDriverRatingProvider';
|
||||
|
||||
describe('InMemoryDriverRatingProvider', () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DriverRatingProvider } from '@core/racing/application/ports/DriverRatingProvider';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
// TODO Provider doesnt exist in Clean Architecture
|
||||
// TODO Hardcoded data here must be moved to a better place
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { RacingSeedData } from './InMemorySocialAndFeed';
|
||||
import { InMemoryFeedRepository, InMemorySocialGraphRepository } from './InMemorySocialAndFeed';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Driver } from '@core/racing/domain/entities/Driver';
|
||||
import type { Logger } from '@core/shared/domain';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import type { FeedRepository } from '@core/social/domain/repositories/FeedRepository';
|
||||
import type { SocialGraphRepository } from '@core/social/domain/repositories/SocialGraphRepository';
|
||||
import type { FeedItem } from '@core/social/domain/types/FeedItem';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { IEngagementRepository } from '@core/analytics/domain/repositories/EngagementRepository';
|
||||
import type { IPageViewRepository } from '@core/analytics/application/repositories/PageViewRepository';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { IEngagementRepository } from '@core/analytics/domain/repositories/EngagementRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Provider } from '@nestjs/common';
|
||||
|
||||
import {
|
||||
ANALYTICS_ENGAGEMENT_REPOSITORY_TOKEN,
|
||||
ANALYTICS_PAGE_VIEW_REPOSITORY_TOKEN,
|
||||
ANALYTICS_ENGAGEMENT_REPOSITORY_TOKEN,
|
||||
ANALYTICS_PAGE_VIEW_REPOSITORY_TOKEN,
|
||||
} from '../../persistence/analytics/AnalyticsPersistenceTokens';
|
||||
|
||||
const LOGGER_TOKEN = 'Logger';
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
import { Provider } from '@nestjs/common';
|
||||
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { CookieIdentitySessionAdapter } from '@adapters/identity/session/CookieIdentitySessionAdapter';
|
||||
import type { IdentitySessionPort } from '@core/identity/application/ports/IdentitySessionPort';
|
||||
import { ForgotPasswordUseCase } from '@core/identity/application/use-cases/ForgotPasswordUseCase';
|
||||
import { LoginUseCase } from '@core/identity/application/use-cases/LoginUseCase';
|
||||
import { LogoutUseCase } from '@core/identity/application/use-cases/LogoutUseCase';
|
||||
import { SignupUseCase } from '@core/identity/application/use-cases/SignupUseCase';
|
||||
import { SignupSponsorUseCase } from '@core/identity/application/use-cases/SignupSponsorUseCase';
|
||||
import { ForgotPasswordUseCase } from '@core/identity/application/use-cases/ForgotPasswordUseCase';
|
||||
import { ResetPasswordUseCase } from '@core/identity/application/use-cases/ResetPasswordUseCase';
|
||||
import type { IdentitySessionPort } from '@core/identity/application/ports/IdentitySessionPort';
|
||||
import { SignupSponsorUseCase } from '@core/identity/application/use-cases/SignupSponsorUseCase';
|
||||
import { SignupUseCase } from '@core/identity/application/use-cases/SignupUseCase';
|
||||
import type { IMagicLinkNotificationPort } from '@core/identity/domain/ports/MagicLinkNotificationPort';
|
||||
import type { IAuthRepository } from '@core/identity/domain/repositories/AuthRepository';
|
||||
import type { ICompanyRepository } from '@core/identity/domain/repositories/CompanyRepository';
|
||||
import type { IMagicLinkRepository } from '@core/identity/domain/repositories/MagicLinkRepository';
|
||||
import type { IPasswordHashingService } from '@core/identity/domain/services/PasswordHashingService';
|
||||
import type { IMagicLinkNotificationPort } from '@core/identity/domain/ports/MagicLinkNotificationPort';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import {
|
||||
AUTH_REPOSITORY_TOKEN,
|
||||
PASSWORD_HASHING_SERVICE_TOKEN,
|
||||
USER_REPOSITORY_TOKEN,
|
||||
MAGIC_LINK_REPOSITORY_TOKEN,
|
||||
COMPANY_REPOSITORY_TOKEN,
|
||||
AUTH_REPOSITORY_TOKEN,
|
||||
COMPANY_REPOSITORY_TOKEN,
|
||||
MAGIC_LINK_REPOSITORY_TOKEN,
|
||||
PASSWORD_HASHING_SERVICE_TOKEN,
|
||||
USER_REPOSITORY_TOKEN,
|
||||
} from '../../persistence/identity/IdentityPersistenceTokens';
|
||||
|
||||
import { ConsoleMagicLinkNotificationAdapter } from '@adapters/notifications/ports/ConsoleMagicLinkNotificationAdapter';
|
||||
import { AuthSessionPresenter } from './presenters/AuthSessionPresenter';
|
||||
import { CommandResultPresenter } from './presenters/CommandResultPresenter';
|
||||
import { ForgotPasswordPresenter } from './presenters/ForgotPasswordPresenter';
|
||||
import { ResetPasswordPresenter } from './presenters/ResetPasswordPresenter';
|
||||
import { ConsoleMagicLinkNotificationAdapter } from '@adapters/notifications/ports/ConsoleMagicLinkNotificationAdapter';
|
||||
|
||||
// Define the tokens for dependency injection
|
||||
export { AUTH_REPOSITORY_TOKEN, USER_REPOSITORY_TOKEN, PASSWORD_HASHING_SERVICE_TOKEN };
|
||||
export { AUTH_REPOSITORY_TOKEN, PASSWORD_HASHING_SERVICE_TOKEN, USER_REPOSITORY_TOKEN };
|
||||
export const LOGGER_TOKEN = 'Logger';
|
||||
export const IDENTITY_SESSION_PORT_TOKEN = 'IdentitySessionPort';
|
||||
export const LOGIN_USE_CASE_TOKEN = 'LoginUseCase';
|
||||
|
||||
@@ -1,49 +1,49 @@
|
||||
import { Inject } from '@nestjs/common';
|
||||
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import {
|
||||
LoginUseCase,
|
||||
type LoginApplicationError,
|
||||
type LoginInput,
|
||||
ForgotPasswordUseCase,
|
||||
type ForgotPasswordApplicationError,
|
||||
type ForgotPasswordInput,
|
||||
} from '@core/identity/application/use-cases/ForgotPasswordUseCase';
|
||||
import {
|
||||
LoginUseCase,
|
||||
type LoginApplicationError,
|
||||
type LoginInput,
|
||||
} from '@core/identity/application/use-cases/LoginUseCase';
|
||||
import { LogoutUseCase, type LogoutApplicationError } from '@core/identity/application/use-cases/LogoutUseCase';
|
||||
import {
|
||||
SignupUseCase,
|
||||
type SignupApplicationError,
|
||||
type SignupInput,
|
||||
} from '@core/identity/application/use-cases/SignupUseCase';
|
||||
ResetPasswordUseCase,
|
||||
type ResetPasswordApplicationError,
|
||||
type ResetPasswordInput,
|
||||
} from '@core/identity/application/use-cases/ResetPasswordUseCase';
|
||||
import {
|
||||
SignupSponsorUseCase,
|
||||
type SignupSponsorApplicationError,
|
||||
type SignupSponsorInput,
|
||||
SignupSponsorUseCase,
|
||||
type SignupSponsorApplicationError,
|
||||
type SignupSponsorInput,
|
||||
} from '@core/identity/application/use-cases/SignupSponsorUseCase';
|
||||
import {
|
||||
ForgotPasswordUseCase,
|
||||
type ForgotPasswordApplicationError,
|
||||
type ForgotPasswordInput,
|
||||
} from '@core/identity/application/use-cases/ForgotPasswordUseCase';
|
||||
import {
|
||||
ResetPasswordUseCase,
|
||||
type ResetPasswordApplicationError,
|
||||
type ResetPasswordInput,
|
||||
} from '@core/identity/application/use-cases/ResetPasswordUseCase';
|
||||
SignupUseCase,
|
||||
type SignupApplicationError,
|
||||
type SignupInput,
|
||||
} from '@core/identity/application/use-cases/SignupUseCase';
|
||||
|
||||
import type { IdentitySessionPort } from '@core/identity/application/ports/IdentitySessionPort';
|
||||
|
||||
import {
|
||||
AUTH_SESSION_OUTPUT_PORT_TOKEN,
|
||||
COMMAND_RESULT_OUTPUT_PORT_TOKEN,
|
||||
FORGOT_PASSWORD_OUTPUT_PORT_TOKEN,
|
||||
RESET_PASSWORD_OUTPUT_PORT_TOKEN,
|
||||
IDENTITY_SESSION_PORT_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
LOGIN_USE_CASE_TOKEN,
|
||||
LOGOUT_USE_CASE_TOKEN,
|
||||
SIGNUP_USE_CASE_TOKEN,
|
||||
SIGNUP_SPONSOR_USE_CASE_TOKEN,
|
||||
FORGOT_PASSWORD_USE_CASE_TOKEN,
|
||||
RESET_PASSWORD_USE_CASE_TOKEN,
|
||||
AUTH_SESSION_OUTPUT_PORT_TOKEN,
|
||||
COMMAND_RESULT_OUTPUT_PORT_TOKEN,
|
||||
FORGOT_PASSWORD_OUTPUT_PORT_TOKEN,
|
||||
FORGOT_PASSWORD_USE_CASE_TOKEN,
|
||||
IDENTITY_SESSION_PORT_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
LOGIN_USE_CASE_TOKEN,
|
||||
LOGOUT_USE_CASE_TOKEN,
|
||||
RESET_PASSWORD_OUTPUT_PORT_TOKEN,
|
||||
RESET_PASSWORD_USE_CASE_TOKEN,
|
||||
SIGNUP_SPONSOR_USE_CASE_TOKEN,
|
||||
SIGNUP_USE_CASE_TOKEN,
|
||||
} from './AuthProviders';
|
||||
import type { AuthSessionDTO } from './dtos/AuthDto';
|
||||
import { LoginParamsDTO, SignupParamsDTO, SignupSponsorParamsDTO } from './dtos/AuthDto';
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { EnsureInitialData } from '../../../../../adapters/bootstrap/EnsureInitialData';
|
||||
import { SeedRacingData, type RacingSeedDependencies } from '../../../../../adapters/bootstrap/SeedRacingData';
|
||||
import { SeedDemoUsers } from '../../../../../adapters/bootstrap/SeedDemoUsers';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Inject, Module, OnModuleInit } from '@nestjs/common';
|
||||
import type { EnsureInitialData } from '../../../../../adapters/bootstrap/EnsureInitialData';
|
||||
import { SeedDemoUsers } from '../../../../../adapters/bootstrap/SeedDemoUsers';
|
||||
import { SeedRacingData, type RacingSeedDependencies } from '../../../../../adapters/bootstrap/SeedRacingData';
|
||||
import { getApiPersistence, getEnableBootstrap, getForceReseed } from '../../env';
|
||||
import { AchievementPersistenceModule } from '../../persistence/achievement/AchievementPersistenceModule';
|
||||
import { AdminPersistenceModule } from '../../persistence/admin/AdminPersistenceModule';
|
||||
import { IdentityPersistenceModule } from '../../persistence/identity/IdentityPersistenceModule';
|
||||
import { RacingPersistenceModule } from '../../persistence/racing/RacingPersistenceModule';
|
||||
import { SocialPersistenceModule } from '../../persistence/social/SocialPersistenceModule';
|
||||
import { AchievementPersistenceModule } from '../../persistence/achievement/AchievementPersistenceModule';
|
||||
import { IdentityPersistenceModule } from '../../persistence/identity/IdentityPersistenceModule';
|
||||
import { AdminPersistenceModule } from '../../persistence/admin/AdminPersistenceModule';
|
||||
import { BootstrapProviders, ENSURE_INITIAL_DATA_TOKEN, SEED_DEMO_USERS_TOKEN } from './BootstrapProviders';
|
||||
|
||||
@Module({
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import { Provider } from '@nestjs/common';
|
||||
import { SOCIAL_FEED_REPOSITORY_TOKEN, SOCIAL_GRAPH_REPOSITORY_TOKEN } from '../../persistence/social/SocialPersistenceTokens';
|
||||
import { ACHIEVEMENT_REPOSITORY_TOKEN } from '../../persistence/achievement/AchievementPersistenceTokens';
|
||||
import { EnsureInitialData } from '../../../../../adapters/bootstrap/EnsureInitialData';
|
||||
import type { RacingSeedDependencies } from '../../../../../adapters/bootstrap/SeedRacingData';
|
||||
import { SeedDemoUsers } from '../../../../../adapters/bootstrap/SeedDemoUsers';
|
||||
import type { IdentitySessionPort } from '@core/identity/application/ports/IdentitySessionPort';
|
||||
import { SignupWithEmailUseCase } from '@core/identity/application/use-cases/SignupWithEmailUseCase';
|
||||
import {
|
||||
CreateAchievementUseCase,
|
||||
type IAchievementRepository,
|
||||
CreateAchievementUseCase,
|
||||
type IAchievementRepository,
|
||||
} from '@core/identity/application/use-cases/achievement/CreateAchievementUseCase';
|
||||
import type { IUserRepository } from '@core/identity/domain/repositories/UserRepository';
|
||||
import type { IdentitySessionPort } from '@core/identity/application/ports/IdentitySessionPort';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Provider } from '@nestjs/common';
|
||||
import { EnsureInitialData } from '../../../../../adapters/bootstrap/EnsureInitialData';
|
||||
import { SeedDemoUsers } from '../../../../../adapters/bootstrap/SeedDemoUsers';
|
||||
import type { RacingSeedDependencies } from '../../../../../adapters/bootstrap/SeedRacingData';
|
||||
import { CookieIdentitySessionAdapter } from '../../../../../adapters/identity/session/CookieIdentitySessionAdapter';
|
||||
import { USER_REPOSITORY_TOKEN as IDENTITY_USER_REPOSITORY_TOKEN, AUTH_REPOSITORY_TOKEN, PASSWORD_HASHING_SERVICE_TOKEN } from '../../persistence/identity/IdentityPersistenceTokens';
|
||||
import { ACHIEVEMENT_REPOSITORY_TOKEN } from '../../persistence/achievement/AchievementPersistenceTokens';
|
||||
import { ADMIN_USER_REPOSITORY_TOKEN } from '../../persistence/admin/AdminPersistenceTokens';
|
||||
import { AUTH_REPOSITORY_TOKEN, USER_REPOSITORY_TOKEN as IDENTITY_USER_REPOSITORY_TOKEN, PASSWORD_HASHING_SERVICE_TOKEN } from '../../persistence/identity/IdentityPersistenceTokens';
|
||||
import { SOCIAL_FEED_REPOSITORY_TOKEN, SOCIAL_GRAPH_REPOSITORY_TOKEN } from '../../persistence/social/SocialPersistenceTokens';
|
||||
|
||||
// Define tokens
|
||||
export const USER_REPOSITORY_TOKEN = 'IUserRepository_Bootstrap';
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import { Provider } from '@nestjs/common';
|
||||
|
||||
// Import core interfaces
|
||||
import type { MediaResolverPort } from '@core/ports/media/MediaResolverPort';
|
||||
import { DriverExtendedProfileProvider } from '@core/racing/application/ports/DriverExtendedProfileProvider';
|
||||
import { IDriverRepository } from '@core/racing/domain/repositories/DriverRepository';
|
||||
import { ILiveryRepository } from '@core/racing/domain/repositories/LiveryRepository';
|
||||
import { IRaceRegistrationRepository } from '@core/racing/domain/repositories/RaceRegistrationRepository';
|
||||
import type { ITeamMembershipRepository } from '@core/racing/domain/repositories/TeamMembershipRepository';
|
||||
import type { ITeamRepository } from '@core/racing/domain/repositories/TeamRepository';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { ISocialGraphRepository } from '@core/social/domain/repositories/SocialGraphRepository';
|
||||
import type { IResultRepository } from '@core/racing/domain/repositories/ResultRepository';
|
||||
import type { IStandingRepository } from '@core/racing/domain/repositories/StandingRepository';
|
||||
import type { MediaResolverPort } from '@core/ports/media/MediaResolverPort';
|
||||
import type { ITeamMembershipRepository } from '@core/racing/domain/repositories/TeamMembershipRepository';
|
||||
import type { ITeamRepository } from '@core/racing/domain/repositories/TeamRepository';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import type { ISocialGraphRepository } from '@core/social/domain/repositories/SocialGraphRepository';
|
||||
|
||||
// Import use cases
|
||||
import { CompleteDriverOnboardingUseCase } from '@core/racing/application/use-cases/CompleteDriverOnboardingUseCase';
|
||||
import { GetDriversLeaderboardUseCase } from '@core/racing/application/use-cases/GetDriversLeaderboardUseCase';
|
||||
import { GetDriverLiveriesUseCase } from '@core/racing/application/use-cases/GetDriverLiveriesUseCase';
|
||||
import { GetDriversLeaderboardUseCase } from '@core/racing/application/use-cases/GetDriversLeaderboardUseCase';
|
||||
import { GetDriverUseCase } from '@core/racing/application/use-cases/GetDriverUseCase';
|
||||
import { GetProfileOverviewUseCase } from '@core/racing/application/use-cases/GetProfileOverviewUseCase';
|
||||
import { GetTotalDriversUseCase } from '@core/racing/application/use-cases/GetTotalDriversUseCase';
|
||||
@@ -27,12 +27,10 @@ import { UpdateDriverProfileUseCase } from '@core/racing/application/use-cases/U
|
||||
import { ConsoleLogger } from '@adapters/logging/ConsoleLogger';
|
||||
import { InMemoryImageServiceAdapter } from '@adapters/media/ports/InMemoryImageServiceAdapter';
|
||||
import { InMemoryNotificationPreferenceRepository } from '@adapters/notifications/persistence/inmemory/InMemoryNotificationPreferenceRepository';
|
||||
import { InMemoryLiveryRepository } from '@adapters/racing/persistence/inmemory/InMemoryLiveryRepository';
|
||||
import { InMemoryDriverExtendedProfileProvider } from '@adapters/racing/ports/InMemoryDriverExtendedProfileProvider';
|
||||
import { InMemoryDriverRatingProvider } from '@adapters/racing/ports/InMemoryDriverRatingProvider';
|
||||
import { InMemoryLiveryRepository } from '@adapters/racing/persistence/inmemory/InMemoryLiveryRepository';
|
||||
// Import new use cases
|
||||
import { RankingUseCase } from '@core/racing/application/use-cases/RankingUseCase';
|
||||
import { DriverStatsUseCase } from '@core/racing/application/use-cases/DriverStatsUseCase';
|
||||
// Import new repositories
|
||||
import { InMemoryDriverStatsRepository } from '@adapters/racing/persistence/inmemory/InMemoryDriverStatsRepository';
|
||||
import { InMemoryMediaRepository } from '@adapters/racing/persistence/media/InMemoryMediaRepository';
|
||||
@@ -41,8 +39,8 @@ import { MediaResolverAdapter } from '@adapters/media/MediaResolverAdapter';
|
||||
// Import repository tokens
|
||||
import { IDriverStatsRepository } from '@core/racing/domain/repositories/DriverStatsRepository';
|
||||
// Import use case interfaces
|
||||
import type { IRankingUseCase } from '@core/racing/application/use-cases/RankingUseCase';
|
||||
import type { IDriverStatsUseCase } from '@core/racing/application/use-cases/DriverStatsUseCase';
|
||||
import type { IRankingUseCase } from '@core/racing/application/use-cases/RankingUseCase';
|
||||
|
||||
// Import presenters
|
||||
import { CompleteOnboardingPresenter } from './presenters/CompleteOnboardingPresenter';
|
||||
@@ -54,30 +52,30 @@ import { DriverStatsPresenter } from './presenters/DriverStatsPresenter';
|
||||
import { GetDriverLiveriesPresenter } from './presenters/GetDriverLiveriesPresenter';
|
||||
|
||||
import {
|
||||
DRIVER_REPOSITORY_TOKEN,
|
||||
DRIVER_RATING_PROVIDER_TOKEN,
|
||||
DRIVER_EXTENDED_PROFILE_PROVIDER_TOKEN,
|
||||
IMAGE_SERVICE_PORT_TOKEN,
|
||||
RACE_REGISTRATION_REPOSITORY_TOKEN,
|
||||
NOTIFICATION_PREFERENCE_REPOSITORY_TOKEN,
|
||||
TEAM_REPOSITORY_TOKEN,
|
||||
TEAM_MEMBERSHIP_REPOSITORY_TOKEN,
|
||||
SOCIAL_GRAPH_REPOSITORY_TOKEN,
|
||||
LIVERY_REPOSITORY_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
GET_DRIVERS_LEADERBOARD_USE_CASE_TOKEN,
|
||||
GET_TOTAL_DRIVERS_USE_CASE_TOKEN,
|
||||
GET_DRIVER_LIVERIES_USE_CASE_TOKEN,
|
||||
GET_DRIVER_USE_CASE_TOKEN,
|
||||
COMPLETE_DRIVER_ONBOARDING_USE_CASE_TOKEN,
|
||||
IS_DRIVER_REGISTERED_FOR_RACE_USE_CASE_TOKEN,
|
||||
UPDATE_DRIVER_PROFILE_USE_CASE_TOKEN,
|
||||
GET_PROFILE_OVERVIEW_USE_CASE_TOKEN,
|
||||
DRIVER_STATS_REPOSITORY_TOKEN,
|
||||
MEDIA_REPOSITORY_TOKEN,
|
||||
RANKING_SERVICE_TOKEN,
|
||||
DRIVER_STATS_SERVICE_TOKEN,
|
||||
MEDIA_RESOLVER_TOKEN,
|
||||
COMPLETE_DRIVER_ONBOARDING_USE_CASE_TOKEN,
|
||||
DRIVER_EXTENDED_PROFILE_PROVIDER_TOKEN,
|
||||
DRIVER_RATING_PROVIDER_TOKEN,
|
||||
DRIVER_REPOSITORY_TOKEN,
|
||||
DRIVER_STATS_REPOSITORY_TOKEN,
|
||||
DRIVER_STATS_SERVICE_TOKEN,
|
||||
GET_DRIVER_LIVERIES_USE_CASE_TOKEN,
|
||||
GET_DRIVER_USE_CASE_TOKEN,
|
||||
GET_DRIVERS_LEADERBOARD_USE_CASE_TOKEN,
|
||||
GET_PROFILE_OVERVIEW_USE_CASE_TOKEN,
|
||||
GET_TOTAL_DRIVERS_USE_CASE_TOKEN,
|
||||
IMAGE_SERVICE_PORT_TOKEN,
|
||||
IS_DRIVER_REGISTERED_FOR_RACE_USE_CASE_TOKEN,
|
||||
LIVERY_REPOSITORY_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
MEDIA_REPOSITORY_TOKEN,
|
||||
MEDIA_RESOLVER_TOKEN,
|
||||
NOTIFICATION_PREFERENCE_REPOSITORY_TOKEN,
|
||||
RACE_REGISTRATION_REPOSITORY_TOKEN,
|
||||
RANKING_SERVICE_TOKEN,
|
||||
SOCIAL_GRAPH_REPOSITORY_TOKEN,
|
||||
TEAM_MEMBERSHIP_REPOSITORY_TOKEN,
|
||||
TEAM_REPOSITORY_TOKEN,
|
||||
UPDATE_DRIVER_PROFILE_USE_CASE_TOKEN,
|
||||
} from './DriverTokens';
|
||||
|
||||
export * from './DriverTokens';
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { CompleteOnboardingInputDTO } from './dtos/CompleteOnboardingInputDTO';
|
||||
import { CompleteOnboardingOutputDTO } from './dtos/CompleteOnboardingOutputDTO';
|
||||
import { DriverRegistrationStatusDTO } from './dtos/DriverRegistrationStatusDTO';
|
||||
import { DriversLeaderboardDTO } from './dtos/DriversLeaderboardDTO';
|
||||
import { DriverStatsDTO } from './dtos/DriverStatsDTO';
|
||||
import { GetDriverOutputDTO } from './dtos/GetDriverOutputDTO';
|
||||
import { GetDriverLiveriesOutputDTO } from './dtos/GetDriverLiveriesOutputDTO';
|
||||
import { GetDriverOutputDTO } from './dtos/GetDriverOutputDTO';
|
||||
import { GetDriverProfileOutputDTO } from './dtos/GetDriverProfileOutputDTO';
|
||||
import { GetDriverRegistrationStatusQueryDTO } from './dtos/GetDriverRegistrationStatusQueryDTO';
|
||||
|
||||
@@ -14,11 +14,11 @@ import { GetDriverRegistrationStatusQueryDTO } from './dtos/GetDriverRegistratio
|
||||
import { CompleteDriverOnboardingUseCase } from '@core/racing/application/use-cases/CompleteDriverOnboardingUseCase';
|
||||
import { GetDriverLiveriesUseCase } from '@core/racing/application/use-cases/GetDriverLiveriesUseCase';
|
||||
import { GetDriversLeaderboardUseCase } from '@core/racing/application/use-cases/GetDriversLeaderboardUseCase';
|
||||
import { GetDriverUseCase } from '@core/racing/application/use-cases/GetDriverUseCase';
|
||||
import { GetProfileOverviewUseCase } from '@core/racing/application/use-cases/GetProfileOverviewUseCase';
|
||||
import { GetTotalDriversUseCase } from '@core/racing/application/use-cases/GetTotalDriversUseCase';
|
||||
import { IsDriverRegisteredForRaceUseCase } from '@core/racing/application/use-cases/IsDriverRegisteredForRaceUseCase';
|
||||
import { UpdateDriverProfileUseCase, type UpdateDriverProfileInput } from '@core/racing/application/use-cases/UpdateDriverProfileUseCase';
|
||||
import { GetDriverUseCase } from '@core/racing/application/use-cases/GetDriverUseCase';
|
||||
|
||||
// Presenters
|
||||
import { CompleteOnboardingPresenter } from './presenters/CompleteOnboardingPresenter';
|
||||
@@ -30,17 +30,17 @@ import { DriverStatsPresenter } from './presenters/DriverStatsPresenter';
|
||||
import { GetDriverLiveriesPresenter } from './presenters/GetDriverLiveriesPresenter';
|
||||
|
||||
// Tokens
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import {
|
||||
COMPLETE_DRIVER_ONBOARDING_USE_CASE_TOKEN,
|
||||
GET_DRIVER_LIVERIES_USE_CASE_TOKEN,
|
||||
GET_DRIVERS_LEADERBOARD_USE_CASE_TOKEN,
|
||||
GET_PROFILE_OVERVIEW_USE_CASE_TOKEN,
|
||||
GET_TOTAL_DRIVERS_USE_CASE_TOKEN,
|
||||
IS_DRIVER_REGISTERED_FOR_RACE_USE_CASE_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
UPDATE_DRIVER_PROFILE_USE_CASE_TOKEN,
|
||||
GET_DRIVER_USE_CASE_TOKEN,
|
||||
COMPLETE_DRIVER_ONBOARDING_USE_CASE_TOKEN,
|
||||
GET_DRIVER_LIVERIES_USE_CASE_TOKEN,
|
||||
GET_DRIVER_USE_CASE_TOKEN,
|
||||
GET_DRIVERS_LEADERBOARD_USE_CASE_TOKEN,
|
||||
GET_PROFILE_OVERVIEW_USE_CASE_TOKEN,
|
||||
GET_TOTAL_DRIVERS_USE_CASE_TOKEN,
|
||||
IS_DRIVER_REGISTERED_FOR_RACE_USE_CASE_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
UPDATE_DRIVER_PROFILE_USE_CASE_TOKEN,
|
||||
} from './DriverTokens';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -7,15 +7,9 @@ import { GetLeagueAdminPermissionsInputDTO } from './dtos/GetLeagueAdminPermissi
|
||||
import { GetLeagueOwnerSummaryQueryDTO } from './dtos/GetLeagueOwnerSummaryQueryDTO';
|
||||
import { GetLeagueProtestsQueryDTO } from './dtos/GetLeagueProtestsQueryDTO';
|
||||
import { GetLeagueRacesOutputDTO } from './dtos/GetLeagueRacesOutputDTO';
|
||||
import { GetLeagueScheduleQueryDTO } from './dtos/GetLeagueScheduleQueryDTO';
|
||||
import { GetLeagueSeasonsQueryDTO } from './dtos/GetLeagueSeasonsQueryDTO';
|
||||
import { GetLeagueWalletOutputDTO } from './dtos/GetLeagueWalletOutputDTO';
|
||||
import { GetLeagueScheduleQueryDTO } from './dtos/GetLeagueScheduleQueryDTO';
|
||||
import {
|
||||
CreateLeagueScheduleRaceInputDTO,
|
||||
CreateLeagueScheduleRaceOutputDTO,
|
||||
LeagueScheduleRaceMutationSuccessDTO,
|
||||
UpdateLeagueScheduleRaceInputDTO,
|
||||
} from './dtos/LeagueScheduleRaceAdminDTO';
|
||||
import { GetSeasonSponsorshipsOutputDTO } from './dtos/GetSeasonSponsorshipsOutputDTO';
|
||||
import { LeagueAdminDTO } from './dtos/LeagueAdminDTO';
|
||||
import { LeagueAdminPermissionsDTO } from './dtos/LeagueAdminPermissionsDTO';
|
||||
@@ -23,13 +17,19 @@ import { LeagueAdminProtestsDTO } from './dtos/LeagueAdminProtestsDTO';
|
||||
import { LeagueConfigFormModelDTO } from './dtos/LeagueConfigFormModelDTO';
|
||||
import { LeagueJoinRequestWithDriverDTO } from './dtos/LeagueJoinRequestWithDriverDTO';
|
||||
import { LeagueMembershipsDTO } from './dtos/LeagueMembershipsDTO';
|
||||
import { LeagueOwnerSummaryDTO } from './dtos/LeagueOwnerSummaryDTO';
|
||||
import { LeagueRosterJoinRequestDTO } from './dtos/LeagueRosterJoinRequestDTO';
|
||||
import { LeagueRosterMemberDTO } from './dtos/LeagueRosterMemberDTO';
|
||||
import { LeagueOwnerSummaryDTO } from './dtos/LeagueOwnerSummaryDTO';
|
||||
import { LeagueScheduleDTO } from './dtos/LeagueScheduleDTO';
|
||||
import {
|
||||
LeagueSeasonSchedulePublishInputDTO,
|
||||
LeagueSeasonSchedulePublishOutputDTO,
|
||||
CreateLeagueScheduleRaceInputDTO,
|
||||
CreateLeagueScheduleRaceOutputDTO,
|
||||
LeagueScheduleRaceMutationSuccessDTO,
|
||||
UpdateLeagueScheduleRaceInputDTO,
|
||||
} from './dtos/LeagueScheduleRaceAdminDTO';
|
||||
import {
|
||||
LeagueSeasonSchedulePublishInputDTO,
|
||||
LeagueSeasonSchedulePublishOutputDTO,
|
||||
} from './dtos/LeagueSeasonSchedulePublishDTO';
|
||||
import { LeagueSeasonSummaryDTO } from './dtos/LeagueSeasonSummaryDTO';
|
||||
import { LeagueStandingsDTO } from './dtos/LeagueStandingsDTO';
|
||||
@@ -38,8 +38,8 @@ import { RejectJoinRequestInputDTO } from './dtos/RejectJoinRequestInputDTO';
|
||||
import { RejectJoinRequestOutputDTO } from './dtos/RejectJoinRequestOutputDTO';
|
||||
import { RemoveLeagueMemberInputDTO } from './dtos/RemoveLeagueMemberInputDTO';
|
||||
import { RemoveLeagueMemberOutputDTO } from './dtos/RemoveLeagueMemberOutputDTO';
|
||||
import { TransferLeagueOwnershipOutputDTO } from './dtos/TransferLeagueOwnershipOutputDTO';
|
||||
import { TransferLeagueOwnershipInputDTO } from './dtos/TransferLeagueOwnershipInputDTO';
|
||||
import { TransferLeagueOwnershipOutputDTO } from './dtos/TransferLeagueOwnershipOutputDTO';
|
||||
import { UpdateLeagueMemberRoleInputDTO } from './dtos/UpdateLeagueMemberRoleInputDTO';
|
||||
import { UpdateLeagueMemberRoleOutputDTO } from './dtos/UpdateLeagueMemberRoleOutputDTO';
|
||||
import { WithdrawFromLeagueWalletInputDTO } from './dtos/WithdrawFromLeagueWalletInputDTO';
|
||||
@@ -49,8 +49,8 @@ import { getActorFromRequestContext } from '../auth/getActorFromRequestContext';
|
||||
import { requireLeagueAdminOrOwner } from './LeagueAuthorization';
|
||||
|
||||
// Core imports for view models
|
||||
import type { AllLeaguesWithCapacityDTO as AllLeaguesWithCapacityViewModel } from './dtos/AllLeaguesWithCapacityDTO';
|
||||
import type { AllLeaguesWithCapacityAndScoringDTO as AllLeaguesWithCapacityAndScoringViewModel } from './dtos/AllLeaguesWithCapacityAndScoringDTO';
|
||||
import type { AllLeaguesWithCapacityDTO as AllLeaguesWithCapacityViewModel } from './dtos/AllLeaguesWithCapacityDTO';
|
||||
import type { CreateLeagueViewModel } from './dtos/CreateLeagueDTO';
|
||||
import type { JoinLeagueOutputDTO } from './dtos/JoinLeagueOutputDTO';
|
||||
import { TotalLeaguesDTO } from './dtos/TotalLeaguesDTO';
|
||||
@@ -58,23 +58,23 @@ import type { LeagueScoringConfigViewModel } from './presenters/LeagueScoringCon
|
||||
import type { LeagueScoringPresetsViewModel } from './presenters/LeagueScoringPresetsPresenter';
|
||||
|
||||
// Core imports
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
// Use cases
|
||||
import { ApproveLeagueJoinRequestUseCase } from '@core/racing/application/use-cases/ApproveLeagueJoinRequestUseCase';
|
||||
import { CreateLeagueWithSeasonAndScoringUseCase } from '@core/racing/application/use-cases/CreateLeagueWithSeasonAndScoringUseCase';
|
||||
import { GetAllLeaguesWithCapacityUseCase } from '@core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase';
|
||||
import { GetAllLeaguesWithCapacityAndScoringUseCase } from '@core/racing/application/use-cases/GetAllLeaguesWithCapacityAndScoringUseCase';
|
||||
import { GetAllLeaguesWithCapacityUseCase } from '@core/racing/application/use-cases/GetAllLeaguesWithCapacityUseCase';
|
||||
import { GetLeagueAdminPermissionsUseCase } from '@core/racing/application/use-cases/GetLeagueAdminPermissionsUseCase';
|
||||
import { GetLeagueFullConfigUseCase } from '@core/racing/application/use-cases/GetLeagueFullConfigUseCase';
|
||||
import { GetLeagueJoinRequestsUseCase } from '@core/racing/application/use-cases/GetLeagueJoinRequestsUseCase';
|
||||
import { GetLeagueMembershipsUseCase } from '@core/racing/application/use-cases/GetLeagueMembershipsUseCase';
|
||||
import { GetLeagueRosterMembersUseCase } from '@core/racing/application/use-cases/GetLeagueRosterMembersUseCase';
|
||||
import { GetLeagueRosterJoinRequestsUseCase } from '@core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase';
|
||||
import { GetLeagueOwnerSummaryUseCase } from '@core/racing/application/use-cases/GetLeagueOwnerSummaryUseCase';
|
||||
import { GetLeagueProtestsUseCase } from '@core/racing/application/use-cases/GetLeagueProtestsUseCase';
|
||||
import { GetLeagueScheduleUseCase } from '@core/racing/application/use-cases/GetLeagueScheduleUseCase';
|
||||
import { GetLeagueRosterJoinRequestsUseCase } from '@core/racing/application/use-cases/GetLeagueRosterJoinRequestsUseCase';
|
||||
import { GetLeagueRosterMembersUseCase } from '@core/racing/application/use-cases/GetLeagueRosterMembersUseCase';
|
||||
import type { GetLeagueScheduleInput } from '@core/racing/application/use-cases/GetLeagueScheduleUseCase';
|
||||
import { GetLeagueScheduleUseCase } from '@core/racing/application/use-cases/GetLeagueScheduleUseCase';
|
||||
import { GetLeagueScoringConfigUseCase } from '@core/racing/application/use-cases/GetLeagueScoringConfigUseCase';
|
||||
import { GetLeagueSeasonsUseCase } from '@core/racing/application/use-cases/GetLeagueSeasonsUseCase';
|
||||
import { GetLeagueStandingsUseCase } from '@core/racing/application/use-cases/GetLeagueStandingsUseCase';
|
||||
@@ -97,26 +97,34 @@ import { UnpublishLeagueSeasonScheduleUseCase } from '@core/racing/application/u
|
||||
import { UpdateLeagueSeasonScheduleRaceUseCase } from '@core/racing/application/use-cases/UpdateLeagueSeasonScheduleRaceUseCase';
|
||||
|
||||
// API Presenters
|
||||
import { AllLeaguesWithCapacityPresenter } from './presenters/AllLeaguesWithCapacityPresenter';
|
||||
import { AllLeaguesWithCapacityAndScoringPresenter } from './presenters/AllLeaguesWithCapacityAndScoringPresenter';
|
||||
import { AllLeaguesWithCapacityPresenter } from './presenters/AllLeaguesWithCapacityPresenter';
|
||||
import { ApproveLeagueJoinRequestPresenter } from './presenters/ApproveLeagueJoinRequestPresenter';
|
||||
import { CreateLeaguePresenter } from './presenters/CreateLeaguePresenter';
|
||||
import { GetLeagueAdminPermissionsPresenter } from './presenters/GetLeagueAdminPermissionsPresenter';
|
||||
import { GetLeagueMembershipsPresenter } from './presenters/GetLeagueMembershipsPresenter';
|
||||
import {
|
||||
GetLeagueRosterJoinRequestsPresenter,
|
||||
GetLeagueRosterMembersPresenter,
|
||||
} from './presenters/LeagueRosterAdminReadPresenters';
|
||||
import { GetLeagueOwnerSummaryPresenter } from './presenters/GetLeagueOwnerSummaryPresenter';
|
||||
import { GetLeagueProtestsPresenter } from './presenters/GetLeagueProtestsPresenter';
|
||||
import { GetLeagueSeasonsPresenter } from './presenters/GetLeagueSeasonsPresenter';
|
||||
import { GetLeagueWalletPresenter } from './presenters/GetLeagueWalletPresenter';
|
||||
import { GetSeasonSponsorshipsPresenter } from './presenters/GetSeasonSponsorshipsPresenter';
|
||||
import { JoinLeaguePresenter } from './presenters/JoinLeaguePresenter';
|
||||
import { LeagueConfigPresenter } from './presenters/LeagueConfigPresenter';
|
||||
import { LeagueJoinRequestsPresenter } from './presenters/LeagueJoinRequestsPresenter';
|
||||
import {
|
||||
GetLeagueRosterJoinRequestsPresenter,
|
||||
GetLeagueRosterMembersPresenter,
|
||||
} from './presenters/LeagueRosterAdminReadPresenters';
|
||||
import { LeagueSchedulePresenter } from './presenters/LeagueSchedulePresenter';
|
||||
import { LeagueScoringConfigPresenter } from './presenters/LeagueScoringConfigPresenter';
|
||||
import { LeagueScoringPresetsPresenter } from './presenters/LeagueScoringPresetsPresenter';
|
||||
import {
|
||||
CreateLeagueSeasonScheduleRacePresenter,
|
||||
DeleteLeagueSeasonScheduleRacePresenter,
|
||||
PublishLeagueSeasonSchedulePresenter,
|
||||
UnpublishLeagueSeasonSchedulePresenter,
|
||||
UpdateLeagueSeasonScheduleRacePresenter,
|
||||
} from './presenters/LeagueSeasonScheduleMutationPresenters';
|
||||
import { LeagueStandingsPresenter } from './presenters/LeagueStandingsPresenter';
|
||||
import { LeagueStatsPresenter } from './presenters/LeagueStatsPresenter';
|
||||
import { RejectLeagueJoinRequestPresenter } from './presenters/RejectLeagueJoinRequestPresenter';
|
||||
@@ -124,50 +132,42 @@ import { RemoveLeagueMemberPresenter } from './presenters/RemoveLeagueMemberPres
|
||||
import { TotalLeaguesPresenter } from './presenters/TotalLeaguesPresenter';
|
||||
import { TransferLeagueOwnershipPresenter } from './presenters/TransferLeagueOwnershipPresenter';
|
||||
import { UpdateLeagueMemberRolePresenter } from './presenters/UpdateLeagueMemberRolePresenter';
|
||||
import { GetLeagueWalletPresenter } from './presenters/GetLeagueWalletPresenter';
|
||||
import { WithdrawFromLeagueWalletPresenter } from './presenters/WithdrawFromLeagueWalletPresenter';
|
||||
import {
|
||||
CreateLeagueSeasonScheduleRacePresenter,
|
||||
DeleteLeagueSeasonScheduleRacePresenter,
|
||||
PublishLeagueSeasonSchedulePresenter,
|
||||
UnpublishLeagueSeasonSchedulePresenter,
|
||||
UpdateLeagueSeasonScheduleRacePresenter,
|
||||
} from './presenters/LeagueSeasonScheduleMutationPresenters';
|
||||
// Tokens
|
||||
import {
|
||||
APPROVE_LEAGUE_JOIN_REQUEST_USE_CASE,
|
||||
CREATE_LEAGUE_SEASON_SCHEDULE_RACE_USE_CASE,
|
||||
CREATE_LEAGUE_WITH_SEASON_AND_SCORING_USE_CASE,
|
||||
GET_ALL_LEAGUES_WITH_CAPACITY_AND_SCORING_USE_CASE,
|
||||
GET_ALL_LEAGUES_WITH_CAPACITY_USE_CASE,
|
||||
GET_LEAGUE_ADMIN_PERMISSIONS_USE_CASE,
|
||||
GET_LEAGUE_FULL_CONFIG_USE_CASE,
|
||||
GET_LEAGUE_JOIN_REQUESTS_USE_CASE,
|
||||
GET_LEAGUE_MEMBERSHIPS_USE_CASE,
|
||||
GET_LEAGUE_OWNER_SUMMARY_USE_CASE,
|
||||
GET_LEAGUE_PROTESTS_USE_CASE,
|
||||
GET_LEAGUE_SCHEDULE_USE_CASE,
|
||||
GET_LEAGUE_SCORING_CONFIG_USE_CASE,
|
||||
GET_LEAGUE_SEASONS_USE_CASE,
|
||||
GET_LEAGUE_STATS_USE_CASE,
|
||||
GET_LEAGUE_STANDINGS_USE_CASE,
|
||||
GET_LEAGUE_WALLET_USE_CASE,
|
||||
GET_SEASON_SPONSORSHIPS_USE_CASE,
|
||||
GET_TOTAL_LEAGUES_USE_CASE,
|
||||
JOIN_LEAGUE_USE_CASE,
|
||||
LIST_LEAGUE_SCORING_PRESETS_USE_CASE,
|
||||
LOGGER_TOKEN,
|
||||
PUBLISH_LEAGUE_SEASON_SCHEDULE_USE_CASE,
|
||||
REJECT_LEAGUE_JOIN_REQUEST_USE_CASE,
|
||||
REMOVE_LEAGUE_MEMBER_USE_CASE,
|
||||
TRANSFER_LEAGUE_OWNERSHIP_USE_CASE,
|
||||
UNPUBLISH_LEAGUE_SEASON_SCHEDULE_USE_CASE,
|
||||
UPDATE_LEAGUE_MEMBER_ROLE_USE_CASE,
|
||||
UPDATE_LEAGUE_SEASON_SCHEDULE_RACE_USE_CASE,
|
||||
DELETE_LEAGUE_SEASON_SCHEDULE_RACE_USE_CASE,
|
||||
WITHDRAW_FROM_LEAGUE_WALLET_USE_CASE,
|
||||
GET_LEAGUE_ROSTER_MEMBERS_USE_CASE,
|
||||
GET_LEAGUE_ROSTER_JOIN_REQUESTS_USE_CASE,
|
||||
APPROVE_LEAGUE_JOIN_REQUEST_USE_CASE,
|
||||
CREATE_LEAGUE_SEASON_SCHEDULE_RACE_USE_CASE,
|
||||
CREATE_LEAGUE_WITH_SEASON_AND_SCORING_USE_CASE,
|
||||
DELETE_LEAGUE_SEASON_SCHEDULE_RACE_USE_CASE,
|
||||
GET_ALL_LEAGUES_WITH_CAPACITY_AND_SCORING_USE_CASE,
|
||||
GET_ALL_LEAGUES_WITH_CAPACITY_USE_CASE,
|
||||
GET_LEAGUE_ADMIN_PERMISSIONS_USE_CASE,
|
||||
GET_LEAGUE_FULL_CONFIG_USE_CASE,
|
||||
GET_LEAGUE_JOIN_REQUESTS_USE_CASE,
|
||||
GET_LEAGUE_MEMBERSHIPS_USE_CASE,
|
||||
GET_LEAGUE_OWNER_SUMMARY_USE_CASE,
|
||||
GET_LEAGUE_PROTESTS_USE_CASE,
|
||||
GET_LEAGUE_ROSTER_JOIN_REQUESTS_USE_CASE,
|
||||
GET_LEAGUE_ROSTER_MEMBERS_USE_CASE,
|
||||
GET_LEAGUE_SCHEDULE_USE_CASE,
|
||||
GET_LEAGUE_SCORING_CONFIG_USE_CASE,
|
||||
GET_LEAGUE_SEASONS_USE_CASE,
|
||||
GET_LEAGUE_STANDINGS_USE_CASE,
|
||||
GET_LEAGUE_STATS_USE_CASE,
|
||||
GET_LEAGUE_WALLET_USE_CASE,
|
||||
GET_SEASON_SPONSORSHIPS_USE_CASE,
|
||||
GET_TOTAL_LEAGUES_USE_CASE,
|
||||
JOIN_LEAGUE_USE_CASE,
|
||||
LIST_LEAGUE_SCORING_PRESETS_USE_CASE,
|
||||
LOGGER_TOKEN,
|
||||
PUBLISH_LEAGUE_SEASON_SCHEDULE_USE_CASE,
|
||||
REJECT_LEAGUE_JOIN_REQUEST_USE_CASE,
|
||||
REMOVE_LEAGUE_MEMBER_USE_CASE,
|
||||
TRANSFER_LEAGUE_OWNERSHIP_USE_CASE,
|
||||
UNPUBLISH_LEAGUE_SEASON_SCHEDULE_USE_CASE,
|
||||
UPDATE_LEAGUE_MEMBER_ROLE_USE_CASE,
|
||||
UPDATE_LEAGUE_SEASON_SCHEDULE_RACE_USE_CASE,
|
||||
WITHDRAW_FROM_LEAGUE_WALLET_USE_CASE,
|
||||
} from './LeagueTokens';
|
||||
|
||||
@Injectable()
|
||||
|
||||
@@ -1,56 +1,56 @@
|
||||
import { Provider } from '@nestjs/common';
|
||||
|
||||
// Import core interfaces
|
||||
import { IAvatarGenerationRepository } from '@core/media/domain/repositories/AvatarGenerationRepository';
|
||||
import { IMediaRepository } from '@core/media/domain/repositories/MediaRepository';
|
||||
import { IAvatarRepository } from '@core/media/domain/repositories/AvatarRepository';
|
||||
import { FaceValidationPort } from '@core/media/application/ports/FaceValidationPort';
|
||||
import { AvatarGenerationPort } from '@core/media/application/ports/AvatarGenerationPort';
|
||||
import { FaceValidationPort } from '@core/media/application/ports/FaceValidationPort';
|
||||
import { MediaStoragePort } from '@core/media/application/ports/MediaStoragePort';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { IAvatarGenerationRepository } from '@core/media/domain/repositories/AvatarGenerationRepository';
|
||||
import { IAvatarRepository } from '@core/media/domain/repositories/AvatarRepository';
|
||||
import { IMediaRepository } from '@core/media/domain/repositories/MediaRepository';
|
||||
import type { MediaResolverPort } from '@core/ports/media/MediaResolverPort';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
// Import use cases
|
||||
import { RequestAvatarGenerationUseCase } from '@core/media/application/use-cases/RequestAvatarGenerationUseCase';
|
||||
import { UploadMediaUseCase } from '@core/media/application/use-cases/UploadMediaUseCase';
|
||||
import { GetMediaUseCase } from '@core/media/application/use-cases/GetMediaUseCase';
|
||||
import { DeleteMediaUseCase } from '@core/media/application/use-cases/DeleteMediaUseCase';
|
||||
import { GetAvatarUseCase } from '@core/media/application/use-cases/GetAvatarUseCase';
|
||||
import { UpdateAvatarUseCase } from '@core/media/application/use-cases/UpdateAvatarUseCase';
|
||||
import { ResolveMediaReferenceUseCase } from '@core/media/application/use-cases/ResolveMediaReferenceUseCase';
|
||||
import { GetMediaUseCase } from '@core/media/application/use-cases/GetMediaUseCase';
|
||||
import { GetUploadedMediaUseCase } from '@core/media/application/use-cases/GetUploadedMediaUseCase';
|
||||
import { RequestAvatarGenerationUseCase } from '@core/media/application/use-cases/RequestAvatarGenerationUseCase';
|
||||
import { ResolveMediaReferenceUseCase } from '@core/media/application/use-cases/ResolveMediaReferenceUseCase';
|
||||
import { UpdateAvatarUseCase } from '@core/media/application/use-cases/UpdateAvatarUseCase';
|
||||
import { UploadMediaUseCase } from '@core/media/application/use-cases/UploadMediaUseCase';
|
||||
|
||||
// Import presenters
|
||||
import { RequestAvatarGenerationPresenter } from './presenters/RequestAvatarGenerationPresenter';
|
||||
import { UploadMediaPresenter } from './presenters/UploadMediaPresenter';
|
||||
import { GetMediaPresenter } from './presenters/GetMediaPresenter';
|
||||
import { DeleteMediaPresenter } from './presenters/DeleteMediaPresenter';
|
||||
import { GetAvatarPresenter } from './presenters/GetAvatarPresenter';
|
||||
import { GetMediaPresenter } from './presenters/GetMediaPresenter';
|
||||
import { RequestAvatarGenerationPresenter } from './presenters/RequestAvatarGenerationPresenter';
|
||||
import { UpdateAvatarPresenter } from './presenters/UpdateAvatarPresenter';
|
||||
import { UploadMediaPresenter } from './presenters/UploadMediaPresenter';
|
||||
|
||||
import {
|
||||
AVATAR_GENERATION_REPOSITORY_TOKEN,
|
||||
MEDIA_REPOSITORY_TOKEN,
|
||||
AVATAR_REPOSITORY_TOKEN,
|
||||
FACE_VALIDATION_PORT_TOKEN,
|
||||
AVATAR_GENERATION_PORT_TOKEN,
|
||||
MEDIA_STORAGE_PORT_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
REQUEST_AVATAR_GENERATION_USE_CASE_TOKEN,
|
||||
UPLOAD_MEDIA_USE_CASE_TOKEN,
|
||||
GET_MEDIA_USE_CASE_TOKEN,
|
||||
DELETE_MEDIA_USE_CASE_TOKEN,
|
||||
GET_AVATAR_USE_CASE_TOKEN,
|
||||
UPDATE_AVATAR_USE_CASE_TOKEN,
|
||||
RESOLVE_MEDIA_REFERENCE_USE_CASE_TOKEN,
|
||||
GET_UPLOADED_MEDIA_USE_CASE_TOKEN,
|
||||
MEDIA_RESOLVER_PORT_TOKEN,
|
||||
AVATAR_GENERATION_PORT_TOKEN,
|
||||
AVATAR_GENERATION_REPOSITORY_TOKEN,
|
||||
AVATAR_REPOSITORY_TOKEN,
|
||||
DELETE_MEDIA_USE_CASE_TOKEN,
|
||||
FACE_VALIDATION_PORT_TOKEN,
|
||||
GET_AVATAR_USE_CASE_TOKEN,
|
||||
GET_MEDIA_USE_CASE_TOKEN,
|
||||
GET_UPLOADED_MEDIA_USE_CASE_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
MEDIA_REPOSITORY_TOKEN,
|
||||
MEDIA_RESOLVER_PORT_TOKEN,
|
||||
MEDIA_STORAGE_PORT_TOKEN,
|
||||
REQUEST_AVATAR_GENERATION_USE_CASE_TOKEN,
|
||||
RESOLVE_MEDIA_REFERENCE_USE_CASE_TOKEN,
|
||||
UPDATE_AVATAR_USE_CASE_TOKEN,
|
||||
UPLOAD_MEDIA_USE_CASE_TOKEN,
|
||||
} from './MediaTokens';
|
||||
|
||||
export * from './MediaTokens';
|
||||
|
||||
import type { FaceValidationResult } from '@core/media/application/ports/FaceValidationPort';
|
||||
import type { AvatarGenerationResult } from '@core/media/application/ports/AvatarGenerationPort';
|
||||
import type { FaceValidationResult } from '@core/media/application/ports/FaceValidationPort';
|
||||
|
||||
// External adapters (ports) - these remain mock implementations
|
||||
class MockFaceValidationAdapter implements FaceValidationPort {
|
||||
@@ -84,9 +84,9 @@ class MockLogger implements Logger {
|
||||
error(): void {}
|
||||
}
|
||||
|
||||
import { MediaGenerationService } from '@core/media/domain/services/MediaGenerationService';
|
||||
import { MediaResolverAdapter } from '@adapters/media/MediaResolverAdapter';
|
||||
import { FileSystemMediaStorageAdapter } from '@adapters/media/ports/FileSystemMediaStorageAdapter';
|
||||
import { MediaGenerationService } from '@core/media/domain/services/MediaGenerationService';
|
||||
|
||||
// Import logging infrastructure
|
||||
import { InitializationLogger } from '../../shared/logging/InitializationLogger';
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
import { Injectable, Inject } from '@nestjs/common';
|
||||
import type { RequestAvatarGenerationInputDTO } from './dtos/RequestAvatarGenerationInputDTO';
|
||||
import type { UploadMediaInputDTO } from './dtos/UploadMediaInputDTO';
|
||||
import type { UpdateAvatarInputDTO } from './dtos/UpdateAvatarInputDTO';
|
||||
import type { RequestAvatarGenerationOutputDTO } from './dtos/RequestAvatarGenerationOutputDTO';
|
||||
import type { UploadMediaOutputDTO } from './dtos/UploadMediaOutputDTO';
|
||||
import type { GetMediaOutputDTO } from './dtos/GetMediaOutputDTO';
|
||||
import type { MediaReference } from '@core/domain/media/MediaReference';
|
||||
import type { RacingSuitColor } from '@core/media/domain/types/AvatarGenerationRequest';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import type { DeleteMediaOutputDTO } from './dtos/DeleteMediaOutputDTO';
|
||||
import type { GetAvatarOutputDTO } from './dtos/GetAvatarOutputDTO';
|
||||
import type { GetMediaOutputDTO } from './dtos/GetMediaOutputDTO';
|
||||
import type { RequestAvatarGenerationInputDTO } from './dtos/RequestAvatarGenerationInputDTO';
|
||||
import type { RequestAvatarGenerationOutputDTO } from './dtos/RequestAvatarGenerationOutputDTO';
|
||||
import type { UpdateAvatarInputDTO } from './dtos/UpdateAvatarInputDTO';
|
||||
import type { UpdateAvatarOutputDTO } from './dtos/UpdateAvatarOutputDTO';
|
||||
import type { UploadMediaInputDTO } from './dtos/UploadMediaInputDTO';
|
||||
import type { UploadMediaOutputDTO } from './dtos/UploadMediaOutputDTO';
|
||||
import type { ValidateFaceInputDTO } from './dtos/ValidateFaceInputDTO';
|
||||
import type { ValidateFaceOutputDTO } from './dtos/ValidateFaceOutputDTO';
|
||||
import type { RacingSuitColor } from '@core/media/domain/types/AvatarGenerationRequest';
|
||||
import type { MulterFile } from './types/MulterFile';
|
||||
import type { MediaReference } from '@core/domain/media/MediaReference';
|
||||
|
||||
type RequestAvatarGenerationInput = RequestAvatarGenerationInputDTO;
|
||||
type UploadMediaInput = UploadMediaInputDTO;
|
||||
type UpdateAvatarInput = UpdateAvatarInputDTO;
|
||||
|
||||
// Use cases
|
||||
import { RequestAvatarGenerationUseCase } from '@core/media/application/use-cases/RequestAvatarGenerationUseCase';
|
||||
import { UploadMediaUseCase } from '@core/media/application/use-cases/UploadMediaUseCase';
|
||||
import { GetMediaUseCase } from '@core/media/application/use-cases/GetMediaUseCase';
|
||||
import { DeleteMediaUseCase } from '@core/media/application/use-cases/DeleteMediaUseCase';
|
||||
import { GetAvatarUseCase } from '@core/media/application/use-cases/GetAvatarUseCase';
|
||||
import { UpdateAvatarUseCase } from '@core/media/application/use-cases/UpdateAvatarUseCase';
|
||||
import { ResolveMediaReferenceUseCase } from '@core/media/application/use-cases/ResolveMediaReferenceUseCase';
|
||||
import { GetMediaUseCase } from '@core/media/application/use-cases/GetMediaUseCase';
|
||||
import { GetUploadedMediaUseCase, type GetUploadedMediaResult } from '@core/media/application/use-cases/GetUploadedMediaUseCase';
|
||||
import { RequestAvatarGenerationUseCase } from '@core/media/application/use-cases/RequestAvatarGenerationUseCase';
|
||||
import { ResolveMediaReferenceUseCase } from '@core/media/application/use-cases/ResolveMediaReferenceUseCase';
|
||||
import { UpdateAvatarUseCase } from '@core/media/application/use-cases/UpdateAvatarUseCase';
|
||||
import { UploadMediaUseCase } from '@core/media/application/use-cases/UploadMediaUseCase';
|
||||
|
||||
// Presenters (now transformers)
|
||||
import { RequestAvatarGenerationPresenter } from './presenters/RequestAvatarGenerationPresenter';
|
||||
import { UploadMediaPresenter } from './presenters/UploadMediaPresenter';
|
||||
import { GetMediaPresenter } from './presenters/GetMediaPresenter';
|
||||
import { DeleteMediaPresenter } from './presenters/DeleteMediaPresenter';
|
||||
import { GetAvatarPresenter } from './presenters/GetAvatarPresenter';
|
||||
import { GetMediaPresenter } from './presenters/GetMediaPresenter';
|
||||
import { RequestAvatarGenerationPresenter } from './presenters/RequestAvatarGenerationPresenter';
|
||||
import { UpdateAvatarPresenter } from './presenters/UpdateAvatarPresenter';
|
||||
import { UploadMediaPresenter } from './presenters/UploadMediaPresenter';
|
||||
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import {
|
||||
REQUEST_AVATAR_GENERATION_USE_CASE_TOKEN,
|
||||
UPLOAD_MEDIA_USE_CASE_TOKEN,
|
||||
GET_MEDIA_USE_CASE_TOKEN,
|
||||
DELETE_MEDIA_USE_CASE_TOKEN,
|
||||
GET_AVATAR_USE_CASE_TOKEN,
|
||||
UPDATE_AVATAR_USE_CASE_TOKEN,
|
||||
RESOLVE_MEDIA_REFERENCE_USE_CASE_TOKEN,
|
||||
GET_UPLOADED_MEDIA_USE_CASE_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
DELETE_MEDIA_USE_CASE_TOKEN,
|
||||
GET_AVATAR_USE_CASE_TOKEN,
|
||||
GET_MEDIA_USE_CASE_TOKEN,
|
||||
GET_UPLOADED_MEDIA_USE_CASE_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
REQUEST_AVATAR_GENERATION_USE_CASE_TOKEN,
|
||||
RESOLVE_MEDIA_REFERENCE_USE_CASE_TOKEN,
|
||||
UPDATE_AVATAR_USE_CASE_TOKEN,
|
||||
UPLOAD_MEDIA_USE_CASE_TOKEN,
|
||||
} from './MediaTokens';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
|
||||
@Injectable()
|
||||
export class MediaService {
|
||||
|
||||
@@ -14,7 +14,7 @@ import { ISeasonSponsorshipRepository } from '@core/racing/domain/repositories/S
|
||||
import { ISponsorRepository } from '@core/racing/domain/repositories/SponsorRepository';
|
||||
import { ISponsorshipPricingRepository } from '@core/racing/domain/repositories/SponsorshipPricingRepository';
|
||||
import { ISponsorshipRequestRepository } from '@core/racing/domain/repositories/SponsorshipRequestRepository';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
import { GetSponsorBillingUseCase } from '@core/payments/application/use-cases/GetSponsorBillingUseCase';
|
||||
import { AcceptSponsorshipRequestUseCase } from '@core/racing/application/use-cases/AcceptSponsorshipRequestUseCase';
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import type { GetSponsorBillingUseCase } from '@core/payments/application/use-cases/GetSponsorBillingUseCase';
|
||||
import type { AcceptSponsorshipRequestUseCase } from '@core/racing/application/use-cases/AcceptSponsorshipRequestUseCase';
|
||||
import type { CreateSponsorUseCase } from '@core/racing/application/use-cases/CreateSponsorUseCase';
|
||||
import type { GetEntitySponsorshipPricingUseCase } from '@core/racing/application/use-cases/GetEntitySponsorshipPricingUseCase';
|
||||
import type { GetPendingSponsorshipRequestsUseCase } from '@core/racing/application/use-cases/GetPendingSponsorshipRequestsUseCase';
|
||||
import type { GetSponsorDashboardInput, GetSponsorDashboardUseCase } from '@core/racing/application/use-cases/GetSponsorDashboardUseCase';
|
||||
import type { GetEntitySponsorshipPricingUseCase } from '@core/racing/application/use-cases/GetEntitySponsorshipPricingUseCase';
|
||||
import type { GetSponsorSponsorshipsInput, GetSponsorSponsorshipsUseCase } from '@core/racing/application/use-cases/GetSponsorSponsorshipsUseCase';
|
||||
import type { GetSponsorsUseCase } from '@core/racing/application/use-cases/GetSponsorsUseCase';
|
||||
import type { GetSponsorUseCase } from '@core/racing/application/use-cases/GetSponsorUseCase';
|
||||
import type { RejectSponsorshipRequestUseCase } from '@core/racing/application/use-cases/RejectSponsorshipRequestUseCase';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import { Sponsor } from '@core/racing/domain/entities/sponsor/Sponsor';
|
||||
import { Money } from '@core/racing/domain/value-objects/Money';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import { beforeEach, describe, expect, it, Mock, vi } from 'vitest';
|
||||
import type { CreateSponsorInputDTO } from './dtos/CreateSponsorInputDTO';
|
||||
import { Sponsor } from '@core/racing/domain/entities/sponsor/Sponsor';
|
||||
import { Money } from '@core/racing/domain/value-objects/Money';
|
||||
import { SponsorService } from './SponsorService';
|
||||
|
||||
describe('SponsorService', () => {
|
||||
|
||||
@@ -1,74 +1,74 @@
|
||||
import { Injectable, Inject } from '@nestjs/common';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { AvailableLeagueDTO } from './dtos/AvailableLeagueDTO';
|
||||
import { BillingStatsDTO } from './dtos/BillingStatsDTO';
|
||||
import { CreateSponsorInputDTO } from './dtos/CreateSponsorInputDTO';
|
||||
import { CreateSponsorOutputDTO } from './dtos/CreateSponsorOutputDTO';
|
||||
import { GetSponsorDashboardQueryParamsDTO } from './dtos/GetSponsorDashboardQueryParamsDTO';
|
||||
import { SponsorDashboardDTO } from './dtos/SponsorDashboardDTO';
|
||||
import { GetSponsorSponsorshipsQueryParamsDTO } from './dtos/GetSponsorSponsorshipsQueryParamsDTO';
|
||||
import { SponsorSponsorshipsDTO } from './dtos/SponsorSponsorshipsDTO';
|
||||
import { GetSponsorOutputDTO } from './dtos/GetSponsorOutputDTO';
|
||||
import { GetPendingSponsorshipRequestsOutputDTO } from './dtos/GetPendingSponsorshipRequestsOutputDTO';
|
||||
import { GetEntitySponsorshipPricingResultDTO } from './dtos/GetEntitySponsorshipPricingResultDTO';
|
||||
import { GetPendingSponsorshipRequestsOutputDTO } from './dtos/GetPendingSponsorshipRequestsOutputDTO';
|
||||
import { GetSponsorDashboardQueryParamsDTO } from './dtos/GetSponsorDashboardQueryParamsDTO';
|
||||
import { GetSponsorOutputDTO } from './dtos/GetSponsorOutputDTO';
|
||||
import { GetSponsorsOutputDTO } from './dtos/GetSponsorsOutputDTO';
|
||||
import { AvailableLeagueDTO } from './dtos/AvailableLeagueDTO';
|
||||
import { LeagueDetailDTO } from './dtos/LeagueDetailDTO';
|
||||
import { SponsorDriverDTO } from './dtos/SponsorDriverDTO';
|
||||
import { SponsorRaceDTO } from './dtos/RaceDTO';
|
||||
import { SponsorProfileDTO } from './dtos/SponsorProfileDTO';
|
||||
import { NotificationSettingsDTO } from './dtos/NotificationSettingsDTO';
|
||||
import { PrivacySettingsDTO } from './dtos/PrivacySettingsDTO';
|
||||
import { PaymentMethodDTO } from './dtos/PaymentMethodDTO';
|
||||
import { GetSponsorSponsorshipsQueryParamsDTO } from './dtos/GetSponsorSponsorshipsQueryParamsDTO';
|
||||
import { InvoiceDTO } from './dtos/InvoiceDTO';
|
||||
import { BillingStatsDTO } from './dtos/BillingStatsDTO';
|
||||
import { LeagueDetailDTO } from './dtos/LeagueDetailDTO';
|
||||
import { NotificationSettingsDTO } from './dtos/NotificationSettingsDTO';
|
||||
import { PaymentMethodDTO } from './dtos/PaymentMethodDTO';
|
||||
import { PrivacySettingsDTO } from './dtos/PrivacySettingsDTO';
|
||||
import { SponsorRaceDTO } from './dtos/RaceDTO';
|
||||
import { SponsorDashboardDTO } from './dtos/SponsorDashboardDTO';
|
||||
import { SponsorDriverDTO } from './dtos/SponsorDriverDTO';
|
||||
import { SponsorProfileDTO } from './dtos/SponsorProfileDTO';
|
||||
import { SponsorSponsorshipsDTO } from './dtos/SponsorSponsorshipsDTO';
|
||||
|
||||
// Use cases
|
||||
import { GetEntitySponsorshipPricingUseCase } from '@core/racing/application/use-cases/GetEntitySponsorshipPricingUseCase';
|
||||
import { GetSponsorsUseCase } from '@core/racing/application/use-cases/GetSponsorsUseCase';
|
||||
import { GetSponsorBillingUseCase } from '@core/payments/application/use-cases/GetSponsorBillingUseCase';
|
||||
import { AcceptSponsorshipRequestUseCase } from '@core/racing/application/use-cases/AcceptSponsorshipRequestUseCase';
|
||||
import { CreateSponsorUseCase } from '@core/racing/application/use-cases/CreateSponsorUseCase';
|
||||
import { GetEntitySponsorshipPricingUseCase } from '@core/racing/application/use-cases/GetEntitySponsorshipPricingUseCase';
|
||||
import {
|
||||
GetPendingSponsorshipRequestsInput,
|
||||
GetPendingSponsorshipRequestsUseCase,
|
||||
} from '@core/racing/application/use-cases/GetPendingSponsorshipRequestsUseCase';
|
||||
import { GetSponsorDashboardUseCase } from '@core/racing/application/use-cases/GetSponsorDashboardUseCase';
|
||||
import { GetSponsorSponsorshipsUseCase } from '@core/racing/application/use-cases/GetSponsorSponsorshipsUseCase';
|
||||
import { GetSponsorsUseCase } from '@core/racing/application/use-cases/GetSponsorsUseCase';
|
||||
import { GetSponsorUseCase } from '@core/racing/application/use-cases/GetSponsorUseCase';
|
||||
import {
|
||||
GetPendingSponsorshipRequestsUseCase,
|
||||
GetPendingSponsorshipRequestsInput,
|
||||
} from '@core/racing/application/use-cases/GetPendingSponsorshipRequestsUseCase';
|
||||
import { AcceptSponsorshipRequestUseCase } from '@core/racing/application/use-cases/AcceptSponsorshipRequestUseCase';
|
||||
import { RejectSponsorshipRequestUseCase } from '@core/racing/application/use-cases/RejectSponsorshipRequestUseCase';
|
||||
import { GetSponsorBillingUseCase } from '@core/payments/application/use-cases/GetSponsorBillingUseCase';
|
||||
import type { SponsorableEntityType } from '@core/racing/domain/entities/SponsorshipRequest';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
|
||||
// Tokens
|
||||
import {
|
||||
GET_SPONSORS_USE_CASE_TOKEN,
|
||||
CREATE_SPONSOR_USE_CASE_TOKEN,
|
||||
GET_SPONSOR_DASHBOARD_USE_CASE_TOKEN,
|
||||
GET_SPONSOR_SPONSORSHIPS_USE_CASE_TOKEN,
|
||||
GET_SPONSOR_USE_CASE_TOKEN,
|
||||
GET_PENDING_SPONSORSHIP_REQUESTS_USE_CASE_TOKEN,
|
||||
ACCEPT_SPONSORSHIP_REQUEST_USE_CASE_TOKEN,
|
||||
REJECT_SPONSORSHIP_REQUEST_USE_CASE_TOKEN,
|
||||
GET_SPONSOR_BILLING_USE_CASE_TOKEN,
|
||||
GET_ENTITY_SPONSORSHIP_PRICING_USE_CASE_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
ACCEPT_SPONSORSHIP_REQUEST_USE_CASE_TOKEN,
|
||||
CREATE_SPONSOR_USE_CASE_TOKEN,
|
||||
GET_ENTITY_SPONSORSHIP_PRICING_USE_CASE_TOKEN,
|
||||
GET_PENDING_SPONSORSHIP_REQUESTS_USE_CASE_TOKEN,
|
||||
GET_SPONSOR_BILLING_USE_CASE_TOKEN,
|
||||
GET_SPONSOR_DASHBOARD_USE_CASE_TOKEN,
|
||||
GET_SPONSOR_SPONSORSHIPS_USE_CASE_TOKEN,
|
||||
GET_SPONSOR_USE_CASE_TOKEN,
|
||||
GET_SPONSORS_USE_CASE_TOKEN,
|
||||
LOGGER_TOKEN,
|
||||
REJECT_SPONSORSHIP_REQUEST_USE_CASE_TOKEN,
|
||||
} from './SponsorTokens';
|
||||
|
||||
// Presenters (for view model transformation only)
|
||||
import { GetEntitySponsorshipPricingPresenter } from './presenters/GetEntitySponsorshipPricingPresenter';
|
||||
import { GetSponsorsPresenter } from './presenters/GetSponsorsPresenter';
|
||||
import { CreateSponsorPresenter } from './presenters/CreateSponsorPresenter';
|
||||
import { GetSponsorDashboardPresenter } from './presenters/GetSponsorDashboardPresenter';
|
||||
import { GetSponsorSponsorshipsPresenter } from './presenters/GetSponsorSponsorshipsPresenter';
|
||||
import { GetSponsorPresenter } from './presenters/GetSponsorPresenter';
|
||||
import { GetPendingSponsorshipRequestsPresenter } from './presenters/GetPendingSponsorshipRequestsPresenter';
|
||||
import { AcceptSponsorshipRequestPresenter } from './presenters/AcceptSponsorshipRequestPresenter';
|
||||
import { RejectSponsorshipRequestPresenter } from './presenters/RejectSponsorshipRequestPresenter';
|
||||
import { SponsorBillingPresenter } from './presenters/SponsorBillingPresenter';
|
||||
import { AvailableLeaguesPresenter } from './presenters/AvailableLeaguesPresenter';
|
||||
import { LeagueDetailPresenter } from './presenters/LeagueDetailPresenter';
|
||||
import { SponsorSettingsPresenter } from './presenters/SponsorSettingsPresenter';
|
||||
import { SponsorSettingsUpdatePresenter } from './presenters/SponsorSettingsUpdatePresenter';
|
||||
import type { RejectSponsorshipRequestResult } from '@core/racing/application/use-cases/RejectSponsorshipRequestUseCase';
|
||||
import type { AcceptSponsorshipRequestResultViewModel } from './presenters/AcceptSponsorshipRequestPresenter';
|
||||
import { AcceptSponsorshipRequestPresenter } from './presenters/AcceptSponsorshipRequestPresenter';
|
||||
import { AvailableLeaguesPresenter } from './presenters/AvailableLeaguesPresenter';
|
||||
import { CreateSponsorPresenter } from './presenters/CreateSponsorPresenter';
|
||||
import { GetEntitySponsorshipPricingPresenter } from './presenters/GetEntitySponsorshipPricingPresenter';
|
||||
import { GetPendingSponsorshipRequestsPresenter } from './presenters/GetPendingSponsorshipRequestsPresenter';
|
||||
import { GetSponsorDashboardPresenter } from './presenters/GetSponsorDashboardPresenter';
|
||||
import { GetSponsorPresenter } from './presenters/GetSponsorPresenter';
|
||||
import { GetSponsorSponsorshipsPresenter } from './presenters/GetSponsorSponsorshipsPresenter';
|
||||
import { GetSponsorsPresenter } from './presenters/GetSponsorsPresenter';
|
||||
import { LeagueDetailPresenter } from './presenters/LeagueDetailPresenter';
|
||||
import { RejectSponsorshipRequestPresenter } from './presenters/RejectSponsorshipRequestPresenter';
|
||||
import { SponsorBillingPresenter } from './presenters/SponsorBillingPresenter';
|
||||
import { SponsorSettingsPresenter } from './presenters/SponsorSettingsPresenter';
|
||||
import { SponsorSettingsUpdatePresenter } from './presenters/SponsorSettingsUpdatePresenter';
|
||||
|
||||
@Injectable()
|
||||
export class SponsorService {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import type { LogContext } from './LoggerContext';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
|
||||
/**
|
||||
* LoggerPort - Port interface for application-layer logging.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { AuthenticationState } from '../../domain/value-objects/AuthenticationState';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { AuthenticationServicePort } from '../ports/AuthenticationServicePort';
|
||||
import { AuthenticationState } from '../../domain/value-objects/AuthenticationState';
|
||||
import { SessionLifetime } from '../../domain/value-objects/SessionLifetime';
|
||||
import type { AuthenticationServicePort } from '../ports/AuthenticationServicePort';
|
||||
import type { SessionValidatorPort } from '../ports/SessionValidatorPort';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { AuthenticationServicePort } from '../ports/AuthenticationServicePort';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
|
||||
/**
|
||||
* Use case for clearing the user's session (logout).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import { RaceCreationResult } from '../../domain/value-objects/RaceCreationResult';
|
||||
import type { CheckoutServicePort } from '../ports/CheckoutServicePort';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
|
||||
export class CompleteRaceCreationUseCase {
|
||||
constructor(private readonly checkoutService: CheckoutServicePort, private readonly logger: Logger) {}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { CheckoutServicePort } from '../ports/CheckoutServicePort';
|
||||
import type { CheckoutConfirmationPort } from '../ports/CheckoutConfirmationPort';
|
||||
import { CheckoutStateEnum } from '../../domain/value-objects/CheckoutState';
|
||||
import type { CheckoutConfirmationPort } from '../ports/CheckoutConfirmationPort';
|
||||
import type { CheckoutServicePort } from '../ports/CheckoutServicePort';
|
||||
|
||||
|
||||
interface SessionMetadata {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { AsyncUseCase } from '@core/shared/application';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { AutomationSession } from '../../domain/entities/AutomationSession';
|
||||
import type { HostedSessionConfig } from '../../domain/types/HostedSessionConfig';
|
||||
import type { SessionDTO } from '../dto/SessionDTO';
|
||||
import { AutomationEnginePort } from '../ports/AutomationEnginePort';
|
||||
import type { IBrowserAutomation } from '../ports/ScreenAutomationPort';
|
||||
import { SessionRepositoryPort } from '../ports/SessionRepositoryPort';
|
||||
import type { SessionDTO } from '../dto/SessionDTO';
|
||||
|
||||
export class StartAutomationSessionUseCase
|
||||
implements AsyncUseCase<HostedSessionConfig, SessionDTO> {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { AuthenticationServicePort } from '../ports/AuthenticationServicePort';
|
||||
import type { Logger } from '@core/shared/domain/Logger';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import { BrowserAuthenticationState } from '../../domain/value-objects/BrowserAuthenticationState';
|
||||
import type { Logger } from '@core/shared/application';
|
||||
import type { AuthenticationServicePort } from '../ports/AuthenticationServicePort';
|
||||
|
||||
/**
|
||||
* Use case for verifying browser shows authenticated page state.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user