{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/telenor-sverige/json-schema/telenor-sverige-termination-response-schema.json",
  "title": "TerminationResponse",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/telenor-sverige-product-inventory-openapi.yml#/components/schemas/TerminationResponse",
  "type": "object",
  "properties": {
    "requestId": {
      "type": "string",
      "description": "A unique identifier for the request.",
      "format": "uuid"
    },
    "products": {
      "type": "array",
      "description": "The list of products to be terminated.",
      "items": {
        "$ref": "#/$defs/ProductResponse"
      }
    },
    "desiredTerminationDate": {
      "type": "string",
      "description": "A desired date for when the products should be terminated.",
      "format": "date"
    },
    "sendTechnician": {
      "type": "boolean",
      "description": "Indicates if a technician should be sent out to assist with the termination"
    },
    "contactPersons": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ContactPersonRequest"
      }
    },
    "state": {
      "type": "string",
      "description": "The state in which the request is.",
      "enum": [
        "NEW",
        "PARTIALLY_PROCESSED",
        "IN_PROGRESS",
        "CANCELLED",
        "COMPLETED"
      ]
    },
    "createdDate": {
      "type": "string",
      "description": "The date and time that the request was received by the API.",
      "format": "date-time"
    },
    "onBehalfOfOrgNr": {
      "type": "string",
      "description": "The organization number on behalf of which the request was made."
    }
  },
  "$defs": {
    "ContactPersonRequest": {
      "required": [
        "email",
        "firstName",
        "lastName"
      ],
      "type": "object",
      "properties": {
        "firstName": {
          "minLength": 1,
          "type": "string",
          "description": "The first name of the person to be contacted."
        },
        "lastName": {
          "minLength": 1,
          "type": "string",
          "description": "The last name of the person to be contacted."
        },
        "email": {
          "type": "string",
          "description": "The e-mail address of the contact person.",
          "format": "email"
        },
        "phoneNumber": {
          "type": "string",
          "description": "The phone number of the person to be contacted. Phone number should consist only of digits, spaces, dashes with optional leading plus. Will be set from mobile number if missing."
        },
        "mobileNumber": {
          "type": "string",
          "description": "The mobile number of the contact person. Phone number should consist only of digits, spaces, dashes with optional leading plus."
        },
        "type": {
          "type": "string",
          "description": "Represents the type of information the person can provide when contacted.",
          "enum": [
            "GENERAL",
            "TECHNICAL",
            "LOCAL_CONTACT"
          ]
        }
      }
    },
    "ProductResponse": {
      "type": "object",
      "properties": {
        "productId": {
          "type": "string",
          "description": "The installed product ID."
        },
        "luNumber": {
          "type": "string",
          "description": "The LU Number of the CPE."
        },
        "state": {
          "type": "string",
          "description": "The state of the product termination request.",
          "enum": [
            "IN_PROGRESS",
            "COMPLETED",
            "UNKNOWN"
          ]
        },
        "caseId": {
          "type": "string",
          "description": "The ID of the case in Telenor's internal systems."
        }
      },
      "description": "The list of products to be terminated."
    }
  }
}