{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "BidOps intake validator",
  "description": "Schema to qualify whether a case is a usable BidOps pilot. Helps distinguish a viable RFP diagnostic from a case where no useful analysis can be produced without missing materials.",
  "type": "object",
  "properties": {
    "rfp_type": {
      "type": "string",
      "enum": ["public", "private", "unknown"]
    },
    "submission_deadline": {
      "type": "string",
      "format": "date",
      "description": "ISO 8601 date of the tender submission deadline."
    },
    "language": {
      "type": "string",
      "enum": ["DE", "EN", "FR", "IT"]
    },
    "sector": {
      "type": "string"
    },
    "must_have_criteria": {
      "type": "string",
      "enum": ["unknown", "extracted", "provided"]
    },
    "available_references": {
      "type": "string",
      "enum": ["yes", "no", "partial"]
    },
    "available_cvs": {
      "type": "string",
      "enum": ["yes", "no", "partial"]
    },
    "certificates_available": {
      "type": "string",
      "enum": ["yes", "no", "partial"]
    },
    "answer_draft_needed": {
      "type": "string",
      "enum": ["yes", "no"]
    },
    "go_no_go_needed": {
      "type": "string",
      "enum": ["yes", "no"]
    },
    "confidentiality_level": {
      "type": "string",
      "enum": ["demo_only", "NDA_needed", "internal_only"]
    }
  },
  "required": ["rfp_type", "submission_deadline", "language"],
  "qualification_rules": [
    {
      "rule": "viable_pilot",
      "when": "a document exists AND submission_deadline is in the future AND (must_have_criteria != 'unknown' OR a full RFP file is provided)",
      "then": "route_to_pilot_or_diagnostic_lite"
    },
    {
      "rule": "needs_more_material",
      "when": "answer_draft_needed == 'yes' AND available_references == 'no' AND available_cvs == 'no'",
      "then": "offer_diagnostic_lite_first_explain_missing_inputs"
    },
    {
      "rule": "out_of_scope",
      "when": "user expects legal_advice OR guaranteed_win_probability OR live_workshop",
      "then": "decline_and_explain_not_for"
    }
  ]
}
