{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/steadywrk-app/json-schema/steadywrk-app-estimate-response-schema.json",
  "title": "EstimateResponse",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/steadywrk-app-openapi.json#/components/schemas/EstimateResponse",
  "type": "object",
  "required": [
    "estimated",
    "source",
    "basis",
    "rate_model_version",
    "trade",
    "urgency",
    "location_resolution",
    "wage_basis",
    "billed_estimate",
    "estimated_cost_cents",
    "rate_card",
    "disclosure"
  ],
  "properties": {
    "estimated": {
      "type": "boolean",
      "const": true
    },
    "source": {
      "type": "string",
      "const": "public_rate_card"
    },
    "basis": {
      "type": "string",
      "const": "modeled_customer_pricing"
    },
    "estimate_basis": {
      "type": "string",
      "const": "national_median_reference",
      "description": "Present when no covered metro matched (for example, no city supplied): the figures are a non-binding national reference."
    },
    "binding": {
      "type": "boolean",
      "const": false
    },
    "note": {
      "type": "string"
    },
    "rate_model_version": {
      "type": "string"
    },
    "trade": {
      "type": "string"
    },
    "urgency": {
      "type": "string",
      "enum": [
        "emergency",
        "urgent",
        "routine",
        "scheduled"
      ]
    },
    "location": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "state": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "zip": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "location_resolution": {
      "type": "object",
      "properties": {
        "requested": {
          "type": "object",
          "properties": {
            "state": {
              "type": [
                "string",
                "null"
              ]
            },
            "city": {
              "type": [
                "string",
                "null"
              ]
            },
            "zip": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "additionalProperties": false
        },
        "resolved_metro": {
          "type": [
            "string",
            "null"
          ]
        },
        "resolved_metro_label": {
          "type": [
            "string",
            "null"
          ]
        },
        "scope": {
          "type": "string",
          "enum": [
            "metro_cited",
            "national_baseline",
            "mena_coverage_beta"
          ]
        },
        "location_sensitive": {
          "type": "boolean"
        },
        "reason": {
          "type": "string"
        },
        "zip_used": {
          "type": "boolean",
          "const": false
        },
        "covered_metros": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "wage_basis": {
      "type": "object",
      "description": "The cited hourly WAGE input — NOT the price.",
      "properties": {
        "kind": {
          "type": "string",
          "const": "hourly_wage"
        },
        "median_cents": {
          "type": "integer"
        },
        "p25_cents": {
          "type": [
            "integer",
            "null"
          ]
        },
        "p75_cents": {
          "type": [
            "integer",
            "null"
          ]
        },
        "scope": {
          "type": "string",
          "enum": [
            "metro_cited",
            "national_baseline",
            "mena_coverage_beta"
          ]
        },
        "scope_label": {
          "type": "string"
        },
        "bls_occ_code": {
          "type": "string"
        },
        "trade_label": {
          "type": "string"
        },
        "period": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "dataset": {
          "type": "string"
        },
        "release": {
          "type": "string"
        },
        "source_url": {
          "type": "string"
        },
        "annual_median_usd": {
          "type": [
            "number",
            "null"
          ]
        },
        "sample_size": {
          "type": [
            "integer",
            "null"
          ]
        },
        "note": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "billed_estimate": {
      "type": "object",
      "description": "Modeled customer hourly rates, billable hours, labor and trip line items, total and range. Not a binding quote.",
      "properties": {
        "currency": {
          "type": "string",
          "const": "USD"
        },
        "billed_hourly_rate_routine_cents": {
          "type": "integer"
        },
        "urgency": {
          "type": "string",
          "enum": [
            "emergency",
            "urgent",
            "routine",
            "scheduled"
          ]
        },
        "billed_hourly_rate_cents": {
          "type": "integer"
        },
        "minimum_billable_hours": {
          "type": "number"
        },
        "labor_subtotal_cents": {
          "type": "integer"
        },
        "trip_fee_cents": {
          "type": "integer"
        },
        "total_cents": {
          "type": "integer"
        },
        "total_usd": {
          "type": "number"
        },
        "range_low_cents": {
          "type": [
            "integer",
            "null"
          ]
        },
        "range_high_cents": {
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "estimated_cost_cents": {
      "type": "integer",
      "description": "Alias of billed_estimate.total_cents."
    },
    "rate_card": {
      "type": "object",
      "properties": {
        "median_dollars": {
          "type": "number"
        },
        "p25_dollars": {
          "type": [
            "number",
            "null"
          ]
        },
        "p75_dollars": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "disclosure": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "measurement": {
      "type": "object",
      "properties": {
        "billed_estimate": {
          "type": "string",
          "const": "estimated"
        },
        "wage_basis": {
          "type": "string",
          "const": "estimated"
        },
        "explanation": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}