test-entity-library-asm 2.3.5 → 2.3.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.
@@ -1,12 +1,10 @@
1
1
  import { DataSource, EntityTarget, Repository, ObjectLiteral } from 'typeorm';
2
+ import { IPropsQueryVerifyLocal } from './interfaces';
2
3
  export declare class CustomRepository<T extends ObjectLiteral> extends Repository<T> {
3
4
  constructor(target: EntityTarget<T>, dataSource: DataSource);
4
- getVerifyLocals2(status: number | null, page: number, pageSize: number, filters: any): Promise<{
5
+ getVerifyLocals({ status, lazyEvent }: IPropsQueryVerifyLocal): Promise<{
5
6
  data: T[];
6
- total: number;
7
- page: number;
8
- pageSize: number;
9
- totalPages: number;
7
+ totalRecords: number;
10
8
  }>;
11
9
  anyOtherRepository(args: any): Promise<void>;
12
10
  }
@@ -53,61 +53,89 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
53
53
  Object.defineProperty(exports, "__esModule", { value: true });
54
54
  exports.CustomRepository = void 0;
55
55
  var typeorm_1 = require("typeorm");
56
+ var utils_1 = require("./utils");
56
57
  var CustomRepository = /** @class */ (function (_super) {
57
58
  __extends(CustomRepository, _super);
58
59
  function CustomRepository(target, dataSource) {
59
60
  return _super.call(this, target, dataSource.manager) || this;
60
61
  }
61
- CustomRepository.prototype.getVerifyLocals2 = 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) {
62
+ CustomRepository.prototype.getVerifyLocals = function (_a) {
63
+ return __awaiter(this, arguments, void 0, function (_b) {
64
+ var queryBuilder, globalValue, filters, order, jsonPath, _c, data, total;
65
+ var status = _b.status, lazyEvent = _b.lazyEvent;
66
+ return __generator(this, function (_d) {
67
+ switch (_d.label) {
66
68
  case 0:
67
- queryBuilder = this.createQueryBuilder('entity')
68
- .skip((page - 1) * pageSize)
69
- .take(pageSize);
70
- if (status !== null && status >= 0) {
71
- queryBuilder.andWhere('entity.status = :status', { status: status });
69
+ queryBuilder = this.createQueryBuilder('verify_local')
70
+ .skip(lazyEvent.first)
71
+ .take(lazyEvent.rows);
72
+ // Filtro global
73
+ if (lazyEvent.filters['global'] && lazyEvent.filters['global'].value) {
74
+ globalValue = "%".concat(lazyEvent.filters['global'].value.toLowerCase(), "%");
75
+ queryBuilder.andWhere('LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.local_information, "$.name"))) LIKE :globalValue OR LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.local_information, "$.addressElement"))) LIKE :globalValue', { globalValue: globalValue });
72
76
  }
73
- if (filters['global'] && filters['global'].value) {
74
- globalValue = "%".concat(filters['global'].value, "%");
75
- queryBuilder.andWhere('(JSON_EXTRACT(entity.local_information, "$.name") LIKE :globalValue ' +
76
- 'OR JSON_EXTRACT(entity.local_information, "$.square.address") LIKE :globalValue ' +
77
- 'OR JSON_EXTRACT(entity.local_information, "$.address.formatted_address") LIKE :globalValue ' +
78
- 'OR entity.status LIKE :globalValue)', { globalValue: globalValue });
77
+ // Filtro por estado
78
+ if (status !== null && status >= 0) {
79
+ queryBuilder.andWhere('verify_local.status = :status', { status: status });
79
80
  }
81
+ filters = lazyEvent.filters;
80
82
  Object.keys(filters).forEach(function (key) {
81
- var _a, _b, _c, _d;
82
- if (key !== 'global' && filters[key].constraints) {
83
- var filter = filters[key];
84
- var value = filter.constraints[0].value;
85
- var matchMode = filter.constraints[0].matchMode;
86
- if (value !== null) {
83
+ var _a, _b, _c, _d, _e, _f;
84
+ var _g;
85
+ if (filters[key] && filters[key].value) {
86
+ var matchMode = filters[key].matchMode;
87
+ var value = filters[key].value;
88
+ if (key === 'status') {
89
+ queryBuilder.andWhere('verify_local.status = :status', {
90
+ status: (0, utils_1.getStatusVerifyLocalNumber)((_g = filters[key].value) !== null && _g !== void 0 ? _g : ''),
91
+ });
92
+ }
93
+ else if (key === 'created') {
94
+ switch (matchMode) {
95
+ case 'dateIs':
96
+ queryBuilder.andWhere("DATE(verify_local.created) = :created", {
97
+ created: value,
98
+ });
99
+ break;
100
+ case 'dateBefore':
101
+ queryBuilder.andWhere("DATE(verify_local.created) < :created", {
102
+ created: value,
103
+ });
104
+ break;
105
+ case 'dateAfter':
106
+ queryBuilder.andWhere("DATE(verify_local.created) > :created", {
107
+ created: value,
108
+ });
109
+ break;
110
+ default:
111
+ break;
112
+ }
113
+ }
114
+ else if (key !== 'global') {
87
115
  var jsonPath = key
88
116
  .split('.')
117
+ .slice(1)
89
118
  .map(function (segment) { return "$.".concat(segment); })
90
119
  .join('');
120
+ var paramKey = key.split('.')[1];
91
121
  switch (matchMode) {
122
+ case 'contains':
123
+ queryBuilder.andWhere("LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\"))) LIKE :").concat(paramKey), (_a = {}, _a[paramKey] = "%".concat(value, "%"), _a));
124
+ break;
92
125
  case 'startsWith':
93
- queryBuilder.andWhere("JSON_EXTRACT(entity.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") LIKE :").concat(key), (_a = {},
94
- _a[key] = "".concat(value, "%"),
95
- _a));
126
+ queryBuilder.andWhere("LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\"))) LIKE :").concat(paramKey), (_b = {}, _b[paramKey] = "".concat(value, "%"), _b));
96
127
  break;
97
- case 'contains':
98
- queryBuilder.andWhere("JSON_EXTRACT(entity.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") LIKE :").concat(key), (_b = {},
99
- _b[key] = "%".concat(value, "%"),
100
- _b));
128
+ case 'notContains':
129
+ queryBuilder.andWhere("LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\"))) NOT LIKE :").concat(paramKey), (_c = {}, _c[paramKey] = "%".concat(value, "%"), _c));
130
+ break;
131
+ case 'endsWith':
132
+ queryBuilder.andWhere("LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\"))) LIKE :").concat(paramKey), (_d = {}, _d[paramKey] = "%".concat(value), _d));
101
133
  break;
102
134
  case 'equals':
103
- queryBuilder.andWhere("JSON_EXTRACT(entity.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\") = :").concat(key), (_c = {},
104
- _c[key] = value,
105
- _c));
135
+ queryBuilder.andWhere("LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\"))) = :").concat(paramKey), (_e = {}, _e[paramKey] = value, _e));
106
136
  break;
107
- case 'dateIs':
108
- queryBuilder.andWhere("DATE(JSON_EXTRACT(entity.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\")) = :").concat(key), (_d = {},
109
- _d[key] = value,
110
- _d));
137
+ case 'notEquals':
138
+ queryBuilder.andWhere("LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.".concat(key.split('.')[0], ", \"").concat(jsonPath, "\"))) != :").concat(paramKey), (_f = {}, _f[paramKey] = value, _f));
111
139
  break;
112
140
  default:
113
141
  break;
@@ -115,15 +143,27 @@ var CustomRepository = /** @class */ (function (_super) {
115
143
  }
116
144
  }
117
145
  });
146
+ // Ordenamiento
147
+ if (lazyEvent.sortField) {
148
+ order = lazyEvent.sortOrder === 1 ? 'ASC' : 'DESC';
149
+ if (lazyEvent.sortField.startsWith('local_information.')) {
150
+ jsonPath = lazyEvent.sortField
151
+ .split('.')
152
+ .slice(1)
153
+ .map(function (segment) { return "$.".concat(segment); })
154
+ .join('');
155
+ queryBuilder.orderBy("LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.local_information, '".concat(jsonPath, "')))"), order);
156
+ }
157
+ else {
158
+ queryBuilder.orderBy(lazyEvent.sortField, order);
159
+ }
160
+ }
118
161
  return [4 /*yield*/, queryBuilder.getManyAndCount()];
119
162
  case 1:
120
- _a = _b.sent(), data = _a[0], total = _a[1];
163
+ _c = _d.sent(), data = _c[0], total = _c[1];
121
164
  return [2 /*return*/, {
122
165
  data: data,
123
- total: total,
124
- page: page,
125
- pageSize: pageSize,
126
- totalPages: Math.ceil(total / pageSize),
166
+ totalRecords: total,
127
167
  }];
128
168
  }
129
169
  });
@@ -8,6 +8,7 @@ import { Plan } from './Plan';
8
8
  import { ProductTopping } from './ProductTopping';
9
9
  export declare class Company {
10
10
  id: number;
11
+ code: string;
11
12
  name: string;
12
13
  city: City;
13
14
  partner: Partner;
@@ -28,6 +28,10 @@ var Company = /** @class */ (function () {
28
28
  }),
29
29
  __metadata("design:type", Number)
30
30
  ], Company.prototype, "id", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.Column)({ length: 30, unique: true, comment: 'Código único de la empresa.' }),
33
+ __metadata("design:type", String)
34
+ ], Company.prototype, "code", void 0);
31
35
  __decorate([
32
36
  (0, typeorm_1.Column)({ length: 50, comment: 'Nombre de la empresa.' }),
33
37
  __metadata("design:type", String)
@@ -43,3 +43,4 @@ export { AuthenticationCredential } from './entities/AuthenticationCredential';
43
43
  export { PosSystem } from './entities/PosSystem';
44
44
  export { VerifyLocal } from './entities/VerifyLocal';
45
45
  export { CustomRepository } from './CustomRepository';
46
+ export * from './utils';
@@ -1,4 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.CustomRepository = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.LocalsCompany = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.TerminalSession = exports.Terminal = exports.Square = exports.RequestStatus = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.Region = exports.ProductTopping = exports.ProductIngredient = exports.ProductGroupComplement = exports.ProductGroup = exports.Product = exports.Plan = exports.PaymentMethod = exports.PartnerRole = exports.PartnerPermission = exports.PartnerNotification = exports.Partner = exports.MasterRole = exports.MasterPermission = exports.Master = exports.LocalQualification = exports.Local = exports.DiscountCodeUser = exports.DiscountCodeCompany = exports.Day = exports.Country = exports.Configuration = exports.Company = exports.CodeRedemptionHistoryUser = exports.CodeRedemptionHistoryCompany = exports.City = exports.ScheduleCategory = exports.Category = exports.BusinessTypeProduct = void 0;
4
18
  var BusinessTypeProduct_1 = require("./entities/BusinessTypeProduct");
@@ -91,3 +105,4 @@ var VerifyLocal_1 = require("./entities/VerifyLocal");
91
105
  Object.defineProperty(exports, "VerifyLocal", { enumerable: true, get: function () { return VerifyLocal_1.VerifyLocal; } });
92
106
  var CustomRepository_1 = require("./CustomRepository");
93
107
  Object.defineProperty(exports, "CustomRepository", { enumerable: true, get: function () { return CustomRepository_1.CustomRepository; } });
108
+ __exportStar(require("./utils"), exports);
@@ -13,4 +13,15 @@ export interface IDataBaseSource {
13
13
  synchronize: boolean;
14
14
  entitiesRoute?: string;
15
15
  }
16
+ export interface IPropsQueryVerifyLocal {
17
+ status: number;
18
+ lazyEvent: {
19
+ first: number;
20
+ rows: number;
21
+ page: number;
22
+ sortField: any;
23
+ sortOrder: any;
24
+ filters: any;
25
+ };
26
+ }
16
27
  export type IType = 'mysql' | 'mariadb';
@@ -0,0 +1 @@
1
+ export declare function getStatusVerifyLocalNumber(status: string): any;
package/dist/utils.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getStatusVerifyLocalNumber = void 0;
4
+ function getStatusVerifyLocalNumber(status) {
5
+ var statuses = {
6
+ 'Pending approval': 1,
7
+ Approved: 2,
8
+ Rejected: 3,
9
+ 'Pendiente aprobación': 1,
10
+ Aprobado: 3,
11
+ Rechazado: 2,
12
+ };
13
+ return statuses[status];
14
+ }
15
+ exports.getStatusVerifyLocalNumber = getStatusVerifyLocalNumber;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "2.3.5",
3
+ "version": "2.3.7",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,85 +1,117 @@
1
1
  import { DataSource, EntityTarget, Repository, ObjectLiteral } from 'typeorm'
2
+ import { IPropsQueryVerifyLocal } from './interfaces'
3
+ import { getStatusVerifyLocalNumber } from './utils'
2
4
 
3
5
  export class CustomRepository<T extends ObjectLiteral> extends Repository<T> {
4
6
  constructor(target: EntityTarget<T>, dataSource: DataSource) {
5
7
  super(target, dataSource.manager)
6
8
  }
7
9
 
8
- async getVerifyLocals2(
9
- status: number | null,
10
- page: number,
11
- pageSize: number,
12
- filters: any
13
- ) {
14
- const queryBuilder = this.createQueryBuilder('entity')
15
- .skip((page - 1) * pageSize)
16
- .take(pageSize)
10
+ async getVerifyLocals({ status, lazyEvent }: IPropsQueryVerifyLocal) {
11
+ const queryBuilder = this.createQueryBuilder('verify_local')
12
+ .skip(lazyEvent.first)
13
+ .take(lazyEvent.rows)
17
14
 
18
- if (status !== null && status >= 0) {
19
- queryBuilder.andWhere('entity.status = :status', { status })
20
- }
21
-
22
- if (filters['global'] && filters['global'].value) {
23
- const globalValue = `%${filters['global'].value}%`
15
+ // Filtro global
16
+ if (lazyEvent.filters['global'] && lazyEvent.filters['global'].value) {
17
+ const globalValue = `%${lazyEvent.filters['global'].value.toLowerCase()}%`
24
18
  queryBuilder.andWhere(
25
- '(JSON_EXTRACT(entity.local_information, "$.name") LIKE :globalValue ' +
26
- 'OR JSON_EXTRACT(entity.local_information, "$.square.address") LIKE :globalValue ' +
27
- 'OR JSON_EXTRACT(entity.local_information, "$.address.formatted_address") LIKE :globalValue ' +
28
- 'OR entity.status LIKE :globalValue)',
19
+ 'LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.local_information, "$.name"))) LIKE :globalValue OR LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.local_information, "$.addressElement"))) LIKE :globalValue',
29
20
  { globalValue }
30
21
  )
31
22
  }
32
23
 
24
+ // Filtro por estado
25
+ if (status !== null && status >= 0) {
26
+ queryBuilder.andWhere('verify_local.status = :status', { status })
27
+ }
28
+
29
+ // Aplicación de filtros
30
+ const filters = lazyEvent.filters
33
31
  Object.keys(filters).forEach((key) => {
34
- if (key !== 'global' && filters[key].constraints) {
35
- const filter = filters[key]
36
- const value = filter.constraints[0].value
37
- const matchMode = filter.constraints[0].matchMode
32
+ if (filters[key] && filters[key].value) {
33
+ const matchMode = filters[key].matchMode
34
+ const value = filters[key].value
38
35
 
39
- if (value !== null) {
36
+ if (key === 'status') {
37
+ queryBuilder.andWhere('verify_local.status = :status', {
38
+ status: getStatusVerifyLocalNumber(filters[key].value ?? ''),
39
+ })
40
+ } else if (key === 'created') {
41
+ switch (matchMode) {
42
+ case 'dateIs':
43
+ queryBuilder.andWhere(`DATE(verify_local.created) = :created`, {
44
+ created: value,
45
+ })
46
+ break
47
+ case 'dateBefore':
48
+ queryBuilder.andWhere(`DATE(verify_local.created) < :created`, {
49
+ created: value,
50
+ })
51
+ break
52
+ case 'dateAfter':
53
+ queryBuilder.andWhere(`DATE(verify_local.created) > :created`, {
54
+ created: value,
55
+ })
56
+ break
57
+ default:
58
+ break
59
+ }
60
+ } else if (key !== 'global') {
40
61
  const jsonPath = key
41
62
  .split('.')
63
+ .slice(1)
42
64
  .map((segment) => `$.${segment}`)
43
65
  .join('')
66
+ const paramKey = key.split('.')[1]
67
+
44
68
  switch (matchMode) {
69
+ case 'contains':
70
+ queryBuilder.andWhere(
71
+ `LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.${
72
+ key.split('.')[0]
73
+ }, "${jsonPath}"))) LIKE :${paramKey}`,
74
+ { [paramKey]: `%${value}%` }
75
+ )
76
+ break
45
77
  case 'startsWith':
46
78
  queryBuilder.andWhere(
47
- `JSON_EXTRACT(entity.${
79
+ `LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.${
48
80
  key.split('.')[0]
49
- }, "${jsonPath}") LIKE :${key}`,
50
- {
51
- [key]: `${value}%`,
52
- }
81
+ }, "${jsonPath}"))) LIKE :${paramKey}`,
82
+ { [paramKey]: `${value}%` }
53
83
  )
54
84
  break
55
- case 'contains':
85
+ case 'notContains':
86
+ queryBuilder.andWhere(
87
+ `LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.${
88
+ key.split('.')[0]
89
+ }, "${jsonPath}"))) NOT LIKE :${paramKey}`,
90
+ { [paramKey]: `%${value}%` }
91
+ )
92
+ break
93
+ case 'endsWith':
56
94
  queryBuilder.andWhere(
57
- `JSON_EXTRACT(entity.${
95
+ `LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.${
58
96
  key.split('.')[0]
59
- }, "${jsonPath}") LIKE :${key}`,
60
- {
61
- [key]: `%${value}%`,
62
- }
97
+ }, "${jsonPath}"))) LIKE :${paramKey}`,
98
+ { [paramKey]: `%${value}` }
63
99
  )
64
100
  break
65
101
  case 'equals':
66
102
  queryBuilder.andWhere(
67
- `JSON_EXTRACT(entity.${
103
+ `LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.${
68
104
  key.split('.')[0]
69
- }, "${jsonPath}") = :${key}`,
70
- {
71
- [key]: value,
72
- }
105
+ }, "${jsonPath}"))) = :${paramKey}`,
106
+ { [paramKey]: value }
73
107
  )
74
108
  break
75
- case 'dateIs':
109
+ case 'notEquals':
76
110
  queryBuilder.andWhere(
77
- `DATE(JSON_EXTRACT(entity.${
111
+ `LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.${
78
112
  key.split('.')[0]
79
- }, "${jsonPath}")) = :${key}`,
80
- {
81
- [key]: value,
82
- }
113
+ }, "${jsonPath}"))) != :${paramKey}`,
114
+ { [paramKey]: value }
83
115
  )
84
116
  break
85
117
  default:
@@ -89,14 +121,29 @@ export class CustomRepository<T extends ObjectLiteral> extends Repository<T> {
89
121
  }
90
122
  })
91
123
 
124
+ // Ordenamiento
125
+ if (lazyEvent.sortField) {
126
+ const order = lazyEvent.sortOrder === 1 ? 'ASC' : 'DESC'
127
+ if (lazyEvent.sortField.startsWith('local_information.')) {
128
+ const jsonPath = lazyEvent.sortField
129
+ .split('.')
130
+ .slice(1)
131
+ .map((segment: any) => `$.${segment}`)
132
+ .join('')
133
+ queryBuilder.orderBy(
134
+ `LOWER(JSON_UNQUOTE(JSON_EXTRACT(verify_local.local_information, '${jsonPath}')))`,
135
+ order
136
+ )
137
+ } else {
138
+ queryBuilder.orderBy(lazyEvent.sortField, order)
139
+ }
140
+ }
141
+
92
142
  const [data, total] = await queryBuilder.getManyAndCount()
93
143
 
94
144
  return {
95
145
  data,
96
- total,
97
- page,
98
- pageSize,
99
- totalPages: Math.ceil(total / pageSize),
146
+ totalRecords: total,
100
147
  }
101
148
  }
102
149
 
@@ -25,6 +25,9 @@ export class Company {
25
25
  })
26
26
  id: number
27
27
 
28
+ @Column({ length: 30, unique: true, comment: 'Código único de la empresa.' })
29
+ code: string
30
+
28
31
  @Column({ length: 50, comment: 'Nombre de la empresa.' })
29
32
  name: string
30
33
 
@@ -44,3 +44,4 @@ export { PosSystem } from './entities/PosSystem'
44
44
  export { VerifyLocal } from './entities/VerifyLocal'
45
45
 
46
46
  export { CustomRepository } from './CustomRepository'
47
+ export * from './utils'
package/src/interfaces.ts CHANGED
@@ -16,4 +16,16 @@ export interface IDataBaseSource {
16
16
  entitiesRoute?: string
17
17
  }
18
18
 
19
+ export interface IPropsQueryVerifyLocal {
20
+ status: number
21
+ lazyEvent: {
22
+ first: number
23
+ rows: number
24
+ page: number
25
+ sortField: any
26
+ sortOrder: any
27
+ filters: any
28
+ }
29
+ }
30
+
19
31
  export type IType = 'mysql' | 'mariadb'
package/src/utils.ts ADDED
@@ -0,0 +1,11 @@
1
+ export function getStatusVerifyLocalNumber(status: string) {
2
+ const statuses: any = {
3
+ 'Pending approval': 1,
4
+ Approved: 2,
5
+ Rejected: 3,
6
+ 'Pendiente aprobación': 1,
7
+ Aprobado: 3,
8
+ Rechazado: 2,
9
+ }
10
+ return statuses[status]
11
+ }