fix issues in core

This commit is contained in:
2025-12-23 14:43:49 +01:00
parent 11492d1ff2
commit df5c20c5cc
62 changed files with 480 additions and 334 deletions

View File

@@ -2,13 +2,13 @@
* Enhanced Result entity with detailed incident tracking
*/
import { RacingDomainValidationError } from '../errors/RacingDomainError';
import type { IEntity } from '@core/shared/domain';
import { RacingDomainValidationError } from '../errors/RacingDomainError';
import { RaceIncidents, type IncidentRecord } from '../value-objects/RaceIncidents';
import { RaceId } from './RaceId';
import { DriverId } from './DriverId';
import { Position } from './result/Position';
import { RaceId } from './RaceId';
import { LapTime } from './result/LapTime';
import { Position } from './result/Position';
export class ResultWithIncidents implements IEntity<string> {
readonly id: string;
@@ -66,6 +66,7 @@ export class ResultWithIncidents implements IEntity<string> {
});
}
// TODO WE DONT NEED ANY LEGACY CODE WE ARE NOT EVEN LIVE
/**
* Create from legacy Result data (with incidents as number)
*/

View File

@@ -8,9 +8,9 @@ describe('SponsorshipRequest', () => {
const validProps = {
id: 'request-123',
sponsorId: 'sponsor-456',
entityType: 'driver',
entityType: 'driver' as SponsorableEntityType,
entityId: 'driver-789',
tier: 'main',
tier: 'main' as SponsorshipTier,
offeredAmount: validMoney,
};

View File

@@ -1,6 +1,6 @@
import { describe, it, expect } from 'vitest';
import { LeagueWallet } from './LeagueWallet';
import { Money } from '../value-objects/Money';
import { Money } from '../../value-objects/Money';
describe('LeagueWallet', () => {
it('should create a league wallet', () => {

View File

@@ -11,7 +11,7 @@ import type { Money } from '../../value-objects/Money';
import { Position } from '../championship/Position';
import { PrizeId } from './PrizeId';
import { PrizeStatus } from './PrizeStatus';
import { SeasonId } from '../SeasonId';
import { SeasonId } from '../season/SeasonId';
import { DriverId } from '../DriverId';
export interface PrizeProps {

View File

@@ -78,9 +78,9 @@ export class Sponsor implements IEntity<SponsorId> {
id: this.id,
name,
contactEmail,
logoUrl,
websiteUrl,
createdAt: this.createdAt,
...(logoUrl !== undefined ? { logoUrl } : {}),
...(websiteUrl !== undefined ? { websiteUrl } : {}),
});
}
}