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 { IdentityDomainInvariantError, IdentityDomainValidationError } from '../errors/IdentityDomainError';
|
||||
import { RatingDelta } from '../value-objects/RatingDelta';
|
||||
import { RatingDimensionKey } from '../value-objects/RatingDimensionKey';
|
||||
@@ -34,8 +34,7 @@ export interface RatingEventProps {
|
||||
version: number;
|
||||
}
|
||||
|
||||
export class RatingEvent implements Entity<RatingEventId> {
|
||||
readonly id: RatingEventId;
|
||||
export class RatingEvent extends Entity<RatingEventId> {
|
||||
readonly userId: string;
|
||||
readonly dimension: RatingDimensionKey;
|
||||
readonly delta: RatingDelta;
|
||||
@@ -48,7 +47,8 @@ export class RatingEvent implements Entity<RatingEventId> {
|
||||
readonly version: number;
|
||||
|
||||
private constructor(props: RatingEventProps) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.userId = props.userId;
|
||||
this.dimension = props.dimension;
|
||||
this.delta = props.delta;
|
||||
@@ -118,7 +118,7 @@ export class RatingEvent implements Entity<RatingEventId> {
|
||||
return new RatingEvent(props);
|
||||
}
|
||||
|
||||
equals(other: IEntity<RatingEventId>): boolean {
|
||||
equals(other: Entity<RatingEventId>): boolean {
|
||||
return this.id.equals(other.id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user