truflow 0.0.195 → 1.50.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 (51) hide show
  1. package/dist/API/Allmoxy/IGeneric.d.ts +1 -0
  2. package/dist/API/Allmoxy/IOrderInventoryItems.d.ts +27 -0
  3. package/dist/API/Allmoxy/IOrderInventoryItems.js +2 -0
  4. package/dist/API/Allmoxy/index.d.ts +2 -0
  5. package/dist/API/Allmoxy/index.js +2 -0
  6. package/dist/Helpers/IExporters.d.ts +1 -42
  7. package/dist/IAutomation.d.ts +71 -3
  8. package/dist/IBackorder.d.ts +79 -0
  9. package/dist/IBackorder.js +2 -0
  10. package/dist/IDocumentType.d.ts +36 -0
  11. package/dist/IDocumentType.js +2 -0
  12. package/dist/IIntegration.d.ts +28 -0
  13. package/dist/IJobRole.d.ts +56 -0
  14. package/dist/IJobRole.js +2 -0
  15. package/dist/IMailCache.d.ts +1 -0
  16. package/dist/INotification.d.ts +1 -1
  17. package/dist/IOrder.d.ts +15 -0
  18. package/dist/ISMTPServerConfig.d.ts +41 -0
  19. package/dist/ISMTPServerConfig.js +2 -0
  20. package/dist/ISOP.d.ts +118 -0
  21. package/dist/ISOP.js +5 -0
  22. package/dist/ISchedule.d.ts +27 -3
  23. package/dist/ISetting.d.ts +16 -0
  24. package/dist/IShipment.d.ts +47 -0
  25. package/dist/IShipment.js +2 -0
  26. package/dist/ISupplier.d.ts +3 -0
  27. package/dist/IUser.d.ts +12 -0
  28. package/dist/Inventory/ILocation.d.ts +2 -0
  29. package/dist/index.d.ts +4 -0
  30. package/dist/index.js +4 -0
  31. package/package.json +1 -1
  32. package/src/API/Allmoxy/IContact.ts +59 -0
  33. package/src/API/Allmoxy/IGeneric.ts +1 -0
  34. package/src/API/Allmoxy/IOrderInventoryItems.ts +28 -0
  35. package/src/API/Allmoxy/index.ts +2 -0
  36. package/src/Helpers/IExporters.ts +3 -45
  37. package/src/IAutomation.ts +84 -1
  38. package/src/IDocumentType.ts +14 -0
  39. package/src/IIntegration.ts +36 -0
  40. package/src/IJobRole.ts +36 -0
  41. package/src/IMailCache.ts +1 -0
  42. package/src/INotification.ts +1 -0
  43. package/src/IOrder.ts +16 -0
  44. package/src/ISMTPServerConfig.ts +19 -0
  45. package/src/ISOP.ts +128 -0
  46. package/src/ISchedule.ts +31 -3
  47. package/src/ISetting.ts +22 -0
  48. package/src/ISupplier.ts +4 -0
  49. package/src/IUser.ts +14 -1
  50. package/src/Inventory/ILocation.ts +3 -0
  51. package/src/index.ts +4 -0
@@ -27,7 +27,7 @@ export interface IScheduleFilterCondition {
27
27
  field: "product" | "attribute";
28
28
  productId?: number;
29
29
  attributeName?: string;
30
- operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual";
30
+ operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual" | "exists" | "doesNotExist";
31
31
  value: string;
32
32
  }
33
33
  export interface IViewFilterCondition {
@@ -53,6 +53,7 @@ export interface ISavedViewFilter {
53
53
  sortConditions?: IFilterSortCondition[];
54
54
  }
55
55
  export interface IScheduleFilterGroup {
56
+ name?: string;
56
57
  conditions: IScheduleFilterCondition[];
57
58
  conditionOperator?: "and" | "or";
58
59
  }
@@ -62,9 +63,10 @@ export interface IScheduleColumn {
62
63
  machineId: mongoose.Types.ObjectId;
63
64
  offsetDays: number;
64
65
  order: number;
66
+ disableCondition?: IFieldDisableCondition;
65
67
  }
66
68
  export interface IScheduleDisplayColumn {
67
- type: "orderNumber" | "company" | "product" | "quantity" | "shipDate" | "startDate" | "status" | "attribute" | "stage" | "customField";
69
+ type: "orderNumber" | "company" | "product" | "quantity" | "shipDate" | "startDate" | "status" | "attribute" | "stage" | "customField" | "shipDateStage";
68
70
  stageColumnId?: mongoose.Types.ObjectId;
69
71
  attributeName?: string;
70
72
  customFieldName?: string;
@@ -72,7 +74,7 @@ export interface IScheduleDisplayColumn {
72
74
  visible: boolean;
73
75
  }
74
76
  export interface IScheduleAdditionalAttribute {
75
- attributeName: string;
77
+ attributeNames: string[];
76
78
  label?: string;
77
79
  displayCondition?: {
78
80
  operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual";
@@ -89,11 +91,20 @@ export interface IScheduleView {
89
91
  additionalAttributes?: (string | IScheduleAdditionalAttribute)[];
90
92
  combineAdditionalAttributes?: boolean;
91
93
  groupByMatchingAttributes?: boolean;
94
+ combineByAttributes?: string[];
95
+ combineFilterGroups?: boolean;
92
96
  isDefault?: boolean;
93
97
  savedFilters?: ISavedViewFilter[];
94
98
  defaultFilterId?: mongoose.Types.ObjectId;
95
99
  activeFilterId?: mongoose.Types.ObjectId;
96
100
  }
101
+ export interface IFieldDisableCondition {
102
+ fieldType: "attribute" | "customField";
103
+ fieldName: string;
104
+ operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual" | "isEmpty" | "isNotEmpty";
105
+ value?: string;
106
+ disabledPlaceholder?: string;
107
+ }
97
108
  export interface IScheduleCustomField {
98
109
  _id?: mongoose.Types.ObjectId;
99
110
  name: string;
@@ -103,6 +114,7 @@ export interface IScheduleCustomField {
103
114
  defaultValue?: string | boolean | number;
104
115
  required?: boolean;
105
116
  order?: number;
117
+ disableCondition?: IFieldDisableCondition;
106
118
  }
107
119
  export interface ILeanSchedule {
108
120
  _id: mongoose.Types.ObjectId;
@@ -115,11 +127,14 @@ export interface ILeanSchedule {
115
127
  views?: IScheduleView[];
116
128
  customFields?: IScheduleCustomField[];
117
129
  baseDateField: "shipDate" | "startDate";
130
+ completedStatuses?: string[];
131
+ hideCompletedOrders?: boolean;
118
132
  displayColumns?: IScheduleDisplayColumn[];
119
133
  hidePastShipDates?: boolean;
120
134
  hideShippedOrders?: boolean;
121
135
  showShipDate?: boolean;
122
136
  showStartDate?: boolean;
137
+ showShipDateStage?: boolean;
123
138
  defaultSortField?: string;
124
139
  defaultSortDirection?: "asc" | "desc";
125
140
  createdAt?: Date;
@@ -130,6 +145,14 @@ export interface IScheduleEntryDate {
130
145
  columnId: mongoose.Types.ObjectId;
131
146
  date: string;
132
147
  }
148
+ export interface IScheduleEntryHistory {
149
+ fieldType: "date" | "status" | "customField";
150
+ fieldName: string;
151
+ oldValue?: string | number | boolean | null;
152
+ newValue?: string | number | boolean | null;
153
+ changedAt: Date;
154
+ changedBy?: string;
155
+ }
133
156
  export interface ILeanScheduleEntry {
134
157
  _id: mongoose.Types.ObjectId;
135
158
  scheduleId: mongoose.Types.ObjectId;
@@ -141,6 +164,7 @@ export interface ILeanScheduleEntry {
141
164
  customStatus?: {
142
165
  [key: string]: any;
143
166
  };
167
+ history?: IScheduleEntryHistory[];
144
168
  createdAt?: Date;
145
169
  updatedAt?: Date;
146
170
  }
@@ -93,6 +93,22 @@ export interface ILeanMachine extends ILeanSetting {
93
93
  hiddenSOPs?: mongoose.Types.ObjectId[];
94
94
  sopOrder?: mongoose.Types.ObjectId[];
95
95
  pinnedSOPs?: mongoose.Types.ObjectId[];
96
+ hiddenMachineChecks?: mongoose.Types.ObjectId[];
97
+ machineCheckOrder?: mongoose.Types.ObjectId[];
98
+ pinnedMachineChecks?: mongoose.Types.ObjectId[];
99
+ currentStatus?: mongoose.Types.ObjectId;
100
+ statusHistory?: Array<{
101
+ statusId: mongoose.Types.ObjectId;
102
+ statusName: string;
103
+ changedBy: mongoose.Types.ObjectId;
104
+ changedAt: Date;
105
+ comments?: string;
106
+ }>;
107
+ publicLinks?: Array<{
108
+ name: string;
109
+ url: string;
110
+ openInNewTab?: boolean;
111
+ }>;
96
112
  }
97
113
  export interface ILeanOrderFlag extends ILeanSetting {
98
114
  name: string;
@@ -0,0 +1,47 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ import mongoose, { Document } from "mongoose";
26
+ export interface IShipmentOrder {
27
+ orderId: number;
28
+ orderName?: string;
29
+ quantity?: number;
30
+ backorderIds?: mongoose.Types.ObjectId[];
31
+ }
32
+ export interface IShipmentEntry {
33
+ _id?: mongoose.Types.ObjectId;
34
+ shipmentNumber?: string;
35
+ customerId?: number;
36
+ customerName: string;
37
+ orders: IShipmentOrder[];
38
+ packingListPaths?: string[];
39
+ notes?: string;
40
+ shippedDate?: Date;
41
+ createdBy: mongoose.Types.ObjectId;
42
+ status: "pending" | "shipped" | "delivered" | "cancelled";
43
+ publicToken?: string;
44
+ createdAt?: Date;
45
+ updatedAt?: Date;
46
+ }
47
+ export type IShipment = IShipmentEntry & Document;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -30,6 +30,7 @@ export interface ISupplierContact {
30
30
  phone?: string;
31
31
  role?: string;
32
32
  notifyOnVMIPurchase?: boolean;
33
+ allmoxyContactId?: number;
33
34
  }
34
35
  export interface ISupplier {
35
36
  _id: mongoose.Types.ObjectId;
@@ -39,6 +40,8 @@ export interface ISupplier {
39
40
  notes?: string;
40
41
  active: boolean;
41
42
  allowedInventoryTypes?: mongoose.Types.ObjectId[];
43
+ allmoxyCompanyId?: number;
44
+ lastSyncedToAllmoxy?: Date;
42
45
  createdAt: Date;
43
46
  updatedAt: Date;
44
47
  }
package/dist/IUser.d.ts CHANGED
@@ -34,11 +34,18 @@ export interface ILeanUser {
34
34
  permissions: any[];
35
35
  groups: any[];
36
36
  pushSubscriptions?: PushSubscription[];
37
+ expoPushTokens?: ExpoPushToken[];
37
38
  pushNotificationTags?: NotificationTag[];
38
39
  enableSignin?: boolean;
39
40
  position?: string;
40
41
  department?: mongoose.Types.ObjectId | string;
42
+ departments?: (mongoose.Types.ObjectId | string)[];
41
43
  employeeId?: string;
44
+ startupPage?: string;
45
+ jobRoleId?: mongoose.Types.ObjectId | string;
46
+ isOrgRoot?: boolean;
47
+ reportsTo?: mongoose.Types.ObjectId | string;
48
+ hideFromOrgChartUnassigned?: boolean;
42
49
  }
43
50
  export interface PushSubscription {
44
51
  endpoint: string;
@@ -49,3 +56,8 @@ export interface PushSubscription {
49
56
  device?: string;
50
57
  createdAt?: Date;
51
58
  }
59
+ export interface ExpoPushToken {
60
+ token: string;
61
+ device?: string;
62
+ createdAt?: Date;
63
+ }
@@ -74,6 +74,8 @@ export interface ILocation extends Omit<Document, '_id'>, ILocationComponentBase
74
74
  isVMI?: boolean;
75
75
  allowedSuppliers?: Types.ObjectId[];
76
76
  transferRestriction?: "bidirectional" | "inbound_only" | "outbound_only";
77
+ allmoxyLocationId?: number;
78
+ lastSyncedToAllmoxy?: Date;
77
79
  }
78
80
  export interface ILocationPath {
79
81
  locationId: Types.ObjectId;
package/dist/index.d.ts CHANGED
@@ -39,3 +39,7 @@ export * from "./ISupplier";
39
39
  export * from "./ISchedule";
40
40
  export * from "./IAutomation";
41
41
  export * from "./IEmailTemplate";
42
+ export * from "./ISOP";
43
+ export * from "./IDocumentType";
44
+ export * from "./ISMTPServerConfig";
45
+ export * from "./IJobRole";
package/dist/index.js CHANGED
@@ -55,3 +55,7 @@ __exportStar(require("./ISupplier"), exports);
55
55
  __exportStar(require("./ISchedule"), exports);
56
56
  __exportStar(require("./IAutomation"), exports);
57
57
  __exportStar(require("./IEmailTemplate"), exports);
58
+ __exportStar(require("./ISOP"), exports);
59
+ __exportStar(require("./IDocumentType"), exports);
60
+ __exportStar(require("./ISMTPServerConfig"), exports);
61
+ __exportStar(require("./IJobRole"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "truflow",
3
- "version": "0.0.195",
3
+ "version": "1.50.0",
4
4
  "main": "./dist/index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -0,0 +1,59 @@
1
+ export interface IAllmoxyContactResponse {
2
+ contact_id: number;
3
+ company_id: number;
4
+ contact_type: "employee" | "individual";
5
+ first_name: string;
6
+ middle_name?: string;
7
+ last_name: string;
8
+ job_title?: string;
9
+ gender?: "male" | "female";
10
+ language?: string;
11
+ email?: string;
12
+ about_text?: string;
13
+ username?: string;
14
+ avatar?: string;
15
+ theme_id?: number;
16
+ sms_phone_number?: string;
17
+ carrier_id?: number;
18
+ digest_time?: number;
19
+ timezone_id?: number;
20
+ tags?: string;
21
+ status: number;
22
+ can_log_in: number;
23
+ createdby?: string;
24
+ createdbyid?: number;
25
+ createddate?: string;
26
+ updatedby?: string;
27
+ updatedbyid?: number;
28
+ updateddate?: string;
29
+ }
30
+
31
+ export interface IAllmoxyContact {
32
+ company_id: number;
33
+ contact_type: "employee" | "individual";
34
+ first_name: string;
35
+ middle_name?: string;
36
+ last_name: string;
37
+ job_title?: string;
38
+ gender?: "male" | "female";
39
+ language?: string;
40
+ email?: string;
41
+ about_text?: string;
42
+ status: number;
43
+ can_log_in?: number;
44
+ theme_id?: number;
45
+ timezone_id?: number;
46
+ carrier_id?: number;
47
+ digest_time?: number;
48
+ }
49
+
50
+ export interface IAllmoxyContactQuery {
51
+ company_id?: number;
52
+ contact_type?: "employee" | "individual";
53
+ first_name?: string;
54
+ last_name?: string;
55
+ email?: string;
56
+ status?: number;
57
+ page?: number;
58
+ per_page?: number;
59
+ }
@@ -43,6 +43,7 @@ export interface IStatusChangeTrigger {
43
43
  contact_tags: any[];
44
44
  delivery_date: string;
45
45
  due_date: string;
46
+ previous_delivery_date?: string;
46
47
  entered_date: string;
47
48
  exported: string;
48
49
  gst: string;
@@ -0,0 +1,28 @@
1
+ export interface IOrderInventoryItemsQuery {
2
+ order_id?: number;
3
+ }
4
+
5
+ export interface IOrderInventoryItemsResponse {
6
+ supply_id: number;
7
+ order_id: number;
8
+ location_id: number | null;
9
+ item_id: number;
10
+ quantity: number;
11
+ /** Allmoxy returns price as a numeric string (e.g. "0E-8"). Parsed to number when storing internally. */
12
+ price: string | number;
13
+ type: string | null;
14
+ allocated_by: string | null;
15
+ timestamp: string | null;
16
+ createdby: string | null;
17
+ createdbyid: number | null;
18
+ createddate: string | null;
19
+ updatedby: string | null;
20
+ updatedbyid: number | null;
21
+ updateddate: string | null;
22
+ inventory_item_name: string;
23
+ inventory_item_piece_size: string;
24
+ inventory_item_status: number;
25
+ order_name: string;
26
+ order_type: string;
27
+ order_status: string;
28
+ }
@@ -1,5 +1,6 @@
1
1
  export * from "./IAnnouncement";
2
2
  export * from "./ICompany";
3
+ export * from "./IContact";
3
4
  export * from "./IGeneric";
4
5
  export * from "./IInventoryItem";
5
6
  export * from "./IInventoryOrder";
@@ -13,4 +14,5 @@ export * from "./IProductAttributeOptions";
13
14
  export * from "./IProductProductAttribute";
14
15
  export * from "./ITrigger";
15
16
  export * from "./IOrderBatch";
17
+ export * from "./IOrderInventoryItems";
16
18
  export * from "./IShippingMethod";
@@ -1,45 +1,3 @@
1
- export interface ICloudPanelAccount {
2
- name: string;
3
- username: string;
4
- password: string;
5
- }
6
-
7
- export interface ICloudPanelAPIRequest {
8
- DisplayName: string;
9
- Company: string;
10
- Username: string;
11
- Domain: string;
12
- Pwd: string;
13
- confirmPwd: string;
14
- PasswordNeverExpires: boolean;
15
- EnableMailbox: boolean;
16
- LocalPart: string;
17
- DomainPart: string;
18
- MailboxPlan: number;
19
- }
20
-
21
- export interface IPosteBox {
22
- address: string;
23
- user: string;
24
- home: string;
25
- name: string;
26
- disabled: boolean;
27
- domain_admin: boolean;
28
- super_admin: boolean;
29
- strict_from_disabled: boolean;
30
- created: string;
31
- updated: string;
32
- redirect_only: boolean;
33
- redirect_to: [];
34
- discard: boolean;
35
- }
36
-
37
- export interface ICreatePosteBox {
38
- name: string;
39
- email: string;
40
- passwordPlaintext: string;
41
- disabled: boolean;
42
- superAdmin: boolean;
43
- redirectTo?: ["string"];
44
- referenceId?: "string";
45
- }
1
+ // No interfaces needed in this file after removing legacy email account creation
2
+ // All exporter types are in IExporter.ts
3
+ export {};
@@ -10,15 +10,21 @@ export type AutomationTriggerType =
10
10
  | "measurement.added" // When a measurement is added to an order product
11
11
  | "measurement.completed" // When all measurements are completed for an order
12
12
  | "walkthrough.submitted" // When a walkthrough template is submitted
13
- | "walkthrough.arrived"; // When a walkthrough template is submitted (alias for notifications)
13
+ | "walkthrough.arrived" // When a walkthrough template is submitted (alias for notifications)
14
+ | "machineCheck.submitted" // When a machine check is submitted
15
+ | "machineCheck.arrived" // When a machine check reminder is due (for notifications)
16
+ | "machineStatus.changed"; // When a machine status changes
14
17
 
15
18
  // Action types that can be executed
16
19
  export type AutomationActionType =
17
20
  | "webhook" // Trigger a webhook (HTTP request)
18
21
  | "email" // Send an email
19
22
  | "notification" // Send in-app notification to user(s)
23
+ | "push_notification" // Send Expo push notification to mobile app
20
24
  | "sms" // Send SMS/text message
21
25
  | "slack" // Post to Slack channel
26
+ | "google_chat" // Send a Google Chat message
27
+ | "clickup" // Post a ClickUp Chat message
22
28
  | "update_field" // Update order or schedule entry field
23
29
  | "add_note"; // Add a note to the order
24
30
 
@@ -126,6 +132,23 @@ export interface IAutomationSlackAction {
126
132
  iconEmoji?: string; // Optional emoji icon (e.g., ":robot_face:")
127
133
  }
128
134
 
135
+ // Google Chat action configuration
136
+ export interface IAutomationGoogleChatAction {
137
+ type: "google_chat";
138
+ integrationId: string; // References the GoogleChat integration _id
139
+ spaceId: string; // References a space _id within the integration's spaces array
140
+ message: string; // Message text (can use template variables)
141
+ threadKey?: string; // Optional thread key for grouping messages into a thread
142
+ }
143
+
144
+ // ClickUp Chat action configuration
145
+ export interface IAutomationClickUpAction {
146
+ type: "clickup";
147
+ integrationId: string; // References the ClickUp integration _id
148
+ channelId: string; // ClickUp channel ID (from the integration's channels array)
149
+ message: string; // Message text (can use template variables)
150
+ }
151
+
129
152
  // Update field action configuration
130
153
  export interface IAutomationUpdateFieldAction {
131
154
  type: "update_field";
@@ -141,13 +164,28 @@ export interface IAutomationAddNoteAction {
141
164
  mentionUserIds?: string[]; // Optional user IDs to mention
142
165
  }
143
166
 
167
+ // Push notification action configuration (for Expo mobile app)
168
+ export interface IAutomationPushNotificationAction {
169
+ type: "push_notification";
170
+ userIds: string[]; // Array of user IDs to notify (can use "all" for all users with matching tags)
171
+ title: string; // Notification title (can use template variables)
172
+ message: string; // Notification message (can use template variables)
173
+ /** Optional deep-link payload. Supports template variables in string values.
174
+ * e.g. { screen: "Walkthroughs", templateId: "{{walkthrough.templateId}}" }
175
+ */
176
+ data?: Record<string, string>;
177
+ }
178
+
144
179
  // Union type for all action configurations
145
180
  export type IAutomationAction =
146
181
  | IAutomationWebhookAction
147
182
  | IAutomationEmailAction
148
183
  | IAutomationNotificationAction
184
+ | IAutomationPushNotificationAction
149
185
  | IAutomationSMSAction
150
186
  | IAutomationSlackAction
187
+ | IAutomationGoogleChatAction
188
+ | IAutomationClickUpAction
151
189
  | IAutomationUpdateFieldAction
152
190
  | IAutomationAddNoteAction;
153
191
 
@@ -255,6 +293,51 @@ export interface IAutomationContext {
255
293
  }>;
256
294
  [key: string]: any; // Allow dynamic field access
257
295
  };
296
+ machineCheck?: {
297
+ id: string; // Submission ID
298
+ templateId: string; // Template ID
299
+ templateName: string; // Template name
300
+ machineId: string; // Machine ID
301
+ machineName: string; // Machine name
302
+ submittedBy: {
303
+ id: string;
304
+ firstName: string;
305
+ lastName: string;
306
+ email?: string;
307
+ };
308
+ submittedAt: string; // ISO date string
309
+ comments?: string; // Optional general comments
310
+ fields: Array<{ // All field values from the submission
311
+ fieldId: string;
312
+ label: string;
313
+ type: "number" | "yesno" | "comment";
314
+ value: any;
315
+ status?: string; // Buffer zone status if applicable
316
+ }>;
317
+ [key: string]: any; // Allow dynamic field access
318
+ };
319
+ machineStatus?: {
320
+ machineId: string; // Machine ID
321
+ machineName: string; // Machine name
322
+ oldStatus?: {
323
+ id: string;
324
+ name: string;
325
+ color: string;
326
+ };
327
+ newStatus: {
328
+ id: string;
329
+ name: string;
330
+ color: string;
331
+ };
332
+ changedBy: {
333
+ id: string;
334
+ firstName: string;
335
+ lastName: string;
336
+ email?: string;
337
+ };
338
+ changedAt: string; // ISO date string
339
+ comments?: string; // Optional comments about the status change
340
+ };
258
341
  triggeredBy?: {
259
342
  userId?: string;
260
343
  userName?: string;
@@ -0,0 +1,14 @@
1
+ import mongoose, { Document } from "mongoose";
2
+
3
+ export interface ILeanDocumentType {
4
+ _id?: mongoose.Types.ObjectId;
5
+ name: string;
6
+ slug: string;
7
+ description?: string;
8
+ isActive: boolean;
9
+ isSystem: boolean;
10
+ createdAt?: Date;
11
+ updatedAt?: Date;
12
+ }
13
+
14
+ export type IDocumentType = ILeanDocumentType & Document;
@@ -25,6 +25,13 @@ export interface ILeanAllmoxyIntegration extends ILeanIntegration {
25
25
  authToken: string;
26
26
  }[];
27
27
  saveSelectedAttributesInOrder?: boolean;
28
+ enableShipDateSync?: boolean;
29
+ shipDateWebhook?: {
30
+ id: string;
31
+ url: string;
32
+ event: string;
33
+ authToken: string;
34
+ };
28
35
  webhook?: {
29
36
  id: string;
30
37
  url: string;
@@ -37,3 +44,32 @@ export interface ILeanAllmoxyIntegration extends ILeanIntegration {
37
44
 
38
45
  export type IAllmoxyIntegration = ILeanAllmoxyIntegration & Document;
39
46
 
47
+ // A single configured target (space, DM, or group) in a Google Chat integration
48
+ export interface IGoogleChatSpace {
49
+ _id: mongoose.Types.ObjectId;
50
+ name: string; // User-defined display name (e.g. "Engineering Space")
51
+ type: "space" | "dm" | "group"; // Target type
52
+ webhookUrl: string; // Google Chat incoming webhook URL
53
+ }
54
+
55
+ export interface ILeanGoogleChatIntegration extends ILeanIntegration {
56
+ spaces: IGoogleChatSpace[];
57
+ }
58
+
59
+ export type IGoogleChatIntegration = ILeanGoogleChatIntegration & Document;
60
+
61
+ // A single configured channel or DM in a ClickUp integration
62
+ export interface IClickUpChannel {
63
+ _id: mongoose.Types.ObjectId;
64
+ name: string; // User-defined display name (e.g. "Engineering")
65
+ type: "channel" | "dm"; // Target type
66
+ channelId: string; // ClickUp Chat channel ID
67
+ }
68
+
69
+ export interface ILeanClickUpIntegration extends ILeanIntegration {
70
+ apiKey: string; // ClickUp Personal API Key
71
+ channels: IClickUpChannel[];
72
+ }
73
+
74
+ export type IClickUpIntegration = ILeanClickUpIntegration & Document;
75
+
@@ -0,0 +1,36 @@
1
+ import mongoose, { Document } from "mongoose";
2
+
3
+ export type IJobRole = ILeanJobRole & Document;
4
+
5
+ export interface ILeanJobRole {
6
+ _id: mongoose.Types.ObjectId;
7
+ name: string;
8
+ description?: string;
9
+ responsibilities?: string;
10
+ tasks?: IJobRoleTask[];
11
+ metrics?: IJobRoleMetric[];
12
+ qualifications?: string;
13
+ safetyNotes?: string;
14
+ tools?: string;
15
+ reportingTo?: string;
16
+ notes?: string;
17
+ assignedMachineIds?: (mongoose.Types.ObjectId | string)[];
18
+ assignedDepartmentIds?: (mongoose.Types.ObjectId | string)[];
19
+ assignedSOPIds?: (mongoose.Types.ObjectId | string)[];
20
+ enabled?: boolean;
21
+ createdAt?: Date;
22
+ updatedAt?: Date;
23
+ }
24
+
25
+ export interface IJobRoleTask {
26
+ title: string;
27
+ frequency: "daily" | "weekly" | "biweekly" | "monthly" | "asNeeded";
28
+ description?: string;
29
+ }
30
+
31
+ export interface IJobRoleMetric {
32
+ name: string;
33
+ description?: string;
34
+ unit?: string;
35
+ target?: string;
36
+ }
package/src/IMailCache.ts CHANGED
@@ -28,6 +28,7 @@ export interface IPDFAttachment {
28
28
  storagePath?: string;
29
29
  gridFSId?: mongoose.Types.ObjectId;
30
30
  orderNumber?: number;
31
+ documentType?: string;
31
32
  }
32
33
 
33
34
  export type IMailCache = ILeanMailCache & Document;
@@ -10,6 +10,7 @@ export interface INotificationAction {
10
10
  // Standard notification tags for categorizing notifications
11
11
  export type NotificationTag =
12
12
  | "walkthrough" // Walkthrough reminders and submissions
13
+ | "machine-check" // Machine check reminders and submissions
13
14
  | "order_update" // Order status changes, ship date updates
14
15
  | "mention" // User @mentions
15
16
  | "automation" // Automation notifications