{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://uqp.dev/spec/schemas/estimate.json",
  "title": "Estimate",
  "type": "object",
  "properties": {
    "pack_id": {
      "$ref": "common.json#/$defs/packId"
    },
    "pack_version": {
      "$ref": "common.json#/$defs/packVersion"
    },
    "answers": {
      "$ref": "common.json#/$defs/answers"
    },
    "artist_review_mode": {
      "$ref": "common.json#/$defs/reviewMode"
    },
    "price_range": {
      "$ref": "common.json#/$defs/priceRange"
    },
    "sessions": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "count": {
              "type": "integer",
              "minimum": 0
            },
            "hours_per_session": {
              "type": "number",
              "minimum": 0
            }
          },
          "required": [
            "count",
            "hours_per_session"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "min": {
              "type": "integer",
              "minimum": 1
            },
            "max": {
              "type": "integer",
              "minimum": 1
            }
          },
          "required": [
            "min",
            "max"
          ],
          "additionalProperties": false
        }
      ]
    },
    "deposit": {
      "$ref": "common.json#/$defs/deposit"
    },
    "assumptions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "intermediates": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "properties": {
          "step": {
            "type": "string",
            "minLength": 1
          },
          "factor_id": {
            "type": "string",
            "minLength": 1
          },
          "input": {},
          "value": {},
          "skipped": {
            "const": true
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "step",
          "factor_id",
          "input",
          "value"
        ],
        "additionalProperties": false
      }
    },
    "review_status": {
      "enum": [
        "VALIDATED_PENDING_REVIEW",
        "MUTATION_REQUIRED"
      ]
    },
    "consent": {
      "$ref": "common.json#/$defs/consent"
    },
    "anonymized": {
      "type": "boolean"
    },
    "kind": {
      "const": "estimate"
    },
    "binding": {
      "const": false
    },
    "confidence": {
      "enum": [
        "low",
        "medium",
        "high"
      ]
    },
    "requires_in_person_consult": {
      "type": "boolean"
    }
  },
  "required": [
    "pack_id",
    "pack_version",
    "answers",
    "artist_review_mode",
    "sessions",
    "deposit",
    "assumptions",
    "intermediates",
    "review_status",
    "consent",
    "anonymized",
    "price_range",
    "kind",
    "binding",
    "confidence"
  ],
  "additionalProperties": false,
  "description": "Non-binding PricingModel result returned on PAYLOAD_SUBMITTED; incomplete inputs require mutation, never omission of a price."
}
