truflow 0.0.189 → 0.0.191

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/IContact.d.ts +57 -0
  2. package/dist/Helpers/IOrders/IMoveOrder.d.ts +1 -1
  3. package/dist/Helpers/IZapier/index.d.ts +7 -6
  4. package/dist/IAutomation.d.ts +197 -0
  5. package/dist/IDailyTotal.d.ts +6 -0
  6. package/dist/IExporter.d.ts +1 -0
  7. package/dist/IExpress.d.ts +2 -0
  8. package/dist/IExpress.js +1 -0
  9. package/dist/IInventory.d.ts +35 -0
  10. package/dist/IMailCache.d.ts +13 -0
  11. package/dist/INotification.d.ts +9 -0
  12. package/dist/IOrder.d.ts +1 -1
  13. package/dist/IScannerActivity.d.ts +54 -0
  14. package/dist/IScannerActivity.js +2 -0
  15. package/dist/ISchedule.d.ts +147 -0
  16. package/dist/ISchedule.js +2 -0
  17. package/dist/ISetting.d.ts +32 -2
  18. package/dist/ISupplier.d.ts +10 -6
  19. package/dist/IUser.d.ts +2 -0
  20. package/dist/Inventory/IInventoryTransfer.d.ts +122 -0
  21. package/dist/Inventory/IInventoryTransfer.js +2 -0
  22. package/dist/Inventory/ILocation.d.ts +9 -0
  23. package/dist/{IInventoryLocation.d.ts → Inventory/ISelectFieldDefinition.d.ts} +20 -34
  24. package/dist/Inventory/ISelectFieldDefinition.js +2 -0
  25. package/dist/index.d.ts +4 -0
  26. package/dist/index.js +4 -0
  27. package/package-lock.json +2180 -0
  28. package/package.json +15 -5
  29. package/src/Helpers/IOrders/IMoveOrder.ts +1 -1
  30. package/src/Helpers/IZapier/index.ts +9 -6
  31. package/src/IAutomation.ts +264 -0
  32. package/src/IDailyTotal.ts +7 -0
  33. package/src/IExporter.ts +1 -0
  34. package/src/IExpress.ts +1 -0
  35. package/src/IIntegration.ts +1 -0
  36. package/src/IInventory.ts +38 -0
  37. package/src/IMailCache.ts +14 -0
  38. package/src/INotification.ts +21 -0
  39. package/src/IOrder.ts +1 -1
  40. package/src/ISchedule.ts +162 -0
  41. package/src/ISetting.ts +50 -2
  42. package/src/ISupplier.ts +12 -6
  43. package/src/IUser.ts +2 -0
  44. package/src/Inventory/IInventoryTransfer.ts +108 -0
  45. package/src/Inventory/ILocation.ts +17 -0
  46. package/src/Inventory/ISelectFieldDefinition.ts +29 -0
  47. package/src/index.ts +4 -0
  48. package/tsconfig.json +4 -1
  49. package/dist/ILocation.d.ts +0 -75
  50. /package/dist/{IInventoryLocation.js → API/Allmoxy/IContact.js} +0 -0
  51. /package/dist/{ILocation.js → IAutomation.js} +0 -0
@@ -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
+ }
@@ -4,7 +4,7 @@ export interface IMoveOrderTotalsData {
4
4
  startDate: string;
5
5
  updatedStartDate: string;
6
6
  entries: {
7
- limitsGroup: string;
7
+ productionLine: string;
8
8
  quantity: number;
9
9
  }[];
10
10
  }
@@ -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 { ILimit } from "../../ISetting";
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 IFetchLimits = (type: string) => Promise<ILimit>;
31
- export type ICalculateInitialStartDate = (shipDate: DateTime, limits: ILimit) => Promise<{
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, limitData: ILimit) => Promise<{
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, limits: ILimit) => Promise<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;
@@ -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
  }
@@ -38,4 +38,5 @@ export interface ILeanExporter {
38
38
  csvGenerator?: IHeader[];
39
39
  ignoreEmptyFiles: boolean;
40
40
  firstLineHeaders: boolean;
41
+ enabled: boolean;
41
42
  }
@@ -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
@@ -6,5 +6,6 @@ var IHTTPMethod;
6
6
  IHTTPMethod["GET"] = "get";
7
7
  IHTTPMethod["POST"] = "post";
8
8
  IHTTPMethod["PUT"] = "put";
9
+ IHTTPMethod["PATCH"] = "patch";
9
10
  IHTTPMethod["DELETE"] = "delete";
10
11
  })(IHTTPMethod || (exports.IHTTPMethod = IHTTPMethod = {}));
@@ -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,6 +131,11 @@ 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
  };
@@ -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;
@@ -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
  }
package/dist/IOrder.d.ts CHANGED
@@ -67,7 +67,7 @@ export interface IOrderProduct {
67
67
  _id: string;
68
68
  quantity: number;
69
69
  type: string;
70
- limitsGroup: string;
70
+ productionLine: string;
71
71
  startDate: string;
72
72
  hasStarted: boolean;
73
73
  highlight: boolean;
@@ -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;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,147 @@
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 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
+ }
55
+ export interface IScheduleFilterGroup {
56
+ conditions: IScheduleFilterCondition[];
57
+ conditionOperator?: "and" | "or";
58
+ }
59
+ export interface IScheduleColumn {
60
+ _id?: mongoose.Types.ObjectId;
61
+ name: string;
62
+ machineId: mongoose.Types.ObjectId;
63
+ offsetDays: number;
64
+ order: number;
65
+ }
66
+ export interface IScheduleDisplayColumn {
67
+ type: "orderNumber" | "company" | "product" | "quantity" | "shipDate" | "startDate" | "status" | "attribute" | "stage" | "customField";
68
+ stageColumnId?: mongoose.Types.ObjectId;
69
+ attributeName?: string;
70
+ customFieldName?: string;
71
+ order: number;
72
+ visible: boolean;
73
+ }
74
+ export interface IScheduleAdditionalAttribute {
75
+ attributeName: string;
76
+ label?: string;
77
+ displayCondition?: {
78
+ operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual";
79
+ value: string;
80
+ };
81
+ }
82
+ export interface IScheduleView {
83
+ _id?: mongoose.Types.ObjectId;
84
+ name: string;
85
+ layoutType: "table" | "kanban" | "gantt";
86
+ displayColumns?: IScheduleDisplayColumn[];
87
+ sortField?: string;
88
+ sortDirection?: "asc" | "desc";
89
+ additionalAttributes?: (string | IScheduleAdditionalAttribute)[];
90
+ combineAdditionalAttributes?: boolean;
91
+ groupByMatchingAttributes?: boolean;
92
+ isDefault?: boolean;
93
+ savedFilters?: ISavedViewFilter[];
94
+ defaultFilterId?: mongoose.Types.ObjectId;
95
+ activeFilterId?: mongoose.Types.ObjectId;
96
+ }
97
+ export interface IScheduleCustomField {
98
+ _id?: mongoose.Types.ObjectId;
99
+ name: string;
100
+ label: string;
101
+ fieldType: "boolean" | "select" | "text" | "number";
102
+ options?: string[];
103
+ defaultValue?: string | boolean | number;
104
+ required?: boolean;
105
+ order?: number;
106
+ }
107
+ export interface ILeanSchedule {
108
+ _id: mongoose.Types.ObjectId;
109
+ name: string;
110
+ description?: string;
111
+ enabled: boolean;
112
+ filterGroups: IScheduleFilterGroup[];
113
+ groupOperator: "and" | "or";
114
+ columns: IScheduleColumn[];
115
+ views?: IScheduleView[];
116
+ customFields?: IScheduleCustomField[];
117
+ baseDateField: "shipDate" | "startDate";
118
+ displayColumns?: IScheduleDisplayColumn[];
119
+ hidePastShipDates?: boolean;
120
+ hideShippedOrders?: boolean;
121
+ showShipDate?: boolean;
122
+ showStartDate?: boolean;
123
+ defaultSortField?: string;
124
+ defaultSortDirection?: "asc" | "desc";
125
+ createdAt?: Date;
126
+ updatedAt?: Date;
127
+ }
128
+ export type ISchedule = ILeanSchedule & Document;
129
+ export interface IScheduleEntryDate {
130
+ columnId: mongoose.Types.ObjectId;
131
+ date: string;
132
+ }
133
+ export interface ILeanScheduleEntry {
134
+ _id: mongoose.Types.ObjectId;
135
+ scheduleId: mongoose.Types.ObjectId;
136
+ orderId: number;
137
+ orderProductId: string;
138
+ dates: IScheduleEntryDate[];
139
+ notes?: string;
140
+ status?: string;
141
+ customStatus?: {
142
+ [key: string]: any;
143
+ };
144
+ createdAt?: Date;
145
+ updatedAt?: Date;
146
+ }
147
+ export type IScheduleEntry = ILeanScheduleEntry & Document;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });