test-entity-library-asm 3.9.58 → 3.9.60

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.
@@ -8,11 +8,12 @@ export declare class DiscountCodeCompany {
8
8
  single_use: number;
9
9
  use_limit: number | null;
10
10
  created: Date;
11
+ created_by: Master;
11
12
  start: string;
12
13
  expiration: string | null;
13
14
  repeat_days: any | null;
14
- updated: Date;
15
+ updated: Date | null;
16
+ updated_by: Master | null;
15
17
  status: number;
16
- updated_by: Master;
17
18
  code_redemptions_history_company: CodeRedemptionHistoryCompany[];
18
19
  }
@@ -68,6 +68,14 @@ __decorate([
68
68
  }),
69
69
  __metadata("design:type", Date)
70
70
  ], DiscountCodeCompany.prototype, "created", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.ManyToOne)(() => Master_1.Master, (master) => master.discounts_code_company_created_by, {
73
+ onDelete: "CASCADE",
74
+ onUpdate: "NO ACTION",
75
+ }),
76
+ (0, typeorm_1.JoinColumn)({ name: "created_by" }),
77
+ __metadata("design:type", Master_1.Master)
78
+ ], DiscountCodeCompany.prototype, "created_by", void 0);
71
79
  __decorate([
72
80
  (0, typeorm_1.Column)({
73
81
  type: "date",
@@ -96,12 +104,22 @@ __decorate([
96
104
  __decorate([
97
105
  (0, typeorm_1.Column)({
98
106
  type: "datetime",
99
- comment: "Fecha de actualización.",
100
- default: () => "CURRENT_TIMESTAMP",
107
+ default: null,
108
+ nullable: true,
101
109
  onUpdate: "CURRENT_TIMESTAMP",
110
+ comment: "Fecha de actualización.",
102
111
  }),
103
- __metadata("design:type", Date)
112
+ __metadata("design:type", Object)
104
113
  ], DiscountCodeCompany.prototype, "updated", void 0);
114
+ __decorate([
115
+ (0, typeorm_1.ManyToOne)(() => Master_1.Master, (master) => master.discount_code_companies, {
116
+ onDelete: "CASCADE",
117
+ onUpdate: "NO ACTION",
118
+ nullable: true,
119
+ }),
120
+ (0, typeorm_1.JoinColumn)({ name: "updated_by" }),
121
+ __metadata("design:type", Object)
122
+ ], DiscountCodeCompany.prototype, "updated_by", void 0);
105
123
  __decorate([
106
124
  (0, typeorm_1.Column)({
107
125
  default: 1,
@@ -111,14 +129,6 @@ __decorate([
111
129
  }),
112
130
  __metadata("design:type", Number)
113
131
  ], DiscountCodeCompany.prototype, "status", void 0);
114
- __decorate([
115
- (0, typeorm_1.ManyToOne)(() => Master_1.Master, (master) => master.discount_code_companies, {
116
- onDelete: "CASCADE",
117
- onUpdate: "NO ACTION",
118
- }),
119
- (0, typeorm_1.JoinColumn)({ name: "updated_by" }),
120
- __metadata("design:type", Master_1.Master)
121
- ], DiscountCodeCompany.prototype, "updated_by", void 0);
122
132
  __decorate([
123
133
  (0, typeorm_1.OneToMany)(() => CodeRedemptionHistoryCompany_1.CodeRedemptionHistoryCompany, (codeRedemptionHistoryCompany) => codeRedemptionHistoryCompany.discount_code_company),
124
134
  __metadata("design:type", Array)
@@ -12,11 +12,12 @@ export declare class DiscountCodeUser {
12
12
  single_use: number;
13
13
  use_limit: number | null;
14
14
  created: Date;
15
+ created_by: Partner;
15
16
  start: string;
16
17
  expiration: string | null;
17
18
  repeat_days: any | null;
18
- updated_by: Partner;
19
- updated: Date;
19
+ updated: Date | null;
20
+ updated_by: Partner | null;
20
21
  status: number;
21
22
  code_redemptions_history_users: CodeRedemptionHistoryUser[];
22
23
  }
@@ -88,6 +88,14 @@ __decorate([
88
88
  }),
89
89
  __metadata("design:type", Date)
90
90
  ], DiscountCodeUser.prototype, "created", void 0);
91
+ __decorate([
92
+ (0, typeorm_1.ManyToOne)(() => Partner_1.Partner, (partner) => partner.discounts_code_user_created_by, {
93
+ onDelete: "CASCADE",
94
+ onUpdate: "NO ACTION",
95
+ }),
96
+ (0, typeorm_1.JoinColumn)({ name: "created_by" }),
97
+ __metadata("design:type", Partner_1.Partner)
98
+ ], DiscountCodeUser.prototype, "created_by", void 0);
91
99
  __decorate([
92
100
  (0, typeorm_1.Column)({
93
101
  type: "date",
@@ -113,23 +121,25 @@ __decorate([
113
121
  }),
114
122
  __metadata("design:type", Object)
115
123
  ], DiscountCodeUser.prototype, "repeat_days", void 0);
116
- __decorate([
117
- (0, typeorm_1.ManyToOne)(() => Partner_1.Partner, (partner) => partner.discount_code_partners, {
118
- onDelete: "CASCADE",
119
- onUpdate: "NO ACTION",
120
- }),
121
- (0, typeorm_1.JoinColumn)({ name: "updated_by" }),
122
- __metadata("design:type", Partner_1.Partner)
123
- ], DiscountCodeUser.prototype, "updated_by", void 0);
124
124
  __decorate([
125
125
  (0, typeorm_1.Column)({
126
126
  type: "datetime",
127
- default: () => "CURRENT_TIMESTAMP",
127
+ nullable: true,
128
+ default: null,
128
129
  onUpdate: "CURRENT_TIMESTAMP",
129
130
  comment: "Fecha de actualización.",
130
131
  }),
131
- __metadata("design:type", Date)
132
+ __metadata("design:type", Object)
132
133
  ], DiscountCodeUser.prototype, "updated", void 0);
134
+ __decorate([
135
+ (0, typeorm_1.ManyToOne)(() => Partner_1.Partner, (partner) => partner.discount_code_partners, {
136
+ onDelete: "CASCADE",
137
+ onUpdate: "NO ACTION",
138
+ nullable: true,
139
+ }),
140
+ (0, typeorm_1.JoinColumn)({ name: "updated_by" }),
141
+ __metadata("design:type", Object)
142
+ ], DiscountCodeUser.prototype, "updated_by", void 0);
133
143
  __decorate([
134
144
  (0, typeorm_1.Column)({
135
145
  default: 1,
@@ -19,6 +19,7 @@ export declare class Master {
19
19
  updated: Date;
20
20
  status: number;
21
21
  visible: number;
22
+ discounts_code_company_created_by: DiscountCodeCompany[];
22
23
  discount_code_companies: DiscountCodeCompany[];
23
24
  masters_roles: MasterRole[];
24
25
  verifyLocals: VerifyLocal[];
@@ -155,6 +155,10 @@ __decorate([
155
155
  }),
156
156
  __metadata("design:type", Number)
157
157
  ], Master.prototype, "visible", void 0);
158
+ __decorate([
159
+ (0, typeorm_1.OneToMany)(() => DiscountCodeCompany_1.DiscountCodeCompany, (discountCodeCompany) => discountCodeCompany.created_by),
160
+ __metadata("design:type", Array)
161
+ ], Master.prototype, "discounts_code_company_created_by", void 0);
158
162
  __decorate([
159
163
  (0, typeorm_1.OneToMany)(() => DiscountCodeCompany_1.DiscountCodeCompany, (discountCodeCompany) => discountCodeCompany.updated_by),
160
164
  __metadata("design:type", Array)
@@ -25,6 +25,7 @@ export declare class Partner {
25
25
  status: number;
26
26
  visible: number;
27
27
  companies: Company[];
28
+ discounts_code_user_created_by: DiscountCodeUser[];
28
29
  discount_code_partners: DiscountCodeUser[];
29
30
  locals: Local[];
30
31
  locals_partner: Local[];
@@ -181,6 +181,10 @@ __decorate([
181
181
  (0, typeorm_1.OneToMany)(() => Company_1.Company, (company) => company.partner),
182
182
  __metadata("design:type", Array)
183
183
  ], Partner.prototype, "companies", void 0);
184
+ __decorate([
185
+ (0, typeorm_1.OneToMany)(() => DiscountCodeUser_1.DiscountCodeUser, (discountCodeUser) => discountCodeUser.created_by),
186
+ __metadata("design:type", Array)
187
+ ], Partner.prototype, "discounts_code_user_created_by", void 0);
184
188
  __decorate([
185
189
  (0, typeorm_1.OneToMany)(() => DiscountCodeUser_1.DiscountCodeUser, (discountCodeUser) => discountCodeUser.updated_by),
186
190
  __metadata("design:type", Array)
@@ -10,7 +10,7 @@ async function getLocalsCompanyInformationTable(repository, { company, status, v
10
10
  // DOC: Filtro global
11
11
  if (lazyEvent.filters["global"] && lazyEvent.filters["global"].value) {
12
12
  const globalValue = `%${lazyEvent.filters["global"].value.toLowerCase()}%`;
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 });
13
+ queryBuilder.andWhere("(LOWER(locals_company_information_for_the_table.code) LIKE :globalValue OR 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 });
14
14
  }
15
15
  // DOC: Filtro por estado FILTRO POR DEFECTO.
16
16
  if (status !== null && status >= 0) {
@@ -8,6 +8,7 @@ export declare class DiscountsCodeUser {
8
8
  single_use: number;
9
9
  use_limit: number;
10
10
  created: Date;
11
+ created_by: number;
11
12
  start: string;
12
13
  expiration: string;
13
14
  repeat_days: any;
@@ -18,10 +19,18 @@ export declare class DiscountsCodeUser {
18
19
  local_name: string;
19
20
  local_address: string;
20
21
  local_status: number;
22
+ created_by_id: number;
23
+ created_by_code: string;
24
+ created_by_name: string;
25
+ created_by_surname: string;
26
+ created_by_full_name: string;
27
+ created_by_profile: any;
28
+ created_by_status: number;
21
29
  partner_id: number;
22
30
  partner_code: string;
23
31
  partner_name: string;
24
32
  partner_surname: string;
33
+ partner_full_name: string;
25
34
  partner_profile: any;
26
35
  partner_status: number;
27
36
  number_of_times_used: number;
@@ -50,6 +50,10 @@ __decorate([
50
50
  (0, typeorm_1.ViewColumn)(),
51
51
  __metadata("design:type", Date)
52
52
  ], DiscountsCodeUser.prototype, "created", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.ViewColumn)(),
55
+ __metadata("design:type", Number)
56
+ ], DiscountsCodeUser.prototype, "created_by", void 0);
53
57
  __decorate([
54
58
  (0, typeorm_1.ViewColumn)(),
55
59
  __metadata("design:type", String)
@@ -90,6 +94,34 @@ __decorate([
90
94
  (0, typeorm_1.ViewColumn)(),
91
95
  __metadata("design:type", Number)
92
96
  ], DiscountsCodeUser.prototype, "local_status", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.ViewColumn)(),
99
+ __metadata("design:type", Number)
100
+ ], DiscountsCodeUser.prototype, "created_by_id", void 0);
101
+ __decorate([
102
+ (0, typeorm_1.ViewColumn)(),
103
+ __metadata("design:type", String)
104
+ ], DiscountsCodeUser.prototype, "created_by_code", void 0);
105
+ __decorate([
106
+ (0, typeorm_1.ViewColumn)(),
107
+ __metadata("design:type", String)
108
+ ], DiscountsCodeUser.prototype, "created_by_name", void 0);
109
+ __decorate([
110
+ (0, typeorm_1.ViewColumn)(),
111
+ __metadata("design:type", String)
112
+ ], DiscountsCodeUser.prototype, "created_by_surname", void 0);
113
+ __decorate([
114
+ (0, typeorm_1.ViewColumn)(),
115
+ __metadata("design:type", String)
116
+ ], DiscountsCodeUser.prototype, "created_by_full_name", void 0);
117
+ __decorate([
118
+ (0, typeorm_1.ViewColumn)(),
119
+ __metadata("design:type", Object)
120
+ ], DiscountsCodeUser.prototype, "created_by_profile", void 0);
121
+ __decorate([
122
+ (0, typeorm_1.ViewColumn)(),
123
+ __metadata("design:type", Number)
124
+ ], DiscountsCodeUser.prototype, "created_by_status", void 0);
93
125
  __decorate([
94
126
  (0, typeorm_1.ViewColumn)(),
95
127
  __metadata("design:type", Number)
@@ -106,6 +138,10 @@ __decorate([
106
138
  (0, typeorm_1.ViewColumn)(),
107
139
  __metadata("design:type", String)
108
140
  ], DiscountsCodeUser.prototype, "partner_surname", void 0);
141
+ __decorate([
142
+ (0, typeorm_1.ViewColumn)(),
143
+ __metadata("design:type", String)
144
+ ], DiscountsCodeUser.prototype, "partner_full_name", void 0);
109
145
  __decorate([
110
146
  (0, typeorm_1.ViewColumn)(),
111
147
  __metadata("design:type", Object)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "3.9.58",
3
+ "version": "3.9.60",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -61,6 +61,17 @@ export class DiscountCodeCompany {
61
61
  })
62
62
  created: Date;
63
63
 
64
+ @ManyToOne(
65
+ () => Master,
66
+ (master) => master.discounts_code_company_created_by,
67
+ {
68
+ onDelete: "CASCADE",
69
+ onUpdate: "NO ACTION",
70
+ },
71
+ )
72
+ @JoinColumn({ name: "created_by" })
73
+ created_by: Master;
74
+
64
75
  @Column({
65
76
  type: "date",
66
77
  comment: "Fecha inicial del descuento.",
@@ -86,11 +97,20 @@ export class DiscountCodeCompany {
86
97
 
87
98
  @Column({
88
99
  type: "datetime",
89
- comment: "Fecha de actualización.",
90
- default: () => "CURRENT_TIMESTAMP",
100
+ default: null,
101
+ nullable: true,
91
102
  onUpdate: "CURRENT_TIMESTAMP",
103
+ comment: "Fecha de actualización.",
104
+ })
105
+ updated: Date | null;
106
+
107
+ @ManyToOne(() => Master, (master) => master.discount_code_companies, {
108
+ onDelete: "CASCADE",
109
+ onUpdate: "NO ACTION",
110
+ nullable: true,
92
111
  })
93
- updated: Date;
112
+ @JoinColumn({ name: "updated_by" })
113
+ updated_by: Master | null;
94
114
 
95
115
  @Column({
96
116
  default: 1,
@@ -101,13 +121,6 @@ export class DiscountCodeCompany {
101
121
  })
102
122
  status: number;
103
123
 
104
- @ManyToOne(() => Master, (master) => master.discount_code_companies, {
105
- onDelete: "CASCADE",
106
- onUpdate: "NO ACTION",
107
- })
108
- @JoinColumn({ name: "updated_by" })
109
- updated_by: Master;
110
-
111
124
  @OneToMany(
112
125
  () => CodeRedemptionHistoryCompany,
113
126
  (codeRedemptionHistoryCompany) =>
@@ -79,6 +79,17 @@ export class DiscountCodeUser {
79
79
  })
80
80
  created: Date;
81
81
 
82
+ @ManyToOne(
83
+ () => Partner,
84
+ (partner) => partner.discounts_code_user_created_by,
85
+ {
86
+ onDelete: "CASCADE",
87
+ onUpdate: "NO ACTION",
88
+ },
89
+ )
90
+ @JoinColumn({ name: "created_by" })
91
+ created_by: Partner;
92
+
82
93
  @Column({
83
94
  type: "date",
84
95
  comment: "Fecha inicial del descuento.",
@@ -102,20 +113,22 @@ export class DiscountCodeUser {
102
113
  })
103
114
  repeat_days: any | null;
104
115
 
105
- @ManyToOne(() => Partner, (partner) => partner.discount_code_partners, {
106
- onDelete: "CASCADE",
107
- onUpdate: "NO ACTION",
108
- })
109
- @JoinColumn({ name: "updated_by" })
110
- updated_by: Partner;
111
-
112
116
  @Column({
113
117
  type: "datetime",
114
- default: () => "CURRENT_TIMESTAMP",
118
+ nullable: true,
119
+ default: null,
115
120
  onUpdate: "CURRENT_TIMESTAMP",
116
121
  comment: "Fecha de actualización.",
117
122
  })
118
- updated: Date;
123
+ updated: Date | null;
124
+
125
+ @ManyToOne(() => Partner, (partner) => partner.discount_code_partners, {
126
+ onDelete: "CASCADE",
127
+ onUpdate: "NO ACTION",
128
+ nullable: true,
129
+ })
130
+ @JoinColumn({ name: "updated_by" })
131
+ updated_by: Partner | null;
119
132
 
120
133
  @Column({
121
134
  default: 1,
@@ -148,6 +148,12 @@ export class Master {
148
148
  })
149
149
  visible: number;
150
150
 
151
+ @OneToMany(
152
+ () => DiscountCodeCompany,
153
+ (discountCodeCompany) => discountCodeCompany.created_by,
154
+ )
155
+ discounts_code_company_created_by: DiscountCodeCompany[];
156
+
151
157
  @OneToMany(
152
158
  () => DiscountCodeCompany,
153
159
  (discountCodeCompany) => discountCodeCompany.updated_by,
@@ -185,6 +185,12 @@ export class Partner {
185
185
  @OneToMany(() => Company, (company) => company.partner)
186
186
  companies: Company[];
187
187
 
188
+ @OneToMany(
189
+ () => DiscountCodeUser,
190
+ (discountCodeUser) => discountCodeUser.created_by,
191
+ )
192
+ discounts_code_user_created_by: DiscountCodeUser[];
193
+
188
194
  @OneToMany(
189
195
  () => DiscountCodeUser,
190
196
  (discountCodeUser) => discountCodeUser.updated_by,
@@ -1,5 +1,6 @@
1
1
  import { Repository } from "typeorm";
2
2
  import { IBasicCompany } from "../interfaces";
3
+ import { query } from "express";
3
4
 
4
5
  export async function getLocalsCompanyInformationTable(
5
6
  repository: Repository<any>,
@@ -17,7 +18,7 @@ export async function getLocalsCompanyInformationTable(
17
18
  "global"
18
19
  ].value.toLowerCase()}%`;
19
20
  queryBuilder.andWhere(
20
- "(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)",
21
+ "(LOWER(locals_company_information_for_the_table.code) LIKE :globalValue OR 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)",
21
22
  { globalValue },
22
23
  );
23
24
  }
@@ -31,6 +31,9 @@ export class DiscountsCodeUser {
31
31
  @ViewColumn()
32
32
  created: Date;
33
33
 
34
+ @ViewColumn()
35
+ created_by: number;
36
+
34
37
  @ViewColumn()
35
38
  start: string;
36
39
 
@@ -61,6 +64,27 @@ export class DiscountsCodeUser {
61
64
  @ViewColumn()
62
65
  local_status: number;
63
66
 
67
+ @ViewColumn()
68
+ created_by_id: number;
69
+
70
+ @ViewColumn()
71
+ created_by_code: string;
72
+
73
+ @ViewColumn()
74
+ created_by_name: string;
75
+
76
+ @ViewColumn()
77
+ created_by_surname: string;
78
+
79
+ @ViewColumn()
80
+ created_by_full_name: string;
81
+
82
+ @ViewColumn()
83
+ created_by_profile: any;
84
+
85
+ @ViewColumn()
86
+ created_by_status: number;
87
+
64
88
  @ViewColumn()
65
89
  partner_id: number;
66
90
 
@@ -73,6 +97,9 @@ export class DiscountsCodeUser {
73
97
  @ViewColumn()
74
98
  partner_surname: string;
75
99
 
100
+ @ViewColumn()
101
+ partner_full_name: string;
102
+
76
103
  @ViewColumn()
77
104
  partner_profile: any;
78
105