test-entity-library-asm 3.1.4 → 3.1.6
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/entities/Local.d.ts +11 -13
- package/dist/entities/Local.js +43 -48
- package/dist/entities/Partner.d.ts +2 -6
- package/dist/entities/Partner.js +3 -24
- package/dist/entities/Terminal.d.ts +3 -3
- package/dist/entities/Terminal.js +19 -11
- package/dist/entities.views.routes.d.ts +0 -2
- package/dist/entities.views.routes.js +2 -6
- package/dist/filters/LoginTerminalPartner.d.ts +3 -0
- package/dist/filters/LoginTerminalPartner.js +74 -0
- package/dist/interfaces.d.ts +3 -0
- package/package.json +1 -1
- package/src/CustomRepository.ts +1 -0
- package/src/entities/Local.ts +79 -84
- package/src/entities/Partner.ts +4 -27
- package/src/entities.views.routes.ts +0 -2
- package/src/interfaces.ts +4 -0
- package/src/entities/Terminal.ts +0 -60
- package/src/entities/TerminalSession.ts +0 -56
package/dist/entities/Local.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { DiscountCodeUser, LocalPlan, PosSystem } from '..';
|
|
1
|
+
import { DiscountCodeUser, LocalPlan, PosSystem } from "..";
|
|
2
|
+
import { BusinessTypeProduct } from "./BusinessTypeProduct";
|
|
3
|
+
import { Category } from "./Category";
|
|
4
|
+
import { City } from "./City";
|
|
5
|
+
import { Company } from "./Company";
|
|
6
|
+
import { LocalQualification } from "./LocalQualification";
|
|
7
|
+
import { Partner } from "./Partner";
|
|
8
|
+
import { PaymentMethod } from "./PaymentMethod";
|
|
9
|
+
import { Request } from "./Request";
|
|
10
|
+
import { Square } from "./Square";
|
|
11
|
+
import { User } from "./User";
|
|
13
12
|
export declare class Local {
|
|
14
13
|
id: number;
|
|
15
14
|
company: Company;
|
|
@@ -32,7 +31,6 @@ export declare class Local {
|
|
|
32
31
|
payment_methods: PaymentMethod[];
|
|
33
32
|
qualifications: LocalQualification[];
|
|
34
33
|
requests: Request[];
|
|
35
|
-
terminals: Terminal[];
|
|
36
34
|
users_favorite_local: User[];
|
|
37
35
|
business_type_products: BusinessTypeProduct[];
|
|
38
36
|
discount_code_locals: DiscountCodeUser[];
|
package/dist/entities/Local.js
CHANGED
|
@@ -11,34 +11,33 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Local = void 0;
|
|
13
13
|
var typeorm_1 = require("typeorm");
|
|
14
|
+
var __1 = require("..");
|
|
15
|
+
var jsonTransformer_1 = require("../transformers/jsonTransformer");
|
|
16
|
+
var BusinessTypeProduct_1 = require("./BusinessTypeProduct");
|
|
14
17
|
var Category_1 = require("./Category");
|
|
15
18
|
var City_1 = require("./City");
|
|
16
19
|
var Company_1 = require("./Company");
|
|
17
20
|
var LocalQualification_1 = require("./LocalQualification");
|
|
21
|
+
var Partner_1 = require("./Partner");
|
|
18
22
|
var PaymentMethod_1 = require("./PaymentMethod");
|
|
19
23
|
var Request_1 = require("./Request");
|
|
20
24
|
var Square_1 = require("./Square");
|
|
21
|
-
var Terminal_1 = require("./Terminal");
|
|
22
25
|
var User_1 = require("./User");
|
|
23
|
-
var Partner_1 = require("./Partner");
|
|
24
|
-
var BusinessTypeProduct_1 = require("./BusinessTypeProduct");
|
|
25
|
-
var __1 = require("..");
|
|
26
|
-
var jsonTransformer_1 = require("../transformers/jsonTransformer");
|
|
27
26
|
var Local = /** @class */ (function () {
|
|
28
27
|
function Local() {
|
|
29
28
|
}
|
|
30
29
|
__decorate([
|
|
31
30
|
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
32
|
-
comment:
|
|
31
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
33
32
|
}),
|
|
34
33
|
__metadata("design:type", Number)
|
|
35
34
|
], Local.prototype, "id", void 0);
|
|
36
35
|
__decorate([
|
|
37
36
|
(0, typeorm_1.ManyToOne)(function () { return Company_1.Company; }, function (company) { return company.locals; }, {
|
|
38
|
-
onDelete:
|
|
39
|
-
onUpdate:
|
|
37
|
+
onDelete: "CASCADE",
|
|
38
|
+
onUpdate: "NO ACTION",
|
|
40
39
|
}),
|
|
41
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
40
|
+
(0, typeorm_1.JoinColumn)({ name: "company" }),
|
|
42
41
|
__metadata("design:type", Company_1.Company)
|
|
43
42
|
], Local.prototype, "company", void 0);
|
|
44
43
|
__decorate([
|
|
@@ -47,10 +46,10 @@ var Local = /** @class */ (function () {
|
|
|
47
46
|
], Local.prototype, "name", void 0);
|
|
48
47
|
__decorate([
|
|
49
48
|
(0, typeorm_1.ManyToOne)(function () { return City_1.City; }, function (city) { return city.locals; }, {
|
|
50
|
-
onDelete:
|
|
51
|
-
onUpdate:
|
|
49
|
+
onDelete: "RESTRICT",
|
|
50
|
+
onUpdate: "NO ACTION",
|
|
52
51
|
}),
|
|
53
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
52
|
+
(0, typeorm_1.JoinColumn)({ name: "city" }),
|
|
54
53
|
__metadata("design:type", City_1.City)
|
|
55
54
|
], Local.prototype, "city", void 0);
|
|
56
55
|
__decorate([
|
|
@@ -58,88 +57,88 @@ var Local = /** @class */ (function () {
|
|
|
58
57
|
__metadata("design:type", String)
|
|
59
58
|
], Local.prototype, "address", void 0);
|
|
60
59
|
__decorate([
|
|
61
|
-
(0, typeorm_1.Column)({ type:
|
|
60
|
+
(0, typeorm_1.Column)({ type: "decimal", precision: 10, scale: 8 }),
|
|
62
61
|
__metadata("design:type", Number)
|
|
63
62
|
], Local.prototype, "latitude", void 0);
|
|
64
63
|
__decorate([
|
|
65
|
-
(0, typeorm_1.Column)({ type:
|
|
64
|
+
(0, typeorm_1.Column)({ type: "decimal", precision: 10, scale: 8 }),
|
|
66
65
|
__metadata("design:type", Number)
|
|
67
66
|
], Local.prototype, "longitude", void 0);
|
|
68
67
|
__decorate([
|
|
69
68
|
(0, typeorm_1.Column)({
|
|
70
|
-
type:
|
|
69
|
+
type: "longtext",
|
|
71
70
|
nullable: true,
|
|
72
71
|
transformer: jsonTransformer_1.jsonTransformer,
|
|
73
|
-
comment:
|
|
72
|
+
comment: "Campo de tipo JSON por si es necesario agregar información adicional",
|
|
74
73
|
}),
|
|
75
74
|
__metadata("design:type", Object)
|
|
76
75
|
], Local.prototype, "details", void 0);
|
|
77
76
|
__decorate([
|
|
78
|
-
(0, typeorm_1.Column)({ type:
|
|
77
|
+
(0, typeorm_1.Column)({ type: "datetime" }),
|
|
79
78
|
__metadata("design:type", Date)
|
|
80
79
|
], Local.prototype, "created", void 0);
|
|
81
80
|
__decorate([
|
|
82
|
-
(0, typeorm_1.Column)({ type:
|
|
81
|
+
(0, typeorm_1.Column)({ type: "datetime" }),
|
|
83
82
|
__metadata("design:type", Date)
|
|
84
83
|
], Local.prototype, "updated", void 0);
|
|
85
84
|
__decorate([
|
|
86
85
|
(0, typeorm_1.ManyToOne)(function () { return Partner_1.Partner; }, function (partner) { return partner.locals; }, {
|
|
87
|
-
onDelete:
|
|
88
|
-
onUpdate:
|
|
86
|
+
onDelete: "NO ACTION",
|
|
87
|
+
onUpdate: "NO ACTION",
|
|
89
88
|
}),
|
|
90
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
89
|
+
(0, typeorm_1.JoinColumn)({ name: "updated_by" }),
|
|
91
90
|
__metadata("design:type", Partner_1.Partner)
|
|
92
91
|
], Local.prototype, "updated_by", void 0);
|
|
93
92
|
__decorate([
|
|
94
93
|
(0, typeorm_1.ManyToOne)(function () { return Square_1.Square; }, function (square) { return square.locals; }, {
|
|
95
|
-
onDelete:
|
|
96
|
-
onUpdate:
|
|
94
|
+
onDelete: "RESTRICT",
|
|
95
|
+
onUpdate: "NO ACTION",
|
|
97
96
|
}),
|
|
98
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
97
|
+
(0, typeorm_1.JoinColumn)({ name: "square" }),
|
|
99
98
|
__metadata("design:type", Square_1.Square)
|
|
100
99
|
], Local.prototype, "square", void 0);
|
|
101
100
|
__decorate([
|
|
102
101
|
(0, typeorm_1.ManyToOne)(function () { return __1.PosSystem; }, function (posSystem) { return posSystem.locals_pos_system; }, {
|
|
103
|
-
onDelete:
|
|
104
|
-
onUpdate:
|
|
102
|
+
onDelete: "RESTRICT",
|
|
103
|
+
onUpdate: "NO ACTION",
|
|
105
104
|
}),
|
|
106
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
105
|
+
(0, typeorm_1.JoinColumn)({ name: "pos_system" }),
|
|
107
106
|
__metadata("design:type", __1.PosSystem)
|
|
108
107
|
], Local.prototype, "pos_system", void 0);
|
|
109
108
|
__decorate([
|
|
110
109
|
(0, typeorm_1.Column)({
|
|
111
|
-
type:
|
|
110
|
+
type: "text",
|
|
112
111
|
nullable: true,
|
|
113
112
|
transformer: jsonTransformer_1.jsonTransformer,
|
|
114
|
-
comment:
|
|
113
|
+
comment: "Campo de tipo JSON por si es necesario agregar información adicional",
|
|
115
114
|
}),
|
|
116
115
|
__metadata("design:type", String)
|
|
117
116
|
], Local.prototype, "pos_system_settings", void 0);
|
|
118
117
|
__decorate([
|
|
119
118
|
(0, typeorm_1.Column)({
|
|
120
119
|
default: 1,
|
|
121
|
-
comment:
|
|
120
|
+
comment: "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
122
121
|
}),
|
|
123
122
|
__metadata("design:type", Number)
|
|
124
123
|
], Local.prototype, "status", void 0);
|
|
125
124
|
__decorate([
|
|
126
125
|
(0, typeorm_1.Column)({
|
|
127
126
|
default: 1,
|
|
128
|
-
comment:
|
|
127
|
+
comment: "Es el estado para verificar si se envía en la papelera o no.",
|
|
129
128
|
}),
|
|
130
129
|
__metadata("design:type", Number)
|
|
131
130
|
], Local.prototype, "visible", void 0);
|
|
132
131
|
__decorate([
|
|
133
132
|
(0, typeorm_1.ManyToMany)(function () { return Partner_1.Partner; }, function (partner) { return partner.locals_partner; }),
|
|
134
133
|
(0, typeorm_1.JoinTable)({
|
|
135
|
-
name:
|
|
134
|
+
name: "local_partner",
|
|
136
135
|
joinColumn: {
|
|
137
|
-
name:
|
|
138
|
-
referencedColumnName:
|
|
136
|
+
name: "local",
|
|
137
|
+
referencedColumnName: "id",
|
|
139
138
|
},
|
|
140
139
|
inverseJoinColumn: {
|
|
141
|
-
name:
|
|
142
|
-
referencedColumnName:
|
|
140
|
+
name: "partner",
|
|
141
|
+
referencedColumnName: "id",
|
|
143
142
|
},
|
|
144
143
|
}),
|
|
145
144
|
__metadata("design:type", Array)
|
|
@@ -151,7 +150,7 @@ var Local = /** @class */ (function () {
|
|
|
151
150
|
__decorate([
|
|
152
151
|
(0, typeorm_1.ManyToMany)(function () { return PaymentMethod_1.PaymentMethod; }),
|
|
153
152
|
(0, typeorm_1.JoinTable)({
|
|
154
|
-
name:
|
|
153
|
+
name: "local_payment_method",
|
|
155
154
|
}),
|
|
156
155
|
__metadata("design:type", Array)
|
|
157
156
|
], Local.prototype, "payment_methods", void 0);
|
|
@@ -163,28 +162,24 @@ var Local = /** @class */ (function () {
|
|
|
163
162
|
(0, typeorm_1.OneToMany)(function () { return Request_1.Request; }, function (request) { return request.local; }),
|
|
164
163
|
__metadata("design:type", Array)
|
|
165
164
|
], Local.prototype, "requests", void 0);
|
|
166
|
-
__decorate([
|
|
167
|
-
(0, typeorm_1.OneToMany)(function () { return Terminal_1.Terminal; }, function (terminal) { return terminal.local; }),
|
|
168
|
-
__metadata("design:type", Array)
|
|
169
|
-
], Local.prototype, "terminals", void 0);
|
|
170
165
|
__decorate([
|
|
171
166
|
(0, typeorm_1.ManyToMany)(function () { return User_1.User; }),
|
|
172
167
|
(0, typeorm_1.JoinTable)({
|
|
173
|
-
name:
|
|
168
|
+
name: "user_favorite_local",
|
|
174
169
|
}),
|
|
175
170
|
__metadata("design:type", Array)
|
|
176
171
|
], Local.prototype, "users_favorite_local", void 0);
|
|
177
172
|
__decorate([
|
|
178
173
|
(0, typeorm_1.ManyToMany)(function () { return BusinessTypeProduct_1.BusinessTypeProduct; }),
|
|
179
174
|
(0, typeorm_1.JoinTable)({
|
|
180
|
-
name:
|
|
175
|
+
name: "business_type_product_local",
|
|
181
176
|
joinColumn: {
|
|
182
|
-
name:
|
|
183
|
-
referencedColumnName:
|
|
177
|
+
name: "local",
|
|
178
|
+
referencedColumnName: "id",
|
|
184
179
|
},
|
|
185
180
|
inverseJoinColumn: {
|
|
186
|
-
name:
|
|
187
|
-
referencedColumnName:
|
|
181
|
+
name: "business_type_product",
|
|
182
|
+
referencedColumnName: "id",
|
|
188
183
|
},
|
|
189
184
|
}),
|
|
190
185
|
__metadata("design:type", Array)
|
|
@@ -198,7 +193,7 @@ var Local = /** @class */ (function () {
|
|
|
198
193
|
__metadata("design:type", Array)
|
|
199
194
|
], Local.prototype, "locals_plan", void 0);
|
|
200
195
|
Local = __decorate([
|
|
201
|
-
(0, typeorm_1.Entity)({ comment:
|
|
196
|
+
(0, typeorm_1.Entity)({ comment: "Locales disponibles de las empresas (company)." })
|
|
202
197
|
], Local);
|
|
203
198
|
return Local;
|
|
204
199
|
}());
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
+
import { Category, MasterNotification, Product, VerifyLocal } from "..";
|
|
1
2
|
import { City } from "./City";
|
|
2
3
|
import { Company } from "./Company";
|
|
3
4
|
import { DiscountCodeUser } from "./DiscountCodeUser";
|
|
4
5
|
import { Local } from "./Local";
|
|
5
|
-
import { PartnerRole } from "./PartnerRole";
|
|
6
|
-
import { Terminal } from "./Terminal";
|
|
7
|
-
import { TerminalSession } from "./TerminalSession";
|
|
8
6
|
import { PartnerNotification } from "./PartnerNotification";
|
|
9
|
-
import {
|
|
7
|
+
import { PartnerRole } from "./PartnerRole";
|
|
10
8
|
export declare class Partner {
|
|
11
9
|
id: number;
|
|
12
10
|
company: Company;
|
|
@@ -30,8 +28,6 @@ export declare class Partner {
|
|
|
30
28
|
locals: Local[];
|
|
31
29
|
locals_partner: Local[];
|
|
32
30
|
partners_roles: PartnerRole[];
|
|
33
|
-
terminals: Terminal[];
|
|
34
|
-
sessions: TerminalSession[];
|
|
35
31
|
partners_notification: PartnerNotification[];
|
|
36
32
|
verifyLocals: VerifyLocal[];
|
|
37
33
|
partners_to_notification: PartnerNotification[];
|
package/dist/entities/Partner.js
CHANGED
|
@@ -11,17 +11,15 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Partner = void 0;
|
|
13
13
|
var typeorm_1 = require("typeorm");
|
|
14
|
+
var __1 = require("..");
|
|
15
|
+
var dateTransformer_1 = require("../transformers/dateTransformer");
|
|
14
16
|
var jsonTransformer_1 = require("../transformers/jsonTransformer");
|
|
15
17
|
var City_1 = require("./City");
|
|
16
18
|
var Company_1 = require("./Company");
|
|
17
19
|
var DiscountCodeUser_1 = require("./DiscountCodeUser");
|
|
18
20
|
var Local_1 = require("./Local");
|
|
19
|
-
var PartnerRole_1 = require("./PartnerRole");
|
|
20
|
-
var Terminal_1 = require("./Terminal");
|
|
21
|
-
var TerminalSession_1 = require("./TerminalSession");
|
|
22
|
-
var dateTransformer_1 = require("../transformers/dateTransformer");
|
|
23
21
|
var PartnerNotification_1 = require("./PartnerNotification");
|
|
24
|
-
var
|
|
22
|
+
var PartnerRole_1 = require("./PartnerRole");
|
|
25
23
|
var Partner = /** @class */ (function () {
|
|
26
24
|
function Partner() {
|
|
27
25
|
}
|
|
@@ -184,25 +182,6 @@ var Partner = /** @class */ (function () {
|
|
|
184
182
|
}),
|
|
185
183
|
__metadata("design:type", Array)
|
|
186
184
|
], Partner.prototype, "partners_roles", void 0);
|
|
187
|
-
__decorate([
|
|
188
|
-
(0, typeorm_1.ManyToMany)(function () { return Terminal_1.Terminal; }, function (terminal) { return terminal.partners; }),
|
|
189
|
-
(0, typeorm_1.JoinTable)({
|
|
190
|
-
name: "partner_terminal",
|
|
191
|
-
joinColumn: {
|
|
192
|
-
name: "partner",
|
|
193
|
-
referencedColumnName: "id",
|
|
194
|
-
},
|
|
195
|
-
inverseJoinColumn: {
|
|
196
|
-
name: "terminal",
|
|
197
|
-
referencedColumnName: "id",
|
|
198
|
-
},
|
|
199
|
-
}),
|
|
200
|
-
__metadata("design:type", Array)
|
|
201
|
-
], Partner.prototype, "terminals", void 0);
|
|
202
|
-
__decorate([
|
|
203
|
-
(0, typeorm_1.OneToMany)(function () { return TerminalSession_1.TerminalSession; }, function (terminalSession) { return terminalSession.partner; }),
|
|
204
|
-
__metadata("design:type", Array)
|
|
205
|
-
], Partner.prototype, "sessions", void 0);
|
|
206
185
|
__decorate([
|
|
207
186
|
(0, typeorm_1.OneToMany)(function () { return PartnerNotification_1.PartnerNotification; }, function (partnerNotification) { return partnerNotification.partner; }),
|
|
208
187
|
__metadata("design:type", Array)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Local } from "./Local";
|
|
2
|
+
import { Partner } from "./Partner";
|
|
3
|
+
import { TerminalSession } from "./TerminalSession";
|
|
4
4
|
export declare class Terminal {
|
|
5
5
|
id: number;
|
|
6
6
|
local: Local;
|
|
@@ -11,50 +11,58 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.Terminal = void 0;
|
|
13
13
|
var typeorm_1 = require("typeorm");
|
|
14
|
-
var TerminalSession_1 = require("./TerminalSession");
|
|
15
14
|
var Local_1 = require("./Local");
|
|
16
15
|
var Partner_1 = require("./Partner");
|
|
16
|
+
var TerminalSession_1 = require("./TerminalSession");
|
|
17
17
|
var Terminal = /** @class */ (function () {
|
|
18
18
|
function Terminal() {
|
|
19
19
|
}
|
|
20
20
|
__decorate([
|
|
21
21
|
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
22
|
-
comment:
|
|
22
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
23
23
|
}),
|
|
24
24
|
__metadata("design:type", Number)
|
|
25
25
|
], Terminal.prototype, "id", void 0);
|
|
26
26
|
__decorate([
|
|
27
27
|
(0, typeorm_1.ManyToOne)(function () { return Local_1.Local; }, function (local) { return local.terminals; }, {
|
|
28
28
|
nullable: true,
|
|
29
|
-
onDelete:
|
|
30
|
-
onUpdate:
|
|
29
|
+
onDelete: "CASCADE",
|
|
30
|
+
onUpdate: "NO ACTION",
|
|
31
31
|
}),
|
|
32
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
32
|
+
(0, typeorm_1.JoinColumn)({ name: "local" }),
|
|
33
33
|
__metadata("design:type", Local_1.Local)
|
|
34
34
|
], Terminal.prototype, "local", void 0);
|
|
35
35
|
__decorate([
|
|
36
|
-
(0, typeorm_1.Column)({ length: 50, comment:
|
|
36
|
+
(0, typeorm_1.Column)({ length: 50, comment: "Nombre de la terminal." }),
|
|
37
37
|
__metadata("design:type", String)
|
|
38
38
|
], Terminal.prototype, "name", void 0);
|
|
39
39
|
__decorate([
|
|
40
40
|
(0, typeorm_1.Column)({
|
|
41
|
-
type:
|
|
41
|
+
type: "longtext",
|
|
42
42
|
nullable: true,
|
|
43
|
-
comment:
|
|
43
|
+
comment: "Campo de tipo JSON donde se guarda información necesaria para la terminal si es necesario",
|
|
44
44
|
}),
|
|
45
45
|
__metadata("design:type", String)
|
|
46
46
|
], Terminal.prototype, "settings", void 0);
|
|
47
47
|
__decorate([
|
|
48
48
|
(0, typeorm_1.Column)({
|
|
49
49
|
default: 1,
|
|
50
|
-
comment:
|
|
50
|
+
comment: "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
51
51
|
}),
|
|
52
52
|
__metadata("design:type", Number)
|
|
53
53
|
], Terminal.prototype, "status", void 0);
|
|
54
54
|
__decorate([
|
|
55
55
|
(0, typeorm_1.ManyToMany)(function () { return Partner_1.Partner; }, function (partner) { return partner.terminals; }),
|
|
56
56
|
(0, typeorm_1.JoinTable)({
|
|
57
|
-
name:
|
|
57
|
+
name: "partner_terminal",
|
|
58
|
+
joinColumn: {
|
|
59
|
+
name: "terminal",
|
|
60
|
+
referencedColumnName: "id",
|
|
61
|
+
},
|
|
62
|
+
inverseJoinColumn: {
|
|
63
|
+
name: "partner",
|
|
64
|
+
referencedColumnName: "id",
|
|
65
|
+
},
|
|
58
66
|
}),
|
|
59
67
|
__metadata("design:type", Array)
|
|
60
68
|
], Terminal.prototype, "partners", void 0);
|
|
@@ -64,7 +72,7 @@ var Terminal = /** @class */ (function () {
|
|
|
64
72
|
], Terminal.prototype, "terminalsUser", void 0);
|
|
65
73
|
Terminal = __decorate([
|
|
66
74
|
(0, typeorm_1.Entity)({
|
|
67
|
-
comment:
|
|
75
|
+
comment: "Tabla creada para asignar terminales a los computadores que estén en un local y así poder recibir pedidos.",
|
|
68
76
|
})
|
|
69
77
|
], Terminal);
|
|
70
78
|
return Terminal;
|
|
@@ -32,8 +32,6 @@ export { RequestProduct } from "./entities/RequestProduct";
|
|
|
32
32
|
export { RequestProductGroupComplement } from "./entities/RequestProductGroupComplement";
|
|
33
33
|
export { RequestStatus } from "./entities/RequestStatus";
|
|
34
34
|
export { Square } from "./entities/Square";
|
|
35
|
-
export { Terminal } from "./entities/Terminal";
|
|
36
|
-
export { TerminalSession } from "./entities/TerminalSession";
|
|
37
35
|
export { TypeMeasureIngredient } from "./entities/TypeMeasureIngredient";
|
|
38
36
|
export { User } from "./entities/User";
|
|
39
37
|
export { UserAddress } from "./entities/UserAddress";
|
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.CategoryDate = exports.Bank = exports.ServicePlan = exports.PartnerPlatform = exports.PartnerPermissionSection = exports.LocalPlan = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.
|
|
18
|
-
exports.CustomRepository = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.ToppingImage =
|
|
17
|
+
exports.ProductDate = exports.ProductSchedule = exports.CategoryDate = exports.Bank = exports.ServicePlan = exports.PartnerPlatform = exports.PartnerPermissionSection = exports.LocalPlan = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = 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;
|
|
18
|
+
exports.CustomRepository = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.ToppingImage = void 0;
|
|
19
19
|
var BusinessTypeProduct_1 = require("./entities/BusinessTypeProduct");
|
|
20
20
|
Object.defineProperty(exports, "BusinessTypeProduct", { enumerable: true, get: function () { return BusinessTypeProduct_1.BusinessTypeProduct; } });
|
|
21
21
|
var Category_1 = require("./entities/Category");
|
|
@@ -84,10 +84,6 @@ var RequestStatus_1 = require("./entities/RequestStatus");
|
|
|
84
84
|
Object.defineProperty(exports, "RequestStatus", { enumerable: true, get: function () { return RequestStatus_1.RequestStatus; } });
|
|
85
85
|
var Square_1 = require("./entities/Square");
|
|
86
86
|
Object.defineProperty(exports, "Square", { enumerable: true, get: function () { return Square_1.Square; } });
|
|
87
|
-
var Terminal_1 = require("./entities/Terminal");
|
|
88
|
-
Object.defineProperty(exports, "Terminal", { enumerable: true, get: function () { return Terminal_1.Terminal; } });
|
|
89
|
-
var TerminalSession_1 = require("./entities/TerminalSession");
|
|
90
|
-
Object.defineProperty(exports, "TerminalSession", { enumerable: true, get: function () { return TerminalSession_1.TerminalSession; } });
|
|
91
87
|
var TypeMeasureIngredient_1 = require("./entities/TypeMeasureIngredient");
|
|
92
88
|
Object.defineProperty(exports, "TypeMeasureIngredient", { enumerable: true, get: function () { return TypeMeasureIngredient_1.TypeMeasureIngredient; } });
|
|
93
89
|
var User_1 = require("./entities/User");
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.getFilteredLoginTerminalPartnerWithTerminalsQuery = void 0;
|
|
40
|
+
function getFilteredLoginTerminalPartnerWithTerminalsQuery(repository_1, _a) {
|
|
41
|
+
return __awaiter(this, arguments, void 0, function (repository, _b) {
|
|
42
|
+
var queryBuilder, result, error_1;
|
|
43
|
+
var user = _b.user;
|
|
44
|
+
return __generator(this, function (_c) {
|
|
45
|
+
switch (_c.label) {
|
|
46
|
+
case 0:
|
|
47
|
+
_c.trys.push([0, 2, , 3]);
|
|
48
|
+
queryBuilder = repository
|
|
49
|
+
.createQueryBuilder("partner")
|
|
50
|
+
.leftJoinAndSelect("partner.company", "company")
|
|
51
|
+
.leftJoinAndSelect("partner.city", "city")
|
|
52
|
+
.leftJoinAndSelect("city.region", "region")
|
|
53
|
+
.leftJoinAndSelect("region.country", "country")
|
|
54
|
+
.leftJoinAndSelect("partner.locals_partner", "local")
|
|
55
|
+
.leftJoinAndSelect("local.terminals", "terminal")
|
|
56
|
+
.leftJoinAndSelect("terminal.partners", "terminal_partner") // Asociamos las terminales con los partners
|
|
57
|
+
.where("partner.email = :email", { email: user })
|
|
58
|
+
.andWhere("partner.status = 1 AND partner.visible = 1") // Asegurar que el partner está activo
|
|
59
|
+
.andWhere("terminal_partner.id = partner.id") // Filtrar terminales donde el usuario es un partner
|
|
60
|
+
.orderBy("local.id", "ASC");
|
|
61
|
+
return [4 /*yield*/, queryBuilder.getOne()];
|
|
62
|
+
case 1:
|
|
63
|
+
result = _c.sent();
|
|
64
|
+
return [2 /*return*/, result];
|
|
65
|
+
case 2:
|
|
66
|
+
error_1 = _c.sent();
|
|
67
|
+
console.error("Error in getFilteredPartnersWithTerminalsQuery:", error_1);
|
|
68
|
+
return [2 /*return*/, null];
|
|
69
|
+
case 3: return [2 /*return*/];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
exports.getFilteredLoginTerminalPartnerWithTerminalsQuery = getFilteredLoginTerminalPartnerWithTerminalsQuery;
|
package/dist/interfaces.d.ts
CHANGED
package/package.json
CHANGED
package/src/CustomRepository.ts
CHANGED
package/src/entities/Local.ts
CHANGED
|
@@ -7,174 +7,169 @@ import {
|
|
|
7
7
|
ManyToOne,
|
|
8
8
|
OneToMany,
|
|
9
9
|
PrimaryGeneratedColumn,
|
|
10
|
-
} from
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
@Entity({ comment: 'Locales disponibles de las empresas (company).' })
|
|
10
|
+
} from "typeorm";
|
|
11
|
+
import { DiscountCodeUser, LocalPlan, PosSystem } from "..";
|
|
12
|
+
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
13
|
+
import { BusinessTypeProduct } from "./BusinessTypeProduct";
|
|
14
|
+
import { Category } from "./Category";
|
|
15
|
+
import { City } from "./City";
|
|
16
|
+
import { Company } from "./Company";
|
|
17
|
+
import { LocalQualification } from "./LocalQualification";
|
|
18
|
+
import { Partner } from "./Partner";
|
|
19
|
+
import { PaymentMethod } from "./PaymentMethod";
|
|
20
|
+
import { Request } from "./Request";
|
|
21
|
+
import { Square } from "./Square";
|
|
22
|
+
import { User } from "./User";
|
|
23
|
+
|
|
24
|
+
@Entity({ comment: "Locales disponibles de las empresas (company)." })
|
|
27
25
|
export class Local {
|
|
28
26
|
@PrimaryGeneratedColumn({
|
|
29
|
-
comment:
|
|
27
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
30
28
|
})
|
|
31
|
-
id: number
|
|
29
|
+
id: number;
|
|
32
30
|
|
|
33
31
|
@ManyToOne(() => Company, (company) => company.locals, {
|
|
34
|
-
onDelete:
|
|
35
|
-
onUpdate:
|
|
32
|
+
onDelete: "CASCADE",
|
|
33
|
+
onUpdate: "NO ACTION",
|
|
36
34
|
})
|
|
37
|
-
@JoinColumn({ name:
|
|
38
|
-
company: Company
|
|
35
|
+
@JoinColumn({ name: "company" })
|
|
36
|
+
company: Company;
|
|
39
37
|
|
|
40
38
|
@Column({ length: 100 })
|
|
41
|
-
name: string
|
|
39
|
+
name: string;
|
|
42
40
|
|
|
43
41
|
@ManyToOne(() => City, (city) => city.locals, {
|
|
44
|
-
onDelete:
|
|
45
|
-
onUpdate:
|
|
42
|
+
onDelete: "RESTRICT",
|
|
43
|
+
onUpdate: "NO ACTION",
|
|
46
44
|
})
|
|
47
|
-
@JoinColumn({ name:
|
|
48
|
-
city: City
|
|
45
|
+
@JoinColumn({ name: "city" })
|
|
46
|
+
city: City;
|
|
49
47
|
|
|
50
48
|
@Column({ length: 120 })
|
|
51
|
-
address: string
|
|
49
|
+
address: string;
|
|
52
50
|
|
|
53
|
-
@Column({ type:
|
|
54
|
-
latitude: number
|
|
51
|
+
@Column({ type: "decimal", precision: 10, scale: 8 })
|
|
52
|
+
latitude: number;
|
|
55
53
|
|
|
56
|
-
@Column({ type:
|
|
57
|
-
longitude: number
|
|
54
|
+
@Column({ type: "decimal", precision: 10, scale: 8 })
|
|
55
|
+
longitude: number;
|
|
58
56
|
|
|
59
57
|
@Column({
|
|
60
|
-
type:
|
|
58
|
+
type: "longtext",
|
|
61
59
|
nullable: true,
|
|
62
60
|
transformer: jsonTransformer,
|
|
63
61
|
comment:
|
|
64
|
-
|
|
62
|
+
"Campo de tipo JSON por si es necesario agregar información adicional",
|
|
65
63
|
})
|
|
66
|
-
details: any
|
|
64
|
+
details: any;
|
|
67
65
|
|
|
68
|
-
@Column({ type:
|
|
69
|
-
created: Date
|
|
66
|
+
@Column({ type: "datetime" })
|
|
67
|
+
created: Date;
|
|
70
68
|
|
|
71
|
-
@Column({ type:
|
|
72
|
-
updated: Date
|
|
69
|
+
@Column({ type: "datetime" })
|
|
70
|
+
updated: Date;
|
|
73
71
|
|
|
74
72
|
@ManyToOne(() => Partner, (partner) => partner.locals, {
|
|
75
|
-
onDelete:
|
|
76
|
-
onUpdate:
|
|
73
|
+
onDelete: "NO ACTION",
|
|
74
|
+
onUpdate: "NO ACTION",
|
|
77
75
|
})
|
|
78
|
-
@JoinColumn({ name:
|
|
79
|
-
updated_by: Partner
|
|
76
|
+
@JoinColumn({ name: "updated_by" })
|
|
77
|
+
updated_by: Partner;
|
|
80
78
|
|
|
81
79
|
@ManyToOne(() => Square, (square) => square.locals, {
|
|
82
|
-
onDelete:
|
|
83
|
-
onUpdate:
|
|
80
|
+
onDelete: "RESTRICT",
|
|
81
|
+
onUpdate: "NO ACTION",
|
|
84
82
|
})
|
|
85
|
-
@JoinColumn({ name:
|
|
86
|
-
square: Square
|
|
83
|
+
@JoinColumn({ name: "square" })
|
|
84
|
+
square: Square;
|
|
87
85
|
|
|
88
86
|
@ManyToOne(() => PosSystem, (posSystem) => posSystem.locals_pos_system, {
|
|
89
|
-
onDelete:
|
|
90
|
-
onUpdate:
|
|
87
|
+
onDelete: "RESTRICT",
|
|
88
|
+
onUpdate: "NO ACTION",
|
|
91
89
|
})
|
|
92
|
-
@JoinColumn({ name:
|
|
93
|
-
pos_system: PosSystem
|
|
90
|
+
@JoinColumn({ name: "pos_system" })
|
|
91
|
+
pos_system: PosSystem;
|
|
94
92
|
|
|
95
93
|
@Column({
|
|
96
|
-
type:
|
|
94
|
+
type: "text",
|
|
97
95
|
nullable: true,
|
|
98
96
|
transformer: jsonTransformer,
|
|
99
97
|
comment:
|
|
100
|
-
|
|
98
|
+
"Campo de tipo JSON por si es necesario agregar información adicional",
|
|
101
99
|
})
|
|
102
|
-
pos_system_settings: string
|
|
100
|
+
pos_system_settings: string;
|
|
103
101
|
|
|
104
102
|
@Column({
|
|
105
103
|
default: 1,
|
|
106
104
|
comment:
|
|
107
|
-
|
|
105
|
+
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
108
106
|
})
|
|
109
|
-
status: number
|
|
107
|
+
status: number;
|
|
110
108
|
|
|
111
109
|
@Column({
|
|
112
110
|
default: 1,
|
|
113
|
-
comment:
|
|
111
|
+
comment: "Es el estado para verificar si se envía en la papelera o no.",
|
|
114
112
|
})
|
|
115
|
-
visible: number
|
|
113
|
+
visible: number;
|
|
116
114
|
|
|
117
115
|
@ManyToMany(() => Partner, (partner) => partner.locals_partner)
|
|
118
116
|
@JoinTable({
|
|
119
|
-
name:
|
|
117
|
+
name: "local_partner",
|
|
120
118
|
joinColumn: {
|
|
121
|
-
name:
|
|
122
|
-
referencedColumnName:
|
|
119
|
+
name: "local",
|
|
120
|
+
referencedColumnName: "id",
|
|
123
121
|
},
|
|
124
122
|
inverseJoinColumn: {
|
|
125
|
-
name:
|
|
126
|
-
referencedColumnName:
|
|
123
|
+
name: "partner",
|
|
124
|
+
referencedColumnName: "id",
|
|
127
125
|
},
|
|
128
126
|
})
|
|
129
|
-
locals_partners: Partner[]
|
|
130
|
-
|
|
127
|
+
locals_partners: Partner[];
|
|
128
|
+
|
|
131
129
|
@OneToMany(() => Category, (category) => category.local)
|
|
132
|
-
categories: Category[]
|
|
130
|
+
categories: Category[];
|
|
133
131
|
|
|
134
132
|
@ManyToMany(() => PaymentMethod)
|
|
135
133
|
@JoinTable({
|
|
136
|
-
name:
|
|
134
|
+
name: "local_payment_method",
|
|
137
135
|
})
|
|
138
|
-
payment_methods: PaymentMethod[]
|
|
136
|
+
payment_methods: PaymentMethod[];
|
|
139
137
|
|
|
140
138
|
@OneToMany(
|
|
141
139
|
() => LocalQualification,
|
|
142
140
|
(localQualification) => localQualification.local
|
|
143
141
|
)
|
|
144
|
-
qualifications: LocalQualification[]
|
|
142
|
+
qualifications: LocalQualification[];
|
|
145
143
|
|
|
146
144
|
@OneToMany(() => Request, (request) => request.local)
|
|
147
|
-
requests: Request[]
|
|
148
|
-
|
|
149
|
-
@OneToMany(() => Terminal, (terminal) => terminal.local)
|
|
150
|
-
terminals: Terminal[]
|
|
145
|
+
requests: Request[];
|
|
151
146
|
|
|
152
147
|
@ManyToMany(() => User)
|
|
153
148
|
@JoinTable({
|
|
154
|
-
name:
|
|
149
|
+
name: "user_favorite_local",
|
|
155
150
|
})
|
|
156
|
-
users_favorite_local: User[]
|
|
151
|
+
users_favorite_local: User[];
|
|
157
152
|
|
|
158
153
|
@ManyToMany(() => BusinessTypeProduct)
|
|
159
154
|
@JoinTable({
|
|
160
|
-
name:
|
|
155
|
+
name: "business_type_product_local",
|
|
161
156
|
joinColumn: {
|
|
162
|
-
name:
|
|
163
|
-
referencedColumnName:
|
|
157
|
+
name: "local",
|
|
158
|
+
referencedColumnName: "id",
|
|
164
159
|
},
|
|
165
160
|
inverseJoinColumn: {
|
|
166
|
-
name:
|
|
167
|
-
referencedColumnName:
|
|
161
|
+
name: "business_type_product",
|
|
162
|
+
referencedColumnName: "id",
|
|
168
163
|
},
|
|
169
164
|
})
|
|
170
|
-
business_type_products: BusinessTypeProduct[]
|
|
165
|
+
business_type_products: BusinessTypeProduct[];
|
|
171
166
|
|
|
172
167
|
@OneToMany(
|
|
173
168
|
() => DiscountCodeUser,
|
|
174
169
|
(discountCodeUser) => discountCodeUser.local
|
|
175
170
|
)
|
|
176
|
-
discount_code_locals: DiscountCodeUser[]
|
|
171
|
+
discount_code_locals: DiscountCodeUser[];
|
|
177
172
|
|
|
178
173
|
@OneToMany(() => LocalPlan, (localPlan) => localPlan.local)
|
|
179
|
-
locals_plan: LocalPlan[]
|
|
174
|
+
locals_plan: LocalPlan[];
|
|
180
175
|
}
|
package/src/entities/Partner.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
BaseEntity,
|
|
3
2
|
Column,
|
|
4
3
|
Entity,
|
|
5
4
|
JoinColumn,
|
|
@@ -7,19 +6,17 @@ import {
|
|
|
7
6
|
ManyToMany,
|
|
8
7
|
ManyToOne,
|
|
9
8
|
OneToMany,
|
|
10
|
-
PrimaryGeneratedColumn
|
|
9
|
+
PrimaryGeneratedColumn
|
|
11
10
|
} from "typeorm";
|
|
11
|
+
import { Category, MasterNotification, Product, VerifyLocal } from "..";
|
|
12
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
12
13
|
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
13
14
|
import { City } from "./City";
|
|
14
15
|
import { Company } from "./Company";
|
|
15
16
|
import { DiscountCodeUser } from "./DiscountCodeUser";
|
|
16
17
|
import { Local } from "./Local";
|
|
17
|
-
import { PartnerRole } from "./PartnerRole";
|
|
18
|
-
import { Terminal } from "./Terminal";
|
|
19
|
-
import { TerminalSession } from "./TerminalSession";
|
|
20
|
-
import { DateTransformer } from "../transformers/dateTransformer";
|
|
21
18
|
import { PartnerNotification } from "./PartnerNotification";
|
|
22
|
-
import {
|
|
19
|
+
import { PartnerRole } from "./PartnerRole";
|
|
23
20
|
|
|
24
21
|
@Entity({
|
|
25
22
|
comment:
|
|
@@ -169,26 +166,6 @@ export class Partner {
|
|
|
169
166
|
})
|
|
170
167
|
partners_roles: PartnerRole[];
|
|
171
168
|
|
|
172
|
-
@ManyToMany(() => Terminal, (terminal) => terminal.partners)
|
|
173
|
-
@JoinTable({
|
|
174
|
-
name: "partner_terminal",
|
|
175
|
-
joinColumn: {
|
|
176
|
-
name: "partner",
|
|
177
|
-
referencedColumnName: "id",
|
|
178
|
-
},
|
|
179
|
-
inverseJoinColumn: {
|
|
180
|
-
name: "terminal",
|
|
181
|
-
referencedColumnName: "id",
|
|
182
|
-
},
|
|
183
|
-
})
|
|
184
|
-
terminals: Terminal[];
|
|
185
|
-
|
|
186
|
-
@OneToMany(
|
|
187
|
-
() => TerminalSession,
|
|
188
|
-
(terminalSession) => terminalSession.partner
|
|
189
|
-
)
|
|
190
|
-
sessions: TerminalSession[];
|
|
191
|
-
|
|
192
169
|
@OneToMany(
|
|
193
170
|
() => PartnerNotification,
|
|
194
171
|
(partnerNotification) => partnerNotification.partner
|
|
@@ -32,8 +32,6 @@ export { RequestProduct } from "./entities/RequestProduct";
|
|
|
32
32
|
export { RequestProductGroupComplement } from "./entities/RequestProductGroupComplement";
|
|
33
33
|
export { RequestStatus } from "./entities/RequestStatus";
|
|
34
34
|
export { Square } from "./entities/Square";
|
|
35
|
-
export { Terminal } from "./entities/Terminal";
|
|
36
|
-
export { TerminalSession } from "./entities/TerminalSession";
|
|
37
35
|
export { TypeMeasureIngredient } from "./entities/TypeMeasureIngredient";
|
|
38
36
|
export { User } from "./entities/User";
|
|
39
37
|
export { UserAddress } from "./entities/UserAddress";
|
package/src/interfaces.ts
CHANGED
package/src/entities/Terminal.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Entity,
|
|
3
|
-
Column,
|
|
4
|
-
PrimaryGeneratedColumn,
|
|
5
|
-
ManyToMany,
|
|
6
|
-
JoinTable,
|
|
7
|
-
OneToMany,
|
|
8
|
-
ManyToOne,
|
|
9
|
-
JoinColumn,
|
|
10
|
-
} from 'typeorm'
|
|
11
|
-
import { User } from './User'
|
|
12
|
-
import { TerminalSession } from './TerminalSession'
|
|
13
|
-
import { Local } from './Local'
|
|
14
|
-
import { Partner } from './Partner'
|
|
15
|
-
|
|
16
|
-
@Entity({
|
|
17
|
-
comment:
|
|
18
|
-
'Tabla creada para asignar terminales a los computadores que estén en un local y así poder recibir pedidos.',
|
|
19
|
-
})
|
|
20
|
-
export class Terminal {
|
|
21
|
-
@PrimaryGeneratedColumn({
|
|
22
|
-
comment: 'Número de identificación (ID) único de cada registro.',
|
|
23
|
-
})
|
|
24
|
-
id: number
|
|
25
|
-
|
|
26
|
-
@ManyToOne(() => Local, (local) => local.terminals, {
|
|
27
|
-
nullable: true,
|
|
28
|
-
onDelete: 'CASCADE',
|
|
29
|
-
onUpdate: 'NO ACTION',
|
|
30
|
-
})
|
|
31
|
-
@JoinColumn({ name: 'local' })
|
|
32
|
-
local: Local
|
|
33
|
-
|
|
34
|
-
@Column({ length: 50, comment: 'Nombre de la terminal.' })
|
|
35
|
-
name: string
|
|
36
|
-
|
|
37
|
-
@Column({
|
|
38
|
-
type: 'longtext',
|
|
39
|
-
nullable: true,
|
|
40
|
-
comment:
|
|
41
|
-
'Campo de tipo JSON donde se guarda información necesaria para la terminal si es necesario',
|
|
42
|
-
})
|
|
43
|
-
settings: string
|
|
44
|
-
|
|
45
|
-
@Column({
|
|
46
|
-
default: 1,
|
|
47
|
-
comment:
|
|
48
|
-
'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
49
|
-
})
|
|
50
|
-
status: number
|
|
51
|
-
|
|
52
|
-
@ManyToMany(() => Partner, (partner) => partner.terminals)
|
|
53
|
-
@JoinTable({
|
|
54
|
-
name: 'partner_terminal',
|
|
55
|
-
})
|
|
56
|
-
partners: Partner[]
|
|
57
|
-
|
|
58
|
-
@OneToMany(() => TerminalSession, (terminalsUser) => terminalsUser.terminal)
|
|
59
|
-
terminalsUser: TerminalSession[]
|
|
60
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Column,
|
|
3
|
-
Entity,
|
|
4
|
-
JoinColumn,
|
|
5
|
-
ManyToOne,
|
|
6
|
-
PrimaryGeneratedColumn,
|
|
7
|
-
} from 'typeorm'
|
|
8
|
-
import { Terminal } from './Terminal'
|
|
9
|
-
import { User } from './User'
|
|
10
|
-
import { Partner } from './Partner'
|
|
11
|
-
|
|
12
|
-
@Entity('terminal_session', {
|
|
13
|
-
comment:
|
|
14
|
-
'Tabla creada para llevar el control de los inicios de sesión de los usuarios que tiene permiso de esa terminal.',
|
|
15
|
-
})
|
|
16
|
-
export class TerminalSession {
|
|
17
|
-
@PrimaryGeneratedColumn({
|
|
18
|
-
comment: 'Número de identificación (ID) único de cada registro.',
|
|
19
|
-
})
|
|
20
|
-
id: number
|
|
21
|
-
|
|
22
|
-
@ManyToOne(() => Partner, (partner) => partner.sessions, {
|
|
23
|
-
nullable: true,
|
|
24
|
-
onDelete: 'CASCADE',
|
|
25
|
-
onUpdate: 'NO ACTION',
|
|
26
|
-
})
|
|
27
|
-
@JoinColumn({ name: 'user' })
|
|
28
|
-
partner: Partner
|
|
29
|
-
|
|
30
|
-
@ManyToOne(() => Terminal, (terminal) => terminal.terminalsUser, {
|
|
31
|
-
nullable: true,
|
|
32
|
-
onDelete: 'CASCADE',
|
|
33
|
-
onUpdate: 'NO ACTION',
|
|
34
|
-
})
|
|
35
|
-
@JoinColumn({ name: 'terminal' })
|
|
36
|
-
terminal: Terminal
|
|
37
|
-
|
|
38
|
-
@Column({
|
|
39
|
-
type: 'datetime',
|
|
40
|
-
comment: 'Fecha de inicio de sesión en la terminal.',
|
|
41
|
-
})
|
|
42
|
-
open: Date
|
|
43
|
-
|
|
44
|
-
@Column({
|
|
45
|
-
type: 'datetime',
|
|
46
|
-
comment: 'Fecha de finalización de la sesión en la terminal.',
|
|
47
|
-
})
|
|
48
|
-
close: Date
|
|
49
|
-
|
|
50
|
-
@Column({
|
|
51
|
-
default: 1,
|
|
52
|
-
comment:
|
|
53
|
-
'Se valida si la sesión está abierta o cerrada:\r\n1. Abierta.\r\n0. Cerrada.',
|
|
54
|
-
})
|
|
55
|
-
status: number
|
|
56
|
-
}
|