{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/calculate-co-nz/json-schema/calculate-co-nz-electricity-cost-response-schema.json",
  "title": "ElectricityCostResponse",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/calculate-co-nz-openapi.json#/components/schemas/ElectricityCostResponse",
  "properties": {
    "result": {
      "$ref": "#/$defs/ElectricityCostResult",
      "description": "Cost, by appliance and in total."
    },
    "disclaimer": {
      "type": "string",
      "title": "Disclaimer",
      "description": "Scope and limits of this calculation."
    }
  },
  "type": "object",
  "required": [
    "result",
    "disclaimer"
  ],
  "$defs": {
    "ElectricityApplianceRow": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Appliance."
        },
        "watts": {
          "type": "integer",
          "title": "Watts",
          "description": "Rated power draw."
        },
        "hours_per_day": {
          "type": "number",
          "title": "Hours Per Day",
          "description": "Hours run a day."
        },
        "kwh_per_day": {
          "type": "number",
          "title": "Kwh Per Day",
          "description": "Energy used a day."
        },
        "daily_cost": {
          "type": "number",
          "title": "Daily Cost",
          "description": "What it costs a day at your rate."
        },
        "annual_cost": {
          "type": "number",
          "title": "Annual Cost",
          "description": "What it costs a year."
        }
      },
      "type": "object",
      "required": [
        "name",
        "watts",
        "hours_per_day",
        "kwh_per_day",
        "daily_cost",
        "annual_cost"
      ],
      "title": "ElectricityApplianceRow"
    },
    "ElectricityCostResult": {
      "properties": {
        "region": {
          "type": "string",
          "title": "Region",
          "description": "Region used."
        },
        "rate_cents_per_kwh": {
          "type": "number",
          "title": "Rate Cents Per Kwh",
          "description": "Unit rate applied, including GST."
        },
        "rate_source": {
          "type": "string",
          "title": "Rate Source",
          "description": "Where that rate came from."
        },
        "household_size": {
          "type": "integer",
          "title": "Household Size",
          "description": "People in the household."
        },
        "household_multiplier": {
          "type": "number",
          "title": "Household Multiplier",
          "description": "Scale applied to the appliance profile."
        },
        "daily_kwh_before_multiplier": {
          "type": "number",
          "title": "Daily Kwh Before Multiplier",
          "description": "Raw appliance total."
        },
        "daily_kwh": {
          "type": "number",
          "title": "Daily Kwh",
          "description": "After the household multiplier."
        },
        "daily_usage_cost": {
          "type": "number",
          "title": "Daily Usage Cost",
          "description": "Energy cost a day."
        },
        "daily_fixed_charge": {
          "type": "number",
          "title": "Daily Fixed Charge",
          "description": "The connection charge, kept separate because advice that only addresses usage is aiming at part of the bill."
        },
        "daily_total": {
          "type": "number",
          "title": "Daily Total",
          "description": "Usage plus fixed charge."
        },
        "monthly_total": {
          "type": "number",
          "title": "Monthly Total",
          "description": "Daily total over 30.4 days."
        },
        "annual_total": {
          "type": "number",
          "title": "Annual Total",
          "description": "Daily total over 365 days."
        },
        "annual_kwh": {
          "type": "number",
          "title": "Annual Kwh",
          "description": "Energy used in a year."
        },
        "appliances": {
          "items": {
            "$ref": "#/$defs/ElectricityApplianceRow"
          },
          "type": "array",
          "title": "Appliances",
          "description": "Every appliance with its own cost."
        },
        "biggest_users": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Biggest Users",
          "description": "The three costing the most a year, which is where any saving is."
        },
        "nz_average_rate": {
          "type": "number",
          "title": "Nz Average Rate",
          "description": "MBIE's national figure."
        },
        "annual_at_nz_average": {
          "type": "number",
          "title": "Annual At Nz Average",
          "description": "The same household at the national rate."
        },
        "cheapest_region": {
          "additionalProperties": true,
          "type": "object",
          "title": "Cheapest Region",
          "description": "Cheapest surveyed town and its rate."
        },
        "most_expensive_region": {
          "additionalProperties": true,
          "type": "object",
          "title": "Most Expensive Region",
          "description": "Dearest surveyed town and its rate."
        },
        "regions_compared": {
          "type": "integer",
          "title": "Regions Compared",
          "description": "How many real towns the comparison covered. MBIE national average is excluded, since it is a figure rather than a place."
        },
        "saving_against_most_expensive": {
          "type": "number",
          "title": "Saving Against Most Expensive",
          "description": "Annual difference against the dearest town."
        },
        "note": {
          "type": "string",
          "title": "Note",
          "description": "What the fixed charge means for a low user."
        }
      },
      "type": "object",
      "required": [
        "region",
        "rate_cents_per_kwh",
        "rate_source",
        "household_size",
        "household_multiplier",
        "daily_kwh_before_multiplier",
        "daily_kwh",
        "daily_usage_cost",
        "daily_fixed_charge",
        "daily_total",
        "monthly_total",
        "annual_total",
        "annual_kwh",
        "appliances",
        "biggest_users",
        "nz_average_rate",
        "annual_at_nz_average",
        "cheapest_region",
        "most_expensive_region",
        "regions_compared",
        "saving_against_most_expensive",
        "note"
      ],
      "title": "ElectricityCostResult"
    }
  }
}