cardus 0.0.32 → 0.0.33

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
@@ -15,6 +15,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.IntegrationManager = void 0;
16
16
  const moment_1 = __importDefault(require("moment"));
17
17
  const insertTempShipment_1 = require("./insertTempShipment");
18
+ const dataToInsert = {
19
+ tempShipment: [],
20
+ lines: [],
21
+ content: [],
22
+ details: [],
23
+ external: [],
24
+ };
18
25
  class IntegrationManager {
19
26
  constructor(params) {
20
27
  this.insertOrder = (_a) => __awaiter(this, [_a], void 0, function* ({ order, agencyId, warehouseId, sellerAddress, idUsuario, group, isPriority }) {
@@ -222,11 +229,12 @@ class IntegrationManager {
222
229
  const arrayFake = Array.from({ length: Number(cantidad) });
223
230
  arrayFake.forEach(() => {
224
231
  if (!estaAgrupado) {
225
- quantityRelatedFunctions.push(integrationsService.insertTempShipmentLines({
232
+ dataToInsert.lines.push({
226
233
  id_envio: idEnvioTemporal,
227
234
  bulto
228
- }));
235
+ });
229
236
  }
237
+ integrationsService.insertTempShipmentMultipleLines(dataToInsert.lines);
230
238
  quantityRelatedFunctions.push(integrationsService.insertTempDetailsShipment({
231
239
  id_envio: idEnvioTemporal,
232
240
  bulto
package/index.ts CHANGED
@@ -22,9 +22,18 @@ import {
22
22
  UserDefaultConfigurationContent,
23
23
  GetAgencyIdForTempShipment,
24
24
  IsPriority,
25
- CustomizationService
25
+ CustomizationService,
26
+ DataToInsert,
26
27
  } from './types';
27
28
 
29
+ const dataToInsert: DataToInsert = {
30
+ tempShipment: [],
31
+ lines: [],
32
+ content: [],
33
+ details: [],
34
+ external: [],
35
+ }
36
+
28
37
  interface Services {
29
38
  integrationsService: IntegrationsService;
30
39
  addressesService: AddressesService;
@@ -384,14 +393,12 @@ export class IntegrationManager {
384
393
 
385
394
  arrayFake.forEach(() => {
386
395
  if (!estaAgrupado) {
387
- quantityRelatedFunctions.push(
388
- integrationsService.insertTempShipmentLines({
389
- id_envio: idEnvioTemporal,
390
-
391
- bulto
392
- })
393
- );
396
+ dataToInsert.lines.push({
397
+ id_envio: idEnvioTemporal,
398
+ bulto
399
+ });
394
400
  }
401
+ integrationsService.insertTempShipmentMultipleLines(dataToInsert.lines);
395
402
 
396
403
  quantityRelatedFunctions.push(
397
404
  integrationsService.insertTempDetailsShipment({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cardus",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "an integration manager",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/types/index.ts CHANGED
@@ -174,6 +174,8 @@ export type IntegrationsService = {
174
174
  bulto: Pick<Bulto['bulto'], 'peso' | 'alto' | 'ancho' | 'largo'>;
175
175
  }) => Promise<undefined>;
176
176
 
177
+ insertTempShipmentMultipleLines: (lines: DataToInsert["lines"]) => number | false;
178
+
177
179
  insertTempDetailsShipment: (params: {
178
180
  id_envio: number;
179
181
  bulto: Bulto['bulto'];
@@ -304,4 +306,15 @@ export type GetAgencyIdForTempShipment = (params: {
304
306
  export type ExecutionManager = {
305
307
  upload(): ExecutionManagerUploadReturn[];
306
308
  new (params: ExecutionManagerConstructorParams): ExecutionManager;
307
- };
309
+ };
310
+
311
+ export type DataToInsert = {
312
+ tempShipment: any[];
313
+ lines: {
314
+ id_envio: number;
315
+ bulto: Pick<Bulto['bulto'], 'peso' | 'alto' | 'ancho' | 'largo'>;
316
+ }[];
317
+ content: any[];
318
+ details: any[];
319
+ external: any[];
320
+ };