inmemory to postgres
This commit is contained in:
@@ -49,6 +49,22 @@ export class JoinRequest implements IEntity<string> {
|
||||
});
|
||||
}
|
||||
|
||||
static rehydrate(props: {
|
||||
id: string;
|
||||
leagueId: string;
|
||||
driverId: string;
|
||||
requestedAt: Date;
|
||||
message?: string;
|
||||
}): JoinRequest {
|
||||
return new JoinRequest({
|
||||
id: props.id,
|
||||
leagueId: props.leagueId,
|
||||
driverId: props.driverId,
|
||||
requestedAt: props.requestedAt,
|
||||
...(props.message !== undefined && { message: props.message }),
|
||||
});
|
||||
}
|
||||
|
||||
private static validate(props: JoinRequestProps): void {
|
||||
if (!props.leagueId || props.leagueId.trim().length === 0) {
|
||||
throw new RacingDomainValidationError('League ID is required');
|
||||
|
||||
Reference in New Issue
Block a user