{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/voltplan-app/json-schema/voltplan-app-admin-catalog-save-component-request-schema.json",
  "title": "AdminCatalogSaveComponentRequest",
  "description": "Mirrors `ComponentData` in `src/app/api/admin/save-component/route.ts`. Optional fields accept `null` because the extract response is sent verbatim. Unknown keys are ignored.",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/voltplan-app-openapi.json#/components/schemas/AdminCatalogSaveComponentRequest",
  "type": "object",
  "required": [
    "name",
    "type"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "battery",
        "charger",
        "inverter",
        "transformer",
        "power",
        "load",
        "fuse",
        "shunt",
        "switch",
        "disconnect",
        "tool"
      ]
    },
    "voltage_in": {
      "type": [
        "number",
        "null"
      ]
    },
    "voltage_in_type": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "ac",
        "dc",
        null
      ]
    },
    "voltage_out": {
      "type": [
        "number",
        "null"
      ]
    },
    "voltage_out_type": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "ac",
        "dc",
        null
      ]
    },
    "watt": {
      "type": [
        "number",
        "null"
      ]
    },
    "estd_price_euro": {
      "type": [
        "number",
        "null"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "image": {
      "type": [
        "string",
        "null"
      ]
    },
    "icon": {
      "type": [
        "string",
        "null"
      ],
      "description": "A data URI is uploaded as a PNG file; any other string is stored as-is."
    },
    "duty_cycle": {
      "type": [
        "number",
        "null"
      ]
    },
    "default_utilization_factor": {
      "type": [
        "number",
        "null"
      ]
    },
    "usage_hours_per_day": {
      "type": [
        "number",
        "null"
      ]
    },
    "amperage": {
      "type": [
        "number",
        "null"
      ]
    },
    "cutoff_voltage": {
      "type": [
        "number",
        "null"
      ]
    },
    "fuse_type": {
      "type": [
        "string",
        "null"
      ]
    },
    "wire_gauge": {
      "type": [
        "string",
        "null"
      ]
    },
    "brand": {
      "type": [
        "string",
        "null"
      ],
      "description": "Brand name, matched or created in `component_brands`."
    },
    "affiliate_links": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/AdminCatalogSaveAffiliateLink"
      }
    }
  },
  "$defs": {
    "AdminCatalogSaveAffiliateLink": {
      "type": "object",
      "description": "Other keys (e.g. `isExact`, `title`) are ignored.",
      "required": [
        "url",
        "country"
      ],
      "properties": {
        "url": {
          "type": "string"
        },
        "country": {
          "type": "string"
        }
      }
    }
  }
}