cardus 0.0.57 → 0.0.59

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 CHANGED
@@ -83,7 +83,7 @@ class IntegrationManager {
83
83
  this.getAgencyIdForTempShipment = params.getAgencyIdForTempShipment;
84
84
  }
85
85
  insertTempShipments(_a) {
86
- return __awaiter(this, arguments, void 0, function* ({ payload: { idUsuario, agencyId, addressId, warehouseId, group }, fetchAllOrders, crearBulto, modificarOrdenOriginal }) {
86
+ return __awaiter(this, arguments, void 0, function* ({ payload: { idUsuario, agencyId, addressId, warehouseId, group, sequentialInsertion = false }, fetchAllOrders, crearBulto, modificarOrdenOriginal }) {
87
87
  const user = yield this.services.usersService.obtenerUsuarioId(idUsuario);
88
88
  const { integrationsService, addressesService } = this.services;
89
89
  // esto hay que pasarlo ya en los parametros
@@ -134,7 +134,7 @@ class IntegrationManager {
134
134
  return Object.assign(parsedOrder, { idEnvioTemporal, agencyId });
135
135
  }),
136
136
  regularExecutionTime: 8000, // ms
137
- initialBatchQuantity: 5 // de cinco en cinco
137
+ initialBatchQuantity: sequentialInsertion ? 1 : 5 // si la insercion no es secuencial, de cinco en cinco
138
138
  }).upload();
139
139
  const successfullShipments = insertOrdersResult
140
140
  .filter(Boolean)
@@ -177,7 +177,11 @@ class IntegrationManager {
177
177
  integrationsService.insertTempShipmentMultipleContents(this.dataToInsert.contents),
178
178
  integrationsService.insertTempShipmentMultipleExternals(this.dataToInsert.externals)
179
179
  ]);
180
- return { filteredOrders, insertedTempShipments: successfullShipments };
180
+ return {
181
+ filteredOrders,
182
+ insertedTempShipments: successfullShipments,
183
+ sequentialInsertion
184
+ };
181
185
  });
182
186
  }
183
187
  insertUserDefaultConfigurationContent(_a) {
@@ -199,7 +203,7 @@ class IntegrationManager {
199
203
  const userFakeData = configurationService.getFakeDefaultProformaConfiguration(idUsuario, user.dni);
200
204
  userConfiguration = userFakeData;
201
205
  }
202
- if (userConfiguration && userConfiguration !== null) {
206
+ if (userConfiguration) {
203
207
  tempShimpmentIds.forEach((tempShimpmentId) => {
204
208
  if (userConfiguration) {
205
209
  insert(userConfiguration, tempShimpmentId);
package/index.ts CHANGED
@@ -88,7 +88,14 @@ export class IntegrationManager {
88
88
  }
89
89
 
90
90
  async insertTempShipments({
91
- payload: { idUsuario, agencyId, addressId, warehouseId, group },
91
+ payload: {
92
+ idUsuario,
93
+ agencyId,
94
+ addressId,
95
+ warehouseId,
96
+ group,
97
+ sequentialInsertion = false
98
+ },
92
99
  fetchAllOrders,
93
100
  crearBulto,
94
101
  modificarOrdenOriginal
@@ -161,7 +168,7 @@ export class IntegrationManager {
161
168
  return Object.assign(parsedOrder, { idEnvioTemporal, agencyId });
162
169
  },
163
170
  regularExecutionTime: 8000, // ms
164
- initialBatchQuantity: 5 // de cinco en cinco
171
+ initialBatchQuantity: sequentialInsertion ? 1 : 5 // si la insercion no es secuencial, de cinco en cinco
165
172
  }).upload();
166
173
 
167
174
  const successfullShipments = insertOrdersResult
@@ -229,7 +236,11 @@ export class IntegrationManager {
229
236
  )
230
237
  ]);
231
238
 
232
- return { filteredOrders, insertedTempShipments: successfullShipments };
239
+ return {
240
+ filteredOrders,
241
+ insertedTempShipments: successfullShipments,
242
+ sequentialInsertion
243
+ };
233
244
  }
234
245
 
235
246
  async insertUserDefaultConfigurationContent({
@@ -268,7 +279,7 @@ export class IntegrationManager {
268
279
  );
269
280
  userConfiguration = userFakeData;
270
281
  }
271
- if (userConfiguration && userConfiguration !== null) {
282
+ if (userConfiguration) {
272
283
  tempShimpmentIds.forEach((tempShimpmentId) => {
273
284
  if (userConfiguration) {
274
285
  insert(userConfiguration, tempShimpmentId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cardus",
3
- "version": "0.0.57",
3
+ "version": "0.0.59",
4
4
  "description": "an integration manager",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/types/index.ts CHANGED
@@ -157,6 +157,7 @@ export interface InsertParams {
157
157
  addressId: number;
158
158
  warehouseId: number;
159
159
  group: Group;
160
+ sequentialInsertion?: boolean;
160
161
  };
161
162
  fetchAllOrders: FetchAllOrders;
162
163
  crearBulto: CrearBulto;