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
@@ -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
- limit: string;
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" | "limits";
98
+ usage: "totals-groups" | "production-lines" | "machines";
72
99
  }
73
100
  export interface ICalculation {
74
101
  action: "add" | "subtract";
@@ -82,6 +109,7 @@ export interface ILeanTotalsGroup extends ILeanSetting {
82
109
  calculations?: ICalculation[];
83
110
  dailyLimit?: number;
84
111
  buffer?: number;
112
+ visibleOnDashboard?: boolean;
85
113
  }
86
114
  export interface ILeanKeyValue extends ILeanSetting {
87
115
  key: string;
@@ -96,3 +124,5 @@ export type IOrderFlag = ILeanOrderFlag & Document;
96
124
  export type ISorting = ILeanSorting & Document;
97
125
  export type ITotalsGroup = ILeanTotalsGroup & Document;
98
126
  export type IKeyValue = ILeanKeyValue & Document;
127
+ export type IProductionLine = ILeanProductionLine & Document;
128
+ export type IMachine = ILeanMachine & Document;
@@ -23,18 +23,22 @@
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
- contactInfo: {
31
- email?: string;
32
- phone?: string;
33
- address?: string;
34
- contactPerson?: string;
35
- };
38
+ contacts?: ISupplierContact[];
36
39
  notes?: string;
37
40
  active: boolean;
41
+ allowedInventoryTypes?: mongoose.Types.ObjectId[];
38
42
  createdAt: Date;
39
43
  updatedAt: Date;
40
44
  }
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;
@@ -0,0 +1,122 @@
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, Types } from "mongoose";
26
+ /**
27
+ * Single item in a bulk transfer
28
+ */
29
+ export interface ITransferItem {
30
+ itemId: Types.ObjectId;
31
+ fromLocation: Types.ObjectId;
32
+ fromLocationPath?: {
33
+ rackId?: Types.ObjectId;
34
+ shelfId?: Types.ObjectId;
35
+ binId?: Types.ObjectId;
36
+ };
37
+ toLocation: Types.ObjectId;
38
+ toLocationPath?: {
39
+ rackId?: Types.ObjectId;
40
+ shelfId?: Types.ObjectId;
41
+ binId?: Types.ObjectId;
42
+ };
43
+ quantity?: number;
44
+ }
45
+ /**
46
+ * Inventory transfer - records movement of inventory between locations
47
+ * Supports both single and bulk transfers
48
+ */
49
+ export interface IInventoryTransfer {
50
+ _id: Types.ObjectId;
51
+ itemId?: Types.ObjectId;
52
+ fromLocation?: Types.ObjectId;
53
+ fromLocationPath?: {
54
+ rackId?: Types.ObjectId;
55
+ shelfId?: Types.ObjectId;
56
+ binId?: Types.ObjectId;
57
+ };
58
+ toLocation?: Types.ObjectId;
59
+ toLocationPath?: {
60
+ rackId?: Types.ObjectId;
61
+ shelfId?: Types.ObjectId;
62
+ binId?: Types.ObjectId;
63
+ };
64
+ quantity?: number;
65
+ items?: ITransferItem[];
66
+ isBulk?: boolean;
67
+ notes?: string;
68
+ status: "pending" | "completed" | "cancelled";
69
+ initiatedBy: Types.ObjectId;
70
+ completedBy?: Types.ObjectId;
71
+ completedAt?: Date;
72
+ createdAt: Date;
73
+ updatedAt: Date;
74
+ }
75
+ export type IInventoryTransferDocument = IInventoryTransfer & Document;
76
+ /**
77
+ * Count session item - tracks counting of a single inventory item
78
+ */
79
+ export interface ICountSessionItem {
80
+ itemId: Types.ObjectId;
81
+ expectedLocation?: Types.ObjectId;
82
+ expectedLocationPath?: {
83
+ rackId?: Types.ObjectId;
84
+ shelfId?: Types.ObjectId;
85
+ binId?: Types.ObjectId;
86
+ };
87
+ actualLocation?: Types.ObjectId;
88
+ actualLocationPath?: {
89
+ rackId?: Types.ObjectId;
90
+ shelfId?: Types.ObjectId;
91
+ binId?: Types.ObjectId;
92
+ };
93
+ expectedQuantity?: number;
94
+ countedQuantity?: number;
95
+ status: "pending" | "counted" | "discrepancy" | "resolved";
96
+ scannedAt?: Date;
97
+ notes?: string;
98
+ }
99
+ /**
100
+ * Inventory counting session - guides users through rack-by-rack counting
101
+ */
102
+ export interface IInventoryCountSession {
103
+ _id: Types.ObjectId;
104
+ name: string;
105
+ locationId: Types.ObjectId;
106
+ racks: Types.ObjectId[];
107
+ shelves?: Types.ObjectId[];
108
+ bins?: Types.ObjectId[];
109
+ currentRackIndex: number;
110
+ currentRackId?: Types.ObjectId;
111
+ items: ICountSessionItem[];
112
+ totalExpectedItems: number;
113
+ status: "not_started" | "in_progress" | "completed" | "cancelled";
114
+ startedBy: Types.ObjectId;
115
+ startedAt?: Date;
116
+ completedBy?: Types.ObjectId;
117
+ completedAt?: Date;
118
+ notes?: string;
119
+ createdAt: Date;
120
+ updatedAt: Date;
121
+ }
122
+ export type IInventoryCountSessionDocument = IInventoryCountSession & Document;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -41,16 +41,21 @@ export interface ILocationComponentBase {
41
41
  export interface IBin extends ILocationComponentBase {
42
42
  capacity?: number;
43
43
  currentStock?: number;
44
+ mergedWith?: Types.ObjectId[];
45
+ mergedInto?: Types.ObjectId;
46
+ allowedInventoryTypes?: Types.ObjectId[];
44
47
  }
45
48
  export interface IShelf extends ILocationComponentBase {
46
49
  bins: IBin[];
47
50
  capacity?: number;
48
51
  currentStock?: number;
52
+ allowedInventoryTypes?: Types.ObjectId[];
49
53
  }
50
54
  export interface IRack extends ILocationComponentBase {
51
55
  shelves: IShelf[];
52
56
  capacity?: number;
53
57
  currentStock?: number;
58
+ allowedInventoryTypes?: Types.ObjectId[];
54
59
  }
55
60
  export interface ILocationMethods {
56
61
  generateUniqueCode(prefix: string): Promise<string>;
@@ -65,6 +70,10 @@ export interface ILocation extends Omit<Document, '_id'>, ILocationComponentBase
65
70
  capacity?: number;
66
71
  currentStock?: number;
67
72
  isActive: boolean;
73
+ allowedInventoryTypes?: Types.ObjectId[];
74
+ isVMI?: boolean;
75
+ allowedSuppliers?: Types.ObjectId[];
76
+ transferRestriction?: "bidirectional" | "inbound_only" | "outbound_only";
68
77
  }
69
78
  export interface ILocationPath {
70
79
  locationId: Types.ObjectId;
@@ -23,41 +23,27 @@
23
23
  /// <reference types="mongoose/types/virtuals" />
24
24
  /// <reference types="mongoose/types/inferschematype" />
25
25
  import { Document, Types } from "mongoose";
26
- export interface IInventoryBase {
27
- name: string;
28
- code: string;
29
- display_order: number;
30
- status: number;
31
- createdBy: string;
32
- createdById: number;
33
- createdDate: Date;
34
- updatedBy: string;
35
- updatedById: number;
36
- updatedDate: Date;
37
- }
38
- export interface IBin extends IInventoryBase {
39
- _id: Types.ObjectId;
40
- capacity?: number;
41
- currentStock?: number;
42
- }
43
- export interface IShelf extends IInventoryBase {
44
- _id: Types.ObjectId;
45
- bins: IBin[];
46
- capacity?: number;
47
- currentStock?: number;
26
+ /**
27
+ * Select field definition option
28
+ */
29
+ export interface ISelectOption {
30
+ key: string;
31
+ value: string;
48
32
  }
49
- export interface IRack extends IInventoryBase {
33
+ /**
34
+ * Source type for select field data
35
+ */
36
+ export type SelectFieldSource = "table";
37
+ /**
38
+ * Select field definition - defines a reusable select field with its options
39
+ */
40
+ export interface ISelectFieldDefinition {
50
41
  _id: Types.ObjectId;
51
- shelves: IShelf[];
52
- capacity?: number;
53
- currentStock?: number;
54
- }
55
- export interface IInventoryLocation extends Document, IInventoryBase {
56
- racks: IRack[];
57
- type: string;
42
+ name: string;
58
43
  description?: string;
59
- capacity?: number;
60
- currentStock?: number;
61
- isActive: boolean;
62
- _id: Types.ObjectId;
44
+ source: SelectFieldSource;
45
+ options: ISelectOption[];
46
+ createdAt: Date;
47
+ updatedAt: Date;
63
48
  }
49
+ export type ISelectFieldDefinitionDocument = ISelectFieldDefinition & Document;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -30,5 +30,9 @@ export * from "./Classes/IRoute";
30
30
  export * from "./IApplication";
31
31
  export * from "./IQualityControl";
32
32
  export * from "./Inventory/ILocation";
33
+ export * from "./Inventory/ISelectFieldDefinition";
34
+ export * from "./Inventory/IInventoryTransfer";
33
35
  export * from "./IInventory";
34
36
  export * from "./ISupplier";
37
+ export * from "./ISchedule";
38
+ export * from "./IAutomation";
package/dist/index.js CHANGED
@@ -46,5 +46,9 @@ __exportStar(require("./Classes/IRoute"), exports);
46
46
  __exportStar(require("./IApplication"), exports);
47
47
  __exportStar(require("./IQualityControl"), exports);
48
48
  __exportStar(require("./Inventory/ILocation"), exports);
49
+ __exportStar(require("./Inventory/ISelectFieldDefinition"), exports);
50
+ __exportStar(require("./Inventory/IInventoryTransfer"), exports);
49
51
  __exportStar(require("./IInventory"), exports);
50
52
  __exportStar(require("./ISupplier"), exports);
53
+ __exportStar(require("./ISchedule"), exports);
54
+ __exportStar(require("./IAutomation"), exports);