fix issues in core

This commit is contained in:
2025-12-23 15:38:50 +01:00
parent df5c20c5cc
commit 120d3bb1a1
125 changed files with 1005 additions and 793 deletions

View File

@@ -3,11 +3,14 @@
* Represents a monetary amount with currency and platform fee calculation
*/
import { RacingDomainValidationError } from '../errors/RacingDomainError';
import type { IValueObject } from '@core/shared/domain';
import { RacingDomainValidationError } from '../errors/RacingDomainError';
export type Currency = 'USD' | 'EUR' | 'GBP';
export const isCurrency = (value: string): value is Currency =>
value === 'USD' || value === 'EUR' || value === 'GBP';
export interface MoneyProps {
amount: number;
currency: Currency;
@@ -34,6 +37,7 @@ export class Money implements IValueObject<MoneyProps> {
return new Money(amount, currency);
}
// TODO i dont think platform fee must be coupled
/**
* Calculate platform fee (10%)
*/