{
  "definitions": {
    "Tender": {
      "properties": {
        "lots": {
          "title": "Lots",
          "description": "A tender process may be divided into lots, where bidders can bid on one or more lots. Details of each lot can be provided here. Items, documents and other features can then reference the lot they are related to using relatedLot. Where no relatedLots identifier is given, the values should be interpreted as applicable to the whole tender. Properties of tender can be overridden for a given Lot through their inclusion in the Lot object.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/Lot"
          }
        },
        "lotDetails": {
          "title": "Lot Details",
          "description": "If this tender is divided into lots, details can be provided here of any criteria that apply to bidding on these lots. This extended property is currently focused on fields required by the EU TED data standard",
          "type": "object",
          "properties": {
            "maximumLotsBidPerSupplier": {
              "title": "Maximum lots per supplier",
              "description": "The maximum number of lots that one supplier may bid for as part of this contracting process.",
              "type": [
                "integer",
                "null"
              ]
            },
            "maximumLotsAwardedPerSupplier": {
              "title": "Maximum lots per supplier",
              "description": "The maximum number of lots that may be awarded to one supplier as part of this contracting process.",
              "type": [
                "integer",
                "null"
              ]
            }
          }
        },
        "lotGroups": {
          "title": "Lot groups",
          "description": "Where the buyer reserves the right to combine lots, or wishes to specify the total value for a group of lots, a lot group is used to capture this information.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/LotGroup"
          }
        }
      }
    },
    "Document": {
      "properties": {
        "relatedLots": {
          "title": "Related lot(s)",
          "description": "If this document relates to a particular lot, provide the identifier(s) of the related lot(s) here.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "string"
            ]
          }
        }
      }
    },
    "Item": {
      "properties": {
        "relatedLot": {
          "title": "Related lot",
          "description": "If this item belongs to a lot, provide the identifier of the related lot here. Each item may only belong to a single lot.",
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "Milestone": {
      "properties": {
        "relatedLots": {
          "title": "Related lot(s)",
          "description": "If this milestone relates to a particular lot, provide the identifier(s) of the related lot(s) here.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "string"
            ]
          }
        }
      }
    },
    "Award": {
      "properties": {
        "relatedLots": {
          "title": "Related lot(s)",
          "description": "If this award relates to one or more specific lots, provide the identifier(s) of the related lot(s) here.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "string"
            ]
          }
        }
      }
    },
    "Bid": {
      "properties": {
        "relatedLots": {
          "title": "Related lot(s)",
          "description": "If this bid relates to one or more specific lots, provide the identifier(s) of the related lot(s) here.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "string"
            ]
          }
        }
      }
    },
    "Lot": {
      "title": "Lots",
      "description": "A lot is a grouping of items within a tender that can be bid on or awarded together.",
      "type": "object",
      "properties": {
        "id": {
          "title": "Lot ID",
          "type": "string",
          "description": "A local identifier for this lot, such as a lot number. This is used in relatedLots references at the item, document and award level."
        },
        "title": {
          "title": "Title",
          "type": [
            "string",
            "null"
          ],
          "description": "A title for this lot."
        },
        "description": {
          "title": "Description",
          "description": "A description of this lot.",
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "title": "Lot Status",
          "description": "The current status of the process related to this lot based on the [tenderStatus codelist](http://standard.open-contracting.org/1.1/en/schema/codelists/#tender-status)",
          "type": [
            "string",
            "null"
          ],
          "codelist": "tenderStatus.csv",
          "openCodelist": false,
          "enum": [
            "planning",
            "planned",
            "active",
            "cancelled",
            "unsuccessful",
            "complete",
            "withdrawn",
            null
          ]
        },
        "value": {
          "title": "Lot value",
          "$ref": "#/definitions/Value",
          "description": "The maximum estimated value of this lot."
        }
      }
    },
    "LotGroup": {
      "title": "Lot group",
      "description": "Where the buyer reserves the right to combine lots, or wishes to specify the total value for a group of lots, a lot group is used to capture this information.",
      "type": "object",
      "properties": {
        "id": {
          "title": "Lot group identifier",
          "type": "string",
          "description": "A local identifier for this group of lots."
        },
        "relatedLots": {
          "title": "Related lot(s)",
          "description": "A list of the identifiers of the lots that form this group. Lots may appear in more than one group.",
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": [
              "string"
            ]
          }
        },
        "optionToCombine": {
          "title": "Option to combine",
          "description": "The buyer reserves the right to combine the lots in this group when awarding a contract.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "maximumValue": {
          "title": "Maximum value",
          "description": "The maximum estimated value of the lots in this group. This may be lower than the sum total of lot values",
          "$ref": "#/definitions/Value"
        }
      }
    }
  }
}
