{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "title": "costings.json",
 "type": "array",
 "items": {
  "type": "object",
  "additionalProperties": false,
  "required": [
   "slug",
   "as_of",
   "confidence",
   "vendor_side_sampling",
   "quote_only",
   "components"
  ],
  "properties": {
   "slug": {
    "type": "string"
   },
   "as_of": {
    "type": "string",
    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
   },
   "confidence": {
    "enum": [
     "high",
     "medium",
     "low",
     null
    ]
   },
   "vendor_side_sampling": {
    "enum": [
     "yes",
     "offered",
     "no",
     "unknown"
    ]
   },
   "quote_only": {
    "type": "boolean"
   },
   "minimum_monthly_usd": {
    "type": [
     "string",
     "number"
    ]
   },
   "components": {
    "type": "array",
    "items": {
     "type": "object",
     "additionalProperties": false,
     "required": [
      "label",
      "item",
      "qty"
     ],
     "properties": {
      "label": {
       "type": "string"
      },
      "item": {
       "type": "object",
       "additionalProperties": false,
       "required": [
        "sku",
        "unit",
        "commitment"
       ],
       "properties": {
        "sku": {
         "type": "string"
        },
        "unit": {
         "type": "string"
        },
        "commitment": {
         "type": "string"
        }
       }
      },
      "qty": {
       "type": [
        "string",
        "number"
       ]
      },
      "free": {
       "type": [
        "string",
        "number"
       ]
      },
      "tier": {
       "type": "array",
       "items": {
        "type": [
         "number",
         "null"
        ]
       },
       "minItems": 2,
       "maxItems": 2
      },
      "metered": {
       "enum": [
        "kept",
        "received"
       ]
      }
     }
    }
   },
   "basis": {
    "type": "string"
   },
   "confidence_reason": {
    "type": "string"
   },
   "quote_reason": {
    "type": "string"
   }
  }
 }
}
