MCPcopy Index your code
hub / github.com/simstudioai/sim / getIsOnDemandActive

Function getIsOnDemandActive

apps/sim/lib/billing/on-demand.ts:45–54  ·  view source on GitHub ↗
(params: {
  isPaid: boolean
  planIncludedAmount: number
  effectiveUsageLimit: number
  covered: number
})

Source from the content-addressed store, hash-verified

43 * from being misread as on-demand having been switched on.
44 */
45export 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

Callers 2

on-demand.test.tsFile · 0.90
BillingFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected