league service

This commit is contained in:
2025-12-16 00:57:31 +01:00
parent 3b566c973d
commit 775d41e055
130 changed files with 4077 additions and 1036 deletions

View File

@@ -0,0 +1,9 @@
import { Module } from '@nestjs/common';
import { AuthProviders, AUTH_REPOSITORY_TOKEN, USER_REPOSITORY_TOKEN } from './AuthProviders';
@Module({
imports: [],
providers: AuthProviders,
exports: [AUTH_REPOSITORY_TOKEN, USER_REPOSITORY_TOKEN],
})
export class AuthModule {}

View File

@@ -0,0 +1,30 @@
import { Provider } from '@nestjs/common';
// Import core interfaces
import { IAuthRepository } from '@gridpilot/identity/domain/repositories/IAuthRepository';
import { IUserRepository } from '@gridpilot/identity/domain/repositories/IUserRepository';
import { Logger } from '@gridpilot/shared/logging/Logger';
// Import implementations
import { InMemoryAuthRepository } from '@gridpilot/adapters/identity/persistence/inmemory/InMemoryAuthRepository';
import { InMemoryUserRepository } from '@gridpilot/adapters/identity/persistence/inmemory/InMemoryUserRepository';
// Import tokens
import { LOGGER_TOKEN } from '../logging/LoggingModule';
// Define injection tokens
export const AUTH_REPOSITORY_TOKEN = Symbol('IAuthRepository');
export const USER_REPOSITORY_TOKEN = Symbol('IUserRepository');
export const AuthProviders: Provider[] = [
{
provide: AUTH_REPOSITORY_TOKEN,
useFactory: (logger: Logger) => new InMemoryAuthRepository(logger),
inject: [LOGGER_TOKEN],
},
{
provide: USER_REPOSITORY_TOKEN,
useFactory: (logger: Logger) => new InMemoryUserRepository(logger),
inject: [LOGGER_TOKEN],
},
];