website refactor
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { RecordRaceRatingEventsUseCase } from './RecordRaceRatingEventsUseCase';
|
||||
import { IRaceResultsProvider, RaceResultsData } from '../ports/IRaceResultsProvider';
|
||||
import { IRatingEventRepository } from '../../domain/repositories/IRatingEventRepository';
|
||||
import { IUserRatingRepository } from '../../domain/repositories/IUserRatingRepository';
|
||||
import { RaceResultsProvider, RaceResultsData } from '../ports/RaceResultsProvider';
|
||||
import { RatingEventRepository } from '../../domain/repositories/RatingEventRepository';
|
||||
import { UserRatingRepository } from '../../domain/repositories/UserRatingRepository';
|
||||
import { AppendRatingEventsUseCase } from './AppendRatingEventsUseCase';
|
||||
import { UserRating } from '../../domain/value-objects/UserRating';
|
||||
import { RatingEvent } from '../../domain/entities/RatingEvent';
|
||||
@@ -10,7 +10,7 @@ import { RatingDimensionKey } from '../../domain/value-objects/RatingDimensionKe
|
||||
import { RatingDelta } from '../../domain/value-objects/RatingDelta';
|
||||
|
||||
// In-memory implementations for integration testing
|
||||
class InMemoryRaceResultsProvider implements IRaceResultsProvider {
|
||||
class InMemoryRaceResultsProvider implements RaceResultsProvider {
|
||||
private results: Map<string, RaceResultsData> = new Map();
|
||||
|
||||
async getRaceResults(raceId: string): Promise<RaceResultsData | null> {
|
||||
@@ -27,7 +27,7 @@ class InMemoryRaceResultsProvider implements IRaceResultsProvider {
|
||||
}
|
||||
}
|
||||
|
||||
class InMemoryRatingEventRepository implements IRatingEventRepository {
|
||||
class InMemoryRatingEventRepository implements RatingEventRepository {
|
||||
private events: Map<string, RatingEvent[]> = new Map();
|
||||
|
||||
async save(event: RatingEvent): Promise<RatingEvent> {
|
||||
@@ -52,7 +52,7 @@ class InMemoryRatingEventRepository implements IRatingEventRepository {
|
||||
return this.events.get(userId) || [];
|
||||
}
|
||||
|
||||
async findEventsPaginated(userId: string, options?: import('@core/identity/domain/repositories/IRatingEventRepository').PaginatedQueryOptions): Promise<import('@core/identity/domain/repositories/IRatingEventRepository').PaginatedResult<RatingEvent>> {
|
||||
async findEventsPaginated(userId: string, options?: import('@core/identity/domain/repositories/RatingEventRepository').PaginatedQueryOptions): Promise<import('@core/identity/domain/repositories/RatingEventRepository').PaginatedResult<RatingEvent>> {
|
||||
const allEvents = await this.findByUserId(userId);
|
||||
|
||||
// Apply filters
|
||||
@@ -86,7 +86,7 @@ class InMemoryRatingEventRepository implements IRatingEventRepository {
|
||||
const hasMore = offset + limit < total;
|
||||
const nextOffset = hasMore ? offset + limit : undefined;
|
||||
|
||||
const result: import('@core/identity/domain/repositories/IRatingEventRepository').PaginatedResult<RatingEvent> = {
|
||||
const result: import('@core/identity/domain/repositories/RatingEventRepository').PaginatedResult<RatingEvent> = {
|
||||
items,
|
||||
total,
|
||||
limit,
|
||||
@@ -111,7 +111,7 @@ class InMemoryRatingEventRepository implements IRatingEventRepository {
|
||||
}
|
||||
}
|
||||
|
||||
class InMemoryUserRatingRepository implements IUserRatingRepository {
|
||||
class InMemoryUserRatingRepository implements UserRatingRepository {
|
||||
private ratings: Map<string, UserRating> = new Map();
|
||||
|
||||
async findByUserId(userId: string): Promise<UserRating | null> {
|
||||
|
||||
Reference in New Issue
Block a user