{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/entur/json-schema/entur-fare-quota-factor-schema.json",
  "title": "FareQuotaFactor",
  "description": "A FareQuotaFactor",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entur-fare-quota-factors-api-openapi.yml#/components/schemas/FareQuotaFactor",
  "required": [
    "changed",
    "created",
    "fareFrameRef",
    "fareStructureElementRef",
    "id",
    "modification",
    "nameOfClass",
    "status",
    "version"
  ],
  "type": "object",
  "properties": {
    "changed": {
      "type": "string",
      "description": "Changed datetime",
      "readOnly": true
    },
    "compatibleWithVersionRef": {
      "type": "string",
      "description": "Compatible with version.",
      "readOnly": true
    },
    "created": {
      "type": "string",
      "description": "Created datetime",
      "readOnly": true
    },
    "derivedFromVersionRef": {
      "type": "string",
      "description": "Derived from version.",
      "readOnly": true
    },
    "description": {
      "type": "array",
      "description": "Description represented in different languages. Language codes are ISO-639.",
      "items": {
        "$ref": "#/$defs/TextInLanguage"
      }
    },
    "fareFrameRef": {
      "$ref": "#/$defs/VersionOfObjectRef"
    },
    "fareStructureElementRef": {
      "$ref": "#/$defs/VersionOfObjectRef"
    },
    "id": {
      "minLength": 1,
      "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
      "type": "string",
      "description": "Id."
    },
    "modification": {
      "type": "string",
      "description": "Modification status",
      "readOnly": true,
      "enum": [
        "NEW",
        "REVISE",
        "DELETE"
      ]
    },
    "name": {
      "type": "array",
      "description": "Name represented in different languages. Language codes are ISO-639.",
      "items": {
        "$ref": "#/$defs/TextInLanguage"
      }
    },
    "nameOfClass": {
      "type": "string",
      "description": "Name of class",
      "readOnly": true
    },
    "numberOfUnits": {
      "type": "integer",
      "description": "The number of units.",
      "format": "int32"
    },
    "prices": {
      "type": "array",
      "description": "Fare prices for the fare quota factor.",
      "items": {
        "$ref": "#/$defs/FarePrice"
      }
    },
    "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true,
      "enum": [
        "DRAFT",
        "PROPOSED",
        "VERSIONED",
        "DEPRECATED"
      ]
    },
    "validityConditions": {
      "type": "array",
      "description": "Gives a sequence of conditions for validity.",
      "items": {
        "$ref": "#/$defs/ValidityCondition"
      }
    },
    "value": {
      "type": "string",
      "description": "The value of fare quota factor."
    },
    "version": {
      "minLength": 1,
      "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
      "type": "string",
      "description": "FareQuotaFactor version. Versioned child of FSE,trying to set other versions will be ignored"
    }
  },
  "$defs": {
    "FarePrice": {
      "required": [
        "changed",
        "created",
        "fareFrameRef",
        "id",
        "modification",
        "nameOfClass",
        "status"
      ],
      "type": "object",
      "properties": {
        "amount": {
          "type": "string",
          "description": "Amount"
        },
        "canBeCumulative": {
          "type": "boolean",
          "description": "canBeCumulative."
        },
        "changed": {
          "type": "string",
          "description": "Changed datetime.",
          "readOnly": true
        },
        "compatibleWithVersionRef": {
          "type": "string",
          "description": "Compatible with version."
        },
        "created": {
          "type": "string",
          "description": "Created datetime.",
          "readOnly": true
        },
        "currency": {
          "type": "string",
          "description": "Currency."
        },
        "derivedFromVersionRef": {
          "type": "string",
          "description": "Derived from version."
        },
        "discountPercentageUsed": {
          "maximum": 100,
          "minimum": -100,
          "type": "integer",
          "description": "discountPercentageUsed.",
          "format": "int32"
        },
        "fareFrameRef": {
          "$ref": "#/$defs/VersionOfObjectRef"
        },
        "id": {
          "minLength": 1,
          "type": "string",
          "description": "Id."
        },
        "isAllowed": {
          "type": "boolean",
          "description": "isAllowed."
        },
        "limitingRule": {
          "$ref": "#/$defs/LimitingRule"
        },
        "modification": {
          "type": "string",
          "description": "Modification status.",
          "readOnly": true,
          "enum": [
            "NEW",
            "REVISE",
            "DELETE"
          ]
        },
        "name": {
          "type": "array",
          "description": "Name.",
          "items": {
            "$ref": "#/$defs/TextInLanguage"
          }
        },
        "nameOfClass": {
          "type": "string",
          "description": "Name of class.",
          "readOnly": true
        },
        "ranking": {
          "type": "integer",
          "description": "Ranking.",
          "format": "int32"
        },
        "rounding": {
          "$ref": "#/$defs/Rounding"
        },
        "roundingRef": {
          "$ref": "#/$defs/VersionOfObjectRef"
        },
        "status": {
          "type": "string",
          "description": "Status.",
          "readOnly": true,
          "enum": [
            "DRAFT",
            "PROPOSED",
            "VERSIONED",
            "DEPRECATED"
          ]
        },
        "vatRegisterGroup": {
          "type": "string",
          "description": "vatRegisterGroup.",
          "enum": [
            "EXCEPTION_FROM_VAT",
            "GENERAL_VAT",
            "FOOD_VAT",
            "TRANSPORT_AND_TICKETS_VAT"
          ]
        },
        "version": {
          "type": "string",
          "description": "Version.",
          "readOnly": true
        }
      },
      "description": "A description of the price and factor for a set fare"
    },
    "LimitingRule": {
      "required": [
        "changed",
        "created",
        "fareFrameRef",
        "id",
        "modification",
        "nameOfClass",
        "status"
      ],
      "type": "object",
      "properties": {
        "canBeCumulative": {
          "type": "boolean",
          "description": "CanBeCumulative."
        },
        "changed": {
          "type": "string",
          "description": "Changed datetime.",
          "readOnly": true
        },
        "compatibleWithVersionRef": {
          "type": "string",
          "description": "Compatible with version."
        },
        "created": {
          "type": "string",
          "description": "Created datetime.",
          "readOnly": true
        },
        "derivedFromVersionRef": {
          "type": "string",
          "description": "Derived from version."
        },
        "description": {
          "type": "array",
          "description": "Description.",
          "items": {
            "$ref": "#/$defs/TextInLanguage"
          }
        },
        "discountAsPercentage": {
          "type": "number",
          "description": "DiscountAsPercentage.",
          "format": "float"
        },
        "discountAsValue": {
          "type": "number",
          "description": "DiscountAsValue.",
          "format": "float"
        },
        "fareFrameRef": {
          "$ref": "#/$defs/VersionOfObjectRef"
        },
        "id": {
          "minLength": 1,
          "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
          "type": "string",
          "description": "Id."
        },
        "maximumPrice": {
          "type": "string",
          "description": "MaximumPrice."
        },
        "maximumPriceAsPercentage": {
          "type": "number",
          "description": "MaximumPriceAsPercentage.",
          "format": "double"
        },
        "minimumLimitPrice": {
          "type": "string",
          "description": "MinimumLimitPrice."
        },
        "minimumPrice": {
          "type": "string",
          "description": "MinimumPrice."
        },
        "modification": {
          "type": "string",
          "description": "Modification status.",
          "readOnly": true,
          "enum": [
            "NEW",
            "REVISE",
            "DELETE"
          ]
        },
        "name": {
          "type": "array",
          "description": "Name.",
          "items": {
            "$ref": "#/$defs/TextInLanguage"
          }
        },
        "nameOfClass": {
          "type": "string",
          "description": "Name of class.",
          "readOnly": true
        },
        "status": {
          "type": "string",
          "description": "Status.",
          "readOnly": true,
          "enum": [
            "DRAFT",
            "PROPOSED",
            "VERSIONED",
            "DEPRECATED"
          ]
        },
        "version": {
          "minLength": 1,
          "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
          "type": "string",
          "description": "Version."
        }
      },
      "description": "A LimitingRule"
    },
    "Rounding": {
      "required": [
        "changed",
        "created",
        "fareFrameRef",
        "id",
        "modification",
        "nameOfClass",
        "roundingMethod",
        "status",
        "version"
      ],
      "type": "object",
      "properties": {
        "changed": {
          "type": "string",
          "description": "Changed datetime.",
          "readOnly": true
        },
        "compatibleWithVersionRef": {
          "type": "string",
          "description": "Compatible with version."
        },
        "created": {
          "type": "string",
          "description": "Created datetime.",
          "readOnly": true
        },
        "derivedFromVersionRef": {
          "type": "string",
          "description": "Derived from version."
        },
        "description": {
          "type": "array",
          "description": "Description.",
          "items": {
            "$ref": "#/$defs/TextInLanguage"
          }
        },
        "fareFrameRef": {
          "$ref": "#/$defs/VersionOfObjectRef"
        },
        "id": {
          "minLength": 1,
          "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
          "type": "string",
          "description": "Id."
        },
        "modification": {
          "type": "string",
          "description": "Modification status.",
          "readOnly": true,
          "enum": [
            "NEW",
            "REVISE",
            "DELETE"
          ]
        },
        "name": {
          "type": "array",
          "description": "Name.",
          "items": {
            "$ref": "#/$defs/TextInLanguage"
          }
        },
        "nameOfClass": {
          "type": "string",
          "description": "Name of class.",
          "readOnly": true
        },
        "roundingMethod": {
          "type": "string",
          "description": "Type of rounding.",
          "enum": [
            "NONE",
            "DOWN",
            "UP",
            "SPLIT",
            "STEP_TABLE",
            "FIVE",
            "NINE",
            "TEN",
            "FORTY_NINE"
          ]
        },
        "roundingModulus": {
          "type": "number",
          "description": "Amount by which rounding is to be quantised, i.e. results should be quantised to nearest whole multiple of this value.",
          "format": "double"
        },
        "status": {
          "type": "string",
          "description": "Rounding status.",
          "readOnly": true,
          "enum": [
            "DRAFT",
            "PROPOSED",
            "VERSIONED",
            "DEPRECATED"
          ]
        },
        "version": {
          "minLength": 1,
          "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
          "type": "string",
          "description": "Rounding version."
        }
      },
      "description": "A description of how prices are rounded post calculation",
      "deprecated": true
    },
    "TextInLanguage": {
      "required": [
        "lang",
        "value"
      ],
      "type": "object",
      "properties": {
        "lang": {
          "minLength": 1,
          "type": "string",
          "description": "Language code."
        },
        "value": {
          "minLength": 1,
          "type": "string",
          "description": "The text."
        }
      },
      "description": "Text in a specific language."
    },
    "ValidityCondition": {
      "required": [
        "changed",
        "created",
        "id",
        "modification",
        "nameOfClass",
        "status",
        "version"
      ],
      "type": "object",
      "properties": {
        "changed": {
          "type": "string",
          "description": "Changed datetime.",
          "readOnly": true
        },
        "created": {
          "type": "string",
          "description": "Created datetime.",
          "readOnly": true
        },
        "fromDate": {
          "type": "string",
          "description": "From Date."
        },
        "id": {
          "minLength": 1,
          "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
          "type": "string",
          "description": "Id."
        },
        "modification": {
          "type": "string",
          "description": "Modification status.",
          "readOnly": true,
          "enum": [
            "NEW",
            "REVISE",
            "DELETE"
          ]
        },
        "nameOfClass": {
          "type": "string",
          "description": "Name of class.",
          "readOnly": true
        },
        "status": {
          "type": "string",
          "description": "Status.",
          "readOnly": true,
          "enum": [
            "DRAFT",
            "PROPOSED",
            "VERSIONED",
            "DEPRECATED"
          ]
        },
        "toDate": {
          "type": "string",
          "description": "To Date."
        },
        "version": {
          "minLength": 1,
          "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
          "type": "string",
          "description": "Version."
        }
      },
      "description": "A condition of the validity of the priceable object"
    },
    "VersionOfObjectRef": {
      "required": [
        "nameOfClass",
        "ref",
        "version"
      ],
      "type": "object",
      "properties": {
        "nameOfClass": {
          "minLength": 1,
          "type": "string",
          "description": "Name of class."
        },
        "ref": {
          "minLength": 1,
          "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
          "type": "string",
          "description": "The netex id reference to the object."
        },
        "version": {
          "type": "string",
          "description": "Version."
        }
      },
      "description": "Fare frame ref."
    }
  }
}