test-entity-library-asm 3.1.6 → 3.1.7
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/Company.d.ts +10 -9
- package/dist/entities/Company.js +34 -25
- package/dist/entities/Partner.d.ts +2 -1
- package/dist/entities/Partner.js +4 -0
- package/dist/entities/PartnerSession.d.ts +13 -0
- package/dist/entities/PartnerSession.js +104 -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/Company.ts +65 -57
- package/src/entities/Partner.ts +4 -1
- package/src/entities/PartnerSession.ts +88 -0
- package/src/entities.views.routes.ts +1 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { City } from
|
|
2
|
-
import { CodeRedemptionHistoryCompany } from
|
|
3
|
-
import { DiscountCodeUser } from
|
|
4
|
-
import { Local } from
|
|
5
|
-
import { Partner } from
|
|
6
|
-
import { PartnerRole } from
|
|
7
|
-
import { Plan } from
|
|
8
|
-
import { ProductTopping } from
|
|
9
|
-
import { IPropsContactDetails } from
|
|
1
|
+
import { City } from "./City";
|
|
2
|
+
import { CodeRedemptionHistoryCompany } from "./CodeRedemptionHistoryCompany";
|
|
3
|
+
import { DiscountCodeUser } from "./DiscountCodeUser";
|
|
4
|
+
import { Local } from "./Local";
|
|
5
|
+
import { Partner } from "./Partner";
|
|
6
|
+
import { PartnerRole } from "./PartnerRole";
|
|
7
|
+
import { Plan } from "./Plan";
|
|
8
|
+
import { ProductTopping } from "./ProductTopping";
|
|
9
|
+
import { IPropsContactDetails } from "../interfaces";
|
|
10
10
|
export declare class Company {
|
|
11
11
|
id: number;
|
|
12
12
|
code: string;
|
|
@@ -17,6 +17,7 @@ export declare class Company {
|
|
|
17
17
|
contact_details: IPropsContactDetails | null;
|
|
18
18
|
legal_information: any;
|
|
19
19
|
legal_agent: any;
|
|
20
|
+
settings: any;
|
|
20
21
|
created: Date;
|
|
21
22
|
expiration: Date;
|
|
22
23
|
updated: Date;
|
package/dist/entities/Company.js
CHANGED
|
@@ -26,98 +26,107 @@ var Company = /** @class */ (function () {
|
|
|
26
26
|
}
|
|
27
27
|
__decorate([
|
|
28
28
|
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
29
|
-
comment:
|
|
29
|
+
comment: "Número de identificación (ID) único de cada empresa.",
|
|
30
30
|
}),
|
|
31
31
|
__metadata("design:type", Number)
|
|
32
32
|
], Company.prototype, "id", void 0);
|
|
33
33
|
__decorate([
|
|
34
|
-
(0, typeorm_1.Column)({ length: 30, unique: true, comment:
|
|
34
|
+
(0, typeorm_1.Column)({ length: 30, unique: true, comment: "Código único de la empresa." }),
|
|
35
35
|
__metadata("design:type", String)
|
|
36
36
|
], Company.prototype, "code", void 0);
|
|
37
37
|
__decorate([
|
|
38
|
-
(0, typeorm_1.Column)({ length: 50, comment:
|
|
38
|
+
(0, typeorm_1.Column)({ length: 50, comment: "Nombre de la empresa." }),
|
|
39
39
|
__metadata("design:type", String)
|
|
40
40
|
], Company.prototype, "name", void 0);
|
|
41
41
|
__decorate([
|
|
42
42
|
(0, typeorm_1.ManyToOne)(function () { return City_1.City; }, function (city) { return city.companies; }, {
|
|
43
|
-
onDelete:
|
|
44
|
-
onUpdate:
|
|
43
|
+
onDelete: "RESTRICT",
|
|
44
|
+
onUpdate: "NO ACTION",
|
|
45
45
|
}),
|
|
46
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
46
|
+
(0, typeorm_1.JoinColumn)({ name: "city" }),
|
|
47
47
|
__metadata("design:type", City_1.City)
|
|
48
48
|
], Company.prototype, "city", void 0);
|
|
49
49
|
__decorate([
|
|
50
50
|
(0, typeorm_1.ManyToOne)(function () { return Partner_1.Partner; }, function (partner) { return partner.companies; }, {
|
|
51
|
-
onDelete:
|
|
52
|
-
onUpdate:
|
|
51
|
+
onDelete: "CASCADE",
|
|
52
|
+
onUpdate: "NO ACTION",
|
|
53
53
|
}),
|
|
54
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
54
|
+
(0, typeorm_1.JoinColumn)({ name: "partner" }),
|
|
55
55
|
__metadata("design:type", Partner_1.Partner)
|
|
56
56
|
], Company.prototype, "partner", void 0);
|
|
57
57
|
__decorate([
|
|
58
58
|
(0, typeorm_1.Column)({
|
|
59
|
-
type:
|
|
59
|
+
type: "longtext",
|
|
60
60
|
nullable: true,
|
|
61
61
|
transformer: jsonTransformer_1.jsonTransformer,
|
|
62
|
-
comment:
|
|
62
|
+
comment: "Campo de tipo JSON donde se guarda información necesaria para la empresa.",
|
|
63
63
|
}),
|
|
64
64
|
__metadata("design:type", Object)
|
|
65
65
|
], Company.prototype, "profile", void 0);
|
|
66
66
|
__decorate([
|
|
67
67
|
(0, typeorm_1.Column)({
|
|
68
|
-
type:
|
|
68
|
+
type: "text",
|
|
69
69
|
nullable: true,
|
|
70
70
|
transformer: jsonTransformer_1.jsonTransformer,
|
|
71
|
-
comment:
|
|
71
|
+
comment: "Campo de tipo JSON donde se guarda información para guardar el teléfono y el correo electrónico, también los nuevos valores qué tengan esos 2 campos.",
|
|
72
72
|
}),
|
|
73
73
|
__metadata("design:type", Object)
|
|
74
74
|
], Company.prototype, "contact_details", void 0);
|
|
75
75
|
__decorate([
|
|
76
76
|
(0, typeorm_1.Column)({
|
|
77
|
-
type:
|
|
77
|
+
type: "longtext",
|
|
78
78
|
nullable: true,
|
|
79
79
|
transformer: jsonTransformer_1.jsonTransformer,
|
|
80
|
-
comment:
|
|
80
|
+
comment: "Información de tipo JSON donde se guarda la información legal de la empresa.",
|
|
81
81
|
}),
|
|
82
82
|
__metadata("design:type", Object)
|
|
83
83
|
], Company.prototype, "legal_information", void 0);
|
|
84
84
|
__decorate([
|
|
85
85
|
(0, typeorm_1.Column)({
|
|
86
|
-
type:
|
|
86
|
+
type: "longtext",
|
|
87
87
|
nullable: true,
|
|
88
88
|
transformer: jsonTransformer_1.jsonTransformer,
|
|
89
|
-
comment:
|
|
89
|
+
comment: "Información de tipo JSON donde se guarda la información del representante legal del representante.",
|
|
90
90
|
}),
|
|
91
91
|
__metadata("design:type", Object)
|
|
92
92
|
], Company.prototype, "legal_agent", void 0);
|
|
93
93
|
__decorate([
|
|
94
94
|
(0, typeorm_1.Column)({
|
|
95
|
-
type:
|
|
95
|
+
type: "longtext",
|
|
96
|
+
nullable: true,
|
|
97
|
+
transformer: jsonTransformer_1.jsonTransformer,
|
|
98
|
+
comment: "Configuración de la empresa.",
|
|
99
|
+
}),
|
|
100
|
+
__metadata("design:type", Object)
|
|
101
|
+
], Company.prototype, "settings", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, typeorm_1.Column)({
|
|
104
|
+
type: "datetime",
|
|
96
105
|
transformer: new dateTransformer_1.DateTransformer(),
|
|
97
|
-
comment:
|
|
106
|
+
comment: "Fecha creación de la empresa.",
|
|
98
107
|
}),
|
|
99
108
|
__metadata("design:type", Date)
|
|
100
109
|
], Company.prototype, "created", void 0);
|
|
101
110
|
__decorate([
|
|
102
111
|
(0, typeorm_1.Column)({
|
|
103
|
-
type:
|
|
112
|
+
type: "date",
|
|
104
113
|
nullable: true,
|
|
105
|
-
comment:
|
|
114
|
+
comment: "Cuándo expira el plan de la empresa.",
|
|
106
115
|
}),
|
|
107
116
|
__metadata("design:type", Date)
|
|
108
117
|
], Company.prototype, "expiration", void 0);
|
|
109
118
|
__decorate([
|
|
110
119
|
(0, typeorm_1.Column)({
|
|
111
|
-
type:
|
|
120
|
+
type: "datetime",
|
|
112
121
|
transformer: new dateTransformer_1.DateTransformer(),
|
|
113
|
-
comment:
|
|
122
|
+
comment: "Fecha de actualización de la empresa.",
|
|
114
123
|
}),
|
|
115
124
|
__metadata("design:type", Date)
|
|
116
125
|
], Company.prototype, "updated", void 0);
|
|
117
126
|
__decorate([
|
|
118
127
|
(0, typeorm_1.Column)({
|
|
119
128
|
default: 1,
|
|
120
|
-
comment:
|
|
129
|
+
comment: "Estado de la empresa, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
121
130
|
}),
|
|
122
131
|
__metadata("design:type", Number)
|
|
123
132
|
], Company.prototype, "status", void 0);
|
|
@@ -151,7 +160,7 @@ var Company = /** @class */ (function () {
|
|
|
151
160
|
], Company.prototype, "plans_company", void 0);
|
|
152
161
|
Company = __decorate([
|
|
153
162
|
(0, typeorm_1.Entity)({
|
|
154
|
-
comment:
|
|
163
|
+
comment: "Tabla creada para las empresas de comida rápida que deseen registrarse en la plataforma.",
|
|
155
164
|
})
|
|
156
165
|
], Company);
|
|
157
166
|
return Company;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Category, MasterNotification, Product, VerifyLocal } from "..";
|
|
1
|
+
import { Category, MasterNotification, PartnerSession, Product, VerifyLocal } from "..";
|
|
2
2
|
import { City } from "./City";
|
|
3
3
|
import { Company } from "./Company";
|
|
4
4
|
import { DiscountCodeUser } from "./DiscountCodeUser";
|
|
@@ -36,4 +36,5 @@ export declare class Partner {
|
|
|
36
36
|
partners_created_by: Product[];
|
|
37
37
|
partners_category_update_by: Category[];
|
|
38
38
|
partners_category_created_by: Category[];
|
|
39
|
+
partners: PartnerSession[];
|
|
39
40
|
}
|
package/dist/entities/Partner.js
CHANGED
|
@@ -225,6 +225,10 @@ var Partner = /** @class */ (function () {
|
|
|
225
225
|
(0, typeorm_1.OneToMany)(function () { return __1.Category; }, function (category) { return category.created_by; }),
|
|
226
226
|
__metadata("design:type", Array)
|
|
227
227
|
], Partner.prototype, "partners_category_created_by", void 0);
|
|
228
|
+
__decorate([
|
|
229
|
+
(0, typeorm_1.OneToMany)(function () { return __1.PartnerSession; }, function (partnerSession) { return partnerSession.partner; }),
|
|
230
|
+
__metadata("design:type", Array)
|
|
231
|
+
], Partner.prototype, "partners", void 0);
|
|
228
232
|
Partner = __decorate([
|
|
229
233
|
(0, typeorm_1.Entity)({
|
|
230
234
|
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,13 @@
|
|
|
1
|
+
import { Partner } from "..";
|
|
2
|
+
export declare class PartnerSession {
|
|
3
|
+
id: number;
|
|
4
|
+
partner: Partner;
|
|
5
|
+
platform: number;
|
|
6
|
+
token: string;
|
|
7
|
+
ip_address: string;
|
|
8
|
+
start_time: Date;
|
|
9
|
+
finish_time: Date;
|
|
10
|
+
status: number;
|
|
11
|
+
created: Date;
|
|
12
|
+
updated: Date;
|
|
13
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
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.PartnerSession = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var __1 = require("..");
|
|
15
|
+
var dateTransformer_1 = require("../transformers/dateTransformer");
|
|
16
|
+
var PartnerSession = /** @class */ (function () {
|
|
17
|
+
function PartnerSession() {
|
|
18
|
+
}
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
21
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
22
|
+
}),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], PartnerSession.prototype, "id", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(function () { return __1.Partner; }, function (partner) { return partner.partners; }, {
|
|
27
|
+
onDelete: "CASCADE",
|
|
28
|
+
onUpdate: "NO ACTION",
|
|
29
|
+
}),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: "partner" }),
|
|
31
|
+
__metadata("design:type", __1.Partner)
|
|
32
|
+
], PartnerSession.prototype, "partner", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({
|
|
35
|
+
comment: "Plataforma a la que está inciando sesión:\r\n1. Administrador.\r\n2. Portal - Terminal.",
|
|
36
|
+
}),
|
|
37
|
+
__metadata("design:type", Number)
|
|
38
|
+
], PartnerSession.prototype, "platform", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({
|
|
41
|
+
length: 255,
|
|
42
|
+
comment: "Token generado para la sesión.",
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], PartnerSession.prototype, "token", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({
|
|
48
|
+
length: 255,
|
|
49
|
+
comment: "Dirección IP de donde está accediendo.",
|
|
50
|
+
}),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], PartnerSession.prototype, "ip_address", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({
|
|
55
|
+
type: "datetime",
|
|
56
|
+
default: function () { return "CURRENT_TIMESTAMP"; },
|
|
57
|
+
comment: "Fecha de inicio de la sesión.",
|
|
58
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:type", Date)
|
|
61
|
+
], PartnerSession.prototype, "start_time", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({
|
|
64
|
+
type: "datetime",
|
|
65
|
+
nullable: true,
|
|
66
|
+
comment: "Fecha de finalización de la sesión.",
|
|
67
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", Date)
|
|
70
|
+
], PartnerSession.prototype, "finish_time", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({
|
|
73
|
+
default: 1,
|
|
74
|
+
comment: "Estado de la sesión:\r\n1. Activa.\r\n2. Expirada.\r\n3. Revocada.",
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", Number)
|
|
77
|
+
], PartnerSession.prototype, "status", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.Column)({
|
|
80
|
+
type: "datetime",
|
|
81
|
+
default: function () { return "CURRENT_TIMESTAMP"; },
|
|
82
|
+
comment: "Fecha de creación del registro.",
|
|
83
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
84
|
+
}),
|
|
85
|
+
__metadata("design:type", Date)
|
|
86
|
+
], PartnerSession.prototype, "created", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, typeorm_1.Column)({
|
|
89
|
+
type: "datetime",
|
|
90
|
+
default: function () { return "CURRENT_TIMESTAMP"; },
|
|
91
|
+
comment: "Fecha de actualización del registro.",
|
|
92
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
93
|
+
}),
|
|
94
|
+
__metadata("design:type", Date)
|
|
95
|
+
], PartnerSession.prototype, "updated", void 0);
|
|
96
|
+
PartnerSession = __decorate([
|
|
97
|
+
(0, typeorm_1.Entity)({
|
|
98
|
+
comment: "Tabla creada para llevar el control de las sesiones (partner)",
|
|
99
|
+
name: "partner_session",
|
|
100
|
+
})
|
|
101
|
+
], PartnerSession);
|
|
102
|
+
return PartnerSession;
|
|
103
|
+
}());
|
|
104
|
+
exports.PartnerSession = PartnerSession;
|
|
@@ -49,6 +49,7 @@ export { CategoryDate } from "./entities/CategoryDate";
|
|
|
49
49
|
export { ProductSchedule } from "./entities/ProductSchedule";
|
|
50
50
|
export { ProductDate } from "./entities/ProductDate";
|
|
51
51
|
export { ToppingImage } from "./entities/ToppingImage";
|
|
52
|
+
export { PartnerSession } from "./entities/PartnerSession";
|
|
52
53
|
export { LocalsCompany } from "./views/LocalsCompany";
|
|
53
54
|
export { VerifyLocals } from "./views/VerifyLocals";
|
|
54
55
|
export { MasterNotifications } from "./views/MasterNotifications";
|
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
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;
|
|
18
|
+
exports.CustomRepository = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.PartnerSession = 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");
|
|
@@ -118,6 +118,8 @@ var ProductDate_1 = require("./entities/ProductDate");
|
|
|
118
118
|
Object.defineProperty(exports, "ProductDate", { enumerable: true, get: function () { return ProductDate_1.ProductDate; } });
|
|
119
119
|
var ToppingImage_1 = require("./entities/ToppingImage");
|
|
120
120
|
Object.defineProperty(exports, "ToppingImage", { enumerable: true, get: function () { return ToppingImage_1.ToppingImage; } });
|
|
121
|
+
var PartnerSession_1 = require("./entities/PartnerSession");
|
|
122
|
+
Object.defineProperty(exports, "PartnerSession", { enumerable: true, get: function () { return PartnerSession_1.PartnerSession; } });
|
|
121
123
|
var LocalsCompany_1 = require("./views/LocalsCompany");
|
|
122
124
|
Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
|
|
123
125
|
var VerifyLocals_1 = require("./views/VerifyLocals");
|
package/package.json
CHANGED
package/src/entities/Company.ts
CHANGED
|
@@ -5,137 +5,145 @@ import {
|
|
|
5
5
|
ManyToOne,
|
|
6
6
|
OneToMany,
|
|
7
7
|
PrimaryGeneratedColumn,
|
|
8
|
-
} from
|
|
9
|
-
import { City } from
|
|
10
|
-
import { CodeRedemptionHistoryCompany } from
|
|
11
|
-
import { DiscountCodeUser } from
|
|
12
|
-
import { Local } from
|
|
13
|
-
import { Partner } from
|
|
14
|
-
import { PartnerRole } from
|
|
15
|
-
import { Plan } from
|
|
16
|
-
import { ProductTopping } from
|
|
17
|
-
import { jsonTransformer } from
|
|
18
|
-
import { DateTransformer } from
|
|
19
|
-
import { IPropsContactDetails } from
|
|
8
|
+
} from "typeorm";
|
|
9
|
+
import { City } from "./City";
|
|
10
|
+
import { CodeRedemptionHistoryCompany } from "./CodeRedemptionHistoryCompany";
|
|
11
|
+
import { DiscountCodeUser } from "./DiscountCodeUser";
|
|
12
|
+
import { Local } from "./Local";
|
|
13
|
+
import { Partner } from "./Partner";
|
|
14
|
+
import { PartnerRole } from "./PartnerRole";
|
|
15
|
+
import { Plan } from "./Plan";
|
|
16
|
+
import { ProductTopping } from "./ProductTopping";
|
|
17
|
+
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
18
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
19
|
+
import { IPropsContactDetails } from "../interfaces";
|
|
20
20
|
|
|
21
21
|
@Entity({
|
|
22
22
|
comment:
|
|
23
|
-
|
|
23
|
+
"Tabla creada para las empresas de comida rápida que deseen registrarse en la plataforma.",
|
|
24
24
|
})
|
|
25
25
|
export class Company {
|
|
26
26
|
@PrimaryGeneratedColumn({
|
|
27
|
-
comment:
|
|
27
|
+
comment: "Número de identificación (ID) único de cada empresa.",
|
|
28
28
|
})
|
|
29
|
-
id: number
|
|
29
|
+
id: number;
|
|
30
30
|
|
|
31
|
-
@Column({ length: 30, unique: true, comment:
|
|
32
|
-
code: string
|
|
31
|
+
@Column({ length: 30, unique: true, comment: "Código único de la empresa." })
|
|
32
|
+
code: string;
|
|
33
33
|
|
|
34
|
-
@Column({ length: 50, comment:
|
|
35
|
-
name: string
|
|
34
|
+
@Column({ length: 50, comment: "Nombre de la empresa." })
|
|
35
|
+
name: string;
|
|
36
36
|
|
|
37
37
|
@ManyToOne(() => City, (city) => city.companies, {
|
|
38
|
-
onDelete:
|
|
39
|
-
onUpdate:
|
|
38
|
+
onDelete: "RESTRICT",
|
|
39
|
+
onUpdate: "NO ACTION",
|
|
40
40
|
})
|
|
41
|
-
@JoinColumn({ name:
|
|
42
|
-
city: City
|
|
41
|
+
@JoinColumn({ name: "city" })
|
|
42
|
+
city: City;
|
|
43
43
|
|
|
44
44
|
@ManyToOne(() => Partner, (partner) => partner.companies, {
|
|
45
|
-
onDelete:
|
|
46
|
-
onUpdate:
|
|
45
|
+
onDelete: "CASCADE",
|
|
46
|
+
onUpdate: "NO ACTION",
|
|
47
47
|
})
|
|
48
|
-
@JoinColumn({ name:
|
|
49
|
-
partner: Partner
|
|
48
|
+
@JoinColumn({ name: "partner" })
|
|
49
|
+
partner: Partner;
|
|
50
50
|
|
|
51
51
|
@Column({
|
|
52
|
-
type:
|
|
52
|
+
type: "longtext",
|
|
53
53
|
nullable: true,
|
|
54
54
|
transformer: jsonTransformer,
|
|
55
55
|
comment:
|
|
56
|
-
|
|
56
|
+
"Campo de tipo JSON donde se guarda información necesaria para la empresa.",
|
|
57
57
|
})
|
|
58
|
-
profile: any
|
|
58
|
+
profile: any;
|
|
59
59
|
|
|
60
60
|
@Column({
|
|
61
|
-
type:
|
|
61
|
+
type: "text",
|
|
62
62
|
nullable: true,
|
|
63
63
|
transformer: jsonTransformer,
|
|
64
64
|
comment:
|
|
65
|
-
|
|
65
|
+
"Campo de tipo JSON donde se guarda información para guardar el teléfono y el correo electrónico, también los nuevos valores qué tengan esos 2 campos.",
|
|
66
66
|
})
|
|
67
|
-
contact_details: IPropsContactDetails | null
|
|
67
|
+
contact_details: IPropsContactDetails | null;
|
|
68
68
|
|
|
69
69
|
@Column({
|
|
70
|
-
type:
|
|
70
|
+
type: "longtext",
|
|
71
71
|
nullable: true,
|
|
72
72
|
transformer: jsonTransformer,
|
|
73
73
|
comment:
|
|
74
|
-
|
|
74
|
+
"Información de tipo JSON donde se guarda la información legal de la empresa.",
|
|
75
75
|
})
|
|
76
|
-
legal_information: any
|
|
76
|
+
legal_information: any;
|
|
77
77
|
|
|
78
78
|
@Column({
|
|
79
|
-
type:
|
|
79
|
+
type: "longtext",
|
|
80
80
|
nullable: true,
|
|
81
81
|
transformer: jsonTransformer,
|
|
82
82
|
comment:
|
|
83
|
-
|
|
83
|
+
"Información de tipo JSON donde se guarda la información del representante legal del representante.",
|
|
84
84
|
})
|
|
85
|
-
legal_agent: any
|
|
85
|
+
legal_agent: any;
|
|
86
86
|
|
|
87
87
|
@Column({
|
|
88
|
-
type:
|
|
88
|
+
type: "longtext",
|
|
89
|
+
nullable: true,
|
|
90
|
+
transformer: jsonTransformer,
|
|
91
|
+
comment: "Configuración de la empresa.",
|
|
92
|
+
})
|
|
93
|
+
settings: any;
|
|
94
|
+
|
|
95
|
+
@Column({
|
|
96
|
+
type: "datetime",
|
|
89
97
|
transformer: new DateTransformer(),
|
|
90
|
-
comment:
|
|
98
|
+
comment: "Fecha creación de la empresa.",
|
|
91
99
|
})
|
|
92
|
-
created: Date
|
|
100
|
+
created: Date;
|
|
93
101
|
|
|
94
102
|
@Column({
|
|
95
|
-
type:
|
|
103
|
+
type: "date",
|
|
96
104
|
nullable: true,
|
|
97
|
-
comment:
|
|
105
|
+
comment: "Cuándo expira el plan de la empresa.",
|
|
98
106
|
})
|
|
99
|
-
expiration: Date
|
|
107
|
+
expiration: Date;
|
|
100
108
|
|
|
101
109
|
@Column({
|
|
102
|
-
type:
|
|
110
|
+
type: "datetime",
|
|
103
111
|
transformer: new DateTransformer(),
|
|
104
|
-
comment:
|
|
112
|
+
comment: "Fecha de actualización de la empresa.",
|
|
105
113
|
})
|
|
106
|
-
updated: Date
|
|
114
|
+
updated: Date;
|
|
107
115
|
|
|
108
116
|
@Column({
|
|
109
117
|
default: 1,
|
|
110
118
|
comment:
|
|
111
|
-
|
|
119
|
+
"Estado de la empresa, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
112
120
|
})
|
|
113
|
-
status: number
|
|
121
|
+
status: number;
|
|
114
122
|
|
|
115
123
|
@OneToMany(() => Local, (local) => local.company)
|
|
116
|
-
locals: Local[]
|
|
124
|
+
locals: Local[];
|
|
117
125
|
|
|
118
126
|
@OneToMany(
|
|
119
127
|
() => CodeRedemptionHistoryCompany,
|
|
120
128
|
(codeRedemptionHistoryCompany) => codeRedemptionHistoryCompany.company
|
|
121
129
|
)
|
|
122
|
-
code_redemption_history_company: CodeRedemptionHistoryCompany[]
|
|
130
|
+
code_redemption_history_company: CodeRedemptionHistoryCompany[];
|
|
123
131
|
|
|
124
132
|
@OneToMany(
|
|
125
133
|
() => DiscountCodeUser,
|
|
126
134
|
(discountCodeUser) => discountCodeUser.company
|
|
127
135
|
)
|
|
128
|
-
discount_code_users: DiscountCodeUser[]
|
|
136
|
+
discount_code_users: DiscountCodeUser[];
|
|
129
137
|
|
|
130
138
|
@OneToMany(() => ProductTopping, (productTopping) => productTopping.company)
|
|
131
|
-
product_toppings: ProductTopping[]
|
|
139
|
+
product_toppings: ProductTopping[];
|
|
132
140
|
|
|
133
141
|
@OneToMany(() => Partner, (partner) => partner.company)
|
|
134
|
-
partners_company: Partner[]
|
|
142
|
+
partners_company: Partner[];
|
|
135
143
|
|
|
136
144
|
@OneToMany(() => PartnerRole, (partnerRole) => partnerRole.company)
|
|
137
|
-
roles_company: PartnerRole[]
|
|
145
|
+
roles_company: PartnerRole[];
|
|
138
146
|
|
|
139
147
|
@OneToMany(() => Plan, (plan) => plan.company)
|
|
140
|
-
plans_company: Plan[]
|
|
148
|
+
plans_company: Plan[];
|
|
141
149
|
}
|
package/src/entities/Partner.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
OneToMany,
|
|
9
9
|
PrimaryGeneratedColumn
|
|
10
10
|
} from "typeorm";
|
|
11
|
-
import { Category, MasterNotification, Product, VerifyLocal } from "..";
|
|
11
|
+
import { Category, MasterNotification, PartnerSession, Product, VerifyLocal } from "..";
|
|
12
12
|
import { DateTransformer } from "../transformers/dateTransformer";
|
|
13
13
|
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
14
14
|
import { City } from "./City";
|
|
@@ -206,4 +206,7 @@ export class Partner {
|
|
|
206
206
|
|
|
207
207
|
@OneToMany(() => Category, (category) => category.created_by)
|
|
208
208
|
partners_category_created_by: Category[];
|
|
209
|
+
|
|
210
|
+
@OneToMany(() => PartnerSession, (partnerSession) => partnerSession.partner)
|
|
211
|
+
partners: PartnerSession[];
|
|
209
212
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
Column,
|
|
4
|
+
PrimaryGeneratedColumn,
|
|
5
|
+
ManyToOne,
|
|
6
|
+
JoinColumn,
|
|
7
|
+
OneToMany,
|
|
8
|
+
BaseEntity,
|
|
9
|
+
} from "typeorm";
|
|
10
|
+
import { Country } from "./Country";
|
|
11
|
+
import { City } from "./City";
|
|
12
|
+
import { Partner } from "..";
|
|
13
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
14
|
+
|
|
15
|
+
@Entity({
|
|
16
|
+
comment: "Tabla creada para llevar el control de las sesiones (partner)",
|
|
17
|
+
name: "partner_session",
|
|
18
|
+
})
|
|
19
|
+
export class PartnerSession {
|
|
20
|
+
@PrimaryGeneratedColumn({
|
|
21
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
22
|
+
})
|
|
23
|
+
id: number;
|
|
24
|
+
|
|
25
|
+
@ManyToOne(() => Partner, (partner) => partner.partners, {
|
|
26
|
+
onDelete: "CASCADE",
|
|
27
|
+
onUpdate: "NO ACTION",
|
|
28
|
+
})
|
|
29
|
+
@JoinColumn({ name: "partner" })
|
|
30
|
+
partner: Partner;
|
|
31
|
+
|
|
32
|
+
@Column({
|
|
33
|
+
comment:
|
|
34
|
+
"Plataforma a la que está inciando sesión:\r\n1. Administrador.\r\n2. Portal - Terminal.",
|
|
35
|
+
})
|
|
36
|
+
platform: number;
|
|
37
|
+
|
|
38
|
+
@Column({
|
|
39
|
+
length: 255,
|
|
40
|
+
comment: "Token generado para la sesión.",
|
|
41
|
+
})
|
|
42
|
+
token: string;
|
|
43
|
+
|
|
44
|
+
@Column({
|
|
45
|
+
length: 255,
|
|
46
|
+
comment: "Dirección IP de donde está accediendo.",
|
|
47
|
+
})
|
|
48
|
+
ip_address: string;
|
|
49
|
+
|
|
50
|
+
@Column({
|
|
51
|
+
type: "datetime",
|
|
52
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
53
|
+
comment: "Fecha de inicio de la sesión.",
|
|
54
|
+
transformer: new DateTransformer(),
|
|
55
|
+
})
|
|
56
|
+
start_time: Date;
|
|
57
|
+
|
|
58
|
+
@Column({
|
|
59
|
+
type: "datetime",
|
|
60
|
+
nullable: true,
|
|
61
|
+
comment: "Fecha de finalización de la sesión.",
|
|
62
|
+
transformer: new DateTransformer(),
|
|
63
|
+
})
|
|
64
|
+
finish_time: Date;
|
|
65
|
+
|
|
66
|
+
@Column({
|
|
67
|
+
default: 1,
|
|
68
|
+
comment:
|
|
69
|
+
"Estado de la sesión:\r\n1. Activa.\r\n2. Expirada.\r\n3. Revocada.",
|
|
70
|
+
})
|
|
71
|
+
status: number;
|
|
72
|
+
|
|
73
|
+
@Column({
|
|
74
|
+
type: "datetime",
|
|
75
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
76
|
+
comment: "Fecha de creación del registro.",
|
|
77
|
+
transformer: new DateTransformer(),
|
|
78
|
+
})
|
|
79
|
+
created: Date;
|
|
80
|
+
|
|
81
|
+
@Column({
|
|
82
|
+
type: "datetime",
|
|
83
|
+
default: () => "CURRENT_TIMESTAMP",
|
|
84
|
+
comment: "Fecha de actualización del registro.",
|
|
85
|
+
transformer: new DateTransformer(),
|
|
86
|
+
})
|
|
87
|
+
updated: Date;
|
|
88
|
+
}
|
|
@@ -49,6 +49,7 @@ export { CategoryDate } from "./entities/CategoryDate";
|
|
|
49
49
|
export { ProductSchedule } from "./entities/ProductSchedule";
|
|
50
50
|
export { ProductDate } from "./entities/ProductDate";
|
|
51
51
|
export { ToppingImage } from "./entities/ToppingImage";
|
|
52
|
+
export { PartnerSession } from "./entities/PartnerSession";
|
|
52
53
|
|
|
53
54
|
export { LocalsCompany } from "./views/LocalsCompany";
|
|
54
55
|
export { VerifyLocals } from "./views/VerifyLocals";
|