cardus 0.0.73 → 0.0.75

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
@@ -191,10 +191,10 @@ class IntegrationManager {
191
191
  return __awaiter(this, arguments, void 0, function* ({ user, tempShimpmentIds, countryName }) {
192
192
  const idUsuario = user.id_usuario;
193
193
  const { configurationService, llmAPIService } = this.services;
194
- const insert = (data, tempShimpmentId) => {
194
+ const insert = (data) => {
195
195
  data.forEach((tempContent) => {
196
196
  if (tempContent.contenido) {
197
- this.dataToInsert.contents.push(Object.assign(Object.assign({}, tempContent), { id_envio: tempShimpmentId }));
197
+ this.dataToInsert.contents.push(Object.assign({}, tempContent));
198
198
  }
199
199
  });
200
200
  };
@@ -219,9 +219,11 @@ class IntegrationManager {
219
219
  id_envio: detail.id_envio,
220
220
  id_usuario: idUsuario,
221
221
  contenido: detail.bulto.nombre_producto,
222
- valor: detail.bulto.valor || getRandomContentValue(),
222
+ valor: detail.bulto.precio_producto
223
+ ? parseFloat(detail.bulto.precio_producto)
224
+ : getRandomContentValue(),
223
225
  dni: user.dni,
224
- taric,
226
+ taric: detail.bulto.hs_code || taric,
225
227
  eori_importacion: user.eori_import,
226
228
  eori_exportacion: user.eori_export,
227
229
  peso_bruto: detail.bulto.peso,
@@ -242,11 +244,7 @@ class IntegrationManager {
242
244
  }
243
245
  if (shipmentContent) {
244
246
  shipmentContent = cleanContentData(shipmentContent);
245
- tempShimpmentIds.forEach((tempShimpmentId) => {
246
- if (shipmentContent) {
247
- insert(shipmentContent, tempShimpmentId);
248
- }
249
- });
247
+ insert(shipmentContent);
250
248
  }
251
249
  });
252
250
  }
package/index.ts CHANGED
@@ -263,15 +263,11 @@ export class IntegrationManager {
263
263
  const idUsuario = user.id_usuario as number;
264
264
  const { configurationService, llmAPIService } = this.services;
265
265
 
266
- const insert = (
267
- data: UserDefaultConfigurationContent[],
268
- tempShimpmentId: number
269
- ) => {
266
+ const insert = (data: UserDefaultConfigurationContent[]) => {
270
267
  data.forEach((tempContent) => {
271
268
  if (tempContent.contenido) {
272
269
  this.dataToInsert.contents.push({
273
- ...tempContent,
274
- id_envio: tempShimpmentId
270
+ ...tempContent
275
271
  });
276
272
  }
277
273
  });
@@ -313,9 +309,11 @@ export class IntegrationManager {
313
309
  id_envio: detail.id_envio,
314
310
  id_usuario: idUsuario,
315
311
  contenido: detail.bulto.nombre_producto,
316
- valor: detail.bulto.valor || getRandomContentValue(),
312
+ valor: detail.bulto.precio_producto
313
+ ? parseFloat(detail.bulto.precio_producto)
314
+ : getRandomContentValue(),
317
315
  dni: user.dni,
318
- taric,
316
+ taric: detail.bulto.hs_code || taric,
319
317
  eori_importacion: user.eori_import,
320
318
  eori_exportacion: user.eori_export,
321
319
  peso_bruto: detail.bulto.peso,
@@ -341,11 +339,7 @@ export class IntegrationManager {
341
339
 
342
340
  if (shipmentContent) {
343
341
  shipmentContent = cleanContentData(shipmentContent);
344
- tempShimpmentIds.forEach((tempShimpmentId) => {
345
- if (shipmentContent) {
346
- insert(shipmentContent, tempShimpmentId);
347
- }
348
- });
342
+ insert(shipmentContent);
349
343
  }
350
344
  }
351
345
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cardus",
3
- "version": "0.0.73",
3
+ "version": "0.0.75",
4
4
  "description": "an integration manager",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/types/index.ts CHANGED
@@ -92,6 +92,8 @@ export type Bulto = {
92
92
  url_imagen: string | null;
93
93
  nombre_producto: string | null;
94
94
  valor?: number;
95
+ precio_producto: string | null;
96
+ hs_code: string | null;
95
97
  };
96
98
  cantidad: number;
97
99
  forzarAgrupamientoDeLinea: boolean;