{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/telenor-sverige/json-schema/telenor-sverige-quote-response-schema.json",
  "title": "QuoteResponse",
  "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/QuoteResponse",
  "type": "object",
  "required": [
    "appId",
    "authorizer"
  ],
  "properties": {
    "quoteId": {
      "type": "string",
      "readOnly": true,
      "description": "The id for the quotation"
    },
    "deliveryStatus": {
      "$ref": "#/$defs/DeliveryStatus"
    },
    "appId": {
      "type": "string",
      "pattern": "^(?!unknown).*",
      "description": "The appId (client or subject) to receive this this quote"
    },
    "organizationNumber": {
      "type": "string",
      "description": "Organization number for which quotation was made"
    },
    "category": {
      "type": "string",
      "description": "The category of this quote"
    },
    "expectedFulfillmentStartDate": {
      "$ref": "#/$defs/LocalDate",
      "type": "string",
      "deprecated": true,
      "description": "Estimated start date of the the fulfillment for this quote.The field will be replaced by 'expectedDeliveryDays' with relative amount of days instead of absolute date."
    },
    "expectedDeliveryDays": {
      "type": "integer",
      "format": "int32",
      "description": "Expected number of working days before delivery."
    },
    "expectedQuoteCompletionDate": {
      "$ref": "#/$defs/LocalDate",
      "type": "string",
      "description": "Completion date for this quote"
    },
    "authorizer": {
      "$ref": "#/$defs/Authorizer"
    },
    "quoteItems": {
      "type": "array",
      "maxItems": 1,
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/QuoteItem"
      }
    }
  },
  "$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"
          }
        }
      }
    },
    "Authorizer": {
      "type": "object",
      "required": [
        "approverName",
        "signatureRepresentation"
      ],
      "properties": {
        "approverName": {
          "type": "string",
          "pattern": "\\S",
          "description": "The name of the quote approver"
        },
        "approvalRole": {
          "type": "string",
          "description": "The role of the approver"
        },
        "responseCreationDate": {
          "$ref": "#/$defs/LocalDate",
          "type": "string",
          "description": "When the quotation response was created. If omitted, current date will be used."
        },
        "signatureRepresentation": {
          "$ref": "#/$defs/SignatureRepresentation"
        }
      }
    },
    "DeliveryStatus": {
      "type": "object",
      "description": "Contains information about the possibility to delivery the requested service.",
      "properties": {
        "reason": {
          "type": "string",
          "description": "A reason for the quote response status"
        },
        "status": {
          "$ref": "#/$defs/Status",
          "type": "string",
          "description": "Different status for the requested service. CONFIRMED means the service can be delivered while REJECTED means the service for some reason can't be delivered",
          "default": "ACCEPTED"
        }
      }
    },
    "LocalDate": {
      "type": "string",
      "format": "date"
    },
    "Parameters": {
      "type": "object",
      "properties": {
        "parameterId": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "format": "int32",
          "description": "The Id of the additional service parameter from Product Catalog"
        }
      }
    },
    "Price": {
      "type": "object",
      "required": [
        "priceType",
        "cost"
      ],
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the tariff"
        },
        "priceType": {
          "$ref": "#/$defs/PriceType",
          "type": "string",
          "description": "The price type"
        },
        "currency": {
          "type": "string",
          "description": "The currency",
          "default": "SEK"
        },
        "cost": {
          "type": "integer",
          "format": "int32",
          "description": "The actual cost, excluding any value-added tax (VAT) rate or discounts",
          "minimum": 0
        },
        "vatTaxRate": {
          "type": "integer",
          "format": "int32",
          "description": "The value-added tax (VAT) rate in percent (%)",
          "default": 25
        },
        "quantity": {
          "type": "integer",
          "format": "int32",
          "description": "The quantity"
        }
      }
    },
    "PriceAlternation": {
      "type": "object",
      "required": [
        "name",
        "priceType",
        "discount"
      ],
      "description": "Describes any alternation to the original price",
      "properties": {
        "applicationDuration": {
          "type": "string",
          "description": "The duration of the price alternation"
        },
        "description": {
          "type": "string",
          "description": "The description of the price alternation"
        },
        "name": {
          "type": "string",
          "description": "The name of the price alternation"
        },
        "priceType": {
          "$ref": "#/$defs/PriceType",
          "type": "string",
          "description": "The price type"
        },
        "discount": {
          "type": "string",
          "description": "The actual discount, could be in percent (%) or fixed amount"
        }
      }
    },
    "PriceType": {
      "type": "string",
      "enum": [
        "RECURRING_MONTHLY",
        "ONE_TIME_FEE",
        "HOURLY_RATE"
      ]
    },
    "ProductSpecification": {
      "type": "object",
      "description": "Represent a product specification from the product catalog.",
      "properties": {
        "productId": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "format": "int32"
        },
        "qualityOfServiceId": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "accessRedundancyId": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "accessTypeId": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "accessSpeedId": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "serviceLevelAgreementId": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "serviceLevelAgreementLevelId": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "additionalServices": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AdditionalService"
          }
        }
      }
    },
    "QuoteItem": {
      "type": "object",
      "required": [
        "bindingTime",
        "quantity",
        "quoteResourceUrl",
        "prices"
      ],
      "description": "Represent an item from the product catalog with price, binding time, etc.",
      "properties": {
        "bindingTime": {
          "type": "integer",
          "format": "int32",
          "description": "The binding time (in months) for the quotation",
          "minimum": 0
        },
        "quantity": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "format": "int32",
          "description": "The number of products"
        },
        "quoteResourceUrl": {
          "type": "string",
          "pattern": "\\S",
          "description": "An link to the quote request resource"
        },
        "prices": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/Price"
          }
        },
        "priceAlternations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PriceAlternation"
          }
        },
        "products": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ProductSpecification"
          }
        }
      }
    },
    "SignatureRepresentation": {
      "type": "string",
      "enum": [
        "DIGITAL",
        "MANUAL"
      ]
    },
    "Status": {
      "type": "string",
      "enum": [
        "ACCEPTED",
        "REJECTED"
      ]
    }
  }
}