truflow 1.3.1 → 1.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API/Allmoxy/IGeneric.d.ts +1 -0
- package/dist/API/Allmoxy/IOrderInventoryItems.d.ts +27 -0
- package/dist/API/Allmoxy/IOrderInventoryItems.js +2 -0
- package/dist/API/Allmoxy/index.d.ts +1 -0
- package/dist/API/Allmoxy/index.js +1 -0
- package/dist/API/IQualityControlNotification.d.ts +0 -24
- package/dist/Helpers/IExporters.d.ts +1 -42
- package/dist/Helpers/ITotals.d.ts +1 -0
- package/dist/Helpers/IZapier/index.d.ts +0 -24
- package/dist/IAllmoxy.d.ts +0 -24
- package/dist/IAutomation.d.ts +25 -26
- package/dist/IBackorder.d.ts +79 -0
- package/dist/IBackorder.js +2 -0
- package/dist/IDailyTotal.d.ts +0 -24
- package/dist/IDepartment.d.ts +0 -24
- package/dist/IDocumentType.d.ts +12 -0
- package/dist/IDocumentType.js +2 -0
- package/dist/IEmailTemplate.d.ts +0 -24
- package/dist/IEvent.d.ts +0 -24
- package/dist/IExporter.d.ts +0 -24
- package/dist/IExpress.d.ts +0 -1
- package/dist/IIntegration.d.ts +28 -24
- package/dist/IInventory.d.ts +0 -24
- package/dist/IJobRole.d.ts +32 -0
- package/dist/IJobRole.js +2 -0
- package/dist/IMailCache.d.ts +1 -24
- package/dist/INotification.d.ts +0 -24
- package/dist/IOrder.d.ts +15 -24
- package/dist/IQualityControl.d.ts +0 -24
- package/dist/IRedo.d.ts +0 -24
- package/dist/ISMTPServerConfig.d.ts +17 -0
- package/dist/ISMTPServerConfig.js +2 -0
- package/dist/ISOP.d.ts +30 -0
- package/dist/ISchedule.d.ts +27 -27
- package/dist/IScript.d.ts +0 -24
- package/dist/ISetting.d.ts +0 -24
- package/dist/IShipment.d.ts +47 -0
- package/dist/IShipment.js +2 -0
- package/dist/ISupplier.d.ts +0 -24
- package/dist/ITrainingMatrix.d.ts +0 -24
- package/dist/IUser.d.ts +12 -24
- package/dist/Inventory/IInventoryTransfer.d.ts +0 -24
- package/dist/Inventory/ILocation.d.ts +0 -24
- package/dist/Inventory/ISelectFieldDefinition.d.ts +0 -24
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/package.json +1 -1
- package/src/API/Allmoxy/IGeneric.ts +1 -0
- package/src/API/Allmoxy/IOrderInventoryItems.ts +28 -0
- package/src/API/Allmoxy/index.ts +1 -0
- package/src/Helpers/IExporters.ts +3 -45
- package/src/Helpers/ITotals.ts +1 -0
- package/src/IAutomation.ts +35 -0
- package/src/IDocumentType.ts +14 -0
- package/src/IIntegration.ts +36 -0
- package/src/IJobRole.ts +36 -0
- package/src/IMailCache.ts +1 -0
- package/src/IOrder.ts +16 -0
- package/src/ISMTPServerConfig.ts +19 -0
- package/src/ISOP.ts +33 -0
- package/src/ISchedule.ts +31 -3
- package/src/IUser.ts +14 -1
- package/src/index.ts +3 -0
package/src/ISchedule.ts
CHANGED
|
@@ -5,7 +5,7 @@ export interface IScheduleFilterCondition {
|
|
|
5
5
|
field: "product" | "attribute";
|
|
6
6
|
productId?: number;
|
|
7
7
|
attributeName?: string;
|
|
8
|
-
operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual";
|
|
8
|
+
operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual" | "exists" | "doesNotExist";
|
|
9
9
|
value: string;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -39,6 +39,7 @@ export interface ISavedViewFilter {
|
|
|
39
39
|
|
|
40
40
|
// A filter group - conditions are combined based on conditionOperator
|
|
41
41
|
export interface IScheduleFilterGroup {
|
|
42
|
+
name?: string; // Optional display name for this filter group (used when combining groups)
|
|
42
43
|
conditions: IScheduleFilterCondition[];
|
|
43
44
|
conditionOperator?: "and" | "or";
|
|
44
45
|
}
|
|
@@ -50,11 +51,12 @@ export interface IScheduleColumn {
|
|
|
50
51
|
machineId: mongoose.Types.ObjectId;
|
|
51
52
|
offsetDays: number; // Days offset from the base date (ship date or start date)
|
|
52
53
|
order: number; // Display order of this column
|
|
54
|
+
disableCondition?: IFieldDisableCondition; // When set, the stage cell is read-only if the condition is met
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
// Display column configuration - controls order and visibility of all columns
|
|
56
58
|
export interface IScheduleDisplayColumn {
|
|
57
|
-
type: "orderNumber" | "company" | "product" | "quantity" | "shipDate" | "startDate" | "status" | "attribute" | "stage" | "customField";
|
|
59
|
+
type: "orderNumber" | "company" | "product" | "quantity" | "shipDate" | "startDate" | "status" | "attribute" | "stage" | "customField" | "shipDateStage";
|
|
58
60
|
stageColumnId?: mongoose.Types.ObjectId; // Reference to the stage column if type is "stage"
|
|
59
61
|
attributeName?: string; // Reference to the attribute if type is "attribute"
|
|
60
62
|
customFieldName?: string; // Reference to the custom field name if type is "customField"
|
|
@@ -64,7 +66,7 @@ export interface IScheduleDisplayColumn {
|
|
|
64
66
|
|
|
65
67
|
// Additional attribute with optional display condition
|
|
66
68
|
export interface IScheduleAdditionalAttribute {
|
|
67
|
-
|
|
69
|
+
attributeNames: string[]; // Array of attribute names - will use the first one with a value
|
|
68
70
|
label?: string; // Optional custom label for display
|
|
69
71
|
// Optional condition - if specified, attribute only displays when condition is met
|
|
70
72
|
displayCondition?: {
|
|
@@ -88,6 +90,8 @@ export interface IScheduleView {
|
|
|
88
90
|
combineAdditionalAttributes?: boolean; // Whether to show all additional attributes in one column (like matched attributes)
|
|
89
91
|
// Product grouping configuration
|
|
90
92
|
groupByMatchingAttributes?: boolean; // Whether to group products with matching filter attributes in the same order
|
|
93
|
+
combineByAttributes?: string[]; // When groupByMatchingAttributes is true, only use these specific attribute names for the grouping key (empty/undefined = use all filter-condition attributes)
|
|
94
|
+
combineFilterGroups?: boolean; // Whether to combine products from different named filter groups into a single row (requires groupByMatchingAttributes and named filter groups)
|
|
91
95
|
isDefault?: boolean; // Whether this is the default view
|
|
92
96
|
// Saved filters for this view
|
|
93
97
|
savedFilters?: ISavedViewFilter[];
|
|
@@ -97,6 +101,15 @@ export interface IScheduleView {
|
|
|
97
101
|
activeFilterId?: mongoose.Types.ObjectId;
|
|
98
102
|
}
|
|
99
103
|
|
|
104
|
+
// Condition that determines when a stage or custom field should be disabled (read-only)
|
|
105
|
+
export interface IFieldDisableCondition {
|
|
106
|
+
fieldType: "attribute" | "customField"; // Where to look for the value
|
|
107
|
+
fieldName: string; // Attribute name or custom field name to evaluate
|
|
108
|
+
operator: "equals" | "notEquals" | "contains" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual" | "isEmpty" | "isNotEmpty";
|
|
109
|
+
value?: string; // Comparison value (not used for isEmpty/isNotEmpty)
|
|
110
|
+
disabledPlaceholder?: string; // Text shown in the cell when the field is disabled (e.g. "No Finish")
|
|
111
|
+
}
|
|
112
|
+
|
|
100
113
|
// Custom field definition for schedule entries
|
|
101
114
|
export interface IScheduleCustomField {
|
|
102
115
|
_id?: mongoose.Types.ObjectId;
|
|
@@ -107,6 +120,7 @@ export interface IScheduleCustomField {
|
|
|
107
120
|
defaultValue?: string | boolean | number; // Default value for new entries
|
|
108
121
|
required?: boolean; // Whether field is required
|
|
109
122
|
order?: number; // Display order
|
|
123
|
+
disableCondition?: IFieldDisableCondition; // When set, the field is read-only if the condition is met
|
|
110
124
|
}
|
|
111
125
|
|
|
112
126
|
// The main Schedule configuration
|
|
@@ -126,12 +140,16 @@ export interface ILeanSchedule {
|
|
|
126
140
|
customFields?: IScheduleCustomField[];
|
|
127
141
|
// Base date field to calculate offsets from
|
|
128
142
|
baseDateField: "shipDate" | "startDate";
|
|
143
|
+
// Completed status configuration
|
|
144
|
+
completedStatuses?: string[];
|
|
145
|
+
hideCompletedOrders?: boolean;
|
|
129
146
|
// Legacy fields (kept for backward compatibility, will be migrated to default view)
|
|
130
147
|
displayColumns?: IScheduleDisplayColumn[];
|
|
131
148
|
hidePastShipDates?: boolean;
|
|
132
149
|
hideShippedOrders?: boolean;
|
|
133
150
|
showShipDate?: boolean;
|
|
134
151
|
showStartDate?: boolean;
|
|
152
|
+
showShipDateStage?: boolean;
|
|
135
153
|
defaultSortField?: string;
|
|
136
154
|
defaultSortDirection?: "asc" | "desc";
|
|
137
155
|
createdAt?: Date;
|
|
@@ -146,6 +164,15 @@ export interface IScheduleEntryDate {
|
|
|
146
164
|
date: string; // ISO date string
|
|
147
165
|
}
|
|
148
166
|
|
|
167
|
+
export interface IScheduleEntryHistory {
|
|
168
|
+
fieldType: "date" | "status" | "customField";
|
|
169
|
+
fieldName: string;
|
|
170
|
+
oldValue?: string | number | boolean | null;
|
|
171
|
+
newValue?: string | number | boolean | null;
|
|
172
|
+
changedAt: Date;
|
|
173
|
+
changedBy?: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
149
176
|
export interface ILeanScheduleEntry {
|
|
150
177
|
_id: mongoose.Types.ObjectId;
|
|
151
178
|
scheduleId: mongoose.Types.ObjectId;
|
|
@@ -155,6 +182,7 @@ export interface ILeanScheduleEntry {
|
|
|
155
182
|
notes?: string;
|
|
156
183
|
status?: string; // Legacy status field
|
|
157
184
|
customStatus?: { [key: string]: any }; // Custom status fields (key-value pairs)
|
|
185
|
+
history?: IScheduleEntryHistory[]; // Audit trail
|
|
158
186
|
createdAt?: Date;
|
|
159
187
|
updatedAt?: Date;
|
|
160
188
|
}
|
package/src/IUser.ts
CHANGED
|
@@ -12,12 +12,19 @@ export interface ILeanUser {
|
|
|
12
12
|
permissions: any[];
|
|
13
13
|
groups: any[];
|
|
14
14
|
pushSubscriptions?: PushSubscription[];
|
|
15
|
+
expoPushTokens?: ExpoPushToken[]; // Expo push tokens for the native mobile app
|
|
15
16
|
pushNotificationTags?: NotificationTag[]; // Tags user wants to receive push notifications for
|
|
16
17
|
// Employee fields
|
|
17
18
|
enableSignin?: boolean; // If true, this person can sign in (user), if false they're employee-only
|
|
18
19
|
position?: string; // Job title/position
|
|
19
|
-
department?: mongoose.Types.ObjectId | string; //
|
|
20
|
+
department?: mongoose.Types.ObjectId | string; // Deprecated — kept for backward compat; use departments[]
|
|
21
|
+
departments?: (mongoose.Types.ObjectId | string)[]; // Department memberships (can belong to multiple)
|
|
20
22
|
employeeId?: string; // Employee ID number (optional)
|
|
23
|
+
startupPage?: string; // Default page to load after login (e.g., "/quality-control")
|
|
24
|
+
jobRoleId?: mongoose.Types.ObjectId | string;
|
|
25
|
+
isOrgRoot?: boolean;
|
|
26
|
+
reportsTo?: mongoose.Types.ObjectId | string; // Direct reporting relationship for org chart
|
|
27
|
+
hideFromOrgChartUnassigned?: boolean; // If true, exclude from org chart unassigned section
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
export interface PushSubscription {
|
|
@@ -29,3 +36,9 @@ export interface PushSubscription {
|
|
|
29
36
|
device?: string;
|
|
30
37
|
createdAt?: Date;
|
|
31
38
|
}
|
|
39
|
+
|
|
40
|
+
export interface ExpoPushToken {
|
|
41
|
+
token: string; // The Expo push token (ExponentPushToken[xxx])
|
|
42
|
+
device?: string; // Optional device label
|
|
43
|
+
createdAt?: Date;
|
|
44
|
+
}
|