cardus 0.0.87 → 0.0.88
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 +6 -3
- package/index.ts +8 -3
- package/package.json +1 -1
- package/types/index.ts +4 -3
package/dist/index.js
CHANGED
|
@@ -265,7 +265,7 @@ class IntegrationManager {
|
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
createJsonQuantityReferencesFromLines(_a) {
|
|
268
|
-
return __awaiter(this, arguments, void 0, function* ({ warehouseId, bultosYCantidades }) {
|
|
268
|
+
return __awaiter(this, arguments, void 0, function* ({ idUsuario, warehouseId, bultosYCantidades }) {
|
|
269
269
|
try {
|
|
270
270
|
if (warehouseId) {
|
|
271
271
|
const json_referencias_cantidades = (yield Promise.all(bultosYCantidades.map((each) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -273,8 +273,10 @@ class IntegrationManager {
|
|
|
273
273
|
const sku = each === null || each === void 0 ? void 0 : each.bulto.sku_producto;
|
|
274
274
|
if (!cantidad || !sku)
|
|
275
275
|
return [];
|
|
276
|
-
const
|
|
277
|
-
|
|
276
|
+
const reference = yield this.services.warehouseService.getProductReferenceFromSku({
|
|
277
|
+
idUsuario,
|
|
278
|
+
sku
|
|
279
|
+
});
|
|
278
280
|
if (!(reference === null || reference === void 0 ? void 0 : reference.id)) {
|
|
279
281
|
throw new Error('no existe sku para referencia');
|
|
280
282
|
}
|
|
@@ -344,6 +346,7 @@ class IntegrationManager {
|
|
|
344
346
|
}, {});
|
|
345
347
|
yield Promise.all(Object.entries(bultosYCantidadesGroupedByShipment).map((_c) => __awaiter(this, [_c], void 0, function* ([tempShipmentId, bultosYCantidades]) {
|
|
346
348
|
const json_referencias_cantidades = yield this.createJsonQuantityReferencesFromLines({
|
|
349
|
+
idUsuario,
|
|
347
350
|
warehouseId,
|
|
348
351
|
bultosYCantidades
|
|
349
352
|
});
|
package/index.ts
CHANGED
|
@@ -447,9 +447,11 @@ export class IntegrationManager {
|
|
|
447
447
|
};
|
|
448
448
|
|
|
449
449
|
async createJsonQuantityReferencesFromLines({
|
|
450
|
+
idUsuario,
|
|
450
451
|
warehouseId,
|
|
451
452
|
bultosYCantidades
|
|
452
453
|
}: {
|
|
454
|
+
idUsuario: number;
|
|
453
455
|
warehouseId: number;
|
|
454
456
|
bultosYCantidades: BultoYCantidad[];
|
|
455
457
|
}): Promise<JsonReferenciasCantidades | []> {
|
|
@@ -463,11 +465,13 @@ export class IntegrationManager {
|
|
|
463
465
|
|
|
464
466
|
if (!cantidad || !sku) return [];
|
|
465
467
|
|
|
466
|
-
const
|
|
468
|
+
const reference =
|
|
467
469
|
await this.services.warehouseService.getProductReferenceFromSku(
|
|
468
|
-
|
|
470
|
+
{
|
|
471
|
+
idUsuario,
|
|
472
|
+
sku
|
|
473
|
+
}
|
|
469
474
|
);
|
|
470
|
-
const reference = references?.[0];
|
|
471
475
|
|
|
472
476
|
if (!reference?.id) {
|
|
473
477
|
throw new Error('no existe sku para referencia');
|
|
@@ -573,6 +577,7 @@ export class IntegrationManager {
|
|
|
573
577
|
async ([tempShipmentId, bultosYCantidades]) => {
|
|
574
578
|
const json_referencias_cantidades =
|
|
575
579
|
await this.createJsonQuantityReferencesFromLines({
|
|
580
|
+
idUsuario,
|
|
576
581
|
warehouseId,
|
|
577
582
|
bultosYCantidades
|
|
578
583
|
});
|
package/package.json
CHANGED
package/types/index.ts
CHANGED
|
@@ -264,9 +264,10 @@ export type LlmAPIService = {
|
|
|
264
264
|
};
|
|
265
265
|
|
|
266
266
|
export type WarehouseService = {
|
|
267
|
-
getProductReferenceFromSku: (
|
|
268
|
-
|
|
269
|
-
|
|
267
|
+
getProductReferenceFromSku: (params: {
|
|
268
|
+
idUsuario: number;
|
|
269
|
+
sku: string;
|
|
270
|
+
}) => Promise<{ id: number; sku: string }>;
|
|
270
271
|
};
|
|
271
272
|
|
|
272
273
|
export type JsonReferenciasCantidades = Array<{
|