import { RacingDomainValidationError } from '../errors/RacingDomainError'; import type { IValueObject } from '@core/shared/domain'; export class TrackImageUrl implements IValueObject { private constructor(private readonly value: string | undefined) {} get props(): string | undefined { return this.value; } static create(value: string | undefined): TrackImageUrl { // Allow undefined or valid URL, but for simplicity, just check if string is not empty if provided if (value !== undefined && value.trim().length === 0) { throw new RacingDomainValidationError('Track image URL cannot be empty string'); } return new TrackImageUrl(value); } toString(): string | undefined { return this.value; } equals(other: IValueObject): boolean { return this.value === other.props; } }