Issue #23593:correctly handle nulls in address
[xtuple] / enyo-client / database / orm / models / customer.json
1 [
2   {
3     "context": "xtuple",
4     "nameSpace": "XM",
5     "type": "Customer",
6     "table": "custinfo",
7     "isRest": true,
8     "lockable": true,
9     "orderSequence": "CRMAccountNumber",
10     "comment": "Customer Map",
11     "privileges": {
12       "all": {
13         "create": "MaintainCustomerMasters",
14         "read": "ViewCustomerMasters",
15         "update": "MaintainCustomerMasters",
16         "delete": "MaintainCustomerMasters"
17       },
18       "personal":{
19         "create":"MaintainPersonalCRMAccounts",
20         "read":"ViewPersonalCRMAccounts",
21         "update":"MaintainPersonalCRMAccounts",
22         "delete":"MaintainPersonalCRMAccounts",
23         "properties":[
24           "account.owner.username",
25           "account.number"
26         ]
27       },
28       "attribute": {
29         "creditStatus": {
30           "create": "UpdateCustomerCreditStatus",
31           "update": "UpdateCustomerCreditStatus"
32         }
33       }
34     },
35     "properties": [
36       {
37         "name": "id",
38         "attr": {
39           "type": "Number",
40           "column": "cust_id",
41           "isPrimaryKey": true
42         }
43       },
44       {
45         "name": "number",
46         "attr": {
47           "type": "String",
48           "column": "cust_number",
49           "isNaturalKey": true,
50           "required": true
51         }
52       },
53       {
54         "name": "name",
55         "attr": {
56           "type": "String",
57           "column": "cust_name",
58           "required": true
59         }
60       },
61       {
62         "name": "customerType",
63         "toOne": {
64           "type": "CustomerType",
65           "column": "cust_custtype_id",
66           "required": true
67         }
68       },
69       {
70         "name": "isActive",
71         "attr": {
72           "type": "Boolean",
73           "column": "cust_active",
74           "required": true
75         }
76       },
77       {
78         "name": "notes",
79         "attr": {
80           "type": "String",
81           "column": "cust_comments"
82         }
83       },
84       {
85         "name": "billingContact",
86         "toOne": {
87           "isNested": true,
88           "type": "ContactRelation",
89           "column": "cust_cntct_id",
90           "inverse": "id"
91         }
92       },
93       {
94         "name": "correspondenceContact",
95         "toOne": {
96           "isNested": true,
97           "type": "ContactRelation",
98           "column": "cust_corrcntct_id",
99           "inverse": "id"
100         }
101       },
102       {
103         "name": "salesRep",
104         "toOne": {
105           "type": "SalesRep",
106           "column": "cust_salesrep_id",
107           "required": true
108         }
109       },
110       {
111         "name": "commission",
112         "attr": {
113           "type": "Percent",
114           "column": "cust_commprcnt"
115         }
116       },
117       {
118         "name": "shipVia",
119         "attr": {
120           "type": "String",
121           "column": "cust_shipvia"
122         }
123       },
124       {
125         "name": "shipCharge",
126         "toOne": {
127           "type": "ShipCharge",
128           "column": "cust_shipchrg_id",
129           "required": true
130         }
131       },
132       {
133         "name": "isFreeFormShipto",
134         "attr": {
135           "type": "Boolean",
136           "column": "cust_ffshipto",
137           "required": true
138         }
139       },
140       {
141         "name": "isFreeFormBillto",
142         "attr": {
143           "type": "Boolean",
144           "column": "cust_ffbillto",
145           "required": true
146         }
147       },
148       {
149         "name": "terms",
150         "toOne": {
151           "type": "Terms",
152           "column": "cust_terms_id",
153           "required": true
154         }
155       },
156       {
157         "name": "discount",
158         "attr": {
159           "type": "Percent",
160           "column": "cust_discntprcnt",
161           "required": true
162         }
163       },
164       {
165         "name": "currency",
166         "toOne": {
167           "type": "Currency",
168           "column": "cust_curr_id",
169           "defalutValue": "baseCurrency"
170         }
171       },
172       {
173         "name": "creditStatus",
174         "attr": {
175           "type": "String",
176           "column": "cust_creditstatus",
177           "required": true
178         }
179       },
180       {
181         "name": "balanceMethod",
182         "attr": {
183           "type": "String",
184           "column": "cust_balmethod",
185           "required": true
186         }
187       },
188       {
189         "name": "creditLimit",
190         "attr": {
191           "type": "Number",
192           "column": "cust_creditlmt"
193         }
194       },
195       {
196         "name": "creditLimitCurrency",
197         "toOne": {
198           "type": "Currency",
199           "column": "cust_creditlmt_curr_id"
200         }
201       },
202       {
203         "name": "creditRating",
204         "attr": {
205           "type": "String",
206           "column": "cust_creditrating"
207         }
208       },
209       {
210         "name": "graceDays",
211         "attr": {
212           "type": "Number",
213           "column": "cust_gracedays"
214         }
215       },
216       {
217         "name": "taxZone",
218         "toOne": {
219           "type": "TaxZone",
220           "column": "cust_taxzone_id"
221         }
222       },
223       {
224         "name": "shiptos",
225         "toMany": {
226           "isNested": true,
227           "type": "CustomerShipto",
228           "column": "cust_id",
229           "inverse": "customer"
230         }
231       },
232       {
233         "name": "comments",
234         "toMany": {
235           "isNested": true,
236           "type": "CustomerComment",
237           "column": "cust_id",
238           "inverse": "customer"
239         }
240       },
241       {
242         "name": "taxRegistration",
243         "toMany": {
244           "isNested": true,
245           "type": "CustomerTaxRegistration",
246           "column": "cust_id",
247           "inverse": "customer"
248         }
249       },
250       {
251         "name": "characteristics",
252         "toMany": {
253           "isNested": true,
254           "type": "CustomerCharacteristic",
255           "column": "cust_id",
256           "inverse": "customer"
257         }
258       },
259       {
260         "name": "backorder",
261         "attr": {
262           "type": "Boolean",
263           "column": "cust_backorder",
264           "required": true
265         }
266       },
267       {
268         "name": "partialShip",
269         "attr": {
270           "type": "Boolean",
271           "column": "cust_partialship",
272           "required": true
273         }
274       },
275       {
276         "name": "blanketPurchaseOrders",
277         "attr": {
278           "type": "Boolean",
279           "column": "cust_blanketpos",
280           "required": true
281         }
282       },
283       {
284         "name": "usesPurchaseOrders",
285         "attr": {
286           "type": "Boolean",
287           "column": "cust_usespos",
288           "required": true
289         }
290       },
291       {
292         "name": "autoUpdateStatus",
293         "attr": {
294           "type": "Boolean",
295           "column": "cust_autoupdatestatus",
296           "required": true
297         }
298       },
299       {
300         "name": "autoHoldOrders",
301         "attr": {
302           "type": "Boolean",
303           "column": "cust_autoholdorders",
304           "required": true
305         }
306       },
307       {
308         "name": "accounts",
309         "toMany": {
310           "isNested": true,
311           "type": "CustomerAccount",
312           "column": "cust_id",
313           "inverse": "source"
314         }
315       },
316       {
317         "name": "contacts",
318         "toMany": {
319           "isNested": true,
320           "type": "CustomerContact",
321           "column": "cust_id",
322           "inverse": "source"
323         }
324       },
325       {
326         "name": "items",
327         "toMany": {
328           "isNested": true,
329           "type": "CustomerItem",
330           "column": "cust_id",
331           "inverse": "source"
332         }
333       },
334       {
335         "name": "files",
336         "toMany": {
337           "isNested": true,
338           "type": "CustomerFile",
339           "column": "cust_id",
340           "inverse": "source"
341         }
342       },
343       {
344         "name": "urls",
345         "toMany": {
346           "isNested": true,
347           "type": "CustomerUrl",
348           "column": "cust_id",
349           "inverse": "source"
350         }
351       },
352       {
353         "name": "customers",
354         "toMany": {
355           "isNested": true,
356           "type": "CustomerCustomer",
357           "column": "cust_id",
358           "inverse": "source"
359         }
360       },
361       {
362         "name": "preferredSite",
363         "toOne": {
364           "type": "SiteRelation",
365           "column": "cust_preferred_warehous_id",
366           "nullValue": -1
367         }
368       },
369       {
370         "name": "creditCards",
371         "toMany": {
372           "isNested": true,
373           "type": "CreditCard",
374           "column": "cust_id",
375           "inverse": "customer"
376         }
377       }
378     ],
379     "extensions": [{
380       "table": "xt.custcustemlprofile",
381       "isExtension": true,
382       "relations": [
383         {
384           "column": "custcustemlprofile_cust_id",
385           "inverse": "id"
386         }
387       ],
388       "properties": [
389         {
390           "name": "emailProfile",
391           "toOne": {
392             "type": "CustomerEmailProfile",
393             "column": "custcustemlprofile_custemlprofile_id"
394           }
395         }
396       ]
397     }],
398     "isSystem": true
399   },
400   {
401     "context": "xtuple",
402     "nameSpace": "XM",
403     "type": "SalesCustomer",
404     "table": "custinfo",
405     "idSequenceName": "cust_cust_id_seq",
406     "orderSequence": "CRMAccountNumber",
407     "comment": "Customer Map",
408     "privileges": {
409       "all": {
410         "create": "MaintainSalesOrders",
411         "read": "ViewSalesOrders ViewAROpenItems EditAROpenItem",
412         "update": "MaintainSalesOrders",
413         "delete": "MaintainSalesOrders"
414       },
415       "attribute": {
416         "creditStatus": {
417           "create": "UpdateCustomerCreditStatus",
418           "update": "UpdateCustomerCreditStatus"
419         }
420       }
421     },
422     "properties": [
423       {
424         "name": "id",
425         "attr": {
426           "type": "Number",
427           "column": "cust_id",
428           "isPrimaryKey": true
429         }
430       },
431       {
432         "name": "number",
433         "attr": {
434           "type": "String",
435           "column": "cust_number",
436           "isNaturalKey": true,
437           "required": true
438         }
439       },
440       {
441         "name": "name",
442         "attr": {
443           "type": "String",
444           "column": "cust_name",
445           "required": true
446         }
447       },
448       {
449         "name": "customerType",
450         "toOne": {
451           "type": "CustomerType",
452           "column": "cust_custtype_id",
453           "required": true
454         }
455       },
456       {
457         "name": "isActive",
458         "attr": {
459           "type": "Boolean",
460           "column": "cust_active",
461           "required": true
462         }
463       },
464       {
465         "name": "notes",
466         "attr": {
467           "type": "String",
468           "column": "cust_comments"
469         }
470       },
471       {
472         "name": "billingContact",
473         "toOne": {
474           "isNested": true,
475           "type": "ContactRelation",
476           "column": "cust_cntct_id",
477           "inverse": "id"
478         }
479       },
480       {
481         "name": "correspondenceContact",
482         "toOne": {
483           "isNested": true,
484           "type": "ContactRelation",
485           "column": "cust_corrcntct_id",
486           "inverse": "id"
487         }
488       },
489       {
490         "name": "salesRep",
491         "toOne": {
492           "type": "SalesRep",
493           "column": "cust_salesrep_id",
494           "required": true
495         }
496       },
497       {
498         "name": "commission",
499         "attr": {
500           "type": "Percent",
501           "column": "cust_commprcnt"
502         }
503       },
504       {
505         "name": "shipVia",
506         "attr": {
507           "type": "String",
508           "column": "cust_shipvia"
509         }
510       },
511       {
512         "name": "shipCharge",
513         "toOne": {
514           "type": "ShipCharge",
515           "column": "cust_shipchrg_id",
516           "required": true
517         }
518       },
519       {
520         "name": "isFreeFormShipto",
521         "attr": {
522           "type": "Boolean",
523           "column": "cust_ffshipto",
524           "required": true
525         }
526       },
527       {
528         "name": "isFreeFormBillto",
529         "attr": {
530           "type": "Boolean",
531           "column": "cust_ffbillto",
532           "required": true
533         }
534       },
535       {
536         "name": "terms",
537         "toOne": {
538           "type": "Terms",
539           "column": "cust_terms_id",
540           "required": true
541         }
542       },
543       {
544         "name": "discount",
545         "attr": {
546           "type": "Percent",
547           "column": "cust_discntprcnt",
548           "required": true
549         }
550       },
551       {
552         "name": "currency",
553         "toOne": {
554           "type": "Currency",
555           "column": "cust_curr_id",
556           "defalutValue": "baseCurrency"
557         }
558       },
559       {
560         "name": "creditStatus",
561         "attr": {
562           "type": "String",
563           "column": "cust_creditstatus",
564           "required": true
565         }
566       },
567       {
568         "name": "balanceMethod",
569         "attr": {
570           "type": "String",
571           "column": "cust_balmethod",
572           "required": true
573         }
574       },
575       {
576         "name": "creditLimit",
577         "attr": {
578           "type": "Number",
579           "column": "cust_creditlmt"
580         }
581       },
582       {
583         "name": "creditLimitCurrency",
584         "toOne": {
585           "type": "Currency",
586           "column": "cust_creditlmt_curr_id"
587         }
588       },
589       {
590         "name": "creditRating",
591         "attr": {
592           "type": "String",
593           "column": "cust_creditrating"
594         }
595       },
596       {
597         "name": "graceDays",
598         "attr": {
599           "type": "Number",
600           "column": "cust_gracedays"
601         }
602       },
603       {
604         "name": "taxZone",
605         "toOne": {
606           "type": "TaxZone",
607           "column": "cust_taxzone_id"
608         }
609       },
610       {
611         "name": "shiptos",
612         "toMany": {
613           "isNested": true,
614           "type": "CustomerShipto",
615           "column": "cust_id",
616           "inverse": "customer"
617         }
618       },
619       {
620         "name": "backorder",
621         "attr": {
622           "type": "Boolean",
623           "column": "cust_backorder",
624           "required": true
625         }
626       },
627       {
628         "name": "partialShip",
629         "attr": {
630           "type": "Boolean",
631           "column": "cust_partialship",
632           "required": true
633         }
634       },
635       {
636         "name": "blanketPurchaseOrders",
637         "attr": {
638           "type": "Boolean",
639           "column": "cust_blanketpos",
640           "required": true
641         }
642       },
643       {
644         "name": "usesPurchaseOrders",
645         "attr": {
646           "type": "Boolean",
647           "column": "cust_usespos",
648           "required": true
649         }
650       },
651       {
652         "name": "autoUpdateStatus",
653         "attr": {
654           "type": "Boolean",
655           "column": "cust_autoupdatestatus",
656           "required": true
657         }
658       },
659       {
660         "name": "autoHoldOrders",
661         "attr": {
662           "type": "Boolean",
663           "column": "cust_autoholdorders",
664           "required": true
665         }
666       },
667       {
668         "name": "preferredSite",
669         "toOne": {
670           "type": "SiteRelation",
671           "column": "cust_preferred_warehous_id",
672           "nullValue": -1
673         }
674       },
675       {
676         "name": "creditCards",
677         "toMany": {
678           "isNested": true,
679           "type": "CreditCard",
680           "column": "cust_id",
681           "inverse": "customer"
682         }
683       }
684     ],
685     "extensions": [],
686     "isSystem": true
687   },
688   {
689     "context": "xtuple",
690     "nameSpace": "XM",
691     "type": "BillingCustomer",
692     "table": "custinfo",
693     "idSequenceName": "cust_cust_id_seq",
694     "orderSequence": "CRMAccountNumber",
695     "comment": "Customer Map for Billing",
696     "privileges": {
697       "all": {
698         "create": false,
699         "read": "ViewMiscInvoices ViewCreditMemos",
700         "update": false,
701         "delete": false
702       }
703     },
704     "properties": [
705       {
706         "name": "id",
707         "attr": {
708           "type": "Number",
709           "column": "cust_id",
710           "isPrimaryKey": true
711         }
712       },
713       {
714         "name": "number",
715         "attr": {
716           "type": "String",
717           "column": "cust_number",
718           "isNaturalKey": true,
719           "required": true
720         }
721       },
722       {
723         "name": "name",
724         "attr": {
725           "type": "String",
726           "column": "cust_name",
727           "required": true
728         }
729       },
730       {
731         "name": "customerType",
732         "toOne": {
733           "type": "CustomerType",
734           "column": "cust_custtype_id",
735           "required": true
736         }
737       },
738       {
739         "name": "customerGroups",
740         "toMany": {
741           "isNested": true,
742           "type": "CustomerCustomerGroup",
743           "column": "cust_id",
744           "inverse": "customer"
745         }
746       },
747       {
748         "name": "isActive",
749         "attr": {
750           "type": "Boolean",
751           "column": "cust_active",
752           "required": true
753         }
754       },
755       {
756         "name": "notes",
757         "attr": {
758           "type": "String",
759           "column": "cust_comments"
760         }
761       },
762       {
763         "name": "billingContact",
764         "toOne": {
765           "isNested": true,
766           "type": "ContactRelation",
767           "column": "cust_cntct_id",
768           "inverse": "id"
769         }
770       },
771       {
772         "name": "salesRep",
773         "toOne": {
774           "type": "SalesRep",
775           "column": "cust_salesrep_id",
776           "required": true
777         }
778       },
779       {
780         "name": "commission",
781         "attr": {
782           "type": "Percent",
783           "column": "cust_commprcnt"
784         }
785       },
786       {
787         "name": "terms",
788         "toOne": {
789           "type": "Terms",
790           "column": "cust_terms_id",
791           "required": true
792         }
793       },
794       {
795         "name": "taxZone",
796         "toOne": {
797           "type": "TaxZone",
798           "column": "cust_taxzone_id"
799         }
800       },
801       {
802         "name": "isFreeFormBillto",
803         "attr": {
804           "type": "Boolean",
805           "column": "cust_ffbillto",
806           "required": true
807         }
808       },
809       {
810         "name": "shiptos",
811         "toMany": {
812           "isNested": true,
813           "type": "CustomerShipto",
814           "column": "cust_id",
815           "inverse": "customer"
816         }
817       },
818       {
819         "name": "currency",
820         "toOne": {
821           "type": "Currency",
822           "column": "cust_curr_id",
823           "defalutValue": "baseCurrency"
824         }
825       }
826     ],
827     "extensions": [{
828       "table": "xt.custcustemlprofile",
829       "isExtension": true,
830       "relations": [
831         {
832           "column": "custcustemlprofile_cust_id",
833           "inverse": "id"
834         }
835       ],
836       "properties": [
837         {
838           "name": "emailProfile",
839           "toOne": {
840             "type": "CustomerEmailProfile",
841             "column": "custcustemlprofile_custemlprofile_id"
842           }
843         }
844       ]
845     }],
846     "isSystem": true
847   },
848   {
849     "context": "xtuple",
850     "nameSpace": "XM",
851     "type": "CustomerEmailProfile",
852     "table": "xt.custemlprofile",
853     "isRest": true,
854     "idSequenceName": "emlprofile_emlprofile_id_seq",
855     "comment": "Customer Email Profile Map",
856     "privileges": {
857       "all": {
858         "create": "MaintainCustomerEmailProfiles",
859         "read": true,
860         "update": "MaintainCustomerEmailProfiles",
861         "delete": "MaintainCustomerEmailProfiles"
862       }
863     },
864     "properties": [
865       {
866         "name": "id",
867         "attr": {
868           "type": "Number",
869           "column": "emlprofile_id",
870           "isPrimaryKey": true
871         }
872       },
873       {
874         "name": "name",
875         "attr": {
876           "type": "String",
877           "column": "emlprofile_name",
878           "isNaturalKey": true
879         }
880       },
881       {
882         "name": "description",
883         "attr": {
884           "type": "String",
885           "column": "emlprofile_descrip"
886         }
887       },
888       {
889         "name": "from",
890         "attr": {
891           "type": "String",
892           "column": "emlprofile_from"
893         }
894       },
895       {
896         "name": "replyTo",
897         "attr": {
898           "type": "String",
899           "column": "emlprofile_replyto"
900         }
901       },
902       {
903         "name": "to",
904         "attr": {
905           "type": "String",
906           "column": "emlprofile_to"
907         }
908       },
909       {
910         "name": "cc",
911         "attr": {
912           "type": "String",
913           "column": "emlprofile_cc"
914         }
915       },
916       {
917         "name": "bcc",
918         "attr": {
919           "type": "String",
920           "column": "emlprofile_bcc"
921         }
922       },
923       {
924         "name": "subject",
925         "attr": {
926           "type": "String",
927           "column": "emlprofile_subject"
928         }
929       },
930       {
931         "name": "body",
932         "attr": {
933           "type": "String",
934           "column": "emlprofile_body"
935         }
936       }
937     ],
938     "isSystem": true
939   },
940   {
941     "context": "xtuple",
942     "nameSpace": "SYS",
943     "type": "CustomerEmailProfile",
944     "table": "xt.custemlprofile",
945     "idSequenceName": "emlprofile_emlprofile_id_seq",
946     "comment": "Customer Email Profile Map",
947     "privileges": {
948       "all": {
949         "create": "MaintainCustomerEmailProfiles",
950         "read": true,
951         "update": "MaintainCustomerEmailProfiles",
952         "delete": "MaintainCustomerEmailProfiles"
953       }
954     },
955     "properties": [
956       {
957         "name": "id",
958         "attr": {
959           "type": "Number",
960           "column": "emlprofile_id",
961           "isPrimaryKey": true
962         }
963       },
964       {
965         "name": "name",
966         "attr": {
967           "type": "String",
968           "column": "emlprofile_name",
969           "isNaturalKey": true
970         }
971       },
972       {
973         "name": "description",
974         "attr": {
975           "type": "String",
976           "column": "emlprofile_descrip"
977         }
978       },
979       {
980         "name": "from",
981         "attr": {
982           "type": "String",
983           "column": "emlprofile_from"
984         }
985       },
986       {
987         "name": "replyTo",
988         "attr": {
989           "type": "String",
990           "column": "emlprofile_replyto"
991         }
992       },
993       {
994         "name": "to",
995         "attr": {
996           "type": "String",
997           "column": "emlprofile_to"
998         }
999       },
1000       {
1001         "name": "cc",
1002         "attr": {
1003           "type": "String",
1004           "column": "emlprofile_cc"
1005         }
1006       },
1007       {
1008         "name": "bcc",
1009         "attr": {
1010           "type": "String",
1011           "column": "emlprofile_bcc"
1012         }
1013       },
1014       {
1015         "name": "subject",
1016         "attr": {
1017           "type": "String",
1018           "column": "emlprofile_subject"
1019         }
1020       },
1021       {
1022         "name": "body",
1023         "attr": {
1024           "type": "String",
1025           "column": "emlprofile_body"
1026         }
1027       }
1028     ],
1029     "isSystem": true
1030   },
1031   {
1032     "context": "xtuple",
1033     "nameSpace": "XM",
1034     "type": "CustomerCharacteristic",
1035     "table": "charass",
1036     "idSequenceName": "charass_charass_id_seq",
1037     "comment": "Customer Characteristic Map",
1038     "privileges": {
1039       "all": {
1040         "create": true,
1041         "read": true,
1042         "update": true,
1043         "delete": true
1044       }
1045     },
1046     "properties": [
1047       {
1048         "name": "id",
1049         "attr": {
1050           "type": "Number",
1051           "column": "charass_id",
1052           "isPrimaryKey": true
1053         }
1054       },
1055       {
1056         "name": "uuid",
1057         "attr": {
1058           "type": "String",
1059           "column": "obj_uuid",
1060           "isNaturalKey": true
1061         }
1062       },
1063       {
1064         "name": "targetType",
1065         "attr": {
1066           "type": "String",
1067           "column": "charass_target_type",
1068           "value": "C"
1069         }
1070       },
1071       {
1072         "name": "customer",
1073         "attr": {
1074           "type": "Number",
1075           "column": "charass_target_id"
1076         }
1077       },
1078       {
1079         "name": "characteristic",
1080         "toOne": {
1081           "type": "Characteristic",
1082           "column": "charass_char_id",
1083           "required": true
1084         }
1085       },
1086       {
1087         "name": "value",
1088         "attr": {
1089           "type": "String",
1090           "column": "charass_value"
1091         }
1092       }
1093     ],
1094     "isNestedOnly": true,
1095     "isSystem": true
1096   },
1097   {
1098     "context": "xtuple",
1099     "nameSpace": "XM",
1100     "type": "CustomerComment",
1101     "table": "comment",
1102     "idSequenceName": "comment_comment_id_seq",
1103     "comment": "Customer Comment Map",
1104     "canDelete": false,
1105     "privileges": {
1106       "all": {
1107         "create": true,
1108         "read": true,
1109         "update": "EditOthersComments",
1110         "delete": false
1111       },
1112       "personal": {
1113         "update": "EditOwnComments",
1114         "properties": [
1115           "createdBy"
1116         ]
1117       }
1118     },
1119     "properties": [
1120       {
1121         "name": "id",
1122         "attr": {
1123           "type": "Number",
1124           "column": "comment_id",
1125           "isPrimaryKey": true
1126         }
1127       },
1128       {
1129         "name": "uuid",
1130         "attr": {
1131           "type": "String",
1132           "column": "obj_uuid",
1133           "isNaturalKey": true
1134         }
1135       },
1136       {
1137         "name": "sourceType",
1138         "attr": {
1139           "type": "String",
1140           "column": "comment_source",
1141           "value": "C"
1142         }
1143       },
1144       {
1145         "name": "customer",
1146         "attr": {
1147           "type": "Number",
1148           "column": "comment_source_id"
1149         }
1150       },
1151       {
1152         "name": "commentType",
1153         "toOne": {
1154           "type": "CommentType",
1155           "column": "comment_cmnttype_id",
1156           "required": true
1157         }
1158       },
1159       {
1160         "name": "text",
1161         "attr": {
1162           "type": "String",
1163           "column": "comment_text"
1164         }
1165       },
1166       {
1167         "name": "isPublic",
1168         "attr": {
1169           "type": "Boolean",
1170           "column": "comment_public",
1171           "value": true
1172         }
1173       },
1174       {
1175         "name": "created",
1176         "attr": {
1177           "type": "Date",
1178           "column": "comment_date"
1179         }
1180       },
1181       {
1182         "name": "createdBy",
1183         "attr": {
1184           "type": "String",
1185           "column": "comment_user"
1186         }
1187       }
1188     ],
1189     "isNestedOnly": true,
1190     "isSystem": true
1191   },
1192   {
1193     "context": "xtuple",
1194     "nameSpace": "XM",
1195     "type": "CustomerTaxRegistration",
1196     "table": "taxreg",
1197     "idSequenceName": "taxreg_taxreg_id_seq",
1198     "comment": "Tax Registration Map",
1199     "privileges": {
1200       "all": {
1201         "create": "MaintainTaxAuthorities",
1202         "read": "ViewTaxAuthorities",
1203         "update": "MaintainTaxAuthorities",
1204         "delete": "MaintainTaxAuthorities"
1205       }
1206     },
1207     "properties": [
1208       {
1209         "name": "id",
1210         "attr": {
1211           "type": "Number",
1212           "column": "taxreg_id",
1213           "isPrimaryKey": true
1214         }
1215       },
1216       {
1217         "name": "uuid",
1218         "attr": {
1219           "type": "String",
1220           "column": "obj_uuid",
1221           "isNaturalKey": true
1222         }
1223       },
1224       {
1225         "name": "customer",
1226         "attr": {
1227           "type": "Number",
1228           "column": "taxreg_rel_id"
1229         }
1230       },
1231       {
1232         "name": "relType",
1233         "attr": {
1234           "type": "String",
1235           "column": "taxreg_rel_type",
1236           "value": "C"
1237         }
1238       },
1239       {
1240         "name": "taxAuthority",
1241         "toOne": {
1242           "type": "TaxAuthority",
1243           "column": "taxreg_taxauth_id"
1244         }
1245       },
1246       {
1247         "name": "number",
1248         "attr": {
1249           "type": "String",
1250           "column": "taxreg_number"
1251         }
1252       },
1253       {
1254         "name": "taxZone",
1255         "toOne": {
1256           "type": "TaxZone",
1257           "column": "taxreg_taxzone_id"
1258         }
1259       },
1260       {
1261         "name": "effective",
1262         "attr": {
1263           "type": "Date",
1264           "column": "taxreg_effective"
1265         }
1266       },
1267       {
1268         "name": "expires",
1269         "attr": {
1270           "type": "Date",
1271           "column": "taxreg_expires"
1272         }
1273       },
1274       {
1275         "name": "notes",
1276         "attr": {
1277           "type": "String",
1278           "column": "taxreg_notes"
1279         }
1280       }
1281     ],
1282     "isNestedOnly": true,
1283     "isSystem": true
1284   },
1285   {
1286     "context": "xtuple",
1287     "nameSpace": "XM",
1288     "type": "CustomerShipto",
1289     "table": "shiptoinfo",
1290     "idSequenceName": "shipto_shipto_id_seq",
1291     "comment": "Customer Shipto Map",
1292     "privileges": {
1293       "all": {
1294         "create": true,
1295         "read": true,
1296         "update": true,
1297         "delete": true
1298       }
1299     },
1300     "properties": [
1301       {
1302         "name": "id",
1303         "attr": {
1304           "type": "Number",
1305           "column": "shipto_id",
1306           "isPrimaryKey": true
1307         }
1308       },
1309       {
1310         "name": "uuid",
1311         "attr": {
1312           "type": "String",
1313           "column": "obj_uuid",
1314           "isNaturalKey": true
1315         }
1316       },
1317       {
1318         "name": "customer",
1319         "attr": {
1320           "type": "Number",
1321           "column": "shipto_cust_id"
1322         }
1323       },
1324       {
1325         "name": "number",
1326         "attr": {
1327           "type": "String",
1328           "column": "shipto_num",
1329           "required": true
1330         }
1331       },
1332       {
1333         "name": "name",
1334         "attr": {
1335           "type": "String",
1336           "column": "shipto_name",
1337           "required": true
1338         }
1339       },
1340       {
1341         "name": "isActive",
1342         "attr": {
1343           "type": "Boolean",
1344           "column": "shipto_active",
1345           "required": true
1346         }
1347       },
1348       {
1349         "name": "isDefault",
1350         "attr": {
1351           "type": "Boolean",
1352           "column": "shipto_default",
1353           "isRequired": true
1354         }
1355       },
1356       {
1357         "name": "salesRep",
1358         "toOne": {
1359           "type": "SalesRep",
1360           "column": "shipto_salesrep_id"
1361         }
1362       },
1363       {
1364         "name": "commission",
1365         "attr": {
1366           "type": "Percent",
1367           "column": "shipto_commission"
1368         }
1369       },
1370       {
1371         "name": "shipZone",
1372         "toOne": {
1373           "type": "ShipZone",
1374           "column": "shipto_shipzone_id"
1375         }
1376       },
1377       {
1378         "name": "taxZone",
1379         "toOne": {
1380           "type": "TaxZone",
1381           "column": "shipto_taxzone_id"
1382         }
1383       },
1384       {
1385         "name": "shipVia",
1386         "attr": {
1387           "type": "String",
1388           "column": "shipto_shipvia"
1389         }
1390       },
1391       {
1392         "name": "shipCharge",
1393         "toOne": {
1394           "type": "ShipCharge",
1395           "column": "shipto_shipchrg_id",
1396           "required": true
1397         }
1398       },
1399       {
1400         "name": "contact",
1401         "toOne": {
1402           "isNested": true,
1403           "type": "ContactRelation",
1404           "column": "shipto_cntct_id"
1405         }
1406       },
1407       {
1408         "name": "address",
1409         "toOne": {
1410           "isNested": true,
1411           "type": "AddressInfo",
1412           "column": "shipto_addr_id"
1413         }
1414       },
1415       {
1416         "name": "notes",
1417         "attr": {
1418           "type": "String",
1419           "column": "shipto_comments"
1420         }
1421       },
1422       {
1423         "name": "shippingNotes",
1424         "attr": {
1425           "type": "String",
1426           "column": "shipto_shipcomments"
1427         }
1428       }
1429     ],
1430     "isNestedOnly": true,
1431     "isSystem": true
1432   },
1433   {
1434     "context": "xtuple",
1435     "nameSpace": "XM",
1436     "type": "CustomerAccount",
1437     "table": "xt.cust_doc",
1438     "idSequenceName": "docass_docass_id_seq",
1439     "comment": "Customer Account Map",
1440     "privileges": {
1441       "all": {
1442         "create": true,
1443         "read": true,
1444         "update": false,
1445         "delete": true
1446       }
1447     },
1448     "properties": [
1449       {
1450         "name": "id",
1451         "attr": {
1452           "type": "Number",
1453           "column": "id",
1454           "isPrimaryKey": true
1455         }
1456       },
1457       {
1458         "name": "uuid",
1459         "attr": {
1460           "type": "String",
1461           "column": "obj_uuid",
1462           "isNaturalKey": true
1463         }
1464       },
1465       {
1466         "name": "source",
1467         "attr": {
1468           "type": "Number",
1469           "column": "source_id"
1470         }
1471       },
1472       {
1473         "name": "targetType",
1474         "attr": {
1475           "type": "String",
1476           "column": "target_type",
1477           "value": "CRMA"
1478         }
1479       },
1480       {
1481         "name": "account",
1482         "toOne": {
1483           "isNested": true,
1484           "type": "AccountRelation",
1485           "column": "target_id"
1486         }
1487       },
1488       {
1489         "name": "purpose",
1490         "attr": {
1491           "type": "String",
1492           "column": "purpose"
1493         }
1494       }
1495     ],
1496     "isNestedOnly": true,
1497     "isSystem": true
1498   },
1499   {
1500     "context": "xtuple",
1501     "nameSpace": "XM",
1502     "type": "CustomerContact",
1503     "table": "xt.cust_doc",
1504     "idSequenceName": "docass_docass_id_seq",
1505     "comment": "Customer Contact Map",
1506     "privileges": {
1507       "all": {
1508         "create": true,
1509         "read": true,
1510         "update": false,
1511         "delete": true
1512       }
1513     },
1514     "properties": [
1515       {
1516         "name": "id",
1517         "attr": {
1518           "type": "Number",
1519           "column": "id",
1520           "isPrimaryKey": true
1521         }
1522       },
1523       {
1524         "name": "uuid",
1525         "attr": {
1526           "type": "String",
1527           "column": "obj_uuid",
1528           "isNaturalKey": true
1529         }
1530       },
1531       {
1532         "name": "source",
1533         "attr": {
1534           "type": "Number",
1535           "column": "source_id"
1536         }
1537       },
1538       {
1539         "name": "targetType",
1540         "attr": {
1541           "type": "String",
1542           "column": "target_type",
1543           "value": "T"
1544         }
1545       },
1546       {
1547         "name": "contact",
1548         "toOne": {
1549           "isNested": true,
1550           "type": "ContactRelation",
1551           "column": "target_id"
1552         }
1553       },
1554       {
1555         "name": "purpose",
1556         "attr": {
1557           "type": "String",
1558           "column": "purpose"
1559         }
1560       }
1561     ],
1562     "isNestedOnly": true,
1563     "isSystem": true
1564   },
1565   {
1566     "context": "xtuple",
1567     "nameSpace": "XM",
1568     "type": "CustomerFile",
1569     "table": "xt.cust_doc",
1570     "idSequenceName": "docass_docass_id_seq",
1571     "comment": "Customer File Map",
1572     "privileges": {
1573       "all": {
1574         "create": true,
1575         "read": true,
1576         "update": false,
1577         "delete": true
1578       }
1579     },
1580     "properties": [
1581       {
1582         "name": "id",
1583         "attr": {
1584           "type": "Number",
1585           "column": "id",
1586           "isPrimaryKey": true
1587         }
1588       },
1589       {
1590         "name": "uuid",
1591         "attr": {
1592           "type": "String",
1593           "column": "obj_uuid",
1594           "isNaturalKey": true
1595         }
1596       },
1597       {
1598         "name": "source",
1599         "attr": {
1600           "type": "Number",
1601           "column": "source_id"
1602         }
1603       },
1604       {
1605         "name": "targetType",
1606         "attr": {
1607           "type": "String",
1608           "column": "target_type",
1609           "value": "FILE"
1610         }
1611       },
1612       {
1613         "name": "file",
1614         "toOne": {
1615           "isNested": true,
1616           "type": "FileRelation",
1617           "column": "target_id"
1618         }
1619       },
1620       {
1621         "name": "purpose",
1622         "attr": {
1623           "type": "String",
1624           "column": "purpose"
1625         }
1626       }
1627     ],
1628     "isNestedOnly": true,
1629     "isSystem": true
1630   },
1631   {
1632     "context": "xtuple",
1633     "nameSpace": "XM",
1634     "type": "CustomerItem",
1635     "table": "xt.cust_doc",
1636     "idSequenceName": "docass_docass_id_seq",
1637     "comment": "Customer Item Map",
1638     "privileges": {
1639       "all": {
1640         "create": true,
1641         "read": true,
1642         "update": false,
1643         "delete": true
1644       }
1645     },
1646     "properties": [
1647       {
1648         "name": "id",
1649         "attr": {
1650           "type": "Number",
1651           "column": "id",
1652           "isPrimaryKey": true
1653         }
1654       },
1655       {
1656         "name": "uuid",
1657         "attr": {
1658           "type": "String",
1659           "column": "obj_uuid",
1660           "isNaturalKey": true
1661         }
1662       },
1663       {
1664         "name": "source",
1665         "attr": {
1666           "type": "Number",
1667           "column": "source_id"
1668         }
1669       },
1670       {
1671         "name": "targetType",
1672         "attr": {
1673           "type": "String",
1674           "column": "target_type",
1675           "value": "I"
1676         }
1677       },
1678       {
1679         "name": "item",
1680         "toOne": {
1681           "isNested": true,
1682           "type": "ItemRelation",
1683           "column": "target_id"
1684         }
1685       },
1686       {
1687         "name": "purpose",
1688         "attr": {
1689           "type": "String",
1690           "column": "purpose"
1691         }
1692       }
1693     ],
1694     "isNestedOnly": true,
1695     "isSystem": true
1696   },
1697   {
1698     "context": "xtuple",
1699     "nameSpace": "XM",
1700     "type": "CustomerUrl",
1701     "table": "xt.cust_doc",
1702     "idSequenceName": "docass_docass_id_seq",
1703     "comment": "Customer Url Map",
1704     "privileges": {
1705       "all": {
1706         "create": true,
1707         "read": true,
1708         "update": false,
1709         "delete": true
1710       }
1711     },
1712     "properties": [
1713       {
1714         "name": "id",
1715         "attr": {
1716           "type": "Number",
1717           "column": "id",
1718           "isPrimaryKey": true
1719         }
1720       },
1721       {
1722         "name": "uuid",
1723         "attr": {
1724           "type": "String",
1725           "column": "obj_uuid",
1726           "isNaturalKey": true
1727         }
1728       },
1729       {
1730         "name": "source",
1731         "attr": {
1732           "type": "Number",
1733           "column": "source_id"
1734         }
1735       },
1736       {
1737         "name": "targetType",
1738         "attr": {
1739           "type": "String",
1740           "column": "target_type",
1741           "value": "URL"
1742         }
1743       },
1744       {
1745         "name": "url",
1746         "toOne": {
1747           "isNested": true,
1748           "type": "Url",
1749           "column": "target_id"
1750         }
1751       },
1752       {
1753         "name": "purpose",
1754         "attr": {
1755           "type": "String",
1756           "column": "purpose"
1757         }
1758       }
1759     ],
1760     "isNestedOnly": true,
1761     "isSystem": true
1762   },
1763   {
1764     "context": "xtuple",
1765     "nameSpace": "XM",
1766     "type": "CustomerCustomer",
1767     "table": "xt.cust_doc",
1768     "idSequenceName": "docass_docass_id_seq",
1769     "comment": "Customer Customer Map",
1770     "privileges": {
1771       "all": {
1772         "create": true,
1773         "read": true,
1774         "update": false,
1775         "delete": true
1776       }
1777     },
1778     "properties": [
1779       {
1780         "name": "id",
1781         "attr": {
1782           "type": "Number",
1783           "column": "id",
1784           "isPrimaryKey": true
1785         }
1786       },
1787       {
1788         "name": "uuid",
1789         "attr": {
1790           "type": "String",
1791           "column": "obj_uuid",
1792           "isNaturalKey": true
1793         }
1794       },
1795       {
1796         "name": "source",
1797         "attr": {
1798           "type": "Number",
1799           "column": "source_id"
1800         }
1801       },
1802       {
1803         "name": "targetType",
1804         "attr": {
1805           "type": "String",
1806           "column": "target_type",
1807           "value": "C"
1808         }
1809       },
1810       {
1811         "name": "customer",
1812         "toOne": {
1813           "isNested": true,
1814           "type": "CustomerRelation",
1815           "column": "target_id"
1816         }
1817       },
1818       {
1819         "name": "purpose",
1820         "attr": {
1821           "type": "String",
1822           "column": "purpose"
1823         }
1824       }
1825     ],
1826     "isNestedOnly": true,
1827     "isSystem": true
1828   },
1829   {
1830     "context": "xtuple",
1831     "nameSpace": "XM",
1832     "type": "CustomerShiptoRelation",
1833     "table": "shiptoinfo",
1834     "isRest": true,
1835     "comment": "Customer Shipto Relation Map",
1836     "privileges": {
1837       "all": {
1838         "create": false,
1839         "read": true,
1840         "update": false,
1841         "delete": false
1842       }
1843     },
1844     "properties": [
1845       {
1846         "name": "id",
1847         "attr": {
1848           "type": "Number",
1849           "column": "shipto_id",
1850           "isPrimaryKey": true
1851         }
1852       },
1853       {
1854         "name": "uuid",
1855         "attr": {
1856           "type": "String",
1857           "column": "obj_uuid",
1858           "isNaturalKey": true
1859         }
1860       },
1861       {
1862         "name": "customer",
1863         "toOne": {
1864           "type": "CustomerRelation",
1865           "column": "shipto_cust_id"
1866         }
1867       },
1868       {
1869         "name": "number",
1870         "attr": {
1871           "type": "String",
1872           "column": "shipto_num"
1873         }
1874       },
1875       {
1876         "name": "name",
1877         "attr": {
1878           "type": "String",
1879           "column": "shipto_name"
1880         }
1881       },
1882       {
1883         "name": "isActive",
1884         "attr": {
1885           "type": "Boolean",
1886           "column": "shipto_active"
1887         }
1888       },
1889       {
1890         "name": "isDefault",
1891         "attr": {
1892           "type": "Boolean",
1893           "column": "shipto_default"
1894         }
1895       },
1896       {
1897         "name": "contact",
1898         "toOne": {
1899           "isNested": true,
1900           "type": "ContactRelation",
1901           "column": "shipto_cntct_id"
1902         }
1903       },
1904       {
1905         "name": "address",
1906         "toOne": {
1907           "isNested": true,
1908           "type": "AddressInfo",
1909           "column": "shipto_addr_id"
1910         }
1911       },
1912       {
1913         "name": "salesRep",
1914         "toOne": {
1915           "type": "SalesRep",
1916           "column": "shipto_salesrep_id"
1917         }
1918       },
1919       {
1920         "name": "commission",
1921         "attr": {
1922           "type": "Percent",
1923           "column": "shipto_commission"
1924         }
1925       },
1926       {
1927         "name": "taxZone",
1928         "toOne": {
1929           "type": "TaxZone",
1930           "column": "shipto_taxzone_id"
1931         }
1932       },
1933       {
1934         "name": "shipCharge",
1935         "toOne": {
1936           "type": "ShipCharge",
1937           "column": "shipto_shipchrg_id"
1938         }
1939       },
1940       {
1941         "name": "shipVia",
1942         "attr": {
1943           "type": "String",
1944           "column": "shipto_shipvia"
1945         }
1946       },
1947       {
1948         "name": "shipZone",
1949         "toOne": {
1950           "type": "ShipZone",
1951           "column": "shipto_shipzone_id"
1952         }
1953       },
1954       {
1955         "name": "notes",
1956         "attr": {
1957           "type": "String",
1958           "column": "shipto_shipcomments"
1959         }
1960       }
1961     ],
1962     "isSystem": true
1963   },
1964   {
1965     "context": "xtuple",
1966     "nameSpace": "XM",
1967     "type": "SalesCustomerShiptoRelation",
1968     "table": "shiptoinfo",
1969     "isRest": true,
1970     "comment": "Sales Customer Shipto Relation Map",
1971     "privileges": {
1972       "all": {
1973         "create": false,
1974         "read": true,
1975         "update": false,
1976         "delete": false
1977       }
1978     },
1979     "properties": [
1980       {
1981         "name": "id",
1982         "attr": {
1983           "type": "Number",
1984           "column": "shipto_id",
1985           "isPrimaryKey": true
1986         }
1987       },
1988       {
1989         "name": "uuid",
1990         "attr": {
1991           "type": "String",
1992           "column": "obj_uuid",
1993           "isNaturalKey": true
1994         }
1995       },
1996       {
1997         "name": "customer",
1998         "attr": {
1999           "type": "Number",
2000           "column": "shipto_cust_id"
2001         }
2002       },
2003       {
2004         "name": "number",
2005         "attr": {
2006           "type": "String",
2007           "column": "shipto_num"
2008         }
2009       },
2010       {
2011         "name": "name",
2012         "attr": {
2013           "type": "String",
2014           "column": "shipto_name"
2015         }
2016       },
2017       {
2018         "name": "isActive",
2019         "attr": {
2020           "type": "Boolean",
2021           "column": "shipto_active"
2022         }
2023       },
2024       {
2025         "name": "isDefault",
2026         "attr": {
2027           "type": "Boolean",
2028           "column": "shipto_default"
2029         }
2030       },
2031       {
2032         "name": "contact",
2033         "toOne": {
2034           "isNested": true,
2035           "type": "ContactRelation",
2036           "column": "shipto_cntct_id"
2037         }
2038       },
2039       {
2040         "name": "address",
2041         "toOne": {
2042           "isNested": true,
2043           "type": "AddressInfo",
2044           "column": "shipto_addr_id"
2045         }
2046       },
2047       {
2048         "name": "salesRep",
2049         "toOne": {
2050           "type": "SalesRep",
2051           "column": "shipto_salesrep_id"
2052         }
2053       },
2054       {
2055         "name": "commission",
2056         "attr": {
2057           "type": "Percent",
2058           "column": "shipto_commission"
2059         }
2060       },
2061       {
2062         "name": "taxZone",
2063         "toOne": {
2064           "type": "TaxZone",
2065           "column": "shipto_taxzone_id"
2066         }
2067       },
2068       {
2069         "name": "shipCharge",
2070         "toOne": {
2071           "type": "ShipCharge",
2072           "column": "shipto_shipchrg_id"
2073         }
2074       },
2075       {
2076         "name": "shipVia",
2077         "attr": {
2078           "type": "String",
2079           "column": "shipto_shipvia"
2080         }
2081       },
2082       {
2083         "name": "shipZone",
2084         "toOne": {
2085           "type": "ShipZone",
2086           "column": "shipto_shipzone_id"
2087         }
2088       },
2089       {
2090         "name": "notes",
2091         "attr": {
2092           "type": "String",
2093           "column": "shipto_shipcomments"
2094         }
2095       }
2096     ],
2097     "isSystem": true
2098   },
2099   {
2100     "context": "xtuple",
2101     "nameSpace": "XM",
2102     "type": "CustomerType",
2103     "table": "custtype",
2104     "isRest": true,
2105     "idSequenceName": "custtype_custtype_id_seq",
2106     "lockable": true,
2107     "comment": "Vendor Type Map",
2108     "privileges": {
2109       "all": {
2110         "create": "MaintainCustomerTypes",
2111         "read": "ViewCustomerTypes",
2112         "update": "MaintainCustomerTypes",
2113         "delete": "MaintainCustomerTypes"
2114       }
2115     },
2116     "properties": [
2117       {
2118         "name": "id",
2119         "attr": {
2120           "type": "Number",
2121           "column": "custtype_id",
2122           "isPrimaryKey": true
2123         }
2124       },
2125       {
2126         "name": "code",
2127         "attr": {
2128           "type": "String",
2129           "column": "custtype_code",
2130           "isNaturalKey": true
2131         }
2132       },
2133       {
2134         "name": "description",
2135         "attr": {
2136           "type": "String",
2137           "column": "custtype_descrip"
2138         }
2139       }
2140     ],
2141     "isSystem": true
2142   },
2143   {
2144     "context": "xtuple",
2145     "nameSpace": "XM",
2146     "type": "CustomerRelation",
2147     "table": "custinfo",
2148     "isRest": true,
2149     "comment": "Customer Relation Map",
2150     "privileges": {
2151       "all": {
2152         "create": false,
2153         "read": true,
2154         "update": false,
2155         "delete": false
2156       }
2157     },
2158     "properties": [
2159       {
2160         "name": "id",
2161         "attr": {
2162           "type": "Number",
2163           "column": "cust_id",
2164           "isPrimaryKey": true
2165         }
2166       },
2167       {
2168         "name": "number",
2169         "attr": {
2170           "type": "String",
2171           "column": "cust_number",
2172           "isNaturalKey": true
2173         }
2174       },
2175       {
2176         "name": "name",
2177         "attr": {
2178           "type": "String",
2179           "column": "cust_name"
2180         }
2181       },
2182       {
2183         "name": "isActive",
2184         "attr": {
2185           "type": "Boolean",
2186           "column": "cust_active"
2187         }
2188       }
2189     ],
2190     "extensions": [
2191       {
2192         "table": "shiptoinfo",
2193         "relations": [
2194           {
2195             "column": "shipto_cust_id"
2196           }
2197         ],
2198         "properties": [
2199           {
2200             "name": "shipto",
2201             "toOne": {
2202               "isNested": true,
2203               "type": "CustomerShipto",
2204               "column": "shipto_id"
2205             }
2206           },
2207           {
2208             "name": "isDefault",
2209             "attr": {
2210               "type": "Boolean",
2211               "column": "shipto_default",
2212               "value": true,
2213               "isVisible": false
2214             }
2215           },
2216           {
2217             "name": "isActive",
2218             "attr": {
2219               "type": "Boolean",
2220               "column": "shipto_active",
2221               "value": true,
2222               "isVisible": false
2223             }
2224           }
2225         ],
2226         "nameSpace": "XM"
2227       }
2228     ],
2229     "isSystem": true
2230   },
2231   {
2232     "context": "xtuple",
2233     "nameSpace": "SYS",
2234     "type": "CustomerRelation",
2235     "table": "custinfo",
2236     "comment": "Customer Relation Map",
2237     "privileges": {
2238       "all": {
2239         "create": false,
2240         "read": true,
2241         "update": false,
2242         "delete": false
2243       }
2244     },
2245     "properties": [
2246       {
2247         "name": "id",
2248         "attr": {
2249           "type": "Number",
2250           "column": "cust_id",
2251           "isPrimaryKey": true
2252         }
2253       },
2254       {
2255         "name": "number",
2256         "attr": {
2257           "type": "String",
2258           "column": "cust_number",
2259           "isNaturalKey": true
2260         }
2261       },
2262       {
2263         "name": "name",
2264         "attr": {
2265           "type": "String",
2266           "column": "cust_name"
2267         }
2268       },
2269       {
2270         "name": "isActive",
2271         "attr": {
2272           "type": "Boolean",
2273           "column": "cust_active"
2274         }
2275       }
2276     ],
2277     "isSystem": true
2278   },
2279   {
2280     "context": "xtuple",
2281     "nameSpace": "XM",
2282     "type": "CustomerListItem",
2283     "table": "custinfo",
2284     "isRest": true,
2285     "comment": "Customer List Item Map",
2286     "privileges": {
2287       "all": {
2288         "create": false,
2289         "read": true,
2290         "update": false,
2291         "delete": false
2292       }
2293     },
2294     "properties": [
2295       {
2296         "name": "id",
2297         "attr": {
2298           "type": "Number",
2299           "column": "cust_id",
2300           "isPrimaryKey": true
2301         }
2302       },
2303       {
2304         "name": "number",
2305         "attr": {
2306           "type": "String",
2307           "column": "cust_number",
2308           "isNaturalKey": true
2309         }
2310       },
2311       {
2312         "name": "name",
2313         "attr": {
2314           "type": "String",
2315           "column": "cust_name"
2316         }
2317       },
2318       {
2319         "name": "isActive",
2320         "attr": {
2321           "type": "Boolean",
2322           "column": "cust_active"
2323         }
2324       },
2325       {
2326         "name": "billingContact",
2327         "toOne": {
2328           "isNested": true,
2329           "type": "ContactRelation",
2330           "column": "cust_cntct_id"
2331         }
2332       }
2333     ],
2334     "extensions": [
2335       {
2336         "table": "shiptoinfo",
2337         "relations": [
2338           {
2339             "column": "shipto_cust_id"
2340           }
2341         ],
2342         "properties": [
2343           {
2344             "name": "shipto",
2345             "toOne": {
2346               "isNested": true,
2347               "type": "CustomerShipto",
2348               "column": "shipto_id"
2349             }
2350           },
2351           {
2352             "name": "isDefault",
2353             "attr": {
2354               "type": "Boolean",
2355               "column": "shipto_default",
2356               "value": true,
2357               "isVisible": false
2358             }
2359           },
2360           {
2361             "name": "isActive",
2362             "attr": {
2363               "type": "Boolean",
2364               "column": "shipto_active",
2365               "value": true,
2366               "isVisible": false
2367             }
2368           }
2369         ],
2370         "nameSpace": "XM"
2371       }
2372     ],
2373     "isSystem": true
2374   },
2375   {
2376     "context": "xtuple",
2377     "nameSpace": "XM",
2378     "type": "ShipCharge",
2379     "table": "shipchrg",
2380     "isRest": true,
2381     "lockable": true,
2382     "idSequenceName": "shipchrg_shipchrg_id_seq",
2383     "comment": "Ship Charge Map",
2384     "privileges": {
2385       "all": {
2386         "create": "MaintainShippingChargeTypes",
2387         "read": true,
2388         "update": "MaintainShippingChargeTypes",
2389         "delete": "MaintainShippingChargeTypes"
2390       }
2391     },
2392     "properties": [
2393       {
2394         "name": "id",
2395         "attr": {
2396           "type": "Number",
2397           "column": "shipchrg_id",
2398           "isPrimaryKey": true
2399         }
2400       },
2401       {
2402         "name": "name",
2403         "attr": {
2404           "type": "String",
2405           "column": "shipchrg_name",
2406           "isNaturalKey": true
2407         }
2408       },
2409       {
2410         "name": "description",
2411         "attr": {
2412           "type": "String",
2413           "column": "shipchrg_descrip"
2414         }
2415       },
2416       {
2417         "name": "isCustomerPay",
2418         "attr": {
2419           "type": "Boolean",
2420           "column": "shipchrg_custfreight"
2421         }
2422       }
2423     ],
2424     "isSystem": true
2425   },
2426   {
2427     "context": "xtuple",
2428     "nameSpace": "XM",
2429     "type": "ShipVia",
2430     "table": "shipvia",
2431     "isRest": true,
2432     "idSequenceName": "shipvia_shipvia_id_seq",
2433     "lockable": true,
2434     "comment": "Ship Via Map",
2435     "privileges": {
2436       "all": {
2437         "create": "MaintainShipVias",
2438         "read": "ViewShipVias",
2439         "update": "MaintainShipVias",
2440         "delete": "MaintainShipVias"
2441       }
2442     },
2443     "properties": [
2444       {
2445         "name": "id",
2446         "attr": {
2447           "type": "Number",
2448           "column": "shipvia_id",
2449           "isPrimaryKey": true
2450         }
2451       },
2452       {
2453         "name": "code",
2454         "attr": {
2455           "type": "String",
2456           "column": "shipvia_code",
2457           "isNaturalKey": true
2458         }
2459       },
2460       {
2461         "name": "description",
2462         "attr": {
2463           "type": "String",
2464           "column": "shipvia_descrip"
2465         }
2466       }
2467     ],
2468     "isSystem": true
2469   },
2470   {
2471     "context": "xtuple",
2472     "nameSpace": "XM",
2473     "type": "ShipZone",
2474     "table": "shipzone",
2475     "isRest": true,
2476     "lockable": true,
2477     "idSequenceName": "shipzone_shipzone_id_seq",
2478     "comment": "Ship Zone Map",
2479     "privileges": {
2480       "all": {
2481         "create": "MaintainShippingZones",
2482         "read": "ViewShippingZones",
2483         "update": "MaintainShippingZones",
2484         "delete": "MaintainShippingZones"
2485       }
2486     },
2487     "properties": [
2488       {
2489         "name": "id",
2490         "attr": {
2491           "type": "Number",
2492           "column": "shipzone_id",
2493           "isPrimaryKey": true
2494         }
2495       },
2496       {
2497         "name": "name",
2498         "attr": {
2499           "type": "String",
2500           "column": "shipzone_name",
2501           "isNaturalKey": true
2502         }
2503       },
2504       {
2505         "name": "description",
2506         "attr": {
2507           "type": "String",
2508           "column": "shipzone_descrip"
2509         }
2510       }
2511     ],
2512     "isSystem": true
2513   },
2514   {
2515     "context": "xtuple",
2516     "nameSpace": "XM",
2517     "type": "CustomerGroup",
2518     "table": "custgrp",
2519     "isRest": true,
2520     "idSequenceName": "custgrp_custgrp_id_seq",
2521     "lockable": true,
2522     "comment": "Customer Group Map",
2523     "privileges": {
2524       "all": {
2525         "create": "MaintainCustomerGroups",
2526         "read": "ViewCustomerGroups",
2527         "update": "MaintainCustomerGroups",
2528         "delete": "MaintainCustomerGroups"
2529       }
2530     },
2531     "properties": [
2532       {
2533         "name": "id",
2534         "attr": {
2535           "type": "Number",
2536           "column": "custgrp_id",
2537           "isPrimaryKey": true
2538         }
2539       },
2540       {
2541         "name": "name",
2542         "attr": {
2543           "type": "String",
2544           "column": "custgrp_name",
2545           "isNaturalKey": true
2546         }
2547       },
2548       {
2549         "name": "description",
2550         "attr": {
2551           "type": "String",
2552           "column": "custgrp_descrip"
2553         }
2554       },
2555       {
2556         "name": "customers",
2557         "toMany": {
2558           "isNested": true,
2559           "type": "CustomerGroupCustomer",
2560           "column": "custgrp_id",
2561           "inverse": "customerGroup"
2562         }
2563       }
2564     ],
2565     "isSystem": true
2566   },
2567   {
2568     "context": "xtuple",
2569     "nameSpace": "XM",
2570     "type": "CustomerGroupCustomer",
2571     "table": "custgrpitem",
2572     "idSequenceName": "custgrpitem_custgrpitem_id_seq",
2573     "comment": "Customer Group Customer Map",
2574     "properties": [
2575       {
2576         "name": "id",
2577         "attr": {
2578           "type": "Number",
2579           "column": "custgrpitem_id",
2580           "isPrimaryKey": true
2581         }
2582       },
2583       {
2584         "name": "uuid",
2585         "attr": {
2586           "type": "String",
2587           "column": "obj_uuid",
2588           "isNaturalKey": true
2589         }
2590       },
2591       {
2592         "name": "customerGroup",
2593         "attr": {
2594           "type": "Number",
2595           "column": "custgrpitem_custgrp_id"
2596         }
2597       },
2598       {
2599         "name": "customer",
2600         "toOne":        {
2601           "isNested": true,
2602           "type": "CustomerRelation",
2603           "column": "custgrpitem_cust_id"
2604         }
2605       }
2606     ],
2607     "isNestedOnly": true,
2608     "isSystem": true
2609   },
2610   {
2611     "context": "xtuple",
2612     "nameSpace": "XM",
2613     "type": "CustomerCustomerGroup",
2614     "table": "custgrpitem",
2615     "idSequenceName": "custgrpitem_custgrpitem_id_seq",
2616     "comment": "Customer Group Customer Map",
2617     "properties": [
2618       {
2619         "name": "id",
2620         "attr": {
2621           "type": "Number",
2622           "column": "custgrpitem_id",
2623           "isPrimaryKey": true
2624         }
2625       },
2626       {
2627         "name": "uuid",
2628         "attr": {
2629           "type": "String",
2630           "column": "obj_uuid",
2631           "isNaturalKey": true
2632         }
2633       },
2634       {
2635         "name": "customerGroup",
2636         "toOne": {
2637           "type": "CustomerGroup",
2638           "isNested": true,
2639           "column": "custgrpitem_custgrp_id"
2640         }
2641       },
2642       {
2643         "name": "customer",
2644         "attr": {
2645           "type": "Number",
2646           "column": "custgrpitem_cust_id"
2647         }
2648       }
2649     ],
2650     "isNestedOnly": true,
2651     "isSystem": true
2652   },
2653   {
2654     "context": "xtuple",
2655     "nameSpace": "XM",
2656     "type": "CustomerProspectRelation",
2657     "table": "xt.customer_prospect",
2658     "isRest": true,
2659     "comment": "Customer Prospect Relation Map",
2660     "privileges": {
2661       "all": {
2662         "create": false,
2663         "read": true,
2664         "update": false,
2665         "delete": false
2666       }
2667     },
2668     "properties": [
2669       {
2670         "name": "id",
2671         "attr": {
2672           "type": "Number",
2673           "column": "id",
2674           "isPrimaryKey": true
2675         }
2676       },
2677       {
2678         "name": "number",
2679         "attr": {
2680           "type": "String",
2681           "column": "number",
2682           "isNaturalKey": true
2683         }
2684       },
2685       {
2686         "name": "name",
2687         "attr": {
2688           "type": "String",
2689           "column": "name"
2690         }
2691       },
2692       {
2693         "name": "isActive",
2694         "attr": {
2695           "type": "Boolean",
2696           "column": "active"
2697         }
2698       },
2699       {
2700         "name": "billingContact",
2701         "toOne": {
2702           "isNested": true,
2703           "type": "ContactRelation",
2704           "column": "contact"
2705         }
2706       },
2707       {
2708         "name": "isFreeFormShipto",
2709         "attr": {
2710           "type": "Boolean",
2711           "column": "cust_ffshipto"
2712         }
2713       },
2714       {
2715         "name": "isFreeFormBillto",
2716         "attr": {
2717           "type": "Boolean",
2718           "column": "cust_ffbillto",
2719           "required": true
2720         }
2721       },
2722       {
2723         "name": "currency",
2724         "toOne": {
2725           "type": "Currency",
2726           "column": "cust_curr_id"
2727         }
2728       },
2729       {
2730         "name": "terms",
2731         "toOne": {
2732           "type": "Terms",
2733           "column": "cust_terms_id"
2734         }
2735       },
2736       {
2737         "name": "creditStatus",
2738         "attr": {
2739           "type": "String",
2740           "column": "cust_creditstatus"
2741         }
2742       },
2743       {
2744         "name": "salesRep",
2745         "toOne": {
2746           "type": "SalesRep",
2747           "column": "salesrep_id"
2748         }
2749       },
2750       {
2751         "name": "commission",
2752         "attr": {
2753           "type": "Percent",
2754           "column": "cust_commprcnt"
2755         }
2756       },
2757       {
2758         "name": "discount",
2759         "attr": {
2760           "type": "Percent",
2761           "column": "cust_discntprcnt"
2762         }
2763       },
2764       {
2765         "name": "taxZone",
2766         "toOne": {
2767           "type": "TaxZone",
2768           "column": "taxzone_id"
2769         }
2770       },
2771       {
2772         "name": "shipVia",
2773         "attr": {
2774           "type": "String",
2775           "column": "cust_shipvia"
2776         }
2777       },
2778       {
2779         "name": "shipCharge",
2780         "toOne": {
2781           "type": "ShipCharge",
2782           "column": "cust_shipchrg_id"
2783         }
2784       },
2785       {
2786         "name": "preferredSite",
2787         "toOne": {
2788           "type": "Site",
2789           "column": "site",
2790           "nullValue": -1
2791         }
2792       },
2793       {
2794         "name": "shiptos",
2795         "toMany": {
2796           "isNested": true,
2797           "type": "SalesCustomerShiptoRelation",
2798           "column": "id",
2799           "inverse": "customer"
2800         }
2801       },
2802       {
2803         "name": "status",
2804         "attr": {
2805           "type": "String",
2806           "column": "status"
2807         }
2808       },
2809       {
2810         "name": "customerType",
2811         "toOne": {
2812           "type": "CustomerType",
2813           "column": "type"
2814         }
2815       },
2816       {
2817         "name": "account",
2818         "attr": {
2819           "type": "Number",
2820           "column": "crmacct_id"
2821         }
2822       }
2823     ],
2824     "extensions": [],
2825     "isSystem": true
2826   },
2827   {
2828     "context": "xtuple",
2829     "nameSpace": "XM",
2830     "type": "CustomerProspectListItem",
2831     "table": "xt.customer_prospect",
2832     "isRest": true,
2833     "comment": "Customer Prospect List Item Map",
2834     "privileges": {
2835       "all": {
2836         "create": false,
2837         "read": true,
2838         "update": false,
2839         "delete": false
2840       }
2841     },
2842     "properties": [
2843       {
2844         "name": "id",
2845         "attr": {
2846           "type": "Number",
2847           "column": "id",
2848           "isPrimaryKey": true
2849         }
2850       },
2851       {
2852         "name": "number",
2853         "attr": {
2854           "type": "String",
2855           "column": "number",
2856           "isNaturalKey": true
2857         }
2858       },
2859       {
2860         "name": "name",
2861         "attr": {
2862           "type": "String",
2863           "column": "name"
2864         }
2865       },
2866       {
2867         "name": "isActive",
2868         "attr": {
2869           "type": "Boolean",
2870           "column": "active"
2871         }
2872       },
2873       {
2874         "name": "contact",
2875         "toOne": {
2876           "isNested": true,
2877           "type": "ContactRelation",
2878           "column": "contact"
2879         }
2880       },
2881       {
2882         "name": "status",
2883         "attr": {
2884           "type": "String",
2885           "column": "status"
2886         }
2887       },
2888       {
2889         "name": "customerType",
2890         "toOne": {
2891           "type": "CustomerType",
2892           "column": "type"
2893         }
2894       }
2895     ],
2896     "extensions": [],
2897     "isSystem": true
2898   }
2899 ]