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';
|
||||
|
||||
// Mock implementations
|
||||
class MockRaceResultsProvider implements IRaceResultsProvider {
|
||||
class MockRaceResultsProvider implements RaceResultsProvider {
|
||||
private results: RaceResultsData | null = null;
|
||||
|
||||
setResults(results: RaceResultsData | null) {
|
||||
@@ -26,7 +26,7 @@ class MockRaceResultsProvider implements IRaceResultsProvider {
|
||||
}
|
||||
}
|
||||
|
||||
class MockRatingEventRepository implements IRatingEventRepository {
|
||||
class MockRatingEventRepository implements RatingEventRepository {
|
||||
private events: RatingEvent[] = [];
|
||||
|
||||
async save(event: RatingEvent): Promise<RatingEvent> {
|
||||
@@ -46,7 +46,7 @@ class MockRatingEventRepository implements IRatingEventRepository {
|
||||
return this.events.filter(e => e.userId === 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
|
||||
@@ -80,7 +80,7 @@ class MockRatingEventRepository 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,
|
||||
@@ -96,7 +96,7 @@ class MockRatingEventRepository implements IRatingEventRepository {
|
||||
}
|
||||
}
|
||||
|
||||
class MockUserRatingRepository implements IUserRatingRepository {
|
||||
class MockUserRatingRepository implements UserRatingRepository {
|
||||
private ratings: Map<string, UserRating> = new Map();
|
||||
|
||||
async findByUserId(userId: string): Promise<UserRating | null> {
|
||||
|
||||
Reference in New Issue
Block a user