website refactor
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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', () => {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user