refactor
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
|
||||
export class IRacingId {
|
||||
export class IRacingId implements IValueObject<string> {
|
||||
private constructor(private readonly value: string) {}
|
||||
|
||||
static create(value: string): IRacingId {
|
||||
@@ -14,7 +15,11 @@ export class IRacingId {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
equals(other: IRacingId): boolean {
|
||||
return this.value === other.value;
|
||||
get props(): string {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
equals(other: IValueObject<string>): boolean {
|
||||
return this.props === other.props;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user