website refactor
This commit is contained in:
@@ -4,14 +4,14 @@
|
||||
* Represents a driver's membership in a league.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain';
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { LeagueId } from './LeagueId';
|
||||
import { MembershipRole, MembershipRoleValue } from './MembershipRole';
|
||||
import { MembershipStatus, MembershipStatusValue } from './MembershipStatus';
|
||||
import { JoinedAt } from '../value-objects/JoinedAt';
|
||||
import { DriverId } from './DriverId';
|
||||
import { JoinRequest } from './JoinRequest';
|
||||
import { LeagueId } from './LeagueId';
|
||||
import { MembershipRole, MembershipRoleValue } from './MembershipRole';
|
||||
import { MembershipStatus, MembershipStatusValue } from './MembershipStatus';
|
||||
|
||||
export interface LeagueMembershipProps {
|
||||
id?: string;
|
||||
@@ -101,6 +101,13 @@ export class LeagueMembership implements Entity<string> {
|
||||
throw new RacingDomainValidationError('Membership role is required');
|
||||
}
|
||||
}
|
||||
|
||||
equals(other: Entity<string>): boolean {
|
||||
if (!(other instanceof LeagueMembership)) {
|
||||
return false;
|
||||
}
|
||||
return this.id === other.id;
|
||||
}
|
||||
}
|
||||
|
||||
export { MembershipRole, MembershipStatus, JoinRequest };
|
||||
export { JoinRequest, MembershipRole, MembershipStatus };
|
||||
|
||||
Reference in New Issue
Block a user