This commit is contained in:
2025-12-17 01:23:09 +01:00
parent f01e01e50c
commit 4d890863d3
73 changed files with 2632 additions and 3224 deletions

View File

@@ -33,10 +33,6 @@ export class MembershipFee implements IValueObject<MembershipFeeProps> {
throw new RacingDomainValidationError('MembershipFee amount is required');
}
if (amount.amount < 0) {
throw new RacingDomainValidationError('MembershipFee amount cannot be negative');
}
return new MembershipFee({ type, amount });
}
@@ -62,29 +58,15 @@ export class MembershipFee implements IValueObject<MembershipFeeProps> {
}
/**
* Check if this is a recurring fee
*/
isRecurring(): boolean {
return this.type === 'monthly';
}
* Check if this is a recurring fee
*/
isRecurring(): boolean {
return this.type === 'monthly';
}
equals(other: IValueObject<MembershipFeeProps>): boolean {
const a = this.props;
const b = other.props;
return a.type === b.type && a.amount.equals(b.amount);
}
/**
* Get display name for fee type
*/
getDisplayName(): string {
switch (this.type) {
case 'season':
return 'Season Fee';
case 'monthly':
return 'Monthly Subscription';
case 'per_race':
return 'Per-Race Fee';
}
}
equals(other: IValueObject<MembershipFeeProps>): boolean {
const a = this.props;
const b = other.props;
return a.type === b.type && a.amount.equals(b.amount);
}
}