@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,103 @@
|
|
|
1
|
+
label: Contact
|
|
2
|
+
description: Individual contact person
|
|
3
|
+
icon: user-line
|
|
4
|
+
|
|
5
|
+
fields:
|
|
6
|
+
first_name:
|
|
7
|
+
type: text
|
|
8
|
+
required: true
|
|
9
|
+
label: First Name
|
|
10
|
+
index: true
|
|
11
|
+
|
|
12
|
+
last_name:
|
|
13
|
+
type: text
|
|
14
|
+
required: true
|
|
15
|
+
label: Last Name
|
|
16
|
+
index: true
|
|
17
|
+
|
|
18
|
+
full_name:
|
|
19
|
+
type: formula
|
|
20
|
+
formula: "CONCAT(first_name, ' ', last_name)"
|
|
21
|
+
label: Full Name
|
|
22
|
+
|
|
23
|
+
email:
|
|
24
|
+
type: text
|
|
25
|
+
label: Email
|
|
26
|
+
unique: true
|
|
27
|
+
index: true
|
|
28
|
+
|
|
29
|
+
phone:
|
|
30
|
+
type: text
|
|
31
|
+
label: Phone
|
|
32
|
+
|
|
33
|
+
mobile:
|
|
34
|
+
type: text
|
|
35
|
+
label: Mobile
|
|
36
|
+
|
|
37
|
+
title:
|
|
38
|
+
type: text
|
|
39
|
+
label: Job Title
|
|
40
|
+
index: true
|
|
41
|
+
|
|
42
|
+
department:
|
|
43
|
+
type: text
|
|
44
|
+
label: Department
|
|
45
|
+
|
|
46
|
+
account:
|
|
47
|
+
type: lookup
|
|
48
|
+
reference_to: crm_account
|
|
49
|
+
label: Account
|
|
50
|
+
required: true
|
|
51
|
+
index: true
|
|
52
|
+
|
|
53
|
+
owner:
|
|
54
|
+
type: lookup
|
|
55
|
+
reference_to: user
|
|
56
|
+
label: Contact Owner
|
|
57
|
+
index: true
|
|
58
|
+
|
|
59
|
+
lead_source:
|
|
60
|
+
type: select
|
|
61
|
+
options:
|
|
62
|
+
- web
|
|
63
|
+
- referral
|
|
64
|
+
- trade_show
|
|
65
|
+
- partner
|
|
66
|
+
- other
|
|
67
|
+
label: Lead Source
|
|
68
|
+
index: true
|
|
69
|
+
|
|
70
|
+
linkedin_url:
|
|
71
|
+
type: url
|
|
72
|
+
label: LinkedIn Profile
|
|
73
|
+
|
|
74
|
+
description:
|
|
75
|
+
type: textarea
|
|
76
|
+
label: Notes
|
|
77
|
+
|
|
78
|
+
status:
|
|
79
|
+
type: select
|
|
80
|
+
options:
|
|
81
|
+
- active
|
|
82
|
+
- inactive
|
|
83
|
+
defaultValue: active
|
|
84
|
+
index: true
|
|
85
|
+
|
|
86
|
+
indexes:
|
|
87
|
+
# For account contact lookup
|
|
88
|
+
account_status_idx:
|
|
89
|
+
fields: [account, status]
|
|
90
|
+
|
|
91
|
+
# For owner queries
|
|
92
|
+
owner_account_idx:
|
|
93
|
+
fields: [owner, account]
|
|
94
|
+
|
|
95
|
+
# For name search
|
|
96
|
+
name_idx:
|
|
97
|
+
fields: [last_name, first_name]
|
|
98
|
+
|
|
99
|
+
ai:
|
|
100
|
+
search:
|
|
101
|
+
enabled: true
|
|
102
|
+
fields: [first_name, last_name, email, title]
|
|
103
|
+
model: text-embedding-3-small
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
label: Lead
|
|
2
|
+
description: Potential sales lead
|
|
3
|
+
icon: user-add-line
|
|
4
|
+
|
|
5
|
+
fields:
|
|
6
|
+
first_name:
|
|
7
|
+
type: text
|
|
8
|
+
required: true
|
|
9
|
+
label: First Name
|
|
10
|
+
index: true
|
|
11
|
+
|
|
12
|
+
last_name:
|
|
13
|
+
type: text
|
|
14
|
+
required: true
|
|
15
|
+
label: Last Name
|
|
16
|
+
index: true
|
|
17
|
+
|
|
18
|
+
company:
|
|
19
|
+
type: text
|
|
20
|
+
label: Company
|
|
21
|
+
index: true
|
|
22
|
+
|
|
23
|
+
title:
|
|
24
|
+
type: text
|
|
25
|
+
label: Job Title
|
|
26
|
+
|
|
27
|
+
email:
|
|
28
|
+
type: text
|
|
29
|
+
label: Email
|
|
30
|
+
unique: true
|
|
31
|
+
index: true
|
|
32
|
+
|
|
33
|
+
phone:
|
|
34
|
+
type: text
|
|
35
|
+
label: Phone
|
|
36
|
+
|
|
37
|
+
status:
|
|
38
|
+
type: select
|
|
39
|
+
options:
|
|
40
|
+
- new
|
|
41
|
+
- contacted
|
|
42
|
+
- qualified
|
|
43
|
+
- unqualified
|
|
44
|
+
- converted
|
|
45
|
+
defaultValue: new
|
|
46
|
+
required: true
|
|
47
|
+
index: true
|
|
48
|
+
|
|
49
|
+
lead_source:
|
|
50
|
+
type: select
|
|
51
|
+
options:
|
|
52
|
+
- web
|
|
53
|
+
- referral
|
|
54
|
+
- trade_show
|
|
55
|
+
- partner
|
|
56
|
+
- advertisement
|
|
57
|
+
- other
|
|
58
|
+
label: Lead Source
|
|
59
|
+
index: true
|
|
60
|
+
|
|
61
|
+
rating:
|
|
62
|
+
type: select
|
|
63
|
+
options:
|
|
64
|
+
- hot
|
|
65
|
+
- warm
|
|
66
|
+
- cold
|
|
67
|
+
label: Lead Rating
|
|
68
|
+
index: true
|
|
69
|
+
|
|
70
|
+
owner:
|
|
71
|
+
type: lookup
|
|
72
|
+
reference_to: user
|
|
73
|
+
label: Lead Owner
|
|
74
|
+
index: true
|
|
75
|
+
|
|
76
|
+
industry:
|
|
77
|
+
type: select
|
|
78
|
+
options:
|
|
79
|
+
- technology
|
|
80
|
+
- finance
|
|
81
|
+
- healthcare
|
|
82
|
+
- manufacturing
|
|
83
|
+
- retail
|
|
84
|
+
- education
|
|
85
|
+
- other
|
|
86
|
+
label: Industry
|
|
87
|
+
|
|
88
|
+
annual_revenue:
|
|
89
|
+
type: currency
|
|
90
|
+
label: Annual Revenue
|
|
91
|
+
|
|
92
|
+
employees:
|
|
93
|
+
type: number
|
|
94
|
+
label: Number of Employees
|
|
95
|
+
|
|
96
|
+
description:
|
|
97
|
+
type: textarea
|
|
98
|
+
label: Description
|
|
99
|
+
|
|
100
|
+
converted_date:
|
|
101
|
+
type: datetime
|
|
102
|
+
label: Conversion Date
|
|
103
|
+
|
|
104
|
+
converted_account:
|
|
105
|
+
type: lookup
|
|
106
|
+
reference_to: crm_account
|
|
107
|
+
label: Converted Account
|
|
108
|
+
|
|
109
|
+
converted_contact:
|
|
110
|
+
type: lookup
|
|
111
|
+
reference_to: crm_contact
|
|
112
|
+
label: Converted Contact
|
|
113
|
+
|
|
114
|
+
converted_opportunity:
|
|
115
|
+
type: lookup
|
|
116
|
+
reference_to: crm_opportunity
|
|
117
|
+
label: Converted Opportunity
|
|
118
|
+
|
|
119
|
+
indexes:
|
|
120
|
+
# For lead pipeline
|
|
121
|
+
status_rating_idx:
|
|
122
|
+
fields: [status, rating]
|
|
123
|
+
|
|
124
|
+
# For owner queries
|
|
125
|
+
owner_status_idx:
|
|
126
|
+
fields: [owner, status]
|
|
127
|
+
|
|
128
|
+
# For source analysis
|
|
129
|
+
source_status_idx:
|
|
130
|
+
fields: [lead_source, status]
|
|
131
|
+
|
|
132
|
+
actions:
|
|
133
|
+
convert:
|
|
134
|
+
type: record
|
|
135
|
+
label: Convert Lead
|
|
136
|
+
icon: arrow-right-circle-line
|
|
137
|
+
confirm_text: "Convert this lead to Account, Contact, and Opportunity?"
|
|
138
|
+
params:
|
|
139
|
+
create_opportunity:
|
|
140
|
+
type: boolean
|
|
141
|
+
label: Create Opportunity
|
|
142
|
+
defaultValue: true
|
|
143
|
+
opportunity_name:
|
|
144
|
+
type: text
|
|
145
|
+
label: Opportunity Name
|
|
146
|
+
opportunity_amount:
|
|
147
|
+
type: currency
|
|
148
|
+
label: Expected Amount
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
label: Opportunity
|
|
2
|
+
description: Sales opportunity or deal
|
|
3
|
+
icon: currency-line
|
|
4
|
+
|
|
5
|
+
fields:
|
|
6
|
+
name:
|
|
7
|
+
type: text
|
|
8
|
+
required: true
|
|
9
|
+
label: Opportunity Name
|
|
10
|
+
index: true
|
|
11
|
+
|
|
12
|
+
account:
|
|
13
|
+
type: lookup
|
|
14
|
+
reference_to: crm_account
|
|
15
|
+
label: Account
|
|
16
|
+
required: true
|
|
17
|
+
index: true
|
|
18
|
+
|
|
19
|
+
amount:
|
|
20
|
+
type: currency
|
|
21
|
+
label: Amount
|
|
22
|
+
required: true
|
|
23
|
+
|
|
24
|
+
close_date:
|
|
25
|
+
type: date
|
|
26
|
+
label: Expected Close Date
|
|
27
|
+
required: true
|
|
28
|
+
index: true
|
|
29
|
+
|
|
30
|
+
stage:
|
|
31
|
+
type: select
|
|
32
|
+
options:
|
|
33
|
+
- prospecting
|
|
34
|
+
- qualification
|
|
35
|
+
- proposal
|
|
36
|
+
- negotiation
|
|
37
|
+
- closed_won
|
|
38
|
+
- closed_lost
|
|
39
|
+
defaultValue: prospecting
|
|
40
|
+
required: true
|
|
41
|
+
index: true
|
|
42
|
+
|
|
43
|
+
probability:
|
|
44
|
+
type: percent
|
|
45
|
+
label: Probability (%)
|
|
46
|
+
min: 0
|
|
47
|
+
max: 100
|
|
48
|
+
|
|
49
|
+
type:
|
|
50
|
+
type: select
|
|
51
|
+
options:
|
|
52
|
+
- new_business
|
|
53
|
+
- existing_customer
|
|
54
|
+
- renewal
|
|
55
|
+
label: Opportunity Type
|
|
56
|
+
index: true
|
|
57
|
+
|
|
58
|
+
lead_source:
|
|
59
|
+
type: select
|
|
60
|
+
options:
|
|
61
|
+
- web
|
|
62
|
+
- referral
|
|
63
|
+
- trade_show
|
|
64
|
+
- partner
|
|
65
|
+
- cold_call
|
|
66
|
+
- other
|
|
67
|
+
label: Lead Source
|
|
68
|
+
index: true
|
|
69
|
+
|
|
70
|
+
owner:
|
|
71
|
+
type: lookup
|
|
72
|
+
reference_to: user
|
|
73
|
+
label: Opportunity Owner
|
|
74
|
+
required: true
|
|
75
|
+
index: true
|
|
76
|
+
|
|
77
|
+
next_step:
|
|
78
|
+
type: text
|
|
79
|
+
label: Next Step
|
|
80
|
+
|
|
81
|
+
description:
|
|
82
|
+
type: textarea
|
|
83
|
+
label: Description
|
|
84
|
+
|
|
85
|
+
competitors:
|
|
86
|
+
type: textarea
|
|
87
|
+
label: Known Competitors
|
|
88
|
+
|
|
89
|
+
indexes:
|
|
90
|
+
# For pipeline reports
|
|
91
|
+
stage_close_date_idx:
|
|
92
|
+
fields: [stage, close_date]
|
|
93
|
+
|
|
94
|
+
# For owner queries
|
|
95
|
+
owner_stage_idx:
|
|
96
|
+
fields: [owner, stage]
|
|
97
|
+
|
|
98
|
+
# For forecasting
|
|
99
|
+
close_date_amount_idx:
|
|
100
|
+
fields: [close_date, amount]
|
|
101
|
+
|
|
102
|
+
# For account opportunity history
|
|
103
|
+
account_stage_idx:
|
|
104
|
+
fields: [account, stage]
|
|
105
|
+
|
|
106
|
+
ai:
|
|
107
|
+
search:
|
|
108
|
+
enabled: true
|
|
109
|
+
fields: [name, description, next_step]
|
|
110
|
+
model: text-embedding-3-small
|
|
111
|
+
|
|
112
|
+
actions:
|
|
113
|
+
mark_won:
|
|
114
|
+
type: record
|
|
115
|
+
label: Mark as Won
|
|
116
|
+
icon: checkbox-circle-line
|
|
117
|
+
confirm_text: "Mark this opportunity as won?"
|
|
118
|
+
|
|
119
|
+
mark_lost:
|
|
120
|
+
type: record
|
|
121
|
+
label: Mark as Lost
|
|
122
|
+
icon: close-circle-line
|
|
123
|
+
confirm_text: "Mark this opportunity as lost?"
|
|
124
|
+
params:
|
|
125
|
+
reason:
|
|
126
|
+
type: textarea
|
|
127
|
+
label: Loss Reason
|
|
128
|
+
required: true
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"crm_account": {
|
|
3
|
+
"label": "Account",
|
|
4
|
+
"fields": {
|
|
5
|
+
"name": "Account Name",
|
|
6
|
+
"account_number": "Account Number",
|
|
7
|
+
"type": "Account Type",
|
|
8
|
+
"industry": "Industry",
|
|
9
|
+
"annual_revenue": "Annual Revenue",
|
|
10
|
+
"employees": "Number of Employees",
|
|
11
|
+
"website": "Website",
|
|
12
|
+
"phone": "Phone",
|
|
13
|
+
"billing_address": "Billing Address",
|
|
14
|
+
"shipping_address": "Shipping Address",
|
|
15
|
+
"owner": "Account Owner",
|
|
16
|
+
"parent_account": "Parent Account",
|
|
17
|
+
"description": "Description",
|
|
18
|
+
"status": "Status"
|
|
19
|
+
},
|
|
20
|
+
"options": {
|
|
21
|
+
"type": {
|
|
22
|
+
"customer": "Customer",
|
|
23
|
+
"prospect": "Prospect",
|
|
24
|
+
"partner": "Partner",
|
|
25
|
+
"competitor": "Competitor"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"crm_contact": {
|
|
30
|
+
"label": "Contact",
|
|
31
|
+
"fields": {
|
|
32
|
+
"first_name": "First Name",
|
|
33
|
+
"last_name": "Last Name",
|
|
34
|
+
"full_name": "Full Name",
|
|
35
|
+
"email": "Email",
|
|
36
|
+
"phone": "Phone",
|
|
37
|
+
"mobile": "Mobile",
|
|
38
|
+
"title": "Job Title",
|
|
39
|
+
"department": "Department",
|
|
40
|
+
"account": "Account",
|
|
41
|
+
"owner": "Contact Owner"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"crm_opportunity": {
|
|
45
|
+
"label": "Opportunity",
|
|
46
|
+
"fields": {
|
|
47
|
+
"name": "Opportunity Name",
|
|
48
|
+
"account": "Account",
|
|
49
|
+
"amount": "Amount",
|
|
50
|
+
"close_date": "Expected Close Date",
|
|
51
|
+
"stage": "Stage",
|
|
52
|
+
"probability": "Probability (%)",
|
|
53
|
+
"type": "Opportunity Type",
|
|
54
|
+
"owner": "Opportunity Owner"
|
|
55
|
+
},
|
|
56
|
+
"actions": {
|
|
57
|
+
"mark_won": "Mark as Won",
|
|
58
|
+
"mark_lost": "Mark as Lost"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"crm_account": {
|
|
3
|
+
"label": "客户",
|
|
4
|
+
"fields": {
|
|
5
|
+
"name": "客户名称",
|
|
6
|
+
"account_number": "客户编号",
|
|
7
|
+
"type": "客户类型",
|
|
8
|
+
"industry": "行业",
|
|
9
|
+
"annual_revenue": "年收入",
|
|
10
|
+
"employees": "员工人数",
|
|
11
|
+
"website": "网站",
|
|
12
|
+
"phone": "电话",
|
|
13
|
+
"billing_address": "账单地址",
|
|
14
|
+
"shipping_address": "送货地址",
|
|
15
|
+
"owner": "客户负责人",
|
|
16
|
+
"parent_account": "上级客户",
|
|
17
|
+
"description": "描述",
|
|
18
|
+
"status": "状态"
|
|
19
|
+
},
|
|
20
|
+
"options": {
|
|
21
|
+
"type": {
|
|
22
|
+
"customer": "客户",
|
|
23
|
+
"prospect": "潜在客户",
|
|
24
|
+
"partner": "合作伙伴",
|
|
25
|
+
"competitor": "竞争对手"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"crm_contact": {
|
|
30
|
+
"label": "联系人",
|
|
31
|
+
"fields": {
|
|
32
|
+
"first_name": "名字",
|
|
33
|
+
"last_name": "姓氏",
|
|
34
|
+
"full_name": "全名",
|
|
35
|
+
"email": "电子邮件",
|
|
36
|
+
"phone": "电话",
|
|
37
|
+
"mobile": "手机",
|
|
38
|
+
"title": "职位",
|
|
39
|
+
"department": "部门",
|
|
40
|
+
"account": "客户",
|
|
41
|
+
"owner": "联系人负责人"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"crm_opportunity": {
|
|
45
|
+
"label": "商机",
|
|
46
|
+
"fields": {
|
|
47
|
+
"name": "商机名称",
|
|
48
|
+
"account": "客户",
|
|
49
|
+
"amount": "金额",
|
|
50
|
+
"close_date": "预期成交日期",
|
|
51
|
+
"stage": "阶段",
|
|
52
|
+
"probability": "成功概率 (%)",
|
|
53
|
+
"type": "商机类型",
|
|
54
|
+
"owner": "商机负责人"
|
|
55
|
+
},
|
|
56
|
+
"actions": {
|
|
57
|
+
"mark_won": "标记为已赢",
|
|
58
|
+
"mark_lost": "标记为已失"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CRM Module - Customer Relationship Management
|
|
3
|
+
*
|
|
4
|
+
* Exports all CRM objects, actions, and hooks
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Re-export all CRM objects
|
|
8
|
+
// In a real implementation, these would be loaded from .object.yml files
|
|
9
|
+
|
|
10
|
+
export const CRM_OBJECTS = [
|
|
11
|
+
'crm_account',
|
|
12
|
+
'crm_contact',
|
|
13
|
+
'crm_opportunity',
|
|
14
|
+
'crm_lead',
|
|
15
|
+
] as const;
|
|
16
|
+
|
|
17
|
+
export type CRMObject = typeof CRM_OBJECTS[number];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Module metadata
|
|
21
|
+
*/
|
|
22
|
+
export const CRM_MODULE = {
|
|
23
|
+
name: 'crm',
|
|
24
|
+
label: 'Customer Relationship Management',
|
|
25
|
+
description: 'Manage customers, contacts, and sales opportunities',
|
|
26
|
+
version: '1.0.0',
|
|
27
|
+
objects: CRM_OBJECTS,
|
|
28
|
+
icon: 'briefcase-line',
|
|
29
|
+
} as const;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Finance Module
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
The Finance & Accounting module handles invoicing, payments, expenses, and budget management.
|
|
5
|
+
|
|
6
|
+
## Objects
|
|
7
|
+
|
|
8
|
+
### finance_invoice
|
|
9
|
+
Customer invoices and billing.
|
|
10
|
+
|
|
11
|
+
**Key Features:**
|
|
12
|
+
- Multiple payment statuses (draft, sent, paid, overdue)
|
|
13
|
+
- Multi-currency support
|
|
14
|
+
- Payment terms configuration
|
|
15
|
+
- Automatic balance calculation
|
|
16
|
+
|
|
17
|
+
### finance_payment
|
|
18
|
+
Payment transaction records linked to invoices.
|
|
19
|
+
|
|
20
|
+
**Key Features:**
|
|
21
|
+
- Multiple payment methods
|
|
22
|
+
- Transaction reference tracking
|
|
23
|
+
- Status workflow (pending, completed, failed, refunded)
|
|
24
|
+
|
|
25
|
+
### finance_expense
|
|
26
|
+
Employee expense reports and reimbursements.
|
|
27
|
+
|
|
28
|
+
**Key Features:**
|
|
29
|
+
- Category-based classification
|
|
30
|
+
- Receipt attachment support
|
|
31
|
+
- Approval workflow
|
|
32
|
+
- Department and project allocation
|
|
33
|
+
|
|
34
|
+
### finance_budget
|
|
35
|
+
Department and project budgets.
|
|
36
|
+
|
|
37
|
+
**Key Features:**
|
|
38
|
+
- Fiscal year planning
|
|
39
|
+
- Period-based budgets (annual/quarterly/monthly)
|
|
40
|
+
- Spent vs. allocated tracking
|
|
41
|
+
- Category breakdowns
|
|
42
|
+
|
|
43
|
+
## Relationships
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Invoice <--has many-- Payment
|
|
47
|
+
Account <--has many-- Invoice
|
|
48
|
+
Account <--has many-- Payment
|
|
49
|
+
Employee --submits--> Expense
|
|
50
|
+
Department <--has-- Budget
|
|
51
|
+
Project <--has-- Budget
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Team Ownership
|
|
55
|
+
**Owner:** Finance Team
|
|
56
|
+
**Primary Contact:** finance-team@example.com
|
|
57
|
+
|
|
58
|
+
## Dependencies
|
|
59
|
+
- **Core Objects:** `user` (for approvals)
|
|
60
|
+
- **Cross-Module:** `crm_account` (invoices), `hr_employee` (expenses), `hr_department` (budgets), `project_project` (budgets)
|
|
61
|
+
|
|
62
|
+
## Custom Actions
|
|
63
|
+
- `Invoice.send` - Send invoice to customer
|
|
64
|
+
- `Invoice.mark_paid` - Mark invoice as paid
|
|
65
|
+
- `Expense.submit` - Submit for approval
|
|
66
|
+
- `Expense.approve` - Approve expense
|
|
67
|
+
- `Expense.reject` - Reject expense
|
|
68
|
+
- `Expense.reimburse` - Mark as reimbursed
|
|
69
|
+
|
|
70
|
+
## Indexes Strategy
|
|
71
|
+
- Account-based indexes for customer financial history
|
|
72
|
+
- Date-based indexes for aging reports and period analysis
|
|
73
|
+
- Status indexes for workflow management
|
|
74
|
+
- Category indexes for expense analysis
|
|
75
|
+
|
|
76
|
+
## Usage Examples
|
|
77
|
+
|
|
78
|
+
### Find overdue invoices
|
|
79
|
+
```typescript
|
|
80
|
+
const overdueInvoices = await app.find({
|
|
81
|
+
object: 'finance_invoice',
|
|
82
|
+
filters: [
|
|
83
|
+
['due_date', '<', new Date()],
|
|
84
|
+
'and',
|
|
85
|
+
['status', 'not in', ['paid', 'cancelled']]
|
|
86
|
+
],
|
|
87
|
+
sort: [['due_date', 'asc']]
|
|
88
|
+
});
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Get pending expense approvals
|
|
92
|
+
```typescript
|
|
93
|
+
const pendingExpenses = await app.find({
|
|
94
|
+
object: 'finance_expense',
|
|
95
|
+
filters: [
|
|
96
|
+
['status', '=', 'submitted']
|
|
97
|
+
],
|
|
98
|
+
sort: [['expense_date', 'desc']]
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Budget utilization report
|
|
103
|
+
```typescript
|
|
104
|
+
const budgets = await app.find({
|
|
105
|
+
object: 'finance_budget',
|
|
106
|
+
filters: [
|
|
107
|
+
['fiscal_year', '=', currentYear],
|
|
108
|
+
'and',
|
|
109
|
+
['status', '=', 'active']
|
|
110
|
+
]
|
|
111
|
+
});
|
|
112
|
+
```
|