{
  "schemaVersion": 1,
  "slug": "hotel-cost-calculator",
  "category": "travel",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "a7b566d2b82ba96d1688e35cdf5725be1cf4ce28425baaf53ff50a6975b52389",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/hotel-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": "T = X + p × n + b × g × n + X × t ÷ 100 ; X = (r + f) × n × Rm",
    "vars": [
      [
        "X",
        "taxable room charges"
      ],
      [
        "n",
        "nights"
      ],
      [
        "p",
        "parking per night"
      ],
      [
        "b",
        "breakfast per person"
      ],
      [
        "g",
        "guests"
      ],
      [
        "t",
        "tax rate (%)"
      ]
    ],
    "note": "Tax applies only to room charges plus resort fees in this model. Parking and breakfast are added without tax; actual treatment depends on property and location."
  },
  "externalEvidence": null,
  "contract": {
    "compute": "const roomTotal = nightlyRate*nights*rooms; const fees = resortFee*nights*rooms; const parking = parkingPerNight*nights; const breakfast = breakfastPerPerson*guests*nights; const taxable = roomTotal+fees; const taxes = taxable*taxRate/100; const total = roomTotal+fees+parking+breakfast+taxes; return { roomTotal, fees, parking, breakfast, taxes, total, perNight: nights > 0 ? total/nights : 0 };",
    "inputs": [
      {
        "name": "nightlyRate",
        "type": "number",
        "default": 180,
        "min": 0,
        "max": 10000,
        "step": 5,
        "slider": true
      },
      {
        "name": "nights",
        "type": "number",
        "default": 5,
        "min": 1,
        "max": 365,
        "step": 1,
        "slider": true
      },
      {
        "name": "rooms",
        "type": "number",
        "default": 1,
        "min": 1,
        "max": 20,
        "step": 1,
        "slider": true
      },
      {
        "name": "taxRate",
        "type": "number",
        "default": 13,
        "min": 0,
        "max": 40,
        "step": 0.5,
        "slider": true
      },
      {
        "name": "resortFee",
        "type": "number",
        "default": 25,
        "min": 0,
        "max": 500,
        "step": 5,
        "slider": true
      },
      {
        "name": "parkingPerNight",
        "type": "number",
        "default": 0,
        "min": 0,
        "max": 200,
        "step": 5,
        "slider": true
      },
      {
        "name": "breakfastPerPerson",
        "type": "number",
        "default": 0,
        "min": 0,
        "max": 100,
        "step": 1,
        "slider": true
      },
      {
        "name": "guests",
        "type": "number",
        "default": 2,
        "min": 1,
        "max": 30,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "total",
        "precision": 2,
        "unit": "USD"
      },
      {
        "name": "perNight",
        "precision": 2,
        "unit": "USD"
      },
      {
        "name": "roomTotal",
        "precision": 2,
        "unit": "USD"
      },
      {
        "name": "fees",
        "precision": 2,
        "unit": "USD"
      },
      {
        "name": "parking",
        "precision": 2,
        "unit": "USD"
      },
      {
        "name": "breakfast",
        "precision": 2,
        "unit": "USD"
      },
      {
        "name": "taxes",
        "precision": 2,
        "unit": "USD"
      }
    ],
    "interpret": null
  }
}
