truflow 0.0.188 → 0.0.190
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/Helpers/IOrders/IMoveOrder.d.ts +1 -1
- package/dist/Helpers/IZapier/index.d.ts +7 -6
- package/dist/IAutomation.d.ts +197 -0
- package/dist/IDailyTotal.d.ts +6 -0
- package/dist/IExporter.d.ts +1 -0
- package/dist/IExpress.d.ts +2 -0
- package/dist/IExpress.js +1 -0
- package/dist/IInventory.d.ts +37 -2
- package/dist/IMailCache.d.ts +13 -0
- package/dist/IOrder.d.ts +1 -1
- package/dist/ISchedule.d.ts +119 -0
- package/dist/ISetting.d.ts +31 -2
- package/dist/ISupplier.d.ts +1 -0
- package/dist/Inventory/IInventoryTransfer.d.ts +122 -0
- package/dist/Inventory/IInventoryTransfer.js +2 -0
- package/dist/Inventory/ILocation.d.ts +6 -0
- package/dist/{IInventoryLocation.d.ts → Inventory/ISelectFieldDefinition.d.ts} +20 -34
- package/dist/Inventory/ISelectFieldDefinition.js +2 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/package-lock.json +2180 -0
- package/package.json +13 -4
- package/src/Helpers/IOrders/IMoveOrder.ts +1 -1
- package/src/Helpers/IZapier/index.ts +9 -6
- package/src/IAutomation.ts +264 -0
- package/src/IDailyTotal.ts +7 -0
- package/src/IExporter.ts +1 -0
- package/src/IExpress.ts +1 -0
- package/src/IIntegration.ts +1 -0
- package/src/IInventory.ts +40 -2
- package/src/IMailCache.ts +14 -0
- package/src/IOrder.ts +1 -1
- package/src/ISchedule.ts +125 -0
- package/src/ISetting.ts +49 -2
- package/src/ISupplier.ts +1 -0
- package/src/Inventory/IInventoryTransfer.ts +108 -0
- package/src/Inventory/ILocation.ts +12 -0
- package/src/Inventory/ISelectFieldDefinition.ts +29 -0
- package/src/index.ts +4 -0
- package/dist/ILocation.d.ts +0 -75
- /package/dist/{IInventoryLocation.js → IAutomation.js} +0 -0
- /package/dist/{ILocation.js → ISchedule.js} +0 -0
|
@@ -23,25 +23,26 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import { DateTime } from "luxon";
|
|
26
|
-
import {
|
|
26
|
+
import { IProductionLine } from "../../ISetting";
|
|
27
27
|
import { IZapierOrder } from "../../Routes/IZapierRoutes";
|
|
28
28
|
import { IOrderProduct, IOrder } from "../../IOrder";
|
|
29
29
|
import mongoose from "mongoose";
|
|
30
|
-
export type
|
|
31
|
-
export type
|
|
30
|
+
export type IFetchProductionLines = (type: string) => Promise<IProductionLine>;
|
|
31
|
+
export type IFetchLimits = IFetchProductionLines;
|
|
32
|
+
export type ICalculateInitialStartDate = (shipDate: DateTime, productionLine: IProductionLine) => Promise<{
|
|
32
33
|
startDate: DateTime;
|
|
33
34
|
isHighlighted: boolean;
|
|
34
35
|
}>;
|
|
35
|
-
export type ICheckDailyTotals = (date: string, quantity: number,
|
|
36
|
+
export type ICheckDailyTotals = (date: string, quantity: number, productionLineData: IProductionLine) => Promise<{
|
|
36
37
|
result: boolean;
|
|
37
38
|
exists?: boolean;
|
|
38
39
|
} | boolean>;
|
|
39
|
-
export type ICalculateStartDate = (startDate: DateTime, isHighlighted: boolean) => Promise<{
|
|
40
|
+
export type ICalculateStartDate = (startDate: DateTime, isHighlighted: boolean, productionLineId?: string) => Promise<{
|
|
40
41
|
startDate: DateTime;
|
|
41
42
|
isHighlighted: boolean;
|
|
42
43
|
}>;
|
|
43
44
|
export type ICalculateRPD = (requiredProductionDays: number, requestedShipDate: DateTime) => number;
|
|
44
|
-
export type ICalculateShipDate = (startDate: DateTime,
|
|
45
|
+
export type ICalculateShipDate = (startDate: DateTime, productionLine: IProductionLine) => Promise<DateTime>;
|
|
45
46
|
export type ICalculateStartDates = (summary: string[], data: IZapierOrder) => Promise<{
|
|
46
47
|
entries: IOrderProduct[];
|
|
47
48
|
shipDate?: DateTime;
|
|
@@ -0,0 +1,197 @@
|
|
|
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 type AutomationTriggerType = "order.created" | "order.updated" | "order.status_changed" | "schedule.entry_added" | "schedule.field_changed" | "measurement.added" | "measurement.completed";
|
|
27
|
+
export type AutomationActionType = "webhook" | "email" | "notification" | "sms" | "slack" | "update_field" | "add_note";
|
|
28
|
+
export type AutomationConditionOperator = "equals" | "notEquals" | "contains" | "notContains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual" | "exists" | "notExists" | "in" | "notIn";
|
|
29
|
+
export interface IAutomationCondition {
|
|
30
|
+
field: string;
|
|
31
|
+
operator: AutomationConditionOperator;
|
|
32
|
+
value?: string | number;
|
|
33
|
+
}
|
|
34
|
+
export type AutomationFilterOperator = AutomationConditionOperator;
|
|
35
|
+
export type AutomationFilterLogic = "AND" | "OR";
|
|
36
|
+
export interface IAutomationFilter {
|
|
37
|
+
field: string;
|
|
38
|
+
operator: AutomationFilterOperator;
|
|
39
|
+
value?: any;
|
|
40
|
+
enabled?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface IAutomationFilterGroup {
|
|
43
|
+
logic: AutomationFilterLogic;
|
|
44
|
+
filters: IAutomationFilter[];
|
|
45
|
+
}
|
|
46
|
+
export interface IAutomationFilterEvaluationResult {
|
|
47
|
+
filter: IAutomationFilter;
|
|
48
|
+
matched: boolean;
|
|
49
|
+
actualValue?: any;
|
|
50
|
+
reason?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface IAutomationFiltersEvaluationResult {
|
|
53
|
+
matched: boolean;
|
|
54
|
+
filterResults: IAutomationFilterEvaluationResult[];
|
|
55
|
+
logic: AutomationFilterLogic;
|
|
56
|
+
}
|
|
57
|
+
export interface IAutomationWebhookAction {
|
|
58
|
+
type: "webhook";
|
|
59
|
+
url: string;
|
|
60
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
61
|
+
queryParams?: Record<string, string>;
|
|
62
|
+
headers?: Record<string, string>;
|
|
63
|
+
body?: Record<string, any>;
|
|
64
|
+
}
|
|
65
|
+
export interface IAutomationEmailAction {
|
|
66
|
+
type: "email";
|
|
67
|
+
to: string[];
|
|
68
|
+
subject: string;
|
|
69
|
+
body: string;
|
|
70
|
+
cc?: string[];
|
|
71
|
+
bcc?: string[];
|
|
72
|
+
}
|
|
73
|
+
export interface IAutomationNotificationAction {
|
|
74
|
+
type: "notification";
|
|
75
|
+
userIds: string[];
|
|
76
|
+
title: string;
|
|
77
|
+
message: string;
|
|
78
|
+
notificationType: "info" | "success" | "warning" | "error";
|
|
79
|
+
}
|
|
80
|
+
export interface IAutomationSMSAction {
|
|
81
|
+
type: "sms";
|
|
82
|
+
phoneNumbers: string[];
|
|
83
|
+
message: string;
|
|
84
|
+
}
|
|
85
|
+
export interface IAutomationSlackAction {
|
|
86
|
+
type: "slack";
|
|
87
|
+
channel: string;
|
|
88
|
+
message: string;
|
|
89
|
+
username?: string;
|
|
90
|
+
iconEmoji?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface IAutomationUpdateFieldAction {
|
|
93
|
+
type: "update_field";
|
|
94
|
+
targetType: "order" | "scheduleEntry";
|
|
95
|
+
fieldName: string;
|
|
96
|
+
value: string;
|
|
97
|
+
}
|
|
98
|
+
export interface IAutomationAddNoteAction {
|
|
99
|
+
type: "add_note";
|
|
100
|
+
noteText: string;
|
|
101
|
+
mentionUserIds?: string[];
|
|
102
|
+
}
|
|
103
|
+
export type IAutomationAction = IAutomationWebhookAction | IAutomationEmailAction | IAutomationNotificationAction | IAutomationSMSAction | IAutomationSlackAction | IAutomationUpdateFieldAction | IAutomationAddNoteAction;
|
|
104
|
+
export interface ILeanAutomation {
|
|
105
|
+
_id: mongoose.Types.ObjectId;
|
|
106
|
+
name: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
enabled: boolean;
|
|
109
|
+
triggerType: AutomationTriggerType;
|
|
110
|
+
filters?: IAutomationFilterGroup;
|
|
111
|
+
conditions?: IAutomationCondition[];
|
|
112
|
+
scheduleId?: mongoose.Types.ObjectId;
|
|
113
|
+
actions: IAutomationAction[];
|
|
114
|
+
createdBy?: mongoose.Types.ObjectId;
|
|
115
|
+
lastTriggeredAt?: Date;
|
|
116
|
+
triggerCount?: number;
|
|
117
|
+
createdAt?: Date;
|
|
118
|
+
updatedAt?: Date;
|
|
119
|
+
}
|
|
120
|
+
export type IAutomation = ILeanAutomation & Document;
|
|
121
|
+
export interface IAutomationContext {
|
|
122
|
+
order?: {
|
|
123
|
+
id: number;
|
|
124
|
+
name: string;
|
|
125
|
+
companyName: string;
|
|
126
|
+
status: string;
|
|
127
|
+
shipDate: string;
|
|
128
|
+
orderProducts?: any[];
|
|
129
|
+
[key: string]: any;
|
|
130
|
+
};
|
|
131
|
+
orderProduct?: {
|
|
132
|
+
id: string;
|
|
133
|
+
type: string;
|
|
134
|
+
quantity: number;
|
|
135
|
+
allmoxyData?: {
|
|
136
|
+
productId?: number;
|
|
137
|
+
productAttributes?: Array<{
|
|
138
|
+
attributeName: string;
|
|
139
|
+
value: any;
|
|
140
|
+
}>;
|
|
141
|
+
};
|
|
142
|
+
[key: string]: any;
|
|
143
|
+
};
|
|
144
|
+
measurement?: {
|
|
145
|
+
width: number;
|
|
146
|
+
height: number;
|
|
147
|
+
angle: number;
|
|
148
|
+
outOfSquare: number;
|
|
149
|
+
comments?: string;
|
|
150
|
+
[key: string]: any;
|
|
151
|
+
};
|
|
152
|
+
schedule?: {
|
|
153
|
+
id: string;
|
|
154
|
+
name: string;
|
|
155
|
+
[key: string]: any;
|
|
156
|
+
};
|
|
157
|
+
scheduleEntry?: {
|
|
158
|
+
id: string;
|
|
159
|
+
scheduleId: string;
|
|
160
|
+
orderId: number;
|
|
161
|
+
orderProductId: string;
|
|
162
|
+
customStatus?: {
|
|
163
|
+
[key: string]: any;
|
|
164
|
+
};
|
|
165
|
+
[key: string]: any;
|
|
166
|
+
};
|
|
167
|
+
fieldChange?: {
|
|
168
|
+
fieldName: string;
|
|
169
|
+
oldValue: any;
|
|
170
|
+
newValue: any;
|
|
171
|
+
};
|
|
172
|
+
triggeredBy?: {
|
|
173
|
+
userId?: string;
|
|
174
|
+
userName?: string;
|
|
175
|
+
source?: string;
|
|
176
|
+
};
|
|
177
|
+
[key: string]: any;
|
|
178
|
+
}
|
|
179
|
+
export interface ILeanAutomationLog {
|
|
180
|
+
_id: mongoose.Types.ObjectId;
|
|
181
|
+
automationId: mongoose.Types.ObjectId;
|
|
182
|
+
automationName: string;
|
|
183
|
+
triggerType: AutomationTriggerType;
|
|
184
|
+
status: "success" | "error" | "partial" | "skipped";
|
|
185
|
+
context: IAutomationContext;
|
|
186
|
+
filterEvaluation?: IAutomationFiltersEvaluationResult;
|
|
187
|
+
actionsExecuted: {
|
|
188
|
+
actionType: AutomationActionType;
|
|
189
|
+
status: "success" | "error";
|
|
190
|
+
error?: string;
|
|
191
|
+
details?: any;
|
|
192
|
+
}[];
|
|
193
|
+
error?: string;
|
|
194
|
+
executedAt: Date;
|
|
195
|
+
createdAt?: Date;
|
|
196
|
+
}
|
|
197
|
+
export type IAutomationLog = ILeanAutomationLog & Document;
|
package/dist/IDailyTotal.d.ts
CHANGED
|
@@ -24,8 +24,14 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import { Document } from "mongoose";
|
|
26
26
|
export type IDailyTotal = ILeanDailyTotal & Document;
|
|
27
|
+
export interface ILockedProductionLine {
|
|
28
|
+
productionLineId: string;
|
|
29
|
+
productionLineName: string;
|
|
30
|
+
reason: string;
|
|
31
|
+
}
|
|
27
32
|
export interface ILeanDailyTotal {
|
|
28
33
|
_id: string;
|
|
29
34
|
locked: boolean;
|
|
35
|
+
lockedProductionLines?: ILockedProductionLine[];
|
|
30
36
|
[key: string]: any;
|
|
31
37
|
}
|
package/dist/IExporter.d.ts
CHANGED
package/dist/IExpress.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/// <reference types="cookie-parser" />
|
|
1
2
|
import { Request, Response, NextFunction } from "express";
|
|
2
3
|
export type IRequestHandler = (req: Request, res: Response, next: NextFunction) => void | Promise<any>;
|
|
3
4
|
export declare enum IHTTPMethod {
|
|
4
5
|
GET = "get",
|
|
5
6
|
POST = "post",
|
|
6
7
|
PUT = "put",
|
|
8
|
+
PATCH = "patch",
|
|
7
9
|
DELETE = "delete"
|
|
8
10
|
}
|
package/dist/IExpress.js
CHANGED
package/dist/IInventory.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export interface IField {
|
|
|
30
30
|
type: "number" | "text" | "select" | "calculation" | "tag";
|
|
31
31
|
required?: boolean;
|
|
32
32
|
options?: string[];
|
|
33
|
+
selectFieldDefinitionId?: mongoose.Types.ObjectId;
|
|
33
34
|
default?: any;
|
|
34
35
|
unit?: string;
|
|
35
36
|
validation?: {
|
|
@@ -53,11 +54,32 @@ export interface IInventoryType {
|
|
|
53
54
|
name: string;
|
|
54
55
|
description?: string;
|
|
55
56
|
fields: IField[];
|
|
57
|
+
uniqueIdentifierField?: string;
|
|
56
58
|
defaultLocation?: mongoose.Types.ObjectId;
|
|
57
59
|
tagGenerationEnabled?: boolean;
|
|
58
60
|
enableSupplierField?: boolean;
|
|
61
|
+
supplierRequired?: boolean;
|
|
59
62
|
enableLocationField?: boolean;
|
|
63
|
+
locationRequired?: boolean;
|
|
64
|
+
locationPrecision?: "rack" | "shelf" | "bin";
|
|
65
|
+
requiredLocationLevel?: "rack" | "shelf" | "bin";
|
|
60
66
|
groupingAttributes?: string[];
|
|
67
|
+
quantityField?: string;
|
|
68
|
+
minQuantity?: number;
|
|
69
|
+
maxQuantity?: number;
|
|
70
|
+
minMaxRequired?: boolean;
|
|
71
|
+
liftTagConfig?: {
|
|
72
|
+
enabled: boolean;
|
|
73
|
+
size?: string;
|
|
74
|
+
fieldsToInclude: string[];
|
|
75
|
+
includeBarcode?: boolean;
|
|
76
|
+
showFieldLabels?: boolean;
|
|
77
|
+
identifierFontSize?: number;
|
|
78
|
+
includeCreatedDate?: boolean;
|
|
79
|
+
widthInches?: number;
|
|
80
|
+
heightInches?: number;
|
|
81
|
+
textAlignment?: "left" | "right";
|
|
82
|
+
};
|
|
61
83
|
}
|
|
62
84
|
export interface IHistoryEntry {
|
|
63
85
|
date: Date;
|
|
@@ -70,9 +92,17 @@ export interface IInventoryItem {
|
|
|
70
92
|
_id: string;
|
|
71
93
|
type: string | IInventoryType;
|
|
72
94
|
location?: string | ILocation;
|
|
95
|
+
locationPath?: {
|
|
96
|
+
rackId?: mongoose.Types.ObjectId;
|
|
97
|
+
shelfId?: mongoose.Types.ObjectId;
|
|
98
|
+
binId?: mongoose.Types.ObjectId;
|
|
99
|
+
};
|
|
73
100
|
fields: Map<string, any>;
|
|
74
|
-
|
|
101
|
+
tag: string;
|
|
75
102
|
history: IHistoryEntry[];
|
|
103
|
+
minQuantity?: number;
|
|
104
|
+
maxQuantity?: number;
|
|
105
|
+
currentQuantity?: number;
|
|
76
106
|
createdAt: Date;
|
|
77
107
|
updatedAt: Date;
|
|
78
108
|
}
|
|
@@ -101,10 +131,15 @@ export interface IInventoryItemResponse {
|
|
|
101
131
|
name: string;
|
|
102
132
|
[key: string]: any;
|
|
103
133
|
};
|
|
134
|
+
locationPath?: {
|
|
135
|
+
rackId?: mongoose.Types.ObjectId;
|
|
136
|
+
shelfId?: mongoose.Types.ObjectId;
|
|
137
|
+
binId?: mongoose.Types.ObjectId;
|
|
138
|
+
};
|
|
104
139
|
fields: {
|
|
105
140
|
[key: string]: any;
|
|
106
141
|
};
|
|
107
|
-
|
|
142
|
+
tag: string;
|
|
108
143
|
history: {
|
|
109
144
|
date: Date;
|
|
110
145
|
action: string;
|
package/dist/IMailCache.d.ts
CHANGED
|
@@ -32,9 +32,22 @@ export interface ILeanMailCache {
|
|
|
32
32
|
state: string;
|
|
33
33
|
logs: string[];
|
|
34
34
|
exporterID: string;
|
|
35
|
+
pdfAttachments?: IPDFAttachment[];
|
|
35
36
|
}
|
|
36
37
|
export interface IAttachment {
|
|
37
38
|
fileName: string;
|
|
38
39
|
content: string;
|
|
40
|
+
contentType?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface IPDFAttachment {
|
|
43
|
+
_id?: mongoose.Types.ObjectId;
|
|
44
|
+
fileName: string;
|
|
45
|
+
fileSize: number;
|
|
46
|
+
contentType: string;
|
|
47
|
+
uploadedAt: Date;
|
|
48
|
+
uploadedBy?: string;
|
|
49
|
+
storagePath?: string;
|
|
50
|
+
gridFSId?: mongoose.Types.ObjectId;
|
|
51
|
+
orderNumber?: number;
|
|
39
52
|
}
|
|
40
53
|
export type IMailCache = ILeanMailCache & Document;
|
package/dist/IOrder.d.ts
CHANGED
|
@@ -0,0 +1,119 @@
|
|
|
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 IScheduleFilterCondition {
|
|
27
|
+
field: "product" | "attribute";
|
|
28
|
+
productId?: number;
|
|
29
|
+
attributeName?: string;
|
|
30
|
+
operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual";
|
|
31
|
+
value: string;
|
|
32
|
+
}
|
|
33
|
+
export interface IScheduleFilterGroup {
|
|
34
|
+
conditions: IScheduleFilterCondition[];
|
|
35
|
+
}
|
|
36
|
+
export interface IScheduleColumn {
|
|
37
|
+
_id?: mongoose.Types.ObjectId;
|
|
38
|
+
name: string;
|
|
39
|
+
machineId: mongoose.Types.ObjectId;
|
|
40
|
+
offsetDays: number;
|
|
41
|
+
order: number;
|
|
42
|
+
}
|
|
43
|
+
export interface IScheduleDisplayColumn {
|
|
44
|
+
type: "orderNumber" | "company" | "product" | "quantity" | "shipDate" | "startDate" | "status" | "attribute" | "stage" | "customField";
|
|
45
|
+
stageColumnId?: mongoose.Types.ObjectId;
|
|
46
|
+
attributeName?: string;
|
|
47
|
+
customFieldName?: string;
|
|
48
|
+
order: number;
|
|
49
|
+
visible: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface IScheduleAdditionalAttribute {
|
|
52
|
+
attributeName: string;
|
|
53
|
+
label?: string;
|
|
54
|
+
displayCondition?: {
|
|
55
|
+
operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual";
|
|
56
|
+
value: string;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export interface IScheduleView {
|
|
60
|
+
_id?: mongoose.Types.ObjectId;
|
|
61
|
+
name: string;
|
|
62
|
+
layoutType: "table" | "kanban" | "gantt";
|
|
63
|
+
displayColumns?: IScheduleDisplayColumn[];
|
|
64
|
+
sortField?: string;
|
|
65
|
+
sortDirection?: "asc" | "desc";
|
|
66
|
+
additionalAttributes?: (string | IScheduleAdditionalAttribute)[];
|
|
67
|
+
combineAdditionalAttributes?: boolean;
|
|
68
|
+
groupByMatchingAttributes?: boolean;
|
|
69
|
+
isDefault?: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface IScheduleCustomField {
|
|
72
|
+
_id?: mongoose.Types.ObjectId;
|
|
73
|
+
name: string;
|
|
74
|
+
label: string;
|
|
75
|
+
fieldType: "boolean" | "select" | "text" | "number";
|
|
76
|
+
options?: string[];
|
|
77
|
+
defaultValue?: string | boolean | number;
|
|
78
|
+
required?: boolean;
|
|
79
|
+
order?: number;
|
|
80
|
+
}
|
|
81
|
+
export interface ILeanSchedule {
|
|
82
|
+
_id: mongoose.Types.ObjectId;
|
|
83
|
+
name: string;
|
|
84
|
+
description?: string;
|
|
85
|
+
enabled: boolean;
|
|
86
|
+
filterGroups: IScheduleFilterGroup[];
|
|
87
|
+
columns: IScheduleColumn[];
|
|
88
|
+
views?: IScheduleView[];
|
|
89
|
+
customFields?: IScheduleCustomField[];
|
|
90
|
+
baseDateField: "shipDate" | "startDate";
|
|
91
|
+
displayColumns?: IScheduleDisplayColumn[];
|
|
92
|
+
hidePastShipDates?: boolean;
|
|
93
|
+
showShipDate?: boolean;
|
|
94
|
+
showStartDate?: boolean;
|
|
95
|
+
defaultSortField?: string;
|
|
96
|
+
defaultSortDirection?: "asc" | "desc";
|
|
97
|
+
createdAt?: Date;
|
|
98
|
+
updatedAt?: Date;
|
|
99
|
+
}
|
|
100
|
+
export type ISchedule = ILeanSchedule & Document;
|
|
101
|
+
export interface IScheduleEntryDate {
|
|
102
|
+
columnId: mongoose.Types.ObjectId;
|
|
103
|
+
date: string;
|
|
104
|
+
}
|
|
105
|
+
export interface ILeanScheduleEntry {
|
|
106
|
+
_id: mongoose.Types.ObjectId;
|
|
107
|
+
scheduleId: mongoose.Types.ObjectId;
|
|
108
|
+
orderId: number;
|
|
109
|
+
orderProductId: string;
|
|
110
|
+
dates: IScheduleEntryDate[];
|
|
111
|
+
notes?: string;
|
|
112
|
+
status?: string;
|
|
113
|
+
customStatus?: {
|
|
114
|
+
[key: string]: any;
|
|
115
|
+
};
|
|
116
|
+
createdAt?: Date;
|
|
117
|
+
updatedAt?: Date;
|
|
118
|
+
}
|
|
119
|
+
export type IScheduleEntry = ILeanScheduleEntry & Document;
|
package/dist/ISetting.d.ts
CHANGED
|
@@ -44,20 +44,47 @@ export interface ILeanHoliday extends ILeanSetting {
|
|
|
44
44
|
recurring?: boolean;
|
|
45
45
|
recurs?: string;
|
|
46
46
|
}
|
|
47
|
+
export type AttributeFilterOperator = "equals" | "notEquals" | "contains" | "notContains" | "startsWith" | "endsWith";
|
|
48
|
+
export interface IAttributeFilter {
|
|
49
|
+
attributeName: string;
|
|
50
|
+
operator?: AttributeFilterOperator;
|
|
51
|
+
value: any;
|
|
52
|
+
}
|
|
47
53
|
export interface ILeanLimit extends ILeanSetting {
|
|
48
54
|
name: string;
|
|
49
55
|
rpd: string;
|
|
50
|
-
|
|
56
|
+
capacity: string;
|
|
51
57
|
enabled: boolean;
|
|
52
58
|
products?: [
|
|
53
59
|
{
|
|
54
60
|
name: string;
|
|
61
|
+
allmoxyProductId?: number;
|
|
55
62
|
sheetGroupingAttribute?: string;
|
|
56
63
|
grainedProduct?: boolean;
|
|
57
64
|
grainedProductAttribute?: string;
|
|
65
|
+
attributeFilters?: IAttributeFilter[];
|
|
66
|
+
priority?: number;
|
|
58
67
|
}
|
|
59
68
|
];
|
|
60
69
|
nestable?: boolean;
|
|
70
|
+
visibleOnDashboard?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface IMachinePathStep {
|
|
73
|
+
machine: mongoose.Types.ObjectId;
|
|
74
|
+
offsetDays: number;
|
|
75
|
+
_id?: mongoose.Types.ObjectId;
|
|
76
|
+
}
|
|
77
|
+
export interface ILeanProductionLine extends ILeanLimit {
|
|
78
|
+
machinePath?: IMachinePathStep[];
|
|
79
|
+
}
|
|
80
|
+
export interface ILeanMachine extends ILeanSetting {
|
|
81
|
+
name: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
type: "machine" | "station";
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
dailyCapacity?: number;
|
|
86
|
+
location?: string;
|
|
87
|
+
visibleOnDashboard?: boolean;
|
|
61
88
|
}
|
|
62
89
|
export interface ILeanOrderFlag extends ILeanSetting {
|
|
63
90
|
name: string;
|
|
@@ -68,7 +95,7 @@ export interface ILeanOrderFlag extends ILeanSetting {
|
|
|
68
95
|
export interface ILeanSorting extends ILeanSetting {
|
|
69
96
|
headerList?: string[];
|
|
70
97
|
itemList: string[];
|
|
71
|
-
usage: "totals-groups" | "
|
|
98
|
+
usage: "totals-groups" | "production-lines" | "machines";
|
|
72
99
|
}
|
|
73
100
|
export interface ICalculation {
|
|
74
101
|
action: "add" | "subtract";
|
|
@@ -96,3 +123,5 @@ export type IOrderFlag = ILeanOrderFlag & Document;
|
|
|
96
123
|
export type ISorting = ILeanSorting & Document;
|
|
97
124
|
export type ITotalsGroup = ILeanTotalsGroup & Document;
|
|
98
125
|
export type IKeyValue = ILeanKeyValue & Document;
|
|
126
|
+
export type IProductionLine = ILeanProductionLine & Document;
|
|
127
|
+
export type IMachine = ILeanMachine & Document;
|