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

@@ -92,24 +92,11 @@ export class Money implements IValueObject<MoneyProps> {
}
/**
* Check if this money equals another
*/
equals(other: IValueObject<MoneyProps>): boolean {
const a = this.props;
const b = other.props;
return a.amount === b.amount && a.currency === b.currency;
}
/**
* Format money for display
*/
format(): string {
const formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: this.currency,
minimumFractionDigits: 2,
maximumFractionDigits: 2,
});
return formatter.format(this.amount / 100);
}
* Check if this money equals another
*/
equals(other: IValueObject<MoneyProps>): boolean {
const a = this.props;
const b = other.props;
return a.amount === b.amount && a.currency === b.currency;
}
}