{
  "schemaVersion": 1,
  "slug": "party-budget-calculator",
  "category": "party",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "bd034de574a4b57f8f1fe0652f2a708d3acb1b4cf279dc76f933bafc5d57f7b3",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/party-budget-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "T = G (f + d + r) + F0; T_g = T ÷ G; p_v = G (f + d + r) ÷ T × 100",
    "vars": [
      [
        "G",
        "Number of guests"
      ],
      [
        "f",
        "Food cost per guest"
      ],
      [
        "d",
        "Drinks cost per guest"
      ],
      [
        "r",
        "Rental cost per guest"
      ],
      [
        "F0",
        "Fixed costs (decor + venue + entertainment)"
      ],
      [
        "T_g,p_v",
        "Total per guest; variable-cost share (%)"
      ]
    ],
    "note": "All amounts share the chosen currency; the variable percentage is the share of per-guest costs within the total."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const food = guests*foodPerGuest; const drinks = guests*drinksPerGuest; const rentals = guests*rentalsPerGuest; const fixed = decorCost + venueCost + entertainmentCost; const total = food + drinks + rentals + fixed; const variable = food + drinks + rentals; return { foodTotal: food, drinksTotal: drinks, rentalsTotal: rentals, fixedTotal: fixed, total: total, perGuest: guests > 0 ? total/guests : 0, variablePct: total > 0 ? variable/total*100 : null };",
    "inputs": [
      {
        "name": "guests",
        "type": "number",
        "default": 40,
        "min": 1,
        "max": 1000,
        "step": 1,
        "slider": true
      },
      {
        "name": "foodPerGuest",
        "type": "number",
        "default": 18,
        "min": 0,
        "max": 1000,
        "step": 0.01
      },
      {
        "name": "drinksPerGuest",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 1000,
        "step": 0.01
      },
      {
        "name": "rentalsPerGuest",
        "type": "number",
        "default": 4,
        "min": 0,
        "max": 500,
        "step": 0.01
      },
      {
        "name": "decorCost",
        "type": "number",
        "default": 120,
        "min": 0,
        "max": 100000,
        "step": 1
      },
      {
        "name": "venueCost",
        "type": "number",
        "default": 400,
        "min": 0,
        "max": 1000000,
        "step": 1
      },
      {
        "name": "entertainmentCost",
        "type": "number",
        "default": 250,
        "min": 0,
        "max": 1000000,
        "step": 1
      }
    ],
    "outputs": [
      {
        "name": "foodTotal",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "drinksTotal",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "rentalsTotal",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "fixedTotal",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "total",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "perGuest",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "variablePct",
        "precision": 1,
        "unit": "%",
        "optional": true
      }
    ],
    "interpret": null
  }
}
