[
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "Customer",
    "table": "custinfo",
    "isRest": true,
    "lockable": true,
    "orderSequence": "CRMAccountNumber",
    "comment": "Customer Map",
    "privileges": {
      "all": {
        "create": "MaintainCustomerMasters",
        "read": "ViewCustomerMasters",
        "update": "MaintainCustomerMasters",
        "delete": "MaintainCustomerMasters"
      },
      "personal":{
        "create":"MaintainPersonalCRMAccounts",
        "read":"ViewPersonalCRMAccounts",
        "update":"MaintainPersonalCRMAccounts",
        "delete":"MaintainPersonalCRMAccounts",
        "properties":[
          "account.owner.username",
          "account.userAccount.username",
          "account.number",
          "crmaccountUsers"
        ]
      },
      "attribute": {
        "creditStatus": {
          "create": "UpdateCustomerCreditStatus",
          "update": "UpdateCustomerCreditStatus"
        },
        "crmaccountUsers": {
          "view": false,
          "create": false,
          "update": false
        }
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "cust_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "cust_number",
          "isNaturalKey": true,
          "required": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "cust_name",
          "required": true
        }
      },
      {
        "name": "customerType",
        "toOne": {
          "type": "CustomerType",
          "column": "cust_custtype_id",
          "required": true
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "cust_active",
          "required": true
        }
      },
      {
        "name": "notes",
        "attr": {
          "type": "String",
          "column": "cust_comments"
        }
      },
      {
        "name": "billingContact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "cust_cntct_id",
          "inverse": "id"
        }
      },
      {
        "name": "correspondenceContact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "cust_corrcntct_id",
          "inverse": "id"
        }
      },
      {
        "name": "salesRep",
        "toOne": {
          "type": "SalesRep",
          "column": "cust_salesrep_id",
          "required": true
        }
      },
      {
        "name": "commission",
        "attr": {
          "type": "Percent",
          "column": "cust_commprcnt"
        }
      },
      {
        "name": "shipVia",
        "attr": {
          "type": "String",
          "column": "cust_shipvia"
        }
      },
      {
        "name": "shipCharge",
        "toOne": {
          "type": "ShipCharge",
          "column": "cust_shipchrg_id",
          "required": true
        }
      },
      {
        "name": "isFreeFormShipto",
        "attr": {
          "type": "Boolean",
          "column": "cust_ffshipto",
          "required": true
        }
      },
      {
        "name": "isFreeFormBillto",
        "attr": {
          "type": "Boolean",
          "column": "cust_ffbillto",
          "required": true
        }
      },
      {
        "name": "terms",
        "toOne": {
          "type": "Terms",
          "column": "cust_terms_id",
          "required": true
        }
      },
      {
        "name": "discount",
        "attr": {
          "type": "Percent",
          "column": "cust_discntprcnt",
          "required": true
        }
      },
      {
        "name": "currency",
        "toOne": {
          "type": "Currency",
          "column": "cust_curr_id",
          "defalutValue": "baseCurrency"
        }
      },
      {
        "name": "creditStatus",
        "attr": {
          "type": "String",
          "column": "cust_creditstatus",
          "required": true
        }
      },
      {
        "name": "balanceMethod",
        "attr": {
          "type": "String",
          "column": "cust_balmethod",
          "required": true
        }
      },
      {
        "name": "creditLimit",
        "attr": {
          "type": "Number",
          "column": "cust_creditlmt"
        }
      },
      {
        "name": "creditLimitCurrency",
        "toOne": {
          "type": "Currency",
          "column": "cust_creditlmt_curr_id"
        }
      },
      {
        "name": "creditRating",
        "attr": {
          "type": "String",
          "column": "cust_creditrating"
        }
      },
      {
        "name": "graceDays",
        "attr": {
          "type": "Number",
          "column": "cust_gracedays"
        }
      },
      {
        "name": "taxZone",
        "toOne": {
          "type": "TaxZone",
          "column": "cust_taxzone_id"
        }
      },
      {
        "name": "shiptos",
        "toMany": {
          "isNested": true,
          "type": "CustomerShipto",
          "column": "cust_id",
          "inverse": "customer"
        }
      },
      {
        "name": "comments",
        "toMany": {
          "isNested": true,
          "type": "CustomerComment",
          "column": "cust_id",
          "inverse": "customer"
        }
      },
      {
        "name": "taxRegistration",
        "toMany": {
          "isNested": true,
          "type": "CustomerTaxRegistration",
          "column": "cust_id",
          "inverse": "customer"
        }
      },
      {
        "name": "characteristics",
        "toMany": {
          "isNested": true,
          "type": "CustomerCharacteristic",
          "column": "cust_id",
          "inverse": "customer"
        }
      },
      {
        "name": "backorder",
        "attr": {
          "type": "Boolean",
          "column": "cust_backorder",
          "required": true
        }
      },
      {
        "name": "partialShip",
        "attr": {
          "type": "Boolean",
          "column": "cust_partialship",
          "required": true
        }
      },
      {
        "name": "blanketPurchaseOrders",
        "attr": {
          "type": "Boolean",
          "column": "cust_blanketpos",
          "required": true
        }
      },
      {
        "name": "usesPurchaseOrders",
        "attr": {
          "type": "Boolean",
          "column": "cust_usespos",
          "required": true
        }
      },
      {
        "name": "autoUpdateStatus",
        "attr": {
          "type": "Boolean",
          "column": "cust_autoupdatestatus",
          "required": true
        }
      },
      {
        "name": "autoHoldOrders",
        "attr": {
          "type": "Boolean",
          "column": "cust_autoholdorders",
          "required": true
        }
      },
      {
        "name": "preferredSite",
        "toOne": {
          "type": "SiteRelation",
          "column": "cust_preferred_warehous_id",
          "nullValue": -1
        }
      },
      {
        "name": "documents",
        "toMany": {
          "type": "DocumentAssociation",
          "column": "cust_id",
          "inverse": "source",
          "sourceType": "C",
          "isNested": true
        }
      },
      {
        "name": "creditCards",
        "toMany": {
          "isNested": true,
          "type": "CreditCard",
          "column": "cust_id",
          "inverse": "customer"
        }
      },
      {
        "name": "crmaccountUsers",
        "toMany": {
          "type": "ShareUsers",
          "column": "obj_uuid",
          "inverse": "uuid"
        }
      }
    ],
    "extensions": [{
      "table": "xt.custcustemlprofile",
      "isExtension": true,
      "relations": [
        {
          "column": "custcustemlprofile_cust_id",
          "inverse": "id"
        }
      ],
      "properties": [
        {
          "name": "emailProfile",
          "toOne": {
            "type": "CustomerEmailProfile",
            "column": "custcustemlprofile_custemlprofile_id"
          }
        }
      ]
    }],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "SalesCustomer",
    "table": "custinfo",
    "idSequenceName": "cust_cust_id_seq",
    "orderSequence": "CRMAccountNumber",
    "comment": "Customer Map",
    "privileges": {
      "all": {
        "create": "MaintainSalesOrders",
        "read": "ViewSalesOrders ViewAROpenItems EditAROpenItem",
        "update": "MaintainSalesOrders",
        "delete": "MaintainSalesOrders"
      },
      "attribute": {
        "creditStatus": {
          "create": "UpdateCustomerCreditStatus",
          "update": "UpdateCustomerCreditStatus"
        }
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "cust_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "cust_number",
          "isNaturalKey": true,
          "required": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "cust_name",
          "required": true
        }
      },
      {
        "name": "customerType",
        "toOne": {
          "type": "CustomerType",
          "column": "cust_custtype_id",
          "required": true
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "cust_active",
          "required": true
        }
      },
      {
        "name": "notes",
        "attr": {
          "type": "String",
          "column": "cust_comments"
        }
      },
      {
        "name": "billingContact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "cust_cntct_id",
          "inverse": "id"
        }
      },
      {
        "name": "correspondenceContact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "cust_corrcntct_id",
          "inverse": "id"
        }
      },
      {
        "name": "salesRep",
        "toOne": {
          "type": "SalesRep",
          "column": "cust_salesrep_id",
          "required": true
        }
      },
      {
        "name": "commission",
        "attr": {
          "type": "Percent",
          "column": "cust_commprcnt"
        }
      },
      {
        "name": "shipVia",
        "attr": {
          "type": "String",
          "column": "cust_shipvia"
        }
      },
      {
        "name": "shipCharge",
        "toOne": {
          "type": "ShipCharge",
          "column": "cust_shipchrg_id",
          "required": true
        }
      },
      {
        "name": "isFreeFormShipto",
        "attr": {
          "type": "Boolean",
          "column": "cust_ffshipto",
          "required": true
        }
      },
      {
        "name": "isFreeFormBillto",
        "attr": {
          "type": "Boolean",
          "column": "cust_ffbillto",
          "required": true
        }
      },
      {
        "name": "terms",
        "toOne": {
          "type": "Terms",
          "column": "cust_terms_id",
          "required": true
        }
      },
      {
        "name": "discount",
        "attr": {
          "type": "Percent",
          "column": "cust_discntprcnt",
          "required": true
        }
      },
      {
        "name": "currency",
        "toOne": {
          "type": "Currency",
          "column": "cust_curr_id",
          "defalutValue": "baseCurrency"
        }
      },
      {
        "name": "creditStatus",
        "attr": {
          "type": "String",
          "column": "cust_creditstatus",
          "required": true
        }
      },
      {
        "name": "balanceMethod",
        "attr": {
          "type": "String",
          "column": "cust_balmethod",
          "required": true
        }
      },
      {
        "name": "creditLimit",
        "attr": {
          "type": "Number",
          "column": "cust_creditlmt"
        }
      },
      {
        "name": "creditLimitCurrency",
        "toOne": {
          "type": "Currency",
          "column": "cust_creditlmt_curr_id"
        }
      },
      {
        "name": "creditRating",
        "attr": {
          "type": "String",
          "column": "cust_creditrating"
        }
      },
      {
        "name": "graceDays",
        "attr": {
          "type": "Number",
          "column": "cust_gracedays"
        }
      },
      {
        "name": "taxZone",
        "toOne": {
          "type": "TaxZone",
          "column": "cust_taxzone_id"
        }
      },
      {
        "name": "shiptos",
        "toMany": {
          "isNested": true,
          "type": "CustomerShipto",
          "column": "cust_id",
          "inverse": "customer"
        }
      },
      {
        "name": "backorder",
        "attr": {
          "type": "Boolean",
          "column": "cust_backorder",
          "required": true
        }
      },
      {
        "name": "partialShip",
        "attr": {
          "type": "Boolean",
          "column": "cust_partialship",
          "required": true
        }
      },
      {
        "name": "blanketPurchaseOrders",
        "attr": {
          "type": "Boolean",
          "column": "cust_blanketpos",
          "required": true
        }
      },
      {
        "name": "usesPurchaseOrders",
        "attr": {
          "type": "Boolean",
          "column": "cust_usespos",
          "required": true
        }
      },
      {
        "name": "autoUpdateStatus",
        "attr": {
          "type": "Boolean",
          "column": "cust_autoupdatestatus",
          "required": true
        }
      },
      {
        "name": "autoHoldOrders",
        "attr": {
          "type": "Boolean",
          "column": "cust_autoholdorders",
          "required": true
        }
      },
      {
        "name": "preferredSite",
        "toOne": {
          "type": "SiteRelation",
          "column": "cust_preferred_warehous_id",
          "nullValue": -1
        }
      },
      {
        "name": "creditCards",
        "toMany": {
          "isNested": true,
          "type": "CreditCard",
          "column": "cust_id",
          "inverse": "customer"
        }
      }
    ],
    "extensions": [],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "BillingCustomer",
    "table": "custinfo",
    "idSequenceName": "cust_cust_id_seq",
    "orderSequence": "CRMAccountNumber",
    "comment": "Customer Map for Billing",
    "privileges": {
      "all": {
        "create": false,
        "read": "ViewMiscInvoices ViewCreditMemos",
        "update": false,
        "delete": false
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "cust_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "cust_number",
          "isNaturalKey": true,
          "required": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "cust_name",
          "required": true
        }
      },
      {
        "name": "customerType",
        "toOne": {
          "type": "CustomerType",
          "column": "cust_custtype_id",
          "required": true
        }
      },
      {
        "name": "customerGroups",
        "toMany": {
          "isNested": true,
          "type": "CustomerCustomerGroup",
          "column": "cust_id",
          "inverse": "customer"
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "cust_active",
          "required": true
        }
      },
      {
        "name": "notes",
        "attr": {
          "type": "String",
          "column": "cust_comments"
        }
      },
      {
        "name": "billingContact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "cust_cntct_id",
          "inverse": "id"
        }
      },
      {
        "name": "salesRep",
        "toOne": {
          "type": "SalesRep",
          "column": "cust_salesrep_id",
          "required": true
        }
      },
      {
        "name": "commission",
        "attr": {
          "type": "Percent",
          "column": "cust_commprcnt"
        }
      },
      {
        "name": "terms",
        "toOne": {
          "type": "Terms",
          "column": "cust_terms_id",
          "required": true
        }
      },
      {
        "name": "taxZone",
        "toOne": {
          "type": "TaxZone",
          "column": "cust_taxzone_id"
        }
      },
      {
        "name": "isFreeFormBillto",
        "attr": {
          "type": "Boolean",
          "column": "cust_ffbillto",
          "required": true
        }
      },
      {
        "name": "shiptos",
        "toMany": {
          "isNested": true,
          "type": "CustomerShipto",
          "column": "cust_id",
          "inverse": "customer"
        }
      },
      {
        "name": "currency",
        "toOne": {
          "type": "Currency",
          "column": "cust_curr_id",
          "defalutValue": "baseCurrency"
        }
      }
    ],
    "extensions": [{
      "table": "xt.custcustemlprofile",
      "isExtension": true,
      "relations": [
        {
          "column": "custcustemlprofile_cust_id",
          "inverse": "id"
        }
      ],
      "properties": [
        {
          "name": "emailProfile",
          "toOne": {
            "type": "CustomerEmailProfile",
            "column": "custcustemlprofile_custemlprofile_id"
          }
        }
      ]
    }],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerEmailProfile",
    "table": "xt.custemlprofile",
    "isRest": true,
    "idSequenceName": "emlprofile_emlprofile_id_seq",
    "comment": "Customer Email Profile Map",
    "privileges": {
      "all": {
        "create": "MaintainCustomerEmailProfiles",
        "read": true,
        "update": "MaintainCustomerEmailProfiles",
        "delete": "MaintainCustomerEmailProfiles"
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "emlprofile_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "emlprofile_name",
          "isNaturalKey": true
        }
      },
      {
        "name": "description",
        "attr": {
          "type": "String",
          "column": "emlprofile_descrip"
        }
      },
      {
        "name": "from",
        "attr": {
          "type": "String",
          "column": "emlprofile_from"
        }
      },
      {
        "name": "replyTo",
        "attr": {
          "type": "String",
          "column": "emlprofile_replyto"
        }
      },
      {
        "name": "to",
        "attr": {
          "type": "String",
          "column": "emlprofile_to"
        }
      },
      {
        "name": "cc",
        "attr": {
          "type": "String",
          "column": "emlprofile_cc"
        }
      },
      {
        "name": "bcc",
        "attr": {
          "type": "String",
          "column": "emlprofile_bcc"
        }
      },
      {
        "name": "subject",
        "attr": {
          "type": "String",
          "column": "emlprofile_subject"
        }
      },
      {
        "name": "body",
        "attr": {
          "type": "String",
          "column": "emlprofile_body"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "SYS",
    "type": "CustomerEmailProfile",
    "table": "xt.custemlprofile",
    "idSequenceName": "emlprofile_emlprofile_id_seq",
    "comment": "Customer Email Profile Map",
    "privileges": {
      "all": {
        "create": "MaintainCustomerEmailProfiles",
        "read": true,
        "update": "MaintainCustomerEmailProfiles",
        "delete": "MaintainCustomerEmailProfiles"
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "emlprofile_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "emlprofile_name",
          "isNaturalKey": true
        }
      },
      {
        "name": "description",
        "attr": {
          "type": "String",
          "column": "emlprofile_descrip"
        }
      },
      {
        "name": "from",
        "attr": {
          "type": "String",
          "column": "emlprofile_from"
        }
      },
      {
        "name": "replyTo",
        "attr": {
          "type": "String",
          "column": "emlprofile_replyto"
        }
      },
      {
        "name": "to",
        "attr": {
          "type": "String",
          "column": "emlprofile_to"
        }
      },
      {
        "name": "cc",
        "attr": {
          "type": "String",
          "column": "emlprofile_cc"
        }
      },
      {
        "name": "bcc",
        "attr": {
          "type": "String",
          "column": "emlprofile_bcc"
        }
      },
      {
        "name": "subject",
        "attr": {
          "type": "String",
          "column": "emlprofile_subject"
        }
      },
      {
        "name": "body",
        "attr": {
          "type": "String",
          "column": "emlprofile_body"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerCharacteristic",
    "table": "charass",
    "idSequenceName": "charass_charass_id_seq",
    "comment": "Customer 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": "C"
        }
      },
      {
        "name": "customer",
        "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": "CustomerComment",
    "table": "comment",
    "idSequenceName": "comment_comment_id_seq",
    "comment": "Customer Comment Map",
    "canDelete": false,
    "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": "C"
        }
      },
      {
        "name": "customer",
        "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": "CustomerTaxRegistration",
    "table": "taxreg",
    "idSequenceName": "taxreg_taxreg_id_seq",
    "comment": "Tax Registration Map",
    "privileges": {
      "all": {
        "create": "MaintainTaxAuthorities",
        "read": "ViewTaxAuthorities",
        "update": "MaintainTaxAuthorities",
        "delete": "MaintainTaxAuthorities"
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "taxreg_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "customer",
        "attr": {
          "type": "Number",
          "column": "taxreg_rel_id"
        }
      },
      {
        "name": "relType",
        "attr": {
          "type": "String",
          "column": "taxreg_rel_type",
          "value": "C"
        }
      },
      {
        "name": "taxAuthority",
        "toOne": {
          "type": "TaxAuthority",
          "column": "taxreg_taxauth_id"
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "taxreg_number"
        }
      },
      {
        "name": "taxZone",
        "toOne": {
          "type": "TaxZone",
          "column": "taxreg_taxzone_id"
        }
      },
      {
        "name": "effective",
        "attr": {
          "type": "Date",
          "column": "taxreg_effective"
        }
      },
      {
        "name": "expires",
        "attr": {
          "type": "Date",
          "column": "taxreg_expires"
        }
      },
      {
        "name": "notes",
        "attr": {
          "type": "String",
          "column": "taxreg_notes"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerShipto",
    "table": "shiptoinfo",
    "idSequenceName": "shipto_shipto_id_seq",
    "comment": "Customer Shipto Map",
    "privileges": {
      "all": {
        "create": true,
        "read": true,
        "update": true,
        "delete": true
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "shipto_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "customer",
        "attr": {
          "type": "Number",
          "column": "shipto_cust_id"
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "shipto_num",
          "required": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "shipto_name",
          "required": true
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "shipto_active",
          "required": true
        }
      },
      {
        "name": "isDefault",
        "attr": {
          "type": "Boolean",
          "column": "shipto_default",
          "isRequired": true
        }
      },
      {
        "name": "salesRep",
        "toOne": {
          "type": "SalesRep",
          "column": "shipto_salesrep_id"
        }
      },
      {
        "name": "commission",
        "attr": {
          "type": "Percent",
          "column": "shipto_commission"
        }
      },
      {
        "name": "shipZone",
        "toOne": {
          "type": "ShipZone",
          "column": "shipto_shipzone_id"
        }
      },
      {
        "name": "taxZone",
        "toOne": {
          "type": "TaxZone",
          "column": "shipto_taxzone_id"
        }
      },
      {
        "name": "shipVia",
        "attr": {
          "type": "String",
          "column": "shipto_shipvia"
        }
      },
      {
        "name": "shipCharge",
        "toOne": {
          "type": "ShipCharge",
          "column": "shipto_shipchrg_id",
          "required": true
        }
      },
      {
        "name": "contact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "shipto_cntct_id"
        }
      },
      {
        "name": "address",
        "toOne": {
          "isNested": true,
          "type": "AddressInfo",
          "column": "shipto_addr_id"
        }
      },
      {
        "name": "notes",
        "attr": {
          "type": "String",
          "column": "shipto_comments"
        }
      },
      {
        "name": "shippingNotes",
        "attr": {
          "type": "String",
          "column": "shipto_shipcomments"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerShiptoRelation",
    "table": "shiptoinfo",
    "isRest": true,
    "comment": "Customer Shipto Relation Map",
    "privileges": {
      "all": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "shipto_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "customer",
        "toOne": {
          "type": "CustomerRelation",
          "column": "shipto_cust_id"
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "shipto_num"
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "shipto_name"
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "shipto_active"
        }
      },
      {
        "name": "isDefault",
        "attr": {
          "type": "Boolean",
          "column": "shipto_default"
        }
      },
      {
        "name": "contact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "shipto_cntct_id"
        }
      },
      {
        "name": "address",
        "toOne": {
          "isNested": true,
          "type": "AddressInfo",
          "column": "shipto_addr_id"
        }
      },
      {
        "name": "salesRep",
        "toOne": {
          "type": "SalesRep",
          "column": "shipto_salesrep_id"
        }
      },
      {
        "name": "commission",
        "attr": {
          "type": "Percent",
          "column": "shipto_commission"
        }
      },
      {
        "name": "taxZone",
        "toOne": {
          "type": "TaxZone",
          "column": "shipto_taxzone_id"
        }
      },
      {
        "name": "shipCharge",
        "toOne": {
          "type": "ShipCharge",
          "column": "shipto_shipchrg_id"
        }
      },
      {
        "name": "shipVia",
        "attr": {
          "type": "String",
          "column": "shipto_shipvia"
        }
      },
      {
        "name": "shipZone",
        "toOne": {
          "type": "ShipZone",
          "column": "shipto_shipzone_id"
        }
      },
      {
        "name": "notes",
        "attr": {
          "type": "String",
          "column": "shipto_shipcomments"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "SalesCustomerShiptoRelation",
    "table": "shiptoinfo",
    "isRest": true,
    "comment": "Sales Customer Shipto Relation Map",
    "privileges": {
      "all": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "shipto_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "customer",
        "attr": {
          "type": "Number",
          "column": "shipto_cust_id"
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "shipto_num"
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "shipto_name"
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "shipto_active"
        }
      },
      {
        "name": "isDefault",
        "attr": {
          "type": "Boolean",
          "column": "shipto_default"
        }
      },
      {
        "name": "contact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "shipto_cntct_id"
        }
      },
      {
        "name": "address",
        "toOne": {
          "isNested": true,
          "type": "AddressInfo",
          "column": "shipto_addr_id"
        }
      },
      {
        "name": "salesRep",
        "toOne": {
          "type": "SalesRep",
          "column": "shipto_salesrep_id"
        }
      },
      {
        "name": "commission",
        "attr": {
          "type": "Percent",
          "column": "shipto_commission"
        }
      },
      {
        "name": "taxZone",
        "toOne": {
          "type": "TaxZone",
          "column": "shipto_taxzone_id"
        }
      },
      {
        "name": "shipCharge",
        "toOne": {
          "type": "ShipCharge",
          "column": "shipto_shipchrg_id"
        }
      },
      {
        "name": "shipVia",
        "attr": {
          "type": "String",
          "column": "shipto_shipvia"
        }
      },
      {
        "name": "shipZone",
        "toOne": {
          "type": "ShipZone",
          "column": "shipto_shipzone_id"
        }
      },
      {
        "name": "notes",
        "attr": {
          "type": "String",
          "column": "shipto_shipcomments"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerType",
    "table": "custtype",
    "isRest": true,
    "idSequenceName": "custtype_custtype_id_seq",
    "lockable": true,
    "comment": "Vendor Type Map",
    "privileges": {
      "all": {
        "create": "MaintainCustomerTypes",
        "read": "ViewCustomerTypes",
        "update": "MaintainCustomerTypes",
        "delete": "MaintainCustomerTypes"
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "custtype_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "code",
        "attr": {
          "type": "String",
          "column": "custtype_code",
          "isNaturalKey": true
        }
      },
      {
        "name": "description",
        "attr": {
          "type": "String",
          "column": "custtype_descrip"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerRelation",
    "table": "custinfo",
    "isRest": true,
    "comment": "Customer Relation Map",
    "privileges": {
      "all": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "cust_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "cust_number",
          "isNaturalKey": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "cust_name"
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "cust_active"
        }
      }
    ],
    "extensions": [
      {
        "table": "shiptoinfo",
        "relations": [
          {
            "column": "shipto_cust_id"
          }
        ],
        "properties": [
          {
            "name": "shipto",
            "toOne": {
              "isNested": true,
              "type": "CustomerShipto",
              "column": "shipto_id"
            }
          },
          {
            "name": "isDefault",
            "attr": {
              "type": "Boolean",
              "column": "shipto_default",
              "value": true,
              "isVisible": false
            }
          },
          {
            "name": "isActive",
            "attr": {
              "type": "Boolean",
              "column": "shipto_active",
              "value": true,
              "isVisible": false
            }
          }
        ],
        "nameSpace": "XM"
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "SYS",
    "type": "CustomerRelation",
    "table": "custinfo",
    "comment": "Customer Relation Map",
    "privileges": {
      "all": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "cust_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "cust_number",
          "isNaturalKey": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "cust_name"
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "cust_active"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerListItem",
    "table": "custinfo",
    "isRest": true,
    "comment": "Customer List Item Map",
    "privileges": {
      "all": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "cust_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "cust_number",
          "isNaturalKey": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "cust_name"
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "cust_active"
        }
      },
      {
        "name": "customerType",
        "toOne": {
          "isNested": true,
          "type": "CustomerType",
          "column": "cust_custtype_id"
        }
      },
      {
        "name": "billingContact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "cust_cntct_id"
        }
      }
    ],
    "extensions": [
      {
        "table": "shiptoinfo",
        "relations": [
          {
            "column": "shipto_cust_id"
          }
        ],
        "properties": [
          {
            "name": "shipto",
            "toOne": {
              "isNested": true,
              "type": "CustomerShipto",
              "column": "shipto_id"
            }
          },
          {
            "name": "isDefault",
            "attr": {
              "type": "Boolean",
              "column": "shipto_default",
              "value": true,
              "isVisible": false
            }
          },
          {
            "name": "isActive",
            "attr": {
              "type": "Boolean",
              "column": "shipto_active",
              "value": true,
              "isVisible": false
            }
          }
        ],
        "nameSpace": "XM"
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ShipCharge",
    "table": "shipchrg",
    "isRest": true,
    "lockable": true,
    "idSequenceName": "shipchrg_shipchrg_id_seq",
    "comment": "Ship Charge Map",
    "privileges": {
      "all": {
        "create": "MaintainShippingChargeTypes",
        "read": true,
        "update": "MaintainShippingChargeTypes",
        "delete": "MaintainShippingChargeTypes"
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "shipchrg_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "shipchrg_name",
          "isNaturalKey": true
        }
      },
      {
        "name": "description",
        "attr": {
          "type": "String",
          "column": "shipchrg_descrip"
        }
      },
      {
        "name": "isCustomerPay",
        "attr": {
          "type": "Boolean",
          "column": "shipchrg_custfreight"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ShipVia",
    "table": "shipvia",
    "isRest": true,
    "idSequenceName": "shipvia_shipvia_id_seq",
    "lockable": true,
    "comment": "Ship Via Map",
    "privileges": {
      "all": {
        "create": "MaintainShipVias",
        "read": "ViewShipVias",
        "update": "MaintainShipVias",
        "delete": "MaintainShipVias"
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "shipvia_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "code",
        "attr": {
          "type": "String",
          "column": "shipvia_code",
          "isNaturalKey": true
        }
      },
      {
        "name": "description",
        "attr": {
          "type": "String",
          "column": "shipvia_descrip"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "ShipZone",
    "table": "shipzone",
    "isRest": true,
    "lockable": true,
    "idSequenceName": "shipzone_shipzone_id_seq",
    "comment": "Ship Zone Map",
    "privileges": {
      "all": {
        "create": "MaintainShippingZones",
        "read": "ViewShippingZones",
        "update": "MaintainShippingZones",
        "delete": "MaintainShippingZones"
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "shipzone_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "shipzone_name",
          "isNaturalKey": true
        }
      },
      {
        "name": "description",
        "attr": {
          "type": "String",
          "column": "shipzone_descrip"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerGroup",
    "table": "custgrp",
    "isRest": true,
    "idSequenceName": "custgrp_custgrp_id_seq",
    "lockable": true,
    "comment": "Customer Group Map",
    "privileges": {
      "all": {
        "create": "MaintainCustomerGroups",
        "read": "ViewCustomerGroups",
        "update": "MaintainCustomerGroups",
        "delete": "MaintainCustomerGroups"
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "custgrp_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "custgrp_name",
          "isNaturalKey": true
        }
      },
      {
        "name": "description",
        "attr": {
          "type": "String",
          "column": "custgrp_descrip"
        }
      },
      {
        "name": "customers",
        "toMany": {
          "isNested": true,
          "type": "CustomerGroupCustomer",
          "column": "custgrp_id",
          "inverse": "customerGroup"
        }
      }
    ],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerGroupCustomer",
    "table": "custgrpitem",
    "idSequenceName": "custgrpitem_custgrpitem_id_seq",
    "comment": "Customer Group Customer Map",
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "custgrpitem_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "customerGroup",
        "attr": {
          "type": "Number",
          "column": "custgrpitem_custgrp_id"
        }
      },
      {
        "name": "customer",
        "toOne":  {
          "isNested": true,
          "type": "CustomerRelation",
          "column": "custgrpitem_cust_id"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerCustomerGroup",
    "table": "custgrpitem",
    "idSequenceName": "custgrpitem_custgrpitem_id_seq",
    "comment": "Customer Group Customer Map",
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "custgrpitem_id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "uuid",
        "attr": {
          "type": "String",
          "column": "obj_uuid",
          "isNaturalKey": true
        }
      },
      {
        "name": "customerGroup",
        "toOne": {
          "type": "CustomerGroup",
          "isNested": true,
          "column": "custgrpitem_custgrp_id"
        }
      },
      {
        "name": "customer",
        "attr": {
          "type": "Number",
          "column": "custgrpitem_cust_id"
        }
      }
    ],
    "isNestedOnly": true,
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerProspectRelation",
    "table": "xt.customer_prospect",
    "isRest": true,
    "comment": "Customer Prospect Relation Map",
    "privileges": {
      "all": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "number",
          "isNaturalKey": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "name"
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "active"
        }
      },
      {
        "name": "billingContact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "contact"
        }
      },
      {
        "name": "isFreeFormShipto",
        "attr": {
          "type": "Boolean",
          "column": "cust_ffshipto"
        }
      },
      {
        "name": "isFreeFormBillto",
        "attr": {
          "type": "Boolean",
          "column": "cust_ffbillto",
          "required": true
        }
      },
      {
        "name": "currency",
        "toOne": {
          "type": "Currency",
          "column": "cust_curr_id"
        }
      },
      {
        "name": "terms",
        "toOne": {
          "type": "Terms",
          "column": "cust_terms_id"
        }
      },
      {
        "name": "creditStatus",
        "attr": {
          "type": "String",
          "column": "cust_creditstatus"
        }
      },
      {
        "name": "salesRep",
        "toOne": {
          "type": "SalesRep",
          "column": "salesrep_id"
        }
      },
      {
        "name": "commission",
        "attr": {
          "type": "Percent",
          "column": "cust_commprcnt"
        }
      },
      {
        "name": "discount",
        "attr": {
          "type": "Percent",
          "column": "cust_discntprcnt"
        }
      },
      {
        "name": "taxZone",
        "toOne": {
          "type": "TaxZone",
          "column": "taxzone_id"
        }
      },
      {
        "name": "shipVia",
        "attr": {
          "type": "String",
          "column": "cust_shipvia"
        }
      },
      {
        "name": "shipCharge",
        "toOne": {
          "type": "ShipCharge",
          "column": "cust_shipchrg_id"
        }
      },
      {
        "name": "preferredSite",
        "toOne": {
          "type": "Site",
          "column": "site",
          "nullValue": -1
        }
      },
      {
        "name": "shiptos",
        "toMany": {
          "isNested": true,
          "type": "SalesCustomerShiptoRelation",
          "column": "id",
          "inverse": "customer"
        }
      },
      {
        "name": "status",
        "attr": {
          "type": "String",
          "column": "status"
        }
      },
      {
        "name": "customerType",
        "toOne": {
          "type": "CustomerType",
          "column": "type"
        }
      },
      {
        "name": "account",
        "attr": {
          "type": "Number",
          "column": "crmacct_id"
        }
      }
    ],
    "extensions": [],
    "isSystem": true
  },
  {
    "context": "xtuple",
    "nameSpace": "XM",
    "type": "CustomerProspectListItem",
    "table": "xt.customer_prospect",
    "isRest": true,
    "comment": "Customer Prospect List Item Map",
    "privileges": {
      "all": {
        "create": false,
        "read": true,
        "update": false,
        "delete": false
      }
    },
    "properties": [
      {
        "name": "id",
        "attr": {
          "type": "Number",
          "column": "id",
          "isPrimaryKey": true
        }
      },
      {
        "name": "number",
        "attr": {
          "type": "String",
          "column": "number",
          "isNaturalKey": true
        }
      },
      {
        "name": "name",
        "attr": {
          "type": "String",
          "column": "name"
        }
      },
      {
        "name": "isActive",
        "attr": {
          "type": "Boolean",
          "column": "active"
        }
      },
      {
        "name": "contact",
        "toOne": {
          "isNested": true,
          "type": "ContactRelation",
          "column": "contact"
        }
      },
      {
        "name": "status",
        "attr": {
          "type": "String",
          "column": "status"
        }
      },
      {
        "name": "customerType",
        "toOne": {
          "type": "CustomerType",
          "column": "type"
        }
      }
    ],
    "extensions": [],
    "isSystem": true
  }
]
