{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/electrical.amps_to_kw/1.4.3/input.json",
  "title": "Amps to kW — input",
  "type": "object",
  "oneOf": [
    {
      "title": "a-kw",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "current_a",
        "voltage_v",
        "system"
      ],
      "properties": {
        "mode": {
          "const": "a-kw",
          "description": "Amps → kW"
        },
        "current_a": {
          "type": "number",
          "minimum": 0,
          "description": "Phase current in amperes"
        },
        "voltage_v": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Voltage (V); RMS for AC; L-L when system=ac_three"
        },
        "system": {
          "type": "string",
          "enum": [
            "dc",
            "ac_single",
            "ac_three"
          ],
          "description": "dc = DC (PF unused); ac_single = single-phase AC; ac_three = balanced three-phase L-L"
        },
        "power_factor": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1,
          "description": "Required for AC. Must be omitted for DC. Legacy REST aliases: a/b, phase, pf."
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "system": {
                "enum": [
                  "ac_single",
                  "ac_three"
                ]
              }
            },
            "required": [
              "system"
            ]
          },
          "then": {
            "required": [
              "power_factor"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "system": {
                "const": "dc"
              }
            },
            "required": [
              "system"
            ]
          },
          "then": {
            "not": {
              "required": [
                "power_factor"
              ]
            }
          }
        }
      ]
    },
    {
      "title": "kw-a",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "power_kw",
        "voltage_v",
        "system"
      ],
      "properties": {
        "mode": {
          "const": "kw-a",
          "description": "kW → Amps"
        },
        "power_kw": {
          "type": "number",
          "minimum": 0,
          "description": "Real power in kilowatts"
        },
        "voltage_v": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Voltage (V); RMS for AC; L-L when system=ac_three"
        },
        "system": {
          "type": "string",
          "enum": [
            "dc",
            "ac_single",
            "ac_three"
          ],
          "description": "dc = DC (PF unused); ac_single = single-phase AC; ac_three = balanced three-phase L-L"
        },
        "power_factor": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1,
          "description": "Required for AC. Must be omitted for DC. Legacy REST aliases: a/b, phase, pf."
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "system": {
                "enum": [
                  "ac_single",
                  "ac_three"
                ]
              }
            },
            "required": [
              "system"
            ]
          },
          "then": {
            "required": [
              "power_factor"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "system": {
                "const": "dc"
              }
            },
            "required": [
              "system"
            ]
          },
          "then": {
            "not": {
              "required": [
                "power_factor"
              ]
            }
          }
        }
      ]
    }
  ],
  "description": "Convert current and voltage to real power in kW (or reverse) for DC, single-phase AC, and balanced three-phase L-L. (calculation_version 1.4.3)"
}
