test-entity-library-asm 3.9.8 → 3.9.10
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/Country.d.ts +2 -1
- package/dist/entities/Country.js +4 -0
- package/dist/entities/CountryHoliday.d.ts +8 -0
- package/dist/entities/CountryHoliday.js +57 -0
- package/dist/entities/Master.d.ts +5 -3
- package/dist/entities/Master.js +21 -2
- package/dist/entities/MasterSession.d.ts +13 -0
- package/dist/entities/MasterSession.js +107 -0
- package/dist/entities.views.routes.d.ts +2 -0
- package/dist/entities.views.routes.js +5 -1
- package/package.json +1 -1
- package/src/entities/Country.ts +4 -1
- package/src/entities/CountryHoliday.ts +43 -0
- package/src/entities/Master.ts +21 -3
- package/src/entities/MasterSession.ts +89 -0
- package/src/entities.views.routes.ts +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bank } from "..";
|
|
1
|
+
import { Bank, CountryHoliday } from "..";
|
|
2
2
|
import { Region } from "./Region";
|
|
3
3
|
export declare class Country {
|
|
4
4
|
id: number;
|
|
@@ -13,4 +13,5 @@ export declare class Country {
|
|
|
13
13
|
status: number;
|
|
14
14
|
regions: Region[];
|
|
15
15
|
banks: Bank[];
|
|
16
|
+
country_holidays: CountryHoliday[];
|
|
16
17
|
}
|
package/dist/entities/Country.js
CHANGED
|
@@ -99,6 +99,10 @@ __decorate([
|
|
|
99
99
|
(0, typeorm_1.OneToMany)(() => __1.Bank, (bank) => bank.country),
|
|
100
100
|
__metadata("design:type", Array)
|
|
101
101
|
], Country.prototype, "banks", void 0);
|
|
102
|
+
__decorate([
|
|
103
|
+
(0, typeorm_1.OneToMany)(() => __1.CountryHoliday, (countryHoliday) => countryHoliday.country),
|
|
104
|
+
__metadata("design:type", Array)
|
|
105
|
+
], Country.prototype, "country_holidays", void 0);
|
|
102
106
|
exports.Country = Country = __decorate([
|
|
103
107
|
(0, typeorm_1.Entity)({ comment: "Países donde está disponible la plataforma." })
|
|
104
108
|
], Country);
|
|
@@ -0,0 +1,57 @@
|
|
|
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.CountryHoliday = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const dateTransformer_1 = require("../transformers/dateTransformer");
|
|
15
|
+
const Country_1 = require("./Country");
|
|
16
|
+
let CountryHoliday = class CountryHoliday {
|
|
17
|
+
};
|
|
18
|
+
exports.CountryHoliday = CountryHoliday;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
21
|
+
type: "int",
|
|
22
|
+
comment: "ID único de cada registro.",
|
|
23
|
+
}),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], CountryHoliday.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 200, comment: "Nombre del festivo." }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], CountryHoliday.prototype, "name", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({
|
|
32
|
+
type: "date",
|
|
33
|
+
comment: "Fecha del festivo.",
|
|
34
|
+
}),
|
|
35
|
+
__metadata("design:type", Date)
|
|
36
|
+
], CountryHoliday.prototype, "date", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.ManyToOne)(() => Country_1.Country, (country) => country.country_holidays, {
|
|
39
|
+
onDelete: "CASCADE",
|
|
40
|
+
onUpdate: "NO ACTION",
|
|
41
|
+
}),
|
|
42
|
+
(0, typeorm_1.JoinColumn)({ name: "country" }),
|
|
43
|
+
__metadata("design:type", Country_1.Country)
|
|
44
|
+
], CountryHoliday.prototype, "country", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({
|
|
47
|
+
type: "datetime",
|
|
48
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
49
|
+
comment: "Fecha de creación del registro.",
|
|
50
|
+
}),
|
|
51
|
+
__metadata("design:type", Date)
|
|
52
|
+
], CountryHoliday.prototype, "created", void 0);
|
|
53
|
+
exports.CountryHoliday = CountryHoliday = __decorate([
|
|
54
|
+
(0, typeorm_1.Entity)("country_holiday", {
|
|
55
|
+
comment: "Tabla para guardar los festivos de los países.",
|
|
56
|
+
})
|
|
57
|
+
], CountryHoliday);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MasterNotification, PartnerNotification, VerifyLocal } from "..";
|
|
1
|
+
import { MasterNotification, MasterSession, PartnerNotification, VerifyLocal } from "..";
|
|
2
2
|
import { City } from "./City";
|
|
3
3
|
import { DiscountCodeCompany } from "./DiscountCodeCompany";
|
|
4
4
|
import { MasterRole } from "./MasterRole";
|
|
@@ -9,10 +9,11 @@ export declare class Master {
|
|
|
9
9
|
name: string;
|
|
10
10
|
surname: string;
|
|
11
11
|
email: string;
|
|
12
|
-
phone: string;
|
|
12
|
+
phone: string | null;
|
|
13
13
|
city: City;
|
|
14
14
|
address: string;
|
|
15
|
-
password: string;
|
|
15
|
+
password: string | null;
|
|
16
|
+
google_id: string | null;
|
|
16
17
|
profile: any | null;
|
|
17
18
|
created: Date;
|
|
18
19
|
updated: Date;
|
|
@@ -24,4 +25,5 @@ export declare class Master {
|
|
|
24
25
|
master_notifications: MasterNotification[];
|
|
25
26
|
masters_to_notification: MasterNotification[];
|
|
26
27
|
masters_notification: PartnerNotification[];
|
|
28
|
+
masters_session: MasterSession[];
|
|
27
29
|
}
|
package/dist/entities/Master.js
CHANGED
|
@@ -69,9 +69,11 @@ __decorate([
|
|
|
69
69
|
type: "varchar",
|
|
70
70
|
length: 12,
|
|
71
71
|
unique: true,
|
|
72
|
+
nullable: true,
|
|
73
|
+
default: null,
|
|
72
74
|
comment: "Número de celular del master.",
|
|
73
75
|
}),
|
|
74
|
-
__metadata("design:type",
|
|
76
|
+
__metadata("design:type", Object)
|
|
75
77
|
], Master.prototype, "phone", void 0);
|
|
76
78
|
__decorate([
|
|
77
79
|
(0, typeorm_1.ManyToOne)(() => City_1.City, (city) => city.masters, {
|
|
@@ -93,11 +95,24 @@ __decorate([
|
|
|
93
95
|
__decorate([
|
|
94
96
|
(0, typeorm_1.Column)({
|
|
95
97
|
type: "varchar",
|
|
98
|
+
nullable: false,
|
|
99
|
+
default: null,
|
|
96
100
|
length: 255,
|
|
97
101
|
comment: "Contraseña almacenada tipo SHA256 del master.",
|
|
98
102
|
}),
|
|
99
|
-
__metadata("design:type",
|
|
103
|
+
__metadata("design:type", Object)
|
|
100
104
|
], Master.prototype, "password", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
(0, typeorm_1.Column)({
|
|
107
|
+
length: 255,
|
|
108
|
+
type: "varchar",
|
|
109
|
+
unique: true,
|
|
110
|
+
nullable: true,
|
|
111
|
+
default: null,
|
|
112
|
+
comment: "Guardamos el token o lo que nos retorna google cuando le damos iniciar con google",
|
|
113
|
+
}),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], Master.prototype, "google_id", void 0);
|
|
101
116
|
__decorate([
|
|
102
117
|
(0, typeorm_1.Column)({
|
|
103
118
|
type: "longtext",
|
|
@@ -188,6 +203,10 @@ __decorate([
|
|
|
188
203
|
(0, typeorm_1.OneToMany)(() => __1.PartnerNotification, (partner_notification) => partner_notification.master),
|
|
189
204
|
__metadata("design:type", Array)
|
|
190
205
|
], Master.prototype, "masters_notification", void 0);
|
|
206
|
+
__decorate([
|
|
207
|
+
(0, typeorm_1.OneToMany)(() => __1.MasterSession, (MasterSession) => MasterSession.master),
|
|
208
|
+
__metadata("design:type", Array)
|
|
209
|
+
], Master.prototype, "masters_session", void 0);
|
|
191
210
|
exports.Master = Master = __decorate([
|
|
192
211
|
(0, typeorm_1.Entity)({
|
|
193
212
|
comment: "Tabla agregada para los usuarios qué son administradores de la plataforma.",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Master } from "..";
|
|
2
|
+
export declare class MasterSession {
|
|
3
|
+
id: number;
|
|
4
|
+
master: Master;
|
|
5
|
+
platform: number;
|
|
6
|
+
token: string;
|
|
7
|
+
ip_address: string;
|
|
8
|
+
start_time: Date;
|
|
9
|
+
finish_time: Date | null;
|
|
10
|
+
status: number;
|
|
11
|
+
created: Date;
|
|
12
|
+
updated: Date | null;
|
|
13
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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.MasterSession = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const __1 = require("..");
|
|
15
|
+
const dateTransformer_1 = require("../transformers/dateTransformer");
|
|
16
|
+
let MasterSession = class MasterSession {
|
|
17
|
+
};
|
|
18
|
+
exports.MasterSession = MasterSession;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
21
|
+
type: "int",
|
|
22
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
23
|
+
}),
|
|
24
|
+
__metadata("design:type", Number)
|
|
25
|
+
], MasterSession.prototype, "id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.ManyToOne)(() => __1.Master, (master) => master.masters_session, {
|
|
28
|
+
onDelete: "CASCADE",
|
|
29
|
+
onUpdate: "NO ACTION",
|
|
30
|
+
}),
|
|
31
|
+
(0, typeorm_1.JoinColumn)({ name: "master" }),
|
|
32
|
+
__metadata("design:type", __1.Master)
|
|
33
|
+
], MasterSession.prototype, "master", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({
|
|
36
|
+
type: "int",
|
|
37
|
+
default: 1,
|
|
38
|
+
comment: "Plataforma a la que está inciando sesión:\r\n1. Administrador.",
|
|
39
|
+
}),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], MasterSession.prototype, "platform", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({
|
|
44
|
+
length: 255,
|
|
45
|
+
type: "varchar",
|
|
46
|
+
comment: "Token generado para la sesión.",
|
|
47
|
+
}),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], MasterSession.prototype, "token", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({
|
|
52
|
+
length: 255,
|
|
53
|
+
type: "varchar",
|
|
54
|
+
comment: "Dirección IP de donde está accediendo.",
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], MasterSession.prototype, "ip_address", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({
|
|
60
|
+
type: "datetime",
|
|
61
|
+
comment: "Fecha de inicio de la sesión.",
|
|
62
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", Date)
|
|
65
|
+
], MasterSession.prototype, "start_time", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({
|
|
68
|
+
type: "datetime",
|
|
69
|
+
nullable: true,
|
|
70
|
+
default: null,
|
|
71
|
+
comment: "Fecha de finalización de la sesión.",
|
|
72
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
73
|
+
}),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], MasterSession.prototype, "finish_time", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({
|
|
78
|
+
default: 1,
|
|
79
|
+
type: "int",
|
|
80
|
+
width: 1,
|
|
81
|
+
comment: "Estado de la sesión:\r\n1. Activa.\r\n2. Expirada.\r\n3. Revocada.",
|
|
82
|
+
}),
|
|
83
|
+
__metadata("design:type", Number)
|
|
84
|
+
], MasterSession.prototype, "status", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.Column)({
|
|
87
|
+
type: "datetime",
|
|
88
|
+
comment: "Fecha de creación del registro.",
|
|
89
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
90
|
+
}),
|
|
91
|
+
__metadata("design:type", Date)
|
|
92
|
+
], MasterSession.prototype, "created", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, typeorm_1.Column)({
|
|
95
|
+
type: "datetime",
|
|
96
|
+
nullable: true,
|
|
97
|
+
comment: "Fecha de actualización del registro.",
|
|
98
|
+
transformer: new dateTransformer_1.DateTransformer(),
|
|
99
|
+
}),
|
|
100
|
+
__metadata("design:type", Object)
|
|
101
|
+
], MasterSession.prototype, "updated", void 0);
|
|
102
|
+
exports.MasterSession = MasterSession = __decorate([
|
|
103
|
+
(0, typeorm_1.Entity)({
|
|
104
|
+
comment: "Tabla creada para llevar el control de las sesiones (master)",
|
|
105
|
+
name: "master_session",
|
|
106
|
+
})
|
|
107
|
+
], MasterSession);
|
|
@@ -71,6 +71,8 @@ export { ProductImage } from "./entities/ProductImage";
|
|
|
71
71
|
export { LocalPaymentMethod } from "./entities/LocalPaymentMethod";
|
|
72
72
|
export { VerificationCode } from "./entities/VerificationCode";
|
|
73
73
|
export { PartnerPlatformSectionPermissionAssociate } from "./entities/PartnerPlatformSectionPermissionAssociate";
|
|
74
|
+
export { MasterSession } from "./entities/MasterSession";
|
|
75
|
+
export { CountryHoliday } from "./entities/CountryHoliday";
|
|
74
76
|
export { LocalsCompany } from "./views/LocalsCompany";
|
|
75
77
|
export { VerifyLocals } from "./views/VerifyLocals";
|
|
76
78
|
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.ToppingImage = exports.ProductDate = exports.ProductSchedule = exports.CategoryDate = exports.Bank = exports.ServicePlan = exports.PartnerPlatform = exports.PartnerPlatformSection = exports.LocalPlan = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.Square = 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.PartnerPlatformSectionPermission = 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.getLocalReservesInformation = exports.getVerifyLocalsInformation = exports.getLocalsCompanyInformation = exports.getDiscountsCodeUserInformation = exports.getDiscountsCodeCompanyInformation = exports.LocalsCompanyInformationForTheTable = exports.LocalsCompanyInformationForTheMap = exports.LocalReserves = exports.LocalTableZonesFilter = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.PartnerPlatformSectionPermissionAssociate = exports.VerificationCode = exports.LocalPaymentMethod = exports.ProductImage = exports.Gallery = exports.RequestLocalTable = exports.RequestInvoiceCategory = exports.RequestInvoice = exports.LocalTableReserve = exports.LocalReserveStatus = exports.LocalReserve = exports.LocalTableReservePayment = exports.DecorationReserve = exports.LocalDecorationReserve = exports.LocalTable = exports.LocalTableZone = exports.RequestPrint = exports.ReceiptConfig = exports.RequestLocalPayment = exports.UserPaymentMethod = exports.RequestLocalHistory = exports.RequestLocal = exports.PartnerSession = void 0;
|
|
18
|
+
exports.CustomRepository = exports.getLocalReservesInformation = exports.getVerifyLocalsInformation = exports.getLocalsCompanyInformation = exports.getDiscountsCodeUserInformation = exports.getDiscountsCodeCompanyInformation = exports.LocalsCompanyInformationForTheTable = exports.LocalsCompanyInformationForTheMap = exports.LocalReserves = exports.LocalTableZonesFilter = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.CountryHoliday = exports.MasterSession = exports.PartnerPlatformSectionPermissionAssociate = exports.VerificationCode = exports.LocalPaymentMethod = exports.ProductImage = exports.Gallery = exports.RequestLocalTable = exports.RequestInvoiceCategory = exports.RequestInvoice = exports.LocalTableReserve = exports.LocalReserveStatus = exports.LocalReserve = exports.LocalTableReservePayment = exports.DecorationReserve = exports.LocalDecorationReserve = exports.LocalTable = exports.LocalTableZone = exports.RequestPrint = exports.ReceiptConfig = exports.RequestLocalPayment = exports.UserPaymentMethod = exports.RequestLocalHistory = exports.RequestLocal = exports.PartnerSession = 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");
|
|
@@ -162,6 +162,10 @@ var VerificationCode_1 = require("./entities/VerificationCode");
|
|
|
162
162
|
Object.defineProperty(exports, "VerificationCode", { enumerable: true, get: function () { return VerificationCode_1.VerificationCode; } });
|
|
163
163
|
var PartnerPlatformSectionPermissionAssociate_1 = require("./entities/PartnerPlatformSectionPermissionAssociate");
|
|
164
164
|
Object.defineProperty(exports, "PartnerPlatformSectionPermissionAssociate", { enumerable: true, get: function () { return PartnerPlatformSectionPermissionAssociate_1.PartnerPlatformSectionPermissionAssociate; } });
|
|
165
|
+
var MasterSession_1 = require("./entities/MasterSession");
|
|
166
|
+
Object.defineProperty(exports, "MasterSession", { enumerable: true, get: function () { return MasterSession_1.MasterSession; } });
|
|
167
|
+
var CountryHoliday_1 = require("./entities/CountryHoliday");
|
|
168
|
+
Object.defineProperty(exports, "CountryHoliday", { enumerable: true, get: function () { return CountryHoliday_1.CountryHoliday; } });
|
|
165
169
|
var LocalsCompany_1 = require("./views/LocalsCompany");
|
|
166
170
|
Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
|
|
167
171
|
var VerifyLocals_1 = require("./views/VerifyLocals");
|
package/package.json
CHANGED
package/src/entities/Country.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
|
2
|
-
import { Bank } from "..";
|
|
2
|
+
import { Bank, CountryHoliday } from "..";
|
|
3
3
|
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
4
4
|
import { Region } from "./Region";
|
|
5
5
|
|
|
@@ -79,4 +79,7 @@ export class Country {
|
|
|
79
79
|
|
|
80
80
|
@OneToMany(() => Bank, (bank) => bank.country)
|
|
81
81
|
banks: Bank[];
|
|
82
|
+
|
|
83
|
+
@OneToMany(() => CountryHoliday, (countryHoliday) => countryHoliday.country)
|
|
84
|
+
country_holidays: CountryHoliday[];
|
|
82
85
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Column,
|
|
3
|
+
Entity,
|
|
4
|
+
JoinColumn,
|
|
5
|
+
ManyToOne,
|
|
6
|
+
PrimaryGeneratedColumn,
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
9
|
+
import { Country } from "./Country";
|
|
10
|
+
|
|
11
|
+
@Entity("country_holiday", {
|
|
12
|
+
comment: "Tabla para guardar los festivos de los países.",
|
|
13
|
+
})
|
|
14
|
+
export class CountryHoliday {
|
|
15
|
+
@PrimaryGeneratedColumn({
|
|
16
|
+
type: "int",
|
|
17
|
+
comment: "ID único de cada registro.",
|
|
18
|
+
})
|
|
19
|
+
id: number;
|
|
20
|
+
|
|
21
|
+
@Column({ type: "varchar", length: 200, comment: "Nombre del festivo." })
|
|
22
|
+
name: string;
|
|
23
|
+
|
|
24
|
+
@Column({
|
|
25
|
+
type: "date",
|
|
26
|
+
comment: "Fecha del festivo.",
|
|
27
|
+
})
|
|
28
|
+
date: Date;
|
|
29
|
+
|
|
30
|
+
@ManyToOne(() => Country, (country) => country.country_holidays, {
|
|
31
|
+
onDelete: "CASCADE",
|
|
32
|
+
onUpdate: "NO ACTION",
|
|
33
|
+
})
|
|
34
|
+
@JoinColumn({ name: "country" })
|
|
35
|
+
country: Country;
|
|
36
|
+
|
|
37
|
+
@Column({
|
|
38
|
+
type: "datetime",
|
|
39
|
+
transformer: new DateTransformer(),
|
|
40
|
+
comment: "Fecha de creación del registro.",
|
|
41
|
+
})
|
|
42
|
+
created: Date;
|
|
43
|
+
}
|
package/src/entities/Master.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
OneToMany,
|
|
9
9
|
PrimaryGeneratedColumn,
|
|
10
10
|
} from "typeorm";
|
|
11
|
-
import { MasterNotification, PartnerNotification, VerifyLocal } from "..";
|
|
11
|
+
import { MasterNotification, MasterSession, PartnerNotification, VerifyLocal } from "..";
|
|
12
12
|
import { DateTransformer } from "../transformers/dateTransformer";
|
|
13
13
|
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
14
14
|
import { City } from "./City";
|
|
@@ -62,9 +62,11 @@ export class Master {
|
|
|
62
62
|
type: "varchar",
|
|
63
63
|
length: 12,
|
|
64
64
|
unique: true,
|
|
65
|
+
nullable: true,
|
|
66
|
+
default: null,
|
|
65
67
|
comment: "Número de celular del master.",
|
|
66
68
|
})
|
|
67
|
-
phone: string;
|
|
69
|
+
phone: string | null;
|
|
68
70
|
|
|
69
71
|
@ManyToOne(() => City, (city) => city.masters, {
|
|
70
72
|
onDelete: "RESTRICT",
|
|
@@ -83,10 +85,23 @@ export class Master {
|
|
|
83
85
|
|
|
84
86
|
@Column({
|
|
85
87
|
type: "varchar",
|
|
88
|
+
nullable: false,
|
|
89
|
+
default: null,
|
|
86
90
|
length: 255,
|
|
87
91
|
comment: "Contraseña almacenada tipo SHA256 del master.",
|
|
88
92
|
})
|
|
89
|
-
password: string;
|
|
93
|
+
password: string | null;
|
|
94
|
+
|
|
95
|
+
@Column({
|
|
96
|
+
length: 255,
|
|
97
|
+
type: "varchar",
|
|
98
|
+
unique: true,
|
|
99
|
+
nullable: true,
|
|
100
|
+
default: null,
|
|
101
|
+
comment:
|
|
102
|
+
"Guardamos el token o lo que nos retorna google cuando le damos iniciar con google",
|
|
103
|
+
})
|
|
104
|
+
google_id: string | null;
|
|
90
105
|
|
|
91
106
|
@Column({
|
|
92
107
|
type: "longtext",
|
|
@@ -180,4 +195,7 @@ export class Master {
|
|
|
180
195
|
(partner_notification) => partner_notification.master
|
|
181
196
|
)
|
|
182
197
|
masters_notification: PartnerNotification[];
|
|
198
|
+
|
|
199
|
+
@OneToMany(() => MasterSession, (MasterSession) => MasterSession.master)
|
|
200
|
+
masters_session: MasterSession[];
|
|
183
201
|
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Column,
|
|
3
|
+
Entity,
|
|
4
|
+
JoinColumn,
|
|
5
|
+
ManyToOne,
|
|
6
|
+
PrimaryGeneratedColumn,
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import { Master } from "..";
|
|
9
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
10
|
+
|
|
11
|
+
@Entity({
|
|
12
|
+
comment: "Tabla creada para llevar el control de las sesiones (master)",
|
|
13
|
+
name: "master_session",
|
|
14
|
+
})
|
|
15
|
+
export class MasterSession {
|
|
16
|
+
@PrimaryGeneratedColumn({
|
|
17
|
+
type: "int",
|
|
18
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
19
|
+
})
|
|
20
|
+
id: number;
|
|
21
|
+
|
|
22
|
+
@ManyToOne(() => Master, (master) => master.masters_session, {
|
|
23
|
+
onDelete: "CASCADE",
|
|
24
|
+
onUpdate: "NO ACTION",
|
|
25
|
+
})
|
|
26
|
+
@JoinColumn({ name: "master" })
|
|
27
|
+
master: Master;
|
|
28
|
+
|
|
29
|
+
@Column({
|
|
30
|
+
type: "int",
|
|
31
|
+
default: 1,
|
|
32
|
+
comment: "Plataforma a la que está inciando sesión:\r\n1. Administrador.",
|
|
33
|
+
})
|
|
34
|
+
platform: number;
|
|
35
|
+
|
|
36
|
+
@Column({
|
|
37
|
+
length: 255,
|
|
38
|
+
type: "varchar",
|
|
39
|
+
comment: "Token generado para la sesión.",
|
|
40
|
+
})
|
|
41
|
+
token: string;
|
|
42
|
+
|
|
43
|
+
@Column({
|
|
44
|
+
length: 255,
|
|
45
|
+
type: "varchar",
|
|
46
|
+
comment: "Dirección IP de donde está accediendo.",
|
|
47
|
+
})
|
|
48
|
+
ip_address: string;
|
|
49
|
+
|
|
50
|
+
@Column({
|
|
51
|
+
type: "datetime",
|
|
52
|
+
comment: "Fecha de inicio de la sesión.",
|
|
53
|
+
transformer: new DateTransformer(),
|
|
54
|
+
})
|
|
55
|
+
start_time: Date;
|
|
56
|
+
|
|
57
|
+
@Column({
|
|
58
|
+
type: "datetime",
|
|
59
|
+
nullable: true,
|
|
60
|
+
default: null,
|
|
61
|
+
comment: "Fecha de finalización de la sesión.",
|
|
62
|
+
transformer: new DateTransformer(),
|
|
63
|
+
})
|
|
64
|
+
finish_time: Date | null;
|
|
65
|
+
|
|
66
|
+
@Column({
|
|
67
|
+
default: 1,
|
|
68
|
+
type: "int",
|
|
69
|
+
width: 1,
|
|
70
|
+
comment:
|
|
71
|
+
"Estado de la sesión:\r\n1. Activa.\r\n2. Expirada.\r\n3. Revocada.",
|
|
72
|
+
})
|
|
73
|
+
status: number;
|
|
74
|
+
|
|
75
|
+
@Column({
|
|
76
|
+
type: "datetime",
|
|
77
|
+
comment: "Fecha de creación del registro.",
|
|
78
|
+
transformer: new DateTransformer(),
|
|
79
|
+
})
|
|
80
|
+
created: Date;
|
|
81
|
+
|
|
82
|
+
@Column({
|
|
83
|
+
type: "datetime",
|
|
84
|
+
nullable: true,
|
|
85
|
+
comment: "Fecha de actualización del registro.",
|
|
86
|
+
transformer: new DateTransformer(),
|
|
87
|
+
})
|
|
88
|
+
updated: Date | null;
|
|
89
|
+
}
|
|
@@ -71,6 +71,8 @@ export { ProductImage } from "./entities/ProductImage";
|
|
|
71
71
|
export { LocalPaymentMethod } from "./entities/LocalPaymentMethod";
|
|
72
72
|
export { VerificationCode } from "./entities/VerificationCode";
|
|
73
73
|
export { PartnerPlatformSectionPermissionAssociate } from "./entities/PartnerPlatformSectionPermissionAssociate";
|
|
74
|
+
export { MasterSession } from "./entities/MasterSession";
|
|
75
|
+
export { CountryHoliday } from "./entities/CountryHoliday";
|
|
74
76
|
|
|
75
77
|
export { LocalsCompany } from "./views/LocalsCompany";
|
|
76
78
|
export { VerifyLocals } from "./views/VerifyLocals";
|