inmemory to postgres
This commit is contained in:
@@ -62,6 +62,24 @@ export class Driver implements IEntity<string> {
|
||||
});
|
||||
}
|
||||
|
||||
static rehydrate(props: {
|
||||
id: string;
|
||||
iracingId: string;
|
||||
name: string;
|
||||
country: string;
|
||||
bio?: string;
|
||||
joinedAt: Date;
|
||||
}): Driver {
|
||||
return new Driver({
|
||||
id: props.id,
|
||||
iracingId: IRacingId.create(props.iracingId),
|
||||
name: DriverName.create(props.name),
|
||||
country: CountryCode.create(props.country),
|
||||
...(props.bio !== undefined ? { bio: DriverBio.create(props.bio) } : {}),
|
||||
joinedAt: JoinedAt.create(props.joinedAt),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a copy with updated properties
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user