{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://openbeautystandard.org/schema/0.9/result.schema.json",
 "title": "OBS search result",
 "description": "One menu line, kept as written, with its OBS reading.",
 "type": "object",
 "required": [
  "provider_id",
  "offering_id",
  "original_label",
  "relation",
  "service_code"
 ],
 "properties": {
  "obs_version": {
   "$ref": "common.schema.json#/$defs/obs_version"
  },
  "registry_release": {
   "type": "string"
  },
  "provider_id": {
   "type": "string",
   "minLength": 1
  },
  "offering_id": {
   "type": "string",
   "minLength": 1
  },
  "original_label": {
   "type": "string",
   "minLength": 1
  },
  "heading": {
   "type": "string"
  },
  "classification": {
   "type": "object",
   "required": [
    "status"
   ],
   "properties": {
    "status": {
     "enum": [
      "placed",
      "unclassified",
      "reserved_domain",
      "out_of_scope"
     ]
    },
    "via": {
     "enum": [
      "line",
      "heading",
      "business",
      "provider"
     ]
    }
   }
  },
  "service_code": {
   "oneOf": [
    {
     "$ref": "common.schema.json#/$defs/code"
    },
    {
     "type": "null"
    }
   ],
   "description": "null when unclassified, out of scope, or a combination (then see also_codes)"
  },
  "also_codes": {
   "type": "array",
   "items": {
    "$ref": "common.schema.json#/$defs/code"
   },
   "description": "a combination: every service the line names"
  },
  "concept_uri": {
   "type": "string",
   "format": "uri"
  },
  "provider_extension": {
   "$ref": "common.schema.json#/$defs/provider_extension"
  },
  "facets": {
   "$ref": "common.schema.json#/$defs/facets"
  },
  "price": {
   "$ref": "common.schema.json#/$defs/price"
  },
  "duration": {
   "type": "object",
   "properties": {
    "minutes": {
     "type": "integer",
     "minimum": 1
    },
    "processing_minutes": {
     "type": "integer",
     "minimum": 0
    }
   }
  },
  "requires": {
   "type": "array",
   "items": {
    "enum": [
     "consultation",
     "patch_test",
     "prior_visit"
    ]
   }
  },
  "delivery": {
   "type": "array",
   "items": {
    "enum": [
     "in_salon",
     "mobile",
     "at_home",
     "online"
    ]
   }
  },
  "includes": {
   "type": "array",
   "items": {
    "$ref": "common.schema.json#/$defs/code"
   },
   "description": "concepts the offering explicitly includes (a toner with highlights)"
  },
  "charged_separately": {
   "type": "array",
   "items": {
    "$ref": "common.schema.json#/$defs/code"
   }
  },
  "price_group": {
   "oneOf": [
    {
     "type": "string"
    },
    {
     "type": "null"
    }
   ],
   "description": "code|facet:value|...; null when the price is never compared"
  },
  "evidence": {
   "type": "array",
   "items": {
    "$ref": "common.schema.json#/$defs/evidence"
   }
  },
  "relation": {
   "type": "string",
   "description": "exact | narrower | broader | sibling | same_category; read an unknown value as same_category"
  },
  "fit": {
   "type": "string",
   "description": "full (every asked facet and the price known and met) | partial"
  },
  "match_status": {
   "type": "string",
   "description": "0.9.0: exact | descendant | uncertain | related; kept for older clients"
  },
  "match_notes": {
   "type": "array",
   "items": {
    "type": "string"
   }
  }
 }
}
