(prices []resources.PriceEntry, usageQty float64)
| 401 | } |
| 402 | |
| 403 | func renderPricesTableWithUsage(prices []resources.PriceEntry, usageQty float64) string { |
| 404 | // Check if any entry has tiered pricing. |
| 405 | hasTiers := false |
| 406 | for _, p := range prices { |
| 407 | if len(p.Tiers) > 0 { |
| 408 | hasTiers = true |
| 409 | break |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | if hasTiers { |
| 414 | return renderTieredPricesTable(prices, usageQty) |
| 415 | } |
| 416 | return renderFlatPricesTable(prices) |
| 417 | } |
| 418 | |
| 419 | // renderFlatPricesTable renders the standard single-rate pricing table, |
| 420 | // hiding Purchase Option / Term / Upfront columns when all values are empty. |
no test coverage detected