test-entity-library-asm 2.6.10 → 2.6.11

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.
Files changed (37) hide show
  1. package/dist/entities/Company.d.ts +1 -3
  2. package/dist/entities/Company.js +4 -22
  3. package/dist/entities/Local.d.ts +2 -1
  4. package/dist/entities/Local.js +5 -1
  5. package/dist/entities/LocalPlan.d.ts +16 -0
  6. package/dist/entities/LocalPlan.js +123 -0
  7. package/dist/entities/Master.d.ts +1 -3
  8. package/dist/entities/Master.js +4 -9
  9. package/dist/entities/Permission.d.ts +9 -9
  10. package/dist/entities/Permission.js +63 -63
  11. package/dist/entities/Plan.d.ts +4 -4
  12. package/dist/entities/Plan.js +13 -17
  13. package/dist/entities/Role.d.ts +12 -12
  14. package/dist/entities/Role.js +81 -81
  15. package/dist/entities/RoleVisibleTo.d.ts +6 -6
  16. package/dist/entities/RoleVisibleTo.js +47 -47
  17. package/dist/entities/ScheduleCategory.d.ts +9 -9
  18. package/dist/entities/ScheduleCategory.js +48 -48
  19. package/dist/entities/TypeFood.d.ts +8 -8
  20. package/dist/entities/TypeFood.js +68 -68
  21. package/dist/entities.views.routes.d.ts +1 -0
  22. package/dist/entities.views.routes.js +4 -1
  23. package/dist/middlewares/timezoneMiddleware.d.ts +3 -3
  24. package/dist/middlewares/timezoneMiddleware.js +22 -22
  25. package/dist/repositories/VerifyLocalRepository.d.ts +4 -4
  26. package/dist/repositories/VerifyLocalRepository.js +142 -142
  27. package/dist/transformations.d.ts +4 -4
  28. package/dist/transformations.js +16 -16
  29. package/dist/views/UserInformation.d.ts +39 -39
  30. package/dist/views/UserInformation.js +187 -187
  31. package/package.json +1 -1
  32. package/src/entities/Company.ts +3 -21
  33. package/src/entities/Local.ts +9 -5
  34. package/src/entities/LocalPlan.ts +101 -0
  35. package/src/entities/Master.ts +4 -8
  36. package/src/entities/Plan.ts +12 -17
  37. package/src/entities.views.routes.ts +1 -0
@@ -1,4 +1,4 @@
1
- import { DataSource, EntityTarget, Repository, ObjectLiteral } from 'typeorm';
2
- export declare const createCustomRepository: <T extends ObjectLiteral>(entity: EntityTarget<T>, dataSource: DataSource) => Repository<T> & {
3
- getVerifyLocals: Function;
4
- };
1
+ import { DataSource, EntityTarget, Repository, ObjectLiteral } from 'typeorm';
2
+ export declare const createCustomRepository: <T extends ObjectLiteral>(entity: EntityTarget<T>, dataSource: DataSource) => Repository<T> & {
3
+ getVerifyLocals: Function;
4
+ };
@@ -1,142 +1,142 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.createCustomRepository = void 0;
55
- var typeorm_1 = require("typeorm");
56
- var CustomRepository = /** @class */ (function (_super) {
57
- __extends(CustomRepository, _super);
58
- function CustomRepository() {
59
- return _super !== null && _super.apply(this, arguments) || this;
60
- }
61
- CustomRepository.prototype.getVerifyLocals = function (status, page, pageSize, filters) {
62
- return __awaiter(this, void 0, void 0, function () {
63
- var queryBuilder, globalValue, _a, data, total;
64
- return __generator(this, function (_b) {
65
- switch (_b.label) {
66
- case 0:
67
- queryBuilder = this.createQueryBuilder('verifyLocal')
68
- .skip((page - 1) * pageSize)
69
- .take(pageSize);
70
- // Filtro por estado si está definido
71
- if (status !== null && status >= 0) {
72
- queryBuilder.andWhere('verifyLocal.status = :status', { status: status });
73
- }
74
- // Filtro global que busca en múltiples campos
75
- if (filters['global'] && filters['global'].value) {
76
- globalValue = "%".concat(filters['global'].value, "%");
77
- queryBuilder.andWhere('(JSON_EXTRACT(verifyLocal.local_information, "$.name") LIKE :globalValue ' +
78
- 'OR JSON_EXTRACT(verifyLocal.local_information, "$.square.address") LIKE :globalValue ' +
79
- 'OR JSON_EXTRACT(verifyLocal.local_information, "$.address.formatted_address") LIKE :globalValue ' +
80
- 'OR verifyLocal.status LIKE :globalValue)', { globalValue: globalValue });
81
- }
82
- // Filtros específicos de columnas
83
- Object.keys(filters).forEach(function (key) {
84
- var _a, _b, _c, _d;
85
- if (key !== 'global' && filters[key].constraints) {
86
- var filter = filters[key];
87
- var value = filter.constraints[0].value;
88
- var matchMode = filter.constraints[0].matchMode;
89
- if (value !== null) {
90
- var jsonPath = key
91
- .split('.')
92
- .map(function (segment) { return "$.".concat(segment); })
93
- .join('');
94
- switch (matchMode) {
95
- case 'startsWith':
96
- queryBuilder.andWhere("JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") LIKE :").concat(key), (_a = {},
97
- _a[key] = "".concat(value, "%"),
98
- _a));
99
- break;
100
- case 'contains':
101
- queryBuilder.andWhere("JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") LIKE :").concat(key), (_b = {},
102
- _b[key] = "%".concat(value, "%"),
103
- _b));
104
- break;
105
- case 'equals':
106
- queryBuilder.andWhere("JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") = :").concat(key), (_c = {},
107
- _c[key] = value,
108
- _c));
109
- break;
110
- case 'dateIs':
111
- queryBuilder.andWhere("DATE(JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\")) = :").concat(key), (_d = {},
112
- _d[key] = value,
113
- _d));
114
- break;
115
- // Agregar otros modos de coincidencia según sea necesario
116
- default:
117
- break;
118
- }
119
- }
120
- }
121
- });
122
- return [4 /*yield*/, queryBuilder.getManyAndCount()];
123
- case 1:
124
- _a = _b.sent(), data = _a[0], total = _a[1];
125
- return [2 /*return*/, {
126
- data: data,
127
- total: total,
128
- page: page,
129
- pageSize: pageSize,
130
- totalPages: Math.ceil(total / pageSize),
131
- }];
132
- }
133
- });
134
- });
135
- };
136
- return CustomRepository;
137
- }(typeorm_1.Repository));
138
- var createCustomRepository = function (entity, dataSource) {
139
- var baseRepository = dataSource.getRepository(entity);
140
- return baseRepository.extend(CustomRepository.prototype);
141
- };
142
- exports.createCustomRepository = createCustomRepository;
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.createCustomRepository = void 0;
55
+ var typeorm_1 = require("typeorm");
56
+ var CustomRepository = /** @class */ (function (_super) {
57
+ __extends(CustomRepository, _super);
58
+ function CustomRepository() {
59
+ return _super !== null && _super.apply(this, arguments) || this;
60
+ }
61
+ CustomRepository.prototype.getVerifyLocals = function (status, page, pageSize, filters) {
62
+ return __awaiter(this, void 0, void 0, function () {
63
+ var queryBuilder, globalValue, _a, data, total;
64
+ return __generator(this, function (_b) {
65
+ switch (_b.label) {
66
+ case 0:
67
+ queryBuilder = this.createQueryBuilder('verifyLocal')
68
+ .skip((page - 1) * pageSize)
69
+ .take(pageSize);
70
+ // Filtro por estado si está definido
71
+ if (status !== null && status >= 0) {
72
+ queryBuilder.andWhere('verifyLocal.status = :status', { status: status });
73
+ }
74
+ // Filtro global que busca en múltiples campos
75
+ if (filters['global'] && filters['global'].value) {
76
+ globalValue = "%".concat(filters['global'].value, "%");
77
+ queryBuilder.andWhere('(JSON_EXTRACT(verifyLocal.local_information, "$.name") LIKE :globalValue ' +
78
+ 'OR JSON_EXTRACT(verifyLocal.local_information, "$.square.address") LIKE :globalValue ' +
79
+ 'OR JSON_EXTRACT(verifyLocal.local_information, "$.address.formatted_address") LIKE :globalValue ' +
80
+ 'OR verifyLocal.status LIKE :globalValue)', { globalValue: globalValue });
81
+ }
82
+ // Filtros específicos de columnas
83
+ Object.keys(filters).forEach(function (key) {
84
+ var _a, _b, _c, _d;
85
+ if (key !== 'global' && filters[key].constraints) {
86
+ var filter = filters[key];
87
+ var value = filter.constraints[0].value;
88
+ var matchMode = filter.constraints[0].matchMode;
89
+ if (value !== null) {
90
+ var jsonPath = key
91
+ .split('.')
92
+ .map(function (segment) { return "$.".concat(segment); })
93
+ .join('');
94
+ switch (matchMode) {
95
+ case 'startsWith':
96
+ queryBuilder.andWhere("JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") LIKE :").concat(key), (_a = {},
97
+ _a[key] = "".concat(value, "%"),
98
+ _a));
99
+ break;
100
+ case 'contains':
101
+ queryBuilder.andWhere("JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") LIKE :").concat(key), (_b = {},
102
+ _b[key] = "%".concat(value, "%"),
103
+ _b));
104
+ break;
105
+ case 'equals':
106
+ queryBuilder.andWhere("JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") = :").concat(key), (_c = {},
107
+ _c[key] = value,
108
+ _c));
109
+ break;
110
+ case 'dateIs':
111
+ queryBuilder.andWhere("DATE(JSON_EXTRACT(verifyLocal.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\")) = :").concat(key), (_d = {},
112
+ _d[key] = value,
113
+ _d));
114
+ break;
115
+ // Agregar otros modos de coincidencia según sea necesario
116
+ default:
117
+ break;
118
+ }
119
+ }
120
+ }
121
+ });
122
+ return [4 /*yield*/, queryBuilder.getManyAndCount()];
123
+ case 1:
124
+ _a = _b.sent(), data = _a[0], total = _a[1];
125
+ return [2 /*return*/, {
126
+ data: data,
127
+ total: total,
128
+ page: page,
129
+ pageSize: pageSize,
130
+ totalPages: Math.ceil(total / pageSize),
131
+ }];
132
+ }
133
+ });
134
+ });
135
+ };
136
+ return CustomRepository;
137
+ }(typeorm_1.Repository));
138
+ var createCustomRepository = function (entity, dataSource) {
139
+ var baseRepository = dataSource.getRepository(entity);
140
+ return baseRepository.extend(CustomRepository.prototype);
141
+ };
142
+ exports.createCustomRepository = createCustomRepository;
@@ -1,4 +1,4 @@
1
- export declare const jsonTransformer: {
2
- to: (value: any) => string;
3
- from: (value: string) => any;
4
- };
1
+ export declare const jsonTransformer: {
2
+ to: (value: any) => string;
3
+ from: (value: string) => any;
4
+ };
@@ -1,16 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsonTransformer = void 0;
4
- // DOCUMENTATION: Variable creada para poder transformar los elementos a tipo objeto a los que están en la base de datos como strings que son objetos.
5
- exports.jsonTransformer = {
6
- to: function (value) { return JSON.stringify(value); },
7
- from: function (value) {
8
- try {
9
- return JSON.parse(value);
10
- }
11
- catch (error) {
12
- console.error('Error parsing JSON:', error);
13
- return null;
14
- }
15
- },
16
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jsonTransformer = void 0;
4
+ // DOCUMENTATION: Variable creada para poder transformar los elementos a tipo objeto a los que están en la base de datos como strings que son objetos.
5
+ exports.jsonTransformer = {
6
+ to: function (value) { return JSON.stringify(value); },
7
+ from: function (value) {
8
+ try {
9
+ return JSON.parse(value);
10
+ }
11
+ catch (error) {
12
+ console.error('Error parsing JSON:', error);
13
+ return null;
14
+ }
15
+ },
16
+ };
@@ -1,39 +1,39 @@
1
- export declare class UserInformation {
2
- id: number;
3
- company: number;
4
- code: string;
5
- document: string;
6
- name: string;
7
- surname: string;
8
- email: string;
9
- phone: string;
10
- city: number;
11
- address: string;
12
- password: string;
13
- profile: any;
14
- owner: number;
15
- created: string;
16
- updated: string;
17
- status: number;
18
- visible: number;
19
- region: number;
20
- name_city: string;
21
- status_city: number;
22
- code_company: string;
23
- name_company: string;
24
- city_company: number;
25
- partner: number;
26
- profile_company: any;
27
- quantity_locals: number;
28
- quantity_users: number;
29
- legal_information: any;
30
- legal_agent: any;
31
- plan: number;
32
- created_company: string;
33
- expiration_company: string;
34
- updated_company: string;
35
- status_company: number;
36
- locals_asigned: any;
37
- roles_asigned: any;
38
- terminals_asigned: any;
39
- }
1
+ export declare class UserInformation {
2
+ id: number;
3
+ company: number;
4
+ code: string;
5
+ document: string;
6
+ name: string;
7
+ surname: string;
8
+ email: string;
9
+ phone: string;
10
+ city: number;
11
+ address: string;
12
+ password: string;
13
+ profile: any;
14
+ owner: number;
15
+ created: string;
16
+ updated: string;
17
+ status: number;
18
+ visible: number;
19
+ region: number;
20
+ name_city: string;
21
+ status_city: number;
22
+ code_company: string;
23
+ name_company: string;
24
+ city_company: number;
25
+ partner: number;
26
+ profile_company: any;
27
+ quantity_locals: number;
28
+ quantity_users: number;
29
+ legal_information: any;
30
+ legal_agent: any;
31
+ plan: number;
32
+ created_company: string;
33
+ expiration_company: string;
34
+ updated_company: string;
35
+ status_company: number;
36
+ locals_asigned: any;
37
+ roles_asigned: any;
38
+ terminals_asigned: any;
39
+ }