website refactor

This commit is contained in:
2026-01-16 15:20:25 +01:00
parent 7e02fc3ea5
commit 37b1aa626c
325 changed files with 2167 additions and 2782 deletions

View File

@@ -1,5 +1,5 @@
import { RacingDomainValidationError } from '../errors/RacingDomainError';
import type { ValueObject } from '@core/shared/domain';
import type { ValueObject } from '@core/shared/domain/ValueObject';
export class CountryCode implements ValueObject<string> {
private constructor(private readonly value: string) {}
@@ -19,11 +19,11 @@ export class CountryCode implements ValueObject<string> {
return this.value;
}
equals(other: IValueObject<string>): boolean {
equals(other: ValueObject<string>): boolean {
return this.value === other.props;
}
get props(): string {
return this.value;
}
}
}

View File

@@ -1,5 +1,5 @@
import { RacingDomainValidationError } from '../errors/RacingDomainError';
import type { ValueObject } from '@core/shared/domain';
import type { ValueObject } from '@core/shared/domain/ValueObject';
export class JoinedAt implements ValueObject<Date> {
private constructor(private readonly value: Date) {}
@@ -20,7 +20,7 @@ export class JoinedAt implements ValueObject<Date> {
return new Date(this.value);
}
equals(other: IValueObject<Date>): boolean {
equals(other: ValueObject<Date>): boolean {
return this.props.getTime() === other.props.getTime();
}
}
}

View File

@@ -19,7 +19,7 @@ export class Points implements ValueObject<{ value: number }> {
return this.value;
}
equals(other: IValueObject<{ value: number }>): boolean {
equals(other: ValueObject<{ value: number }>): boolean {
return this.value === other.props.value;
}
}

View File

@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import { RacingId } from './RacingId';
import { IRacingId } from './RacingId';
describe('IRacingId', () => {
it('should create an iRacing id', () => {

View File

@@ -1,5 +1,5 @@
import { RacingDomainValidationError } from '../errors/RacingDomainError';
import type { ValueObject } from '@core/shared/domain';
import type { ValueObject } from '@core/shared/domain/ValueObject';
export class IRacingId implements ValueObject<string> {
private constructor(private readonly value: string) {}
@@ -19,7 +19,7 @@ export class IRacingId implements ValueObject<string> {
return this.value;
}
equals(other: IValueObject<string>): boolean {
equals(other: ValueObject<string>): boolean {
return this.props === other.props;
}
}
}

View File

@@ -1,5 +1,5 @@
import { RacingDomainValidationError } from '../../errors/RacingDomainError';
import type { ValueObject } from '@core/shared/domain';
import type { ValueObject } from '@core/shared/domain/ValueObject';
export interface DriverBioProps {
value: string;
@@ -19,7 +19,7 @@ export class DriverBio implements ValueObject<DriverBioProps> {
return this.value;
}
equals(other: IValueObject<DriverBioProps>): boolean {
equals(other: ValueObject<DriverBioProps>): boolean {
return this.props.value === other.props.value;
}

View File

@@ -1,5 +1,5 @@
import { RacingDomainValidationError } from '../../errors/RacingDomainError';
import type { ValueObject } from '@core/shared/domain';
import type { ValueObject } from '@core/shared/domain/ValueObject';
export interface DriverNameProps {
value: string;
@@ -19,7 +19,7 @@ export class DriverName implements ValueObject<DriverNameProps> {
return this.value;
}
equals(other: IValueObject<DriverNameProps>): boolean {
equals(other: ValueObject<DriverNameProps>): boolean {
return this.props.value === other.props.value;
}