{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arcnm-io/json-schema/arcnm-io-calibration-import-created-schema.json",
  "title": "CalibrationImportCreated",
  "description": "The import + its cost disclosure, before anything is spent.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arcnm-io-calibration-api-openapi.yml#/components/schemas/CalibrationImportCreated",
  "properties": {
    "import_id": {
      "type": "string",
      "title": "Import Id",
      "description": "Identifier of the created import."
    },
    "env_id": {
      "type": "string",
      "title": "Env Id",
      "description": "The environment this import calibrates."
    },
    "status": {
      "type": "string",
      "title": "Status",
      "description": "Import lifecycle status."
    },
    "created": {
      "type": "boolean",
      "title": "Created",
      "description": "False when these exact rows were already imported into this environment — the existing import is returned instead of a duplicate."
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Message",
      "description": "The cost disclosure, in plain language."
    },
    "rows_received": {
      "type": "integer",
      "title": "Rows Received",
      "description": "Rows submitted."
    },
    "rows_usable": {
      "type": "integer",
      "title": "Rows Usable",
      "description": "Rows that can become calibration observations."
    },
    "calculations_required": {
      "type": "integer",
      "title": "Calculations Required",
      "description": "Distinct (part, lot) pairs that need a NEW calculation — the billable spend POST /price will commit. Nothing is priced by this call."
    },
    "calculations_free": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Calculations Free",
      "description": "Rows already priced (or servable from cache) — free."
    },
    "calculations_remaining": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Calculations Remaining",
      "description": "Your plan's remaining calculation allowance, when known."
    },
    "unresolved_part_numbers": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Unresolved Part Numbers",
      "description": "Part numbers not in your library — add the parts."
    },
    "parts_without_cad": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Parts Without Cad",
      "description": "Parts with no STEP file to calculate from — upload one."
    },
    "distinct_lot_sizes": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Distinct Lot Sizes",
      "description": "Distinct lot sizes across usable rows. Below two the fit cannot split setup cost from per-part cost."
    }
  },
  "type": "object",
  "required": [
    "import_id",
    "env_id",
    "status",
    "created",
    "rows_received",
    "rows_usable",
    "calculations_required"
  ]
}