website refactor
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* Represents a request to join a league.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { JoinedAt } from '../value-objects/JoinedAt';
|
||||
import { LeagueId } from './LeagueId';
|
||||
@@ -18,15 +18,15 @@ export interface JoinRequestProps {
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export class JoinRequest implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class JoinRequest extends Entity<string> {
|
||||
readonly leagueId: LeagueId;
|
||||
readonly driverId: LeagueOwnerId;
|
||||
readonly requestedAt: JoinedAt;
|
||||
readonly message: string | undefined;
|
||||
|
||||
private constructor(props: { id: string; leagueId: string; driverId: string; requestedAt: Date; message?: string }) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.leagueId = LeagueId.create(props.leagueId);
|
||||
this.driverId = LeagueOwnerId.create(props.driverId);
|
||||
this.requestedAt = JoinedAt.create(props.requestedAt);
|
||||
|
||||
Reference in New Issue
Block a user