{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "drillplan://aea/well/1.0.0",
    "title": "Well (well-v1)",
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "name": {
        "type": [
          "null",
          "string"
        ],
        "description": "Well Name"
      },
      "uwi": {
        "type": [
          "null",
          "string"
        ],
        "description": ""
      },
      "well_type": {
        "$ref": "#/definitions/WellType"
      },
      "well_fluid": {
        "$ref": "#/definitions/WellFluidType"
      },
      "sour_service": {
        "type": "boolean",
        "description": ""
      },
      "comments": {
        "type": [
          "null",
          "string"
        ],
        "description": ""
      },
      "elevation_reference": {
        "oneOf": [
          {
            "type": "null"
          },
          {
            "$ref": "#/definitions/ElevationReference"
          }
        ],
        "description": ""
      },
      "spud_date": {
        "type": [
            "null",
            "string"
        ],
        "description": "",
        "format":"date-time"
      }
    },
    "definitions": {
        "ElevationReference": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "well_location_type": {
                  "$ref": "#/definitions/WellLocationType"
                },
                "well_reference_point" : {
                    "type": "number",
                    "format": "double",
                    "description": "Well Reference Point from MSL. Positive when above MSL. Negative when below MSL."
                },
                "surface_level": {
                    "type": "number",
                    "format": "double",
                    "description": "Ground Level from MSL if WellLocationType is Onshore, Seabed Level from MSL if WellLocationType is Offshore. Positive when above MSL. Negative when below MSL."
                },
                "rkb": {
                    "type": "number",
                    "format": "double",
                    "description": "Rotary Kelly Bushing elevation from MSL. Positive when above MSL. Negative when below MSL."
                }
            }
        },
        "WellType": {
            "type": "string",
            "description": "",
            "x-enumNames": [
                "Development",
                "Blowout Relief",
                "Borehole Reacquisition",
                "Deeper-Pool Wildcat",
                "Delineation",
                "Drilling Test",
                "Fluid Storage",
                "General Service",
                "Geothermal",
                "Mineral",
                "Monitor",
                "New-Field Wildcat",
                "New-Pool Wildcat",
                "Outpost Wildcat",
                "Shallower-Pool Wildcat",
                "Stratigraphic Test",
                "Waste Disposal"
            ],
            "enum": [
                "Development",
                "BlowoutRelief",
                "BoreholeReacquisition",
                "DeeperPoolWildcat",
                "Delineation",
                "DrillingTest",
                "FluidStorage",
                "GeneralService",
                "Geothermal",
                "Mineral",
                "Monitor",
                "NewFieldWildcat",
                "NewPoolWildcat",
                "OutpostWildcat",
                "ShallowerPoolWildcat",
                "StratigraphicTest",
                "WasteDisposal"
            ]
        },
        "WellFluidType":{
            "type": "string",
            "description": "",
            "x-enumNames": [
                "Oil",
                "Unknown",
                "Air",
                "Condensate",
                "Dry",
                "Gas",
                "Gas-Water",
                "Non-HC Gas",
                "Non-HC Gas (CO2)",
                "Oil-Gas",
                "Oil-Water",
                "Steam",
                "Water",
                "Water-Brine",
                "Water-Fresh"
            ],
            "enum": [
                "Oil",
                "Unknown",
                "Air",
                "Condensate",
                "Dry",
                "Gas",
                "GasWater",
                "NonHcGas",
                "NonHcGasCO2",
                "OilGas",
                "OilWater",
                "Steam",
                "Water",
                "WaterBrine",
                "WaterFresh"
            ]
        },
        "WellLocationType": {
            "type": "string",
            "description": "",
            "x-enumNames": [
                "Onshore",
                "Offshore"
            ],
            "enum": [
                "Onshore",
                "Offshore"
            ]
        }
    }
  }