cardus 0.0.105 → 0.0.106

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
@@ -362,6 +362,7 @@ class IntegrationManager {
362
362
  })))).filter(Boolean);
363
363
  // sacamos todos los bultos (y cantidad)
364
364
  yield Promise.allSettled(bultosYCantidades.map((bultoYCantidad) => __awaiter(this, void 0, void 0, function* () {
365
+ var _d;
365
366
  if (!bultoYCantidad)
366
367
  return;
367
368
  const { bulto, cantidad, idEnvioTemporal, forzarAgrupamientoDeLinea } = bultoYCantidad;
@@ -415,7 +416,15 @@ class IntegrationManager {
415
416
  }));
416
417
  tempShipmentLines.push(...linesToAdd);
417
418
  }
418
- this.dataToInsert.lines.set(idEnvioTemporal, tempShipmentLines);
419
+ if (this.dataToInsert.lines.has(idEnvioTemporal)) {
420
+ this.dataToInsert.lines.set(idEnvioTemporal, [
421
+ ...((_d = this.dataToInsert.lines.get(idEnvioTemporal)) !== null && _d !== void 0 ? _d : []),
422
+ ...tempShipmentLines
423
+ ]);
424
+ }
425
+ else {
426
+ this.dataToInsert.lines.set(idEnvioTemporal, tempShipmentLines);
427
+ }
419
428
  }
420
429
  })));
421
430
  return { shipmentDetails, bultosYCantidades };
package/index.ts CHANGED
@@ -655,8 +655,14 @@ export class IntegrationManager {
655
655
 
656
656
  tempShipmentLines.push(...linesToAdd);
657
657
  }
658
-
659
- this.dataToInsert.lines.set(idEnvioTemporal, tempShipmentLines);
658
+ if (this.dataToInsert.lines.has(idEnvioTemporal)) {
659
+ this.dataToInsert.lines.set(idEnvioTemporal, [
660
+ ...(this.dataToInsert.lines.get(idEnvioTemporal) ?? []),
661
+ ...tempShipmentLines
662
+ ]);
663
+ } else {
664
+ this.dataToInsert.lines.set(idEnvioTemporal, tempShipmentLines);
665
+ }
660
666
  }
661
667
  })
662
668
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cardus",
3
- "version": "0.0.105",
3
+ "version": "0.0.106",
4
4
  "description": "an integration manager",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",