{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/telenor-sverige/json-schema/telenor-sverige-lan-quote-request-schema.json",
  "title": "LanQuoteRequest",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/telenor-sverige-fixed-network-quotation-openapi.yml#/components/schemas/LanQuoteRequest",
  "type": "object",
  "required": [
    "bindingTime",
    "productOfferingId"
  ],
  "properties": {
    "contactMedium": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ContactMedium"
      }
    },
    "notes": {
      "$ref": "#/$defs/Notes",
      "type": "object",
      "description": "Notes regarding the site"
    },
    "externalId": {
      "type": "string",
      "description": "An external id created and owned by the client"
    },
    "quoteId": {
      "type": "string",
      "readOnly": true,
      "description": "The id for the quotation"
    },
    "relatedQuoteUrl": {
      "type": "string",
      "description": "A url to another existing quote. This field is used by clients to indicate that this quote is related (or connected) to another quote item"
    },
    "appId": {
      "type": "string",
      "readOnly": true
    },
    "creationDate": {
      "$ref": "#/$defs/LocalDate",
      "type": "string",
      "readOnly": true
    },
    "opportunityId": {
      "type": "string",
      "readOnly": true,
      "description": "An internal opportunity id, will be set by Telenor"
    },
    "quoteType": {
      "$ref": "#/$defs/OpportunityAction",
      "type": "string",
      "readOnly": true
    },
    "bindingTime": {
      "type": "integer",
      "format": "int32",
      "description": "The binding time (in months) for the services in the quotation",
      "maximum": 60,
      "minimum": 0
    },
    "expectedDeliveryDate": {
      "$ref": "#/$defs/LocalDate",
      "type": "string",
      "description": "Expected installation date for the service"
    },
    "onBehalfOfOrgNr": {
      "type": "string",
      "readOnly": true,
      "description": "Contains organizational number if the request was behalf of another party, e.g. via Mitt Foretag"
    },
    "replacesInstalledProductId": {
      "type": "string",
      "description": "The ID of the installed product that the product in this request replaces. Required for (and only applicable to) migration requests."
    },
    "quoteGroupId": {
      "type": "string",
      "description": "The id the group that this quote belongs to. If provided, it must be an id of existing group"
    },
    "address": {
      "$ref": "#/$defs/SiteAddress",
      "type": "object",
      "description": "The site address. Must not be set for add and migration quotes."
    },
    "siteId": {
      "type": "string",
      "description": "The site Id. If present, the address will be ignored. Must not be set for migration quotes. Must be set for add quotes."
    },
    "productOfferingId": {
      "type": "integer",
      "format": "int32",
      "description": "The LAN product offering id from product catalog"
    },
    "additionalServices": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AdditionalService"
      },
      "description": "Additional services to be included"
    },
    "crossConnectionPoints": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/CrossConnectionPoint"
      }
    }
  },
  "$defs": {
    "AdditionalService": {
      "type": "object",
      "properties": {
        "additionalServiceId": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "format": "int32",
          "description": "The Id of the additional service from Product Catalog"
        },
        "parameters": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Parameters"
          }
        }
      }
    },
    "ConnectionType": {
      "type": "string",
      "enum": [
        "CAT",
        "CAT5",
        "CAT5E",
        "CAT6",
        "CAT7",
        "MULTI_MODE_SIMPLEX_FIBER",
        "SINGLE_MODE_SIMPLEX_FIBER",
        "MULTI_MODE_FIBER",
        "SINGLE_MODE_FIBER"
      ]
    },
    "ContactMedium": {
      "type": "object",
      "properties": {
        "mediumType": {
          "$ref": "#/$defs/MediumType"
        },
        "preferred": {
          "type": "boolean"
        },
        "contactDetails": {
          "type": "string",
          "description": "Contact details for the customer who made this quote"
        },
        "validFor": {
          "$ref": "#/$defs/LocalDate"
        }
      }
    },
    "CrossConnection": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The id (or name) the cross connection point connects to"
        },
        "connectionType": {
          "$ref": "#/$defs/ConnectionType"
        }
      }
    },
    "CrossConnectionPoint": {
      "type": "object",
      "required": [
        "id",
        "lanPorts",
        "totalPoEPower"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "\\S",
          "description": "An id (or name) for the cross connection point as mentioned on site blueprint"
        },
        "lanPorts": {
          "type": "integer",
          "format": "int32",
          "description": "The number of available LAN ports. This number denotes the number of ports the requester need to utilize for own purpose",
          "minimum": 0
        },
        "totalPoEPower": {
          "type": "integer",
          "format": "int32",
          "description": "The total PoE power (in watt) the requester need to utilize for own purpose",
          "maximum": 1000,
          "minimum": 0
        },
        "fanLess": {
          "type": "boolean",
          "description": "If the equipment should be fanless",
          "default": false
        },
        "outdoor": {
          "type": "boolean",
          "description": "If the equipment needs to operate in outdoor conditions",
          "default": false
        },
        "crossConnections": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CrossConnection"
          },
          "description": "Specifies cross connections between connection points. Only applicable when several connection points exists."
        }
      }
    },
    "LocalDate": {
      "type": "string",
      "format": "date"
    },
    "MediumType": {
      "type": "string",
      "enum": [
        "EMAIL",
        "PHONE"
      ]
    },
    "Notes": {
      "type": "object",
      "properties": {
        "author": {
          "type": "string",
          "maxLength": 100,
          "description": "The name of the person who wrote this note",
          "maximum": 100
        },
        "date": {
          "$ref": "#/$defs/LocalDate",
          "type": "string",
          "description": "The date when this note was created"
        },
        "text": {
          "type": "string",
          "maxLength": 255,
          "description": "Details about this note",
          "maximum": 255
        }
      }
    },
    "OpportunityAction": {
      "type": "string",
      "enum": [
        "QUOTE",
        "ADD_QUOTE",
        "MIGRATION_QUOTE"
      ]
    },
    "Parameters": {
      "type": "object",
      "properties": {
        "parameterId": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "format": "int32",
          "description": "The Id of the additional service parameter from Product Catalog"
        }
      }
    },
    "SiteAddress": {
      "type": "object",
      "required": [
        "street",
        "postalCode",
        "city",
        "country"
      ],
      "properties": {
        "street": {
          "type": "string",
          "pattern": "\\S"
        },
        "streetNumber": {
          "type": "string"
        },
        "postalCode": {
          "type": "string",
          "pattern": "\\S"
        },
        "city": {
          "type": "string",
          "pattern": "\\S"
        },
        "country": {
          "type": "string",
          "pattern": "\\S"
        },
        "apartmentNumber": {
          "type": "string"
        },
        "siteName": {
          "type": "string"
        }
      }
    }
  }
}