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