{
  "name": "On-Tap ROI Calculator",
  "description": "ROI calculator for nitro cold brew, kombucha, nitro tea, and sparkling water or soda on tap, aimed at U.S. cafe and restaurant owners.",
  "version": "1.0.0",
  "currency": "USD",
  "units": {
    "volume": "US gallon",
    "serving": "US fl oz",
    "time": "calendar year 365.25 days"
  },
  "formulas": {
    "theoreticalServingsPerKeg": "kegGallons * 128 / servingSizeOz",
    "usableServingsPerKeg": "theoreticalServingsPerKeg * (1 - wastePercent / 100)",
    "productCostPerKeg": "costMode === 'per-gallon' ? costPerGallon * kegGallons : costPerKeg",
    "productCostPerServing": "productCostPerKeg / usableServingsPerKeg",
    "servingsPerMonth": "servingsPerDay * daysOpenPerWeek * (365.25 / 7) / 12",
    "cleansPerMonth": "(365.25 / causticEveryDays) / 12",
    "cleaningCostPerMonth": "cleaningCostMode === 'monthly' ? cleaningCostPerMonth : cleaningCostPerClean * cleansPerMonth",
    "gasCostPerServing": "gasCostPerMonth / servingsPerMonth",
    "cleaningCostPerServing": "cleaningCostPerMonth / servingsPerMonth",
    "costPerServing": "productCostPerServing + gasCostPerServing + cleaningCostPerServing",
    "grossMarginPct": "(pricePerServing - costPerServing) / pricePerServing * 100",
    "monthlyRevenue": "servingsPerMonth * pricePerServing",
    "monthlyProductCost": "servingsPerMonth * productCostPerServing",
    "monthlyCosts": "monthlyProductCost + gasCostPerMonth + cleaningCostPerMonth",
    "monthlyProfit": "monthlyRevenue - monthlyCosts",
    "capex": "kegeratorCost + faucetCost + regulatorCost + gasSystemCost",
    "paybackMonths": "capex / monthlyProfit  (null if monthlyProfit <= 0)",
    "paybackWeeks": "paybackMonths * (365.25 / 7 / 12)"
  },
  "constants": {
    "ozPerGallon": 128,
    "weeksPerYear": 52.17857142857143,
    "weeksPerMonth": 4.348214285714286
  },
  "kegSizes": [
    {
      "id": "corny-5",
      "gallons": 5,
      "label": "Cornelius keg (5 gal)"
    },
    {
      "id": "sixtel",
      "gallons": 5.16,
      "label": "Sixth barrel / sixtel (5.16 gal)"
    },
    {
      "id": "quarter",
      "gallons": 7.75,
      "label": "Quarter barrel (7.75 gal)"
    },
    {
      "id": "half",
      "gallons": 15.5,
      "label": "Half barrel (15.5 gal)"
    },
    {
      "id": "custom",
      "gallons": null,
      "label": "Custom volume"
    }
  ],
  "gasSystems": {
    "n2-tank": {
      "id": "n2-tank",
      "label": "Nitrogen (N₂) tank",
      "kind": "tank",
      "typicalCapex": 189,
      "typicalMonthly": 25
    },
    "co2-tank": {
      "id": "co2-tank",
      "label": "CO₂ tank",
      "kind": "tank",
      "typicalCapex": 150,
      "typicalMonthly": 20
    },
    "beer-gas": {
      "id": "beer-gas",
      "label": "Beer gas (N₂/CO₂ blend) tank",
      "kind": "tank",
      "typicalCapex": 189,
      "typicalMonthly": 28
    },
    "n2-generator": {
      "id": "n2-generator",
      "label": "Nitrogen generator",
      "kind": "generator",
      "typicalCapex": 2499,
      "typicalMonthly": 12
    }
  },
  "drinkTypes": {
    "nitro-cold-brew": {
      "label": "Nitro cold brew",
      "suggestedGas": "n2-tank",
      "suggestedFaucet": "stout",
      "defaults": {
        "costMode": "per-keg",
        "kegSizeId": "sixtel",
        "kegGallons": 5.16,
        "daysOpenPerWeek": 7,
        "kegeratorCost": 1299,
        "faucetCost": 129,
        "regulatorCost": 99,
        "gasSystemCost": 189,
        "gasCostPerMonth": 25,
        "cleaningCostPerClean": 18,
        "cleaningCostMode": "per-clean",
        "drinkType": "nitro-cold-brew",
        "wastePercent": 8,
        "servingSizeOz": 8,
        "pricePerServing": 5.5,
        "costPerKeg": 90,
        "costPerGallon": 12,
        "servingsPerDay": 20,
        "gasSystem": "n2-tank"
      },
      "cleaning": {
        "causticEveryDays": 7,
        "acidEveryDays": 30,
        "faucetService": "every-clean",
        "nitroFaucetTeardown": true,
        "headline": "Weekly caustic cleaning, monthly acid cleaning"
      }
    },
    "kombucha": {
      "label": "Kombucha",
      "suggestedGas": "co2-tank",
      "suggestedFaucet": "standard",
      "defaults": {
        "costMode": "per-keg",
        "kegSizeId": "sixtel",
        "kegGallons": 5.16,
        "daysOpenPerWeek": 7,
        "kegeratorCost": 1299,
        "faucetCost": 89,
        "regulatorCost": 99,
        "gasSystemCost": 150,
        "gasCostPerMonth": 20,
        "cleaningCostPerClean": 18,
        "cleaningCostMode": "per-clean",
        "drinkType": "kombucha",
        "wastePercent": 5,
        "servingSizeOz": 12,
        "pricePerServing": 5,
        "costPerKeg": 85,
        "costPerGallon": 10,
        "servingsPerDay": 18,
        "gasSystem": "co2-tank"
      },
      "cleaning": {
        "causticEveryDays": 7,
        "acidEveryDays": 30,
        "faucetService": "every-clean",
        "nitroFaucetTeardown": false,
        "headline": "Weekly caustic cleaning (conservative cafe schedule)"
      }
    },
    "nitro-tea": {
      "label": "Nitro tea",
      "suggestedGas": "n2-tank",
      "suggestedFaucet": "stout",
      "defaults": {
        "costMode": "per-keg",
        "kegSizeId": "sixtel",
        "kegGallons": 5.16,
        "daysOpenPerWeek": 7,
        "kegeratorCost": 1299,
        "faucetCost": 129,
        "regulatorCost": 99,
        "gasSystemCost": 189,
        "gasCostPerMonth": 25,
        "cleaningCostPerClean": 18,
        "cleaningCostMode": "per-clean",
        "drinkType": "nitro-tea",
        "wastePercent": 8,
        "servingSizeOz": 10,
        "pricePerServing": 5,
        "costPerKeg": 80,
        "costPerGallon": 9,
        "servingsPerDay": 16,
        "gasSystem": "n2-tank"
      },
      "cleaning": {
        "causticEveryDays": 7,
        "acidEveryDays": 30,
        "faucetService": "every-clean",
        "nitroFaucetTeardown": true,
        "headline": "Weekly caustic cleaning, monthly acid cleaning"
      }
    },
    "sparkling": {
      "label": "Sparkling water / soda",
      "suggestedGas": "co2-tank",
      "suggestedFaucet": "standard",
      "defaults": {
        "costMode": "per-keg",
        "kegSizeId": "sixtel",
        "kegGallons": 5.16,
        "daysOpenPerWeek": 7,
        "kegeratorCost": 1299,
        "faucetCost": 89,
        "regulatorCost": 99,
        "gasSystemCost": 150,
        "gasCostPerMonth": 20,
        "cleaningCostPerClean": 18,
        "cleaningCostMode": "per-clean",
        "drinkType": "sparkling",
        "wastePercent": 3,
        "servingSizeOz": 12,
        "pricePerServing": 3,
        "costPerKeg": 40,
        "costPerGallon": 2.5,
        "servingsPerDay": 25,
        "gasSystem": "co2-tank"
      },
      "cleaning": {
        "causticEveryDays": 14,
        "acidEveryDays": 90,
        "faucetService": "every-clean",
        "nitroFaucetTeardown": false,
        "headline": "Every 14 days caustic; quarterly acid (weekly if sweetened)"
      }
    }
  },
  "api": {
    "calculate": "GET or POST /api/nitro/roi (Netlify function). Omitted params use defaults for the given drinkType.",
    "formulas": "GET /nitro/formulas.json",
    "llms": "GET /nitro/llms.txt"
  },
  "parameters": [
    {
      "name": "drinkType",
      "type": "enum",
      "values": [
        "nitro-cold-brew",
        "kombucha",
        "nitro-tea",
        "sparkling"
      ]
    },
    {
      "name": "kegeratorCost",
      "type": "number",
      "unit": "USD"
    },
    {
      "name": "faucetCost",
      "type": "number",
      "unit": "USD"
    },
    {
      "name": "regulatorCost",
      "type": "number",
      "unit": "USD"
    },
    {
      "name": "gasSystem",
      "type": "enum",
      "values": [
        "n2-tank",
        "co2-tank",
        "beer-gas",
        "n2-generator"
      ]
    },
    {
      "name": "gasSystemCost",
      "type": "number",
      "unit": "USD"
    },
    {
      "name": "kegSizeId",
      "type": "enum",
      "values": [
        "corny-5",
        "sixtel",
        "quarter",
        "half",
        "custom"
      ]
    },
    {
      "name": "kegGallons",
      "type": "number",
      "unit": "US gal"
    },
    {
      "name": "costMode",
      "type": "enum",
      "values": [
        "per-keg",
        "per-gallon"
      ]
    },
    {
      "name": "costPerKeg",
      "type": "number",
      "unit": "USD"
    },
    {
      "name": "costPerGallon",
      "type": "number",
      "unit": "USD"
    },
    {
      "name": "servingSizeOz",
      "type": "number",
      "unit": "US fl oz"
    },
    {
      "name": "pricePerServing",
      "type": "number",
      "unit": "USD"
    },
    {
      "name": "servingsPerDay",
      "type": "number"
    },
    {
      "name": "daysOpenPerWeek",
      "type": "number",
      "min": 0,
      "max": 7
    },
    {
      "name": "wastePercent",
      "type": "number",
      "min": 0,
      "max": 90
    },
    {
      "name": "gasCostPerMonth",
      "type": "number",
      "unit": "USD / month"
    },
    {
      "name": "cleaningCostMode",
      "type": "enum",
      "values": [
        "per-clean",
        "monthly"
      ]
    },
    {
      "name": "cleaningCostPerClean",
      "type": "number",
      "unit": "USD"
    },
    {
      "name": "cleaningCostPerMonth",
      "type": "number",
      "unit": "USD / month",
      "optional": true
    },
    {
      "name": "sugarForward",
      "type": "boolean",
      "optional": true,
      "note": "When drinkType is sparkling, tightens cleaning to weekly caustic / monthly acid."
    }
  ]
}
