inmemory to postgres
This commit is contained in:
@@ -74,6 +74,30 @@ export class Standing implements IEntity<string> {
|
||||
});
|
||||
}
|
||||
|
||||
static rehydrate(props: {
|
||||
id: string;
|
||||
leagueId: string;
|
||||
driverId: string;
|
||||
points: number;
|
||||
wins: number;
|
||||
position: number;
|
||||
racesCompleted: number;
|
||||
}): Standing {
|
||||
if (!props.id || props.id.trim().length === 0) {
|
||||
throw new RacingDomainValidationError('Standing ID is required');
|
||||
}
|
||||
|
||||
return new Standing({
|
||||
id: props.id,
|
||||
leagueId: LeagueId.create(props.leagueId),
|
||||
driverId: DriverId.create(props.driverId),
|
||||
points: Points.create(props.points),
|
||||
wins: props.wins,
|
||||
position: Position.create(props.position),
|
||||
racesCompleted: props.racesCompleted,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Domain validation logic
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user