[
  {
    "context": "crm",
    "nameSpace": "XM",
    "type": "Customer",
    "table": "crmacct",
    "isExtension": true,
    "isChild": true,
    "comment": "Extended by Crm",
    "relations": [
      {
        "column": "crmacct_cust_id",
        "inverse": "id"
      }
    ],
    "properties": [
     {
       "name": "account",
       "toOne": {
         "isNested": true,
         "type": "AccountRelation",
         "column": "crmacct_id"
      }
     },
     {
        "name": "contactRelations",
        "toMany": {
          "type": "CustomerContactRelation",
          "column": "crmacct_number",
          "inverse": "account"
        }
      },
      {
        "name": "incidentRelations",
        "toMany": {
          "type": "CustomerIncidentRelation",
          "column": "crmacct_number",
          "inverse": "account"
        }
      },
      {
        "name": "opportunityRelations",
        "toMany": {
          "type": "CustomerOpportunityRelation",
          "column": "crmacct_number",
          "inverse": "account"
        }
      },
      {
        "name": "toDoRelations",
        "toMany": {
          "type": "CustomerToDoRelation",
          "column": "crmacct_number",
          "inverse": "account"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "crm",
    "nameSpace": "XM",
    "type": "CustomerRelation",
    "table": "crmacct",
    "isExtension": true,
    "isChild": true,
    "comment": "Extended by Crm",
    "relations": [
      {
        "column": "crmacct_cust_id",
        "inverse": "id"
      }
    ],
    "properties": [
      {
        "name": "account",
        "attr": {
         "type": "String",
         "column": "crmacct_number"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerContactRelation",
    "table": "xt.cntctinfo",
    "comment": "Customer 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"
        ]
      }
    },
    "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": "String",
          "column": "cntct_phone"
        }
      },
      {
        "name": "alternate",
        "attr": {
          "type": "String",
          "column": "cntct_phone2"
        }
      },
      {
        "name": "fax",
        "attr": {
          "type": "String",
          "column": "cntct_fax"
        }
      },
      {
        "name": "primaryEmail",
        "attr": {
          "type": "String",
          "column": "cntct_email"
        }
      },
      {
        "name": "webAddress",
        "attr": {
          "type": "String",
          "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": "CustomerOpportunityRelation",
    "table": "xt.opheadinfo",
    "comment": "Opporunity Relation Map",
    "privileges": {
      "all": {
        "create": false,
        "read": "ViewAllOpportunities MaintainAllOpportunities",
        "update": false,
        "delete": false
      },
      "personal": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false,
        "properties": [
          "owner.username",
          "assignedTo.username"
        ]
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "ophead_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "ophead_number",
          "isNaturalKey":true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "ophead_name"
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "ophead_active"
        }
      },
      {
        "name": "opportunityStage",
        "toOne": {
          "type": "OpportunityStage",
          "column": "ophead_opstage_id"
        }
      },
      {
        "name": "targetClose",
        "attr": {
          "type": "Date",
          "column": "ophead_target_date"
        }
      },
      {
        "name": "owner",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "ophead_owner_username",
          "inverse": "username"
        }
      },
      {
        "name": "assignedTo",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "ophead_username",
          "inverse": "username"
        }
      },
      {
        "name": "account",
        "attr": {
          "type": "String",
          "column": "crmacct_number"
        }
      },
      {
        "name": "contact",
        "attr": {
          "type": "String",
          "column": "cntct_number"
        }
      }
    ],
    "isSystem": true
  },
 {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerToDoRelation",
    "table": "xt.todoiteminfo",
    "comment": "Todo Relation Map",
    "privileges": {
      "all": {
        "create": false,
        "read": "ViewAllToDoItems MaintainAllToDoItems",
        "update": false,
        "delete": false
      },
      "personal": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false,
        "properties": [
          "owner.username",
          "assignedTo.username"
        ]
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "todoitem_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "todoitem_name"
        }
      },
      {
        "name": "description",
        "attr": {
          "type": "String",
          "column": "todoitem_description"
        }
      },
      {
        "name": "dueDate",
        "attr": {
          "type": "Date",
          "column": "todoitem_due_date"
        }
      },
      {
        "name": "contact",
        "attr": {
          "type": "String",
          "column": "cntct_number"
        }
      },
      {
        "name": "status",
        "attr": {
          "type": "String",
          "column": "todoitem_status"
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "todoitem_active"
        }
      },
      {
        "name": "owner",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "todoitem_owner_username",
          "inverse": "username"
        }
      },
      {
        "name": "assignedTo",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "todoitem_username",
          "inverse": "username"
        }
      },
      {
        "name": "account",
        "attr": {
          "type": "String",
          "column": "crmacct_number"
        }
      },
      {
        "name": "priority",
        "toOne": {
          "type": "Priority",
          "column": "todoitem_priority_id"
        }
      },
      {
        "name": "priorityOrder",
        "attr": {
          "type": "Number",
          "column": "priority_order"
        }
      }
    ],
    "isSystem": true,
    "extensions": []
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerIncidentRelation",
    "table": "xt.incdtinfo",
    "comment": "Incident Relation Map",
    "privileges": {
      "all": {
        "create": false,
        "read": "ViewAllIncidents MaintainAllIncidents",
        "update": false,
        "delete": false
      },
      "personal": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false,
        "properties": [
          "owner.username",
          "assignedTo.username"
        ]
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "incdt_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "incdt_number",
          "isNaturalKey":true
        }
      },
      {
        "name": "description",
        "attr": {
          "type": "String",
          "column": "incdt_summary"
        }
      },
      {
        "name": "status",
        "attr": {
          "type": "String",
          "column": "incdt_status"
        }
      },
      {
        "name": "owner",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "incdt_owner_username",
          "inverse": "username"
        }
      },
      {
        "name": "assignedTo",
        "toOne": {
          "isNested": true,
          "type": "UserAccountRelation",
          "column": "incdt_assigned_username",
          "inverse": "username"
        }
      },
      {
        "name": "updated",
        "attr": {
          "type": "Date",
          "column": "incdt_updated"
        }
      },
      {
        "name": "account",
        "attr": {
          "type": "String",
          "column": "crmacct_number"
        }
      },
      {
        "name": "contact",
        "attr": {
          "type": "String",
          "column": "cntct_number"
        }
      }
    ],
    "isSystem": true
  }
]
