truflow 0.0.190 → 0.0.192
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/dist/API/Allmoxy/IContact.d.ts +57 -0
- package/dist/API/Allmoxy/IContact.js +2 -0
- package/dist/IAutomation.d.ts +24 -1
- package/dist/IEmailTemplate.d.ts +47 -0
- package/dist/IEmailTemplate.js +2 -0
- package/dist/INotification.d.ts +9 -0
- package/dist/IScannerActivity.d.ts +54 -0
- package/dist/IScannerActivity.js +2 -0
- package/dist/ISchedule.d.ts +28 -0
- package/dist/ISetting.d.ts +1 -0
- package/dist/ISupplier.d.ts +9 -6
- package/dist/IUser.d.ts +2 -0
- package/dist/Inventory/ILocation.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +7 -5
- package/src/IAutomation.ts +29 -4
- package/src/IEmailTemplate.ts +26 -0
- package/src/INotification.ts +21 -0
- package/src/ISchedule.ts +38 -1
- package/src/ISetting.ts +1 -0
- package/src/ISupplier.ts +11 -6
- package/src/IUser.ts +2 -0
- package/src/Inventory/ILocation.ts +5 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +4 -1
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
export interface IAllmoxyContact {
|
|
31
|
+
company_id: number;
|
|
32
|
+
contact_type: "employee" | "individual";
|
|
33
|
+
first_name: string;
|
|
34
|
+
middle_name?: string;
|
|
35
|
+
last_name: string;
|
|
36
|
+
job_title?: string;
|
|
37
|
+
gender?: "male" | "female";
|
|
38
|
+
language?: string;
|
|
39
|
+
email?: string;
|
|
40
|
+
about_text?: string;
|
|
41
|
+
status: number;
|
|
42
|
+
can_log_in?: number;
|
|
43
|
+
theme_id?: number;
|
|
44
|
+
timezone_id?: number;
|
|
45
|
+
carrier_id?: number;
|
|
46
|
+
digest_time?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface IAllmoxyContactQuery {
|
|
49
|
+
company_id?: number;
|
|
50
|
+
contact_type?: "employee" | "individual";
|
|
51
|
+
first_name?: string;
|
|
52
|
+
last_name?: string;
|
|
53
|
+
email?: string;
|
|
54
|
+
status?: number;
|
|
55
|
+
page?: number;
|
|
56
|
+
per_page?: number;
|
|
57
|
+
}
|
package/dist/IAutomation.d.ts
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
|
-
export type AutomationTriggerType = "order.created" | "order.updated" | "order.
|
|
26
|
+
export type AutomationTriggerType = "order.created" | "order.updated" | "order.statusChanged" | "schedule.entryAdded" | "schedule.fieldChanged" | "measurement.added" | "measurement.completed" | "walkthrough.submitted" | "walkthrough.arrived";
|
|
27
27
|
export type AutomationActionType = "webhook" | "email" | "notification" | "sms" | "slack" | "update_field" | "add_note";
|
|
28
28
|
export type AutomationConditionOperator = "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual" | "exists" | "notExists" | "in" | "notIn";
|
|
29
29
|
export interface IAutomationCondition {
|
|
@@ -69,6 +69,8 @@ export interface IAutomationEmailAction {
|
|
|
69
69
|
body: string;
|
|
70
70
|
cc?: string[];
|
|
71
71
|
bcc?: string[];
|
|
72
|
+
useTemplate?: boolean;
|
|
73
|
+
templateId?: string;
|
|
72
74
|
}
|
|
73
75
|
export interface IAutomationNotificationAction {
|
|
74
76
|
type: "notification";
|
|
@@ -169,6 +171,27 @@ export interface IAutomationContext {
|
|
|
169
171
|
oldValue: any;
|
|
170
172
|
newValue: any;
|
|
171
173
|
};
|
|
174
|
+
walkthrough?: {
|
|
175
|
+
id: string;
|
|
176
|
+
templateId: string;
|
|
177
|
+
templateName: string;
|
|
178
|
+
submittedBy: {
|
|
179
|
+
id: string;
|
|
180
|
+
firstName: string;
|
|
181
|
+
lastName: string;
|
|
182
|
+
email?: string;
|
|
183
|
+
};
|
|
184
|
+
submittedAt: string;
|
|
185
|
+
comments?: string;
|
|
186
|
+
fields: Array<{
|
|
187
|
+
fieldId: string;
|
|
188
|
+
label: string;
|
|
189
|
+
type: "number" | "yesno" | "comment";
|
|
190
|
+
value: any;
|
|
191
|
+
status?: string;
|
|
192
|
+
}>;
|
|
193
|
+
[key: string]: any;
|
|
194
|
+
};
|
|
172
195
|
triggeredBy?: {
|
|
173
196
|
userId?: string;
|
|
174
197
|
userName?: 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 { Document } from "mongoose";
|
|
26
|
+
export interface IEmailTemplateVariable {
|
|
27
|
+
key: string;
|
|
28
|
+
label: string;
|
|
29
|
+
description: string;
|
|
30
|
+
example?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ILeanEmailTemplate {
|
|
33
|
+
_id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
triggerType: string;
|
|
37
|
+
subject: string;
|
|
38
|
+
bodyHtml: string;
|
|
39
|
+
bodyText?: string;
|
|
40
|
+
isDefault: boolean;
|
|
41
|
+
isEditable: boolean;
|
|
42
|
+
variables: IEmailTemplateVariable[];
|
|
43
|
+
previewData?: any;
|
|
44
|
+
createdAt: Date;
|
|
45
|
+
updatedAt: Date;
|
|
46
|
+
}
|
|
47
|
+
export type IEmailTemplate = ILeanEmailTemplate & Document;
|
package/dist/INotification.d.ts
CHANGED
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
|
+
export interface INotificationAction {
|
|
27
|
+
label: string;
|
|
28
|
+
type: "navigate" | "modal" | "callback" | "external";
|
|
29
|
+
value: string;
|
|
30
|
+
data?: Record<string, any>;
|
|
31
|
+
}
|
|
32
|
+
export type NotificationTag = "walkthrough" | "order_update" | "mention" | "automation" | "system" | "quality_control" | "inventory" | "schedule" | "general";
|
|
26
33
|
export type INotification = ILeanNotification & Document;
|
|
27
34
|
export interface ILeanNotification {
|
|
28
35
|
_id: mongoose.Types.ObjectId;
|
|
@@ -31,4 +38,6 @@ export interface ILeanNotification {
|
|
|
31
38
|
read: boolean;
|
|
32
39
|
target: mongoose.Types.ObjectId;
|
|
33
40
|
type: "error" | "warning" | "success" | "info";
|
|
41
|
+
tag: NotificationTag;
|
|
42
|
+
actions?: INotificationAction[];
|
|
34
43
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 IPieceDetails {
|
|
27
|
+
group_num: string;
|
|
28
|
+
line_num: string;
|
|
29
|
+
file_name: string;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
outside_profile: number;
|
|
33
|
+
srw?: number;
|
|
34
|
+
opedges?: number;
|
|
35
|
+
ip_type?: number;
|
|
36
|
+
rail_width?: number;
|
|
37
|
+
wood_type?: number;
|
|
38
|
+
x_offset?: number;
|
|
39
|
+
y_offset?: number;
|
|
40
|
+
front_width?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface ILeanScannerActivity {
|
|
43
|
+
_id: mongoose.Types.ObjectId;
|
|
44
|
+
orderId: number;
|
|
45
|
+
machineId: mongoose.Types.ObjectId;
|
|
46
|
+
groupNum: string;
|
|
47
|
+
lineNum: string;
|
|
48
|
+
quantity: number;
|
|
49
|
+
timestamp: Date;
|
|
50
|
+
pieceDetails: IPieceDetails;
|
|
51
|
+
createdAt: Date;
|
|
52
|
+
updatedAt: Date;
|
|
53
|
+
}
|
|
54
|
+
export type IScannerActivity = ILeanScannerActivity & Document;
|
package/dist/ISchedule.d.ts
CHANGED
|
@@ -30,8 +30,31 @@ export interface IScheduleFilterCondition {
|
|
|
30
30
|
operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual";
|
|
31
31
|
value: string;
|
|
32
32
|
}
|
|
33
|
+
export interface IViewFilterCondition {
|
|
34
|
+
id?: string;
|
|
35
|
+
fieldType: "standard" | "customField" | "date" | "attribute";
|
|
36
|
+
fieldName: string;
|
|
37
|
+
operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual" | "in" | "notIn" | "isEmpty" | "isNotEmpty" | "between";
|
|
38
|
+
value?: any;
|
|
39
|
+
label?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface IFilterSortCondition {
|
|
42
|
+
fieldType: "standard" | "customField" | "date" | "attribute";
|
|
43
|
+
fieldName: string;
|
|
44
|
+
direction: "asc" | "desc";
|
|
45
|
+
order: number;
|
|
46
|
+
}
|
|
47
|
+
export interface ISavedViewFilter {
|
|
48
|
+
_id?: mongoose.Types.ObjectId;
|
|
49
|
+
name: string;
|
|
50
|
+
conditions: IViewFilterCondition[];
|
|
51
|
+
conditionOperator: "and" | "or";
|
|
52
|
+
description?: string;
|
|
53
|
+
sortConditions?: IFilterSortCondition[];
|
|
54
|
+
}
|
|
33
55
|
export interface IScheduleFilterGroup {
|
|
34
56
|
conditions: IScheduleFilterCondition[];
|
|
57
|
+
conditionOperator?: "and" | "or";
|
|
35
58
|
}
|
|
36
59
|
export interface IScheduleColumn {
|
|
37
60
|
_id?: mongoose.Types.ObjectId;
|
|
@@ -67,6 +90,9 @@ export interface IScheduleView {
|
|
|
67
90
|
combineAdditionalAttributes?: boolean;
|
|
68
91
|
groupByMatchingAttributes?: boolean;
|
|
69
92
|
isDefault?: boolean;
|
|
93
|
+
savedFilters?: ISavedViewFilter[];
|
|
94
|
+
defaultFilterId?: mongoose.Types.ObjectId;
|
|
95
|
+
activeFilterId?: mongoose.Types.ObjectId;
|
|
70
96
|
}
|
|
71
97
|
export interface IScheduleCustomField {
|
|
72
98
|
_id?: mongoose.Types.ObjectId;
|
|
@@ -84,12 +110,14 @@ export interface ILeanSchedule {
|
|
|
84
110
|
description?: string;
|
|
85
111
|
enabled: boolean;
|
|
86
112
|
filterGroups: IScheduleFilterGroup[];
|
|
113
|
+
groupOperator: "and" | "or";
|
|
87
114
|
columns: IScheduleColumn[];
|
|
88
115
|
views?: IScheduleView[];
|
|
89
116
|
customFields?: IScheduleCustomField[];
|
|
90
117
|
baseDateField: "shipDate" | "startDate";
|
|
91
118
|
displayColumns?: IScheduleDisplayColumn[];
|
|
92
119
|
hidePastShipDates?: boolean;
|
|
120
|
+
hideShippedOrders?: boolean;
|
|
93
121
|
showShipDate?: boolean;
|
|
94
122
|
showStartDate?: boolean;
|
|
95
123
|
defaultSortField?: string;
|
package/dist/ISetting.d.ts
CHANGED
package/dist/ISupplier.d.ts
CHANGED
|
@@ -23,16 +23,19 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
|
+
export interface ISupplierContact {
|
|
27
|
+
_id?: mongoose.Types.ObjectId;
|
|
28
|
+
name: string;
|
|
29
|
+
email?: string;
|
|
30
|
+
phone?: string;
|
|
31
|
+
role?: string;
|
|
32
|
+
notifyOnVMIPurchase?: boolean;
|
|
33
|
+
}
|
|
26
34
|
export interface ISupplier {
|
|
27
35
|
_id: mongoose.Types.ObjectId;
|
|
28
36
|
name: string;
|
|
29
37
|
code: string;
|
|
30
|
-
|
|
31
|
-
email?: string;
|
|
32
|
-
phone?: string;
|
|
33
|
-
address?: string;
|
|
34
|
-
contactPerson?: string;
|
|
35
|
-
};
|
|
38
|
+
contacts?: ISupplierContact[];
|
|
36
39
|
notes?: string;
|
|
37
40
|
active: boolean;
|
|
38
41
|
allowedInventoryTypes?: mongoose.Types.ObjectId[];
|
package/dist/IUser.d.ts
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
|
+
import { NotificationTag } from "./INotification";
|
|
26
27
|
export type IUser = ILeanUser & Document;
|
|
27
28
|
export interface ILeanUser {
|
|
28
29
|
_id: mongoose.Types.ObjectId;
|
|
@@ -33,6 +34,7 @@ export interface ILeanUser {
|
|
|
33
34
|
permissions: any[];
|
|
34
35
|
groups: any[];
|
|
35
36
|
pushSubscriptions?: PushSubscription[];
|
|
37
|
+
pushNotificationTags?: NotificationTag[];
|
|
36
38
|
}
|
|
37
39
|
export interface PushSubscription {
|
|
38
40
|
endpoint: string;
|
|
@@ -71,6 +71,9 @@ export interface ILocation extends Omit<Document, '_id'>, ILocationComponentBase
|
|
|
71
71
|
currentStock?: number;
|
|
72
72
|
isActive: boolean;
|
|
73
73
|
allowedInventoryTypes?: Types.ObjectId[];
|
|
74
|
+
isVMI?: boolean;
|
|
75
|
+
allowedSuppliers?: Types.ObjectId[];
|
|
76
|
+
transferRestriction?: "bidirectional" | "inbound_only" | "outbound_only";
|
|
74
77
|
}
|
|
75
78
|
export interface ILocationPath {
|
|
76
79
|
locationId: Types.ObjectId;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "truflow",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.192",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
"@hokify/agenda": "^6.3.0",
|
|
13
13
|
"@types/express": "^4.17.17",
|
|
14
14
|
"@types/luxon": "^3.3.0",
|
|
15
|
-
"mongoose": "^7.3.4"
|
|
16
|
-
|
|
15
|
+
"mongoose": "^7.3.4"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"socket.io": "^4.5.1"
|
|
17
19
|
},
|
|
18
20
|
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
|
|
19
21
|
"devDependencies": {
|
|
@@ -21,8 +23,8 @@
|
|
|
21
23
|
"@types/node": "^24.10.1",
|
|
22
24
|
"express": "^5.2.1",
|
|
23
25
|
"luxon": "^3.7.2",
|
|
24
|
-
"mongoose": "^9.
|
|
25
|
-
"socket.io": "^4.
|
|
26
|
+
"mongoose": "^9.1.4",
|
|
27
|
+
"socket.io": "^4.5.1",
|
|
26
28
|
"typescript": "5.3.3"
|
|
27
29
|
}
|
|
28
30
|
}
|
package/src/IAutomation.ts
CHANGED
|
@@ -4,11 +4,13 @@ import mongoose, { Document } from "mongoose";
|
|
|
4
4
|
export type AutomationTriggerType =
|
|
5
5
|
| "order.created" // When a new order is created
|
|
6
6
|
| "order.updated" // When an order is updated
|
|
7
|
-
| "order.
|
|
8
|
-
| "schedule.
|
|
9
|
-
| "schedule.
|
|
7
|
+
| "order.statusChanged" // When order status changes
|
|
8
|
+
| "schedule.entryAdded" // When order matches schedule filters and is added
|
|
9
|
+
| "schedule.fieldChanged" // When a custom schedule field value changes
|
|
10
10
|
| "measurement.added" // When a measurement is added to an order product
|
|
11
|
-
| "measurement.completed"
|
|
11
|
+
| "measurement.completed" // When all measurements are completed for an order
|
|
12
|
+
| "walkthrough.submitted" // When a walkthrough template is submitted
|
|
13
|
+
| "walkthrough.arrived"; // When a walkthrough template is submitted (alias for notifications)
|
|
12
14
|
|
|
13
15
|
// Action types that can be executed
|
|
14
16
|
export type AutomationActionType =
|
|
@@ -95,6 +97,8 @@ export interface IAutomationEmailAction {
|
|
|
95
97
|
body: string; // Email body (can use template variables)
|
|
96
98
|
cc?: string[]; // Optional CC addresses
|
|
97
99
|
bcc?: string[]; // Optional BCC addresses
|
|
100
|
+
useTemplate?: boolean; // Whether to use an email template
|
|
101
|
+
templateId?: string; // ID of the email template to use
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
// Notification action configuration
|
|
@@ -230,6 +234,27 @@ export interface IAutomationContext {
|
|
|
230
234
|
oldValue: any; // Previous value
|
|
231
235
|
newValue: any; // New value
|
|
232
236
|
};
|
|
237
|
+
walkthrough?: {
|
|
238
|
+
id: string; // Submission ID
|
|
239
|
+
templateId: string; // Template ID
|
|
240
|
+
templateName: string; // Template name
|
|
241
|
+
submittedBy: {
|
|
242
|
+
id: string;
|
|
243
|
+
firstName: string;
|
|
244
|
+
lastName: string;
|
|
245
|
+
email?: string;
|
|
246
|
+
};
|
|
247
|
+
submittedAt: string; // ISO date string
|
|
248
|
+
comments?: string; // Optional general comments
|
|
249
|
+
fields: Array<{ // All field values from the submission
|
|
250
|
+
fieldId: string;
|
|
251
|
+
label: string;
|
|
252
|
+
type: "number" | "yesno" | "comment";
|
|
253
|
+
value: any;
|
|
254
|
+
status?: string; // Buffer zone status if applicable
|
|
255
|
+
}>;
|
|
256
|
+
[key: string]: any; // Allow dynamic field access
|
|
257
|
+
};
|
|
233
258
|
triggeredBy?: {
|
|
234
259
|
userId?: string;
|
|
235
260
|
userName?: string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import mongoose, { Document } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface IEmailTemplateVariable {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description: string;
|
|
7
|
+
example?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface ILeanEmailTemplate {
|
|
11
|
+
_id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
triggerType: string; // Single trigger type this template is for (e.g., "walkthrough.submitted", "order.created")
|
|
15
|
+
subject: string;
|
|
16
|
+
bodyHtml: string;
|
|
17
|
+
bodyText?: string; // Optional plain text version
|
|
18
|
+
isDefault: boolean; // Whether this is a system-provided default template
|
|
19
|
+
isEditable: boolean; // Whether users can edit this template
|
|
20
|
+
variables: IEmailTemplateVariable[]; // Available variables for this template
|
|
21
|
+
previewData?: any; // Sample data for preview
|
|
22
|
+
createdAt: Date;
|
|
23
|
+
updatedAt: Date;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type IEmailTemplate = ILeanEmailTemplate & Document;
|
package/src/INotification.ts
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import mongoose, { Document } from "mongoose";
|
|
2
2
|
|
|
3
|
+
export interface INotificationAction {
|
|
4
|
+
label: string;
|
|
5
|
+
type: "navigate" | "modal" | "callback" | "external";
|
|
6
|
+
value: string; // For navigate: path, for modal: modal name, for callback: callback identifier, for external: URL
|
|
7
|
+
data?: Record<string, any>; // Optional data to pass to the action handler
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Standard notification tags for categorizing notifications
|
|
11
|
+
export type NotificationTag =
|
|
12
|
+
| "walkthrough" // Walkthrough reminders and submissions
|
|
13
|
+
| "order_update" // Order status changes, ship date updates
|
|
14
|
+
| "mention" // User @mentions
|
|
15
|
+
| "automation" // Automation notifications
|
|
16
|
+
| "system" // System messages, cache reloads
|
|
17
|
+
| "quality_control" // QC related notifications
|
|
18
|
+
| "inventory" // Inventory alerts
|
|
19
|
+
| "schedule" // Scheduling notifications
|
|
20
|
+
| "general"; // General notifications
|
|
21
|
+
|
|
3
22
|
export type INotification = ILeanNotification & Document;
|
|
4
23
|
export interface ILeanNotification {
|
|
5
24
|
_id: mongoose.Types.ObjectId;
|
|
@@ -8,4 +27,6 @@ export interface ILeanNotification {
|
|
|
8
27
|
read: boolean;
|
|
9
28
|
target: mongoose.Types.ObjectId;
|
|
10
29
|
type: "error" | "warning" | "success" | "info";
|
|
30
|
+
tag: NotificationTag;
|
|
31
|
+
actions?: INotificationAction[];
|
|
11
32
|
}
|
package/src/ISchedule.ts
CHANGED
|
@@ -9,9 +9,38 @@ export interface IScheduleFilterCondition {
|
|
|
9
9
|
value: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
//
|
|
12
|
+
// Enhanced filter condition for view-level filtering
|
|
13
|
+
export interface IViewFilterCondition {
|
|
14
|
+
id?: string; // Unique identifier for the filter condition
|
|
15
|
+
fieldType: "standard" | "customField" | "date" | "attribute"; // Type of field being filtered
|
|
16
|
+
fieldName: string; // Field name (e.g., "status", "shipDate", custom field name, or attribute name)
|
|
17
|
+
operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual" | "in" | "notIn" | "isEmpty" | "isNotEmpty" | "between";
|
|
18
|
+
value?: any; // Filter value(s) - can be string, number, array for "in"/"notIn", or object with {start, end} for "between"
|
|
19
|
+
label?: string; // Display label for the field
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Sort configuration for filters
|
|
23
|
+
export interface IFilterSortCondition {
|
|
24
|
+
fieldType: "standard" | "customField" | "date" | "attribute"; // Type of field being sorted
|
|
25
|
+
fieldName: string; // Field name to sort by
|
|
26
|
+
direction: "asc" | "desc"; // Sort direction
|
|
27
|
+
order: number; // Priority order (lower number = higher priority)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Saved filter configuration
|
|
31
|
+
export interface ISavedViewFilter {
|
|
32
|
+
_id?: mongoose.Types.ObjectId;
|
|
33
|
+
name: string; // Name of the saved filter
|
|
34
|
+
conditions: IViewFilterCondition[]; // Array of filter conditions
|
|
35
|
+
conditionOperator: "and" | "or"; // How to combine conditions
|
|
36
|
+
description?: string; // Optional description
|
|
37
|
+
sortConditions?: IFilterSortCondition[]; // Sort conditions (applied after filtering)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// A filter group - conditions are combined based on conditionOperator
|
|
13
41
|
export interface IScheduleFilterGroup {
|
|
14
42
|
conditions: IScheduleFilterCondition[];
|
|
43
|
+
conditionOperator?: "and" | "or";
|
|
15
44
|
}
|
|
16
45
|
|
|
17
46
|
// Column/Stage configuration for the schedule
|
|
@@ -60,6 +89,12 @@ export interface IScheduleView {
|
|
|
60
89
|
// Product grouping configuration
|
|
61
90
|
groupByMatchingAttributes?: boolean; // Whether to group products with matching filter attributes in the same order
|
|
62
91
|
isDefault?: boolean; // Whether this is the default view
|
|
92
|
+
// Saved filters for this view
|
|
93
|
+
savedFilters?: ISavedViewFilter[];
|
|
94
|
+
// ID of the default filter to apply
|
|
95
|
+
defaultFilterId?: mongoose.Types.ObjectId;
|
|
96
|
+
// Currently active filter (not saved, just for UI state)
|
|
97
|
+
activeFilterId?: mongoose.Types.ObjectId;
|
|
63
98
|
}
|
|
64
99
|
|
|
65
100
|
// Custom field definition for schedule entries
|
|
@@ -82,6 +117,7 @@ export interface ILeanSchedule {
|
|
|
82
117
|
enabled: boolean;
|
|
83
118
|
// Filter configuration - groups are ORed together
|
|
84
119
|
filterGroups: IScheduleFilterGroup[];
|
|
120
|
+
groupOperator: "and" | "or";
|
|
85
121
|
// Column/Stage configuration
|
|
86
122
|
columns: IScheduleColumn[];
|
|
87
123
|
// Views for this schedule
|
|
@@ -93,6 +129,7 @@ export interface ILeanSchedule {
|
|
|
93
129
|
// Legacy fields (kept for backward compatibility, will be migrated to default view)
|
|
94
130
|
displayColumns?: IScheduleDisplayColumn[];
|
|
95
131
|
hidePastShipDates?: boolean;
|
|
132
|
+
hideShippedOrders?: boolean;
|
|
96
133
|
showShipDate?: boolean;
|
|
97
134
|
showStartDate?: boolean;
|
|
98
135
|
defaultSortField?: string;
|
package/src/ISetting.ts
CHANGED
package/src/ISupplier.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import mongoose, { Document } from "mongoose";
|
|
2
2
|
|
|
3
|
+
export interface ISupplierContact {
|
|
4
|
+
_id?: mongoose.Types.ObjectId;
|
|
5
|
+
name: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
phone?: string;
|
|
8
|
+
role?: string;
|
|
9
|
+
notifyOnVMIPurchase?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
3
12
|
export interface ISupplier {
|
|
4
13
|
_id: mongoose.Types.ObjectId;
|
|
5
14
|
name: string;
|
|
6
15
|
code: string;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
phone?: string;
|
|
10
|
-
address?: string;
|
|
11
|
-
contactPerson?: string;
|
|
12
|
-
};
|
|
16
|
+
// Contacts array for multiple contacts
|
|
17
|
+
contacts?: ISupplierContact[];
|
|
13
18
|
notes?: string;
|
|
14
19
|
active: boolean;
|
|
15
20
|
allowedInventoryTypes?: mongoose.Types.ObjectId[];
|
package/src/IUser.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import mongoose, { Document } from "mongoose";
|
|
2
|
+
import { NotificationTag } from "./INotification";
|
|
2
3
|
|
|
3
4
|
export type IUser = ILeanUser & Document;
|
|
4
5
|
|
|
@@ -11,6 +12,7 @@ export interface ILeanUser {
|
|
|
11
12
|
permissions: any[];
|
|
12
13
|
groups: any[];
|
|
13
14
|
pushSubscriptions?: PushSubscription[];
|
|
15
|
+
pushNotificationTags?: NotificationTag[]; // Tags user wants to receive push notifications for
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
export interface PushSubscription {
|
|
@@ -60,6 +60,11 @@ export interface ILocation extends Omit<Document, '_id'>, ILocationComponentBase
|
|
|
60
60
|
isActive: boolean;
|
|
61
61
|
// Array of inventory type IDs that can be stored in this location
|
|
62
62
|
allowedInventoryTypes?: Types.ObjectId[];
|
|
63
|
+
// VMI (Vendor Managed Inventory) configuration
|
|
64
|
+
isVMI?: boolean;
|
|
65
|
+
allowedSuppliers?: Types.ObjectId[]; // Suppliers allowed to manage VMI inventory at this location
|
|
66
|
+
// Transfer restrictions: controls direction of inventory movement
|
|
67
|
+
transferRestriction?: "bidirectional" | "inbound_only" | "outbound_only";
|
|
63
68
|
}
|
|
64
69
|
|
|
65
70
|
export interface ILocationPath {
|
package/src/index.ts
CHANGED
package/tsconfig.json
CHANGED