test-entity-library-asm 3.9.53 → 3.9.55

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.
@@ -27,6 +27,7 @@ export declare class Local {
27
27
  pos_system_settings: any | null;
28
28
  status: number;
29
29
  visible: number;
30
+ operation_status: number;
30
31
  contact_details: any | null;
31
32
  locals_partners: Partner[];
32
33
  requests_local: RequestLocal[];
@@ -157,6 +157,15 @@ __decorate([
157
157
  }),
158
158
  __metadata("design:type", Number)
159
159
  ], Local.prototype, "visible", void 0);
160
+ __decorate([
161
+ (0, typeorm_1.Column)({
162
+ default: 0,
163
+ type: "int",
164
+ width: 1,
165
+ comment: "Estado de operación en el que se encuentra el restaurante/local:\n0: Cerrado: Cuando el local no se encuentra operando.\n1: Abierto: Cuando el local se encuentra operando.\n2: Pausado: Cuando el local se ha pausado, es decir, un empleado pausó las operaciones temporalmente.\n3: En mantenimiento: Cuando el local se encuentra en mantenimiento y no está en operación.",
166
+ }),
167
+ __metadata("design:type", Number)
168
+ ], Local.prototype, "operation_status", void 0);
160
169
  __decorate([
161
170
  (0, typeorm_1.Column)({
162
171
  type: "text",
@@ -1,4 +1,4 @@
1
- import { Category, Gallery, LocalChange, LocalReserve, LocalReserveStatus, LocalTable, LocalTableReservePayment, LocalTableZone, MasterNotification, PartnerSession, Product, RequestInvoice, RequestLocal, RequestLocalHistory, RequestLocalPayment, RequestPrint, VerifyLocal } from "..";
1
+ import { Category, Gallery, LocalChange, LocalReserve, LocalReserveStatus, LocalTable, LocalTableReservePayment, LocalTableZone, MasterNotification, PartnerSession, PendingModification, Product, RequestInvoice, RequestLocal, RequestLocalHistory, RequestLocalPayment, RequestPrint, VerifyLocal } from "..";
2
2
  import { City } from "./City";
3
3
  import { Company } from "./Company";
4
4
  import { DiscountCodeUser } from "./DiscountCodeUser";
@@ -51,4 +51,5 @@ export declare class Partner {
51
51
  galleries: Gallery[];
52
52
  local_changes: LocalChange[];
53
53
  created_by_locals: Local[];
54
+ created_by_pending_modifications: PendingModification[];
54
55
  }
@@ -320,6 +320,10 @@ __decorate([
320
320
  (0, typeorm_1.OneToMany)(() => Local_1.Local, (local) => local.created_by),
321
321
  __metadata("design:type", Array)
322
322
  ], Partner.prototype, "created_by_locals", void 0);
323
+ __decorate([
324
+ (0, typeorm_1.OneToMany)(() => __1.PendingModification, (pendingModification) => pendingModification.requested_by),
325
+ __metadata("design:type", Array)
326
+ ], Partner.prototype, "created_by_pending_modifications", void 0);
323
327
  exports.Partner = Partner = __decorate([
324
328
  (0, typeorm_1.Entity)({
325
329
  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 PendingModification {
3
+ id: number;
4
+ entity_name: string;
5
+ entity_id: number;
6
+ execute: Date | null;
7
+ execute_condition: number;
8
+ payload: any;
9
+ status: number;
10
+ requested_by: Partner;
11
+ created: Date;
12
+ updated: Date | null;
13
+ }
@@ -0,0 +1,102 @@
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.PendingModification = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const __1 = require("..");
15
+ let PendingModification = class PendingModification {
16
+ };
17
+ exports.PendingModification = PendingModification;
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)({
20
+ type: "int",
21
+ comment: "ID único de cada registro.",
22
+ }),
23
+ __metadata("design:type", Number)
24
+ ], PendingModification.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Column)({
27
+ length: 100,
28
+ type: "varchar",
29
+ comment: "Nombre de la entidad afectada (ej: local, company, product).",
30
+ }),
31
+ __metadata("design:type", String)
32
+ ], PendingModification.prototype, "entity_name", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)({
35
+ type: "int",
36
+ comment: "ID del registro de la entidad que será modificado.",
37
+ }),
38
+ __metadata("design:type", Number)
39
+ ], PendingModification.prototype, "entity_id", void 0);
40
+ __decorate([
41
+ (0, typeorm_1.Column)({
42
+ type: "datetime",
43
+ nullable: true,
44
+ default: null,
45
+ comment: "Fecha y hora programada para ejecutar el cambio (solo aplica si execute_condition = 2).",
46
+ }),
47
+ __metadata("design:type", Object)
48
+ ], PendingModification.prototype, "execute", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({
51
+ type: "int",
52
+ comment: "Columna creada para saber cuándo se ejecuta el cambio:\n1: Al cerrar (cuando el local deje de estar en operación).\n2: En el momento programado (cuando se cumpla la fecha/hora de la columna execute).",
53
+ }),
54
+ __metadata("design:type", Number)
55
+ ], PendingModification.prototype, "execute_condition", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({
58
+ type: "json",
59
+ comment: "Objeto JSON con los campos y valores que se aplicarán como modificación.",
60
+ }),
61
+ __metadata("design:type", Object)
62
+ ], PendingModification.prototype, "payload", void 0);
63
+ __decorate([
64
+ (0, typeorm_1.Column)({
65
+ default: 1,
66
+ type: "int",
67
+ width: 1,
68
+ comment: "Estado en el que se encuentra la modificación pendiente.\n1: Pendiente: Aún no se ejecuta la modificación.\n2: Ejecutado: Ya se ejecutó la modificación pendiente.\n3: Cancelado: Se canceló la operación pendiente.\n4: Fallado: Falló la operación al intentar ejecutar la operación pendiente.\nEsto debería enviar un correo cuando se ejecute la operación pendiente al que guardó la operación.",
69
+ }),
70
+ __metadata("design:type", Number)
71
+ ], PendingModification.prototype, "status", void 0);
72
+ __decorate([
73
+ (0, typeorm_1.ManyToOne)(() => __1.Partner, (partner) => partner.created_by_pending_modifications, {
74
+ onDelete: "NO ACTION",
75
+ onUpdate: "NO ACTION",
76
+ }),
77
+ (0, typeorm_1.JoinColumn)({ name: "requested_by" }),
78
+ __metadata("design:type", __1.Partner)
79
+ ], PendingModification.prototype, "requested_by", void 0);
80
+ __decorate([
81
+ (0, typeorm_1.Column)({
82
+ type: "datetime",
83
+ default: () => "CURRENT_TIMESTAMP",
84
+ comment: "Fecha y hora en la que se crea el registro.",
85
+ }),
86
+ __metadata("design:type", Date)
87
+ ], PendingModification.prototype, "created", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.Column)({
90
+ type: "datetime",
91
+ nullable: true,
92
+ default: null,
93
+ comment: "Fecha y hora en la que se ejecutó el cambio.",
94
+ }),
95
+ __metadata("design:type", Object)
96
+ ], PendingModification.prototype, "updated", void 0);
97
+ exports.PendingModification = PendingModification = __decorate([
98
+ (0, typeorm_1.Entity)({
99
+ comment: "Tabla para almacenar modificaciones pendientes que se ejecutarán en un momento específico o cuando se cumpla una condición.",
100
+ name: "pending_modification",
101
+ })
102
+ ], PendingModification);
@@ -74,6 +74,7 @@ export { PartnerPlatformSectionPermissionAssociate } from "./entities/PartnerPla
74
74
  export { MasterSession } from "./entities/MasterSession";
75
75
  export { CountryHoliday } from "./entities/CountryHoliday";
76
76
  export { LocalChange } from "./entities/LocalChange";
77
+ export { PendingModification } from "./entities/PendingModification";
77
78
  export { LocalsCompany } from "./views/LocalsCompany";
78
79
  export { VerifyLocals } from "./views/VerifyLocals";
79
80
  export { MasterNotifications } from "./views/MasterNotifications";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  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;
4
- exports.LocalsCompanyInformationForTheTable = exports.LocalsCompanyInformationForTheMap = exports.LocalReserves = exports.LocalTableZonesFilter = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.LocalChange = 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;
4
+ exports.LocalsCompanyInformationForTheTable = exports.LocalsCompanyInformationForTheMap = exports.LocalReserves = exports.LocalTableZonesFilter = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.PendingModification = exports.LocalChange = 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;
5
5
  var BusinessTypeProduct_1 = require("./entities/BusinessTypeProduct");
6
6
  Object.defineProperty(exports, "BusinessTypeProduct", { enumerable: true, get: function () { return BusinessTypeProduct_1.BusinessTypeProduct; } });
7
7
  var Category_1 = require("./entities/Category");
@@ -154,6 +154,8 @@ var CountryHoliday_1 = require("./entities/CountryHoliday");
154
154
  Object.defineProperty(exports, "CountryHoliday", { enumerable: true, get: function () { return CountryHoliday_1.CountryHoliday; } });
155
155
  var LocalChange_1 = require("./entities/LocalChange");
156
156
  Object.defineProperty(exports, "LocalChange", { enumerable: true, get: function () { return LocalChange_1.LocalChange; } });
157
+ var PendingModification_1 = require("./entities/PendingModification");
158
+ Object.defineProperty(exports, "PendingModification", { enumerable: true, get: function () { return PendingModification_1.PendingModification; } });
157
159
  var LocalsCompany_1 = require("./views/LocalsCompany");
158
160
  Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
159
161
  var VerifyLocals_1 = require("./views/VerifyLocals");
@@ -7,7 +7,6 @@ export declare class LocalsCompanyInformationForTheMap {
7
7
  latitude: number;
8
8
  longitude: number;
9
9
  details: any | null;
10
- changes: any | null;
11
10
  created: Date;
12
11
  updated: Date;
13
12
  updated_by: number;
@@ -17,8 +16,6 @@ export declare class LocalsCompanyInformationForTheMap {
17
16
  status: number;
18
17
  visible: number;
19
18
  contact_details: any | null;
20
- review_status: number;
21
- operation_type: number;
22
19
  company_code: string;
23
20
  company_name: string;
24
21
  company_partner: number;
@@ -58,10 +58,6 @@ __decorate([
58
58
  (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
59
59
  __metadata("design:type", Object)
60
60
  ], LocalsCompanyInformationForTheMap.prototype, "details", void 0);
61
- __decorate([
62
- (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
63
- __metadata("design:type", Object)
64
- ], LocalsCompanyInformationForTheMap.prototype, "changes", void 0);
65
61
  __decorate([
66
62
  (0, typeorm_1.ViewColumn)(),
67
63
  __metadata("design:type", Date)
@@ -98,14 +94,6 @@ __decorate([
98
94
  (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
99
95
  __metadata("design:type", Object)
100
96
  ], LocalsCompanyInformationForTheMap.prototype, "contact_details", void 0);
101
- __decorate([
102
- (0, typeorm_1.ViewColumn)(),
103
- __metadata("design:type", Number)
104
- ], LocalsCompanyInformationForTheMap.prototype, "review_status", void 0);
105
- __decorate([
106
- (0, typeorm_1.ViewColumn)(),
107
- __metadata("design:type", Number)
108
- ], LocalsCompanyInformationForTheMap.prototype, "operation_type", void 0);
109
97
  __decorate([
110
98
  (0, typeorm_1.ViewColumn)(),
111
99
  __metadata("design:type", String)
@@ -18,6 +18,7 @@ export declare class LocalsCompanyInformationForTheTable {
18
18
  status: number;
19
19
  visible: number;
20
20
  contact_details: any | null;
21
+ operation_status: number;
21
22
  local_change_id: number;
22
23
  local_change_operation_type: number;
23
24
  local_change_comments: string | null;
@@ -102,6 +102,10 @@ __decorate([
102
102
  (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
103
103
  __metadata("design:type", Object)
104
104
  ], LocalsCompanyInformationForTheTable.prototype, "contact_details", void 0);
105
+ __decorate([
106
+ (0, typeorm_1.ViewColumn)(),
107
+ __metadata("design:type", Number)
108
+ ], LocalsCompanyInformationForTheTable.prototype, "operation_status", void 0);
105
109
  __decorate([
106
110
  (0, typeorm_1.ViewColumn)(),
107
111
  __metadata("design:type", Number)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "3.9.53",
3
+ "version": "3.9.55",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -154,6 +154,15 @@ export class Local {
154
154
  })
155
155
  visible: number;
156
156
 
157
+ @Column({
158
+ default: 0,
159
+ type: "int",
160
+ width: 1,
161
+ comment:
162
+ "Estado de operación en el que se encuentra el restaurante/local:\n0: Cerrado: Cuando el local no se encuentra operando.\n1: Abierto: Cuando el local se encuentra operando.\n2: Pausado: Cuando el local se ha pausado, es decir, un empleado pausó las operaciones temporalmente.\n3: En mantenimiento: Cuando el local se encuentra en mantenimiento y no está en operación.",
163
+ })
164
+ operation_status: number;
165
+
157
166
  // !: ¿Esta columna debería venir?
158
167
  @Column({
159
168
  type: "text",
@@ -19,6 +19,7 @@ import {
19
19
  LocalTableZone,
20
20
  MasterNotification,
21
21
  PartnerSession,
22
+ PendingModification,
22
23
  Product,
23
24
  RequestInvoice,
24
25
  RequestLocal,
@@ -326,4 +327,10 @@ export class Partner {
326
327
 
327
328
  @OneToMany(() => Local, (local) => local.created_by)
328
329
  created_by_locals: Local[];
330
+
331
+ @OneToMany(
332
+ () => PendingModification,
333
+ (pendingModification) => pendingModification.requested_by,
334
+ )
335
+ created_by_pending_modifications: PendingModification[];
329
336
  }
@@ -0,0 +1,92 @@
1
+ import {
2
+ Column,
3
+ Entity,
4
+ JoinColumn,
5
+ ManyToOne,
6
+ PrimaryGeneratedColumn,
7
+ } from "typeorm";
8
+ import { Partner } from "..";
9
+
10
+ @Entity({
11
+ comment:
12
+ "Tabla para almacenar modificaciones pendientes que se ejecutarán en un momento específico o cuando se cumpla una condición.",
13
+ name: "pending_modification",
14
+ })
15
+ export class PendingModification {
16
+ @PrimaryGeneratedColumn({
17
+ type: "int",
18
+ comment: "ID único de cada registro.",
19
+ })
20
+ id: number;
21
+
22
+ @Column({
23
+ length: 100,
24
+ type: "varchar",
25
+ comment: "Nombre de la entidad afectada (ej: local, company, product).",
26
+ })
27
+ entity_name: string;
28
+
29
+ @Column({
30
+ type: "int",
31
+ comment: "ID del registro de la entidad que será modificado.",
32
+ })
33
+ entity_id: number;
34
+
35
+ @Column({
36
+ type: "datetime",
37
+ nullable: true,
38
+ default: null,
39
+ comment:
40
+ "Fecha y hora programada para ejecutar el cambio (solo aplica si execute_condition = 2).",
41
+ })
42
+ execute: Date | null;
43
+
44
+ @Column({
45
+ type: "int",
46
+ comment:
47
+ "Columna creada para saber cuándo se ejecuta el cambio:\n1: Al cerrar (cuando el local deje de estar en operación).\n2: En el momento programado (cuando se cumpla la fecha/hora de la columna execute).",
48
+ })
49
+ execute_condition: number;
50
+
51
+ @Column({
52
+ type: "json",
53
+ comment:
54
+ "Objeto JSON con los campos y valores que se aplicarán como modificación.",
55
+ })
56
+ payload: any;
57
+
58
+ @Column({
59
+ default: 1,
60
+ type: "int",
61
+ width: 1,
62
+ comment:
63
+ "Estado en el que se encuentra la modificación pendiente.\n1: Pendiente: Aún no se ejecuta la modificación.\n2: Ejecutado: Ya se ejecutó la modificación pendiente.\n3: Cancelado: Se canceló la operación pendiente.\n4: Fallado: Falló la operación al intentar ejecutar la operación pendiente.\nEsto debería enviar un correo cuando se ejecute la operación pendiente al que guardó la operación.",
64
+ })
65
+ status: number;
66
+
67
+ @ManyToOne(
68
+ () => Partner,
69
+ (partner) => partner.created_by_pending_modifications,
70
+ {
71
+ onDelete: "NO ACTION",
72
+ onUpdate: "NO ACTION",
73
+ },
74
+ )
75
+ @JoinColumn({ name: "requested_by" })
76
+ requested_by: Partner;
77
+
78
+ @Column({
79
+ type: "datetime",
80
+ default: () => "CURRENT_TIMESTAMP",
81
+ comment: "Fecha y hora en la que se crea el registro.",
82
+ })
83
+ created: Date;
84
+
85
+ @Column({
86
+ type: "datetime",
87
+ nullable: true,
88
+ default: null,
89
+ comment: "Fecha y hora en la que se ejecutó el cambio.",
90
+ })
91
+ updated: Date | null;
92
+ }
@@ -74,6 +74,7 @@ export { PartnerPlatformSectionPermissionAssociate } from "./entities/PartnerPla
74
74
  export { MasterSession } from "./entities/MasterSession";
75
75
  export { CountryHoliday } from "./entities/CountryHoliday";
76
76
  export { LocalChange } from "./entities/LocalChange";
77
+ export { PendingModification } from "./entities/PendingModification";
77
78
 
78
79
  export { LocalsCompany } from "./views/LocalsCompany";
79
80
  export { VerifyLocals } from "./views/VerifyLocals";
@@ -40,9 +40,6 @@ export class LocalsCompanyInformationForTheMap {
40
40
  @ViewColumn({ transformer: jsonTransformer })
41
41
  details: any | null;
42
42
 
43
- @ViewColumn({ transformer: jsonTransformer })
44
- changes: any | null;
45
-
46
43
  @ViewColumn()
47
44
  created: Date;
48
45
 
@@ -70,12 +67,6 @@ export class LocalsCompanyInformationForTheMap {
70
67
  @ViewColumn({ transformer: jsonTransformer })
71
68
  contact_details: any | null;
72
69
 
73
- @ViewColumn()
74
- review_status: number;
75
-
76
- @ViewColumn()
77
- operation_type: number;
78
-
79
70
  @ViewColumn()
80
71
  company_code: string;
81
72
 
@@ -73,6 +73,9 @@ export class LocalsCompanyInformationForTheTable {
73
73
  @ViewColumn({ transformer: jsonTransformer })
74
74
  contact_details: any | null;
75
75
 
76
+ @ViewColumn()
77
+ operation_status: number;
78
+
76
79
  @ViewColumn()
77
80
  local_change_id: number;
78
81