emilsoftware-utilities 1.6.0 → 1.6.1-dev.1
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/accessi-module/AccessiModule.js +16 -3
- package/dist/accessi-module/Dtos/FiltriUtente.d.ts +5 -0
- package/dist/accessi-module/Dtos/FiltriUtente.js +8 -0
- package/dist/accessi-module/Services/FiltriService/FiltriService.js +1 -1
- package/dist/accessi-module/Services/UserService/UserService.js +16 -0
- package/dist/emilsoftware-utilities-1.6.1-dev.1.tgz +0 -0
- package/package.json +4 -4
- package/dist/emilsoftware-utilities-1.6.0.tgz +0 -0
|
@@ -32,9 +32,16 @@ let AccessiModule = AccessiModule_1 = class AccessiModule {
|
|
|
32
32
|
UserService_1.UserService,
|
|
33
33
|
EmailService_1.EmailService,
|
|
34
34
|
PermissionService_1.PermissionService,
|
|
35
|
-
FiltriService_1.FiltriService
|
|
35
|
+
FiltriService_1.FiltriService,
|
|
36
|
+
],
|
|
37
|
+
exports: [
|
|
38
|
+
'ACCESSI_OPTIONS',
|
|
39
|
+
AuthService_1.AuthService,
|
|
40
|
+
UserService_1.UserService,
|
|
41
|
+
EmailService_1.EmailService,
|
|
42
|
+
PermissionService_1.PermissionService,
|
|
43
|
+
FiltriService_1.FiltriService,
|
|
36
44
|
],
|
|
37
|
-
exports: ['ACCESSI_OPTIONS', AuthService_1.AuthService, UserService_1.UserService, EmailService_1.EmailService, PermissionService_1.PermissionService, FiltriService_1.FiltriService],
|
|
38
45
|
};
|
|
39
46
|
}
|
|
40
47
|
};
|
|
@@ -42,7 +49,13 @@ exports.AccessiModule = AccessiModule;
|
|
|
42
49
|
exports.AccessiModule = AccessiModule = AccessiModule_1 = __decorate([
|
|
43
50
|
(0, common_1.Global)(),
|
|
44
51
|
(0, common_1.Module)({
|
|
45
|
-
controllers: [
|
|
52
|
+
controllers: [
|
|
53
|
+
EmailController_1.EmailController,
|
|
54
|
+
AuthController_1.AuthController,
|
|
55
|
+
PermissionController_1.PermissionController,
|
|
56
|
+
UserController_1.UserController,
|
|
57
|
+
FiltriController_1.FiltriController,
|
|
58
|
+
],
|
|
46
59
|
providers: [AuthService_1.AuthService, UserService_1.UserService, EmailService_1.EmailService, PermissionService_1.PermissionService, FiltriService_1.FiltriService],
|
|
47
60
|
exports: [AuthService_1.AuthService, UserService_1.UserService, EmailService_1.EmailService, PermissionService_1.PermissionService, FiltriService_1.FiltriService],
|
|
48
61
|
})
|
|
@@ -11,6 +11,7 @@ export declare class FiltriUtente {
|
|
|
11
11
|
tipFil?: number;
|
|
12
12
|
idxPos?: number;
|
|
13
13
|
codDip?: number;
|
|
14
|
+
codVet?: number;
|
|
14
15
|
}
|
|
15
16
|
export declare class GetFiltriUtenteResponse extends BaseResponse {
|
|
16
17
|
Result: FiltriUtente[];
|
|
@@ -59,4 +60,8 @@ export declare const FILTRI_UTENTE_DB_MAPPING: {
|
|
|
59
60
|
readonly dbField: "CODDIP";
|
|
60
61
|
readonly numeric: true;
|
|
61
62
|
};
|
|
63
|
+
readonly codVet: {
|
|
64
|
+
readonly dbField: "CODVET";
|
|
65
|
+
readonly numeric: true;
|
|
66
|
+
};
|
|
62
67
|
};
|
|
@@ -112,6 +112,13 @@ __decorate([
|
|
|
112
112
|
(0, class_validator_1.IsOptional)(),
|
|
113
113
|
__metadata("design:type", Number)
|
|
114
114
|
], FiltriUtente.prototype, "codDip", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, swagger_1.ApiPropertyOptional)({
|
|
117
|
+
description: 'Codice del vettore',
|
|
118
|
+
example: 12
|
|
119
|
+
}),
|
|
120
|
+
__metadata("design:type", Number)
|
|
121
|
+
], FiltriUtente.prototype, "codVet", void 0);
|
|
115
122
|
class GetFiltriUtenteResponse extends BaseResponse_1.BaseResponse {
|
|
116
123
|
}
|
|
117
124
|
exports.GetFiltriUtenteResponse = GetFiltriUtenteResponse;
|
|
@@ -143,4 +150,5 @@ exports.FILTRI_UTENTE_DB_MAPPING = {
|
|
|
143
150
|
tipFil: { dbField: 'TIPFIL', numeric: true },
|
|
144
151
|
idxPos: { dbField: 'IDXPOS', numeric: true },
|
|
145
152
|
codDip: { dbField: 'CODDIP', numeric: true },
|
|
153
|
+
codVet: { dbField: 'CODVET', numeric: true },
|
|
146
154
|
};
|
|
@@ -52,7 +52,7 @@ let FiltriService = FiltriService_1 = class FiltriService {
|
|
|
52
52
|
try {
|
|
53
53
|
let params = [];
|
|
54
54
|
let getQuery = `SELECT CODUTE AS COD_UTE, PROG AS PROGRESSIVO, NUMREP AS NUM_REP, IDXPERS AS IDX_PERS, CODCLISUPER AS COD_CLI_SUPER, CODAGE AS COD_AGE, CODCLICOL AS COD_CLI_COL,
|
|
55
|
-
CODCLIENTI AS COD_CLIENTI, TIPFIL AS TIP_FIL, CODDIP AS COD_DIP, IDXPOS AS IDX_POS FROM FILTRI `;
|
|
55
|
+
CODCLIENTI AS COD_CLIENTI, TIPFIL AS TIP_FIL, CODDIP AS COD_DIP, IDXPOS AS IDX_POS, CODVET AS COD_VET FROM FILTRI `;
|
|
56
56
|
if (codUte === undefined) {
|
|
57
57
|
this.logger.log('Nessun utente passato, recupero i filtri di tutti gli utenti...');
|
|
58
58
|
}
|
|
@@ -28,6 +28,7 @@ const Orm_1 = require("../../../Orm");
|
|
|
28
28
|
const Utilities_1 = require("../../../Utilities");
|
|
29
29
|
const StatoRegistrazione_1 = require("../../Dtos/StatoRegistrazione");
|
|
30
30
|
const EmailService_1 = require("../EmailService/EmailService");
|
|
31
|
+
const FiltriUtente_1 = require("../../Dtos/FiltriUtente");
|
|
31
32
|
const PermissionService_1 = require("../PermissionService/PermissionService");
|
|
32
33
|
const FiltriService_1 = require("../FiltriService/FiltriService");
|
|
33
34
|
let UserService = class UserService {
|
|
@@ -130,6 +131,7 @@ let UserService = class UserService {
|
|
|
130
131
|
}
|
|
131
132
|
getUserByEmail(email) {
|
|
132
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
var _a;
|
|
133
135
|
const query = `
|
|
134
136
|
SELECT
|
|
135
137
|
U.CODUTE AS codice_utente,
|
|
@@ -151,6 +153,20 @@ let UserService = class UserService {
|
|
|
151
153
|
WHERE LOWER(U.USRNAME) = ?
|
|
152
154
|
`;
|
|
153
155
|
const utenti = (yield Orm_1.Orm.query(this.accessiOptions.databaseOptions, query, [email]).then((results) => results.map(Utilities_1.RestUtilities.convertKeysToCamelCase)));
|
|
156
|
+
const filtriUtente = yield this.filtriService.getFiltriUser((_a = utenti[0]) === null || _a === void 0 ? void 0 : _a.codiceUtente);
|
|
157
|
+
if (utenti.length <= 0) {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
if (utenti.length > 0 && filtriUtente.length > 0) {
|
|
161
|
+
const user = utenti[0];
|
|
162
|
+
const filtro = filtriUtente[0];
|
|
163
|
+
// Type-safe mapping using type assertion
|
|
164
|
+
Object.entries(FiltriUtente_1.FILTRI_UTENTE_DB_MAPPING).forEach(([key]) => {
|
|
165
|
+
if (key in filtro) {
|
|
166
|
+
user[key] = filtro[key];
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
154
170
|
return utenti.length > 0 ? utenti[0] : null;
|
|
155
171
|
});
|
|
156
172
|
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emilsoftware-utilities",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1-dev.1",
|
|
4
4
|
"description": "Utilities for EmilSoftware",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/
|
|
21
|
+
"url": "git+https://github.com/Emil-Software/emilsoftware-utilities.git"
|
|
22
22
|
},
|
|
23
23
|
"author": "",
|
|
24
24
|
"license": "ISC",
|
|
25
25
|
"bugs": {
|
|
26
|
-
"url": "https://github.com/
|
|
26
|
+
"url": "https://github.com/Emil-Software/emilsoftware-utilities/issues"
|
|
27
27
|
},
|
|
28
|
-
"homepage": "https://github.com/
|
|
28
|
+
"homepage": "https://github.com/Emil-Software/emilsoftware-utilities#readme",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@nestjs/common": "^11.0.11",
|
|
31
31
|
"@nestjs/core": "^11.0.11",
|
|
Binary file
|