website refactor
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* Immutable entity with factory methods and domain validation.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { CarClass, CarClassType } from './CarClass';
|
||||
import { CarId } from './CarId';
|
||||
@@ -18,8 +18,7 @@ import { Manufacturer } from './Manufacturer';
|
||||
import { Weight } from './Weight';
|
||||
import { Year } from './Year';
|
||||
|
||||
export class Car implements Entity<CarId> {
|
||||
readonly id: CarId;
|
||||
export class Car extends Entity<CarId> {
|
||||
readonly name: CarName;
|
||||
readonly shortName: string;
|
||||
readonly manufacturer: Manufacturer;
|
||||
@@ -44,7 +43,8 @@ export class Car implements Entity<CarId> {
|
||||
imageUrl?: ImageUrl;
|
||||
gameId: GameId;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.name = props.name;
|
||||
this.shortName = props.shortName;
|
||||
this.manufacturer = props.manufacturer;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import { MediaReference } from '@core/domain/media/MediaReference';
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { CountryCode } from '../value-objects/CountryCode';
|
||||
import { DriverBio } from '../value-objects/driver/DriverBio';
|
||||
@@ -14,8 +14,7 @@ import { DriverName } from '../value-objects/driver/DriverName';
|
||||
import { JoinedAt } from '../value-objects/JoinedAt';
|
||||
import { IRacingId } from '../value-objects/RacingId';
|
||||
|
||||
export class Driver implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class Driver extends Entity<string> {
|
||||
readonly iracingId: IRacingId;
|
||||
readonly name: DriverName;
|
||||
readonly country: CountryCode;
|
||||
@@ -34,7 +33,8 @@ export class Driver implements Entity<string> {
|
||||
category?: string;
|
||||
avatarRef: MediaReference;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.iracingId = props.iracingId;
|
||||
this.name = props.name;
|
||||
this.country = props.country;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Includes user-placed decals and league-specific overrides.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { CarId } from '../value-objects/CarId';
|
||||
@@ -28,8 +28,7 @@ export interface DriverLiveryProps {
|
||||
validatedAt: Date | undefined;
|
||||
}
|
||||
|
||||
export class DriverLivery implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class DriverLivery extends Entity<string> {
|
||||
readonly driverId: DriverId;
|
||||
readonly gameId: GameId;
|
||||
readonly carId: CarId;
|
||||
@@ -41,7 +40,8 @@ export class DriverLivery implements Entity<string> {
|
||||
readonly validatedAt: Date | undefined;
|
||||
|
||||
private constructor(props: DriverLiveryProps) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.driverId = props.driverId;
|
||||
this.gameId = props.gameId;
|
||||
this.carId = props.carId;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { GameId } from './GameId';
|
||||
import { GameName } from './GameName';
|
||||
|
||||
export class Game implements Entity<GameId> {
|
||||
readonly id: GameId;
|
||||
export class Game extends Entity<GameId> {
|
||||
readonly name: GameName;
|
||||
|
||||
private constructor(props: { id: GameId; name: GameName }) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.name = props.name;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import { MediaReference } from '@core/domain/media/MediaReference';
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { LeagueVisibility, LeagueVisibilityType } from '../value-objects/LeagueVisibility';
|
||||
import { MaxParticipants } from '../value-objects/MaxParticipants';
|
||||
@@ -91,8 +91,7 @@ export interface LeagueSettings {
|
||||
visibility?: LeagueVisibilityType;
|
||||
}
|
||||
|
||||
export class League implements Entity<LeagueId> {
|
||||
readonly id: LeagueId;
|
||||
export class League extends Entity<LeagueId> {
|
||||
readonly name: LeagueName;
|
||||
readonly description: LeagueDescription;
|
||||
readonly ownerId: LeagueOwnerId;
|
||||
@@ -119,7 +118,8 @@ export class League implements Entity<LeagueId> {
|
||||
visibility: LeagueVisibility;
|
||||
logoRef: MediaReference;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.name = props.name;
|
||||
this.description = props.description;
|
||||
this.ownerId = props.ownerId;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Represents a driver's membership in 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 { DriverId } from './DriverId';
|
||||
@@ -22,8 +22,7 @@ export interface LeagueMembershipProps {
|
||||
joinedAt?: Date;
|
||||
}
|
||||
|
||||
export class LeagueMembership implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class LeagueMembership extends Entity<string> {
|
||||
readonly leagueId: LeagueId;
|
||||
readonly driverId: DriverId;
|
||||
readonly role: MembershipRole;
|
||||
@@ -38,7 +37,8 @@ export class LeagueMembership implements Entity<string> {
|
||||
status: MembershipStatus;
|
||||
joinedAt: JoinedAt;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.leagueId = props.leagueId;
|
||||
this.driverId = props.driverId;
|
||||
this.role = props.role;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Represents the scoring configuration for a league season.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ChampionshipConfig } from '../types/ChampionshipConfig';
|
||||
import { LeagueScoringConfigId } from './LeagueScoringConfigId';
|
||||
@@ -25,8 +25,7 @@ export interface LeagueScoringConfigRehydrateProps {
|
||||
championships: ChampionshipConfig[];
|
||||
}
|
||||
|
||||
export class LeagueScoringConfig implements Entity<LeagueScoringConfigId> {
|
||||
readonly id: LeagueScoringConfigId;
|
||||
export class LeagueScoringConfig extends Entity<LeagueScoringConfigId> {
|
||||
readonly seasonId: SeasonId;
|
||||
readonly scoringPresetId: ScoringPresetId | undefined;
|
||||
readonly championships: ChampionshipConfig[];
|
||||
@@ -37,7 +36,8 @@ export class LeagueScoringConfig implements Entity<LeagueScoringConfigId> {
|
||||
scoringPresetId?: ScoringPresetId;
|
||||
championships: ChampionshipConfig[];
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.seasonId = props.seasonId;
|
||||
this.scoringPresetId = props.scoringPresetId;
|
||||
this.championships = props.championships;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Contains base image and sponsor decal placements.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { CarId } from '../value-objects/CarId';
|
||||
import type { LiveryDecal } from '../value-objects/LiveryDecal';
|
||||
@@ -16,8 +16,7 @@ import { LiveryTemplateId } from './LiveryTemplateId';
|
||||
import { LiveryTemplateUpdatedAt } from './LiveryTemplateUpdatedAt';
|
||||
import { SeasonId } from './season/SeasonId';
|
||||
|
||||
export class LiveryTemplate implements Entity<LiveryTemplateId> {
|
||||
readonly id: LiveryTemplateId;
|
||||
export class LiveryTemplate extends Entity<LiveryTemplateId> {
|
||||
readonly leagueId: LeagueId;
|
||||
readonly seasonId: SeasonId;
|
||||
readonly carId: CarId;
|
||||
@@ -36,7 +35,8 @@ export class LiveryTemplate implements Entity<LiveryTemplateId> {
|
||||
createdAt: LiveryTemplateCreatedAt;
|
||||
updatedAt?: LiveryTemplateUpdatedAt;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.leagueId = props.leagueId;
|
||||
this.seasonId = props.seasonId;
|
||||
this.carId = props.carId;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* - dismissed: Protest was dismissed (no action taken)
|
||||
* - withdrawn: Protesting driver withdrew the protest
|
||||
*/
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { DecisionNotes } from './DecisionNotes';
|
||||
import { DefenseRequestedAt } from './DefenseRequestedAt';
|
||||
@@ -58,8 +58,9 @@ export interface ProtestProps {
|
||||
defenseRequestedBy?: StewardId;
|
||||
}
|
||||
|
||||
export class Protest implements Entity<string> {
|
||||
private constructor(private readonly props: ProtestProps) {}
|
||||
export class Protest extends Entity<string> {
|
||||
private constructor(private readonly props: ProtestProps) {
|
||||
super(props.id);}
|
||||
|
||||
static create(props: {
|
||||
id: string;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Immutable entity with factory methods and domain validation.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { MaxParticipants } from '../value-objects/MaxParticipants';
|
||||
import { ParticipantCount } from '../value-objects/ParticipantCount';
|
||||
@@ -15,8 +15,7 @@ import { StrengthOfField } from '../value-objects/StrengthOfField';
|
||||
|
||||
export type { RaceStatus, RaceStatusValue } from '../value-objects/RaceStatus';
|
||||
|
||||
export class Race implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class Race extends Entity<string> {
|
||||
readonly leagueId: string;
|
||||
readonly scheduledAt: Date;
|
||||
readonly track: string;
|
||||
@@ -60,7 +59,8 @@ export class Race implements Entity<string> {
|
||||
registeredCount?: ParticipantCount;
|
||||
maxParticipants?: MaxParticipants;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.leagueId = props.leagueId;
|
||||
this.scheduledAt = props.scheduledAt;
|
||||
this.track = props.track;
|
||||
|
||||
@@ -5,15 +5,14 @@
|
||||
* Immutable aggregate root with factory methods and domain validation.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { SessionType } from '../value-objects/SessionType';
|
||||
import type { Session } from './Session';
|
||||
|
||||
export type RaceEventStatus = 'scheduled' | 'in_progress' | 'awaiting_stewarding' | 'closed' | 'cancelled';
|
||||
|
||||
export class RaceEvent implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class RaceEvent extends Entity<string> {
|
||||
readonly seasonId: string;
|
||||
readonly leagueId: string;
|
||||
readonly name: string;
|
||||
@@ -30,7 +29,8 @@ export class RaceEvent implements Entity<string> {
|
||||
status: RaceEventStatus;
|
||||
stewardingClosesAt?: Date;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.seasonId = props.seasonId;
|
||||
this.leagueId = props.leagueId;
|
||||
this.name = props.name;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Represents a registration of a driver for a specific race.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { DriverId } from './DriverId';
|
||||
import { RaceId } from './RaceId';
|
||||
@@ -17,9 +17,8 @@ export interface RaceRegistrationProps {
|
||||
registeredAt?: Date;
|
||||
}
|
||||
|
||||
export class RaceRegistration implements Entity<string> {
|
||||
readonly id: string;
|
||||
readonly raceId: RaceId;
|
||||
export class RaceRegistration extends Entity<string> {
|
||||
readonly raceId: RaceId;
|
||||
readonly driverId: DriverId;
|
||||
readonly registeredAt: RegisteredAt;
|
||||
|
||||
@@ -29,7 +28,8 @@ export class RaceRegistration implements Entity<string> {
|
||||
driverId: DriverId;
|
||||
registeredAt: RegisteredAt;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.raceId = props.raceId;
|
||||
this.driverId = props.driverId;
|
||||
this.registeredAt = props.registeredAt;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Enhanced Result entity with detailed incident tracking
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { RaceIncidents, type IncidentRecord } from '../value-objects/RaceIncidents';
|
||||
import { DriverId } from './DriverId';
|
||||
@@ -10,8 +10,7 @@ import { RaceId } from './RaceId';
|
||||
import { LapTime } from './result/LapTime';
|
||||
import { Position } from './result/Position';
|
||||
|
||||
export class ResultWithIncidents implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class ResultWithIncidents extends Entity<string> {
|
||||
readonly raceId: RaceId;
|
||||
readonly driverId: DriverId;
|
||||
readonly position: Position;
|
||||
@@ -28,7 +27,8 @@ export class ResultWithIncidents implements Entity<string> {
|
||||
incidents: RaceIncidents;
|
||||
startPosition: Position;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.raceId = props.raceId;
|
||||
this.driverId = props.driverId;
|
||||
this.position = props.position;
|
||||
|
||||
@@ -5,14 +5,13 @@
|
||||
* Immutable entity with factory methods and domain validation.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { SessionType } from '../value-objects/SessionType';
|
||||
|
||||
export type SessionStatus = 'scheduled' | 'running' | 'completed' | 'cancelled';
|
||||
|
||||
export class Session implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class Session extends Entity<string> {
|
||||
readonly raceEventId: string;
|
||||
readonly scheduledAt: Date;
|
||||
readonly track: string;
|
||||
@@ -39,7 +38,8 @@ export class Session implements Entity<string> {
|
||||
registeredCount?: number;
|
||||
maxParticipants?: number;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.raceEventId = props.raceEventId;
|
||||
this.scheduledAt = props.scheduledAt;
|
||||
this.track = props.track;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* (driver, team, race, or league/season). The entity owner must approve/reject.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
import type { Money } from '../value-objects/Money';
|
||||
@@ -29,8 +29,7 @@ export interface SponsorshipRequestProps {
|
||||
rejectionReason?: string;
|
||||
}
|
||||
|
||||
export class SponsorshipRequest implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class SponsorshipRequest extends Entity<string> {
|
||||
readonly sponsorId: string;
|
||||
readonly entityType: SponsorableEntityType;
|
||||
readonly entityId: string;
|
||||
@@ -44,7 +43,8 @@ export class SponsorshipRequest implements Entity<string> {
|
||||
readonly rejectionReason: string | undefined;
|
||||
|
||||
private constructor(props: SponsorshipRequestProps) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.sponsorId = props.sponsorId;
|
||||
this.entityType = props.entityType;
|
||||
this.entityId = props.entityId;
|
||||
|
||||
@@ -6,15 +6,14 @@
|
||||
*/
|
||||
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { Points } from '../value-objects/Points';
|
||||
import { Position } from './championship/Position';
|
||||
import { DriverId } from './DriverId';
|
||||
import { LeagueId } from './LeagueId';
|
||||
|
||||
export class Standing implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class Standing extends Entity<string> {
|
||||
readonly leagueId: LeagueId;
|
||||
readonly driverId: DriverId;
|
||||
readonly points: Points;
|
||||
@@ -31,7 +30,8 @@ export class Standing implements Entity<string> {
|
||||
position: Position;
|
||||
racesCompleted: number;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.leagueId = props.leagueId;
|
||||
this.driverId = props.driverId;
|
||||
this.points = props.points;
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
* Domain Entity: Team
|
||||
*
|
||||
* Represents a racing team in the GridPilot platform.
|
||||
* Implements the shared IEntity<string> contract and encapsulates
|
||||
* Implements the shared Entity<string> contract and encapsulates
|
||||
* basic invariants around identity and core properties.
|
||||
*/
|
||||
|
||||
import { MediaReference } from '@core/domain/media/MediaReference';
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { TeamCreatedAt } from '../value-objects/TeamCreatedAt';
|
||||
import { TeamDescription } from '../value-objects/TeamDescription';
|
||||
@@ -16,8 +16,7 @@ import { TeamTag } from '../value-objects/TeamTag';
|
||||
import { DriverId } from './DriverId';
|
||||
import { LeagueId } from './LeagueId';
|
||||
|
||||
export class Team implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class Team extends Entity<string> {
|
||||
readonly name: TeamName;
|
||||
readonly tag: TeamTag;
|
||||
readonly description: TeamDescription;
|
||||
@@ -40,7 +39,8 @@ export class Team implements Entity<string> {
|
||||
createdAt: TeamCreatedAt;
|
||||
logoRef: MediaReference;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.name = props.name;
|
||||
this.tag = props.tag;
|
||||
this.description = props.description;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Immutable entity with factory methods and domain validation.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { TrackCountry } from '../value-objects/TrackCountry';
|
||||
import { TrackGameId } from '../value-objects/TrackGameId';
|
||||
@@ -18,8 +18,7 @@ import { TrackTurns } from '../value-objects/TrackTurns';
|
||||
export type TrackCategory = 'oval' | 'road' | 'street' | 'dirt';
|
||||
export type TrackDifficulty = 'beginner' | 'intermediate' | 'advanced' | 'expert';
|
||||
|
||||
export class Track implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class Track extends Entity<string> {
|
||||
readonly name: TrackName;
|
||||
readonly shortName: TrackShortName;
|
||||
readonly country: TrackCountry;
|
||||
@@ -42,7 +41,8 @@ export class Track implements Entity<string> {
|
||||
imageUrl: TrackImageUrl;
|
||||
gameId: TrackGameId;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.name = props.name;
|
||||
this.shortName = props.shortName;
|
||||
this.country = props.country;
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainValidationError } from '../../errors/RacingDomainError';
|
||||
import type { ParticipantRef } from '../../types/ParticipantRef';
|
||||
import { Points } from '../../value-objects/Points';
|
||||
import { Position } from './Position';
|
||||
import { ResultsCount } from './ResultsCount';
|
||||
|
||||
export class ChampionshipStanding implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class ChampionshipStanding extends Entity<string> {
|
||||
readonly seasonId: string;
|
||||
readonly championshipId: string;
|
||||
readonly participant: ParticipantRef;
|
||||
@@ -24,6 +23,7 @@ export class ChampionshipStanding implements Entity<string> {
|
||||
resultsDropped: number;
|
||||
position: number;
|
||||
}) {
|
||||
super(props.id);
|
||||
this.seasonId = props.seasonId;
|
||||
this.championshipId = props.championshipId;
|
||||
this.participant = props.participant;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Aggregate root for managing league finances and transactions.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../../errors/RacingDomainError';
|
||||
|
||||
import type { Money } from '../../value-objects/Money';
|
||||
@@ -21,15 +21,15 @@ export interface LeagueWalletProps {
|
||||
createdAt: Date;
|
||||
}
|
||||
|
||||
export class LeagueWallet implements Entity<LeagueWalletId> {
|
||||
readonly id: LeagueWalletId;
|
||||
export class LeagueWallet extends Entity<LeagueWalletId> {
|
||||
readonly leagueId: LeagueId;
|
||||
readonly balance: Money;
|
||||
readonly transactionIds: TransactionId[];
|
||||
readonly createdAt: Date;
|
||||
|
||||
private constructor(props: LeagueWalletProps) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.leagueId = props.leagueId;
|
||||
this.balance = props.balance;
|
||||
this.transactionIds = props.transactionIds;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../../errors/RacingDomainError';
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import type { Money } from '../../value-objects/Money';
|
||||
import { LeagueWalletId } from './LeagueWalletId';
|
||||
import { TransactionId } from './TransactionId';
|
||||
@@ -34,8 +34,7 @@ export interface TransactionProps {
|
||||
metadata: Record<string, unknown> | undefined;
|
||||
}
|
||||
|
||||
export class Transaction implements Entity<TransactionId> {
|
||||
readonly id: TransactionId;
|
||||
export class Transaction extends Entity<TransactionId> {
|
||||
readonly walletId: LeagueWalletId;
|
||||
readonly type: TransactionType;
|
||||
readonly amount: Money;
|
||||
@@ -48,7 +47,8 @@ export class Transaction implements Entity<TransactionId> {
|
||||
readonly metadata: Record<string, unknown> | undefined;
|
||||
|
||||
private constructor(props: TransactionProps) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.walletId = props.walletId;
|
||||
this.type = props.type;
|
||||
this.amount = props.amount;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Penalties can be applied as a result of an upheld protest or directly by stewards.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../../errors/RacingDomainError';
|
||||
import { AppliedAt } from '../AppliedAt';
|
||||
import { DriverId } from '../DriverId';
|
||||
@@ -60,8 +60,9 @@ export function penaltyTypeRequiresValue(type: PenaltyTypeValue): boolean {
|
||||
return PENALTY_TYPES_REQUIRING_VALUE.includes(type);
|
||||
}
|
||||
|
||||
export class Penalty implements Entity<string> {
|
||||
private constructor(private readonly props: PenaltyProps) {}
|
||||
export class Penalty extends Entity<PenaltyId> {
|
||||
private constructor(private readonly props: PenaltyProps) {
|
||||
super(props.id);}
|
||||
|
||||
static create(props: {
|
||||
id: string;
|
||||
@@ -154,7 +155,6 @@ export class Penalty implements Entity<string> {
|
||||
});
|
||||
}
|
||||
|
||||
get id(): string { return this.props.id.toString(); }
|
||||
get leagueId(): string { return this.props.leagueId.toString(); }
|
||||
get raceId(): string { return this.props.raceId.toString(); }
|
||||
get driverId(): string { return this.props.driverId.toString(); }
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Represents a prize awarded to a driver for a specific position in a season.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../../errors/RacingDomainError';
|
||||
|
||||
import type { Money } from '../../value-objects/Money';
|
||||
@@ -27,8 +27,7 @@ export interface PrizeProps {
|
||||
description: string | undefined;
|
||||
}
|
||||
|
||||
export class Prize implements Entity<PrizeId> {
|
||||
readonly id: PrizeId;
|
||||
export class Prize extends Entity<PrizeId> {
|
||||
readonly seasonId: SeasonId;
|
||||
readonly position: Position;
|
||||
readonly amount: Money;
|
||||
@@ -40,7 +39,8 @@ export class Prize implements Entity<PrizeId> {
|
||||
readonly description: string | undefined;
|
||||
|
||||
private constructor(props: PrizeProps) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.seasonId = props.seasonId;
|
||||
this.position = props.position;
|
||||
this.amount = props.amount;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Immutable entity with factory methods and domain validation.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainValidationError } from '../../errors/RacingDomainError';
|
||||
import { DriverId } from '../DriverId';
|
||||
import { RaceId } from '../RaceId';
|
||||
@@ -13,8 +13,7 @@ import { IncidentCount } from './IncidentCount';
|
||||
import { LapTime } from './LapTime';
|
||||
import { Position } from './Position';
|
||||
|
||||
export class Result implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class Result extends Entity<string> {
|
||||
readonly raceId: RaceId;
|
||||
readonly driverId: DriverId;
|
||||
readonly position: Position;
|
||||
@@ -31,7 +30,8 @@ export class Result implements Entity<string> {
|
||||
incidents: IncidentCount;
|
||||
startPosition: Position;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.raceId = props.raceId;
|
||||
this.driverId = props.driverId;
|
||||
this.position = props.position;
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
} from '@core/racing/domain/errors/RacingDomainError';
|
||||
|
||||
import { SeasonScoringConfig } from '@core/racing/domain/value-objects/SeasonScoringConfig';
|
||||
import {
|
||||
SeasonDropPolicy,
|
||||
} from '@core/racing/domain/value-objects/SeasonDropPolicy';
|
||||
import { SeasonStewardingConfig } from '@core/racing/domain/value-objects/SeasonStewardingConfig';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import {
|
||||
RacingDomainInvariantError,
|
||||
RacingDomainValidationError,
|
||||
@@ -11,8 +11,7 @@ import type { SeasonScoringConfig } from '../../value-objects/SeasonScoringConfi
|
||||
import { SeasonStatus, SeasonStatusValue } from '../../value-objects/SeasonStatus';
|
||||
import type { SeasonStewardingConfig } from '../../value-objects/SeasonStewardingConfig';
|
||||
|
||||
export class Season implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class Season extends Entity<string> {
|
||||
readonly leagueId: string;
|
||||
readonly gameId: string;
|
||||
readonly name: string;
|
||||
@@ -49,7 +48,8 @@ export class Season implements Entity<string> {
|
||||
maxDrivers?: number;
|
||||
participantCount: ParticipantCount;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.leagueId = props.leagueId;
|
||||
this.gameId = props.gameId;
|
||||
this.name = props.name;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Aggregate root for managing sponsorship slots and pricing.
|
||||
*/
|
||||
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { RacingDomainInvariantError, RacingDomainValidationError } from '../../errors/RacingDomainError';
|
||||
|
||||
import type { Money } from '../../value-objects/Money';
|
||||
@@ -32,8 +32,7 @@ export interface SeasonSponsorshipProps {
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export class SeasonSponsorship implements Entity<string> {
|
||||
readonly id: string;
|
||||
export class SeasonSponsorship extends Entity<string> {
|
||||
readonly seasonId: string;
|
||||
readonly leagueId: string | undefined;
|
||||
readonly sponsorId: string;
|
||||
@@ -47,7 +46,8 @@ export class SeasonSponsorship implements Entity<string> {
|
||||
readonly description: string | undefined;
|
||||
|
||||
private constructor(props: SeasonSponsorshipProps) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.seasonId = props.seasonId;
|
||||
this.leagueId = props.leagueId;
|
||||
this.sponsorId = props.sponsorId;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Represents a sponsor that can sponsor leagues/seasons.
|
||||
* Aggregate root for sponsor information.
|
||||
*/
|
||||
import type { Entity } from '@core/shared/domain/Entity';
|
||||
import { Entity } from '@core/shared/domain/Entity';
|
||||
import { SponsorCreatedAt } from './SponsorCreatedAt';
|
||||
import { SponsorEmail } from './SponsorEmail';
|
||||
import { SponsorId } from './SponsorId';
|
||||
@@ -13,8 +13,7 @@ import { Url } from './Url';
|
||||
|
||||
// TODO sponsor is not actually the racing domain in my opinion
|
||||
|
||||
export class Sponsor implements Entity<SponsorId> {
|
||||
readonly id: SponsorId;
|
||||
export class Sponsor extends Entity<SponsorId> {
|
||||
readonly name: SponsorName;
|
||||
readonly contactEmail: SponsorEmail;
|
||||
readonly logoUrl: Url | undefined;
|
||||
@@ -29,7 +28,8 @@ export class Sponsor implements Entity<SponsorId> {
|
||||
websiteUrl?: Url;
|
||||
createdAt: SponsorCreatedAt;
|
||||
}) {
|
||||
this.id = props.id;
|
||||
super(props.id);
|
||||
|
||||
this.name = props.name;
|
||||
this.contactEmail = props.contactEmail;
|
||||
this.logoUrl = props.logoUrl ?? undefined;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { DomainError, CommonDomainErrorKind } from '@core/shared/errors';
|
||||
import type { DomainError } from '@core/shared/errors/DomainError';
|
||||
import type { CommonDomainErrorKind } from '@core/shared/errors/DomainError';
|
||||
|
||||
export abstract class RacingDomainError extends Error implements DomainError<CommonDomainErrorKind> {
|
||||
readonly type = 'domain' as const;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DomainEvent } from '@core/shared/domain';
|
||||
import type { DomainEvent } from '@core/shared/domain/DomainEvent';
|
||||
|
||||
/**
|
||||
* Domain Event: MainRaceCompleted
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DomainEvent } from '@core/shared/domain';
|
||||
import type { DomainEvent } from '@core/shared/domain/DomainEvent';
|
||||
|
||||
/**
|
||||
* Domain Event: RaceEventStewardingClosed
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: ICarRepository
|
||||
* Application Port: CarRepository
|
||||
*
|
||||
* Repository interface for Car entity CRUD operations.
|
||||
* Defines async methods using domain entities as types.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: IDriverRepository
|
||||
* Application Port: DriverRepository
|
||||
*
|
||||
* Repository interface for Driver entity CRUD operations.
|
||||
* Defines async methods using domain entities as types.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: IDriverStatsRepository
|
||||
* Application Port: DriverStatsRepository
|
||||
*
|
||||
* Repository interface for storing and retrieving computed driver statistics.
|
||||
* This is used for caching computed stats and serving frontend data.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: ILeagueMembershipRepository
|
||||
* Application Port: LeagueMembershipRepository
|
||||
*
|
||||
* Repository interface for league membership and join request operations.
|
||||
* This defines the persistence boundary for membership-related domain entities.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: ILeagueRepository
|
||||
* Application Port: LeagueRepository
|
||||
*
|
||||
* Repository interface for League entity CRUD operations.
|
||||
* Defines async methods using domain entities as types.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Repository Interface: ILeagueWalletRepository
|
||||
* Repository Interface: LeagueWalletRepository
|
||||
*
|
||||
* Defines operations for LeagueWallet aggregate persistence
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Repository Interface: ILiveryRepository
|
||||
* Repository Interface: LiveryRepository
|
||||
*
|
||||
* Defines operations for livery-related entities
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: IMediaRepository
|
||||
* Application Port: MediaRepository
|
||||
*
|
||||
* Repository interface for media assets (logos, avatars).
|
||||
* Handles frontend assets like team logos and driver avatars.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Repository Interface: IPenaltyRepository
|
||||
* Repository Interface: PenaltyRepository
|
||||
*
|
||||
* Defines the contract for persisting and retrieving Penalty entities.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Repository Interface: IPrizeRepository
|
||||
* Repository Interface: PrizeRepository
|
||||
*
|
||||
* Defines operations for Prize entity persistence
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Repository Interface: IProtestRepository
|
||||
* Repository Interface: ProtestRepository
|
||||
*
|
||||
* Defines the contract for persisting and retrieving Protest entities.
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: IRaceRegistrationRepository
|
||||
* Application Port: RaceRegistrationRepository
|
||||
*
|
||||
* Repository interface for race registration operations.
|
||||
* This defines the persistence boundary for RaceRegistration entities.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: IRaceRepository
|
||||
* Application Port: RaceRepository
|
||||
*
|
||||
* Repository interface for Race entity CRUD operations.
|
||||
* Defines async methods using domain entities as types.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: IResultRepository
|
||||
* Application Port: ResultRepository
|
||||
*
|
||||
* Repository interface for Result entity CRUD operations.
|
||||
* Defines async methods using domain entities as types.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Repository Interface: ISeasonSponsorshipRepository
|
||||
* Repository Interface: SeasonSponsorshipRepository
|
||||
*
|
||||
* Defines operations for SeasonSponsorship aggregate persistence
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Repository Interface: ISponsorRepository
|
||||
* Repository Interface: SponsorRepository
|
||||
*
|
||||
* Defines operations for Sponsor aggregate persistence
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Repository Interface: ISponsorshipPricingRepository
|
||||
* Repository Interface: SponsorshipPricingRepository
|
||||
*
|
||||
* Stores sponsorship pricing configuration for any sponsorable entity.
|
||||
* This allows drivers, teams, races, and leagues to define their sponsorship slots.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Repository Interface: ISponsorshipRequestRepository
|
||||
* Repository Interface: SponsorshipRequestRepository
|
||||
*
|
||||
* Defines operations for SponsorshipRequest aggregate persistence
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: IStandingRepository
|
||||
* Application Port: StandingRepository
|
||||
*
|
||||
* Repository interface for Standing entity operations.
|
||||
* Includes methods for calculating and retrieving standings.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: ITeamMembershipRepository
|
||||
* Application Port: TeamMembershipRepository
|
||||
*
|
||||
* Repository interface for team membership and join request operations.
|
||||
* This defines the persistence boundary for team membership-related entities.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Repository Interface: ITeamRatingEventRepository
|
||||
* Repository Interface: TeamRatingEventRepository
|
||||
*
|
||||
* Port for persisting and retrieving team rating events (ledger).
|
||||
* Events are immutable and ordered by occurredAt for deterministic snapshot computation.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Repository Interface: ITeamRatingRepository
|
||||
* Repository Interface: TeamRatingRepository
|
||||
*
|
||||
* Port for persisting and retrieving TeamRating snapshots.
|
||||
* Snapshots are derived from rating events for fast reads.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: ITeamRepository
|
||||
* Application Port: TeamRepository
|
||||
*
|
||||
* Repository interface for Team aggregate operations.
|
||||
* This defines the persistence boundary for Team entities.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: ITeamStatsRepository
|
||||
* Application Port: TeamStatsRepository
|
||||
*
|
||||
* Repository interface for storing and retrieving computed team statistics.
|
||||
* This is used for caching computed stats and serving frontend data.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Application Port: ITrackRepository
|
||||
* Application Port: TrackRepository
|
||||
*
|
||||
* Repository interface for Track entity CRUD operations.
|
||||
* Defines async methods using domain entities as types.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Repository Interface: ITransactionRepository
|
||||
* Repository Interface: TransactionRepository
|
||||
*
|
||||
* Defines operations for Transaction entity persistence
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { DropScorePolicy } from '../types/DropScorePolicy';
|
||||
import type { DomainCalculationService } from '@core/shared/domain';
|
||||
import type { DomainCalculationService } from '@core/shared/domain/Service';
|
||||
|
||||
export interface EventPointsEntry {
|
||||
eventId: string;
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { BonusRule } from '../types/BonusRule';
|
||||
import type { ChampionshipType } from '../types/ChampionshipType';
|
||||
|
||||
import type { PointsTable } from '../value-objects/PointsTable';
|
||||
import type { DomainCalculationService } from '@core/shared/domain';
|
||||
import type { DomainCalculationService } from '@core/shared/domain/Service';
|
||||
|
||||
export interface ParticipantEventPoints {
|
||||
participant: ParticipantRef;
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { RecurrenceStrategy } from '../value-objects/RecurrenceStrategy';
|
||||
import { RaceTimeOfDay } from '../value-objects/RaceTimeOfDay';
|
||||
import type { Weekday } from '../types/Weekday';
|
||||
import { weekdayToIndex } from '../types/Weekday';
|
||||
import type { DomainCalculationService } from '@core/shared/domain';
|
||||
import type { DomainCalculationService } from '@core/shared/domain/Service';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
function cloneDate(date: Date): Date {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DomainService } from '@core/shared/domain';
|
||||
import type { DomainService } from '@core/shared/domain/Service';
|
||||
|
||||
export type SkillLevel = 'beginner' | 'intermediate' | 'advanced' | 'pro';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { DomainCalculationService } from '@core/shared/domain';
|
||||
import type { DomainCalculationService } from '@core/shared/domain/Service';
|
||||
|
||||
/**
|
||||
* Domain Service: StrengthOfFieldCalculator
|
||||
@@ -24,7 +24,7 @@ export interface StrengthOfFieldCalculator {
|
||||
* Default implementation using simple average
|
||||
*/
|
||||
export class AverageStrengthOfFieldCalculator
|
||||
implements StrengthOfFieldCalculator, IDomainCalculationService<DriverRating[], number | null>
|
||||
implements StrengthOfFieldCalculator, DomainCalculationService<DriverRating[], number | null>
|
||||
{
|
||||
calculate(driverRatings: DriverRating[]): number | null {
|
||||
if (driverRatings.length === 0) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export class CarId implements ValueObject<string> {
|
||||
private constructor(private readonly value: string) {}
|
||||
@@ -15,7 +15,7 @@ export class CarId implements ValueObject<string> {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
equals(other: IValueObject<string>): boolean {
|
||||
equals(other: ValueObject<string>): boolean {
|
||||
return this.value === other.props;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export interface DecalOverrideProps {
|
||||
leagueId: string;
|
||||
@@ -47,7 +47,7 @@ export class DecalOverride implements ValueObject<DecalOverrideProps> {
|
||||
}
|
||||
}
|
||||
|
||||
equals(other: IValueObject<DecalOverrideProps>): boolean {
|
||||
equals(other: ValueObject<DecalOverrideProps>): boolean {
|
||||
const a = this.props;
|
||||
const b = other.props;
|
||||
return (
|
||||
|
||||
@@ -29,7 +29,7 @@ export class DriverName implements ValueObject<DriverNameProps> {
|
||||
return new DriverName({ value: trimmed });
|
||||
}
|
||||
|
||||
equals(other: IValueObject<DriverNameProps>): boolean {
|
||||
equals(other: ValueObject<DriverNameProps>): boolean {
|
||||
if (!(other instanceof DriverName)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Different sim racing games have different maximum grid sizes.
|
||||
*/
|
||||
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export interface GameConstraintsData {
|
||||
readonly maxDrivers: number;
|
||||
@@ -37,7 +37,7 @@ export class GameConstraints implements ValueObject<GameConstraintsProps> {
|
||||
};
|
||||
}
|
||||
|
||||
equals(other: IValueObject<GameConstraintsProps>): boolean {
|
||||
equals(other: ValueObject<GameConstraintsProps>): boolean {
|
||||
return this.props.gameId === other.props.gameId;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export class ImageUrl implements ValueObject<string> {
|
||||
private constructor(private readonly value: string) {}
|
||||
@@ -21,7 +21,7 @@ export class ImageUrl implements ValueObject<string> {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
equals(other: IValueObject<string>): boolean {
|
||||
equals(other: ValueObject<string>): boolean {
|
||||
return this.props === other.props;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export interface LeagueDescriptionValidationResult {
|
||||
valid: boolean;
|
||||
@@ -94,7 +94,7 @@ export class LeagueDescription implements ValueObject<LeagueDescriptionProps> {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
equals(other: IValueObject<LeagueDescriptionProps>): boolean {
|
||||
equals(other: ValueObject<LeagueDescriptionProps>): boolean {
|
||||
return this.props.value === other.props.value;
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export interface LeagueNameValidationResult {
|
||||
valid: boolean;
|
||||
@@ -107,7 +107,7 @@ export class LeagueName implements ValueObject<LeagueNameProps> {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
equals(other: IValueObject<LeagueNameProps>): boolean {
|
||||
equals(other: ValueObject<LeagueNameProps>): boolean {
|
||||
return this.props.value === other.props.value;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export interface LeagueTimezoneProps {
|
||||
id: string;
|
||||
@@ -27,7 +27,7 @@ export class LeagueTimezone implements ValueObject<LeagueTimezoneProps> {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
equals(other: IValueObject<LeagueTimezoneProps>): boolean {
|
||||
equals(other: ValueObject<LeagueTimezoneProps>): boolean {
|
||||
return this.props.id === other.props.id;
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
* This is a hardened version that enforces strict business rules.
|
||||
*/
|
||||
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
export type LeagueVisibilityType = 'ranked' | 'unranked';
|
||||
@@ -157,7 +157,7 @@ export class LeagueVisibility implements ValueObject<LeagueVisibilityProps> {
|
||||
return { type: this.type };
|
||||
}
|
||||
|
||||
equals(other: IValueObject<LeagueVisibilityProps>): boolean {
|
||||
equals(other: ValueObject<LeagueVisibilityProps>): boolean {
|
||||
return this.props.type === other.props.type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export type DecalType = 'sponsor' | 'user';
|
||||
|
||||
@@ -165,7 +165,7 @@ export class LiveryDecal implements ValueObject<LiveryDecalProps> {
|
||||
);
|
||||
}
|
||||
|
||||
equals(other: IValueObject<LiveryDecalProps>): boolean {
|
||||
equals(other: ValueObject<LiveryDecalProps>): boolean {
|
||||
const a = this.props;
|
||||
const b = other.props;
|
||||
return (
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Enforces reasonable limits and constraints.
|
||||
*/
|
||||
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
export interface MaxParticipantsProps {
|
||||
@@ -83,7 +83,7 @@ export class MaxParticipants implements ValueObject<MaxParticipantsProps> {
|
||||
return { value: this.value };
|
||||
}
|
||||
|
||||
equals(other: IValueObject<MaxParticipantsProps>): boolean {
|
||||
equals(other: ValueObject<MaxParticipantsProps>): boolean {
|
||||
return this.value === other.props.value;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
import type { Money } from './Money';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export type MembershipFeeType = 'season' | 'monthly' | 'per_race';
|
||||
|
||||
@@ -64,7 +64,7 @@ export class MembershipFee implements ValueObject<MembershipFeeProps> {
|
||||
return this.type === 'monthly';
|
||||
}
|
||||
|
||||
equals(other: IValueObject<MembershipFeeProps>): boolean {
|
||||
equals(other: ValueObject<MembershipFeeProps>): boolean {
|
||||
const a = this.props;
|
||||
const b = other.props;
|
||||
return a.type === b.type && a.amount.equals(b.amount);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Represents a monetary amount with currency and platform fee calculation
|
||||
*/
|
||||
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
export type Currency = 'USD' | 'EUR' | 'GBP';
|
||||
@@ -102,7 +102,7 @@ export class Money implements ValueObject<MoneyProps> {
|
||||
/**
|
||||
* Check if this money equals another
|
||||
*/
|
||||
equals(other: IValueObject<MoneyProps>): boolean {
|
||||
equals(other: ValueObject<MoneyProps>): boolean {
|
||||
const a = this.props;
|
||||
const b = other.props;
|
||||
return a.amount === b.amount && a.currency === b.currency;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import { ALL_WEEKDAYS } from '../types/Weekday';
|
||||
import type { Weekday } from '../types/Weekday';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export interface MonthlyRecurrencePatternProps {
|
||||
ordinal: 1 | 2 | 3 | 4;
|
||||
@@ -57,7 +57,7 @@ export class MonthlyRecurrencePattern implements ValueObject<MonthlyRecurrencePa
|
||||
};
|
||||
}
|
||||
|
||||
equals(other: IValueObject<MonthlyRecurrencePatternProps>): boolean {
|
||||
equals(other: ValueObject<MonthlyRecurrencePatternProps>): boolean {
|
||||
const a = this.props;
|
||||
const b = other.props;
|
||||
return a.ordinal === b.ordinal && a.weekday === b.weekday;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Enforces constraints based on league visibility and other business rules.
|
||||
*/
|
||||
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
export interface ParticipantCountProps {
|
||||
@@ -107,7 +107,7 @@ export class ParticipantCount implements ValueObject<ParticipantCountProps> {
|
||||
return { value: this.value };
|
||||
}
|
||||
|
||||
equals(other: IValueObject<ParticipantCountProps>): boolean {
|
||||
equals(other: ValueObject<ParticipantCountProps>): boolean {
|
||||
return this.value === other.props.value;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
export class Points implements ValueObject<{ value: number }> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export interface PointsTableProps {
|
||||
pointsByPosition: ReadonlyMap<number, number>;
|
||||
@@ -31,7 +31,7 @@ export class PointsTable implements ValueObject<PointsTableProps> {
|
||||
};
|
||||
}
|
||||
|
||||
equals(other: IValueObject<PointsTableProps>): boolean {
|
||||
equals(other: ValueObject<PointsTableProps>): boolean {
|
||||
const a = this.props.pointsByPosition;
|
||||
const b = other.props.pointsByPosition;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
/**
|
||||
* Incident types that can occur during a race
|
||||
@@ -136,7 +136,7 @@ export class RaceIncidents implements ValueObject<IncidentRecord[]> {
|
||||
return typeSummary.length > 0 ? `${total} incidents (${typeSummary})` : `${total} incidents`;
|
||||
}
|
||||
|
||||
equals(other: IValueObject<IncidentRecord[]>): boolean {
|
||||
equals(other: ValueObject<IncidentRecord[]>): boolean {
|
||||
const otherIncidents = other.props;
|
||||
if (this.incidents.length !== otherIncidents.length) {
|
||||
return false;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export interface RaceNameProps {
|
||||
value: string;
|
||||
@@ -32,7 +32,7 @@ export class RaceName implements ValueObject<RaceNameProps> {
|
||||
return this.props.value;
|
||||
}
|
||||
|
||||
public equals(other: IValueObject<RaceNameProps>): boolean {
|
||||
public equals(other: ValueObject<RaceNameProps>): boolean {
|
||||
return this.props.value === other.props.value;
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
* Represents the status of a race with strict lifecycle rules.
|
||||
*/
|
||||
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
export type RaceStatusValue = 'scheduled' | 'running' | 'completed' | 'cancelled';
|
||||
@@ -118,7 +118,7 @@ export class RaceStatus implements ValueObject<RaceStatusProps> {
|
||||
return { value: this.value };
|
||||
}
|
||||
|
||||
equals(other: IValueObject<RaceStatusProps>): boolean {
|
||||
equals(other: ValueObject<RaceStatusProps>): boolean {
|
||||
return this.value === other.props.value;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export interface RaceTimeOfDayProps {
|
||||
hour: number;
|
||||
@@ -47,7 +47,7 @@ export class RaceTimeOfDay implements ValueObject<RaceTimeOfDayProps> {
|
||||
return `${hh}:${mm}`;
|
||||
}
|
||||
|
||||
equals(other: IValueObject<RaceTimeOfDayProps>): boolean {
|
||||
equals(other: ValueObject<RaceTimeOfDayProps>): boolean {
|
||||
const a = this.props;
|
||||
const b = other.props;
|
||||
return a.hour === b.hour && a.minute === b.minute;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
import { WeekdaySet } from './WeekdaySet';
|
||||
import { MonthlyRecurrencePattern } from './MonthlyRecurrencePattern';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
@@ -64,7 +64,7 @@ export class RecurrenceStrategy implements ValueObject<RecurrenceStrategyProps>
|
||||
});
|
||||
}
|
||||
|
||||
equals(other: IValueObject<RecurrenceStrategyProps>): boolean {
|
||||
equals(other: ValueObject<RecurrenceStrategyProps>): boolean {
|
||||
const otherProps = other.props;
|
||||
if (this.strategy.kind !== otherProps.kind) {
|
||||
return false;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { LeagueTimezone } from './LeagueTimezone';
|
||||
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export interface ScheduledRaceSlotProps {
|
||||
roundNumber: number;
|
||||
@@ -35,7 +35,7 @@ export class ScheduledRaceSlot implements ValueObject<ScheduledRaceSlotProps> {
|
||||
};
|
||||
}
|
||||
|
||||
equals(other: IValueObject<ScheduledRaceSlotProps>): boolean {
|
||||
equals(other: ValueObject<ScheduledRaceSlotProps>): boolean {
|
||||
const a = this.props;
|
||||
const b = other.props;
|
||||
return (
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
RacingDomainValidationError,
|
||||
} from '../errors/RacingDomainError';
|
||||
|
||||
import {
|
||||
SeasonDropPolicy,
|
||||
type SeasonDropStrategy,
|
||||
} from './SeasonDropPolicy';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export type SeasonDropStrategy = 'none' | 'bestNResults' | 'dropWorstN';
|
||||
|
||||
@@ -51,7 +51,7 @@ export class SeasonDropPolicy implements ValueObject<SeasonDropPolicyProps> {
|
||||
};
|
||||
}
|
||||
|
||||
equals(other: IValueObject<SeasonDropPolicyProps>): boolean {
|
||||
equals(other: ValueObject<SeasonDropPolicyProps>): boolean {
|
||||
const a = this.props;
|
||||
const b = other.props;
|
||||
return a.strategy === b.strategy && a.n === b.n;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { RaceTimeOfDay } from './RaceTimeOfDay';
|
||||
import { LeagueTimezone } from './LeagueTimezone';
|
||||
import type { RecurrenceStrategy } from './RecurrenceStrategy';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export interface SeasonScheduleProps {
|
||||
startDate: Date;
|
||||
@@ -54,7 +54,7 @@ export class SeasonSchedule implements ValueObject<SeasonScheduleProps> {
|
||||
};
|
||||
}
|
||||
|
||||
equals(other: IValueObject<SeasonScheduleProps>): boolean {
|
||||
equals(other: ValueObject<SeasonScheduleProps>): boolean {
|
||||
const a = this.props;
|
||||
const b = other.props;
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
/**
|
||||
* Value Object: SeasonScoringConfig
|
||||
@@ -55,7 +55,7 @@ export class SeasonScoringConfig
|
||||
};
|
||||
}
|
||||
|
||||
equals(other: IValueObject<SeasonScoringConfigProps>): boolean {
|
||||
equals(other: ValueObject<SeasonScoringConfigProps>): boolean {
|
||||
const a = this.props;
|
||||
const b = other.props;
|
||||
return (
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Represents the status of a season with strict lifecycle rules.
|
||||
*/
|
||||
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
export type SeasonStatusValue = 'planned' | 'active' | 'completed' | 'archived' | 'cancelled';
|
||||
@@ -126,7 +126,7 @@ export class SeasonStatus implements ValueObject<SeasonStatusProps> {
|
||||
return { value: this.value };
|
||||
}
|
||||
|
||||
equals(other: IValueObject<SeasonStatusProps>): boolean {
|
||||
equals(other: ValueObject<SeasonStatusProps>): boolean {
|
||||
return this.value === other.props.value;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
import type { StewardingDecisionMode } from '../entities/League';
|
||||
|
||||
export interface SeasonStewardingConfigProps {
|
||||
@@ -124,7 +124,7 @@ export class SeasonStewardingConfig
|
||||
};
|
||||
}
|
||||
|
||||
equals(other: IValueObject<SeasonStewardingConfigProps>): boolean {
|
||||
equals(other: ValueObject<SeasonStewardingConfigProps>): boolean {
|
||||
const a = this.props;
|
||||
const b = other.props;
|
||||
return (
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Enforces reasonable limits for different session types.
|
||||
*/
|
||||
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
export interface SessionDurationProps {
|
||||
@@ -84,7 +84,7 @@ export class SessionDuration implements ValueObject<SessionDurationProps> {
|
||||
return { value: this.value };
|
||||
}
|
||||
|
||||
equals(other: IValueObject<SessionDurationProps>): boolean {
|
||||
equals(other: ValueObject<SessionDurationProps>): boolean {
|
||||
return this.value === other.props.value;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
/**
|
||||
* Value Object: SessionType
|
||||
@@ -28,7 +28,7 @@ export class SessionType implements ValueObject<SessionTypeValue> {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
equals(other: IValueObject<SessionTypeValue>): boolean {
|
||||
equals(other: ValueObject<SessionTypeValue>): boolean {
|
||||
return this.value === other.props;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
import { Money } from './Money';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export interface SponsorshipSlotConfig {
|
||||
tier: 'main' | 'secondary';
|
||||
@@ -45,7 +45,7 @@ export class SponsorshipPricing implements ValueObject<SponsorshipPricingProps>
|
||||
};
|
||||
}
|
||||
|
||||
equals(other: IValueObject<SponsorshipPricingProps>): boolean {
|
||||
equals(other: ValueObject<SponsorshipPricingProps>): boolean {
|
||||
const a = this.props;
|
||||
const b = other.props;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Enforces valid range and provides domain-specific operations.
|
||||
*/
|
||||
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
export interface StrengthOfFieldProps {
|
||||
@@ -68,7 +68,7 @@ export class StrengthOfField implements ValueObject<StrengthOfFieldProps> {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
equals(other: IValueObject<StrengthOfFieldProps>): boolean {
|
||||
equals(other: ValueObject<StrengthOfFieldProps>): boolean {
|
||||
return this.value === other.props.value;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export class TeamCreatedAt implements ValueObject<Date> {
|
||||
private constructor(private readonly value: Date) {}
|
||||
@@ -20,7 +20,7 @@ export class TeamCreatedAt implements ValueObject<Date> {
|
||||
return new Date(this.value);
|
||||
}
|
||||
|
||||
equals(other: IValueObject<Date>): boolean {
|
||||
equals(other: ValueObject<Date>): boolean {
|
||||
return this.value.getTime() === other.props.getTime();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
|
||||
export class TeamDescription implements ValueObject<string> {
|
||||
private constructor(private readonly value: string) {}
|
||||
@@ -19,7 +19,7 @@ export class TeamDescription implements ValueObject<string> {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
equals(other: IValueObject<string>): boolean {
|
||||
equals(other: ValueObject<string>): boolean {
|
||||
return this.value === other.props;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ValueObject } from '@core/shared/domain';
|
||||
import type { ValueObject } from '@core/shared/domain/ValueObject';
|
||||
import { RacingDomainValidationError } from '../errors/RacingDomainError';
|
||||
|
||||
export interface TeamDrivingReasonCodeProps {
|
||||
@@ -62,7 +62,7 @@ export class TeamDrivingReasonCode implements ValueObject<TeamDrivingReasonCodeP
|
||||
return { value: this.value };
|
||||
}
|
||||
|
||||
equals(other: IValueObject<TeamDrivingReasonCodeProps>): boolean {
|
||||
equals(other: ValueObject<TeamDrivingReasonCodeProps>): boolean {
|
||||
return this.value === other.props.value;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user