@objectql/create 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +28 -0
- package/dist/bin.js +125 -0
- package/package.json +27 -0
- package/templates/enterprise/CHANGELOG.md +140 -0
- package/templates/enterprise/README.md +352 -0
- package/templates/enterprise/__tests__/data-api.test.ts +546 -0
- package/templates/enterprise/__tests__/data-api.test.ts.backup +526 -0
- package/templates/enterprise/__tests__/metadata-api.test.ts +307 -0
- package/templates/enterprise/__tests__/metadata-loading.test.ts +250 -0
- package/templates/enterprise/jest.config.js +22 -0
- package/templates/enterprise/package.json +51 -0
- package/templates/enterprise/src/apps/erp.app.yml +4 -0
- package/templates/enterprise/src/core/attachment.object.yml +57 -0
- package/templates/enterprise/src/core/i18n/en/core.json +60 -0
- package/templates/enterprise/src/core/i18n/zh-CN/core.json +60 -0
- package/templates/enterprise/src/core/index.ts +24 -0
- package/templates/enterprise/src/core/organization.object.yml +78 -0
- package/templates/enterprise/src/core/user.object.yml +80 -0
- package/templates/enterprise/src/extensions/README.md +56 -0
- package/templates/enterprise/src/extensions/user.extension.object.yml +42 -0
- package/templates/enterprise/src/extensions/user.ts +26 -0
- package/templates/enterprise/src/index.ts +47 -0
- package/templates/enterprise/src/modules/crm/README.md +99 -0
- package/templates/enterprise/src/modules/crm/crm_account.object.yml +105 -0
- package/templates/enterprise/src/modules/crm/crm_contact.object.yml +103 -0
- package/templates/enterprise/src/modules/crm/crm_lead.object.yml +148 -0
- package/templates/enterprise/src/modules/crm/crm_opportunity.object.yml +128 -0
- package/templates/enterprise/src/modules/crm/i18n/en/crm.json +61 -0
- package/templates/enterprise/src/modules/crm/i18n/zh-CN/crm.json +61 -0
- package/templates/enterprise/src/modules/crm/index.ts +29 -0
- package/templates/enterprise/src/modules/finance/README.md +112 -0
- package/templates/enterprise/src/modules/finance/finance_budget.object.yml +108 -0
- package/templates/enterprise/src/modules/finance/finance_expense.object.yml +151 -0
- package/templates/enterprise/src/modules/finance/finance_invoice.object.yml +143 -0
- package/templates/enterprise/src/modules/finance/finance_payment.object.yml +96 -0
- package/templates/enterprise/src/modules/finance/index.ts +26 -0
- package/templates/enterprise/src/modules/hr/README.md +95 -0
- package/templates/enterprise/src/modules/hr/hr_department.object.yml +59 -0
- package/templates/enterprise/src/modules/hr/hr_employee.object.yml +137 -0
- package/templates/enterprise/src/modules/hr/hr_position.object.yml +79 -0
- package/templates/enterprise/src/modules/hr/hr_timesheet.object.yml +114 -0
- package/templates/enterprise/src/modules/hr/index.ts +26 -0
- package/templates/enterprise/src/modules/project/README.md +132 -0
- package/templates/enterprise/src/modules/project/index.ts +26 -0
- package/templates/enterprise/src/modules/project/project_milestone.object.yml +70 -0
- package/templates/enterprise/src/modules/project/project_project.object.yml +135 -0
- package/templates/enterprise/src/modules/project/project_task.object.yml +121 -0
- package/templates/enterprise/src/modules/project/project_timesheet_entry.object.yml +95 -0
- package/templates/enterprise/src/plugins/audit/audit.plugin.ts +23 -0
- package/templates/enterprise/src/plugins/audit/index.ts +6 -0
- package/templates/enterprise/src/plugins/audit/note.object.yml +3 -0
- package/templates/enterprise/src/shared/constants.ts +30 -0
- package/templates/enterprise/src/shared/utils.ts +54 -0
- package/templates/enterprise/src/shared/validators.ts +47 -0
- package/templates/enterprise/src/types/attachment.ts +41 -0
- package/templates/enterprise/src/types/crm_account.ts +61 -0
- package/templates/enterprise/src/types/crm_contact.ts +61 -0
- package/templates/enterprise/src/types/crm_lead.ts +77 -0
- package/templates/enterprise/src/types/crm_opportunity.ts +53 -0
- package/templates/enterprise/src/types/finance_budget.ts +61 -0
- package/templates/enterprise/src/types/finance_expense.ts +65 -0
- package/templates/enterprise/src/types/finance_invoice.ts +69 -0
- package/templates/enterprise/src/types/finance_payment.ts +49 -0
- package/templates/enterprise/src/types/hr_department.ts +37 -0
- package/templates/enterprise/src/types/hr_employee.ts +85 -0
- package/templates/enterprise/src/types/hr_position.ts +49 -0
- package/templates/enterprise/src/types/hr_timesheet.ts +57 -0
- package/templates/enterprise/src/types/index.ts +20 -0
- package/templates/enterprise/src/types/note.ts +9 -0
- package/templates/enterprise/src/types/organization.ts +53 -0
- package/templates/enterprise/src/types/project_milestone.ts +41 -0
- package/templates/enterprise/src/types/project_project.ts +69 -0
- package/templates/enterprise/src/types/project_task.ts +57 -0
- package/templates/enterprise/src/types/project_timesheet_entry.ts +45 -0
- package/templates/enterprise/src/types/user.ts +65 -0
- package/templates/enterprise/tsconfig.json +10 -0
- package/templates/enterprise/tsconfig.tsbuildinfo +1 -0
- package/templates/hello-world/CHANGELOG.md +33 -0
- package/templates/hello-world/README.md +29 -0
- package/templates/hello-world/package.json +24 -0
- package/templates/hello-world/src/index.ts +58 -0
- package/templates/hello-world/tsconfig.json +10 -0
- package/templates/starter/CHANGELOG.md +191 -0
- package/templates/starter/README.md +17 -0
- package/templates/starter/__tests__/projects-hooks-actions.test.ts +490 -0
- package/templates/starter/jest.config.js +22 -0
- package/templates/starter/package.json +51 -0
- package/templates/starter/src/README.pages.md +110 -0
- package/templates/starter/src/demo.app.yml +4 -0
- package/templates/starter/src/i18n/zh-CN/projects.json +22 -0
- package/templates/starter/src/index.ts +55 -0
- package/templates/starter/src/modules/kitchen-sink/kitchen_sink.data.yml +18 -0
- package/templates/starter/src/modules/kitchen-sink/kitchen_sink.object.yml +156 -0
- package/templates/starter/src/modules/projects/project_approval.workflow.yml +51 -0
- package/templates/starter/src/modules/projects/projects.action.ts +472 -0
- package/templates/starter/src/modules/projects/projects.data.yml +13 -0
- package/templates/starter/src/modules/projects/projects.hook.ts +339 -0
- package/templates/starter/src/modules/projects/projects.object.yml +148 -0
- package/templates/starter/src/modules/projects/projects.permission.yml +141 -0
- package/templates/starter/src/modules/projects/projects.validation.yml +37 -0
- package/templates/starter/src/modules/tasks/tasks.data.yml +23 -0
- package/templates/starter/src/modules/tasks/tasks.object.yml +34 -0
- package/templates/starter/src/modules/tasks/tasks.permission.yml +167 -0
- package/templates/starter/src/types/index.ts +3 -0
- package/templates/starter/src/types/kitchen_sink.ts +101 -0
- package/templates/starter/src/types/projects.ts +49 -0
- package/templates/starter/src/types/tasks.ts +33 -0
- package/templates/starter/tsconfig.json +11 -0
- package/templates/starter/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
label: Employee
|
|
2
|
+
description: Company employee record
|
|
3
|
+
icon: user-line
|
|
4
|
+
|
|
5
|
+
fields:
|
|
6
|
+
employee_number:
|
|
7
|
+
type: text
|
|
8
|
+
required: true
|
|
9
|
+
label: Employee Number
|
|
10
|
+
unique: true
|
|
11
|
+
index: true
|
|
12
|
+
|
|
13
|
+
user:
|
|
14
|
+
type: lookup
|
|
15
|
+
reference_to: user
|
|
16
|
+
label: System User Account
|
|
17
|
+
unique: true
|
|
18
|
+
|
|
19
|
+
first_name:
|
|
20
|
+
type: text
|
|
21
|
+
required: true
|
|
22
|
+
label: First Name
|
|
23
|
+
index: true
|
|
24
|
+
|
|
25
|
+
last_name:
|
|
26
|
+
type: text
|
|
27
|
+
required: true
|
|
28
|
+
label: Last Name
|
|
29
|
+
index: true
|
|
30
|
+
|
|
31
|
+
full_name:
|
|
32
|
+
type: formula
|
|
33
|
+
formula: "CONCAT(first_name, ' ', last_name)"
|
|
34
|
+
label: Full Name
|
|
35
|
+
|
|
36
|
+
email:
|
|
37
|
+
type: text
|
|
38
|
+
required: true
|
|
39
|
+
label: Work Email
|
|
40
|
+
unique: true
|
|
41
|
+
index: true
|
|
42
|
+
|
|
43
|
+
phone:
|
|
44
|
+
type: text
|
|
45
|
+
label: Work Phone
|
|
46
|
+
|
|
47
|
+
mobile:
|
|
48
|
+
type: text
|
|
49
|
+
label: Mobile Phone
|
|
50
|
+
|
|
51
|
+
department:
|
|
52
|
+
type: lookup
|
|
53
|
+
reference_to: hr_department
|
|
54
|
+
label: Department
|
|
55
|
+
required: true
|
|
56
|
+
index: true
|
|
57
|
+
|
|
58
|
+
position:
|
|
59
|
+
type: lookup
|
|
60
|
+
reference_to: hr_position
|
|
61
|
+
label: Position
|
|
62
|
+
required: true
|
|
63
|
+
index: true
|
|
64
|
+
|
|
65
|
+
manager:
|
|
66
|
+
type: lookup
|
|
67
|
+
reference_to: hr_employee
|
|
68
|
+
label: Direct Manager
|
|
69
|
+
index: true
|
|
70
|
+
|
|
71
|
+
hire_date:
|
|
72
|
+
type: date
|
|
73
|
+
required: true
|
|
74
|
+
label: Hire Date
|
|
75
|
+
index: true
|
|
76
|
+
|
|
77
|
+
termination_date:
|
|
78
|
+
type: date
|
|
79
|
+
label: Termination Date
|
|
80
|
+
|
|
81
|
+
employment_type:
|
|
82
|
+
type: select
|
|
83
|
+
options:
|
|
84
|
+
- full_time
|
|
85
|
+
- part_time
|
|
86
|
+
- contract
|
|
87
|
+
- intern
|
|
88
|
+
defaultValue: full_time
|
|
89
|
+
index: true
|
|
90
|
+
|
|
91
|
+
status:
|
|
92
|
+
type: select
|
|
93
|
+
options:
|
|
94
|
+
- active
|
|
95
|
+
- on_leave
|
|
96
|
+
- terminated
|
|
97
|
+
defaultValue: active
|
|
98
|
+
required: true
|
|
99
|
+
index: true
|
|
100
|
+
|
|
101
|
+
salary:
|
|
102
|
+
type: currency
|
|
103
|
+
label: Base Salary
|
|
104
|
+
|
|
105
|
+
location:
|
|
106
|
+
type: text
|
|
107
|
+
label: Office Location
|
|
108
|
+
index: true
|
|
109
|
+
|
|
110
|
+
emergency_contact_name:
|
|
111
|
+
type: text
|
|
112
|
+
label: Emergency Contact Name
|
|
113
|
+
|
|
114
|
+
emergency_contact_phone:
|
|
115
|
+
type: text
|
|
116
|
+
label: Emergency Contact Phone
|
|
117
|
+
|
|
118
|
+
notes:
|
|
119
|
+
type: textarea
|
|
120
|
+
label: Notes
|
|
121
|
+
|
|
122
|
+
indexes:
|
|
123
|
+
# For department roster
|
|
124
|
+
department_status_idx:
|
|
125
|
+
fields: [department, status]
|
|
126
|
+
|
|
127
|
+
# For org chart
|
|
128
|
+
manager_department_idx:
|
|
129
|
+
fields: [manager, department]
|
|
130
|
+
|
|
131
|
+
# For position analysis
|
|
132
|
+
position_status_idx:
|
|
133
|
+
fields: [position, status]
|
|
134
|
+
|
|
135
|
+
# For tenure reporting
|
|
136
|
+
hire_date_status_idx:
|
|
137
|
+
fields: [hire_date, status]
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
label: Position
|
|
2
|
+
description: Job position or role
|
|
3
|
+
icon: briefcase-line
|
|
4
|
+
|
|
5
|
+
fields:
|
|
6
|
+
title:
|
|
7
|
+
type: text
|
|
8
|
+
required: true
|
|
9
|
+
label: Position Title
|
|
10
|
+
index: true
|
|
11
|
+
|
|
12
|
+
code:
|
|
13
|
+
type: text
|
|
14
|
+
required: true
|
|
15
|
+
label: Position Code
|
|
16
|
+
unique: true
|
|
17
|
+
index: true
|
|
18
|
+
|
|
19
|
+
level:
|
|
20
|
+
type: select
|
|
21
|
+
options:
|
|
22
|
+
- entry
|
|
23
|
+
- junior
|
|
24
|
+
- mid
|
|
25
|
+
- senior
|
|
26
|
+
- lead
|
|
27
|
+
- manager
|
|
28
|
+
- director
|
|
29
|
+
- executive
|
|
30
|
+
label: Position Level
|
|
31
|
+
index: true
|
|
32
|
+
|
|
33
|
+
department:
|
|
34
|
+
type: lookup
|
|
35
|
+
reference_to: hr_department
|
|
36
|
+
label: Department
|
|
37
|
+
index: true
|
|
38
|
+
|
|
39
|
+
reports_to:
|
|
40
|
+
type: lookup
|
|
41
|
+
reference_to: hr_position
|
|
42
|
+
label: Reports To Position
|
|
43
|
+
|
|
44
|
+
min_salary:
|
|
45
|
+
type: currency
|
|
46
|
+
label: Minimum Salary
|
|
47
|
+
|
|
48
|
+
max_salary:
|
|
49
|
+
type: currency
|
|
50
|
+
label: Maximum Salary
|
|
51
|
+
|
|
52
|
+
description:
|
|
53
|
+
type: textarea
|
|
54
|
+
label: Job Description
|
|
55
|
+
|
|
56
|
+
requirements:
|
|
57
|
+
type: textarea
|
|
58
|
+
label: Requirements & Qualifications
|
|
59
|
+
|
|
60
|
+
responsibilities:
|
|
61
|
+
type: textarea
|
|
62
|
+
label: Key Responsibilities
|
|
63
|
+
|
|
64
|
+
status:
|
|
65
|
+
type: select
|
|
66
|
+
options:
|
|
67
|
+
- active
|
|
68
|
+
- inactive
|
|
69
|
+
defaultValue: active
|
|
70
|
+
index: true
|
|
71
|
+
|
|
72
|
+
indexes:
|
|
73
|
+
# For department positions
|
|
74
|
+
department_level_idx:
|
|
75
|
+
fields: [department, level]
|
|
76
|
+
|
|
77
|
+
# For position hierarchy
|
|
78
|
+
reports_to_status_idx:
|
|
79
|
+
fields: [reports_to, status]
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
label: Timesheet
|
|
2
|
+
description: Employee time tracking
|
|
3
|
+
icon: time-line
|
|
4
|
+
|
|
5
|
+
fields:
|
|
6
|
+
employee:
|
|
7
|
+
type: lookup
|
|
8
|
+
reference_to: hr_employee
|
|
9
|
+
label: Employee
|
|
10
|
+
required: true
|
|
11
|
+
index: true
|
|
12
|
+
|
|
13
|
+
work_date:
|
|
14
|
+
type: date
|
|
15
|
+
required: true
|
|
16
|
+
label: Work Date
|
|
17
|
+
index: true
|
|
18
|
+
|
|
19
|
+
clock_in:
|
|
20
|
+
type: datetime
|
|
21
|
+
label: Clock In Time
|
|
22
|
+
|
|
23
|
+
clock_out:
|
|
24
|
+
type: datetime
|
|
25
|
+
label: Clock Out Time
|
|
26
|
+
|
|
27
|
+
total_hours:
|
|
28
|
+
type: number
|
|
29
|
+
label: Total Hours
|
|
30
|
+
scale: 2
|
|
31
|
+
|
|
32
|
+
regular_hours:
|
|
33
|
+
type: number
|
|
34
|
+
label: Regular Hours
|
|
35
|
+
scale: 2
|
|
36
|
+
|
|
37
|
+
overtime_hours:
|
|
38
|
+
type: number
|
|
39
|
+
label: Overtime Hours
|
|
40
|
+
scale: 2
|
|
41
|
+
|
|
42
|
+
break_hours:
|
|
43
|
+
type: number
|
|
44
|
+
label: Break Hours
|
|
45
|
+
scale: 2
|
|
46
|
+
|
|
47
|
+
work_type:
|
|
48
|
+
type: select
|
|
49
|
+
options:
|
|
50
|
+
- office
|
|
51
|
+
- remote
|
|
52
|
+
- field
|
|
53
|
+
- client_site
|
|
54
|
+
defaultValue: office
|
|
55
|
+
index: true
|
|
56
|
+
|
|
57
|
+
status:
|
|
58
|
+
type: select
|
|
59
|
+
options:
|
|
60
|
+
- draft
|
|
61
|
+
- submitted
|
|
62
|
+
- approved
|
|
63
|
+
- rejected
|
|
64
|
+
defaultValue: draft
|
|
65
|
+
required: true
|
|
66
|
+
index: true
|
|
67
|
+
|
|
68
|
+
approved_by:
|
|
69
|
+
type: lookup
|
|
70
|
+
reference_to: user
|
|
71
|
+
label: Approved By
|
|
72
|
+
|
|
73
|
+
approved_at:
|
|
74
|
+
type: datetime
|
|
75
|
+
label: Approval Time
|
|
76
|
+
|
|
77
|
+
notes:
|
|
78
|
+
type: textarea
|
|
79
|
+
label: Notes
|
|
80
|
+
|
|
81
|
+
indexes:
|
|
82
|
+
# For employee timesheet lookup
|
|
83
|
+
employee_date_idx:
|
|
84
|
+
fields: [employee, work_date]
|
|
85
|
+
unique: true
|
|
86
|
+
|
|
87
|
+
# For approval workflow
|
|
88
|
+
status_employee_idx:
|
|
89
|
+
fields: [status, employee]
|
|
90
|
+
|
|
91
|
+
# For date range reports
|
|
92
|
+
work_date_status_idx:
|
|
93
|
+
fields: [work_date, status]
|
|
94
|
+
|
|
95
|
+
actions:
|
|
96
|
+
submit:
|
|
97
|
+
type: record
|
|
98
|
+
label: Submit for Approval
|
|
99
|
+
icon: send-plane-line
|
|
100
|
+
|
|
101
|
+
approve:
|
|
102
|
+
type: record
|
|
103
|
+
label: Approve Timesheet
|
|
104
|
+
icon: checkbox-circle-line
|
|
105
|
+
|
|
106
|
+
reject:
|
|
107
|
+
type: record
|
|
108
|
+
label: Reject Timesheet
|
|
109
|
+
icon: close-circle-line
|
|
110
|
+
params:
|
|
111
|
+
reason:
|
|
112
|
+
type: textarea
|
|
113
|
+
label: Rejection Reason
|
|
114
|
+
required: true
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HR Module - Human Resources Management
|
|
3
|
+
*
|
|
4
|
+
* Exports all HR objects, actions, and hooks
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const HR_OBJECTS = [
|
|
8
|
+
'hr_employee',
|
|
9
|
+
'hr_department',
|
|
10
|
+
'hr_position',
|
|
11
|
+
'hr_timesheet',
|
|
12
|
+
] as const;
|
|
13
|
+
|
|
14
|
+
export type HRObject = typeof HR_OBJECTS[number];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Module metadata
|
|
18
|
+
*/
|
|
19
|
+
export const HR_MODULE = {
|
|
20
|
+
name: 'hr',
|
|
21
|
+
label: 'Human Resources',
|
|
22
|
+
description: 'Manage employees, departments, and time tracking',
|
|
23
|
+
version: '1.0.0',
|
|
24
|
+
objects: HR_OBJECTS,
|
|
25
|
+
icon: 'team-line',
|
|
26
|
+
} as const;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Project Management Module
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
The Project Management module handles project planning, task tracking, milestones, and time tracking against projects.
|
|
5
|
+
|
|
6
|
+
## Objects
|
|
7
|
+
|
|
8
|
+
### project_project
|
|
9
|
+
Main project or initiative records.
|
|
10
|
+
|
|
11
|
+
**Key Features:**
|
|
12
|
+
- Status tracking (planning → active → completed)
|
|
13
|
+
- Priority classification
|
|
14
|
+
- Budget and hour estimation
|
|
15
|
+
- Customer project linkage
|
|
16
|
+
- Completion percentage tracking
|
|
17
|
+
|
|
18
|
+
### project_task
|
|
19
|
+
Individual tasks and work items within projects.
|
|
20
|
+
|
|
21
|
+
**Key Features:**
|
|
22
|
+
- Hierarchical task structure (parent-child)
|
|
23
|
+
- Status workflow (todo → in progress → review → completed)
|
|
24
|
+
- Assignment and due date tracking
|
|
25
|
+
- Hour estimation and actuals
|
|
26
|
+
- Milestone linkage
|
|
27
|
+
|
|
28
|
+
### project_milestone
|
|
29
|
+
Project milestones and checkpoints.
|
|
30
|
+
|
|
31
|
+
**Key Features:**
|
|
32
|
+
- Deliverables definition
|
|
33
|
+
- Success criteria
|
|
34
|
+
- Target vs. actual completion dates
|
|
35
|
+
- Status tracking
|
|
36
|
+
|
|
37
|
+
### project_timesheet_entry
|
|
38
|
+
Time entries logged against projects and tasks.
|
|
39
|
+
|
|
40
|
+
**Key Features:**
|
|
41
|
+
- Billable/non-billable classification
|
|
42
|
+
- Approval workflow
|
|
43
|
+
- Project and task association
|
|
44
|
+
- Work description
|
|
45
|
+
|
|
46
|
+
## Relationships
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
Project <--has many-- Task
|
|
50
|
+
Project <--has many-- Milestone
|
|
51
|
+
Project <--has many-- TimesheetEntry
|
|
52
|
+
Task <--has many-- TimesheetEntry
|
|
53
|
+
Task <--belongs to-- Milestone
|
|
54
|
+
Task <--parent of--> Task (self-referencing)
|
|
55
|
+
Account <--has many-- Project
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Team Ownership
|
|
59
|
+
**Owner:** PMO (Project Management Office)
|
|
60
|
+
**Primary Contact:** pmo@example.com
|
|
61
|
+
|
|
62
|
+
## Dependencies
|
|
63
|
+
- **Core Objects:** `user` (for project ownership and task assignment)
|
|
64
|
+
- **Cross-Module:** `crm_account` (customer projects), `hr_employee` (timesheet entries), `hr_department` (project departments)
|
|
65
|
+
|
|
66
|
+
## Custom Actions
|
|
67
|
+
- `Project.complete` - Mark project as completed
|
|
68
|
+
- `Task.start` - Start working on task
|
|
69
|
+
- `Task.complete` - Complete task with actual hours
|
|
70
|
+
- `Milestone.mark_completed` - Mark milestone as completed
|
|
71
|
+
- `TimesheetEntry.submit` - Submit time entry for approval
|
|
72
|
+
- `TimesheetEntry.approve` - Approve time entry
|
|
73
|
+
|
|
74
|
+
## Indexes Strategy
|
|
75
|
+
- Project-based indexes for task and timesheet queries
|
|
76
|
+
- Status + priority for project portfolio views
|
|
77
|
+
- Date-based indexes for timeline and deadline tracking
|
|
78
|
+
- Assignee indexes for personal task lists
|
|
79
|
+
- Billable indexes for invoicing workflows
|
|
80
|
+
|
|
81
|
+
## Usage Examples
|
|
82
|
+
|
|
83
|
+
### Get active projects by priority
|
|
84
|
+
```typescript
|
|
85
|
+
const projects = await app.find({
|
|
86
|
+
object: 'project_project',
|
|
87
|
+
filters: [
|
|
88
|
+
['status', 'in', ['planning', 'active']],
|
|
89
|
+
'and',
|
|
90
|
+
['priority', 'in', ['high', 'critical']]
|
|
91
|
+
],
|
|
92
|
+
sort: [['priority', 'desc'], ['start_date', 'asc']]
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### My open tasks
|
|
97
|
+
```typescript
|
|
98
|
+
const myTasks = await app.find({
|
|
99
|
+
object: 'project_task',
|
|
100
|
+
filters: [
|
|
101
|
+
['assigned_to', '=', userId],
|
|
102
|
+
'and',
|
|
103
|
+
['status', 'not in', ['completed']]
|
|
104
|
+
],
|
|
105
|
+
sort: [['due_date', 'asc']]
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Project time summary
|
|
110
|
+
```typescript
|
|
111
|
+
const timeEntries = await app.find({
|
|
112
|
+
object: 'project_timesheet_entry',
|
|
113
|
+
filters: [
|
|
114
|
+
['project', '=', projectId],
|
|
115
|
+
'and',
|
|
116
|
+
['status', '=', 'approved']
|
|
117
|
+
]
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Upcoming milestones
|
|
122
|
+
```typescript
|
|
123
|
+
const milestones = await app.find({
|
|
124
|
+
object: 'project_milestone',
|
|
125
|
+
filters: [
|
|
126
|
+
['status', 'in', ['pending', 'in_progress']],
|
|
127
|
+
'and',
|
|
128
|
+
['due_date', '<=', nextMonth]
|
|
129
|
+
],
|
|
130
|
+
sort: [['due_date', 'asc']]
|
|
131
|
+
});
|
|
132
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Module - Project Management
|
|
3
|
+
*
|
|
4
|
+
* Exports all Project objects, actions, and hooks
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const PROJECT_OBJECTS = [
|
|
8
|
+
'project_project',
|
|
9
|
+
'project_task',
|
|
10
|
+
'project_milestone',
|
|
11
|
+
'project_timesheet_entry',
|
|
12
|
+
] as const;
|
|
13
|
+
|
|
14
|
+
export type ProjectObject = typeof PROJECT_OBJECTS[number];
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Module metadata
|
|
18
|
+
*/
|
|
19
|
+
export const PROJECT_MODULE = {
|
|
20
|
+
name: 'project',
|
|
21
|
+
label: 'Project Management',
|
|
22
|
+
description: 'Manage projects, tasks, milestones, and time tracking',
|
|
23
|
+
version: '1.0.0',
|
|
24
|
+
objects: PROJECT_OBJECTS,
|
|
25
|
+
icon: 'folder-line',
|
|
26
|
+
} as const;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
label: Milestone
|
|
2
|
+
description: Project milestone or checkpoint
|
|
3
|
+
icon: flag-line
|
|
4
|
+
|
|
5
|
+
fields:
|
|
6
|
+
name:
|
|
7
|
+
type: text
|
|
8
|
+
required: true
|
|
9
|
+
label: Milestone Name
|
|
10
|
+
index: true
|
|
11
|
+
|
|
12
|
+
project:
|
|
13
|
+
type: lookup
|
|
14
|
+
reference_to: project_project
|
|
15
|
+
label: Project
|
|
16
|
+
required: true
|
|
17
|
+
index: true
|
|
18
|
+
|
|
19
|
+
description:
|
|
20
|
+
type: textarea
|
|
21
|
+
label: Description
|
|
22
|
+
|
|
23
|
+
due_date:
|
|
24
|
+
type: date
|
|
25
|
+
required: true
|
|
26
|
+
label: Target Date
|
|
27
|
+
index: true
|
|
28
|
+
|
|
29
|
+
completed_date:
|
|
30
|
+
type: date
|
|
31
|
+
label: Completion Date
|
|
32
|
+
|
|
33
|
+
status:
|
|
34
|
+
type: select
|
|
35
|
+
options:
|
|
36
|
+
- pending
|
|
37
|
+
- in_progress
|
|
38
|
+
- completed
|
|
39
|
+
- missed
|
|
40
|
+
defaultValue: pending
|
|
41
|
+
required: true
|
|
42
|
+
index: true
|
|
43
|
+
|
|
44
|
+
owner:
|
|
45
|
+
type: lookup
|
|
46
|
+
reference_to: user
|
|
47
|
+
label: Milestone Owner
|
|
48
|
+
|
|
49
|
+
deliverables:
|
|
50
|
+
type: textarea
|
|
51
|
+
label: Deliverables
|
|
52
|
+
|
|
53
|
+
success_criteria:
|
|
54
|
+
type: textarea
|
|
55
|
+
label: Success Criteria
|
|
56
|
+
|
|
57
|
+
indexes:
|
|
58
|
+
# For project milestones
|
|
59
|
+
project_due_date_idx:
|
|
60
|
+
fields: [project, due_date]
|
|
61
|
+
|
|
62
|
+
# For status tracking
|
|
63
|
+
status_due_date_idx:
|
|
64
|
+
fields: [status, due_date]
|
|
65
|
+
|
|
66
|
+
actions:
|
|
67
|
+
mark_completed:
|
|
68
|
+
type: record
|
|
69
|
+
label: Mark as Completed
|
|
70
|
+
icon: checkbox-circle-line
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
label: Project
|
|
2
|
+
description: Project or initiative
|
|
3
|
+
icon: folder-line
|
|
4
|
+
|
|
5
|
+
fields:
|
|
6
|
+
name:
|
|
7
|
+
type: text
|
|
8
|
+
required: true
|
|
9
|
+
label: Project Name
|
|
10
|
+
index: true
|
|
11
|
+
|
|
12
|
+
code:
|
|
13
|
+
type: text
|
|
14
|
+
required: true
|
|
15
|
+
label: Project Code
|
|
16
|
+
unique: true
|
|
17
|
+
index: true
|
|
18
|
+
|
|
19
|
+
description:
|
|
20
|
+
type: textarea
|
|
21
|
+
label: Description
|
|
22
|
+
|
|
23
|
+
status:
|
|
24
|
+
type: select
|
|
25
|
+
options:
|
|
26
|
+
- planning
|
|
27
|
+
- active
|
|
28
|
+
- on_hold
|
|
29
|
+
- completed
|
|
30
|
+
- cancelled
|
|
31
|
+
defaultValue: planning
|
|
32
|
+
required: true
|
|
33
|
+
index: true
|
|
34
|
+
|
|
35
|
+
priority:
|
|
36
|
+
type: select
|
|
37
|
+
options:
|
|
38
|
+
- low
|
|
39
|
+
- medium
|
|
40
|
+
- high
|
|
41
|
+
- critical
|
|
42
|
+
defaultValue: medium
|
|
43
|
+
index: true
|
|
44
|
+
|
|
45
|
+
type:
|
|
46
|
+
type: select
|
|
47
|
+
options:
|
|
48
|
+
- internal
|
|
49
|
+
- customer
|
|
50
|
+
- research
|
|
51
|
+
- maintenance
|
|
52
|
+
index: true
|
|
53
|
+
|
|
54
|
+
account:
|
|
55
|
+
type: lookup
|
|
56
|
+
reference_to: crm_account
|
|
57
|
+
label: Customer Account
|
|
58
|
+
index: true
|
|
59
|
+
|
|
60
|
+
owner:
|
|
61
|
+
type: lookup
|
|
62
|
+
reference_to: user
|
|
63
|
+
label: Project Manager
|
|
64
|
+
required: true
|
|
65
|
+
index: true
|
|
66
|
+
|
|
67
|
+
department:
|
|
68
|
+
type: lookup
|
|
69
|
+
reference_to: hr_department
|
|
70
|
+
label: Department
|
|
71
|
+
index: true
|
|
72
|
+
|
|
73
|
+
start_date:
|
|
74
|
+
type: date
|
|
75
|
+
required: true
|
|
76
|
+
label: Start Date
|
|
77
|
+
index: true
|
|
78
|
+
|
|
79
|
+
end_date:
|
|
80
|
+
type: date
|
|
81
|
+
label: Target End Date
|
|
82
|
+
index: true
|
|
83
|
+
|
|
84
|
+
actual_end_date:
|
|
85
|
+
type: date
|
|
86
|
+
label: Actual End Date
|
|
87
|
+
|
|
88
|
+
budget:
|
|
89
|
+
type: currency
|
|
90
|
+
label: Project Budget
|
|
91
|
+
|
|
92
|
+
estimated_hours:
|
|
93
|
+
type: number
|
|
94
|
+
label: Estimated Hours
|
|
95
|
+
|
|
96
|
+
actual_hours:
|
|
97
|
+
type: number
|
|
98
|
+
label: Actual Hours
|
|
99
|
+
|
|
100
|
+
completion_percentage:
|
|
101
|
+
type: percent
|
|
102
|
+
label: Completion %
|
|
103
|
+
min: 0
|
|
104
|
+
max: 100
|
|
105
|
+
defaultValue: 0
|
|
106
|
+
|
|
107
|
+
indexes:
|
|
108
|
+
# For project portfolio view
|
|
109
|
+
status_priority_idx:
|
|
110
|
+
fields: [status, priority]
|
|
111
|
+
|
|
112
|
+
# For owner queries
|
|
113
|
+
owner_status_idx:
|
|
114
|
+
fields: [owner, status]
|
|
115
|
+
|
|
116
|
+
# For timeline reports
|
|
117
|
+
start_date_status_idx:
|
|
118
|
+
fields: [start_date, status]
|
|
119
|
+
|
|
120
|
+
# For customer projects
|
|
121
|
+
account_status_idx:
|
|
122
|
+
fields: [account, status]
|
|
123
|
+
|
|
124
|
+
ai:
|
|
125
|
+
search:
|
|
126
|
+
enabled: true
|
|
127
|
+
fields: [name, description, code]
|
|
128
|
+
model: text-embedding-3-small
|
|
129
|
+
|
|
130
|
+
actions:
|
|
131
|
+
complete:
|
|
132
|
+
type: record
|
|
133
|
+
label: Mark as Completed
|
|
134
|
+
icon: checkbox-circle-line
|
|
135
|
+
confirm_text: "Mark this project as completed?"
|