{
  "id": "tradle.CreditCard",
  "type": "tradle.Model",
  "title": "Credit Card",
  "subClassOf": "tradle.Form",
  "properties": {
    "cardType":  {
      "type": "string"
    },
    "cardNumber": {
      "type": "string"
    },
    "redactedCardNumber": {
      "type": "string",
      "readOnly": true
    },
    "expiryMonth": {
      "type": "number",
      "max": 12
    },
    "expiryYear": {
      "type": "number"
    },
    "cvv": {
      "type": "string"
    },
    "postalCode": {
      "type": "string"
    },
    "scanned": {
      "type": "boolean",
      "readOnly": true
    },
    "cardholderName": {
      "type": "string",
      "displayName": true
    },
    "scan": {
      "type": "object",
      "range": "photo",
      "scanner": "payment-card",
      "mainPhoto": true,
      "ref": "tradle.Photo"
    },
    "scanJson": {
      "type": "object",
      "title": "Extracted fields",
      "range": "json",
      "readOnly": true
    }
  },
  "required": [
    "cardType",
    "cardholderName",
    "cardNumber",
    "expiryMonth",
    "expiryYear",
    "cvv"
  ],
  "viewCols": [
    "cardType",
    "cardholderName",
    "cardNumber",
    "expiryMonth",
    "expiryYear",
    "cvv",
    "postalCode"
  ],
  "editCols": [
    "scan"
  ]
}