{
  "id": "tradle.PhotoID",
  "type": "tradle.Model",
  "title": "Photo ID",
  "subClassOf": "tradle.Form",
  "interfaces": [
    "tradle.Verifiable",
    "tradle.Document"
  ],
  "verifiableAspects": {
    "authenticity": {
      "methods": [
        "tradle.VisualVerificationMethod"
      ]
    },
    "ownership": {
      "methods": [
        "tradle.VisualVerificationMethod"
      ]
    },
    "validity": {
      "methods": [
        "tradle.VisualVerificationMethod"
      ]
    }
  },
  "properties": {
    "_t": {
      "type": "string",
      "readOnly": true
    },
    "documentType": {
      "type": "object",
      "immutable": true,
      "ref": "tradle.IDCardType"
    },
    "country": {
      "type": "object",
      "title": "Country of Issue",
      "immutable": true,
      "ref": "tradle.Country"
    },
    "resourceTitle": {
      "type": "string",
      "readOnly": true,
      "displayName": true,
      "displayAs": "{1} {2}\n{3}, {4}",
      "group": [
        "firstName",
        "lastName",
        "documentType",
        "country"
      ]
    },
    "scan": {
      "type": "object",
      "range": "photo",
      "scanner": "id-document",
      "mainPhoto": true,
      "component": "Regula",
      "ref": "tradle.Photo",
      "sample": "scan.photoId"
    },
    "otherSideToScan": {
      "type": "string",
      "hidden": true
    },
    "otherSideScan": {
      "type": "object",
      "range": "photo",
      "title": "Back side scan",
      "inlined": true,
      "ref": "tradle.Photo"
    },
    "scanJson": {
      "type": "object",
      "title": "Extracted fields",
      "range": "json",
      "readOnly": true
    },
    "scannedBy": {
      "type": "object",
      "readOnly": true,
      "ref": "tradle.DocumentScanner"
    },
    "houseNumber": {
      "type": "string"
    },
    "street": {
      "type": "string"
    },
    "city": {
      "type": "string"
    },
    "region": {
      "type": "string"
    },
    "postalCode": {
      "type": "string"
    },
    "verifications": {
      "type": "array",
      "readOnly": true,
      "items": {
        "backlink": "document",
        "ref": "tradle.Verification"
      }
    },
    "personal_group": {
      "type": "string",
      "title": "Personal",
      "list": [
        "firstName",
        "lastName",
        "dateOfBirth"
      ]
    },
    "address_group": {
      "type": "string",
      "title": "Address",
      "list": [
        "full"
      ]
    },
    "addressDetails_group": {
      "type": "string",
      "title": "Address",
      "list": [
        "houseNumber",
        "street",
        "city",
        "postalCode",
        "region"
      ]
    },
    "document_group": {
      "type": "string",
      "title": "Document",
      "list": [
        "dateOfIssue",
        "documentNumber",
        "dateOfExpiry"
      ]
    },
    "idCardDocument_group": {
      "type": "string",
      "title": "ID Card Details",
      "list": [
        "documentNumber",
        "issuer",
        "dateOfExpiry"
      ]
    },
    "firstName": {
      "type": "string"
    },
    "lastName": {
      "type": "string"
    },
    "middleName": {
      "type": "string"
    },
    "lastNameAtBirth": {
      "type": "string"
    },
    "full": {
      "type": "string",
      "title": "Full address"
    },
    "dateOfIssue": {
      "type": "date"
    },
    "documentNumber": {
      "type": "string"
    },
    "documentVersion": {
      "type": "string"
    },
    "issuer": {
      "type": "string"
    },
    "dateOfExpiry": {
      "type": "date"
    },
    "sex": {
      "type": "object",
      "ref": "tradle.Sex"
    },
    "dateOfBirth": {
      "type": "date"
    },
    "nationality": {
      "type": "object",
      "ref": "tradle.Country"
    },
    "uploaded": {
      "type": "boolean"
    },
    "face": {
      "type": "object",
      "ref": "tradle.Photo"
    },
    "rfidFace": {
      "type": "object",
      "ref": "tradle.Photo"
    },
    "signature": {
      "type": "object",
      "ref": "tradle.Photo"
    }
  },
  "required": [
    "documentType",
    "country",
    "scan"
  ],
  "hidden": [
    "scanJson"
  ],
  "editCols": [
    "documentType",
    "scan"
  ],
  "viewCols": [
    "documentType",
    "country",
    "scan",
    "otherSideScan",
    "personal_group",
    "middleName",
    "nationality",
    "sex",
    "document_group",
    "address_group",
    "issuer",
    "documentVersion"
  ]
}
