{
  "name": "QuoteLead",
  "type": "object",
  "properties": {
    "birth_month": {
      "type": "string"
    },
    "birth_day": {
      "type": "string"
    },
    "birth_year": {
      "type": "string"
    },
    "zip_code": {
      "type": "string"
    },
    "gender": {
      "type": "string",
      "enum": [
        "male",
        "female"
      ]
    },
    "health_rating": {
      "type": "string",
      "enum": [
        "excellent",
        "above_average",
        "average",
        "below_average"
      ]
    },
    "height_ft": {
      "type": "number"
    },
    "height_in": {
      "type": "number"
    },
    "weight_lbs": {
      "type": "number"
    },
    "state": {
      "type": "string"
    },
    "has_coverage": {
      "type": "boolean"
    },
    "current_coverage_amount": {
      "type": "string"
    },
    "insurance_type": {
      "type": "string",
      "enum": [
        "term",
        "not_sure"
      ]
    },
    "annual_income": {
      "type": "string"
    },
    "coverage_needed": {
      "type": "string"
    },
    "term_length": {
      "type": "string",
      "enum": [
        "10 Years",
        "15 Years",
        "20 Years",
        "30 Years"
      ]
    },
    "used_tobacco": {
      "type": "boolean"
    },
    "medical_conditions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "driving_violations": {
      "type": "boolean"
    },
    "high_risk_activities": {
      "type": "boolean"
    },
    "family_history": {
      "type": "boolean"
    },
    "prior_declined": {
      "type": "boolean"
    },
    "heavy_alcohol": {
      "type": "boolean"
    },
    "daily_marijuana": {
      "type": "boolean"
    },
    "uses_pain_meds": {
      "type": "boolean"
    },
    "felony_conviction": {
      "type": "boolean"
    },
    "address": {
      "type": "string"
    },
    "city": {
      "type": "string"
    },
    "first_name": {
      "type": "string"
    },
    "last_name": {
      "type": "string"
    },
    "email": {
      "type": "string"
    },
    "phone": {
      "type": "string"
    },
    "how_heard": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "new",
        "contacted",
        "quoted",
        "closed"
      ],
      "default": "new"
    }
  },
  "required": [],
  "rls": {
    "create": {},
    "read": {
      "$or": [
        {
          "created_by_id": "{{user.id}}"
        },
        {
          "data.email": "{{user.email}}"
        },
        {
          "user_condition": {
            "role": "admin"
          }
        }
      ]
    },
    "update": {
      "$or": [
        {
          "created_by_id": "{{user.id}}"
        },
        {
          "data.email": "{{user.email}}"
        },
        {
          "user_condition": {
            "role": "admin"
          }
        }
      ]
    },
    "delete": {
      "user_condition": {
        "role": "admin"
      }
    }
  }
}