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

@@ -70,6 +70,24 @@ export class LeagueMembership implements IEntity<string> {
});
}
static rehydrate(props: {
id: string;
leagueId: string;
driverId: string;
role: MembershipRoleValue;
status: MembershipStatusValue;
joinedAt: Date;
}): LeagueMembership {
return new LeagueMembership({
id: props.id,
leagueId: LeagueId.create(props.leagueId),
driverId: DriverId.create(props.driverId),
role: MembershipRole.create(props.role),
status: MembershipStatus.create(props.status),
joinedAt: JoinedAt.create(props.joinedAt),
});
}
private static validate(props: LeagueMembershipProps): void {
if (!props.leagueId || props.leagueId.trim().length === 0) {
throw new RacingDomainValidationError('League ID is required');