test-entity-library-asm 3.5.5 → 3.5.7
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.
|
@@ -19,7 +19,7 @@ export declare class CustomRepository<T extends ObjectLiteral> extends Repositor
|
|
|
19
19
|
totalRecords: number;
|
|
20
20
|
}>;
|
|
21
21
|
getLocalReservesInformationWrapper(params: IPropsLocalReserve): Promise<{
|
|
22
|
-
data:
|
|
22
|
+
data: any[];
|
|
23
23
|
totalRecords: number;
|
|
24
|
-
}
|
|
24
|
+
}>;
|
|
25
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Repository } from "typeorm";
|
|
2
2
|
import { IPropsLocalReserve } from "../interfaces";
|
|
3
3
|
export declare function getLocalReservesInformation(repository: Repository<any>, { globalFilter, date, status, zone, local }: IPropsLocalReserve): Promise<{
|
|
4
|
-
data:
|
|
4
|
+
data: any[];
|
|
5
5
|
totalRecords: number;
|
|
6
|
-
}
|
|
6
|
+
}>;
|
|
@@ -39,37 +39,46 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.getLocalReservesInformation = void 0;
|
|
40
40
|
function getLocalReservesInformation(repository_1, _a) {
|
|
41
41
|
return __awaiter(this, arguments, void 0, function (repository, _b) {
|
|
42
|
-
var queryBuilder, globalValue;
|
|
42
|
+
var queryBuilder, globalValue, _c, discountsCodeUser, totalRecords, error_1;
|
|
43
43
|
var globalFilter = _b.globalFilter, date = _b.date, status = _b.status, zone = _b.zone, local = _b.local;
|
|
44
|
-
return __generator(this, function (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
44
|
+
return __generator(this, function (_d) {
|
|
45
|
+
switch (_d.label) {
|
|
46
|
+
case 0:
|
|
47
|
+
_d.trys.push([0, 2, , 3]);
|
|
48
|
+
queryBuilder = repository.createQueryBuilder("local_reserves");
|
|
49
|
+
if (globalFilter) {
|
|
50
|
+
globalValue = "%".concat(globalFilter.toLowerCase(), "%");
|
|
51
|
+
queryBuilder.andWhere("(LOWER(local_reserves.code) LIKE :globalValue OR local_reserves.user_document LIKE :globalValue OR LOWER(local_reserves.user_name) LIKE :globalValue OR local_reserves.user_phone LIKE :globalValue OR LOWER(local_reserves.user_email) LIKE :globalValue)", { globalValue: globalValue });
|
|
52
|
+
}
|
|
53
|
+
if (date) {
|
|
54
|
+
queryBuilder.andWhere("local_reserves.date = :date", { date: date });
|
|
55
|
+
}
|
|
56
|
+
if (status) {
|
|
57
|
+
queryBuilder.andWhere("local_reserves.status = :status", { status: status });
|
|
58
|
+
}
|
|
59
|
+
if (local) {
|
|
60
|
+
queryBuilder.andWhere("local_reserves.local_table_zone_local = :local", {
|
|
61
|
+
local: local,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (zone) {
|
|
65
|
+
queryBuilder.andWhere("local_reserves.zone = :zone", { zone: zone });
|
|
66
|
+
}
|
|
67
|
+
return [4 /*yield*/, queryBuilder.getManyAndCount()];
|
|
68
|
+
case 1:
|
|
69
|
+
_c = _d.sent(), discountsCodeUser = _c[0], totalRecords = _c[1];
|
|
70
|
+
return [2 /*return*/, {
|
|
71
|
+
data: discountsCodeUser,
|
|
72
|
+
totalRecords: totalRecords,
|
|
73
|
+
}];
|
|
74
|
+
case 2:
|
|
75
|
+
error_1 = _d.sent();
|
|
76
|
+
return [2 /*return*/, {
|
|
77
|
+
data: [],
|
|
78
|
+
totalRecords: 0,
|
|
79
|
+
}];
|
|
80
|
+
case 3: return [2 /*return*/];
|
|
65
81
|
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
return [2 /*return*/, {
|
|
68
|
-
data: [],
|
|
69
|
-
totalRecords: 0,
|
|
70
|
-
}];
|
|
71
|
-
}
|
|
72
|
-
return [2 /*return*/];
|
|
73
82
|
});
|
|
74
83
|
});
|
|
75
84
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ export async function getLocalReservesInformation(
|
|
|
11
11
|
if (globalFilter) {
|
|
12
12
|
const globalValue = `%${globalFilter.toLowerCase()}%`;
|
|
13
13
|
queryBuilder.andWhere(
|
|
14
|
-
"(LOWER(local_reserves.code) LIKE :globalValue OR local_reserves.user_document LIKE :globalValue OR LOWER(local_reserves.user_name) LIKE :globalValue OR local_reserves.user_phone LIKE :globalValue OR LOWER(local_reserves.user_email) LIKE :globalValue",
|
|
14
|
+
"(LOWER(local_reserves.code) LIKE :globalValue OR local_reserves.user_document LIKE :globalValue OR LOWER(local_reserves.user_name) LIKE :globalValue OR local_reserves.user_phone LIKE :globalValue OR LOWER(local_reserves.user_email) LIKE :globalValue)",
|
|
15
15
|
{ globalValue }
|
|
16
16
|
);
|
|
17
17
|
}
|
|
@@ -33,6 +33,15 @@ export async function getLocalReservesInformation(
|
|
|
33
33
|
if (zone) {
|
|
34
34
|
queryBuilder.andWhere("local_reserves.zone = :zone", { zone });
|
|
35
35
|
}
|
|
36
|
+
|
|
37
|
+
// DOC: Ejecutar la consulta
|
|
38
|
+
const [discountsCodeUser, totalRecords] =
|
|
39
|
+
await queryBuilder.getManyAndCount();
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
data: discountsCodeUser,
|
|
43
|
+
totalRecords,
|
|
44
|
+
};
|
|
36
45
|
} catch (error) {
|
|
37
46
|
return {
|
|
38
47
|
data: [],
|