{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://schema.govfresh.com/v1/procurement/tender.schema.json",
  "title": "Tender",
  "description": "The solicitation: what is being bought, how bids are invited, and on what timetable. Mirrors the OCDS tender block.",
  "standards": [
    "ocds"
  ],
  "type": "object",
  "properties": {
    "@type": {
      "const": "Tender",
      "description": "Always `Tender`."
    },
    "@id": {
      "type": "string",
      "format": "iri",
      "description": "This tender's own dereferenceable identifier."
    },
    "tenderId": {
      "type": "string",
      "description": "The buyer's own tender reference."
    },
    "title": {
      "type": "string",
      "description": "A short label for what's being procured."
    },
    "description": {
      "type": "string",
      "description": "A plain-language summary of what's being bought and how bids are invited."
    },
    "status": {
      "type": "string",
      "description": "termCode from the `TenderStatus` code list.",
      "enum": [
        "planning",
        "planned",
        "active",
        "cancelled",
        "unsuccessful",
        "complete",
        "withdrawn"
      ]
    },
    "procurementMethod": {
      "type": "string",
      "description": "How bids were invited. Optional at Core conformance because real publishers omit it on some notices, but REQUIRED at Standard conformance: without it, the question of how much public spending was never competed is unanswerable.",
      "enum": [
        "open",
        "selective",
        "limited",
        "direct"
      ]
    },
    "procurementMethodDetails": {
      "type": "string",
      "description": "The publisher's own name for the procedure."
    },
    "procurementMethodRationale": {
      "type": "string",
      "description": "Why this method was chosen. Expected whenever procurementMethod is 'direct' - a sole-source award without a stated reason is the single most common audit finding in public procurement."
    },
    "mainProcurementCategory": {
      "type": "string",
      "description": "termCode from the `ProcurementCategory` code list.",
      "enum": [
        "goods",
        "works",
        "services",
        "consultingServices"
      ]
    },
    "classification": {
      "type": "array",
      "items": {
        "$ref": "../_core/identifier.schema.json"
      },
      "description": "What is being bought, as scheme-qualified codes: CPV in the EU, UNSPSC globally, NIGP in much of the US. Same propertyID/value pattern as every other identifier in this profile."
    },
    "value": {
      "$ref": "../budget/amount.schema.json",
      "description": "Estimated value."
    },
    "procuringEntity": {
      "$ref": "../_core/reference.schema.json",
      "description": "The `GovernmentOrganization` running the tender, where different from the process's own `buyer`."
    },
    "tenderPeriodStart": {
      "type": "string",
      "anyOf": [
        {
          "format": "date"
        },
        {
          "format": "date-time"
        }
      ],
      "description": "When bids may first be submitted."
    },
    "tenderPeriodEnd": {
      "type": "string",
      "anyOf": [
        {
          "format": "date"
        },
        {
          "format": "date-time"
        }
      ],
      "description": "The submission deadline."
    },
    "enquiryPeriodEnd": {
      "type": "string",
      "anyOf": [
        {
          "format": "date"
        },
        {
          "format": "date-time"
        }
      ],
      "description": "The deadline for bidders to ask questions, where the process has one."
    },
    "numberOfTenderers": {
      "type": "integer",
      "minimum": 0,
      "description": "How many bids were received."
    },
    "submissionMethodDetails": {
      "type": "string",
      "description": "How and where to submit a bid, in the publisher's own words."
    },
    "document": {
      "type": "array",
      "description": "Links to supporting documents, e.g. the tender notice or bid specification.",
      "items": {
        "type": "string",
        "format": "iri"
      }
    }
  },
  "required": [
    "@type",
    "status"
  ],
  "additionalProperties": true
}
