fix issues in core
This commit is contained in:
@@ -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%)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user