Uecko_ERP/modules/customer-invoices/src/api/domain/value-objects/customer-invoice-item-total-price.ts

15 lines
400 B
TypeScript
Raw Normal View History

2025-09-01 14:07:59 +00:00
import { MoneyValue, MoneyValueProps } from "@repo/rdx-ddd";
2025-05-26 10:38:45 +00:00
2025-06-11 15:13:44 +00:00
export class CustomerInvoiceItemTotalPrice extends MoneyValue {
2025-05-26 10:38:45 +00:00
public static DEFAULT_SCALE = 4;
2025-09-01 14:07:59 +00:00
static create({ amount, currency_code, scale }: MoneyValueProps) {
2025-05-26 10:38:45 +00:00
const props = {
amount: Number(amount),
scale: scale ?? MoneyValue.DEFAULT_SCALE,
currency_code,
};
return MoneyValue.create(props);
}
}