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