{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agent.pricerightdigital.com/lead-packet-schema.json",
  "title": "Price Right Digital Lead Routing Packet",
  "description": "A preparation-only packet for lead-routing handoffs. It does not prove that a CRM record was created, updated, messaged, or confirmed.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "packet_id",
    "created_at",
    "source_system",
    "source_url",
    "shopper_name",
    "contact",
    "lead_context",
    "routing",
    "consent_or_contact_note",
    "validation_status",
    "downstream_status"
  ],
  "properties": {
    "packet_id": {
      "type": "string",
      "description": "Unique packet identifier generated by the agent, form, script, or internal tool before handoff."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO 8601 timestamp when the packet was created."
    },
    "source_system": {
      "type": "string",
      "description": "System that prepared the packet, such as agent_hub, form, script, or internal_tool."
    },
    "source_url": {
      "type": "string",
      "format": "uri",
      "description": "URL where the lead-routing packet preparation originated."
    },
    "shopper_name": {
      "type": "string",
      "description": "Shopper name as provided or a placeholder in examples. Do not infer a real name."
    },
    "contact": {
      "type": "object",
      "description": "Contact details supplied for the lead-routing handoff. Empty strings are allowed when a value is not supplied.",
      "additionalProperties": false,
      "required": [
        "email",
        "phone",
        "preferred_contact_method"
      ],
      "properties": {
        "email": {
          "type": "string",
          "description": "Email address supplied by the shopper or placeholder example data. Do not invent an email address."
        },
        "phone": {
          "type": "string",
          "description": "Phone number supplied by the shopper. Use an empty string if not supplied."
        },
        "preferred_contact_method": {
          "type": "string",
          "description": "Shopper-stated contact preference, such as email, phone, text, none, or unknown."
        }
      }
    },
    "lead_context": {
      "type": "object",
      "description": "Context describing the inquiry. Many inquiries are general, so selected_unit, inventory_url, and related fields are optional.",
      "additionalProperties": false,
      "properties": {
        "unit_interest": {
          "type": "string",
          "description": "General unit interest supplied by the shopper, such as travel trailer, fifth wheel, service, finance, or general inquiry."
        },
        "selected_unit": {
          "type": "string",
          "description": "Specific unit identifier or title selected by the shopper, if supplied. Do not require or infer it."
        },
        "inventory_url": {
          "type": "string",
          "description": "Official pricerightrv.com inventory URL related to the inquiry, if supplied. Do not use this as proof of availability."
        },
        "campaign": {
          "type": "string",
          "description": "Campaign label used for internal tracking. Do not include private customer information."
        },
        "asset": {
          "type": "string",
          "description": "Asset or content label associated with the inquiry, if known."
        },
        "referrer": {
          "type": "string",
          "description": "Referrer URL or source string, if available."
        },
        "page_url": {
          "type": "string",
          "description": "Page URL where the inquiry context was gathered, preferably on pricerightrv.com for shopper destinations."
        },
        "utm_source": {
          "type": "string",
          "description": "Lowercase UTM source value. Do not include private customer information."
        },
        "utm_medium": {
          "type": "string",
          "description": "Lowercase UTM medium value. Do not include private customer information."
        },
        "utm_campaign": {
          "type": "string",
          "description": "Readable campaign name using consistent hyphens or underscores. Do not imply a sale or form submission occurred from a UTM alone."
        },
        "utm_content": {
          "type": "string",
          "description": "Optional UTM content value for asset or placement tracking without private customer information."
        },
        "utm_term": {
          "type": "string",
          "description": "Optional UTM term value. Do not include private customer information."
        }
      }
    },
    "routing": {
      "type": "object",
      "description": "Routing preparation details. This does not confirm that any downstream system accepted the lead.",
      "additionalProperties": false,
      "required": [
        "official_customer_site",
        "intended_destination",
        "store_or_location_preference",
        "routing_key",
        "notes"
      ],
      "properties": {
        "official_customer_site": {
          "type": "string",
          "format": "uri",
          "description": "Official shopper website for customer-facing actions."
        },
        "intended_destination": {
          "type": "string",
          "description": "Prepared destination for handoff, such as official_site_contact_page, internal_review, or approved_lead_intake_path."
        },
        "store_or_location_preference": {
          "type": "string",
          "description": "Shopper-stated store or location preference if supplied. Use an empty string if none was supplied."
        },
        "routing_key": {
          "type": "string",
          "description": "Routing label for internal preparation. It is not proof of downstream delivery."
        },
        "notes": {
          "type": "string",
          "description": "Non-sensitive routing notes for the handoff. Do not include unsupported claims."
        }
      }
    },
    "consent_or_contact_note": {
      "type": "string",
      "description": "Note describing whether the shopper supplied contact details or consent context. This is not legal advice or proof of permission beyond the data provided."
    },
    "validation_status": {
      "type": "string",
      "description": "Packet validation stage before or after handoff confirmation.",
      "enum": [
        "draft",
        "ready_for_handoff",
        "blocked_missing_required_fields",
        "awaiting_downstream_confirmation",
        "downstream_confirmed",
        "failed_downstream"
      ]
    },
    "downstream_status": {
      "type": "string",
      "description": "Downstream handoff status. Do not mark confirmed without downstream evidence.",
      "enum": [
        "not_sent",
        "handed_off",
        "awaiting_confirmation",
        "confirmed",
        "failed"
      ]
    }
  }
}
