test-entity-library-asm 3.9.56 → 3.9.58

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 (54) hide show
  1. package/dist/entities/Company.js +5 -11
  2. package/dist/entities/Country.d.ts +2 -2
  3. package/dist/entities/Country.js +7 -7
  4. package/dist/entities/DiscountCodeCompany.js +1 -4
  5. package/dist/entities/DiscountCodeUser.js +1 -3
  6. package/dist/entities/Local.js +6 -7
  7. package/dist/entities/LocalPlan.js +1 -3
  8. package/dist/entities/Master.js +1 -3
  9. package/dist/entities/MasterNotification.js +1 -3
  10. package/dist/entities/Partner.js +1 -3
  11. package/dist/entities/PartnerNotification.js +1 -3
  12. package/dist/entities/PaymentMethod.js +1 -3
  13. package/dist/entities/Plan.js +1 -3
  14. package/dist/entities/Square.js +1 -3
  15. package/dist/entities/User.js +1 -3
  16. package/dist/filters/LocalsCompanyInformationForTheTable.d.ts +1 -1
  17. package/dist/filters/LocalsCompanyInformationForTheTable.js +63 -14
  18. package/dist/index.js +5 -5
  19. package/dist/interfaces.d.ts +0 -1
  20. package/dist/views/DiscountsCodeUser.js +2 -15
  21. package/dist/views/LocalReserves.js +2 -15
  22. package/dist/views/LocalsCompanyInformationForTheMap.js +10 -22
  23. package/dist/views/LocalsCompanyInformationForTheTable.d.ts +2 -2
  24. package/dist/views/LocalsCompanyInformationForTheTable.js +16 -28
  25. package/dist/views/MasterNotifications.js +5 -10
  26. package/dist/views/PartnerNotifications.js +3 -8
  27. package/dist/views/Partners.js +2 -15
  28. package/dist/views/ViewLocalsCompanies.js +1 -6
  29. package/package.json +1 -1
  30. package/src/entities/Company.ts +5 -11
  31. package/src/entities/Country.ts +9 -9
  32. package/src/entities/DiscountCodeCompany.ts +1 -4
  33. package/src/entities/DiscountCodeUser.ts +1 -3
  34. package/src/entities/Local.ts +7 -9
  35. package/src/entities/LocalPlan.ts +1 -3
  36. package/src/entities/Master.ts +2 -4
  37. package/src/entities/MasterNotification.ts +1 -3
  38. package/src/entities/Partner.ts +1 -3
  39. package/src/entities/PartnerNotification.ts +1 -3
  40. package/src/entities/PaymentMethod.ts +1 -3
  41. package/src/entities/Plan.ts +1 -3
  42. package/src/entities/Square.ts +1 -3
  43. package/src/entities/User.ts +1 -3
  44. package/src/filters/LocalsCompanyInformationForTheTable.ts +66 -23
  45. package/src/index.ts +9 -10
  46. package/src/interfaces.ts +0 -1
  47. package/src/views/DiscountsCodeUser.ts +2 -16
  48. package/src/views/LocalReserves.ts +2 -15
  49. package/src/views/LocalsCompanyInformationForTheMap.ts +10 -22
  50. package/src/views/LocalsCompanyInformationForTheTable.ts +17 -29
  51. package/src/views/MasterNotifications.ts +5 -11
  52. package/src/views/PartnerNotifications.ts +3 -9
  53. package/src/views/Partners.ts +2 -15
  54. package/src/views/ViewLocalsCompanies.ts +1 -7
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Company = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const __1 = require("..");
15
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
16
15
  const City_1 = require("./City");
17
16
  const CodeRedemptionHistoryCompany_1 = require("./CodeRedemptionHistoryCompany");
18
17
  const DiscountCodeUser_1 = require("./DiscountCodeUser");
@@ -62,50 +61,45 @@ __decorate([
62
61
  ], Company.prototype, "partner", void 0);
63
62
  __decorate([
64
63
  (0, typeorm_1.Column)({
65
- type: "longtext",
64
+ type: "json",
66
65
  nullable: true,
67
66
  default: null,
68
- transformer: jsonTransformer_1.jsonTransformer,
69
67
  comment: "Campo de tipo JSON donde se guarda información necesaria para la empresa.",
70
68
  }),
71
69
  __metadata("design:type", Object)
72
70
  ], Company.prototype, "profile", void 0);
73
71
  __decorate([
74
72
  (0, typeorm_1.Column)({
75
- type: "text",
73
+ type: "json",
76
74
  nullable: true,
77
75
  default: null,
78
- transformer: jsonTransformer_1.jsonTransformer,
79
76
  comment: "Campo de tipo JSON donde se guarda información para guardar el teléfono y el correo electrónico, también los nuevos valores qué tengan esos 2 campos.",
80
77
  }),
81
78
  __metadata("design:type", Object)
82
79
  ], Company.prototype, "contact_details", void 0);
83
80
  __decorate([
84
81
  (0, typeorm_1.Column)({
85
- type: "longtext",
82
+ type: "json",
86
83
  nullable: true,
87
84
  default: null,
88
- transformer: jsonTransformer_1.jsonTransformer,
89
85
  comment: "Información de tipo JSON donde se guarda la información legal de la empresa.",
90
86
  }),
91
87
  __metadata("design:type", Object)
92
88
  ], Company.prototype, "legal_information", void 0);
93
89
  __decorate([
94
90
  (0, typeorm_1.Column)({
95
- type: "longtext",
91
+ type: "json",
96
92
  nullable: true,
97
93
  default: null,
98
- transformer: jsonTransformer_1.jsonTransformer,
99
94
  comment: "Información de tipo JSON donde se guarda la información del representante legal del representante.",
100
95
  }),
101
96
  __metadata("design:type", Object)
102
97
  ], Company.prototype, "legal_agent", void 0);
103
98
  __decorate([
104
99
  (0, typeorm_1.Column)({
105
- type: "longtext",
100
+ type: "json",
106
101
  nullable: true,
107
102
  default: null,
108
- transformer: jsonTransformer_1.jsonTransformer,
109
103
  comment: "Configuración de la empresa.",
110
104
  }),
111
105
  __metadata("design:type", Object)
@@ -7,8 +7,8 @@ export declare class Country {
7
7
  currency: string;
8
8
  prefix: string;
9
9
  structure_phone: string;
10
- legal_information: any;
11
- legal_agent: any;
10
+ legal_information: any | null;
11
+ legal_agent: any | null;
12
12
  details: any | null;
13
13
  status: number;
14
14
  regions: Region[];
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Country = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const __1 = require("..");
15
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
16
15
  const Region_1 = require("./Region");
17
16
  let Country = class Country {
18
17
  };
@@ -58,26 +57,27 @@ __decorate([
58
57
  ], Country.prototype, "structure_phone", void 0);
59
58
  __decorate([
60
59
  (0, typeorm_1.Column)({
61
- type: "longtext",
62
- transformer: jsonTransformer_1.jsonTransformer,
60
+ type: "json",
61
+ nullable: true,
62
+ default: null,
63
63
  comment: "Esta columna de tipo JSON nos sirve para agregar toda la información que se necesita a nivel de información legal de la empresa que se registre, ya que para cada país cambia la información.",
64
64
  }),
65
65
  __metadata("design:type", Object)
66
66
  ], Country.prototype, "legal_information", void 0);
67
67
  __decorate([
68
68
  (0, typeorm_1.Column)({
69
- type: "longtext",
70
- transformer: jsonTransformer_1.jsonTransformer,
69
+ type: "json",
70
+ nullable: true,
71
+ default: null,
71
72
  comment: "Columna de tipo JSON para almacenar la información que se necesita para la información del representante legal de la empresa.",
72
73
  }),
73
74
  __metadata("design:type", Object)
74
75
  ], Country.prototype, "legal_agent", void 0);
75
76
  __decorate([
76
77
  (0, typeorm_1.Column)({
77
- type: "longtext",
78
+ type: "json",
78
79
  nullable: true,
79
80
  default: null,
80
- transformer: jsonTransformer_1.jsonTransformer,
81
81
  comment: "Columna de tipo JSON para almacenar información adicional sobre el país.",
82
82
  }),
83
83
  __metadata("design:type", Object)
@@ -11,10 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DiscountCodeCompany = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
15
14
  const CodeRedemptionHistoryCompany_1 = require("./CodeRedemptionHistoryCompany");
16
15
  const Master_1 = require("./Master");
17
- // import { ServiceDiscountsPlan } from "./ServiceDiscountsPlan";
18
16
  let DiscountCodeCompany = class DiscountCodeCompany {
19
17
  };
20
18
  exports.DiscountCodeCompany = DiscountCodeCompany;
@@ -88,8 +86,7 @@ __decorate([
88
86
  ], DiscountCodeCompany.prototype, "expiration", void 0);
89
87
  __decorate([
90
88
  (0, typeorm_1.Column)({
91
- type: "text",
92
- transformer: jsonTransformer_1.jsonTransformer,
89
+ type: "json",
93
90
  nullable: true,
94
91
  default: null,
95
92
  comment: "Columna de tipos JSON para agregar en un arreglo los días que se pueden repetir el descuento.",
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DiscountCodeUser = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const __1 = require("..");
15
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
16
15
  const CodeRedemptionHistoryUser_1 = require("./CodeRedemptionHistoryUser");
17
16
  const Company_1 = require("./Company");
18
17
  const Partner_1 = require("./Partner");
@@ -107,8 +106,7 @@ __decorate([
107
106
  ], DiscountCodeUser.prototype, "expiration", void 0);
108
107
  __decorate([
109
108
  (0, typeorm_1.Column)({
110
- type: "text",
111
- transformer: jsonTransformer_1.jsonTransformer,
109
+ type: "json",
112
110
  nullable: true,
113
111
  default: null,
114
112
  comment: "Columna de tipos JSON para agregar en un arreglo los días que se pueden repetir el descuento.",
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Local = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const __1 = require("..");
15
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
16
15
  const BusinessTypeProduct_1 = require("./BusinessTypeProduct");
17
16
  const Category_1 = require("./Category");
18
17
  const City_1 = require("./City");
@@ -75,10 +74,10 @@ __decorate([
75
74
  ], Local.prototype, "longitude", void 0);
76
75
  __decorate([
77
76
  (0, typeorm_1.Column)({
78
- type: "longtext",
77
+ type: "json",
79
78
  nullable: true,
80
79
  default: null,
81
- transformer: jsonTransformer_1.jsonTransformer,
80
+ // transformer: jsonTransformer,
82
81
  comment: "Campo de tipo JSON por si es necesario agregar información adicional",
83
82
  }),
84
83
  __metadata("design:type", Object)
@@ -131,10 +130,10 @@ __decorate([
131
130
  ], Local.prototype, "pos_system", void 0);
132
131
  __decorate([
133
132
  (0, typeorm_1.Column)({
134
- type: "text",
133
+ type: "json",
135
134
  nullable: true,
136
135
  default: null,
137
- transformer: jsonTransformer_1.jsonTransformer,
136
+ // transformer: jsonTransformer,
138
137
  comment: "Campo de tipo JSON por si es necesario agregar información adicional",
139
138
  }),
140
139
  __metadata("design:type", Object)
@@ -168,10 +167,10 @@ __decorate([
168
167
  ], Local.prototype, "operation_status", void 0);
169
168
  __decorate([
170
169
  (0, typeorm_1.Column)({
171
- type: "text",
170
+ type: "json",
172
171
  nullable: true,
173
172
  default: null,
174
- transformer: jsonTransformer_1.jsonTransformer,
173
+ // transformer: jsonTransformer,
175
174
  }),
176
175
  __metadata("design:type", Object)
177
176
  ], Local.prototype, "contact_details", void 0);
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.LocalPlan = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const __1 = require("..");
15
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
16
15
  let LocalPlan = class LocalPlan {
17
16
  };
18
17
  exports.LocalPlan = LocalPlan;
@@ -59,10 +58,9 @@ __decorate([
59
58
  ], LocalPlan.prototype, "price", void 0);
60
59
  __decorate([
61
60
  (0, typeorm_1.Column)({
62
- type: "mediumtext",
61
+ type: "json",
63
62
  nullable: true,
64
63
  default: null,
65
- transformer: jsonTransformer_1.jsonTransformer,
66
64
  comment: "Por si necesitamos agregar más elementos a la tabla. \n\nEsto se comporta como un Objeto guardado en la columna.",
67
65
  }),
68
66
  __metadata("design:type", Object)
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Master = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const __1 = require("..");
15
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
16
15
  const City_1 = require("./City");
17
16
  const DiscountCodeCompany_1 = require("./DiscountCodeCompany");
18
17
  const MasterRole_1 = require("./MasterRole");
@@ -114,10 +113,9 @@ __decorate([
114
113
  ], Master.prototype, "google_id", void 0);
115
114
  __decorate([
116
115
  (0, typeorm_1.Column)({
117
- type: "longtext",
116
+ type: "json",
118
117
  nullable: true,
119
118
  default: null,
120
- transformer: jsonTransformer_1.jsonTransformer,
121
119
  comment: "Campo de tipo JSON donde se guarda información necesaria para el registro.",
122
120
  }),
123
121
  __metadata("design:type", Object)
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.MasterNotification = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const __1 = require("..");
15
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
16
15
  let MasterNotification = class MasterNotification {
17
16
  };
18
17
  exports.MasterNotification = MasterNotification;
@@ -61,10 +60,9 @@ __decorate([
61
60
  ], MasterNotification.prototype, "description", void 0);
62
61
  __decorate([
63
62
  (0, typeorm_1.Column)({
64
- type: "text",
63
+ type: "json",
65
64
  nullable: true,
66
65
  default: null,
67
- transformer: jsonTransformer_1.jsonTransformer,
68
66
  comment: "Configuración adicional de la notificación, como enlaces, qué hace después de darle click...",
69
67
  }),
70
68
  __metadata("design:type", Object)
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Partner = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const __1 = require("..");
15
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
16
15
  const City_1 = require("./City");
17
16
  const Company_1 = require("./Company");
18
17
  const DiscountCodeUser_1 = require("./DiscountCodeUser");
@@ -127,10 +126,9 @@ __decorate([
127
126
  ], Partner.prototype, "google_id", void 0);
128
127
  __decorate([
129
128
  (0, typeorm_1.Column)({
130
- type: "longtext",
129
+ type: "json",
131
130
  nullable: true,
132
131
  default: null,
133
- transformer: jsonTransformer_1.jsonTransformer,
134
132
  comment: "Campo de tipo JSON donde se guarda información necesaria para el registro.",
135
133
  }),
136
134
  __metadata("design:type", Object)
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PartnerNotification = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const Partner_1 = require("./Partner");
15
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
16
15
  const Master_1 = require("./Master");
17
16
  let PartnerNotification = class PartnerNotification {
18
17
  };
@@ -62,10 +61,9 @@ __decorate([
62
61
  ], PartnerNotification.prototype, "description", void 0);
63
62
  __decorate([
64
63
  (0, typeorm_1.Column)({
65
- type: "text",
64
+ type: "json",
66
65
  nullable: true,
67
66
  default: null,
68
- transformer: jsonTransformer_1.jsonTransformer,
69
67
  comment: "Configuración adicional de la notificación, como enlaces, qué hace después de darle click...",
70
68
  }),
71
69
  __metadata("design:type", Object)
@@ -13,7 +13,6 @@ exports.PaymentMethod = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const __1 = require("..");
15
15
  const Local_1 = require("./Local");
16
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
17
16
  let PaymentMethod = class PaymentMethod {
18
17
  };
19
18
  exports.PaymentMethod = PaymentMethod;
@@ -44,8 +43,7 @@ __decorate([
44
43
  ], PaymentMethod.prototype, "description", void 0);
45
44
  __decorate([
46
45
  (0, typeorm_1.Column)({
47
- type: "longtext",
48
- transformer: jsonTransformer_1.jsonTransformer,
46
+ type: "json",
49
47
  nullable: true,
50
48
  default: null,
51
49
  comment: "Campo de tipo JSON donde se pueden agregar columnas u otros elementos que sean necesarios.",
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Plan = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const __1 = require("..");
15
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
16
15
  const Company_1 = require("./Company");
17
16
  let Plan = class Plan {
18
17
  };
@@ -51,8 +50,7 @@ __decorate([
51
50
  ], Plan.prototype, "name", void 0);
52
51
  __decorate([
53
52
  (0, typeorm_1.Column)({
54
- type: "mediumtext",
55
- transformer: jsonTransformer_1.jsonTransformer,
53
+ type: "json",
56
54
  nullable: true,
57
55
  default: null,
58
56
  comment: "Campo de tipo JSON donde se guarda información necesaria para el plan",
@@ -14,7 +14,6 @@ const typeorm_1 = require("typeorm");
14
14
  const City_1 = require("./City");
15
15
  const Local_1 = require("./Local");
16
16
  const User_1 = require("./User");
17
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
18
17
  let Square = class Square {
19
18
  };
20
19
  exports.Square = Square;
@@ -73,10 +72,9 @@ __decorate([
73
72
  ], Square.prototype, "longitude", void 0);
74
73
  __decorate([
75
74
  (0, typeorm_1.Column)({
76
- type: "mediumtext",
75
+ type: "json",
77
76
  nullable: true,
78
77
  default: null,
79
- transformer: jsonTransformer_1.jsonTransformer,
80
78
  comment: "Campo de tipo JSON por si se llega a necesitar agregar otras columnas para las plazoletas de los centros comerciales.",
81
79
  }),
82
80
  __metadata("design:type", Object)
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.User = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const __1 = require("..");
15
- const jsonTransformer_1 = require("../transformers/jsonTransformer");
16
15
  const City_1 = require("./City");
17
16
  const CodeRedemptionHistoryUser_1 = require("./CodeRedemptionHistoryUser");
18
17
  const Local_1 = require("./Local");
@@ -95,10 +94,9 @@ __decorate([
95
94
  ], User.prototype, "password", void 0);
96
95
  __decorate([
97
96
  (0, typeorm_1.Column)({
98
- type: "longtext",
97
+ type: "json",
99
98
  nullable: true,
100
99
  default: null,
101
- transformer: jsonTransformer_1.jsonTransformer,
102
100
  comment: "Campo de tipo JSON donde se guarda información necesaria para el registro.",
103
101
  }),
104
102
  __metadata("design:type", Object)
@@ -1,6 +1,6 @@
1
1
  import { Repository } from "typeorm";
2
2
  import { IBasicCompany } from "../interfaces";
3
- export declare function getLocalsCompanyInformationTable(repository: Repository<any>, { company, status, visible, lazyEvent, filter_visualization, }: IBasicCompany): Promise<{
3
+ export declare function getLocalsCompanyInformationTable(repository: Repository<any>, { company, status, visible, lazyEvent }: IBasicCompany): Promise<{
4
4
  data: any[];
5
5
  totalRecords: number;
6
6
  }>;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLocalsCompanyInformationTable = void 0;
4
- async function getLocalsCompanyInformationTable(repository, { company, status, visible, lazyEvent, filter_visualization = 2, // "no-in-review-rejected"
5
- }) {
4
+ async function getLocalsCompanyInformationTable(repository, { company, status, visible, lazyEvent }) {
6
5
  try {
7
6
  const queryBuilder = repository
8
7
  .createQueryBuilder("locals_company_information_for_the_table")
@@ -11,7 +10,7 @@ async function getLocalsCompanyInformationTable(repository, { company, status, v
11
10
  // DOC: Filtro global
12
11
  if (lazyEvent.filters["global"] && lazyEvent.filters["global"].value) {
13
12
  const globalValue = `%${lazyEvent.filters["global"].value.toLowerCase()}%`;
14
- queryBuilder.andWhere("(LOWER(locals_company_information_for_the_table.name) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.address) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_name) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_surname) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_full_name) LIKE :globalValue OR locals_company_information_for_the_table.partner_full_name LIKE :globalValue", { globalValue });
13
+ queryBuilder.andWhere("(LOWER(locals_company_information_for_the_table.name) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.address) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_name) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_surname) LIKE :globalValue OR LOWER(locals_company_information_for_the_table.partner_full_name) LIKE :globalValue OR locals_company_information_for_the_table.partner_full_name LIKE :globalValue)", { globalValue });
15
14
  }
16
15
  // DOC: Filtro por estado FILTRO POR DEFECTO.
17
16
  if (status !== null && status >= 0) {
@@ -31,17 +30,6 @@ async function getLocalsCompanyInformationTable(repository, { company, status, v
31
30
  visible,
32
31
  });
33
32
  }
34
- // DOC: la columna filter_visualization se utiliza para aplicar el filtro review_status y operation_type.
35
- // DOC: Si filter_visualization es "in-review-rejected", se muestran los locales que están en revisión o rechazados, es decir, review_status = 1 o 3 y operation_type = 1 o 2.
36
- // DOC: Si filter_visualization es "no-in-review-rejected", se muestran los locales que no están en revisión ni rechazados, es decir, review_status es null y operation_type es null.
37
- if (filter_visualization === 1) {
38
- // "in-review-rejected"
39
- queryBuilder.andWhere("(locals_company_information_for_the_table.review_status IN (1, 3) AND locals_company_information_for_the_table.operation_type IN (1, 2))");
40
- }
41
- else if (filter_visualization === 2) {
42
- // "no-in-review-rejected"
43
- queryBuilder.andWhere("(locals_company_information_for_the_table.review_status IS NULL AND locals_company_information_for_the_table.operation_type IS NULL)");
44
- }
45
33
  // DOC: Acá vienen los otros filtros, por las columnas de la tabla.
46
34
  const filters = lazyEvent.filters;
47
35
  Object.keys(filters).forEach((key) => {
@@ -59,6 +47,64 @@ async function getLocalsCompanyInformationTable(repository, { company, status, v
59
47
  : `locals_company_information_for_the_table.${key}`; // DOC: Verificamos si el filtro es un campo anidado o no.
60
48
  switch (matchMode // DOC: Verificamos el modo de coincidencia del filtro.
61
49
  ) {
50
+ case "custom":
51
+ // 📌 Filtro por created / updated (rango de fechas en UTC)
52
+ if (key === "created" || key === "updated") {
53
+ if (Array.isArray(value) && value.length === 2) {
54
+ const [from, to] = value;
55
+ if (from !== null && to === null) {
56
+ queryBuilder.andWhere(`${accessKey} >= :from`, {
57
+ from: new Date(from),
58
+ });
59
+ }
60
+ else if (from === null && to !== null) {
61
+ queryBuilder.andWhere(`${accessKey} <= :to`, {
62
+ to: new Date(to),
63
+ });
64
+ }
65
+ else if (from !== null && to !== null) {
66
+ queryBuilder.andWhere(`${accessKey} BETWEEN :from AND :to`, {
67
+ from: new Date(from),
68
+ to: new Date(to),
69
+ });
70
+ }
71
+ }
72
+ }
73
+ // 📌 Filtro por created_by (array de ids)
74
+ if (key === "created_by") {
75
+ if (Array.isArray(value) && value.length > 0) {
76
+ queryBuilder.andWhere(`${accessKey} IN (:...${key})`, {
77
+ [key]: value,
78
+ });
79
+ }
80
+ }
81
+ // 📌 Filtro por updated_by (array de ids)
82
+ if (key === "updated_by") {
83
+ if (Array.isArray(value) && value.length > 0) {
84
+ queryBuilder.andWhere(`${accessKey} IN (:...${key})`, {
85
+ [key]: value,
86
+ });
87
+ }
88
+ }
89
+ // 📌 Filtro por total_requests / average_rating (rango numérico)
90
+ if (key === "total_requests" || key === "average_rating") {
91
+ if (Array.isArray(value) && value.length === 2) {
92
+ const [from, to] = value;
93
+ if (from !== null && to === null) {
94
+ queryBuilder.andWhere(`${accessKey} >= :from`, { from });
95
+ }
96
+ else if (from === null && to !== null) {
97
+ queryBuilder.andWhere(`${accessKey} <= :to`, { to });
98
+ }
99
+ else if (from !== null && to !== null) {
100
+ queryBuilder.andWhere(`${accessKey} BETWEEN :from AND :to`, {
101
+ from,
102
+ to,
103
+ });
104
+ }
105
+ }
106
+ }
107
+ break;
62
108
  case "contains": // DOC: Si el modo de coincidencia es "contains".
63
109
  queryBuilder.andWhere(`LOWER(${accessKey}) LIKE :${key}`, {
64
110
  [key]: `%${value}%`,
@@ -163,6 +209,9 @@ async function getLocalsCompanyInformationTable(repository, { company, status, v
163
209
  }
164
210
  // DOC: Ejecutamos la consulta y obtenemos los resultados.
165
211
  const [data, totalRecords] = await queryBuilder.getManyAndCount();
212
+ // DOC: Si quieres ver la consulta generada, puedes descomentar las siguientes líneas:
213
+ // console.log("Query:", queryBuilder.getQuery());
214
+ // console.log("Query:", queryBuilder.getQueryAndParameters());
166
215
  return {
167
216
  data,
168
217
  totalRecords,
package/dist/index.js CHANGED
@@ -15,9 +15,6 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
- };
21
18
  var __importStar = (this && this.__importStar) || function (mod) {
22
19
  if (mod && mod.__esModule) return mod;
23
20
  var result = {};
@@ -25,16 +22,19 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
22
  __setModuleDefault(result, mod);
26
23
  return result;
27
24
  };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.getRepositoryByEntity = exports.getTimezoneOffset = exports.getTimeZone = exports.timezoneMiddleware = exports.callStoredProcedure = exports.showEntity = exports.showEntityNameEntity = exports.createDataBaseSource = void 0;
30
30
  const async_hooks_1 = require("async_hooks");
31
31
  const dotenv_1 = require("dotenv");
32
32
  const path_1 = require("path");
33
33
  const typeorm_1 = require("typeorm");
34
- const moment = require("moment-timezone");
34
+ const EntitiesViewsRoutes = __importStar(require("./entities.index"));
35
35
  const entities_views_routes_1 = require("./entities.views.routes");
36
+ const moment = require("moment-timezone");
36
37
  __exportStar(require("./entities.views.routes"), exports);
37
- const EntitiesViewsRoutes = __importStar(require("./entities.index"));
38
38
  const asyncLocalStorage = new async_hooks_1.AsyncLocalStorage();
39
39
  let connection = null;
40
40
  // DOCUMENTATION: Función para crear la conexión de la base de datos
@@ -28,7 +28,6 @@ export interface IBasicCompany extends IBasicLazyEvent {
28
28
  company: number | null;
29
29
  visible?: number | null;
30
30
  owner?: number | null;
31
- filter_visualization?: number | null;
32
31
  }
33
32
  export interface IPropsQueryVerifyLocalInformation extends IPropsQueryVerifyLocal {
34
33
  partner: number | null;
@@ -11,19 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DiscountsCodeUser = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
- // JSON Transformer
15
- const jsonTransformer = {
16
- to: (value) => JSON.stringify(value),
17
- from: (value) => {
18
- try {
19
- return JSON.parse(value);
20
- }
21
- catch (error) {
22
- console.log(error, "Transformer error");
23
- return null;
24
- }
25
- },
26
- };
27
14
  let DiscountsCodeUser = class DiscountsCodeUser {
28
15
  };
29
16
  exports.DiscountsCodeUser = DiscountsCodeUser;
@@ -72,7 +59,7 @@ __decorate([
72
59
  __metadata("design:type", String)
73
60
  ], DiscountsCodeUser.prototype, "expiration", void 0);
74
61
  __decorate([
75
- (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
62
+ (0, typeorm_1.ViewColumn)(),
76
63
  __metadata("design:type", Object)
77
64
  ], DiscountsCodeUser.prototype, "repeat_days", void 0);
78
65
  __decorate([
@@ -120,7 +107,7 @@ __decorate([
120
107
  __metadata("design:type", String)
121
108
  ], DiscountsCodeUser.prototype, "partner_surname", void 0);
122
109
  __decorate([
123
- (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
110
+ (0, typeorm_1.ViewColumn)(),
124
111
  __metadata("design:type", Object)
125
112
  ], DiscountsCodeUser.prototype, "partner_profile", void 0);
126
113
  __decorate([
@@ -11,19 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.LocalReserves = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
- // JSON Transformer
15
- const jsonTransformer = {
16
- to: (value) => JSON.stringify(value),
17
- from: (value) => {
18
- try {
19
- return JSON.parse(value);
20
- }
21
- catch (error) {
22
- console.log(error, "Transformer error");
23
- return null;
24
- }
25
- },
26
- };
27
14
  let LocalReserves = class LocalReserves {
28
15
  };
29
16
  exports.LocalReserves = LocalReserves;
@@ -240,7 +227,7 @@ __decorate([
240
227
  __metadata("design:type", Object)
241
228
  ], LocalReserves.prototype, "partner_email", void 0);
242
229
  __decorate([
243
- (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
230
+ (0, typeorm_1.ViewColumn)(),
244
231
  __metadata("design:type", Object)
245
232
  ], LocalReserves.prototype, "partner_profile", void 0);
246
233
  __decorate([
@@ -280,7 +267,7 @@ __decorate([
280
267
  __metadata("design:type", Object)
281
268
  ], LocalReserves.prototype, "user_table_phone", void 0);
282
269
  __decorate([
283
- (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
270
+ (0, typeorm_1.ViewColumn)(),
284
271
  __metadata("design:type", Object)
285
272
  ], LocalReserves.prototype, "user_table_profile", void 0);
286
273
  __decorate([