cardus 0.0.72 → 0.0.74

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,9 +191,11 @@ 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
- this.dataToInsert.contents.push(Object.assign(Object.assign({}, tempContent), { id_envio: tempShimpmentId }));
196
+ if (tempContent.contenido) {
197
+ this.dataToInsert.contents.push(Object.assign({}, tempContent));
198
+ }
197
199
  });
198
200
  };
199
201
  // Limpia los contenidos para eliminar valores no deseados
@@ -214,6 +216,7 @@ class IntegrationManager {
214
216
  ? yield llmAPIService.getTaricCode('chatgpt', detail.bulto.nombre_producto)
215
217
  : null;
216
218
  return {
219
+ id_envio: detail.id_envio,
217
220
  id_usuario: idUsuario,
218
221
  contenido: detail.bulto.nombre_producto,
219
222
  valor: detail.bulto.valor || getRandomContentValue(),
@@ -239,11 +242,7 @@ class IntegrationManager {
239
242
  }
240
243
  if (shipmentContent) {
241
244
  shipmentContent = cleanContentData(shipmentContent);
242
- tempShimpmentIds.forEach((tempShimpmentId) => {
243
- if (shipmentContent) {
244
- insert(shipmentContent, tempShimpmentId);
245
- }
246
- });
245
+ insert(shipmentContent);
247
246
  }
248
247
  });
249
248
  }
package/index.ts CHANGED
@@ -263,15 +263,13 @@ 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
- this.dataToInsert.contents.push({
272
- ...tempContent,
273
- id_envio: tempShimpmentId
274
- });
268
+ if (tempContent.contenido) {
269
+ this.dataToInsert.contents.push({
270
+ ...tempContent
271
+ });
272
+ }
275
273
  });
276
274
  };
277
275
 
@@ -308,6 +306,7 @@ export class IntegrationManager {
308
306
  : null;
309
307
 
310
308
  return {
309
+ id_envio: detail.id_envio,
311
310
  id_usuario: idUsuario,
312
311
  contenido: detail.bulto.nombre_producto,
313
312
  valor: detail.bulto.valor || getRandomContentValue(),
@@ -338,11 +337,7 @@ export class IntegrationManager {
338
337
 
339
338
  if (shipmentContent) {
340
339
  shipmentContent = cleanContentData(shipmentContent);
341
- tempShimpmentIds.forEach((tempShimpmentId) => {
342
- if (shipmentContent) {
343
- insert(shipmentContent, tempShimpmentId);
344
- }
345
- });
340
+ insert(shipmentContent);
346
341
  }
347
342
  }
348
343
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cardus",
3
- "version": "0.0.72",
3
+ "version": "0.0.74",
4
4
  "description": "an integration manager",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/types/index.ts CHANGED
@@ -295,6 +295,7 @@ export type CountriesService = {
295
295
  };
296
296
 
297
297
  export type UserDefaultConfigurationContent = {
298
+ id_envio: number;
298
299
  id_usuario: number;
299
300
  contenido: string;
300
301
  valor: number;