[
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "Contact",
    "table": "cntct",
    "idSequenceName": "cntct_cntct_id_seq",
    "isRest": true,
    "lockable": true,
    "orderSequence": "ContactNumber",
    "comment": "Contact Map",
    "privileges": {
      "all": {
        "create": "MaintainAllContacts",
        "read": "ViewAllContacts",
        "update": "MaintainAllContacts",
        "delete": "MaintainAllContacts"
      },
      "personal": {
        "create": "MaintainPersonalContacts",
        "read": "ViewPersonalContacts",
        "update": "MaintainPersonalContacts",
        "delete": "MaintainPersonalContacts",
        "properties": [
          "owner.username",
          "crmaccountUsers"
        ]
      },
      "attribute": {
        "owner": {
          "create": "EditOwner",
          "update": "EditOwner"
        },
        "crmaccountUsers": {
          "view": false,
          "create": false,
          "update": false
        }
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "cntct_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "cntct_number",
          "isNaturalKey": true
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "cntct_active"
        }
      },
      {
        "name": "honorific",
        "attr": {
          "type": "String",
          "column": "cntct_honorific"
        }
      },
      {
        "name": "firstName",
        "attr": {
          "type": "String",
          "column": "cntct_first_name"
        }
      },
      {
        "name": "middleName",
        "attr": {
          "type": "String",
          "column": "cntct_middle"
        }
      },
      {
        "name": "lastName",
        "attr": {
          "type": "String",
          "column": "cntct_last_name"
        }
      },
      {
        "name": "suffix",
        "attr": {
          "type": "String",
          "column": "cntct_suffix"
        }
      },
      {
        "name": "jobTitle",
        "attr": {
          "type": "String",
          "column": "cntct_title"
        }
      },
      {
        "name": "initials",
        "attr": {
          "type": "String",
          "column": "cntct_initials"
        }
      },
      {
        "name": "phone",
        "attr": {
          "type": "Phone",
          "column": "cntct_phone"
        }
      },
      {
        "name": "alternate",
        "attr": {
          "type": "Phone",
          "column": "cntct_phone2"
        }
      },
      {
        "name": "fax",
        "attr": {
          "type": "Phone",
          "column": "cntct_fax"
        }
      },
      {
        "name": "primaryEmail",
        "attr": {
          "type": "Email",
          "column": "cntct_email"
        }
      },
      {
        "name": "webAddress",
        "attr": {
          "type": "Url",
          "column": "cntct_webaddr"
        }
      },
      {
        "name": "account",
        "toOne": {
          "isNested": true,
          "type": "AccountRelation",
          "column": "cntct_crmacct_id"
        }
      },
      {
        "name": "owner",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "cntct_owner_username",
          "inverse": "username"
        }
      },
      {
        "name": "notes",
        "attr": {
          "type": "String",
          "column": "cntct_notes"
        }
      },
      {
        "name": "address",
        "toOne": {
          "isNested": true,
          "type": "AddressInfo",
          "column": "cntct_addr_id"
        }
      },
      {
        "name": "email",
        "toMany": {
          "type": "ContactEmail",
          "column": "cntct_id",
          "inverse": "contact",
          "isNested": true
        }
      },
      {
        "name": "comments",
        "toMany": {
          "type": "ContactComment",
          "column": "cntct_id",
          "inverse": "contact",
          "isNested": true
        }
      },
      {
        "name": "characteristics",
        "toMany": {
          "type": "ContactCharacteristic",
          "column": "cntct_id",
          "inverse": "contact",
          "isNested": true
        }
      },
      {
        "name": "documents",
        "toMany": {
          "type": "DocumentAssociation",
          "column": "cntct_id",
          "inverse": "source",
          "sourceType": "T",
          "isNested": true
        }
      },
      {
        "name": "crmaccountUsers",
        "toMany": {
          "type": "ShareUsers",
          "column": "obj_uuid",
          "inverse": "uuid"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ContactInfo",
    "table": "cntct",
    "isRest": true,
    "idSequenceName": "cntct_cntct_id_seq",
    "orderSequence": "ContactNumber",
    "comment": "Contact Info Map",
    "privileges": {
      "all": {
        "create": "MaintainAllContacts",
        "read": "ViewAllContacts",
        "update": "MaintainAllContacts",
        "delete": "MaintainAllContacts"
      },
      "personal": {
        "create": "MaintainPersonalContacts",
        "read": "ViewPersonalContacts",
        "update": "MaintainPersonalContacts",
        "delete": "MaintainPersonalContacts",
        "properties": [
          "owner.username",
          "account.number"
        ]
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "cntct_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "cntct_number",
          "isNaturalKey": true
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "cntct_active"
        }
      },
      {
        "name": "honorific",
        "attr": {
          "type": "String",
          "column": "cntct_honorific"
        }
      },
      {
        "name": "firstName",
        "attr": {
          "type": "String",
          "column": "cntct_first_name"
        }
      },
      {
        "name": "middleName",
        "attr": {
          "type": "String",
          "column": "cntct_middle"
        }
      },
      {
        "name": "lastName",
        "attr": {
          "type": "String",
          "column": "cntct_last_name"
        }
      },
      {
        "name": "suffix",
        "attr": {
          "type": "String",
          "column": "cntct_suffix"
        }
      },
      {
        "name": "jobTitle",
        "attr": {
          "type": "String",
          "column": "cntct_title"
        }
      },
      {
        "name": "initials",
        "attr": {
          "type": "String",
          "column": "cntct_initials"
        }
      },
      {
        "name": "phone",
        "attr": {
          "type": "Phone",
          "column": "cntct_phone"
        }
      },
      {
        "name": "alternate",
        "attr": {
          "type": "Phone",
          "column": "cntct_phone2"
        }
      },
      {
        "name": "fax",
        "attr": {
          "type": "Phone",
          "column": "cntct_fax"
        }
      },
      {
        "name": "primaryEmail",
        "attr": {
          "type": "Email",
          "column": "cntct_email"
        }
      },
      {
        "name": "webAddress",
        "attr": {
          "type": "Url",
          "column": "cntct_webaddr"
        }
      },
      {
        "name": "owner",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "cntct_owner_username",
          "inverse": "username"
        }
      },
      {
        "name": "address",
        "toOne": {
          "isNested": true,
          "type": "AddressInfo",
          "column": "cntct_addr_id"
        }
      },
      {
        "name": "email",
        "toMany": {
          "type": "ContactEmail",
          "column": "cntct_id",
          "inverse": "contact",
          "isNested": true
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ContactCharacteristic",
    "table": "charass",
    "idSequenceName": "charass_charass_id_seq",
    "comment": "Contact Characteristic Map",
    "privileges": {
      "all": {
        "create": true,
        "read": true,
        "update": true,
        "delete": true
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "charass_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "targetType",
        "attr": {
          "type": "String",
          "column": "charass_target_type",
          "value": "CNTCT"
        }
      },
      {
        "name": "contact",
        "attr": {
          "type": "Number",
          "column": "charass_target_id"
        }
      },
      {
        "name": "characteristic",
        "toOne": {
          "type": "Characteristic",
          "column": "charass_char_id",
          "required": true
        }
      },
      {
        "name": "value",
        "attr": {
          "type": "String",
          "column": "charass_value"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ContactListItemCharacteristic",
    "table": "charass",
    "comment": "Contact List Item Characteristic Map",
    "privileges": {
      "all": {
        "create": true,
        "read": true,
        "update": true,
        "delete": true
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "charass_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "targetType",
        "attr": {
          "type": "String",
          "column": "charass_target_type",
          "value": "CNTCT"
        }
      },
      {
        "name": "contact",
        "attr": {
          "type": "Number",
          "column": "charass_target_id"
        }
      },
      {
        "name": "characteristic",
        "toOne": {
          "type": "Characteristic",
          "column": "charass_char_id",
          "required": true
        }
      },
      {
        "name": "value",
        "attr": {
          "type": "String",
          "column": "charass_value"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ContactComment",
    "table": "comment",
    "idSequenceName": "comment_comment_id_seq",
    "comment": "Contact Comment Map",
    "privileges": {
      "all": {
        "create": true,
        "read": true,
        "update": "EditOthersComments",
        "delete": false
      },
      "personal": {
        "update": "EditOwnComments",
        "properties": [
          "createdBy"
        ]
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "comment_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "sourceType",
        "attr": {
          "type": "String",
          "column": "comment_source",
          "value": "T"
        }
      },
      {
        "name": "contact",
        "attr": {
          "type": "Number",
          "column": "comment_source_id"
        }
      },
      {
        "name": "commentType",
        "toOne": {
          "type": "CommentType",
          "column": "comment_cmnttype_id",
          "required": true
        }
      },
      {
        "name": "text",
        "attr": {
          "type": "String",
          "column": "comment_text"
        }
      },
      {
        "name": "isPublic",
        "attr": {
          "type": "Boolean",
          "column": "comment_public",
          "value": true
        }
      },
      {
        "name": "created",
        "attr": {
          "type": "Date",
          "column": "comment_date"
        }
      },
      {
        "name": "createdBy",
        "attr": {
          "type": "String",
          "column": "comment_user"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ContactEmail",
    "table": "cntcteml",
    "idSequenceName": "cntcteml_cntcteml_id_seq",
    "comment": "Contact Email Map",
    "privileges": {
      "all": {
        "create": true,
        "read": true,
        "update": true,
        "delete": true
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "cntcteml_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "contact",
        "attr": {
          "type": "Number",
          "column": "cntcteml_cntct_id"
        }
      },
      {
        "name": "email",
        "attr": {
          "type": "Email",
          "column": "cntcteml_email",
          "required": true
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ContactListItem",
    "table": "xt.cntctinfo",
    "isRest": true,
    "comment": "Contact List Item Map",
    "privileges": {
      "all": {
        "create": false,
        "read": "ViewAllContacts MaintainAllContacts",
        "update": false,
        "delete": false
      },
      "personal": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false,
        "properties": [
          "owner.username",
          "account.number"
        ]
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "cntct_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "cntct_number",
          "isNaturalKey": true
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "cntct_active"
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "cntct_name"
        }
      },
      {
        "name": "firstName",
        "attr": {
          "type": "String",
          "column": "cntct_first_name"
        }
      },
      {
        "name": "lastName",
        "attr": {
          "type": "String",
          "column": "cntct_last_name"
        }
      },
      {
        "name": "jobTitle",
        "attr": {
          "type": "String",
          "column": "cntct_title"
        }
      },
      {
        "name": "phone",
        "attr": {
          "type": "Phone",
          "column": "cntct_phone"
        }
      },
      {
        "name": "alternate",
        "attr": {
          "type": "Phone",
          "column": "cntct_phone2"
        }
      },
      {
        "name": "fax",
        "attr": {
          "type": "Phone",
          "column": "cntct_fax"
        }
      },
      {
        "name": "primaryEmail",
        "attr": {
          "type": "Email",
          "column": "cntct_email"
        }
      },
      {
        "name": "webAddress",
        "attr": {
          "type": "Url",
          "column": "cntct_webaddr"
        }
      },
      {
        "name": "address",
        "toOne": {
          "isNested": true,
          "type": "AddressInfo",
          "column": "cntct_addr_id"
        }
      },
      {
        "name": "owner",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "cntct_owner_username",
          "inverse": "username"
        }
      },
      {
        "name": "account",
        "toOne": {
          "isNested": true,
          "type": "AccountRelation",
          "column": "cntct_crmacct_id"
        }
      },
      {
        "name": "characteristics",
        "toMany": {
          "type": "ContactListItemCharacteristic",
          "column": "cntct_id",
          "inverse": "contact",
          "isNested": true
        }
      },
      {
        "name": "accountParent",
        "attr": {
          "type": "String",
          "column": "crmacct_parent_number"
        }
      }
    ],
    "extensions": [],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ContactRelation",
    "table": "xt.cntctinfo",
    "isRest": true,
    "comment": "Contact Relation Map",
    "privileges": {
      "all": {
        "create": false,
        "read": "ViewAllContacts MaintainAllContacts",
        "update": false,
        "delete": false
      },
      "personal": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false,
        "properties": [
          "owner.username",
          "account.number"
        ]
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "cntct_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "cntct_number",
          "isNaturalKey": true
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "cntct_active"
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "cntct_name"
        }
      },
      {
        "name": "honorific",
        "attr": {
          "type": "String",
          "column": "cntct_honorific"
        }
      },
      {
        "name": "firstName",
        "attr": {
          "type": "String",
          "column": "cntct_first_name"
        }
      },
      {
        "name": "middleName",
        "attr": {
          "type": "String",
          "column": "cntct_middle"
        }
      },
      {
        "name": "lastName",
        "attr": {
          "type": "String",
          "column": "cntct_last_name"
        }
      },
      {
        "name": "suffix",
        "attr": {
          "type": "String",
          "column": "cntct_suffix"
        }
      },
      {
        "name": "jobTitle",
        "attr": {
          "type": "String",
          "column": "cntct_title"
        }
      },
      {
        "name": "phone",
        "attr": {
          "type": "Phone",
          "column": "cntct_phone"
        }
      },
      {
        "name": "alternate",
        "attr": {
          "type": "Phone",
          "column": "cntct_phone2"
        }
      },
      {
        "name": "fax",
        "attr": {
          "type": "Phone",
          "column": "cntct_fax"
        }
      },
      {
        "name": "primaryEmail",
        "attr": {
          "type": "Email",
          "column": "cntct_email"
        }
      },
      {
        "name": "webAddress",
        "attr": {
          "type": "Url",
          "column": "cntct_webaddr"
        }
      },
      {
        "name": "address",
        "toOne": {
          "isNested": true,
          "type": "AddressInfo",
          "column": "cntct_addr_id"
        }
      },
      {
        "name": "owner",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "cntct_owner_username",
          "inverse": "username"
        }
      },
      {
        "name": "account",
        "attr": {
          "type": "String",
          "column": "crmacct_number"
        }
      },
      {
        "name": "accountParent",
        "attr": {
          "type": "String",
          "column": "crmacct_parent_number"
        }
      }
    ],
    "extensions": [],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "Honorific",
    "table": "hnfc",
    "isRest": true,
    "idSequenceName": "hnfc_hnfc_id_seq",
    "lockable": true,
    "comment": "Honorific Map",
    "privileges": {
      "all": {
        "create": "MaintainTitles",
        "read": true,
        "update": "MaintainTitles",
        "delete": "MaintainTitles"
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "hnfc_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "code",
        "attr": {
          "type": "String",
          "column": "hnfc_code",
          "isNaturalKey": true
        }
      }
    ],
    "isSystem": true
  }
]
