cardus 0.0.114 → 0.0.115
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 +3 -2
- package/index.ts +8 -2
- package/package.json +1 -1
- package/types/index.ts +6 -1
package/dist/index.js
CHANGED
|
@@ -226,7 +226,7 @@ class IntegrationManager {
|
|
|
226
226
|
insertUserDefaultConfigurationContent(_a) {
|
|
227
227
|
return __awaiter(this, arguments, void 0, function* ({ user, countryName, shipmentDetails }) {
|
|
228
228
|
const idUsuario = user.id_usuario;
|
|
229
|
-
const { configurationService, llmAPIService } = this.services;
|
|
229
|
+
const { configurationService, llmAPIService, countriesService } = this.services;
|
|
230
230
|
const insert = (data) => {
|
|
231
231
|
data.forEach((tempContent) => {
|
|
232
232
|
if (tempContent.contenido) {
|
|
@@ -256,6 +256,7 @@ class IntegrationManager {
|
|
|
256
256
|
if (e instanceof Error)
|
|
257
257
|
console.error(e.stack);
|
|
258
258
|
}
|
|
259
|
+
const { nombre_pais_en } = yield countriesService.getCountryFromCountryCode(detail.bulto.origen);
|
|
259
260
|
return {
|
|
260
261
|
id_envio: detail.id_envio,
|
|
261
262
|
id_usuario: idUsuario,
|
|
@@ -269,7 +270,7 @@ class IntegrationManager {
|
|
|
269
270
|
eori_exportacion: user.eori_export,
|
|
270
271
|
peso_bruto: detail.bulto.peso,
|
|
271
272
|
peso_neto: detail.bulto.peso,
|
|
272
|
-
origen: countryName,
|
|
273
|
+
origen: nombre_pais_en || countryName,
|
|
273
274
|
cantidad: detail.cantidad,
|
|
274
275
|
reason_export: '1'
|
|
275
276
|
};
|
package/index.ts
CHANGED
|
@@ -367,7 +367,8 @@ export class IntegrationManager {
|
|
|
367
367
|
shipmentDetails: InsertContentShipmentDetail[];
|
|
368
368
|
}) {
|
|
369
369
|
const idUsuario = user.id_usuario as number;
|
|
370
|
-
const { configurationService, llmAPIService } =
|
|
370
|
+
const { configurationService, llmAPIService, countriesService } =
|
|
371
|
+
this.services;
|
|
371
372
|
|
|
372
373
|
const insert = (data: UserDefaultConfigurationContent[]) => {
|
|
373
374
|
data.forEach((tempContent) => {
|
|
@@ -413,6 +414,11 @@ export class IntegrationManager {
|
|
|
413
414
|
if (e instanceof Error) console.error(e.stack);
|
|
414
415
|
}
|
|
415
416
|
|
|
417
|
+
const { nombre_pais_en } =
|
|
418
|
+
await countriesService.getCountryFromCountryCode(
|
|
419
|
+
detail.bulto.origen
|
|
420
|
+
);
|
|
421
|
+
|
|
416
422
|
return {
|
|
417
423
|
id_envio: detail.id_envio,
|
|
418
424
|
id_usuario: idUsuario,
|
|
@@ -426,7 +432,7 @@ export class IntegrationManager {
|
|
|
426
432
|
eori_exportacion: user.eori_export,
|
|
427
433
|
peso_bruto: detail.bulto.peso,
|
|
428
434
|
peso_neto: detail.bulto.peso,
|
|
429
|
-
origen: countryName,
|
|
435
|
+
origen: nombre_pais_en || countryName,
|
|
430
436
|
cantidad: detail.cantidad,
|
|
431
437
|
reason_export: '1'
|
|
432
438
|
} as UserDefaultConfigurationContent;
|
package/package.json
CHANGED
package/types/index.ts
CHANGED
|
@@ -99,6 +99,7 @@ export type Bulto = {
|
|
|
99
99
|
valor?: number;
|
|
100
100
|
precio_producto: string | null;
|
|
101
101
|
hs_code: string | null;
|
|
102
|
+
origen: string;
|
|
102
103
|
};
|
|
103
104
|
cantidad: number;
|
|
104
105
|
};
|
|
@@ -325,7 +326,11 @@ export type CountriesService = {
|
|
|
325
326
|
|
|
326
327
|
getCountryFromCountryCode: (
|
|
327
328
|
countryCode: string
|
|
328
|
-
) => Promise<{
|
|
329
|
+
) => Promise<{
|
|
330
|
+
nombre_pais: string;
|
|
331
|
+
id_pais?: number;
|
|
332
|
+
nombre_pais_en: string;
|
|
333
|
+
}>;
|
|
329
334
|
|
|
330
335
|
getProvinceByCountryIdAndPostalCode: (
|
|
331
336
|
id_pais: Country['id_pais'],
|