{
  "$schema": "http://json-schema.org/draft-07/schema",
  "$id": "https://drillplan.slb.com/kick-tolerance-v1.json",
  "type": "object",
  "description": "Kick tolerance criteria",
  "properties": {
    "name": {
      "type": "string",
      "description": "Kick tolerance criteria name"
    },
    "section_criteria": {
      "type": "array",
      "description": "Array of criteria per section.",
      "items": {
        "type": "object",
        "description": "Section criteria element.",
        "properties": {
          "section_node_id": {
            "type": "string",
            "description": "Id for the associated section."
          },
          "section_diameter": {
            "type": "number",
            "description": "Section diameter (CylinderDiameter, meter, m)."
          },
          "volume": {
            "type": "number",
            "description": "The minimum volume threshold validated against the calculated kick tolerance (LiquidProductionVolume, cubic meter, m3)."
          },
          "kick_intensity": {
            "type": "number",
            "description": "Kick intensity is added to the pore pressure at the calculated depth (MudDensity, kilogram per cubic meter, kg/m3)."
          },
          "safety_margin": {
            "type": "number",
            "description": "Safety margin is subtracted from the fracture pressure to account for annular/choke line frictional pressure losses, choke operational errors and uncertainties of formation properties (Pressure, pascal, Pa)."
          }
        }
      }
    },
    "project_id": {
      "type": "string",
      "description": "Id of preoject associated with the kick tolerance analysis."
    },
    "well_id": {
      "type": "string",
      "description": "Id of well associated with the kick tolerance analysis."
    },
    "wellbore_id": {
      "type": "string",
      "description": "Id of wellbore associated with the kick tolerance analysis."
    },
    "gas_density_model": {
      "type": "string",
      "description": "Gas density model",
      "oneOf": [
        {
          "const": "linearGradient"
        },
        {
          "const": "hallYarborough"
        }
      ]
    },
    "gas_law": {
      "type": "string",
      "description": "Gas law applicable when linear gradient gas density model is chosen",
      "oneOf": [
        {
          "const": "boylesLaw"
        },
        {
          "const": "combinedGasLaw"
        }
      ]
    },
    "influx_density": {
      "type": "number",
      "description": "Maximum influx density applicable when linear gas density model is chosen (PressurePerLength, pascal per meter, Pa/m)."
    },
    "kick_intensity_reference_option": {
      "type": "string",
      "description": "Kick intensity reference option",
      "oneOf": [
        {
          "const": "porePressure",
          "title": "Kick zone pressure = Pore Pressure + Kick Intensity"
        },
        {
          "const": "maxMudDensity",
          "title": "Kick zone pressure = Drilling fluid maximum density + Kick Intensity"
        }
      ]
    },
    "override_drilling_fluid_density": {
      "type": "boolean",
      "description": "Override drilling fluid density and set equal to Pore pressure + Kick Intensity. Applicable when Kick Intensity option is PorePressure"
    }
  }
}