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-16 20:11:55 +08:00
parent f0589cc478
commit f6c0852da9
10 changed files with 160 additions and 132 deletions
+1
View File
@@ -45,6 +45,7 @@ type BillingSnapshot struct {
EstimatedQuotaBeforeGroup float64 `json:"estimated_quota_before_group"`
EstimatedQuotaAfterGroup int `json:"estimated_quota_after_group"`
EstimatedTier string `json:"estimated_tier"`
QuotaPerUnit float64 `json:"quota_per_unit"`
}
// TieredResult holds everything needed after running tiered settlement.