cardus 0.0.36 → 0.0.38
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/index.js +5 -4
- package/index.ts +6 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -117,7 +117,7 @@ class IntegrationManager {
|
|
|
117
117
|
orders: allOrders,
|
|
118
118
|
type: this.type
|
|
119
119
|
});
|
|
120
|
-
const
|
|
120
|
+
const checkIsPriorityByDefault = () => __awaiter(this, void 0, void 0, function* () {
|
|
121
121
|
// TODO sacar esto de aqui, no hay que hacerlo cada vez, con una vale
|
|
122
122
|
const usuariosGeneiPriority = yield this.services.customizationService.getUsersWithSection(8);
|
|
123
123
|
const esPotencialmentePriority = usuariosGeneiPriority.some((seccion) => seccion.id_usuario === user.id_usuario ||
|
|
@@ -130,6 +130,7 @@ class IntegrationManager {
|
|
|
130
130
|
return +user.priority_defecto;
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
+
const isPriorityByDefault = yield checkIsPriorityByDefault();
|
|
133
134
|
const insertOrdersResult = yield new this.executionManager({
|
|
134
135
|
arrayParams: allOrders,
|
|
135
136
|
executable: (order) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -148,10 +149,10 @@ class IntegrationManager {
|
|
|
148
149
|
sellerAddress,
|
|
149
150
|
idUsuario,
|
|
150
151
|
group,
|
|
151
|
-
isPriority:
|
|
152
|
+
isPriority: isPriorityByDefault,
|
|
152
153
|
});
|
|
153
154
|
}),
|
|
154
|
-
regularExecutionTime:
|
|
155
|
+
regularExecutionTime: 8000, // ms
|
|
155
156
|
initialBatchQuantity: 5 // de cinco en cinco
|
|
156
157
|
}).upload();
|
|
157
158
|
const successfullShipments = insertOrdersResult
|
|
@@ -186,7 +187,7 @@ class IntegrationManager {
|
|
|
186
187
|
};
|
|
187
188
|
let userConfiguration = null;
|
|
188
189
|
const userSavedData = (yield configurationService.getDefaultProformaConfiguration(idUsuario)) || [];
|
|
189
|
-
if (userSavedData.length
|
|
190
|
+
if (userSavedData.length > 0) {
|
|
190
191
|
userConfiguration = userSavedData;
|
|
191
192
|
}
|
|
192
193
|
else {
|
package/index.ts
CHANGED
|
@@ -102,7 +102,7 @@ export class IntegrationManager {
|
|
|
102
102
|
type: this.type
|
|
103
103
|
});
|
|
104
104
|
|
|
105
|
-
const
|
|
105
|
+
const checkIsPriorityByDefault = async () => {
|
|
106
106
|
// TODO sacar esto de aqui, no hay que hacerlo cada vez, con una vale
|
|
107
107
|
const usuariosGeneiPriority = await this.services.customizationService.getUsersWithSection(8);
|
|
108
108
|
const esPotencialmentePriority = usuariosGeneiPriority.some(
|
|
@@ -119,6 +119,8 @@ export class IntegrationManager {
|
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
+
const isPriorityByDefault = await checkIsPriorityByDefault()
|
|
123
|
+
|
|
122
124
|
const insertOrdersResult = await new this.executionManager({
|
|
123
125
|
arrayParams: allOrders,
|
|
124
126
|
executable: async (order: OriginalOrder) => {
|
|
@@ -138,10 +140,10 @@ export class IntegrationManager {
|
|
|
138
140
|
sellerAddress,
|
|
139
141
|
idUsuario,
|
|
140
142
|
group,
|
|
141
|
-
isPriority:
|
|
143
|
+
isPriority: isPriorityByDefault,
|
|
142
144
|
});
|
|
143
145
|
},
|
|
144
|
-
regularExecutionTime:
|
|
146
|
+
regularExecutionTime: 8000, // ms
|
|
145
147
|
initialBatchQuantity: 5 // de cinco en cinco
|
|
146
148
|
}).upload();
|
|
147
149
|
|
|
@@ -199,7 +201,7 @@ export class IntegrationManager {
|
|
|
199
201
|
(await configurationService.getDefaultProformaConfiguration(
|
|
200
202
|
idUsuario
|
|
201
203
|
)) || [];
|
|
202
|
-
if (userSavedData.length
|
|
204
|
+
if (userSavedData.length > 0){
|
|
203
205
|
userConfiguration = userSavedData;
|
|
204
206
|
}
|
|
205
207
|
else {
|