module creation

This commit is contained in:
2025-12-15 21:44:06 +01:00
parent b834f88bbd
commit 7c7267da72
88 changed files with 12119 additions and 4241 deletions

View File

@@ -1,9 +1,3 @@
/**
* Repository Interface: IEngagementRepository
*
* Defines persistence operations for EngagementEvent entities.
*/
import type { EngagementEvent, EngagementAction, EngagementEntityType } from '../entities/EngagementEvent';
export interface IEngagementRepository {
@@ -14,4 +8,4 @@ export interface IEngagementRepository {
findByDateRange(startDate: Date, endDate: Date): Promise<EngagementEvent[]>;
countByAction(action: EngagementAction, entityId?: string, since?: Date): Promise<number>;
getSponsorClicksForEntity(entityId: string, since?: Date): Promise<number>;
}
}

View File

@@ -0,0 +1,15 @@
import { User } from '../../domain/entities/User';
// No direct import of apps/api DTOs in core module
/**
* Application Use Case: GetCurrentSessionUseCase
*
* Retrieves the current user session information.
*/
export class GetCurrentSessionUseCase {
async execute(userId: string): Promise<User | null> {
// TODO: Implement actual logic to retrieve user and session data
console.warn('GetCurrentSessionUseCase: Method not implemented.');
return null;
}
}

View File

@@ -0,0 +1,20 @@
import { User } from '../../domain/entities/User';
export interface LoginWithIracingCallbackParams {
code: string;
state?: string;
returnTo?: string;
}
/**
* Application Use Case: LoginWithIracingCallbackUseCase
*
* Handles the callback after iRacing authentication.
*/
export class LoginWithIracingCallbackUseCase {
async execute(params: LoginWithIracingCallbackParams): Promise<User> {
// TODO: Implement actual logic for handling iRacing OAuth callback
console.warn('LoginWithIracingCallbackUseCase: Method not implemented.');
throw new Error('Method not implemented.');
}
}

View File

@@ -0,0 +1,20 @@
export interface IracingAuthRedirectResult {
redirectUrl: string;
state: string;
}
/**
* Application Use Case: StartIracingAuthRedirectUseCase
*
* Initiates the iRacing authentication flow.
*/
export class StartIracingAuthRedirectUseCase {
async execute(returnTo?: string): Promise<IracingAuthRedirectResult> {
// TODO: Implement actual logic for initiating iRacing OAuth redirect
console.warn('StartIracingAuthRedirectUseCase: Method not implemented.');
return {
redirectUrl: '/mock-iracing-redirect',
state: 'mock-state',
};
}
}

View File

@@ -18,7 +18,7 @@ export interface StoredUser {
displayName: string;
passwordHash: string;
salt: string;
primaryDriverId?: string;
primaryDriverId?: string | undefined;
createdAt: Date;
}

View File

@@ -1,4 +1,3 @@
export interface ILogger {
debug(message: string, ...args: any[]): void;
info(message: string, ...args: any[]): void;