{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.nfh.global/MeterServiceProfile/v1.0",
  "title": "MeterServiceProfile",
  "description": "Tariff, regulatory load, and connection profile for a single meter connection point. Links to a METER resource via meterId. CIM: UsagePoint (IEC 61968-9). Formerly called ConsumptionProfile in ElectricityCredential — that alias is preserved for backward compatibility.",
  "$defs": {
    "MeterServiceProfile": {
      "$anchor": "MeterServiceProfile",
      "type": "object",
      "description": "Tariff and regulatory load profile for one meter connection. meterId matches the id of a METER entry in energyResources[].",
      "required": ["meterId", "sanctionedLoadKw", "tariffCategoryCode"],
      "properties": {
        "meterId": { "type": "string", "minLength": 1, "description": "Matches the id of a METER entry in energyResources[]." },
        "sanctionedLoadKw": { "type": "number", "minimum": 0.5, "maximum": 10000, "description": "Sanctioned/approved import load in kW." },
        "sanctionedExportLoadKw": { "type": "number", "minimum": 0, "description": "Sanctioned/approved grid export limit in kW." },
        "billingCycleDay": { "type": "integer", "minimum": 1, "maximum": 31, "description": "Day of month the billing cycle resets." },
        "contractMaxDemandKw": { "type": "number", "minimum": 0, "description": "Maximum demand contracted with the utility, kW." },
        "tariffCategoryCode": { "type": "string", "minLength": 1, "description": "Billing/tariff category code assigned by the utility." },
        "premisesType": { "type": "string", "enum": ["Residential", "Commercial", "Industrial", "Agricultural"] },
        "connectionType": { "type": "string", "enum": ["Single-phase", "Three-phase"], "description": "Electrical connection type. CIM: UsagePoint.phaseCode." },
        "paymentMode": { "type": "string", "enum": ["POSTPAID", "PREPAID"], "description": "Billing/payment modality. Administrative — placed on the profile not the meter. CIM: ESPI AmiBillingReadyKind." }
      }
    }
  }
}
