{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://savitup.com/docs/share-fields.schema.json",
  "title": "SavItUp share fields",
  "description": "The baseline rules for every value a SavItUp share request can carry. A request you receive is validated on the customer's phone against these rules, narrowed by any constraints configured on your template. Requires nothing: a request asks for the subset of these properties it names.",
  "catalogVersion": 1,
  "type": "object",
  "properties": {
    "zip": {
      "type": "string",
      "title": "ZIP code",
      "pattern": "^[0-9]{5}$",
      "errorMessage": {
        "type": "Enter your ZIP code",
        "pattern": "A ZIP code is 5 digits"
      }
    },
    "state": {
      "type": "string",
      "title": "state",
      "pattern": "^[A-Za-z]{2}$",
      "errorMessage": {
        "type": "Enter your state",
        "pattern": "Use the 2-letter state code, like CO"
      }
    },
    "carrier": {
      "type": "string",
      "title": "insurer",
      "minLength": 2,
      "maxLength": 60,
      "errorMessage": {
        "type": "Enter who your policy is with",
        "minLength": "Enter the name of your insurer",
        "maxLength": "That name is too long to send"
      }
    },
    "product": {
      "type": "string",
      "title": "type of policy",
      "enum": [
        "auto",
        "home",
        "renters",
        "health",
        "dental",
        "vision",
        "life",
        "umbrella",
        "motorcycle",
        "business"
      ],
      "errorMessage": {
        "type": "Pick the type of policy",
        "enum": "Pick one of the policy types"
      }
    },
    "coverageTier": {
      "type": "string",
      "title": "coverage level",
      "enum": [
        "minimum",
        "standard",
        "full"
      ],
      "errorMessage": {
        "type": "Pick your coverage level",
        "enum": "Pick minimum, standard or full"
      }
    },
    "bundle": {
      "type": "boolean",
      "title": "bundled policies",
      "errorMessage": {
        "type": "Answer yes or no"
      }
    },
    "monthlyPremium": {
      "type": "number",
      "title": "monthly premium",
      "minimum": 0,
      "maximum": 100000,
      "errorMessage": {
        "type": "Enter what you pay each month",
        "minimum": "A premium cannot be less than 0",
        "maximum": "That is higher than we can send"
      }
    },
    "renewalMonth": {
      "type": "string",
      "title": "renewal month",
      "pattern": "^[0-9]{4}-(0[1-9]|1[0-2])$",
      "errorMessage": {
        "type": "Enter your renewal month",
        "pattern": "Use the year and month, like 2027-04"
      }
    },
    "deductible": {
      "type": "number",
      "title": "deductible",
      "minimum": 0,
      "maximum": 25000,
      "errorMessage": {
        "type": "Enter your deductible",
        "minimum": "A deductible cannot be less than 0",
        "maximum": "That is higher than we can send"
      }
    },
    "yearsWithCarrier": {
      "type": "integer",
      "title": "years with this insurer",
      "minimum": 0,
      "maximum": 75,
      "errorMessage": {
        "type": "Enter a whole number of years",
        "minimum": "Years cannot be less than 0",
        "maximum": "That is more years than we can send"
      }
    },
    "cardIssuer": {
      "type": "string",
      "title": "card issuer",
      "minLength": 2,
      "maxLength": 60,
      "errorMessage": {
        "type": "Enter the bank that issued the card",
        "minLength": "Enter the name of the bank",
        "maxLength": "That name is too long to send"
      }
    },
    "cardType": {
      "type": "string",
      "title": "card name",
      "minLength": 2,
      "maxLength": 60,
      "errorMessage": {
        "type": "Enter the name of the card",
        "minLength": "Enter the name of the card",
        "maxLength": "That name is too long to send"
      }
    },
    "address": {
      "type": "string",
      "title": "address",
      "minLength": 5,
      "maxLength": 200,
      "errorMessage": {
        "type": "Enter your address",
        "minLength": "Enter the street, city, state and ZIP",
        "maxLength": "That address is too long to send"
      }
    },
    "dob": {
      "type": "string",
      "title": "date of birth",
      "format": "date",
      "errorMessage": {
        "type": "Enter your date of birth",
        "format": "Use the date as YYYY-MM-DD"
      }
    },
    "vin": {
      "type": "string",
      "title": "VIN",
      "pattern": "^[A-HJ-NPR-Za-hj-npr-z0-9]{17}$",
      "errorMessage": {
        "type": "Enter the VIN",
        "pattern": "A VIN is 17 characters, with no I, O or Q"
      }
    },
    "driverNames": {
      "type": "string",
      "title": "driver names",
      "minLength": 2,
      "maxLength": 200,
      "errorMessage": {
        "type": "Enter the drivers on the policy",
        "minLength": "Enter at least one name",
        "maxLength": "That list is too long to send"
      }
    },
    "policyNumber": {
      "type": "string",
      "title": "policy number",
      "pattern": "^[A-Za-z0-9 .#/-]{3,40}$",
      "errorMessage": {
        "type": "Enter your policy number",
        "pattern": "Letters, numbers, spaces and . # / - only, 3 to 40 characters"
      }
    },
    "phone": {
      "type": "string",
      "title": "phone number",
      "format": "phone",
      "maxLength": 24,
      "errorMessage": {
        "type": "Enter a phone number",
        "format": "A phone number is 10 digits",
        "maxLength": "That is longer than a phone number"
      }
    },
    "email": {
      "type": "string",
      "title": "email address",
      "format": "email",
      "maxLength": 120,
      "errorMessage": {
        "type": "Enter an email address",
        "format": "That doesn't look like an email address",
        "maxLength": "That address is too long to send"
      }
    }
  },
  "additionalProperties": false
}
