{
  "id": "tradle.Organization",
  "type": "tradle.Model",
  "title": "Organization",
  "sort": "lastMessageTime",
  "properties": {
    "name": {
      "type": "string",
      "displayName": true
    },
    "domain": {
      "type": "string",
      "description": "primary web domain"
    },
    "email": {
      "type": "string",
      "range": "email",
      "keyboard": "email-address"
    },
    "city": {
      "type": "string"
    },
    "country": {
      "type": "object",
      "ref": "tradle.Country"
    },
    "postalCode": {
      "type": "string"
    },
    "region": {
      "type": "string"
    },
    "street": {
      "type": "string"
    },
    "formattedAddress": {
      "type": "string",
      "displayAs": "{1}, {2}, {3}, {4}",
      "group": [
        "street",
        "city",
        "region",
        "postalCode"
      ],
      "title": "Address",
      "readOnly": true
    },
    "contacts": {
      "type": "array",
      "hidden": true,
      "readOnly": true,
      "items": {
        "type": "object",
        "ref": "tradle.Profile",
        "backlink": "organization"
      }
    },
    "lastMessage": {
      "type": "string"
    },
    "lastMessageTime": {
      "type": "date"
    },
    "inactive": {
      "type": "boolean"
    },
    "photos": {
      "type": "array",
      "range": "photo",
      "inlined": true,
      "items": {
        "ref": "tradle.Photo"
      }
    },
    "verifications": {
      "type": "array",
      "readOnly": true,
      "items": {
        "type": "object",
        "ref": "tradle.Verification",
        "backlink": "from"
      }
    },
    "forms": {
      "type": "array",
      "icon": "ios-paper-outline",
      "readOnly": true,
      "items": {
        "type": "object",
        "ref": "tradle.Form",
        "backlink": "to"
      }
    },
    "securityCodes": {
      "hidden": true,
      "type": "array",
      "readOnly": true,
      "items": {
        "type": "object",
        "ref": "tradle.SecurityCode",
        "backlink": "organization"
      }
    }
  },
  "required": [
    "name"
  ],
  "viewCols": [
    "name",
    "photos",
    "forms",
    "verifications"
  ],
  "gridCols": [
    "name",
    "lastMessage",
    "lastMessageTime"
  ],
  "editCols": [
    "name",
    "street",
    "city",
    "region",
    "country"
  ]
}
