{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beel-es/json-schema/beel-es-company-deactivation-schema.json",
  "title": "CompanyDeactivation",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beel-es-companyactivations-api-openapi.yml#/components/schemas/CompanyDeactivation",
  "type": "object",
  "required": [
    "company_id",
    "environment",
    "already_scheduled"
  ],
  "properties": {
    "company_id": {
      "type": "string",
      "format": "uuid"
    },
    "environment": {
      "$ref": "#/$defs/Environment"
    },
    "effective_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the switch-off takes effect. Absent when immediate (Test, or Live under an enterprise contract). Until then the NIF still invoices and is not released."
    },
    "already_scheduled": {
      "type": "boolean",
      "description": "The switch-off was already pending; the same date is returned."
    }
  },
  "$defs": {
    "Environment": {
      "type": "string",
      "description": "Mode a record lives in — its Test/Live twin. It decides where invoices, customers and\nquota are accounted.\n\nFor a company it also decides which AEAT its NIF is registered against: switching a\ncompany on in `PROD` is what registers it with the real AEAT, so `aeat_environment`\nis that same mode and uses this same enum.\n",
      "enum": [
        "TEST",
        "PROD"
      ]
    }
  }
}