inmemory to postgres
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user