cardus 0.0.34 → 0.0.36

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
@@ -56,7 +56,7 @@ class IntegrationManager {
56
56
  countriesService: this.services.countriesService,
57
57
  isPriority
58
58
  });
59
- return yield this.services.integrationsService.insertTempShipment(tempShipmentData);
59
+ return yield this.services.integrationsService.insertTempShipment(tempShipmentData, false);
60
60
  });
61
61
  this.insertExternalShipment = ({ idUsuario, order, idEnvioTemporal }) => {
62
62
  dataToInsert.externals.push({
@@ -118,6 +118,7 @@ class IntegrationManager {
118
118
  type: this.type
119
119
  });
120
120
  const isPriorityByDefault = () => __awaiter(this, void 0, void 0, function* () {
121
+ // TODO sacar esto de aqui, no hay que hacerlo cada vez, con una vale
121
122
  const usuariosGeneiPriority = yield this.services.customizationService.getUsersWithSection(8);
122
123
  const esPotencialmentePriority = usuariosGeneiPriority.some((seccion) => seccion.id_usuario === user.id_usuario ||
123
124
  seccion.tipo_cliente === user.tipo_cliente ||
@@ -135,9 +136,6 @@ class IntegrationManager {
135
136
  const parsedOrder = yield modificarOrdenOriginal({
136
137
  originalOrder: order
137
138
  });
138
- const duplicatedTempShipment = yield integrationsService.checkDuplicateTempShipment(parsedOrder.codigoEnvioExterno, idUsuario);
139
- if (duplicatedTempShipment)
140
- throw new Error('Envio Duplicado');
141
139
  return this.insertOrder({
142
140
  order: parsedOrder,
143
141
  agencyId: yield this.getAgencyIdForTempShipment({
package/index.ts CHANGED
@@ -103,6 +103,7 @@ export class IntegrationManager {
103
103
  });
104
104
 
105
105
  const isPriorityByDefault = async () => {
106
+ // TODO sacar esto de aqui, no hay que hacerlo cada vez, con una vale
106
107
  const usuariosGeneiPriority = await this.services.customizationService.getUsersWithSection(8);
107
108
  const esPotencialmentePriority = usuariosGeneiPriority.some(
108
109
  (seccion: { id_usuario: any; tipo_cliente: any; id_comercial: any; }) =>
@@ -125,12 +126,6 @@ export class IntegrationManager {
125
126
  originalOrder: order
126
127
  });
127
128
 
128
- const duplicatedTempShipment = await integrationsService.checkDuplicateTempShipment(
129
- parsedOrder.codigoEnvioExterno,
130
- idUsuario
131
- );
132
- if (duplicatedTempShipment) throw new Error('Envio Duplicado');
133
-
134
129
  return this.insertOrder({
135
130
  order: parsedOrder,
136
131
  agencyId: await this.getAgencyIdForTempShipment({
@@ -290,7 +285,8 @@ export class IntegrationManager {
290
285
  });
291
286
 
292
287
  return await this.services.integrationsService.insertTempShipment(
293
- tempShipmentData
288
+ tempShipmentData,
289
+ false
294
290
  );
295
291
  };
296
292
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cardus",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
4
4
  "description": "an integration manager",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
package/types/index.ts CHANGED
@@ -153,7 +153,7 @@ export type IntegrationsService = {
153
153
  idUsuario: number
154
154
  ) => Promise<boolean>;
155
155
 
156
- insertTempShipment: (params: Shipment) => number | false;
156
+ insertTempShipment: (params: Shipment, check?: boolean) => number | false;
157
157
 
158
158
  insertExternalShipment: (params: {
159
159
  id_envio_temporal_usuario: number;