test-entity-library-asm 2.1.7 → 2.1.9
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/Master.d.ts +2 -0
- package/dist/entities/Master.js +26 -2
- package/dist/entities/MasterRole.js +2 -2
- package/dist/entities/Partner.d.ts +2 -0
- package/dist/entities/Partner.js +5 -0
- package/dist/entities/VerifyLocal.d.ts +17 -0
- package/dist/entities/VerifyLocal.js +132 -0
- package/dist/entities.views.routes.d.ts +1 -0
- package/dist/entities.views.routes.js +3 -1
- package/package.json +1 -1
- package/src/entities/Master.ts +25 -2
- package/src/entities/MasterRole.ts +2 -2
- package/src/entities/Partner.ts +4 -0
- package/src/entities/VerifyLocal.ts +113 -0
- package/src/entities.views.routes.ts +2 -1
- package/src/views/LocalsCompany.ts +1 -1
|
@@ -2,6 +2,7 @@ import { City } from './City';
|
|
|
2
2
|
import { DiscountCodeCompany } from './DiscountCodeCompany';
|
|
3
3
|
import { MasterRole } from './MasterRole';
|
|
4
4
|
import { Plan } from './Plan';
|
|
5
|
+
import { VerifyLocal } from '..';
|
|
5
6
|
export declare class Master {
|
|
6
7
|
id: number;
|
|
7
8
|
code: string;
|
|
@@ -20,4 +21,5 @@ export declare class Master {
|
|
|
20
21
|
discount_code_companies: DiscountCodeCompany[];
|
|
21
22
|
masters_roles: MasterRole[];
|
|
22
23
|
plans: Plan[];
|
|
24
|
+
verifyLocals: VerifyLocal[];
|
|
23
25
|
}
|
package/dist/entities/Master.js
CHANGED
|
@@ -15,6 +15,9 @@ var City_1 = require("./City");
|
|
|
15
15
|
var DiscountCodeCompany_1 = require("./DiscountCodeCompany");
|
|
16
16
|
var MasterRole_1 = require("./MasterRole");
|
|
17
17
|
var Plan_1 = require("./Plan");
|
|
18
|
+
var jsonTransformer_1 = require("../transformers/jsonTransformer");
|
|
19
|
+
var dateTransformer_1 = require("../transformers/dateTransformer");
|
|
20
|
+
var __1 = require("..");
|
|
18
21
|
var Master = /** @class */ (function () {
|
|
19
22
|
function Master() {
|
|
20
23
|
}
|
|
@@ -84,16 +87,25 @@ var Master = /** @class */ (function () {
|
|
|
84
87
|
(0, typeorm_1.Column)({
|
|
85
88
|
type: 'longtext',
|
|
86
89
|
nullable: true,
|
|
90
|
+
transformer: jsonTransformer_1.jsonTransformer,
|
|
87
91
|
comment: 'Campo de tipo JSON donde se guarda información necesaria para el registro.',
|
|
88
92
|
}),
|
|
89
93
|
__metadata("design:type", String)
|
|
90
94
|
], Master.prototype, "profile", void 0);
|
|
91
95
|
__decorate([
|
|
92
|
-
(0, typeorm_1.Column)({
|
|
96
|
+
(0, typeorm_1.Column)({
|
|
97
|
+
type: 'datetime',
|
|
98
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
99
|
+
comment: 'Fecha de creación del registro.',
|
|
100
|
+
}),
|
|
93
101
|
__metadata("design:type", Date)
|
|
94
102
|
], Master.prototype, "created", void 0);
|
|
95
103
|
__decorate([
|
|
96
|
-
(0, typeorm_1.Column)({
|
|
104
|
+
(0, typeorm_1.Column)({
|
|
105
|
+
type: 'datetime',
|
|
106
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
107
|
+
comment: 'Fecha de actualización del registro.',
|
|
108
|
+
}),
|
|
97
109
|
__metadata("design:type", Date)
|
|
98
110
|
], Master.prototype, "updated", void 0);
|
|
99
111
|
__decorate([
|
|
@@ -111,6 +123,14 @@ var Master = /** @class */ (function () {
|
|
|
111
123
|
(0, typeorm_1.ManyToMany)(function () { return MasterRole_1.MasterRole; }),
|
|
112
124
|
(0, typeorm_1.JoinTable)({
|
|
113
125
|
name: 'master_assigned_role',
|
|
126
|
+
joinColumn: {
|
|
127
|
+
name: 'master',
|
|
128
|
+
referencedColumnName: 'id',
|
|
129
|
+
},
|
|
130
|
+
inverseJoinColumn: {
|
|
131
|
+
name: 'role',
|
|
132
|
+
referencedColumnName: 'id',
|
|
133
|
+
},
|
|
114
134
|
}),
|
|
115
135
|
__metadata("design:type", Array)
|
|
116
136
|
], Master.prototype, "masters_roles", void 0);
|
|
@@ -118,6 +138,10 @@ var Master = /** @class */ (function () {
|
|
|
118
138
|
(0, typeorm_1.OneToMany)(function () { return Plan_1.Plan; }, function (plan) { return plan.created_by; }),
|
|
119
139
|
__metadata("design:type", Array)
|
|
120
140
|
], Master.prototype, "plans", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, typeorm_1.OneToMany)(function () { return __1.VerifyLocal; }, function (verifyLocal) { return verifyLocal.partner; }),
|
|
143
|
+
__metadata("design:type", Array)
|
|
144
|
+
], Master.prototype, "verifyLocals", void 0);
|
|
121
145
|
Master = __decorate([
|
|
122
146
|
(0, typeorm_1.Entity)({
|
|
123
147
|
comment: 'Tabla agregada para los usuarios qué son administradores de la plataforma.',
|
|
@@ -68,11 +68,11 @@ var MasterRole = /** @class */ (function () {
|
|
|
68
68
|
(0, typeorm_1.JoinTable)({
|
|
69
69
|
name: 'master_assigned_role',
|
|
70
70
|
joinColumn: {
|
|
71
|
-
name: '
|
|
71
|
+
name: 'role',
|
|
72
72
|
referencedColumnName: 'id',
|
|
73
73
|
},
|
|
74
74
|
inverseJoinColumn: {
|
|
75
|
-
name: '
|
|
75
|
+
name: 'master',
|
|
76
76
|
referencedColumnName: 'id',
|
|
77
77
|
},
|
|
78
78
|
}),
|
|
@@ -6,6 +6,7 @@ import { PartnerRole } from './PartnerRole';
|
|
|
6
6
|
import { Terminal } from './Terminal';
|
|
7
7
|
import { TerminalSession } from './TerminalSession';
|
|
8
8
|
import { PartnerNotification } from './PartnerNotification';
|
|
9
|
+
import { VerifyLocal } from '..';
|
|
9
10
|
export declare class Partner {
|
|
10
11
|
id: number;
|
|
11
12
|
company: Company;
|
|
@@ -31,4 +32,5 @@ export declare class Partner {
|
|
|
31
32
|
terminals: Terminal[];
|
|
32
33
|
sessions: TerminalSession[];
|
|
33
34
|
partners_notification: PartnerNotification[];
|
|
35
|
+
verifyLocals: VerifyLocal[];
|
|
34
36
|
}
|
package/dist/entities/Partner.js
CHANGED
|
@@ -21,6 +21,7 @@ var Terminal_1 = require("./Terminal");
|
|
|
21
21
|
var TerminalSession_1 = require("./TerminalSession");
|
|
22
22
|
var dateTransformer_1 = require("../transformers/dateTransformer");
|
|
23
23
|
var PartnerNotification_1 = require("./PartnerNotification");
|
|
24
|
+
var __1 = require("..");
|
|
24
25
|
var Partner = /** @class */ (function () {
|
|
25
26
|
function Partner() {
|
|
26
27
|
}
|
|
@@ -199,6 +200,10 @@ var Partner = /** @class */ (function () {
|
|
|
199
200
|
(0, typeorm_1.OneToMany)(function () { return PartnerNotification_1.PartnerNotification; }, function (partnerNotification) { return partnerNotification.partner; }),
|
|
200
201
|
__metadata("design:type", Array)
|
|
201
202
|
], Partner.prototype, "partners_notification", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
(0, typeorm_1.OneToMany)(function () { return __1.VerifyLocal; }, function (verifyLocal) { return verifyLocal.partner; }),
|
|
205
|
+
__metadata("design:type", Array)
|
|
206
|
+
], Partner.prototype, "verifyLocals", void 0);
|
|
202
207
|
Partner = __decorate([
|
|
203
208
|
(0, typeorm_1.Entity)({
|
|
204
209
|
comment: 'Tabla agregada para los usuarios qué quieran registrar su local o empresa de comida rápida en la plataforma.\r\n\r\nEste usuario es independiente a los usuarios de la tabla `user` ya que tiene diferentes plataformas.\r\n\r\nTambién van a estar los usuarios qué el administrador/dueño desee agregar como empleados/colaboradores.',
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Partner } from './Partner';
|
|
2
|
+
import { Master } from '..';
|
|
3
|
+
export declare class VerifyLocal {
|
|
4
|
+
id: number;
|
|
5
|
+
partner: Partner;
|
|
6
|
+
assigned_master: Master;
|
|
7
|
+
local_information: string;
|
|
8
|
+
basic_information: string;
|
|
9
|
+
settings: string;
|
|
10
|
+
opening_hours: string;
|
|
11
|
+
terminals: string;
|
|
12
|
+
details: string;
|
|
13
|
+
created: Date;
|
|
14
|
+
verification_date: Date;
|
|
15
|
+
update_partner: Date;
|
|
16
|
+
status: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.VerifyLocal = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var Partner_1 = require("./Partner");
|
|
15
|
+
var jsonTransformer_1 = require("../transformers/jsonTransformer");
|
|
16
|
+
var __1 = require("..");
|
|
17
|
+
var dateTransformer_1 = require("../transformers/dateTransformer");
|
|
18
|
+
var VerifyLocal = /** @class */ (function () {
|
|
19
|
+
function VerifyLocal() {
|
|
20
|
+
}
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
23
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
24
|
+
}),
|
|
25
|
+
__metadata("design:type", Number)
|
|
26
|
+
], VerifyLocal.prototype, "id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.ManyToOne)(function () { return Partner_1.Partner; }, function (partner) { return partner.verifyLocals; }, {
|
|
29
|
+
onDelete: 'CASCADE',
|
|
30
|
+
onUpdate: 'NO ACTION',
|
|
31
|
+
}),
|
|
32
|
+
(0, typeorm_1.JoinColumn)({ name: 'partner' }),
|
|
33
|
+
__metadata("design:type", Partner_1.Partner)
|
|
34
|
+
], VerifyLocal.prototype, "partner", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.ManyToOne)(function () { return __1.Master; }, function (master) { return master.verifyLocals; }, {
|
|
37
|
+
onDelete: 'RESTRICT',
|
|
38
|
+
onUpdate: 'NO ACTION',
|
|
39
|
+
}),
|
|
40
|
+
(0, typeorm_1.JoinColumn)({ name: 'assigned_master' }),
|
|
41
|
+
__metadata("design:type", __1.Master)
|
|
42
|
+
], VerifyLocal.prototype, "assigned_master", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({
|
|
45
|
+
type: 'longtext',
|
|
46
|
+
transformer: jsonTransformer_1.jsonTransformer,
|
|
47
|
+
comment: 'Campos que el usuario (partner) agrega al nuevo local.',
|
|
48
|
+
}),
|
|
49
|
+
__metadata("design:type", String)
|
|
50
|
+
], VerifyLocal.prototype, "local_information", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({
|
|
53
|
+
type: 'longtext',
|
|
54
|
+
transformer: jsonTransformer_1.jsonTransformer,
|
|
55
|
+
comment: 'Estructura de paso información básica.',
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", String)
|
|
58
|
+
], VerifyLocal.prototype, "basic_information", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({
|
|
61
|
+
type: 'longtext',
|
|
62
|
+
transformer: jsonTransformer_1.jsonTransformer,
|
|
63
|
+
comment: 'Estructura de paso configuración.',
|
|
64
|
+
}),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], VerifyLocal.prototype, "settings", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({
|
|
69
|
+
type: 'longtext',
|
|
70
|
+
transformer: jsonTransformer_1.jsonTransformer,
|
|
71
|
+
comment: 'Estructura de paso horarios de atención.',
|
|
72
|
+
}),
|
|
73
|
+
__metadata("design:type", String)
|
|
74
|
+
], VerifyLocal.prototype, "opening_hours", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, typeorm_1.Column)({
|
|
77
|
+
type: 'longtext',
|
|
78
|
+
transformer: jsonTransformer_1.jsonTransformer,
|
|
79
|
+
comment: 'Estructura de paso terminales y usuarios.',
|
|
80
|
+
}),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], VerifyLocal.prototype, "terminals", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({
|
|
85
|
+
type: 'text',
|
|
86
|
+
nullable: true,
|
|
87
|
+
transformer: jsonTransformer_1.jsonTransformer,
|
|
88
|
+
comment: 'Información adicional del local para su verificación.',
|
|
89
|
+
}),
|
|
90
|
+
__metadata("design:type", String)
|
|
91
|
+
], VerifyLocal.prototype, "details", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, typeorm_1.Column)({
|
|
94
|
+
type: 'datetime',
|
|
95
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
96
|
+
comment: 'Fecha de creación del registro.',
|
|
97
|
+
}),
|
|
98
|
+
__metadata("design:type", Date)
|
|
99
|
+
], VerifyLocal.prototype, "created", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, typeorm_1.Column)({
|
|
102
|
+
type: 'datetime',
|
|
103
|
+
nullable: true,
|
|
104
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
105
|
+
comment: 'Fecha de verificación del registro.',
|
|
106
|
+
}),
|
|
107
|
+
__metadata("design:type", Date)
|
|
108
|
+
], VerifyLocal.prototype, "verification_date", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, typeorm_1.Column)({
|
|
111
|
+
type: 'datetime',
|
|
112
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
113
|
+
comment: 'Fecha de actualización de los nuevos cambios del registro.',
|
|
114
|
+
}),
|
|
115
|
+
__metadata("design:type", Date)
|
|
116
|
+
], VerifyLocal.prototype, "update_partner", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
(0, typeorm_1.Column)({
|
|
119
|
+
default: 1,
|
|
120
|
+
comment: 'Este campo hace referencia al estado que tiene la verificación del local, es decir:\r\n1. Pendiente de verificación (Pending verification): Este estado hace referencia a que el usuario ya creó el local y lo mandó a verificación, entonces, le queda al master validar y aprobar o rechazar.\r\n\r\n2. Rechazado (Rejected): Hace referencia a que el master verificó y por alguna razón rechazó la información de la creación del local.\r\n\r\n3. Aprobado (approved): Hace referencia a que la información y se procede a la realización del pago (Si hay un plan, no debería hacer el pago, eso es automático).',
|
|
121
|
+
}),
|
|
122
|
+
__metadata("design:type", Number)
|
|
123
|
+
], VerifyLocal.prototype, "status", void 0);
|
|
124
|
+
VerifyLocal = __decorate([
|
|
125
|
+
(0, typeorm_1.Entity)({
|
|
126
|
+
name: 'verify_local',
|
|
127
|
+
comment: 'Tabla creada para almacenar la información del local que el administrador (partner) ingrese para su aprobación.',
|
|
128
|
+
})
|
|
129
|
+
], VerifyLocal);
|
|
130
|
+
return VerifyLocal;
|
|
131
|
+
}());
|
|
132
|
+
exports.VerifyLocal = VerifyLocal;
|
|
@@ -41,3 +41,4 @@ export { LocalsCompany } from './views/LocalsCompany';
|
|
|
41
41
|
export { BusinessType } from './entities/BusinessType';
|
|
42
42
|
export { AuthenticationCredential } from './entities/AuthenticationCredential';
|
|
43
43
|
export { PosSystem } from './entities/PosSystem';
|
|
44
|
+
export { VerifyLocal } from './entities/VerifyLocal';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.LocalsCompany = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.TerminalSession = exports.Terminal = exports.Square = exports.RequestStatus = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.Region = exports.ProductTopping = exports.ProductIngredient = exports.ProductGroupComplement = exports.ProductGroup = exports.Product = exports.Plan = exports.PaymentMethod = exports.PartnerRole = exports.PartnerPermission = exports.PartnerNotification = exports.Partner = exports.MasterRole = exports.MasterPermission = exports.Master = exports.LocalQualification = exports.Local = exports.DiscountCodeUser = exports.DiscountCodeCompany = exports.Day = exports.Country = exports.Configuration = exports.Company = exports.CodeRedemptionHistoryUser = exports.CodeRedemptionHistoryCompany = exports.City = exports.ScheduleCategory = exports.Category = exports.BusinessTypeProduct = void 0;
|
|
3
|
+
exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.LocalsCompany = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.TerminalSession = exports.Terminal = exports.Square = exports.RequestStatus = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.Region = exports.ProductTopping = exports.ProductIngredient = exports.ProductGroupComplement = exports.ProductGroup = exports.Product = exports.Plan = exports.PaymentMethod = exports.PartnerRole = exports.PartnerPermission = exports.PartnerNotification = exports.Partner = exports.MasterRole = exports.MasterPermission = exports.Master = exports.LocalQualification = exports.Local = exports.DiscountCodeUser = exports.DiscountCodeCompany = exports.Day = exports.Country = exports.Configuration = exports.Company = exports.CodeRedemptionHistoryUser = exports.CodeRedemptionHistoryCompany = exports.City = exports.ScheduleCategory = exports.Category = exports.BusinessTypeProduct = void 0;
|
|
4
4
|
var BusinessTypeProduct_1 = require("./entities/BusinessTypeProduct");
|
|
5
5
|
Object.defineProperty(exports, "BusinessTypeProduct", { enumerable: true, get: function () { return BusinessTypeProduct_1.BusinessTypeProduct; } });
|
|
6
6
|
var Category_1 = require("./entities/Category");
|
|
@@ -87,3 +87,5 @@ var AuthenticationCredential_1 = require("./entities/AuthenticationCredential");
|
|
|
87
87
|
Object.defineProperty(exports, "AuthenticationCredential", { enumerable: true, get: function () { return AuthenticationCredential_1.AuthenticationCredential; } });
|
|
88
88
|
var PosSystem_1 = require("./entities/PosSystem");
|
|
89
89
|
Object.defineProperty(exports, "PosSystem", { enumerable: true, get: function () { return PosSystem_1.PosSystem; } });
|
|
90
|
+
var VerifyLocal_1 = require("./entities/VerifyLocal");
|
|
91
|
+
Object.defineProperty(exports, "VerifyLocal", { enumerable: true, get: function () { return VerifyLocal_1.VerifyLocal; } });
|
package/package.json
CHANGED
package/src/entities/Master.ts
CHANGED
|
@@ -12,6 +12,9 @@ import { City } from './City'
|
|
|
12
12
|
import { DiscountCodeCompany } from './DiscountCodeCompany'
|
|
13
13
|
import { MasterRole } from './MasterRole'
|
|
14
14
|
import { Plan } from './Plan'
|
|
15
|
+
import { jsonTransformer } from '../transformers/jsonTransformer'
|
|
16
|
+
import { DateTransformer } from '../transformers/dateTransformer'
|
|
17
|
+
import { VerifyLocal } from '..'
|
|
15
18
|
|
|
16
19
|
@Entity({
|
|
17
20
|
comment:
|
|
@@ -73,15 +76,24 @@ export class Master {
|
|
|
73
76
|
@Column({
|
|
74
77
|
type: 'longtext',
|
|
75
78
|
nullable: true,
|
|
79
|
+
transformer: jsonTransformer,
|
|
76
80
|
comment:
|
|
77
81
|
'Campo de tipo JSON donde se guarda información necesaria para el registro.',
|
|
78
82
|
})
|
|
79
83
|
profile: string
|
|
80
84
|
|
|
81
|
-
@Column({
|
|
85
|
+
@Column({
|
|
86
|
+
type: 'datetime',
|
|
87
|
+
transformer: new DateTransformer(),
|
|
88
|
+
comment: 'Fecha de creación del registro.',
|
|
89
|
+
})
|
|
82
90
|
created: Date
|
|
83
91
|
|
|
84
|
-
@Column({
|
|
92
|
+
@Column({
|
|
93
|
+
type: 'datetime',
|
|
94
|
+
transformer: new DateTransformer(),
|
|
95
|
+
comment: 'Fecha de actualización del registro.',
|
|
96
|
+
})
|
|
85
97
|
updated: Date
|
|
86
98
|
|
|
87
99
|
@Column({
|
|
@@ -100,9 +112,20 @@ export class Master {
|
|
|
100
112
|
@ManyToMany(() => MasterRole)
|
|
101
113
|
@JoinTable({
|
|
102
114
|
name: 'master_assigned_role',
|
|
115
|
+
joinColumn: {
|
|
116
|
+
name: 'master',
|
|
117
|
+
referencedColumnName: 'id',
|
|
118
|
+
},
|
|
119
|
+
inverseJoinColumn: {
|
|
120
|
+
name: 'role',
|
|
121
|
+
referencedColumnName: 'id',
|
|
122
|
+
},
|
|
103
123
|
})
|
|
104
124
|
masters_roles: MasterRole[]
|
|
105
125
|
|
|
106
126
|
@OneToMany(() => Plan, (plan) => plan.created_by)
|
|
107
127
|
plans: Plan[]
|
|
128
|
+
|
|
129
|
+
@OneToMany(() => VerifyLocal, (verifyLocal) => verifyLocal.partner)
|
|
130
|
+
verifyLocals: VerifyLocal[]
|
|
108
131
|
}
|
|
@@ -61,11 +61,11 @@ export class MasterRole {
|
|
|
61
61
|
@JoinTable({
|
|
62
62
|
name: 'master_assigned_role',
|
|
63
63
|
joinColumn: {
|
|
64
|
-
name: '
|
|
64
|
+
name: 'role',
|
|
65
65
|
referencedColumnName: 'id',
|
|
66
66
|
},
|
|
67
67
|
inverseJoinColumn: {
|
|
68
|
-
name: '
|
|
68
|
+
name: 'master',
|
|
69
69
|
referencedColumnName: 'id',
|
|
70
70
|
},
|
|
71
71
|
})
|
package/src/entities/Partner.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { Terminal } from './Terminal'
|
|
|
19
19
|
import { TerminalSession } from './TerminalSession'
|
|
20
20
|
import { DateTransformer } from '../transformers/dateTransformer'
|
|
21
21
|
import { PartnerNotification } from './PartnerNotification'
|
|
22
|
+
import { VerifyLocal } from '..'
|
|
22
23
|
|
|
23
24
|
@Entity({
|
|
24
25
|
comment:
|
|
@@ -187,4 +188,7 @@ export class Partner {
|
|
|
187
188
|
(partnerNotification) => partnerNotification.partner
|
|
188
189
|
)
|
|
189
190
|
partners_notification: PartnerNotification[]
|
|
191
|
+
|
|
192
|
+
@OneToMany(() => VerifyLocal, (verifyLocal) => verifyLocal.partner)
|
|
193
|
+
verifyLocals: VerifyLocal[]
|
|
190
194
|
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Column,
|
|
3
|
+
Entity,
|
|
4
|
+
JoinColumn,
|
|
5
|
+
JoinTable,
|
|
6
|
+
ManyToMany,
|
|
7
|
+
ManyToOne,
|
|
8
|
+
OneToMany,
|
|
9
|
+
PrimaryGeneratedColumn,
|
|
10
|
+
} from 'typeorm'
|
|
11
|
+
import { Partner } from './Partner'
|
|
12
|
+
import { TerminalSession } from './TerminalSession'
|
|
13
|
+
import { jsonTransformer } from '../transformers/jsonTransformer'
|
|
14
|
+
import { Master } from '..'
|
|
15
|
+
import { DateTransformer } from '../transformers/dateTransformer'
|
|
16
|
+
|
|
17
|
+
@Entity({
|
|
18
|
+
name: 'verify_local',
|
|
19
|
+
comment:
|
|
20
|
+
'Tabla creada para almacenar la información del local que el administrador (partner) ingrese para su aprobación.',
|
|
21
|
+
})
|
|
22
|
+
export class VerifyLocal {
|
|
23
|
+
@PrimaryGeneratedColumn({
|
|
24
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
25
|
+
})
|
|
26
|
+
id: number
|
|
27
|
+
|
|
28
|
+
@ManyToOne(() => Partner, (partner) => partner.verifyLocals, {
|
|
29
|
+
onDelete: 'CASCADE',
|
|
30
|
+
onUpdate: 'NO ACTION',
|
|
31
|
+
})
|
|
32
|
+
@JoinColumn({ name: 'partner' })
|
|
33
|
+
partner: Partner
|
|
34
|
+
|
|
35
|
+
@ManyToOne(() => Master, (master) => master.verifyLocals, {
|
|
36
|
+
onDelete: 'RESTRICT',
|
|
37
|
+
onUpdate: 'NO ACTION',
|
|
38
|
+
})
|
|
39
|
+
@JoinColumn({ name: 'assigned_master' })
|
|
40
|
+
assigned_master: Master
|
|
41
|
+
|
|
42
|
+
@Column({
|
|
43
|
+
type: 'longtext',
|
|
44
|
+
transformer: jsonTransformer,
|
|
45
|
+
comment: 'Campos que el usuario (partner) agrega al nuevo local.',
|
|
46
|
+
})
|
|
47
|
+
local_information: string
|
|
48
|
+
|
|
49
|
+
@Column({
|
|
50
|
+
type: 'longtext',
|
|
51
|
+
transformer: jsonTransformer,
|
|
52
|
+
comment: 'Estructura de paso información básica.',
|
|
53
|
+
})
|
|
54
|
+
basic_information: string
|
|
55
|
+
|
|
56
|
+
@Column({
|
|
57
|
+
type: 'longtext',
|
|
58
|
+
transformer: jsonTransformer,
|
|
59
|
+
comment: 'Estructura de paso configuración.',
|
|
60
|
+
})
|
|
61
|
+
settings: string
|
|
62
|
+
|
|
63
|
+
@Column({
|
|
64
|
+
type: 'longtext',
|
|
65
|
+
transformer: jsonTransformer,
|
|
66
|
+
comment: 'Estructura de paso horarios de atención.',
|
|
67
|
+
})
|
|
68
|
+
opening_hours: string
|
|
69
|
+
|
|
70
|
+
@Column({
|
|
71
|
+
type: 'longtext',
|
|
72
|
+
transformer: jsonTransformer,
|
|
73
|
+
comment: 'Estructura de paso terminales y usuarios.',
|
|
74
|
+
})
|
|
75
|
+
terminals: string
|
|
76
|
+
|
|
77
|
+
@Column({
|
|
78
|
+
type: 'text',
|
|
79
|
+
nullable: true,
|
|
80
|
+
transformer: jsonTransformer,
|
|
81
|
+
comment: 'Información adicional del local para su verificación.',
|
|
82
|
+
})
|
|
83
|
+
details: string
|
|
84
|
+
|
|
85
|
+
@Column({
|
|
86
|
+
type: 'datetime',
|
|
87
|
+
transformer: new DateTransformer(),
|
|
88
|
+
comment: 'Fecha de creación del registro.',
|
|
89
|
+
})
|
|
90
|
+
created: Date
|
|
91
|
+
|
|
92
|
+
@Column({
|
|
93
|
+
type: 'datetime',
|
|
94
|
+
nullable: true,
|
|
95
|
+
transformer: new DateTransformer(),
|
|
96
|
+
comment: 'Fecha de verificación del registro.',
|
|
97
|
+
})
|
|
98
|
+
verification_date: Date
|
|
99
|
+
|
|
100
|
+
@Column({
|
|
101
|
+
type: 'datetime',
|
|
102
|
+
transformer: new DateTransformer(),
|
|
103
|
+
comment: 'Fecha de actualización de los nuevos cambios del registro.',
|
|
104
|
+
})
|
|
105
|
+
update_partner: Date
|
|
106
|
+
|
|
107
|
+
@Column({
|
|
108
|
+
default: 1,
|
|
109
|
+
comment:
|
|
110
|
+
'Este campo hace referencia al estado que tiene la verificación del local, es decir:\r\n1. Pendiente de verificación (Pending verification): Este estado hace referencia a que el usuario ya creó el local y lo mandó a verificación, entonces, le queda al master validar y aprobar o rechazar.\r\n\r\n2. Rechazado (Rejected): Hace referencia a que el master verificó y por alguna razón rechazó la información de la creación del local.\r\n\r\n3. Aprobado (approved): Hace referencia a que la información y se procede a la realización del pago (Si hay un plan, no debería hacer el pago, eso es automático).',
|
|
111
|
+
})
|
|
112
|
+
status: number
|
|
113
|
+
}
|
|
@@ -40,4 +40,5 @@ export { UserAddress } from './entities/UserAddress'
|
|
|
40
40
|
export { LocalsCompany } from './views/LocalsCompany'
|
|
41
41
|
export { BusinessType } from './entities/BusinessType'
|
|
42
42
|
export { AuthenticationCredential } from './entities/AuthenticationCredential'
|
|
43
|
-
export { PosSystem } from './entities/PosSystem'
|
|
43
|
+
export { PosSystem } from './entities/PosSystem'
|
|
44
|
+
export { VerifyLocal } from './entities/VerifyLocal'
|
|
@@ -12,11 +12,11 @@ const DateTransformer = {
|
|
|
12
12
|
to(value: Date | string): string {
|
|
13
13
|
return moment.utc(value).format('YYYY-MM-DD HH:mm:ss')
|
|
14
14
|
},
|
|
15
|
-
|
|
16
15
|
from(value: string): string {
|
|
17
16
|
return moment.utc(value).tz(getTimeZone()).format('YYYY-MM-DD HH:mm:ss')
|
|
18
17
|
},
|
|
19
18
|
}
|
|
19
|
+
|
|
20
20
|
@ViewEntity({
|
|
21
21
|
name: 'locals_company',
|
|
22
22
|
})
|