test-entity-library-asm 2.1.8 → 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.
@@ -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
  }
@@ -17,6 +17,7 @@ var MasterRole_1 = require("./MasterRole");
17
17
  var Plan_1 = require("./Plan");
18
18
  var jsonTransformer_1 = require("../transformers/jsonTransformer");
19
19
  var dateTransformer_1 = require("../transformers/dateTransformer");
20
+ var __1 = require("..");
20
21
  var Master = /** @class */ (function () {
21
22
  function Master() {
22
23
  }
@@ -137,6 +138,10 @@ var Master = /** @class */ (function () {
137
138
  (0, typeorm_1.OneToMany)(function () { return Plan_1.Plan; }, function (plan) { return plan.created_by; }),
138
139
  __metadata("design:type", Array)
139
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);
140
145
  Master = __decorate([
141
146
  (0, typeorm_1.Entity)({
142
147
  comment: 'Tabla agregada para los usuarios qué son administradores de la plataforma.',
@@ -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
  }
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "2.1.8",
3
+ "version": "2.1.9",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,6 +14,7 @@ import { MasterRole } from './MasterRole'
14
14
  import { Plan } from './Plan'
15
15
  import { jsonTransformer } from '../transformers/jsonTransformer'
16
16
  import { DateTransformer } from '../transformers/dateTransformer'
17
+ import { VerifyLocal } from '..'
17
18
 
18
19
  @Entity({
19
20
  comment:
@@ -108,12 +109,6 @@ export class Master {
108
109
  )
109
110
  discount_code_companies: DiscountCodeCompany[]
110
111
 
111
- // @ManyToMany(() => MasterRole)
112
- // @JoinTable({
113
- // name: 'master_assigned_role',
114
- // })
115
- // masters_roles: MasterRole[]
116
-
117
112
  @ManyToMany(() => MasterRole)
118
113
  @JoinTable({
119
114
  name: 'master_assigned_role',
@@ -130,4 +125,7 @@ export class Master {
130
125
 
131
126
  @OneToMany(() => Plan, (plan) => plan.created_by)
132
127
  plans: Plan[]
128
+
129
+ @OneToMany(() => VerifyLocal, (verifyLocal) => verifyLocal.partner)
130
+ verifyLocals: VerifyLocal[]
133
131
  }
@@ -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'