website refactor
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { Entity, IEntity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { TeamRatingDelta } from '../value-objects/TeamRatingDelta';
|
||||
import { TeamRatingDimensionKey } from '../value-objects/TeamRatingDimensionKey';
|
||||
@@ -32,8 +32,7 @@ export interface TeamRatingEventProps {
|
||||
version: number;
|
||||
}
|
||||
|
||||
export class TeamRatingEvent implements Entity<TeamRatingEventId> {
|
||||
readonly id: TeamRatingEventId;
|
||||
export class TeamRatingEvent extends Entity<TeamRatingEventId> {
|
||||
readonly teamId: string;
|
||||
readonly dimension: TeamRatingDimensionKey;
|
||||
readonly delta: TeamRatingDelta;
|
||||
@@ -46,7 +45,8 @@ export class TeamRatingEvent implements Entity<TeamRatingEventId> {
|
||||
readonly version: number;
|
||||
|
||||
private constructor(props: TeamRatingEventProps) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.teamId = props.teamId;
|
||||
this.dimension = props.dimension;
|
||||
this.delta = props.delta;
|
||||
@@ -156,7 +156,7 @@ export class TeamRatingEvent implements Entity<TeamRatingEventId> {
|
||||
/**
|
||||
* Compare with another event.
|
||||
*/
|
||||
equals(other: IEntity<TeamRatingEventId>): boolean {
|
||||
equals(other: Entity<TeamRatingEventId>): boolean {
|
||||
return this.id.equals(other.id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user