{
  "schemaVersion": 1,
  "slug": "party-rental-cost-calculator",
  "category": "party",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "d6d6cc86444d540ba0db0a6f5dc0e69a399f4330ac21e561b6e4976ed834967f",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/party-rental-cost-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": "S = Σ_j q_j p_j; fees = S f ÷ 100 + D; total = S + fees",
    "vars": [
      [
        "S",
        "Subtotal (tables + chairs + linens)"
      ],
      [
        "f",
        "Service fee percentage"
      ],
      [
        "D",
        "Delivery charge"
      ],
      [
        "q_j,p_j",
        "Rented quantities with their unit prices"
      ]
    ],
    "note": "costPerChair divides the full total (including fees and delivery) by the number of chairs."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const t = tables*tableCost; const c = chairs*chairCost; const l = linens*linenCost; const sub = t + c + l; const fees = sub*feePct/100 + delivery; return { tableTotal: t, chairTotal: c, linenTotal: l, subtotal: sub, fees: fees, total: sub + fees, costPerChair: chairs > 0 ? (sub + fees)/chairs : null };",
    "inputs": [
      {
        "name": "tables",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 500,
        "step": 1,
        "slider": true
      },
      {
        "name": "tableCost",
        "type": "number",
        "default": 12,
        "min": 0,
        "max": 500,
        "step": 0.01
      },
      {
        "name": "chairs",
        "type": "number",
        "default": 80,
        "min": 0,
        "max": 5000,
        "step": 1,
        "slider": true
      },
      {
        "name": "chairCost",
        "type": "number",
        "default": 2.5,
        "min": 0,
        "max": 200,
        "step": 0.01
      },
      {
        "name": "linens",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 500,
        "step": 1,
        "slider": true
      },
      {
        "name": "linenCost",
        "type": "number",
        "default": 15,
        "min": 0,
        "max": 500,
        "step": 0.01
      },
      {
        "name": "delivery",
        "type": "number",
        "default": 120,
        "min": 0,
        "max": 100000,
        "step": 1
      },
      {
        "name": "feePct",
        "type": "number",
        "default": 10,
        "min": 0,
        "max": 50,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "total",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "tableTotal",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "chairTotal",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "linenTotal",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "subtotal",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "fees",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "costPerChair",
        "precision": 2,
        "unit": "$",
        "optional": true
      }
    ],
    "interpret": null
  }
}
