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