inmemory to postgres

This commit is contained in:
2025-12-29 18:34:12 +01:00
parent 9e17d0752a
commit f5639a367f
176 changed files with 10175 additions and 468 deletions

View File

@@ -55,6 +55,15 @@ export class RaceRegistration implements IEntity<string> {
});
}
static rehydrate(props: { id: string; raceId: string; driverId: string; registeredAt: Date }): RaceRegistration {
return new RaceRegistration({
id: props.id,
raceId: RaceId.create(props.raceId),
driverId: DriverId.create(props.driverId),
registeredAt: RegisteredAt.create(props.registeredAt),
});
}
private static validate(props: RaceRegistrationProps): void {
if (!props.raceId || props.raceId.trim().length === 0) {
throw new RacingDomainValidationError('Race ID is required');