refactor: update billing calculations to use quota per unit

- Adjusted billing calculations in tests and core logic to incorporate a new QuotaPerUnit field.
- Modified estimated quota calculations to reflect changes in tiered billing logic.
- Updated related tests to ensure accuracy with the new quota calculations.
- Enhanced dynamic pricing components to align with updated billing expressions.
This commit is contained in:
CaIon
2026-03-17 16:59:25 +08:00
parent f0589cc478
commit f6c0852da9
10 changed files with 160 additions and 132 deletions
@@ -37,7 +37,7 @@ const { Text } = Typography;
const PRICE_SUFFIX = '$/1M tokens';
function unitCostToPrice(uc) {
return (Number(uc) || 0) * 2;
return Number(uc) || 0;
}
function formatPrice(uc) {
@@ -269,7 +269,7 @@ const PricingCardView = ({
</h3>
<div className='flex flex-col gap-1 text-xs mt-1'>
{priceData.isDynamicPricing ? (
formatDynamicPriceSummary(priceData.billingExpr, t)
formatDynamicPriceSummary(priceData.billingExpr, t, priceData.usedGroupRatio)
) : (
formatPriceInfo(priceData, t, siteDisplayType)
)}