{
  "schemaVersion": 1,
  "slug": "wedding-budget-calculator",
  "category": "everyday",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "ce6fd3af8c3e38cba1c83d6770a9125048b3717c6219eeaa256b4c90e1c5f7e8",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/wedding-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": "C_i = B × p_i ÷ 100; A = Σ C_i",
    "vars": [
      [
        "B",
        "Total budget"
      ],
      [
        "p_i",
        "Category percentage"
      ],
      [
        "C_i",
        "Category cost"
      ],
      [
        "A",
        "Allocated total"
      ],
      [
        "G",
        "Guests"
      ]
    ],
    "note": "Each category amount = total budget × entered percentage; allocated total is the sum of seven categories. Cost per guest = budget ÷ guest count. Budget difference = allocated total − budget (positive means over-allocated). Amounts are USD."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const venueCost = totalBudget*venuePercent/100; const photoCost = totalBudget*photoPercent/100; const attireCost = totalBudget*attirePercent/100; const flowersCost = totalBudget*flowersPercent/100; const musicCost = totalBudget*musicPercent/100; const otherCost = totalBudget*otherPercent/100; const contingency = totalBudget*contingencyPercent/100; const allocated = venueCost+photoCost+attireCost+flowersCost+musicCost+otherCost+contingency; return { venueCost, photoCost, attireCost, flowersCost, musicCost, otherCost, contingency, perGuest: guests > 0 ? totalBudget/guests : 0, budgetDifference: allocated-totalBudget };",
    "inputs": [
      {
        "name": "totalBudget",
        "type": "number",
        "default": 30000,
        "min": 0,
        "max": 1000000,
        "step": 500
      },
      {
        "name": "guests",
        "type": "number",
        "default": 120,
        "min": 1,
        "max": 2000,
        "step": 5,
        "slider": true
      },
      {
        "name": "venuePercent",
        "type": "number",
        "default": 45,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true,
        "advanced": true
      },
      {
        "name": "photoPercent",
        "type": "number",
        "default": 12,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true,
        "advanced": true
      },
      {
        "name": "attirePercent",
        "type": "number",
        "default": 8,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true,
        "advanced": true
      },
      {
        "name": "flowersPercent",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true,
        "advanced": true
      },
      {
        "name": "musicPercent",
        "type": "number",
        "default": 8,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true,
        "advanced": true
      },
      {
        "name": "otherPercent",
        "type": "number",
        "default": 12,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true,
        "advanced": true
      },
      {
        "name": "contingencyPercent",
        "type": "number",
        "default": 5,
        "min": 0,
        "max": 30,
        "step": 1,
        "slider": true,
        "advanced": true
      }
    ],
    "outputs": [
      {
        "name": "venueCost",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "photoCost",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "attireCost",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "flowersCost",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "musicCost",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "otherCost",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "contingency",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "perGuest",
        "precision": 0,
        "unit": "USD"
      },
      {
        "name": "budgetDifference",
        "precision": 0,
        "unit": "USD"
      }
    ],
    "interpret": null
  }
}
