Files
gridpilot.gg/core/racing/domain/entities/ProtestId.ts
2025-12-17 00:33:13 +01:00

20 lines
509 B
TypeScript

import { RacingDomainValidationError } from '../errors/RacingDomainError';
export class ProtestId {
private constructor(private readonly value: string) {}
static create(value: string): ProtestId {
if (!value || value.trim().length === 0) {
throw new RacingDomainValidationError('Protest ID cannot be empty');
}
return new ProtestId(value.trim());
}
toString(): string {
return this.value;
}
equals(other: ProtestId): boolean {
return this.value === other.value;
}
}