@objectql/create 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/package.json +1 -1
  2. package/templates/enterprise/CHANGELOG.md +20 -0
  3. package/templates/enterprise/README.md +2 -2
  4. package/templates/enterprise/package.json +2 -2
  5. package/templates/enterprise/src/core/attachment.object.yml +10 -1
  6. package/templates/enterprise/src/core/organization.object.yml +41 -6
  7. package/templates/enterprise/src/core/user.object.yml +37 -12
  8. package/templates/enterprise/src/extensions/README.md +4 -4
  9. package/templates/enterprise/src/extensions/user_extension.object.yml +65 -0
  10. package/templates/enterprise/src/modules/crm/crm_account.object.yml +57 -13
  11. package/templates/enterprise/src/modules/crm/crm_contact.object.yml +42 -8
  12. package/templates/enterprise/src/modules/crm/crm_lead.object.yml +82 -21
  13. package/templates/enterprise/src/modules/crm/crm_opportunity.object.yml +65 -15
  14. package/templates/enterprise/src/modules/finance/finance_budget.object.yml +67 -16
  15. package/templates/enterprise/src/modules/finance/finance_expense.object.yml +75 -19
  16. package/templates/enterprise/src/modules/finance/finance_invoice.object.yml +61 -16
  17. package/templates/enterprise/src/modules/finance/finance_payment.object.yml +65 -16
  18. package/templates/enterprise/src/modules/hr/hr_department.object.yml +29 -2
  19. package/templates/enterprise/src/modules/hr/hr_employee.object.yml +50 -8
  20. package/templates/enterprise/src/modules/hr/hr_position.object.yml +46 -10
  21. package/templates/enterprise/src/modules/hr/hr_timesheet.object.yml +44 -8
  22. package/templates/enterprise/src/modules/project/project_milestone.object.yml +36 -4
  23. package/templates/enterprise/src/modules/project/project_project.object.yml +64 -13
  24. package/templates/enterprise/src/modules/project/project_task.object.yml +70 -9
  25. package/templates/enterprise/src/modules/project/project_timesheet_entry.object.yml +39 -4
  26. package/templates/enterprise/src/plugins/audit/audit.plugin.ts +1 -1
  27. package/templates/enterprise/src/plugins/audit/note.object.yml +17 -0
  28. package/templates/enterprise/tsconfig.tsbuildinfo +1 -1
  29. package/templates/hello-world/CHANGELOG.md +16 -0
  30. package/templates/hello-world/README.md +73 -10
  31. package/templates/hello-world/package.json +1 -1
  32. package/templates/hello-world/src/index.ts +17 -5
  33. package/templates/starter/CHANGELOG.md +20 -0
  34. package/templates/starter/package.json +1 -1
  35. package/templates/starter/src/modules/projects/projects.action.ts +195 -346
  36. package/templates/starter/src/modules/projects/projects.hook.ts +98 -263
  37. package/templates/starter/src/modules/projects/projects.object.yml +65 -6
  38. package/templates/starter/src/modules/projects/projects.validation.yml +13 -4
  39. package/templates/starter/src/seed.ts +1 -1
  40. package/templates/starter/tsconfig.tsbuildinfo +1 -1
  41. package/templates/enterprise/__tests__/data-api.test.ts +0 -554
  42. package/templates/enterprise/__tests__/data-api.test.ts.backup +0 -526
  43. package/templates/enterprise/__tests__/metadata-api.test.ts +0 -315
  44. package/templates/enterprise/__tests__/metadata-loading.test.ts +0 -258
  45. package/templates/enterprise/src/extensions/user.extension.object.yml +0 -42
  46. package/templates/starter/__tests__/projects-hooks-actions.test.ts +0 -498
@@ -1,7 +1,18 @@
1
+ # File: finance_payment.object.yml
2
+ # Object name is inferred from filename as 'finance_payment'
1
3
  label: Payment
2
4
  description: Payment transaction record
3
5
  icon: money-dollar-circle-line
4
6
 
7
+ ai_context:
8
+ intent: "Track customer payments and payment processing"
9
+ domain: financial_management
10
+ aliases: [payment, transaction, remittance]
11
+ common_queries:
12
+ - "Show payments by date"
13
+ - "Find pending payments"
14
+ - "List payments by method and status"
15
+
5
16
  fields:
6
17
  payment_number:
7
18
  type: text
@@ -15,6 +26,9 @@ fields:
15
26
  reference_to: finance_invoice
16
27
  label: Related Invoice
17
28
  index: true
29
+ ai_context:
30
+ intent: "Invoice this payment applies to"
31
+ semantic_type: association
18
32
 
19
33
  account:
20
34
  type: lookup
@@ -22,6 +36,9 @@ fields:
22
36
  label: Customer Account
23
37
  required: true
24
38
  index: true
39
+ ai_context:
40
+ intent: "Customer making the payment"
41
+ semantic_type: association
25
42
 
26
43
  payment_date:
27
44
  type: date
@@ -37,25 +54,42 @@ fields:
37
54
  payment_method:
38
55
  type: select
39
56
  options:
40
- - bank_transfer
41
- - credit_card
42
- - debit_card
43
- - check
44
- - cash
45
- - paypal
46
- - other
57
+ - label: Bank Transfer
58
+ value: bank_transfer
59
+ - label: Credit Card
60
+ value: credit_card
61
+ - label: Debit Card
62
+ value: debit_card
63
+ - label: Check
64
+ value: check
65
+ - label: Cash
66
+ value: cash
67
+ - label: PayPal
68
+ value: paypal
69
+ - label: Other
70
+ value: other
47
71
  required: true
48
72
  index: true
73
+ ai_context:
74
+ intent: "Payment method for processing and reconciliation"
75
+ selection_guidance: "Bank transfer for large amounts; Card for smaller transactions"
49
76
 
50
77
  currency:
51
78
  type: select
52
79
  options:
53
- - USD
54
- - EUR
55
- - GBP
56
- - CNY
57
- - JPY
80
+ - label: USD
81
+ value: USD
82
+ - label: EUR
83
+ value: EUR
84
+ - label: GBP
85
+ value: GBP
86
+ - label: CNY
87
+ value: CNY
88
+ - label: JPY
89
+ value: JPY
58
90
  defaultValue: USD
91
+ ai_context:
92
+ intent: "Payment currency for foreign exchange handling"
59
93
 
60
94
  reference_number:
61
95
  type: text
@@ -65,18 +99,33 @@ fields:
65
99
  status:
66
100
  type: select
67
101
  options:
68
- - pending
69
- - completed
70
- - failed
71
- - refunded
102
+ - label: Pending
103
+ value: pending
104
+ - label: Completed
105
+ value: completed
106
+ - label: Failed
107
+ value: failed
108
+ - label: Refunded
109
+ value: refunded
72
110
  defaultValue: pending
73
111
  required: true
74
112
  index: true
113
+ ai_context:
114
+ intent: "Current processing state of payment"
115
+ is_state_machine: true
116
+ transitions:
117
+ pending: [completed, failed]
118
+ completed: [refunded]
119
+ failed: [pending]
120
+ refunded: []
75
121
 
76
122
  processed_by:
77
123
  type: lookup
78
124
  reference_to: user
79
125
  label: Processed By
126
+ ai_context:
127
+ intent: "User who processed this payment"
128
+ semantic_type: association
80
129
 
81
130
  notes:
82
131
  type: textarea
@@ -1,7 +1,18 @@
1
+ # File: hr_department.object.yml
2
+ # Object name is inferred from filename as 'hr_department'
1
3
  label: Department
2
4
  description: Organizational department
3
5
  icon: building-line
4
6
 
7
+ ai_context:
8
+ intent: "Manage organizational structure and departments"
9
+ domain: human_resources
10
+ aliases: [department, org unit, division]
11
+ common_queries:
12
+ - "Show department hierarchy"
13
+ - "Find departments by manager"
14
+ - "List active departments by cost center"
15
+
5
16
  fields:
6
17
  name:
7
18
  type: text
@@ -9,6 +20,8 @@ fields:
9
20
  label: Department Name
10
21
  unique: true
11
22
  index: true
23
+ ai_context:
24
+ intent: "Official department name"
12
25
 
13
26
  code:
14
27
  type: text
@@ -22,11 +35,17 @@ fields:
22
35
  reference_to: hr_department
23
36
  label: Parent Department
24
37
  index: true
38
+ ai_context:
39
+ intent: "Parent department for organizational hierarchy"
40
+ semantic_type: hierarchy
25
41
 
26
42
  manager:
27
43
  type: lookup
28
44
  reference_to: hr_employee
29
45
  label: Department Manager
46
+ ai_context:
47
+ intent: "Employee managing this department"
48
+ semantic_type: ownership
30
49
 
31
50
  cost_center:
32
51
  type: text
@@ -44,10 +63,18 @@ fields:
44
63
  status:
45
64
  type: select
46
65
  options:
47
- - active
48
- - inactive
66
+ - label: Active
67
+ value: active
68
+ - label: Inactive
69
+ value: inactive
49
70
  defaultValue: active
50
71
  index: true
72
+ ai_context:
73
+ intent: "Current operational status"
74
+ is_state_machine: true
75
+ transitions:
76
+ active: [inactive]
77
+ inactive: [active]
51
78
 
52
79
  indexes:
53
80
  # For org tree
@@ -1,7 +1,18 @@
1
+ # File: hr_employee.object.yml
2
+ # Object name is inferred from filename as 'hr_employee'
1
3
  label: Employee
2
4
  description: Company employee record
3
5
  icon: user-line
4
6
 
7
+ ai_context:
8
+ intent: "Manage employee records and organizational relationships"
9
+ domain: human_resources
10
+ aliases: [employee, staff, team member]
11
+ common_queries:
12
+ - "Show employees by department"
13
+ - "Find employees by manager"
14
+ - "List active employees by position"
15
+
5
16
  fields:
6
17
  employee_number:
7
18
  type: text
@@ -15,6 +26,9 @@ fields:
15
26
  reference_to: user
16
27
  label: System User Account
17
28
  unique: true
29
+ ai_context:
30
+ intent: "Link to system user account for access control"
31
+ semantic_type: association
18
32
 
19
33
  first_name:
20
34
  type: text
@@ -30,8 +44,10 @@ fields:
30
44
 
31
45
  full_name:
32
46
  type: formula
33
- formula: "CONCAT(first_name, ' ', last_name)"
47
+ expression: "first_name + ' ' + last_name"
48
+ data_type: text
34
49
  label: Full Name
50
+ description: "Automatically calculated from first and last name"
35
51
 
36
52
  email:
37
53
  type: text
@@ -54,6 +70,9 @@ fields:
54
70
  label: Department
55
71
  required: true
56
72
  index: true
73
+ ai_context:
74
+ intent: "Department where employee works"
75
+ semantic_type: hierarchy
57
76
 
58
77
  position:
59
78
  type: lookup
@@ -61,12 +80,18 @@ fields:
61
80
  label: Position
62
81
  required: true
63
82
  index: true
83
+ ai_context:
84
+ intent: "Employee's job position and role"
85
+ semantic_type: association
64
86
 
65
87
  manager:
66
88
  type: lookup
67
89
  reference_to: hr_employee
68
90
  label: Direct Manager
69
91
  index: true
92
+ ai_context:
93
+ intent: "Employee's direct supervisor for reporting structure"
94
+ semantic_type: hierarchy
70
95
 
71
96
  hire_date:
72
97
  type: date
@@ -81,22 +106,39 @@ fields:
81
106
  employment_type:
82
107
  type: select
83
108
  options:
84
- - full_time
85
- - part_time
86
- - contract
87
- - intern
109
+ - label: Full Time
110
+ value: full_time
111
+ - label: Part Time
112
+ value: part_time
113
+ - label: Contract
114
+ value: contract
115
+ - label: Intern
116
+ value: intern
88
117
  defaultValue: full_time
89
118
  index: true
119
+ ai_context:
120
+ intent: "Employment classification for benefits and payroll"
121
+ selection_guidance: "Full Time for regular employees; Contract for consultants"
90
122
 
91
123
  status:
92
124
  type: select
93
125
  options:
94
- - active
95
- - on_leave
96
- - terminated
126
+ - label: Active
127
+ value: active
128
+ - label: On Leave
129
+ value: on_leave
130
+ - label: Terminated
131
+ value: terminated
97
132
  defaultValue: active
98
133
  required: true
99
134
  index: true
135
+ ai_context:
136
+ intent: "Current employment status"
137
+ is_state_machine: true
138
+ transitions:
139
+ active: [on_leave, terminated]
140
+ on_leave: [active, terminated]
141
+ terminated: []
100
142
 
101
143
  salary:
102
144
  type: currency
@@ -1,7 +1,18 @@
1
+ # File: hr_position.object.yml
2
+ # Object name is inferred from filename as 'hr_position'
1
3
  label: Position
2
4
  description: Job position or role
3
5
  icon: briefcase-line
4
6
 
7
+ ai_context:
8
+ intent: "Define job positions and career levels in the organization"
9
+ domain: human_resources
10
+ aliases: [position, job role, title]
11
+ common_queries:
12
+ - "Show positions by department"
13
+ - "Find positions by level"
14
+ - "List active positions with salary ranges"
15
+
5
16
  fields:
6
17
  title:
7
18
  type: text
@@ -19,27 +30,44 @@ fields:
19
30
  level:
20
31
  type: select
21
32
  options:
22
- - entry
23
- - junior
24
- - mid
25
- - senior
26
- - lead
27
- - manager
28
- - director
29
- - executive
33
+ - label: Entry
34
+ value: entry
35
+ - label: Junior
36
+ value: junior
37
+ - label: Mid
38
+ value: mid
39
+ - label: Senior
40
+ value: senior
41
+ - label: Lead
42
+ value: lead
43
+ - label: Manager
44
+ value: manager
45
+ - label: Director
46
+ value: director
47
+ - label: Executive
48
+ value: executive
30
49
  label: Position Level
31
50
  index: true
51
+ ai_context:
52
+ intent: "Career level and seniority for compensation bands"
53
+ selection_guidance: "Entry for new grads; Senior for 5+ years experience"
32
54
 
33
55
  department:
34
56
  type: lookup
35
57
  reference_to: hr_department
36
58
  label: Department
37
59
  index: true
60
+ ai_context:
61
+ intent: "Department where this position exists"
62
+ semantic_type: association
38
63
 
39
64
  reports_to:
40
65
  type: lookup
41
66
  reference_to: hr_position
42
67
  label: Reports To Position
68
+ ai_context:
69
+ intent: "Position hierarchy for reporting structure"
70
+ semantic_type: hierarchy
43
71
 
44
72
  min_salary:
45
73
  type: currency
@@ -64,10 +92,18 @@ fields:
64
92
  status:
65
93
  type: select
66
94
  options:
67
- - active
68
- - inactive
95
+ - label: Active
96
+ value: active
97
+ - label: Inactive
98
+ value: inactive
69
99
  defaultValue: active
70
100
  index: true
101
+ ai_context:
102
+ intent: "Whether position is currently open for hiring"
103
+ is_state_machine: true
104
+ transitions:
105
+ active: [inactive]
106
+ inactive: [active]
71
107
 
72
108
  indexes:
73
109
  # For department positions
@@ -1,7 +1,18 @@
1
+ # File: hr_timesheet.object.yml
2
+ # Object name is inferred from filename as 'hr_timesheet'
1
3
  label: Timesheet
2
4
  description: Employee time tracking
3
5
  icon: time-line
4
6
 
7
+ ai_context:
8
+ intent: "Track employee work hours and attendance"
9
+ domain: human_resources
10
+ aliases: [timesheet, attendance, time card]
11
+ common_queries:
12
+ - "Show timesheets for approval"
13
+ - "Find timesheets by employee and date"
14
+ - "List overtime hours by department"
15
+
5
16
  fields:
6
17
  employee:
7
18
  type: lookup
@@ -9,6 +20,9 @@ fields:
9
20
  label: Employee
10
21
  required: true
11
22
  index: true
23
+ ai_context:
24
+ intent: "Employee submitting time worked"
25
+ semantic_type: association
12
26
 
13
27
  work_date:
14
28
  type: date
@@ -47,28 +61,50 @@ fields:
47
61
  work_type:
48
62
  type: select
49
63
  options:
50
- - office
51
- - remote
52
- - field
53
- - client_site
64
+ - label: Office
65
+ value: office
66
+ - label: Remote
67
+ value: remote
68
+ - label: Field
69
+ value: field
70
+ - label: Client Site
71
+ value: client_site
54
72
  defaultValue: office
55
73
  index: true
74
+ ai_context:
75
+ intent: "Work location for tracking remote vs on-site"
76
+ selection_guidance: "Remote for work from home; Field for on-location work"
56
77
 
57
78
  status:
58
79
  type: select
59
80
  options:
60
- - draft
61
- - submitted
62
- - approved
63
- - rejected
81
+ - label: Draft
82
+ value: draft
83
+ - label: Submitted
84
+ value: submitted
85
+ - label: Approved
86
+ value: approved
87
+ - label: Rejected
88
+ value: rejected
64
89
  defaultValue: draft
65
90
  required: true
66
91
  index: true
92
+ ai_context:
93
+ intent: "Approval workflow state"
94
+ is_state_machine: true
95
+ transitions:
96
+ draft: [submitted]
97
+ submitted: [approved, rejected]
98
+ approved: []
99
+ rejected: [draft]
67
100
 
68
101
  approved_by:
69
102
  type: lookup
70
103
  reference_to: user
71
104
  label: Approved By
105
+ ai_context:
106
+ intent: "Manager who approved the timesheet"
107
+ semantic_type: association
72
108
 
73
109
  approved_at:
74
110
  type: datetime
@@ -1,13 +1,26 @@
1
+ # File: project_milestone.object.yml
2
+ # Object name is inferred from filename as 'project_milestone'
1
3
  label: Milestone
2
4
  description: Project milestone or checkpoint
3
5
  icon: flag-line
4
6
 
7
+ ai_context:
8
+ intent: "Track major project milestones and deliverables"
9
+ domain: project_management
10
+ aliases: [milestone, checkpoint, deliverable]
11
+ common_queries:
12
+ - "Show upcoming milestones"
13
+ - "Find milestones by project"
14
+ - "List completed milestones by date"
15
+
5
16
  fields:
6
17
  name:
7
18
  type: text
8
19
  required: true
9
20
  label: Milestone Name
10
21
  index: true
22
+ ai_context:
23
+ intent: "Descriptive name of the milestone"
11
24
 
12
25
  project:
13
26
  type: lookup
@@ -15,6 +28,9 @@ fields:
15
28
  label: Project
16
29
  required: true
17
30
  index: true
31
+ ai_context:
32
+ intent: "Project this milestone belongs to"
33
+ semantic_type: hierarchy
18
34
 
19
35
  description:
20
36
  type: textarea
@@ -32,19 +48,35 @@ fields:
32
48
 
33
49
  status:
34
50
  type: select
51
+ label: Milestone Status
35
52
  options:
36
- - pending
37
- - in_progress
38
- - completed
39
- - missed
53
+ - label: Pending
54
+ value: pending
55
+ - label: In Progress
56
+ value: in_progress
57
+ - label: Completed
58
+ value: completed
59
+ - label: Missed
60
+ value: missed
40
61
  defaultValue: pending
41
62
  required: true
42
63
  index: true
64
+ ai_context:
65
+ intent: "Current state of milestone progress"
66
+ is_state_machine: true
67
+ transitions:
68
+ pending: [in_progress]
69
+ in_progress: [completed, missed]
70
+ completed: []
71
+ missed: []
43
72
 
44
73
  owner:
45
74
  type: lookup
46
75
  reference_to: user
47
76
  label: Milestone Owner
77
+ ai_context:
78
+ intent: "Person responsible for delivering this milestone"
79
+ semantic_type: ownership
48
80
 
49
81
  deliverables:
50
82
  type: textarea
@@ -1,13 +1,26 @@
1
+ # File: project_project.object.yml
2
+ # Object name is inferred from filename as 'project_project'
1
3
  label: Project
2
4
  description: Project or initiative
3
5
  icon: folder-line
4
6
 
7
+ ai_context:
8
+ intent: "Manage projects and track execution from planning to completion"
9
+ domain: project_management
10
+ aliases: [project, initiative, program]
11
+ common_queries:
12
+ - "Show active projects by priority"
13
+ - "Find projects by manager"
14
+ - "List projects by status and department"
15
+
5
16
  fields:
6
17
  name:
7
18
  type: text
8
19
  required: true
9
20
  label: Project Name
10
21
  index: true
22
+ ai_context:
23
+ intent: "Descriptive project name"
11
24
 
12
25
  code:
13
26
  type: text
@@ -22,40 +35,72 @@ fields:
22
35
 
23
36
  status:
24
37
  type: select
38
+ label: Project Status
25
39
  options:
26
- - planning
27
- - active
28
- - on_hold
29
- - completed
30
- - cancelled
40
+ - label: Planning
41
+ value: planning
42
+ - label: Active
43
+ value: active
44
+ - label: On Hold
45
+ value: on_hold
46
+ - label: Completed
47
+ value: completed
48
+ - label: Cancelled
49
+ value: cancelled
31
50
  defaultValue: planning
32
51
  required: true
33
52
  index: true
53
+ ai_context:
54
+ intent: "Current project lifecycle stage"
55
+ is_state_machine: true
56
+ transitions:
57
+ planning: [active, cancelled]
58
+ active: [on_hold, completed, cancelled]
59
+ on_hold: [active, cancelled]
60
+ completed: []
61
+ cancelled: []
34
62
 
35
63
  priority:
36
64
  type: select
37
65
  options:
38
- - low
39
- - medium
40
- - high
41
- - critical
66
+ - label: Low
67
+ value: low
68
+ - label: Medium
69
+ value: medium
70
+ - label: High
71
+ value: high
72
+ - label: Critical
73
+ value: critical
42
74
  defaultValue: medium
43
75
  index: true
76
+ ai_context:
77
+ intent: "Project urgency and business impact"
78
+ selection_guidance: "Critical for strategic initiatives; High for important projects"
44
79
 
45
80
  type:
46
81
  type: select
47
82
  options:
48
- - internal
49
- - customer
50
- - research
51
- - maintenance
83
+ - label: Internal
84
+ value: internal
85
+ - label: Customer
86
+ value: customer
87
+ - label: Research
88
+ value: research
89
+ - label: Maintenance
90
+ value: maintenance
52
91
  index: true
92
+ ai_context:
93
+ intent: "Project category for resource allocation"
94
+ selection_guidance: "Customer for client projects; Internal for company initiatives"
53
95
 
54
96
  account:
55
97
  type: lookup
56
98
  reference_to: crm_account
57
99
  label: Customer Account
58
100
  index: true
101
+ ai_context:
102
+ intent: "Customer for external projects"
103
+ semantic_type: association
59
104
 
60
105
  owner:
61
106
  type: lookup
@@ -63,12 +108,18 @@ fields:
63
108
  label: Project Manager
64
109
  required: true
65
110
  index: true
111
+ ai_context:
112
+ intent: "Project manager responsible for delivery"
113
+ semantic_type: ownership
66
114
 
67
115
  department:
68
116
  type: lookup
69
117
  reference_to: hr_department
70
118
  label: Department
71
119
  index: true
120
+ ai_context:
121
+ intent: "Department owning this project"
122
+ semantic_type: association
72
123
 
73
124
  start_date:
74
125
  type: date