chore: added formatUtils and moved getIntervalStr and formatAmount to it
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import type { FullCusEntWithFullCusProduct } from "../../../models/cusProductModels/cusEntModels/cusEntWithProduct";
|
||||
import {
|
||||
cusEntToCusPrice,
|
||||
entToOptions,
|
||||
} from "../../productUtils/convertUtils";
|
||||
import { getStartingBalance } from "../getStartingBalance";
|
||||
|
||||
export const cusEntToStartingBalance = ({
|
||||
cusEnt,
|
||||
}: {
|
||||
cusEnt: FullCusEntWithFullCusProduct;
|
||||
}) => {
|
||||
const cusPrice = cusEntToCusPrice({ cusEnt });
|
||||
const price = cusPrice?.price;
|
||||
const options = entToOptions({
|
||||
ent: cusEnt.entitlement,
|
||||
options: cusEnt.customer_product.options,
|
||||
});
|
||||
|
||||
return getStartingBalance({
|
||||
entitlement: cusEnt.entitlement,
|
||||
options,
|
||||
relatedPrice: price,
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user