website refactor
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
* In-memory implementation of IAchievementRepository
|
||||
*/
|
||||
|
||||
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 { Achievement } from "@core/identity/domain/entities/Achievement";
|
||||
import { UserAchievement } from "@core/identity/domain/entities/UserAchievement";
|
||||
import { AchievementRepository } from "@core/identity/domain/repositories/AchievementRepository";
|
||||
import { AchievementCategory } from "@core/identity/domain/types/AchievementTypes";
|
||||
import { Logger } from "@core/shared/domain";
|
||||
|
||||
export class InMemoryAchievementRepository implements AchievementRepository {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { User } from '@core/identity/domain/entities/User';
|
||||
import { AuthRepository } from '@core/identity/domain/repositories/AuthRepository';
|
||||
import { UserRepository, StoredUser } from '@core/identity/domain/repositories/UserRepository';
|
||||
import { PasswordHashingService } from '@core/identity/domain/services/PasswordHashingService';
|
||||
import { StoredUser } from '@core/identity/domain/repositories/UserRepository';
|
||||
|
||||
import { EmailAddress } from '@core/identity/domain/value-objects/EmailAddress';
|
||||
import { Logger } from '@core/shared/domain';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ExternalGameRatingRepository, PaginatedQueryOptions, PaginatedResult } from '@core/identity/domain/repositories/ExternalGameRatingRepository';
|
||||
import { ExternalGameRatingProfile } from '@core/identity/domain/entities/ExternalGameRatingProfile';
|
||||
import { ExternalGameRatingRepository, PaginatedQueryOptions, PaginatedResult } from '@core/identity/domain/repositories/ExternalGameRatingRepository';
|
||||
|
||||
/**
|
||||
* In-Memory Implementation: IExternalGameRatingRepository
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, beforeEach } from 'vitest';
|
||||
import { beforeEach, describe, expect, it } from 'vitest';
|
||||
import { InMemoryMagicLinkRepository } from './InMemoryMagicLinkRepository';
|
||||
|
||||
const mockLogger = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { MagicLinkRepository, PasswordResetRequest } from '@core/identity/domain/repositories/MagicLinkRepository';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import { Logger } from '@core/shared/domain';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
|
||||
export class InMemoryMagicLinkRepository implements MagicLinkRepository {
|
||||
private resetRequests: Map<string, PasswordResetRequest> = new Map();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* In-memory implementation of ISponsorAccountRepository for development/testing.
|
||||
*/
|
||||
|
||||
import { SponsorAccountRepository, SponsorAccount, UserId } from '@core/identity';
|
||||
import { SponsorAccount, SponsorAccountRepository, UserId } from '@core/identity';
|
||||
import { Logger } from '@core/shared/domain';
|
||||
|
||||
export class InMemorySponsorAccountRepository implements SponsorAccountRepository {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* In-memory implementation of IUserRatingRepository
|
||||
*/
|
||||
|
||||
import { UserRatingRepository, UserRating } from '@core/identity';
|
||||
import { UserRating, UserRatingRepository } from '@core/identity';
|
||||
import { Logger } from '@core/shared/domain';
|
||||
|
||||
export class InMemoryUserRatingRepository implements UserRatingRepository {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* Stores users in memory for demo/development purposes.
|
||||
*/
|
||||
|
||||
import type { StoredUser, UserRepository } from '@core/identity/domain/repositories/UserRepository';
|
||||
import { Logger } from '@core/shared/domain';
|
||||
import type { UserRepository, StoredUser } from '@core/identity/domain/repositories/UserRepository';
|
||||
|
||||
export class InMemoryUserRepository implements UserRepository {
|
||||
private users: Map<string, StoredUser> = new Map();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn } from 'typeorm';
|
||||
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
||||
|
||||
@Entity('companies')
|
||||
export class CompanyOrmEntity {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';
|
||||
import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm';
|
||||
|
||||
@Entity('password_reset_requests')
|
||||
export class PasswordResetRequestOrmEntity {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { ExternalGameRatingProfileOrmMapper } from './ExternalGameRatingProfileOrmMapper';
|
||||
import { ExternalGameRatingProfileOrmEntity } from '../entities/ExternalGameRatingProfileOrmEntity';
|
||||
import { ExternalGameRatingProfile } from '@core/identity/domain/entities/ExternalGameRatingProfile';
|
||||
import { UserId } from '@core/identity/domain/value-objects/UserId';
|
||||
import { GameKey } from '@core/identity/domain/value-objects/GameKey';
|
||||
import { ExternalRating } from '@core/identity/domain/value-objects/ExternalRating';
|
||||
import { ExternalRatingProvenance } from '@core/identity/domain/value-objects/ExternalRatingProvenance';
|
||||
import { GameKey } from '@core/identity/domain/value-objects/GameKey';
|
||||
import { UserId } from '@core/identity/domain/value-objects/UserId';
|
||||
import { ExternalGameRatingProfileOrmEntity } from '../entities/ExternalGameRatingProfileOrmEntity';
|
||||
import { ExternalGameRatingProfileOrmMapper } from './ExternalGameRatingProfileOrmMapper';
|
||||
|
||||
describe('ExternalGameRatingProfileOrmMapper', () => {
|
||||
describe('toDomain', () => {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
*/
|
||||
|
||||
import { RatingEvent } from '@core/identity/domain/entities/RatingEvent';
|
||||
import { RatingEventId } from '@core/identity/domain/value-objects/RatingEventId';
|
||||
import { RatingDimensionKey } from '@core/identity/domain/value-objects/RatingDimensionKey';
|
||||
import { RatingDelta } from '@core/identity/domain/value-objects/RatingDelta';
|
||||
import { RatingDimensionKey } from '@core/identity/domain/value-objects/RatingDimensionKey';
|
||||
import { RatingEventId } from '@core/identity/domain/value-objects/RatingEventId';
|
||||
import { RatingEventOrmEntity } from '../entities/RatingEventOrmEntity';
|
||||
import { RatingEventOrmMapper } from './RatingEventOrmMapper';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { RatingEvent } from '@core/identity/domain/entities/RatingEvent';
|
||||
import { RatingEventId } from '@core/identity/domain/value-objects/RatingEventId';
|
||||
import { RatingDimensionKey } from '@core/identity/domain/value-objects/RatingDimensionKey';
|
||||
import { RatingDelta } from '@core/identity/domain/value-objects/RatingDelta';
|
||||
import { RatingDimensionKey } from '@core/identity/domain/value-objects/RatingDimensionKey';
|
||||
import { RatingEventId } from '@core/identity/domain/value-objects/RatingEventId';
|
||||
import { RatingEventOrmEntity } from '../entities/RatingEventOrmEntity';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import * as fs from 'node:fs';
|
||||
import * as path from 'node:path';
|
||||
import type { DataSource, Repository } from 'typeorm';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { TypeOrmAuthRepository } from './TypeOrmAuthRepository';
|
||||
import { UserOrmEntity } from '../entities/UserOrmEntity';
|
||||
import { UserOrmMapper } from '../mappers/UserOrmMapper';
|
||||
import { EmailAddress } from '@core/identity/domain/value-objects/EmailAddress';
|
||||
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 { UserOrmEntity } from '../entities/UserOrmEntity';
|
||||
import { UserOrmMapper } from '../mappers/UserOrmMapper';
|
||||
import { TypeOrmAuthRepository } from './TypeOrmAuthRepository';
|
||||
|
||||
describe('TypeOrmAuthRepository', () => {
|
||||
it('does not construct its own mapper dependencies', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Repository } from 'typeorm';
|
||||
import { ExternalGameRatingRepository, PaginatedQueryOptions, PaginatedResult } from '@core/identity/domain/repositories/ExternalGameRatingRepository';
|
||||
import { ExternalGameRatingProfile } from '@core/identity/domain/entities/ExternalGameRatingProfile';
|
||||
import { ExternalGameRatingRepository, PaginatedQueryOptions, PaginatedResult } from '@core/identity/domain/repositories/ExternalGameRatingRepository';
|
||||
import { Repository } from 'typeorm';
|
||||
import { ExternalGameRatingProfileOrmEntity } from '../entities/ExternalGameRatingProfileOrmEntity';
|
||||
import { ExternalGameRatingProfileOrmMapper } from '../mappers/ExternalGameRatingProfileOrmMapper';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { DataSource } from 'typeorm';
|
||||
import { MagicLinkRepository, PasswordResetRequest } from '@core/identity/domain/repositories/MagicLinkRepository';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import { Logger } from '@core/shared/domain';
|
||||
import { Result } from '@core/shared/domain/Result';
|
||||
import type { DataSource } from 'typeorm';
|
||||
import { PasswordResetRequestOrmEntity } from '../entities/PasswordResetRequestOrmEntity';
|
||||
|
||||
export class TypeOrmMagicLinkRepository implements MagicLinkRepository {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import type { DataSource } from 'typeorm';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { TypeOrmRatingEventRepository } from './TypeOrmRatingEventRepository';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { DataSource } from 'typeorm';
|
||||
|
||||
import type { RatingEventRepository, FindByUserIdOptions, PaginatedQueryOptions, PaginatedResult } from '@core/identity/domain/repositories/RatingEventRepository';
|
||||
import type { RatingEvent } from '@core/identity/domain/entities/RatingEvent';
|
||||
import type { FindByUserIdOptions, PaginatedQueryOptions, PaginatedResult, RatingEventRepository } from '@core/identity/domain/repositories/RatingEventRepository';
|
||||
import type { RatingEventId } from '@core/identity/domain/value-objects/RatingEventId';
|
||||
|
||||
import { RatingEventOrmEntity } from '../entities/RatingEventOrmEntity';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import type { DataSource } from 'typeorm';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { TypeOrmUserRatingRepository } from './TypeOrmUserRatingRepository';
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import * as fs from 'node:fs';
|
||||
import * as path from 'node:path';
|
||||
import type { DataSource, Repository } from 'typeorm';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { TypeOrmUserRepository } from './TypeOrmUserRepository';
|
||||
import { UserOrmEntity } from '../entities/UserOrmEntity';
|
||||
import { UserOrmMapper } from '../mappers/UserOrmMapper';
|
||||
import { TypeOrmUserRepository } from './TypeOrmUserRepository';
|
||||
|
||||
describe('TypeOrmUserRepository', () => {
|
||||
it('does not construct its own mapper dependencies', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { DataSource } from 'typeorm';
|
||||
|
||||
import type { UserRepository, StoredUser } from '@core/identity/domain/repositories/UserRepository';
|
||||
import type { StoredUser, UserRepository } from '@core/identity/domain/repositories/UserRepository';
|
||||
|
||||
import { UserOrmEntity } from '../entities/UserOrmEntity';
|
||||
import { UserOrmMapper } from '../mappers/UserOrmMapper';
|
||||
|
||||
Reference in New Issue
Block a user