(params: {
isPaid: boolean
planIncludedAmount: number
effectiveUsageLimit: number
covered: number
})
| 43 | * from being misread as on-demand having been switched on. |
| 44 | */ |
| 45 | export function getIsOnDemandActive(params: { |
| 46 | isPaid: boolean |
| 47 | planIncludedAmount: number |
| 48 | effectiveUsageLimit: number |
| 49 | covered: number |
| 50 | }): boolean { |
| 51 | const { isPaid, planIncludedAmount, effectiveUsageLimit, covered } = params |
| 52 | if (!isPaid || planIncludedAmount <= 0) return false |
| 53 | return effectiveUsageLimit > covered |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * The usage limit to persist when turning on-demand OFF: drop back to the covered |
no outgoing calls
no test coverage detected