This commit is contained in:
2025-12-17 01:23:09 +01:00
parent f01e01e50c
commit 4d890863d3
73 changed files with 2632 additions and 3224 deletions

View File

@@ -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();
}
}