cardus 0.0.14 → 0.0.15
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 +4 -4
- package/index.ts +7 -7
- package/package.json +1 -1
- package/types/index.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -78,7 +78,7 @@ class IntegrationManager {
|
|
|
78
78
|
integrationsService: params.integrationsService,
|
|
79
79
|
addressesService: params.addressesService,
|
|
80
80
|
countriesService: params.countriesService,
|
|
81
|
-
|
|
81
|
+
configurationService: params.configurationService,
|
|
82
82
|
usersService: params.userService
|
|
83
83
|
};
|
|
84
84
|
this.shipmentType = params.shipmentType;
|
|
@@ -140,7 +140,7 @@ class IntegrationManager {
|
|
|
140
140
|
}
|
|
141
141
|
insertUserDefaultConfigurationContent(_a) {
|
|
142
142
|
return __awaiter(this, arguments, void 0, function* ({ idUsuario, tempShimpmentIds }) {
|
|
143
|
-
const { usersService,
|
|
143
|
+
const { usersService, configurationService, integrationsService } = this.services;
|
|
144
144
|
const insert = (data, tempShimpmentId) => __awaiter(this, void 0, void 0, function* () {
|
|
145
145
|
return Promise.allSettled(data.map((tempContent) => __awaiter(this, void 0, void 0, function* () {
|
|
146
146
|
yield integrationsService.insertTempContent(Object.assign(Object.assign({}, tempContent), { id_envio: tempShimpmentId }));
|
|
@@ -149,13 +149,13 @@ class IntegrationManager {
|
|
|
149
149
|
const insertOrdersResult = yield new this.executionManager({
|
|
150
150
|
arrayParams: tempShimpmentIds,
|
|
151
151
|
executable: (order) => __awaiter(this, void 0, void 0, function* () {
|
|
152
|
-
const userSavedData = (yield
|
|
152
|
+
const userSavedData = (yield configurationService.getDefaultProformaConfiguration(idUsuario)) || [];
|
|
153
153
|
if (userSavedData.length > 0) {
|
|
154
154
|
yield insert(userSavedData, order);
|
|
155
155
|
}
|
|
156
156
|
else {
|
|
157
157
|
const user = yield usersService.obtenerUsuarioId(idUsuario);
|
|
158
|
-
const userFakeData =
|
|
158
|
+
const userFakeData = configurationService.getFakeDefaultProformaConfiguration(idUsuario, user.dni);
|
|
159
159
|
yield insert(userFakeData, order);
|
|
160
160
|
}
|
|
161
161
|
}),
|
package/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
InsertParams,
|
|
10
10
|
CountriesService,
|
|
11
11
|
AddressesService,
|
|
12
|
-
|
|
12
|
+
ConfigurationService,
|
|
13
13
|
UsersService,
|
|
14
14
|
IntegrationsService,
|
|
15
15
|
Type,
|
|
@@ -24,7 +24,7 @@ interface Services {
|
|
|
24
24
|
integrationsService: IntegrationsService;
|
|
25
25
|
addressesService: AddressesService;
|
|
26
26
|
countriesService: CountriesService;
|
|
27
|
-
|
|
27
|
+
configurationService: ConfigurationService;
|
|
28
28
|
usersService: UsersService;
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -39,7 +39,7 @@ export class IntegrationManager {
|
|
|
39
39
|
integrationsService: IntegrationsService;
|
|
40
40
|
addressesService: AddressesService;
|
|
41
41
|
countriesService: CountriesService;
|
|
42
|
-
configurationService:
|
|
42
|
+
configurationService: ConfigurationService;
|
|
43
43
|
userService: UsersService;
|
|
44
44
|
type: Type;
|
|
45
45
|
shipmentType: ShipmentType;
|
|
@@ -50,7 +50,7 @@ export class IntegrationManager {
|
|
|
50
50
|
integrationsService: params.integrationsService,
|
|
51
51
|
addressesService: params.addressesService,
|
|
52
52
|
countriesService: params.countriesService,
|
|
53
|
-
|
|
53
|
+
configurationService: params.configurationService,
|
|
54
54
|
usersService: params.userService
|
|
55
55
|
};
|
|
56
56
|
this.shipmentType = params.shipmentType;
|
|
@@ -137,7 +137,7 @@ export class IntegrationManager {
|
|
|
137
137
|
idUsuario: number;
|
|
138
138
|
tempShimpmentIds: number[];
|
|
139
139
|
}) {
|
|
140
|
-
const { usersService,
|
|
140
|
+
const { usersService, configurationService, integrationsService } =
|
|
141
141
|
this.services;
|
|
142
142
|
const insert = async (
|
|
143
143
|
data: UserDefaultConfigurationContent[],
|
|
@@ -156,7 +156,7 @@ export class IntegrationManager {
|
|
|
156
156
|
arrayParams: tempShimpmentIds,
|
|
157
157
|
executable: async (order: any) => {
|
|
158
158
|
const userSavedData =
|
|
159
|
-
(await
|
|
159
|
+
(await configurationService.getDefaultProformaConfiguration(
|
|
160
160
|
idUsuario
|
|
161
161
|
)) || [];
|
|
162
162
|
|
|
@@ -165,7 +165,7 @@ export class IntegrationManager {
|
|
|
165
165
|
} else {
|
|
166
166
|
const user = await usersService.obtenerUsuarioId(idUsuario);
|
|
167
167
|
const userFakeData =
|
|
168
|
-
|
|
168
|
+
configurationService.getFakeDefaultProformaConfiguration(
|
|
169
169
|
idUsuario,
|
|
170
170
|
user.dni
|
|
171
171
|
);
|
package/package.json
CHANGED
package/types/index.ts
CHANGED