{
  "version": "1.1.0",
  "status": "synthetic",
  "tolerance_absolute": 0.000001,
  "cases": [
    {
      "id": "aluminium-efficiency",
      "function": "aluminium",
      "input": {
        "actualIntensity": 12
      },
      "expected": {
        "price": 42.857142857142854,
        "energy": 514.2857142857143,
        "efficiencyValue": 85.71428571428571,
        "margin": 585.7142857142857
      }
    },
    {
      "id": "profile-cost",
      "function": "profile",
      "input": {},
      "expected": {
        "weightedPrice": 8,
        "cost": 3200,
        "naiveCost": 2400,
        "error": 800,
        "profit": -400,
        "naiveProfit": 400
      }
    },
    {
      "id": "profile-equal-volumes",
      "function": "profile",
      "input": {
        "peakShare": 0.5
      },
      "expected": {
        "error": 0,
        "profit": 400
      }
    },
    {
      "id": "profile-negative-price",
      "function": "profile",
      "input": {
        "low": -2,
        "high": 0,
        "peakShare": 0.5,
        "sell": 0
      },
      "expected": {
        "cost": -400,
        "profit": 400
      }
    },
    {
      "id": "uncertainty-default",
      "function": "uncertainty",
      "input": {},
      "expected": {
        "expanded": 6000,
        "lower": 6000,
        "upper": 18000,
        "payable": 6000,
        "invoice": 48000
      }
    },
    {
      "id": "uncertainty-hold",
      "function": "uncertainty",
      "input": {
        "estimate": 4000
      },
      "expected": {
        "lower": -2000,
        "payable": 0,
        "invoice": 0
      }
    },
    {
      "id": "liquidity-one-month",
      "function": "liquidity",
      "input": {},
      "expected": {
        "additionalFunding": 62000,
        "endBalance": 2880,
        "endReceivable": 94440,
        "restrictedReserve": 30000
      }
    },
    {
      "id": "liquidity-two-months",
      "function": "liquidity",
      "input": {
        "delay": 2
      },
      "expected": {
        "additionalFunding": 124000,
        "endBalance": -91560,
        "endReceivable": 188880
      }
    },
    {
      "id": "liquidity-opening-funds",
      "function": "liquidity",
      "input": {
        "opening": 62000
      },
      "expected": {
        "additionalFunding": 0,
        "endBalance": 64880
      }
    },
    {
      "id": "finance-whole-horizon",
      "function": "finance",
      "input": {},
      "expected": {
        "minDscr": 0.9510970261246938,
        "worstDscrYear": 12,
        "maxAnnualFundingGap": 234247.28574080003
      }
    },
    {
      "id": "finance-no-debt",
      "function": "finance",
      "input": {
        "years": 1,
        "debt": 0,
        "replacement": 0
      },
      "expected": {
        "minDscr": null,
        "worstDscrYear": null,
        "maxAnnualFundingGap": 0
      }
    },
    {
      "id": "composite-client-loss",
      "function": "composite",
      "input": {
        "reduction": -0.1,
        "discount": 0,
        "heatValue": 0,
        "product": 0,
        "flex": 0
      },
      "expected": {
        "modeledClientEffect": -48000,
        "retainedEconomicEffect": -48000,
        "eligible": 0,
        "serviceInvoice": 0,
        "payment": 0,
        "shortfall": 40000,
        "fundingGap": 34000,
        "requiredCollection": null
      }
    },
    {
      "id": "composite-correlated-stress",
      "function": "composite",
      "input": {
        "reduction": 0.05,
        "discount": 0,
        "heatValue": 0,
        "flex": 0,
        "collected": 0.5
      },
      "expected": {
        "serviceInvoice": 22800,
        "received": 11400,
        "fundingGap": 22600,
        "shortfall": 40000
      }
    },
    {
      "id": "composite-no-heat-flex",
      "function": "composite",
      "input": {
        "heatValue": 0,
        "flex": 0
      },
      "expected": {
        "serviceInvoice": 89040,
        "received": 89040,
        "payment": 40000,
        "operator": 15040
      }
    },
    {
      "id": "composite-weak-savings",
      "function": "composite",
      "input": {
        "reduction": 0.05,
        "discount": 0
      },
      "expected": {
        "serviceInvoice": 28200,
        "received": 40200,
        "payment": 6200,
        "shortfall": 33800
      }
    },
    {
      "id": "composite-threshold",
      "function": "composite",
      "input": {
        "collected": 0.6565014824227022
      },
      "expected": {
        "payment": 40000,
        "shortfall": 0,
        "requiredCollection": 0.6565014824227022
      }
    },
    {
      "id": "aluminium-default",
      "function": "aluminium",
      "input": {},
      "expected": {
        "price": 42.857142857142854,
        "energy": 600,
        "margin": 500,
        "supplierMargin": 4.857142857142854
      }
    },
    {
      "id": "aluminium-floor",
      "function": "aluminium",
      "input": {
        "metal": 1000
      },
      "expected": {
        "price": 30,
        "regime": "floor"
      }
    },
    {
      "id": "aluminium-cap",
      "function": "aluminium",
      "input": {
        "metal": 4500
      },
      "expected": {
        "price": 70,
        "regime": "cap"
      }
    },
    {
      "id": "trade-full-cost",
      "function": "trade",
      "input": {},
      "expected": {
        "unitCost": 7.708333333333333,
        "purchased": 41666.666666666664,
        "profit": 25666.666666666668,
        "buyerSaving": 66000
      }
    },
    {
      "id": "savings-decomposition",
      "function": "savings",
      "input": {},
      "expected": {
        "quantity": 96000,
        "price": 38400,
        "total": 134400
      }
    },
    {
      "id": "savings-adjusted",
      "function": "savings",
      "input": {
        "adjustment": 0.1
      },
      "expected": {
        "normalized": 66000,
        "saved": 18000,
        "total": 182400
      }
    },
    {
      "id": "heat-balance",
      "function": "heat",
      "input": {},
      "expected": {
        "cold": 30,
        "hot": 40,
        "used": 25,
        "residual": 46
      }
    },
    {
      "id": "heat-no-demand",
      "function": "heat",
      "input": {
        "demand": 0
      },
      "expected": {
        "used": 0,
        "heatValue": 0,
        "residual": 96
      }
    },
    {
      "id": "battery-reserve",
      "function": "battery",
      "input": {},
      "expected": {
        "delivered": 60,
        "charged": 68.18181818181819,
        "profit": 411.27272727272725
      }
    },
    {
      "id": "battery-full-reserve",
      "function": "battery",
      "input": {
        "reserve": 50
      },
      "expected": {
        "delivered": 0,
        "profit": 0
      }
    },
    {
      "id": "shapley",
      "function": "attribution",
      "input": {},
      "expected": {
        "synergy": 40000,
        "aiShare": 60000,
        "technologyShare": 80000,
        "total": 140000
      }
    },
    {
      "id": "npv-one-year",
      "function": "finance",
      "input": {
        "capital": 95000,
        "gross": 110000,
        "cost": 0,
        "rate": 0.1,
        "years": 1,
        "replacement": 0,
        "debt": 0
      },
      "expected": {
        "npv": 5000,
        "payback": 1,
        "firstDscr": null
      }
    },
    {
      "id": "npv-zero-investment",
      "function": "finance",
      "input": {
        "capital": 0,
        "years": 1
      },
      "expected": {
        "payback": 0
      }
    },
    {
      "id": "composite-default",
      "function": "composite",
      "input": {},
      "expected": {
        "eligible": 157400,
        "customerKeep": 62960,
        "serviceInvoice": 94440,
        "received": 106440,
        "cashBeforeDebt": 72440,
        "payment": 40000,
        "shortfall": 0,
        "operator": 32440
      }
    },
    {
      "id": "composite-delay",
      "function": "composite",
      "input": {
        "collected": 0.5
      },
      "expected": {
        "received": 59220,
        "payment": 25220,
        "shortfall": 14780,
        "receivable": 47220
      }
    },
    {
      "id": "composite-quality-hold",
      "function": "composite",
      "input": {
        "quality": false
      },
      "expected": {
        "serviceInvoice": 0,
        "received": 12000,
        "payment": 0,
        "shortfall": 40000,
        "fundingGap": 22000
      }
    },
    {
      "id": "oracle-ready",
      "function": "oracle",
      "input": {},
      "expected": {
        "state": "settlement_ready",
        "failed": []
      }
    },
    {
      "id": "oracle-duplicate",
      "function": "oracle",
      "input": {
        "unique": false
      },
      "expected": {
        "state": "hold",
        "failed": [
          "unique"
        ]
      }
    }
  ]
}