{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.nfh.global/EnergyResourceEVCharger/v1.1",
  "title": "EnergyResourceEVCharger",
  "description": "Typed schema for EV charging station energy resources (EV_CHARGER, EV_V2G). v1.1: inherits EnergyResourceCommon/v1.1 (ratedPower, maxExport, maxImport as QuantitativeValue). CIM: ElectricVehicleChargingStation (CIM17+).",
  "allOf": [
    { "$ref": "https://schema.nfh.global/EnergyResourceCommon/v1.1#EnergyResourceCommon" },
    {
      "type": "object",
      "required": ["id", "type"],
      "properties": {
        "type": {
          "type": "string",
          "enum": ["EV_CHARGER", "EV_V2G"],
          "description": "Asset-class discriminator. EV_CHARGER: EVSE hardware. EV_V2G: Vehicle-to-Grid capable EVSE with ISO 15118-20 / OCPP 2.1 BPT support."
        },
        "attributes": { "$ref": "#/$defs/EnergyResourceEVChargerAttributes" }
      }
    }
  ],
  "$defs": {
    "EnergyResourceEVChargerAttributes": {
      "allOf": [
        { "$ref": "https://schema.nfh.global/EnergyResourceCommon/v1.1#EnergyResourceCommonAttributes" },
        {
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "connectorType": {
              "type": "string",
              "enum": ["Type1", "Type2", "CCS1", "CCS2", "CHAdeMO", "GB_T", "NACS", "Other"],
              "description": "Physical connector standard per IEC 62196-2 / SAE J3400."
            },
            "controlProtocol": {
              "type": "string",
              "enum": ["OCPP_1.6", "OCPP_2.0.1", "OCPP_2.1", "ISO_15118_2", "ISO_15118_20", "Other"],
              "description": "EVSE control and smart-charging protocol."
            },
            "v2xProtocol": {
              "type": "string",
              "enum": ["CHAdeMO_V2G", "CCS_BPT", "ISO_15118_20_AC_BPT", "ISO_15118_20_DC_BPT", "Other"],
              "description": "Vehicle-to-Grid / V2X protocol. Present only for EV_V2G resources."
            }
          }
        }
      ]
    }
  }
}
