test-entity-library-asm 3.9.59 → 3.9.61
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.
- package/dist/CustomRepository.d.ts +0 -5
- package/dist/entities/DiscountCodeCompany.d.ts +3 -2
- package/dist/entities/DiscountCodeCompany.js +21 -11
- package/dist/entities/DiscountCodeUser.d.ts +3 -2
- package/dist/entities/DiscountCodeUser.js +20 -10
- package/dist/entities/Master.d.ts +1 -0
- package/dist/entities/Master.js +4 -0
- package/dist/entities/Partner.d.ts +1 -0
- package/dist/entities/Partner.js +4 -0
- package/dist/filters/LocalsCompanyInformationForTheTable.d.ts +0 -5
- package/dist/filters/LocalsCompanyInformationForTheTable.js +1 -4
- package/dist/index.d.ts +0 -5
- package/dist/views/DiscountsCodeUser.d.ts +9 -0
- package/dist/views/DiscountsCodeUser.js +36 -0
- package/dist/views/LocalsCompany.js +9 -9
- package/package.json +1 -1
- package/src/entities/DiscountCodeCompany.ts +23 -10
- package/src/entities/DiscountCodeUser.ts +22 -9
- package/src/entities/Master.ts +6 -0
- package/src/entities/Partner.ts +6 -0
- package/src/filters/LocalsCompanyInformationForTheTable.ts +1 -5
- package/src/views/DiscountsCodeUser.ts +27 -0
- package/src/views/LocalsCompany.ts +9 -9
|
@@ -25,10 +25,5 @@ export declare class CustomRepository<T extends ObjectLiteral> extends Repositor
|
|
|
25
25
|
getLocalsCompanyInformationForTheTableWrapper(params: IBasicCompany): Promise<{
|
|
26
26
|
data: any[];
|
|
27
27
|
totalRecords: number;
|
|
28
|
-
query: [string, any[]];
|
|
29
|
-
} | {
|
|
30
|
-
data: never[];
|
|
31
|
-
totalRecords: number;
|
|
32
|
-
query: null;
|
|
33
28
|
}>;
|
|
34
29
|
}
|
|
@@ -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
|
-
|
|
100
|
-
|
|
107
|
+
default: null,
|
|
108
|
+
nullable: true,
|
|
101
109
|
onUpdate: "CURRENT_TIMESTAMP",
|
|
110
|
+
comment: "Fecha de actualización.",
|
|
102
111
|
}),
|
|
103
|
-
__metadata("design:type",
|
|
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
|
-
|
|
19
|
-
|
|
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
|
-
|
|
127
|
+
nullable: true,
|
|
128
|
+
default: null,
|
|
128
129
|
onUpdate: "CURRENT_TIMESTAMP",
|
|
129
130
|
comment: "Fecha de actualización.",
|
|
130
131
|
}),
|
|
131
|
-
__metadata("design:type",
|
|
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[];
|
package/dist/entities/Master.js
CHANGED
|
@@ -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)
|
package/dist/entities/Partner.js
CHANGED
|
@@ -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)
|
|
@@ -3,9 +3,4 @@ import { IBasicCompany } from "../interfaces";
|
|
|
3
3
|
export declare function getLocalsCompanyInformationTable(repository: Repository<any>, { company, status, visible, lazyEvent }: IBasicCompany): Promise<{
|
|
4
4
|
data: any[];
|
|
5
5
|
totalRecords: number;
|
|
6
|
-
query: [string, any[]];
|
|
7
|
-
} | {
|
|
8
|
-
data: never[];
|
|
9
|
-
totalRecords: number;
|
|
10
|
-
query: null;
|
|
11
6
|
}>;
|
|
@@ -211,19 +211,16 @@ async function getLocalsCompanyInformationTable(repository, { company, status, v
|
|
|
211
211
|
const [data, totalRecords] = await queryBuilder.getManyAndCount();
|
|
212
212
|
// DOC: Si quieres ver la consulta generada, puedes descomentar las siguientes líneas:
|
|
213
213
|
// console.log("Query:", queryBuilder.getQuery());
|
|
214
|
-
console.log("Query:", queryBuilder.getQueryAndParameters());
|
|
214
|
+
// console.log("Query:", queryBuilder.getQueryAndParameters());
|
|
215
215
|
return {
|
|
216
216
|
data,
|
|
217
217
|
totalRecords,
|
|
218
|
-
query: queryBuilder.getQueryAndParameters(),
|
|
219
218
|
};
|
|
220
219
|
}
|
|
221
220
|
catch (error) {
|
|
222
|
-
console.log(error, "error por acá");
|
|
223
221
|
return {
|
|
224
222
|
data: [],
|
|
225
223
|
totalRecords: 0,
|
|
226
|
-
query: null,
|
|
227
224
|
};
|
|
228
225
|
}
|
|
229
226
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -33,10 +33,5 @@ export declare const getRepositoryByEntity: <T extends ObjectLiteral>(entity: En
|
|
|
33
33
|
getLocalsCompanyInformationForTheTableWrapper(params: IBasicCompany): Promise<{
|
|
34
34
|
data: any[];
|
|
35
35
|
totalRecords: number;
|
|
36
|
-
query: [string, any[]];
|
|
37
|
-
} | {
|
|
38
|
-
data: never[];
|
|
39
|
-
totalRecords: number;
|
|
40
|
-
query: null;
|
|
41
36
|
}>;
|
|
42
37
|
}>;
|
|
@@ -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)
|
|
@@ -12,10 +12,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.LocalsCompany = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
// JSON Transformer
|
|
15
|
-
const jsonTransformer = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
15
|
+
// const jsonTransformer = {
|
|
16
|
+
// to: (value: any) => JSON.stringify(value),
|
|
17
|
+
// from: (value: string) => JSON.parse(value),
|
|
18
|
+
// };
|
|
19
19
|
let LocalsCompany = class LocalsCompany {
|
|
20
20
|
};
|
|
21
21
|
exports.LocalsCompany = LocalsCompany;
|
|
@@ -44,7 +44,7 @@ __decorate([
|
|
|
44
44
|
__metadata("design:type", String)
|
|
45
45
|
], LocalsCompany.prototype, "longitude", void 0);
|
|
46
46
|
__decorate([
|
|
47
|
-
(0, typeorm_1.ViewColumn)(
|
|
47
|
+
(0, typeorm_1.ViewColumn)(),
|
|
48
48
|
__metadata("design:type", Object)
|
|
49
49
|
], LocalsCompany.prototype, "details", void 0);
|
|
50
50
|
__decorate([
|
|
@@ -100,7 +100,7 @@ __decorate([
|
|
|
100
100
|
__metadata("design:type", Number)
|
|
101
101
|
], LocalsCompany.prototype, "country_status", void 0);
|
|
102
102
|
__decorate([
|
|
103
|
-
(0, typeorm_1.ViewColumn)(
|
|
103
|
+
(0, typeorm_1.ViewColumn)(),
|
|
104
104
|
__metadata("design:type", Object)
|
|
105
105
|
], LocalsCompany.prototype, "country_details", void 0);
|
|
106
106
|
__decorate([
|
|
@@ -148,11 +148,11 @@ __decorate([
|
|
|
148
148
|
__metadata("design:type", String)
|
|
149
149
|
], LocalsCompany.prototype, "pos_system_description", void 0);
|
|
150
150
|
__decorate([
|
|
151
|
-
(0, typeorm_1.ViewColumn)(
|
|
151
|
+
(0, typeorm_1.ViewColumn)(),
|
|
152
152
|
__metadata("design:type", Object)
|
|
153
153
|
], LocalsCompany.prototype, "pos_system_endpoint_products", void 0);
|
|
154
154
|
__decorate([
|
|
155
|
-
(0, typeorm_1.ViewColumn)(
|
|
155
|
+
(0, typeorm_1.ViewColumn)(),
|
|
156
156
|
__metadata("design:type", Object)
|
|
157
157
|
], LocalsCompany.prototype, "pos_system_endpoint_order", void 0);
|
|
158
158
|
__decorate([
|
|
@@ -160,7 +160,7 @@ __decorate([
|
|
|
160
160
|
__metadata("design:type", Object)
|
|
161
161
|
], LocalsCompany.prototype, "pos_system_authentication_credentials", void 0);
|
|
162
162
|
__decorate([
|
|
163
|
-
(0, typeorm_1.ViewColumn)(
|
|
163
|
+
(0, typeorm_1.ViewColumn)(),
|
|
164
164
|
__metadata("design:type", Object)
|
|
165
165
|
], LocalsCompany.prototype, "pos_system_settings", void 0);
|
|
166
166
|
__decorate([
|
package/package.json
CHANGED
|
@@ -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
|
-
|
|
90
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
package/src/entities/Master.ts
CHANGED
|
@@ -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,
|
package/src/entities/Partner.ts
CHANGED
|
@@ -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,
|
|
@@ -253,20 +253,16 @@ export async function getLocalsCompanyInformationTable(
|
|
|
253
253
|
|
|
254
254
|
// DOC: Si quieres ver la consulta generada, puedes descomentar las siguientes líneas:
|
|
255
255
|
// console.log("Query:", queryBuilder.getQuery());
|
|
256
|
-
console.log("Query:", queryBuilder.getQueryAndParameters());
|
|
256
|
+
// console.log("Query:", queryBuilder.getQueryAndParameters());
|
|
257
257
|
|
|
258
258
|
return {
|
|
259
259
|
data,
|
|
260
260
|
totalRecords,
|
|
261
|
-
query: queryBuilder.getQueryAndParameters(),
|
|
262
261
|
};
|
|
263
262
|
} catch (error) {
|
|
264
|
-
console.log(error, "error por acá");
|
|
265
|
-
|
|
266
263
|
return {
|
|
267
264
|
data: [],
|
|
268
265
|
totalRecords: 0,
|
|
269
|
-
query: null,
|
|
270
266
|
};
|
|
271
267
|
}
|
|
272
268
|
}
|
|
@@ -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
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ViewColumn, ViewEntity } from "typeorm";
|
|
2
2
|
|
|
3
3
|
// JSON Transformer
|
|
4
|
-
const jsonTransformer = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
4
|
+
// const jsonTransformer = {
|
|
5
|
+
// to: (value: any) => JSON.stringify(value),
|
|
6
|
+
// from: (value: string) => JSON.parse(value),
|
|
7
|
+
// };
|
|
8
8
|
|
|
9
9
|
@ViewEntity({
|
|
10
10
|
name: "locals_company",
|
|
@@ -28,7 +28,7 @@ export class LocalsCompany {
|
|
|
28
28
|
@ViewColumn()
|
|
29
29
|
longitude: string;
|
|
30
30
|
|
|
31
|
-
@ViewColumn(
|
|
31
|
+
@ViewColumn()
|
|
32
32
|
details: any | null;
|
|
33
33
|
|
|
34
34
|
@ViewColumn()
|
|
@@ -70,7 +70,7 @@ export class LocalsCompany {
|
|
|
70
70
|
@ViewColumn()
|
|
71
71
|
country_status: number;
|
|
72
72
|
|
|
73
|
-
@ViewColumn(
|
|
73
|
+
@ViewColumn()
|
|
74
74
|
country_details: any | null;
|
|
75
75
|
|
|
76
76
|
@ViewColumn()
|
|
@@ -106,16 +106,16 @@ export class LocalsCompany {
|
|
|
106
106
|
@ViewColumn()
|
|
107
107
|
pos_system_description: string;
|
|
108
108
|
|
|
109
|
-
@ViewColumn(
|
|
109
|
+
@ViewColumn()
|
|
110
110
|
pos_system_endpoint_products: any;
|
|
111
111
|
|
|
112
|
-
@ViewColumn(
|
|
112
|
+
@ViewColumn()
|
|
113
113
|
pos_system_endpoint_order: any;
|
|
114
114
|
|
|
115
115
|
@ViewColumn()
|
|
116
116
|
pos_system_authentication_credentials: number | null;
|
|
117
117
|
|
|
118
|
-
@ViewColumn(
|
|
118
|
+
@ViewColumn()
|
|
119
119
|
pos_system_settings: any | null;
|
|
120
120
|
|
|
121
121
|
@ViewColumn()
|