Merge pull request #1784 from garyhgohoos/23593-2
[xtuple] / enyo-client / database / orm / models / employee.json
1 [
2   {
3     "context": "xtuple",
4     "nameSpace": "XM",
5     "type": "Department",
6     "table": "dept",
7     "idSequenceName": "dept_dept_id_seq",
8     "isRest": true,
9     "lockable": true,
10     "comment": "Department Map",
11     "privileges": {
12       "all": {
13         "create": "MaintainDepartments",
14         "read": true,
15         "update": "MaintainDepartments",
16         "delete": "MaintainDepartments"
17       }
18     },
19     "properties": [
20       {
21         "name": "id",
22         "attr": {
23           "type": "Number",
24           "column": "dept_id",
25           "isPrimaryKey": true
26         }
27       },
28       {
29         "name": "number",
30         "attr": {
31           "type": "String",
32           "column": "dept_number",
33           "isNaturalKey": true,
34           "required": true
35         }
36       },
37       {
38         "name": "name",
39         "attr": {
40           "type": "String",
41           "column": "dept_name",
42           "required": true
43         }
44       }
45     ],
46     "isSystem": true
47   },
48   {
49     "context": "xtuple",
50     "nameSpace": "XM",
51     "type": "Shift",
52     "table": "shift",
53     "idSequenceName": "shift_shift_id_seq",
54     "isRest": true,
55     "lockable": true,
56     "comment": "Shift Map",
57     "privileges": {
58       "all": {
59         "create": "MaintainShifts",
60         "read": true,
61         "update": "MaintainShifts",
62         "delete": "MaintainShifts"
63       }
64     },
65     "properties": [
66       {
67         "name": "id",
68         "attr": {
69           "type": "Number",
70           "column": "shift_id",
71           "isPrimaryKey": true
72         }
73       },
74       {
75         "name": "number",
76         "attr": {
77           "type": "String",
78           "column": "shift_number",
79           "isNaturalKey": true,
80           "required": true
81         }
82       },
83       {
84         "name": "name",
85         "attr": {
86           "type": "String",
87           "column": "shift_name",
88           "required": true
89         }
90       }
91     ],
92     "isSystem": true
93   },
94   {
95     "context": "xtuple",
96     "nameSpace": "XM",
97     "type": "Employee",
98     "table": "emp",
99     "idSequenceName": "emp_emp_id_seq",
100     "isRest": true,
101     "lockable": true,
102     "orderSequence": "CRMAccountNumber",
103     "comment": "Employee Map",
104     "privileges": {
105       "all": {
106         "create": "MaintainEmployees",
107         "read": "ViewEmployees",
108         "update": "MaintainEmployees",
109         "delete": "MaintainEmployees"
110       }
111     },
112     "properties": [
113       {
114         "name": "id",
115         "attr": {
116           "type": "Number",
117           "column": "emp_id",
118           "isPrimaryKey": true
119         }
120       },
121       {
122         "name": "code",
123         "attr": {
124           "type": "String",
125           "column": "emp_code",
126           "isNaturalKey": true,
127           "required": true
128         }
129       },
130       {
131         "name": "number",
132         "attr": {
133           "type": "String",
134           "column": "emp_number",
135           "required": true
136         }
137       },
138       {
139         "name": "name",
140         "attr": {
141           "type": "String",
142           "column": "emp_name"
143         }
144       },
145       {
146         "name": "isActive",
147         "attr": {
148           "type": "Boolean",
149           "column": "emp_active",
150           "required": true
151         }
152       },
153       {
154         "name": "contact",
155         "toOne": {
156           "isNested": true,
157           "type": "ContactRelation",
158           "column": "emp_cntct_id"
159         }
160       },
161       {
162         "name": "startDate",
163         "attr": {
164           "type": "Date",
165           "column": "emp_startdate"
166         }
167       },
168       {
169         "name": "site",
170         "toOne": {
171           "type": "SiteRelation",
172           "column": "emp_warehous_id"
173         }
174       },
175       {
176         "name": "owner",
177         "toOne": {
178           "isNested": true,
179           "type": "UserAccount",
180           "column": "emp_username",
181           "inverse": "username"
182         }
183       },
184       {
185         "name": "manager",
186         "toOne": {
187           "isNested": true,
188           "type": "EmployeeRelation",
189           "column": "emp_mgr_emp_id",
190           "inverse": "id"
191         }
192       },
193       {
194         "name": "department",
195         "toOne": {
196           "isNested": true,
197           "type": "Department",
198           "column": "emp_dept_id"
199         }
200       },
201       {
202         "name": "shift",
203         "toOne": {
204           "isNested": true,
205           "type": "Shift",
206           "column": "emp_shift_id"
207         }
208       },
209       {
210         "name": "wageType",
211         "attr": {
212           "type": "String",
213           "column": "emp_wage_type",
214           "required": true
215         }
216       },
217       {
218         "name": "wage",
219         "attr": {
220           "type": "Number",
221           "column": "emp_wage",
222           "required": true
223         }
224       },
225       {
226         "name": "wageCurrency",
227         "toOne": {
228           "type": "Currency",
229           "column": "emp_wage_curr_id"
230         }
231       },
232       {
233         "name": "wagePeriod",
234         "attr": {
235           "type": "String",
236           "column": "emp_wage_period",
237           "required": true
238         }
239       },
240       {
241         "name": "billingRate",
242         "attr": {
243           "type": "Number",
244           "column": "emp_extrate",
245           "required": true
246         }
247       },
248       {
249         "name": "billingPeriod",
250         "attr": {
251           "type": "String",
252           "column": "emp_extrate_period",
253           "required": true
254         }
255       },
256       {
257         "name": "notes",
258         "attr": {
259           "type": "String",
260           "column": "emp_notes"
261         }
262       },
263       {
264         "name": "comments",
265         "toMany": {
266           "isNested": true,
267           "type": "EmployeeComment",
268           "column": "emp_id",
269           "inverse": "employee"
270         }
271       },
272       {
273         "name": "characteristics",
274         "toMany": {
275           "isNested": true,
276           "type": "EmployeeCharacteristic",
277           "column": "emp_id",
278           "inverse": "employee"
279         }
280       },
281       {
282         "name": "groups",
283         "toMany": {
284           "isNested": true,
285           "type": "EmployeeGroupGroup",
286           "column": "emp_id",
287           "inverse": "employee"
288         }
289       }
290     ],
291     "isSystem": true
292   },
293   {
294     "context": "xtuple",
295     "nameSpace": "XM",
296     "type": "EmployeeRelation",
297     "table": "emp",
298     "isRest": true,
299     "comment": "Employee Relation Map",
300     "privileges": {
301       "all": {
302         "create": false,
303         "read": true,
304         "update": false,
305         "delete": false
306       }
307     },
308     "properties": [
309       {
310         "name": "id",
311         "attr": {
312           "type": "Number",
313           "column": "emp_id",
314           "isPrimaryKey": true
315         }
316       },
317       {
318         "name": "code",
319         "attr": {
320           "type": "String",
321           "column": "emp_code",
322           "isNaturalKey": true
323         }
324       },
325       {
326         "name": "name",
327         "attr": {
328           "type": "String",
329           "column": "emp_name"
330         }
331       },
332       {
333         "name": "isActive",
334         "attr": {
335           "type": "Boolean",
336           "column": "emp_active"
337         }
338       },
339       {
340         "name": "contact",
341         "toOne": {
342           "isNested": true,
343           "type": "ContactRelation",
344           "column": "emp_cntct_id"
345         }
346       },
347       {
348         "name": "manager",
349         "toOne": {
350           "isNested": true,
351           "type": "EmployeeEmployeeRelation",
352           "column": "emp_mgr_emp_id",
353           "inverse": "id"
354         }
355       },
356       {
357         "name": "department",
358         "toOne": {
359           "isNested": true,
360           "type": "Department",
361           "column": "emp_dept_id"
362         }
363       },
364       {
365         "name": "shift",
366         "toOne": {
367           "isNested": true,
368           "type": "Shift",
369           "column": "emp_shift_id"
370         }
371       },
372       {
373         "name": "site",
374         "toOne": {
375           "type": "SiteRelation",
376           "column": "emp_warehous_id"
377         }
378       }
379     ],
380     "isSystem": true
381   },
382   {
383     "context": "xtuple",
384     "nameSpace": "XM",
385     "type": "EmployeeEmployeeRelation",
386     "table": "emp",
387     "isRest": true,
388     "comment": "Employee Employee Relation Map",
389     "privileges": {
390       "all": {
391         "create": false,
392         "read": true,
393         "update": false,
394         "delete": false
395       }
396     },
397     "properties": [
398       {
399         "name": "id",
400         "attr": {
401           "type": "Number",
402           "column": "emp_id",
403           "isPrimaryKey": true
404         }
405       },
406       {
407         "name": "code",
408         "attr": {
409           "type": "String",
410           "column": "emp_code",
411           "isNaturalKey": true
412         }
413       },
414       {
415         "name": "name",
416         "attr": {
417           "type": "String",
418           "column": "emp_name"
419         }
420       },
421       {
422         "name": "isActive",
423         "attr": {
424           "type": "Boolean",
425           "column": "emp_active"
426         }
427       },
428       {
429         "name": "contact",
430         "toOne": {
431           "isNested": true,
432           "type": "ContactRelation",
433           "column": "emp_cntct_id"
434         }
435       }
436     ],
437     "isSystem": true
438   },
439   {
440     "context": "xtuple",
441     "nameSpace": "XM",
442     "type": "EmployeeComment",
443     "table": "comment",
444     "idSequenceName": "comment_comment_id_seq",
445     "comment": "Employee Comment Map",
446     "privileges": {
447       "all": {
448         "create": true,
449         "read": true,
450         "update": "EditOthersComments",
451         "delete": false
452       },
453       "personal": {
454         "update": "EditOwnComments",
455         "properties": [
456           "createdBy"
457         ]
458       }
459     },
460     "properties": [
461       {
462         "name": "id",
463         "attr": {
464           "type": "Number",
465           "column": "comment_id",
466           "isPrimaryKey": true
467         }
468       },
469       {
470         "name": "uuid",
471         "attr": {
472           "type": "String",
473           "column": "obj_uuid",
474           "isNaturalKey": true
475         }
476       },
477       {
478         "name": "sourceType",
479         "attr": {
480           "type": "String",
481           "column": "comment_source",
482           "value": "EMP"
483         }
484       },
485       {
486         "name": "employee",
487         "attr": {
488           "type": "Number",
489           "column": "comment_source_id"
490         }
491       },
492       {
493         "name": "commentType",
494         "toOne": {
495           "type": "CommentType",
496           "column": "comment_cmnttype_id",
497           "required": true
498         }
499       },
500       {
501         "name": "text",
502         "attr": {
503           "type": "String",
504           "column": "comment_text"
505         }
506       },
507       {
508         "name": "isPublic",
509         "attr": {
510           "type": "Boolean",
511           "column": "comment_public",
512           "value": true
513         }
514       },
515       {
516         "name": "created",
517         "attr": {
518           "type": "Date",
519           "column": "comment_date"
520         }
521       },
522       {
523         "name": "createdBy",
524         "attr": {
525           "type": "String",
526           "column": "comment_user"
527         }
528       }
529     ],
530     "isNestedOnly": true,
531     "isSystem": true
532   },
533   {
534     "context": "xtuple",
535     "nameSpace": "XM",
536     "type": "EmployeeCharacteristic",
537     "table": "charass",
538     "idSequenceName": "charass_charass_id_seq",
539     "comment": "Employee Characteristic Map",
540     "privileges": {
541       "all": {
542         "create": true,
543         "read": true,
544         "update": true,
545         "delete": true
546       }
547     },
548     "properties": [
549       {
550         "name": "id",
551         "attr": {
552           "type": "Number",
553           "column": "charass_id",
554           "isPrimaryKey": true
555         }
556       },
557       {
558         "name": "uuid",
559         "attr": {
560           "type": "String",
561           "column": "obj_uuid",
562           "isNaturalKey": true
563         }
564       },
565       {
566         "name": "targetType",
567         "attr": {
568           "type": "String",
569           "column": "charass_target_type",
570           "value": "EMP"
571         }
572       },
573       {
574         "name": "employee",
575         "attr": {
576           "type": "Number",
577           "column": "charass_target_id"
578         }
579       },
580       {
581         "name": "characteristic",
582         "toOne": {
583           "type": "Characteristic",
584           "column": "charass_char_id",
585           "required": true
586         }
587       },
588       {
589         "name": "value",
590         "attr": {
591           "type": "String",
592           "column": "charass_value"
593         }
594       }
595     ],
596     "isNestedOnly": true,
597     "isSystem": true
598   },
599   {
600     "context": "xtuple",
601     "nameSpace": "XM",
602     "type": "EmployeeGroup",
603     "table": "empgrp",
604     "isRest": true,
605     "idSequenceName": "empgrp_empgrp_id_seq",
606     "lockable": true,
607     "comment": "Employee Group Map",
608     "privileges": {
609       "all": {
610           "create": "MaintainEmployeeGroups",
611         "read": "ViewEmployeeGroups",
612         "update": "MaintainEmployeeGroups",
613         "delete": "MaintainEmployeeGroups"
614       }
615     },
616     "properties": [
617       {
618         "name": "id",
619         "attr": {
620           "type": "Number",
621           "column": "empgrp_id",
622           "isPrimaryKey": true
623         }
624       },
625       {
626         "name": "name",
627         "attr": {
628           "type": "String",
629           "column": "empgrp_name",
630           "isNaturalKey": true
631         }
632       },
633       {
634         "name": "description",
635         "attr": {
636           "type": "String",
637           "column": "empgrp_descrip"
638         }
639       },
640       {
641         "name": "employees",
642         "toMany": {
643           "isNested": true,
644           "type": "EmployeeGroupEmployee",
645           "column": "empgrp_id",
646           "inverse": "employeeGroup"
647         }
648       }
649     ],
650     "isSystem": true
651   },
652   {
653     "context": "xtuple",
654     "nameSpace": "XM",
655     "type": "EmployeeGroupEmployee",
656     "table": "empgrpitem",
657     "idSequenceName": "empgrpitem_empgrpitem_id_seq",
658     "comment": "Employee Group Employee Map",
659     "properties": [
660       {
661         "name": "id",
662         "attr": {
663           "type": "Number",
664           "column": "empgrpitem_id",
665           "isPrimaryKey": true
666         }
667       },
668       {
669         "name": "uuid",
670         "attr": {
671           "type": "String",
672           "column": "obj_uuid",
673           "isNaturalKey": true
674         }
675       },
676       {
677         "name": "employeeGroup",
678         "attr": {
679           "type": "Number",
680           "column": "empgrpitem_empgrp_id"
681         }
682       },
683       {
684         "name": "employee",
685         "toOne":        {
686           "isNested": true,
687           "type": "EmployeeRelation",
688           "column": "empgrpitem_emp_id"
689         }
690       }
691     ],
692     "isNestedOnly": true,
693     "isSystem": true
694   },
695   {
696     "context": "xtuple",
697     "nameSpace": "XM",
698     "type": "EmployeeGroupGroup",
699     "table": "empgrpitem",
700     "idSequenceName": "empgrpitem_empgrpitem_id_seq",
701     "comment": "Employee Group Group Map",
702     "properties": [
703       {
704         "name": "id",
705         "attr": {
706           "type": "Number",
707           "column": "empgrpitem_id",
708           "isPrimaryKey": true
709         }
710       },
711       {
712         "name": "uuid",
713         "attr": {
714           "type": "String",
715           "column": "obj_uuid",
716           "isNaturalKey": true
717         }
718       },
719       {
720         "name": "employeeGroup",
721         "toOne": {
722           "isNested": true,
723           "type": "EmployeeGroup",
724           "column": "empgrpitem_empgrp_id"
725         }
726       },
727       {
728         "name": "employee",
729         "attr": {
730           "type": "Number",
731           "column": "empgrpitem_emp_id"
732         }
733       }
734     ],
735     "isNestedOnly": true,
736     "isSystem": true
737   }
738 ]