@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.
Files changed (110) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +28 -0
  3. package/dist/bin.js +125 -0
  4. package/package.json +27 -0
  5. package/templates/enterprise/CHANGELOG.md +140 -0
  6. package/templates/enterprise/README.md +352 -0
  7. package/templates/enterprise/__tests__/data-api.test.ts +546 -0
  8. package/templates/enterprise/__tests__/data-api.test.ts.backup +526 -0
  9. package/templates/enterprise/__tests__/metadata-api.test.ts +307 -0
  10. package/templates/enterprise/__tests__/metadata-loading.test.ts +250 -0
  11. package/templates/enterprise/jest.config.js +22 -0
  12. package/templates/enterprise/package.json +51 -0
  13. package/templates/enterprise/src/apps/erp.app.yml +4 -0
  14. package/templates/enterprise/src/core/attachment.object.yml +57 -0
  15. package/templates/enterprise/src/core/i18n/en/core.json +60 -0
  16. package/templates/enterprise/src/core/i18n/zh-CN/core.json +60 -0
  17. package/templates/enterprise/src/core/index.ts +24 -0
  18. package/templates/enterprise/src/core/organization.object.yml +78 -0
  19. package/templates/enterprise/src/core/user.object.yml +80 -0
  20. package/templates/enterprise/src/extensions/README.md +56 -0
  21. package/templates/enterprise/src/extensions/user.extension.object.yml +42 -0
  22. package/templates/enterprise/src/extensions/user.ts +26 -0
  23. package/templates/enterprise/src/index.ts +47 -0
  24. package/templates/enterprise/src/modules/crm/README.md +99 -0
  25. package/templates/enterprise/src/modules/crm/crm_account.object.yml +105 -0
  26. package/templates/enterprise/src/modules/crm/crm_contact.object.yml +103 -0
  27. package/templates/enterprise/src/modules/crm/crm_lead.object.yml +148 -0
  28. package/templates/enterprise/src/modules/crm/crm_opportunity.object.yml +128 -0
  29. package/templates/enterprise/src/modules/crm/i18n/en/crm.json +61 -0
  30. package/templates/enterprise/src/modules/crm/i18n/zh-CN/crm.json +61 -0
  31. package/templates/enterprise/src/modules/crm/index.ts +29 -0
  32. package/templates/enterprise/src/modules/finance/README.md +112 -0
  33. package/templates/enterprise/src/modules/finance/finance_budget.object.yml +108 -0
  34. package/templates/enterprise/src/modules/finance/finance_expense.object.yml +151 -0
  35. package/templates/enterprise/src/modules/finance/finance_invoice.object.yml +143 -0
  36. package/templates/enterprise/src/modules/finance/finance_payment.object.yml +96 -0
  37. package/templates/enterprise/src/modules/finance/index.ts +26 -0
  38. package/templates/enterprise/src/modules/hr/README.md +95 -0
  39. package/templates/enterprise/src/modules/hr/hr_department.object.yml +59 -0
  40. package/templates/enterprise/src/modules/hr/hr_employee.object.yml +137 -0
  41. package/templates/enterprise/src/modules/hr/hr_position.object.yml +79 -0
  42. package/templates/enterprise/src/modules/hr/hr_timesheet.object.yml +114 -0
  43. package/templates/enterprise/src/modules/hr/index.ts +26 -0
  44. package/templates/enterprise/src/modules/project/README.md +132 -0
  45. package/templates/enterprise/src/modules/project/index.ts +26 -0
  46. package/templates/enterprise/src/modules/project/project_milestone.object.yml +70 -0
  47. package/templates/enterprise/src/modules/project/project_project.object.yml +135 -0
  48. package/templates/enterprise/src/modules/project/project_task.object.yml +121 -0
  49. package/templates/enterprise/src/modules/project/project_timesheet_entry.object.yml +95 -0
  50. package/templates/enterprise/src/plugins/audit/audit.plugin.ts +23 -0
  51. package/templates/enterprise/src/plugins/audit/index.ts +6 -0
  52. package/templates/enterprise/src/plugins/audit/note.object.yml +3 -0
  53. package/templates/enterprise/src/shared/constants.ts +30 -0
  54. package/templates/enterprise/src/shared/utils.ts +54 -0
  55. package/templates/enterprise/src/shared/validators.ts +47 -0
  56. package/templates/enterprise/src/types/attachment.ts +41 -0
  57. package/templates/enterprise/src/types/crm_account.ts +61 -0
  58. package/templates/enterprise/src/types/crm_contact.ts +61 -0
  59. package/templates/enterprise/src/types/crm_lead.ts +77 -0
  60. package/templates/enterprise/src/types/crm_opportunity.ts +53 -0
  61. package/templates/enterprise/src/types/finance_budget.ts +61 -0
  62. package/templates/enterprise/src/types/finance_expense.ts +65 -0
  63. package/templates/enterprise/src/types/finance_invoice.ts +69 -0
  64. package/templates/enterprise/src/types/finance_payment.ts +49 -0
  65. package/templates/enterprise/src/types/hr_department.ts +37 -0
  66. package/templates/enterprise/src/types/hr_employee.ts +85 -0
  67. package/templates/enterprise/src/types/hr_position.ts +49 -0
  68. package/templates/enterprise/src/types/hr_timesheet.ts +57 -0
  69. package/templates/enterprise/src/types/index.ts +20 -0
  70. package/templates/enterprise/src/types/note.ts +9 -0
  71. package/templates/enterprise/src/types/organization.ts +53 -0
  72. package/templates/enterprise/src/types/project_milestone.ts +41 -0
  73. package/templates/enterprise/src/types/project_project.ts +69 -0
  74. package/templates/enterprise/src/types/project_task.ts +57 -0
  75. package/templates/enterprise/src/types/project_timesheet_entry.ts +45 -0
  76. package/templates/enterprise/src/types/user.ts +65 -0
  77. package/templates/enterprise/tsconfig.json +10 -0
  78. package/templates/enterprise/tsconfig.tsbuildinfo +1 -0
  79. package/templates/hello-world/CHANGELOG.md +33 -0
  80. package/templates/hello-world/README.md +29 -0
  81. package/templates/hello-world/package.json +24 -0
  82. package/templates/hello-world/src/index.ts +58 -0
  83. package/templates/hello-world/tsconfig.json +10 -0
  84. package/templates/starter/CHANGELOG.md +191 -0
  85. package/templates/starter/README.md +17 -0
  86. package/templates/starter/__tests__/projects-hooks-actions.test.ts +490 -0
  87. package/templates/starter/jest.config.js +22 -0
  88. package/templates/starter/package.json +51 -0
  89. package/templates/starter/src/README.pages.md +110 -0
  90. package/templates/starter/src/demo.app.yml +4 -0
  91. package/templates/starter/src/i18n/zh-CN/projects.json +22 -0
  92. package/templates/starter/src/index.ts +55 -0
  93. package/templates/starter/src/modules/kitchen-sink/kitchen_sink.data.yml +18 -0
  94. package/templates/starter/src/modules/kitchen-sink/kitchen_sink.object.yml +156 -0
  95. package/templates/starter/src/modules/projects/project_approval.workflow.yml +51 -0
  96. package/templates/starter/src/modules/projects/projects.action.ts +472 -0
  97. package/templates/starter/src/modules/projects/projects.data.yml +13 -0
  98. package/templates/starter/src/modules/projects/projects.hook.ts +339 -0
  99. package/templates/starter/src/modules/projects/projects.object.yml +148 -0
  100. package/templates/starter/src/modules/projects/projects.permission.yml +141 -0
  101. package/templates/starter/src/modules/projects/projects.validation.yml +37 -0
  102. package/templates/starter/src/modules/tasks/tasks.data.yml +23 -0
  103. package/templates/starter/src/modules/tasks/tasks.object.yml +34 -0
  104. package/templates/starter/src/modules/tasks/tasks.permission.yml +167 -0
  105. package/templates/starter/src/types/index.ts +3 -0
  106. package/templates/starter/src/types/kitchen_sink.ts +101 -0
  107. package/templates/starter/src/types/projects.ts +49 -0
  108. package/templates/starter/src/types/tasks.ts +33 -0
  109. package/templates/starter/tsconfig.json +11 -0
  110. package/templates/starter/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,121 @@
1
+ label: Task
2
+ description: Project task or work item
3
+ icon: task-line
4
+
5
+ fields:
6
+ name:
7
+ type: text
8
+ required: true
9
+ label: Task 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
+ parent_task:
20
+ type: lookup
21
+ reference_to: project_task
22
+ label: Parent Task
23
+ index: true
24
+
25
+ description:
26
+ type: textarea
27
+ label: Description
28
+
29
+ status:
30
+ type: select
31
+ options:
32
+ - todo
33
+ - in_progress
34
+ - in_review
35
+ - blocked
36
+ - completed
37
+ defaultValue: todo
38
+ required: true
39
+ index: true
40
+
41
+ priority:
42
+ type: select
43
+ options:
44
+ - low
45
+ - medium
46
+ - high
47
+ - critical
48
+ defaultValue: medium
49
+ index: true
50
+
51
+ assigned_to:
52
+ type: lookup
53
+ reference_to: user
54
+ label: Assigned To
55
+ index: true
56
+
57
+ due_date:
58
+ type: date
59
+ label: Due Date
60
+ index: true
61
+
62
+ completed_date:
63
+ type: datetime
64
+ label: Completion Date
65
+
66
+ estimated_hours:
67
+ type: number
68
+ label: Estimated Hours
69
+ scale: 2
70
+
71
+ actual_hours:
72
+ type: number
73
+ label: Actual Hours
74
+ scale: 2
75
+
76
+ milestone:
77
+ type: lookup
78
+ reference_to: project_milestone
79
+ label: Milestone
80
+ index: true
81
+
82
+ tags:
83
+ type: text
84
+ label: Tags
85
+
86
+ indexes:
87
+ # For project task list
88
+ project_status_idx:
89
+ fields: [project, status]
90
+
91
+ # For user task list
92
+ assigned_to_status_idx:
93
+ fields: [assigned_to, status]
94
+
95
+ # For due date tracking
96
+ due_date_status_idx:
97
+ fields: [due_date, status]
98
+
99
+ # For task hierarchy
100
+ parent_task_idx:
101
+ fields: [parent_task, status]
102
+
103
+ # For milestone tasks
104
+ milestone_status_idx:
105
+ fields: [milestone, status]
106
+
107
+ actions:
108
+ start:
109
+ type: record
110
+ label: Start Task
111
+ icon: play-circle-line
112
+
113
+ complete:
114
+ type: record
115
+ label: Complete Task
116
+ icon: checkbox-circle-line
117
+ params:
118
+ actual_hours:
119
+ type: number
120
+ label: Actual Hours Spent
121
+ scale: 2
@@ -0,0 +1,95 @@
1
+ label: Timesheet Entry
2
+ description: Time entry for project tasks
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
+ project:
14
+ type: lookup
15
+ reference_to: project_project
16
+ label: Project
17
+ required: true
18
+ index: true
19
+
20
+ task:
21
+ type: lookup
22
+ reference_to: project_task
23
+ label: Task
24
+ index: true
25
+
26
+ work_date:
27
+ type: date
28
+ required: true
29
+ label: Work Date
30
+ index: true
31
+
32
+ hours:
33
+ type: number
34
+ required: true
35
+ label: Hours Worked
36
+ scale: 2
37
+ min: 0
38
+ max: 24
39
+
40
+ description:
41
+ type: textarea
42
+ label: Work Description
43
+
44
+ billable:
45
+ type: boolean
46
+ defaultValue: true
47
+ label: Billable
48
+ index: true
49
+
50
+ status:
51
+ type: select
52
+ options:
53
+ - draft
54
+ - submitted
55
+ - approved
56
+ - rejected
57
+ defaultValue: draft
58
+ index: true
59
+
60
+ approved_by:
61
+ type: lookup
62
+ reference_to: user
63
+ label: Approved By
64
+
65
+ approved_at:
66
+ type: datetime
67
+ label: Approval Time
68
+
69
+ indexes:
70
+ # For employee timesheet
71
+ employee_date_idx:
72
+ fields: [employee, work_date]
73
+
74
+ # For project time tracking
75
+ project_date_idx:
76
+ fields: [project, work_date]
77
+
78
+ # For task time tracking
79
+ task_employee_idx:
80
+ fields: [task, employee]
81
+
82
+ # For billing
83
+ billable_status_idx:
84
+ fields: [billable, status]
85
+
86
+ actions:
87
+ submit:
88
+ type: record
89
+ label: Submit for Approval
90
+ icon: send-plane-line
91
+
92
+ approve:
93
+ type: record
94
+ label: Approve Entry
95
+ icon: checkbox-circle-line
@@ -0,0 +1,23 @@
1
+ import { ObjectQLPlugin, IObjectQL, MutationHookContext } from '@objectql/types';
2
+
3
+ export class AuditLogPlugin implements ObjectQLPlugin {
4
+ name = 'audit-log';
5
+
6
+ setup(app: IObjectQL) {
7
+ console.log('[AuditLogPlugin] Setting up...');
8
+
9
+ // 1. Listen to all 'afterCreate' events
10
+ app.on('afterCreate', '*', async (ctx) => {
11
+ // Narrow down context type or use assertion since 'afterCreate' is Mutation
12
+ const mutationCtx = ctx as MutationHookContext;
13
+ const userId = mutationCtx.user?.id || 'Guest';
14
+ console.log(`[Audit] Created ${mutationCtx.objectName} (ID: ${mutationCtx.id}) by User ${userId}`);
15
+ });
16
+
17
+ // 2. Listen to all 'afterDelete' events
18
+ app.on('afterDelete', '*', async (ctx) => {
19
+ const mutationCtx = ctx as MutationHookContext;
20
+ console.log(`[Audit] Deleted ${mutationCtx.objectName} (ID: ${mutationCtx.id})`);
21
+ });
22
+ }
23
+ }
@@ -0,0 +1,6 @@
1
+ // Export the plugin for external usage
2
+ export * from './audit.plugin';
3
+
4
+ // Make it the default export as well for easier consumption
5
+ import { AuditLogPlugin } from './audit.plugin';
6
+ export default AuditLogPlugin;
@@ -0,0 +1,3 @@
1
+ fields:
2
+ content:
3
+ type: text
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Shared constants used across the application
3
+ */
4
+
5
+ export const OBJECT_PREFIXES = {
6
+ CRM: 'crm_',
7
+ HR: 'hr_',
8
+ FINANCE: 'finance_',
9
+ PROJECT: 'project_',
10
+ } as const;
11
+
12
+ export const STATUS = {
13
+ ACTIVE: 'active',
14
+ INACTIVE: 'inactive',
15
+ DRAFT: 'draft',
16
+ PENDING: 'pending',
17
+ APPROVED: 'approved',
18
+ REJECTED: 'rejected',
19
+ } as const;
20
+
21
+ export const CURRENCIES = {
22
+ USD: 'USD',
23
+ EUR: 'EUR',
24
+ GBP: 'GBP',
25
+ CNY: 'CNY',
26
+ JPY: 'JPY',
27
+ } as const;
28
+
29
+ export const DEFAULT_PAGE_SIZE = 30;
30
+ export const MAX_PAGE_SIZE = 100;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Shared utility functions
3
+ */
4
+
5
+ /**
6
+ * Generate a unique ID (simple implementation)
7
+ */
8
+ export function generateId(): string {
9
+ return `${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
10
+ }
11
+
12
+ /**
13
+ * Format currency amount
14
+ */
15
+ export function formatCurrency(amount: number, currency: string = 'USD'): string {
16
+ return new Intl.NumberFormat('en-US', {
17
+ style: 'currency',
18
+ currency,
19
+ }).format(amount);
20
+ }
21
+
22
+ /**
23
+ * Format date
24
+ */
25
+ export function formatDate(date: Date): string {
26
+ return new Intl.DateTimeFormat('en-US').format(date);
27
+ }
28
+
29
+ /**
30
+ * Calculate fiscal year from date
31
+ */
32
+ export function getFiscalYear(date: Date, fiscalYearStartMonth: number = 1): number {
33
+ const year = date.getFullYear();
34
+ const month = date.getMonth() + 1; // 0-indexed
35
+
36
+ if (month < fiscalYearStartMonth) {
37
+ return year - 1;
38
+ }
39
+ return year;
40
+ }
41
+
42
+ /**
43
+ * Deep clone an object
44
+ */
45
+ export function deepClone<T>(obj: T): T {
46
+ return JSON.parse(JSON.stringify(obj));
47
+ }
48
+
49
+ /**
50
+ * Safely get nested property
51
+ */
52
+ export function getNestedProperty(obj: any, path: string): any {
53
+ return path.split('.').reduce((current, key) => current?.[key], obj);
54
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Shared validation utilities
3
+ */
4
+
5
+ /**
6
+ * Validate email format
7
+ */
8
+ export function isValidEmail(email: string): boolean {
9
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
10
+ return emailRegex.test(email);
11
+ }
12
+
13
+ /**
14
+ * Validate phone number (basic check)
15
+ */
16
+ export function isValidPhone(phone: string): boolean {
17
+ const phoneRegex = /^[\d\s\-\+\(\)]+$/;
18
+ return phone.length >= 10 && phoneRegex.test(phone);
19
+ }
20
+
21
+ /**
22
+ * Validate currency amount (positive number with max 2 decimals)
23
+ */
24
+ export function isValidCurrency(amount: number): boolean {
25
+ return amount >= 0 && Number.isFinite(amount);
26
+ }
27
+
28
+ /**
29
+ * Validate percentage (0-100)
30
+ */
31
+ export function isValidPercentage(value: number): boolean {
32
+ return value >= 0 && value <= 100 && Number.isFinite(value);
33
+ }
34
+
35
+ /**
36
+ * Validate date is not in the future
37
+ */
38
+ export function isNotFutureDate(date: Date): boolean {
39
+ return date <= new Date();
40
+ }
41
+
42
+ /**
43
+ * Validate date range (start before end)
44
+ */
45
+ export function isValidDateRange(startDate: Date, endDate: Date): boolean {
46
+ return startDate <= endDate;
47
+ }
@@ -0,0 +1,41 @@
1
+ // Auto-generated by ObjectQL. DO NOT EDIT.
2
+ import { ObjectDoc } from '@objectql/types';
3
+
4
+ export interface Attachment extends ObjectDoc {
5
+ /**
6
+ * File Name
7
+ */
8
+ name: string;
9
+ /**
10
+ * File URL
11
+ */
12
+ file_url: any;
13
+ /**
14
+ * File Size (bytes)
15
+ */
16
+ file_size?: number;
17
+ /**
18
+ * MIME Type
19
+ */
20
+ file_type?: string;
21
+ /**
22
+ * Related Object Name
23
+ */
24
+ related_to?: string;
25
+ /**
26
+ * Related Record ID
27
+ */
28
+ related_id?: string;
29
+ /**
30
+ * Uploaded By
31
+ */
32
+ uploaded_by?: string | number;
33
+ /**
34
+ * Description
35
+ */
36
+ description?: string;
37
+ /**
38
+ * Tags (comma-separated)
39
+ */
40
+ tags?: string;
41
+ }
@@ -0,0 +1,61 @@
1
+ // Auto-generated by ObjectQL. DO NOT EDIT.
2
+ import { ObjectDoc } from '@objectql/types';
3
+
4
+ export interface CrmAccount extends ObjectDoc {
5
+ /**
6
+ * Account Name
7
+ */
8
+ name: string;
9
+ /**
10
+ * Account Number
11
+ */
12
+ account_number?: string;
13
+ /**
14
+ * Type
15
+ */
16
+ type?: string;
17
+ /**
18
+ * Industry
19
+ */
20
+ industry?: string;
21
+ /**
22
+ * Annual Revenue
23
+ */
24
+ annual_revenue?: number;
25
+ /**
26
+ * Number of Employees
27
+ */
28
+ employees?: number;
29
+ /**
30
+ * Website
31
+ */
32
+ website?: string;
33
+ /**
34
+ * Phone
35
+ */
36
+ phone?: string;
37
+ /**
38
+ * Billing Address
39
+ */
40
+ billing_address?: string;
41
+ /**
42
+ * Shipping Address
43
+ */
44
+ shipping_address?: string;
45
+ /**
46
+ * Account Owner
47
+ */
48
+ owner?: string | number;
49
+ /**
50
+ * Parent Account
51
+ */
52
+ parent_account?: string | number;
53
+ /**
54
+ * Description
55
+ */
56
+ description?: string;
57
+ /**
58
+ * Status
59
+ */
60
+ status?: string;
61
+ }
@@ -0,0 +1,61 @@
1
+ // Auto-generated by ObjectQL. DO NOT EDIT.
2
+ import { ObjectDoc } from '@objectql/types';
3
+
4
+ export interface CrmContact extends ObjectDoc {
5
+ /**
6
+ * First Name
7
+ */
8
+ first_name: string;
9
+ /**
10
+ * Last Name
11
+ */
12
+ last_name: string;
13
+ /**
14
+ * Full Name
15
+ */
16
+ full_name?: any;
17
+ /**
18
+ * Email
19
+ */
20
+ email?: string;
21
+ /**
22
+ * Phone
23
+ */
24
+ phone?: string;
25
+ /**
26
+ * Mobile
27
+ */
28
+ mobile?: string;
29
+ /**
30
+ * Job Title
31
+ */
32
+ title?: string;
33
+ /**
34
+ * Department
35
+ */
36
+ department?: string;
37
+ /**
38
+ * Account
39
+ */
40
+ account: string | number;
41
+ /**
42
+ * Contact Owner
43
+ */
44
+ owner?: string | number;
45
+ /**
46
+ * Lead Source
47
+ */
48
+ lead_source?: string;
49
+ /**
50
+ * LinkedIn Profile
51
+ */
52
+ linkedin_url?: string;
53
+ /**
54
+ * Notes
55
+ */
56
+ description?: string;
57
+ /**
58
+ * Status
59
+ */
60
+ status?: string;
61
+ }
@@ -0,0 +1,77 @@
1
+ // Auto-generated by ObjectQL. DO NOT EDIT.
2
+ import { ObjectDoc } from '@objectql/types';
3
+
4
+ export interface CrmLead extends ObjectDoc {
5
+ /**
6
+ * First Name
7
+ */
8
+ first_name: string;
9
+ /**
10
+ * Last Name
11
+ */
12
+ last_name: string;
13
+ /**
14
+ * Company
15
+ */
16
+ company?: string;
17
+ /**
18
+ * Job Title
19
+ */
20
+ title?: string;
21
+ /**
22
+ * Email
23
+ */
24
+ email?: string;
25
+ /**
26
+ * Phone
27
+ */
28
+ phone?: string;
29
+ /**
30
+ * Status
31
+ */
32
+ status: string;
33
+ /**
34
+ * Lead Source
35
+ */
36
+ lead_source?: string;
37
+ /**
38
+ * Lead Rating
39
+ */
40
+ rating?: string;
41
+ /**
42
+ * Lead Owner
43
+ */
44
+ owner?: string | number;
45
+ /**
46
+ * Industry
47
+ */
48
+ industry?: string;
49
+ /**
50
+ * Annual Revenue
51
+ */
52
+ annual_revenue?: number;
53
+ /**
54
+ * Number of Employees
55
+ */
56
+ employees?: number;
57
+ /**
58
+ * Description
59
+ */
60
+ description?: string;
61
+ /**
62
+ * Conversion Date
63
+ */
64
+ converted_date?: Date | string;
65
+ /**
66
+ * Converted Account
67
+ */
68
+ converted_account?: string | number;
69
+ /**
70
+ * Converted Contact
71
+ */
72
+ converted_contact?: string | number;
73
+ /**
74
+ * Converted Opportunity
75
+ */
76
+ converted_opportunity?: string | number;
77
+ }
@@ -0,0 +1,53 @@
1
+ // Auto-generated by ObjectQL. DO NOT EDIT.
2
+ import { ObjectDoc } from '@objectql/types';
3
+
4
+ export interface CrmOpportunity extends ObjectDoc {
5
+ /**
6
+ * Opportunity Name
7
+ */
8
+ name: string;
9
+ /**
10
+ * Account
11
+ */
12
+ account: string | number;
13
+ /**
14
+ * Amount
15
+ */
16
+ amount: number;
17
+ /**
18
+ * Expected Close Date
19
+ */
20
+ close_date: Date | string;
21
+ /**
22
+ * Stage
23
+ */
24
+ stage: string;
25
+ /**
26
+ * Probability (%)
27
+ */
28
+ probability?: number;
29
+ /**
30
+ * Opportunity Type
31
+ */
32
+ type?: string;
33
+ /**
34
+ * Lead Source
35
+ */
36
+ lead_source?: string;
37
+ /**
38
+ * Opportunity Owner
39
+ */
40
+ owner: string | number;
41
+ /**
42
+ * Next Step
43
+ */
44
+ next_step?: string;
45
+ /**
46
+ * Description
47
+ */
48
+ description?: string;
49
+ /**
50
+ * Known Competitors
51
+ */
52
+ competitors?: string;
53
+ }