cardus 0.0.105 → 0.0.107

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.107",
4
4
  "description": "an integration manager",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/types/index.ts CHANGED
@@ -123,7 +123,7 @@ export type ModifiedOrder = {
123
123
  telefonoLLegada: string | undefined;
124
124
  emailLLegada: string | undefined;
125
125
  cantidadContrareembolso: number | null;
126
- codigoEnvioExterno: string;
126
+ codigoEnvioExterno?: string;
127
127
  idInternoShopify?: string;
128
128
  precio: number | null;
129
129
  fechaCreacionExterna?: string | null;
@@ -468,7 +468,7 @@ export type InsertContentShipmentDetail = {
468
468
 
469
469
  type InsertContentShipmentExternal = {
470
470
  id_envio_temporal_usuario: number;
471
- codigo_envio_externo: string;
471
+ codigo_envio_externo: string | undefined;
472
472
  id_usuario: number;
473
473
  fecha_hora_creacion: string;
474
474
  servicio: Type;