test-entity-library-asm 3.9.46 → 3.9.48

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.
@@ -1,4 +1,4 @@
1
- import { DiscountCodeUser, Gallery, LocalDecorationReserve, LocalPaymentMethod, LocalPlan, LocalReserveStatus, LocalTable, LocalTableZone, Master, PosSystem, ReceiptConfig, RequestInvoice, RequestLocal } from "..";
1
+ import { DiscountCodeUser, Gallery, LocalChange, LocalDecorationReserve, LocalPaymentMethod, LocalPlan, LocalReserveStatus, LocalTable, LocalTableZone, PosSystem, ReceiptConfig, RequestInvoice, RequestLocal } from "..";
2
2
  import { BusinessTypeProduct } from "./BusinessTypeProduct";
3
3
  import { Category } from "./Category";
4
4
  import { City } from "./City";
@@ -18,7 +18,6 @@ export declare class Local {
18
18
  latitude: number;
19
19
  longitude: number;
20
20
  details: any | null;
21
- changes: any | null;
22
21
  created: Date;
23
22
  updated: Date | null;
24
23
  updated_by: Partner | null;
@@ -28,11 +27,6 @@ export declare class Local {
28
27
  status: number;
29
28
  visible: number;
30
29
  contact_details: any | null;
31
- review_status: number;
32
- operation_type: number;
33
- reviewed_by: Master | null;
34
- review_date: Date | null;
35
- review_comments: string | null;
36
30
  locals_partners: Partner[];
37
31
  requests_local: RequestLocal[];
38
32
  categories: Category[];
@@ -50,4 +44,5 @@ export declare class Local {
50
44
  request_invoices: RequestInvoice[];
51
45
  galleries: Gallery[];
52
46
  locals_payment_method: LocalPaymentMethod[];
47
+ locals_changes: LocalChange[];
53
48
  }
@@ -83,16 +83,6 @@ __decorate([
83
83
  }),
84
84
  __metadata("design:type", Object)
85
85
  ], Local.prototype, "details", void 0);
86
- __decorate([
87
- (0, typeorm_1.Column)({
88
- type: "longtext",
89
- nullable: true,
90
- default: null,
91
- transformer: jsonTransformer_1.jsonTransformer,
92
- comment: "Columna para almacenar los cambios que se le hacen al registro. \nSe almacena todo el formik, con esto simplemente cuando estemos editando se usa esta variable y no tenemos que construir la información.",
93
- }),
94
- __metadata("design:type", Object)
95
- ], Local.prototype, "changes", void 0);
96
86
  __decorate([
97
87
  (0, typeorm_1.Column)({ type: "datetime", default: () => "CURRENT_TIMESTAMP" }),
98
88
  __metadata("design:type", Date)
@@ -168,48 +158,6 @@ __decorate([
168
158
  }),
169
159
  __metadata("design:type", Object)
170
160
  ], Local.prototype, "contact_details", void 0);
171
- __decorate([
172
- (0, typeorm_1.Column)({
173
- type: "int",
174
- nullable: true,
175
- default: null,
176
- width: 1,
177
- comment: "Estado en el que se encuentra la revisión de los nuevos cambios.\n1: Pendiente de revisión:Estado para decirle al usuario que los cambios se encuentran en revisión.\n2: Aprobado: Los cambios se encuentran aprobados.\n3: Rechazado: Los cambios se rechazaron por algún problema en los datos.",
178
- }),
179
- __metadata("design:type", Number)
180
- ], Local.prototype, "review_status", void 0);
181
- __decorate([
182
- (0, typeorm_1.Column)({
183
- type: "int",
184
- nullable: true,
185
- default: null,
186
- width: 1,
187
- comment: "Columna para guardar el tipo de operación del registro.\n1: Creación: Cuando se crea por primera vez el registro.\n2: Edición: Cuando se está editando información del local.",
188
- }),
189
- __metadata("design:type", Number)
190
- ], Local.prototype, "operation_type", void 0);
191
- __decorate([
192
- (0, typeorm_1.ManyToOne)(() => __1.Master, (master) => master.locals_reviewed, {
193
- onDelete: "NO ACTION",
194
- onUpdate: "NO ACTION",
195
- nullable: true,
196
- }),
197
- (0, typeorm_1.JoinColumn)({ name: "reviewed_by" }),
198
- __metadata("design:type", Object)
199
- ], Local.prototype, "reviewed_by", void 0);
200
- __decorate([
201
- (0, typeorm_1.Column)({
202
- type: "datetime",
203
- nullable: true,
204
- default: null,
205
- comment: "Fecha de revisión de los cambios realizados por el usuario.",
206
- }),
207
- __metadata("design:type", Object)
208
- ], Local.prototype, "review_date", void 0);
209
- __decorate([
210
- (0, typeorm_1.Column)({ type: "varchar", length: 300, nullable: true, default: null }),
211
- __metadata("design:type", Object)
212
- ], Local.prototype, "review_comments", void 0);
213
161
  __decorate([
214
162
  (0, typeorm_1.ManyToMany)(() => Partner_1.Partner, (partner) => partner.locals_partner),
215
163
  (0, typeorm_1.JoinTable)({
@@ -322,6 +270,10 @@ __decorate([
322
270
  (0, typeorm_1.OneToMany)(() => __1.LocalPaymentMethod, (localPaymentMethod) => localPaymentMethod.local),
323
271
  __metadata("design:type", Array)
324
272
  ], Local.prototype, "locals_payment_method", void 0);
273
+ __decorate([
274
+ (0, typeorm_1.OneToMany)(() => __1.LocalChange, (localChange) => localChange.local),
275
+ __metadata("design:type", Array)
276
+ ], Local.prototype, "locals_changes", void 0);
325
277
  exports.Local = Local = __decorate([
326
278
  (0, typeorm_1.Entity)({ comment: "Locales disponibles de las empresas (company)." })
327
279
  ], Local);
@@ -0,0 +1,14 @@
1
+ import { Local } from "./Local";
2
+ import { Partner } from "./Partner";
3
+ import { Master } from "./Master";
4
+ export declare class LocalChange {
5
+ id: number;
6
+ local: Local;
7
+ changes: any | null;
8
+ created: Date;
9
+ created_by: Partner | null;
10
+ assigned_to: Master | null;
11
+ operation_type: number;
12
+ comments: string | null;
13
+ status: number;
14
+ }
@@ -0,0 +1,101 @@
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.LocalChange = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const Local_1 = require("./Local");
15
+ const jsonTransformer_1 = require("../transformers/jsonTransformer");
16
+ const Partner_1 = require("./Partner");
17
+ const Master_1 = require("./Master");
18
+ let LocalChange = class LocalChange {
19
+ };
20
+ exports.LocalChange = LocalChange;
21
+ __decorate([
22
+ (0, typeorm_1.PrimaryGeneratedColumn)({
23
+ type: "int",
24
+ comment: "ID único de cada registro.",
25
+ }),
26
+ __metadata("design:type", Number)
27
+ ], LocalChange.prototype, "id", void 0);
28
+ __decorate([
29
+ (0, typeorm_1.ManyToOne)(() => Local_1.Local, (local) => local.locals_changes, {
30
+ onDelete: "CASCADE",
31
+ onUpdate: "NO ACTION",
32
+ }),
33
+ (0, typeorm_1.JoinColumn)({ name: "local" }),
34
+ __metadata("design:type", Local_1.Local)
35
+ ], LocalChange.prototype, "local", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.Column)({
38
+ type: "json",
39
+ transformer: jsonTransformer_1.jsonTransformer,
40
+ comment: "Nuevos cambios, la información se guarda como JSON.",
41
+ }),
42
+ __metadata("design:type", Object)
43
+ ], LocalChange.prototype, "changes", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({
46
+ type: "datetime",
47
+ default: () => "CURRENT_TIMESTAMP",
48
+ comment: "Fecha de creación del registro.",
49
+ }),
50
+ __metadata("design:type", Date)
51
+ ], LocalChange.prototype, "created", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.ManyToOne)(() => Partner_1.Partner, (partner) => partner.local_changes, {
54
+ onDelete: "CASCADE",
55
+ onUpdate: "NO ACTION",
56
+ nullable: true,
57
+ }),
58
+ (0, typeorm_1.JoinColumn)({ name: "created_by" }),
59
+ __metadata("design:type", Object)
60
+ ], LocalChange.prototype, "created_by", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.ManyToOne)(() => Master_1.Master, (master) => master.local_changes, {
63
+ onDelete: "CASCADE",
64
+ onUpdate: "NO ACTION",
65
+ nullable: true,
66
+ }),
67
+ (0, typeorm_1.JoinColumn)({ name: "assigned_to" }),
68
+ __metadata("design:type", Object)
69
+ ], LocalChange.prototype, "assigned_to", void 0);
70
+ __decorate([
71
+ (0, typeorm_1.Column)({
72
+ type: "int",
73
+ width: 1,
74
+ comment: "Operación que se está realizando en los cambios:\n1. Creación del local.\n2: Edición del local.",
75
+ }),
76
+ __metadata("design:type", Number)
77
+ ], LocalChange.prototype, "operation_type", void 0);
78
+ __decorate([
79
+ (0, typeorm_1.Column)({
80
+ type: "varchar",
81
+ length: 400,
82
+ nullable: true,
83
+ default: null,
84
+ comment: "Comentarios del registro.",
85
+ }),
86
+ __metadata("design:type", Object)
87
+ ], LocalChange.prototype, "comments", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.Column)({
90
+ type: "int",
91
+ width: 1,
92
+ comment: "Estado en el que se encuentra los cambios realizados.\n1: Pendiente de revisión: Cuando el usuario 'partner' crea los cambios.\n2: Aprobado: Cuando el usuario 'master' - 'IA' aprueba los cambios que el 'partner' realizó.\n3: Rechazado: Cuando el usuario 'master' - 'IA' rechaza los cambios por alguna razón.\n4: Cambios descartados: Cuando el usuario 'partner' descarta los cambios, si 'operation_type' es 1 (creación), entonces el status y visible en la tabla 'local' deberían quedar en 0, eso quiere decir que el local que se creó se eliminó.",
93
+ }),
94
+ __metadata("design:type", Number)
95
+ ], LocalChange.prototype, "status", void 0);
96
+ exports.LocalChange = LocalChange = __decorate([
97
+ (0, typeorm_1.Entity)({
98
+ comment: "Tabla creada para guardar las solicitudes de cambios de los locales.",
99
+ name: "local_change",
100
+ })
101
+ ], LocalChange);
@@ -1,4 +1,4 @@
1
- import { Local, MasterNotification, MasterSession, PartnerNotification, VerifyLocal } from "..";
1
+ import { LocalChange, MasterNotification, MasterSession, PartnerNotification, VerifyLocal } from "..";
2
2
  import { City } from "./City";
3
3
  import { DiscountCodeCompany } from "./DiscountCodeCompany";
4
4
  import { MasterRole } from "./MasterRole";
@@ -26,5 +26,5 @@ export declare class Master {
26
26
  masters_to_notification: MasterNotification[];
27
27
  masters_notification: PartnerNotification[];
28
28
  masters_session: MasterSession[];
29
- locals_reviewed: Local[];
29
+ local_changes: LocalChange[];
30
30
  }
@@ -208,9 +208,9 @@ __decorate([
208
208
  __metadata("design:type", Array)
209
209
  ], Master.prototype, "masters_session", void 0);
210
210
  __decorate([
211
- (0, typeorm_1.OneToMany)(() => __1.Local, (local) => local.reviewed_by),
211
+ (0, typeorm_1.OneToMany)(() => __1.LocalChange, (localChange) => localChange.assigned_to),
212
212
  __metadata("design:type", Array)
213
- ], Master.prototype, "locals_reviewed", void 0);
213
+ ], Master.prototype, "local_changes", void 0);
214
214
  exports.Master = Master = __decorate([
215
215
  (0, typeorm_1.Entity)({
216
216
  comment: "Tabla agregada para los usuarios qué son administradores de la plataforma.",
@@ -1,4 +1,4 @@
1
- import { Category, Gallery, 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, 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";
@@ -49,4 +49,5 @@ export declare class Partner {
49
49
  local_reserve_status: LocalReserveStatus[];
50
50
  request_invoices: RequestInvoice[];
51
51
  galleries: Gallery[];
52
+ local_changes: LocalChange[];
52
53
  }
@@ -312,6 +312,10 @@ __decorate([
312
312
  (0, typeorm_1.OneToMany)(() => __1.Gallery, (gallery) => gallery.created_by),
313
313
  __metadata("design:type", Array)
314
314
  ], Partner.prototype, "galleries", void 0);
315
+ __decorate([
316
+ (0, typeorm_1.OneToMany)(() => __1.LocalChange, (localChange) => localChange.created_by),
317
+ __metadata("design:type", Array)
318
+ ], Partner.prototype, "local_changes", void 0);
315
319
  exports.Partner = Partner = __decorate([
316
320
  (0, typeorm_1.Entity)({
317
321
  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.",
@@ -73,6 +73,7 @@ export { VerificationCode } from "./entities/VerificationCode";
73
73
  export { PartnerPlatformSectionPermissionAssociate } from "./entities/PartnerPlatformSectionPermissionAssociate";
74
74
  export { MasterSession } from "./entities/MasterSession";
75
75
  export { CountryHoliday } from "./entities/CountryHoliday";
76
+ export { LocalChange } from "./entities/LocalChange";
76
77
  export { LocalsCompany } from "./views/LocalsCompany";
77
78
  export { VerifyLocals } from "./views/VerifyLocals";
78
79
  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.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.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");
@@ -152,6 +152,8 @@ var MasterSession_1 = require("./entities/MasterSession");
152
152
  Object.defineProperty(exports, "MasterSession", { enumerable: true, get: function () { return MasterSession_1.MasterSession; } });
153
153
  var CountryHoliday_1 = require("./entities/CountryHoliday");
154
154
  Object.defineProperty(exports, "CountryHoliday", { enumerable: true, get: function () { return CountryHoliday_1.CountryHoliday; } });
155
+ var LocalChange_1 = require("./entities/LocalChange");
156
+ Object.defineProperty(exports, "LocalChange", { enumerable: true, get: function () { return LocalChange_1.LocalChange; } });
155
157
  var LocalsCompany_1 = require("./views/LocalsCompany");
156
158
  Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
157
159
  var VerifyLocals_1 = require("./views/VerifyLocals");
@@ -8,7 +8,6 @@ export declare class LocalsCompanyInformationForTheTable {
8
8
  latitude: number;
9
9
  longitude: number;
10
10
  details: any | null;
11
- changes: any | null;
12
11
  created: Date;
13
12
  updated: Date | null;
14
13
  updated_by: number | null;
@@ -18,11 +17,15 @@ export declare class LocalsCompanyInformationForTheTable {
18
17
  status: number;
19
18
  visible: number;
20
19
  contact_details: any | null;
21
- review_status: number;
22
- operation_type: number;
23
- reviewed_by: number | null;
24
- review_date: Date | null;
25
- review_comments: string;
20
+ local_change_id: number;
21
+ local_change_operation_type: number;
22
+ local_change_comments: string | null;
23
+ local_change_created: Date;
24
+ local_change_status: number;
25
+ local_change_created_by: number | null;
26
+ local_change_assigned_to: number | null;
27
+ local_change_changes: any;
28
+ local_change_local: number;
26
29
  type_local: string;
27
30
  address_local: string;
28
31
  company_id: number;
@@ -69,21 +72,6 @@ export declare class LocalsCompanyInformationForTheTable {
69
72
  partner_visible: number;
70
73
  partner_created: Date;
71
74
  partner_updated: Date;
72
- master_reviewed_id: number;
73
- master_reviewed_code: string;
74
- master_reviewed_document: string | null;
75
- master_reviewed_name: string;
76
- master_reviewed_surname: string;
77
- master_reviewed_full_name: string;
78
- master_reviewed_email: string;
79
- master_reviewed_phone: string | null;
80
- master_reviewed_city: number;
81
- master_reviewed_address: string | null;
82
- master_reviewed_profile: any | null;
83
- master_reviewed_created: Date;
84
- master_reviewed_updated: Date | null;
85
- master_reviewed_status: number;
86
- master_reviewed_visible: number;
87
75
  square_id: number;
88
76
  square_details: any | null;
89
77
  square_email: string | null;
@@ -62,10 +62,6 @@ __decorate([
62
62
  (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
63
63
  __metadata("design:type", Object)
64
64
  ], LocalsCompanyInformationForTheTable.prototype, "details", void 0);
65
- __decorate([
66
- (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
67
- __metadata("design:type", Object)
68
- ], LocalsCompanyInformationForTheTable.prototype, "changes", void 0);
69
65
  __decorate([
70
66
  (0, typeorm_1.ViewColumn)(),
71
67
  __metadata("design:type", Date)
@@ -105,23 +101,39 @@ __decorate([
105
101
  __decorate([
106
102
  (0, typeorm_1.ViewColumn)(),
107
103
  __metadata("design:type", Number)
108
- ], LocalsCompanyInformationForTheTable.prototype, "review_status", void 0);
104
+ ], LocalsCompanyInformationForTheTable.prototype, "local_change_id", void 0);
109
105
  __decorate([
110
106
  (0, typeorm_1.ViewColumn)(),
111
107
  __metadata("design:type", Number)
112
- ], LocalsCompanyInformationForTheTable.prototype, "operation_type", void 0);
108
+ ], LocalsCompanyInformationForTheTable.prototype, "local_change_operation_type", void 0);
113
109
  __decorate([
114
110
  (0, typeorm_1.ViewColumn)(),
115
111
  __metadata("design:type", Object)
116
- ], LocalsCompanyInformationForTheTable.prototype, "reviewed_by", void 0);
112
+ ], LocalsCompanyInformationForTheTable.prototype, "local_change_comments", void 0);
113
+ __decorate([
114
+ (0, typeorm_1.ViewColumn)(),
115
+ __metadata("design:type", Date)
116
+ ], LocalsCompanyInformationForTheTable.prototype, "local_change_created", void 0);
117
+ __decorate([
118
+ (0, typeorm_1.ViewColumn)(),
119
+ __metadata("design:type", Number)
120
+ ], LocalsCompanyInformationForTheTable.prototype, "local_change_status", void 0);
117
121
  __decorate([
118
122
  (0, typeorm_1.ViewColumn)(),
119
123
  __metadata("design:type", Object)
120
- ], LocalsCompanyInformationForTheTable.prototype, "review_date", void 0);
124
+ ], LocalsCompanyInformationForTheTable.prototype, "local_change_created_by", void 0);
121
125
  __decorate([
122
126
  (0, typeorm_1.ViewColumn)(),
123
- __metadata("design:type", String)
124
- ], LocalsCompanyInformationForTheTable.prototype, "review_comments", void 0);
127
+ __metadata("design:type", Object)
128
+ ], LocalsCompanyInformationForTheTable.prototype, "local_change_assigned_to", void 0);
129
+ __decorate([
130
+ (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
131
+ __metadata("design:type", Object)
132
+ ], LocalsCompanyInformationForTheTable.prototype, "local_change_changes", void 0);
133
+ __decorate([
134
+ (0, typeorm_1.ViewColumn)(),
135
+ __metadata("design:type", Number)
136
+ ], LocalsCompanyInformationForTheTable.prototype, "local_change_local", void 0);
125
137
  __decorate([
126
138
  (0, typeorm_1.ViewColumn)(),
127
139
  __metadata("design:type", String)
@@ -306,66 +318,6 @@ __decorate([
306
318
  (0, typeorm_1.ViewColumn)(),
307
319
  __metadata("design:type", Date)
308
320
  ], LocalsCompanyInformationForTheTable.prototype, "partner_updated", void 0);
309
- __decorate([
310
- (0, typeorm_1.ViewColumn)(),
311
- __metadata("design:type", Number)
312
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_id", void 0);
313
- __decorate([
314
- (0, typeorm_1.ViewColumn)(),
315
- __metadata("design:type", String)
316
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_code", void 0);
317
- __decorate([
318
- (0, typeorm_1.ViewColumn)(),
319
- __metadata("design:type", Object)
320
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_document", void 0);
321
- __decorate([
322
- (0, typeorm_1.ViewColumn)(),
323
- __metadata("design:type", String)
324
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_name", void 0);
325
- __decorate([
326
- (0, typeorm_1.ViewColumn)(),
327
- __metadata("design:type", String)
328
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_surname", void 0);
329
- __decorate([
330
- (0, typeorm_1.ViewColumn)(),
331
- __metadata("design:type", String)
332
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_full_name", void 0);
333
- __decorate([
334
- (0, typeorm_1.ViewColumn)(),
335
- __metadata("design:type", String)
336
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_email", void 0);
337
- __decorate([
338
- (0, typeorm_1.ViewColumn)(),
339
- __metadata("design:type", Object)
340
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_phone", void 0);
341
- __decorate([
342
- (0, typeorm_1.ViewColumn)(),
343
- __metadata("design:type", Number)
344
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_city", void 0);
345
- __decorate([
346
- (0, typeorm_1.ViewColumn)(),
347
- __metadata("design:type", Object)
348
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_address", void 0);
349
- __decorate([
350
- (0, typeorm_1.ViewColumn)({ transformer: jsonTransformer }),
351
- __metadata("design:type", Object)
352
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_profile", void 0);
353
- __decorate([
354
- (0, typeorm_1.ViewColumn)(),
355
- __metadata("design:type", Date)
356
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_created", void 0);
357
- __decorate([
358
- (0, typeorm_1.ViewColumn)(),
359
- __metadata("design:type", Object)
360
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_updated", void 0);
361
- __decorate([
362
- (0, typeorm_1.ViewColumn)(),
363
- __metadata("design:type", Number)
364
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_status", void 0);
365
- __decorate([
366
- (0, typeorm_1.ViewColumn)(),
367
- __metadata("design:type", Number)
368
- ], LocalsCompanyInformationForTheTable.prototype, "master_reviewed_visible", void 0);
369
321
  __decorate([
370
322
  (0, typeorm_1.ViewColumn)(),
371
323
  __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.46",
3
+ "version": "3.9.48",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,6 +11,7 @@ import {
11
11
  import {
12
12
  DiscountCodeUser,
13
13
  Gallery,
14
+ LocalChange,
14
15
  LocalDecorationReserve,
15
16
  LocalPaymentMethod,
16
17
  LocalPlan,
@@ -86,16 +87,6 @@ export class Local {
86
87
  })
87
88
  details: any | null;
88
89
 
89
- @Column({
90
- type: "longtext",
91
- nullable: true,
92
- default: null,
93
- transformer: jsonTransformer,
94
- comment:
95
- "Columna para almacenar los cambios que se le hacen al registro. \nSe almacena todo el formik, con esto simplemente cuando estemos editando se usa esta variable y no tenemos que construir la información.",
96
- })
97
- changes: any | null;
98
-
99
90
  @Column({ type: "datetime", default: () => "CURRENT_TIMESTAMP" })
100
91
  created: Date;
101
92
 
@@ -165,45 +156,6 @@ export class Local {
165
156
  })
166
157
  contact_details: any | null;
167
158
 
168
- @Column({
169
- type: "int",
170
- nullable: true,
171
- default: null,
172
- width: 1,
173
- comment:
174
- "Estado en el que se encuentra la revisión de los nuevos cambios.\n1: Pendiente de revisión:Estado para decirle al usuario que los cambios se encuentran en revisión.\n2: Aprobado: Los cambios se encuentran aprobados.\n3: Rechazado: Los cambios se rechazaron por algún problema en los datos.",
175
- })
176
- review_status: number;
177
-
178
- @Column({
179
- type: "int",
180
- nullable: true,
181
- default: null,
182
- width: 1,
183
- comment:
184
- "Columna para guardar el tipo de operación del registro.\n1: Creación: Cuando se crea por primera vez el registro.\n2: Edición: Cuando se está editando información del local.",
185
- })
186
- operation_type: number;
187
-
188
- @ManyToOne(() => Master, (master) => master.locals_reviewed, {
189
- onDelete: "NO ACTION",
190
- onUpdate: "NO ACTION",
191
- nullable: true,
192
- })
193
- @JoinColumn({ name: "reviewed_by" })
194
- reviewed_by: Master | null;
195
-
196
- @Column({
197
- type: "datetime",
198
- nullable: true,
199
- default: null,
200
- comment: "Fecha de revisión de los cambios realizados por el usuario.",
201
- })
202
- review_date: Date | null;
203
-
204
- @Column({ type: "varchar", length: 300, nullable: true, default: null })
205
- review_comments: string | null;
206
-
207
159
  @ManyToMany(() => Partner, (partner) => partner.locals_partner)
208
160
  @JoinTable({
209
161
  name: "local_partner",
@@ -316,4 +268,10 @@ export class Local {
316
268
  (localPaymentMethod) => localPaymentMethod.local,
317
269
  )
318
270
  locals_payment_method: LocalPaymentMethod[];
271
+
272
+ @OneToMany(
273
+ () => LocalChange,
274
+ (localChange) => localChange.local,
275
+ )
276
+ locals_changes: LocalChange[];
319
277
  }
@@ -0,0 +1,86 @@
1
+ import {
2
+ Column,
3
+ Entity,
4
+ JoinColumn,
5
+ ManyToOne,
6
+ PrimaryGeneratedColumn,
7
+ } from "typeorm";
8
+ import { Local } from "./Local";
9
+ import { jsonTransformer } from "../transformers/jsonTransformer";
10
+ import { Partner } from "./Partner";
11
+ import { Master } from "./Master";
12
+
13
+ @Entity({
14
+ comment:
15
+ "Tabla creada para guardar las solicitudes de cambios de los locales.",
16
+ name: "local_change",
17
+ })
18
+ export class LocalChange {
19
+ @PrimaryGeneratedColumn({
20
+ type: "int",
21
+ comment: "ID único de cada registro.",
22
+ })
23
+ id: number;
24
+
25
+ @ManyToOne(() => Local, (local) => local.locals_changes, {
26
+ onDelete: "CASCADE",
27
+ onUpdate: "NO ACTION",
28
+ })
29
+ @JoinColumn({ name: "local" })
30
+ local: Local;
31
+
32
+ @Column({
33
+ type: "json",
34
+ transformer: jsonTransformer,
35
+ comment: "Nuevos cambios, la información se guarda como JSON.",
36
+ })
37
+ changes: any | null;
38
+
39
+ @Column({
40
+ type: "datetime",
41
+ default: () => "CURRENT_TIMESTAMP",
42
+ comment: "Fecha de creación del registro.",
43
+ })
44
+ created: Date;
45
+
46
+ @ManyToOne(() => Partner, (partner) => partner.local_changes, {
47
+ onDelete: "CASCADE",
48
+ onUpdate: "NO ACTION",
49
+ nullable: true,
50
+ })
51
+ @JoinColumn({ name: "created_by" })
52
+ created_by: Partner | null;
53
+
54
+ @ManyToOne(() => Master, (master) => master.local_changes, {
55
+ onDelete: "CASCADE",
56
+ onUpdate: "NO ACTION",
57
+ nullable: true,
58
+ })
59
+ @JoinColumn({ name: "assigned_to" })
60
+ assigned_to: Master | null;
61
+
62
+ @Column({
63
+ type: "int",
64
+ width: 1,
65
+ comment:
66
+ "Operación que se está realizando en los cambios:\n1. Creación del local.\n2: Edición del local.",
67
+ })
68
+ operation_type: number;
69
+
70
+ @Column({
71
+ type: "varchar",
72
+ length: 400,
73
+ nullable: true,
74
+ default: null,
75
+ comment: "Comentarios del registro.",
76
+ })
77
+ comments: string | null;
78
+
79
+ @Column({
80
+ type: "int",
81
+ width: 1,
82
+ comment:
83
+ "Estado en el que se encuentra los cambios realizados.\n1: Pendiente de revisión: Cuando el usuario 'partner' crea los cambios.\n2: Aprobado: Cuando el usuario 'master' - 'IA' aprueba los cambios que el 'partner' realizó.\n3: Rechazado: Cuando el usuario 'master' - 'IA' rechaza los cambios por alguna razón.\n4: Cambios descartados: Cuando el usuario 'partner' descarta los cambios, si 'operation_type' es 1 (creación), entonces el status y visible en la tabla 'local' deberían quedar en 0, eso quiere decir que el local que se creó se eliminó.",
84
+ })
85
+ status: number;
86
+ }
@@ -9,11 +9,11 @@ import {
9
9
  PrimaryGeneratedColumn,
10
10
  } from "typeorm";
11
11
  import {
12
- Local,
12
+ LocalChange,
13
13
  MasterNotification,
14
14
  MasterSession,
15
15
  PartnerNotification,
16
- VerifyLocal,
16
+ VerifyLocal
17
17
  } from "..";
18
18
  import { jsonTransformer } from "../transformers/jsonTransformer";
19
19
  import { City } from "./City";
@@ -205,6 +205,6 @@ export class Master {
205
205
  @OneToMany(() => MasterSession, (MasterSession) => MasterSession.master)
206
206
  masters_session: MasterSession[];
207
207
 
208
- @OneToMany(() => Local, (local) => local.reviewed_by)
209
- locals_reviewed: Local[];
208
+ @OneToMany(() => LocalChange, (localChange) => localChange.assigned_to)
209
+ local_changes: LocalChange[];
210
210
  }
@@ -11,6 +11,7 @@ import {
11
11
  import {
12
12
  Category,
13
13
  Gallery,
14
+ LocalChange,
14
15
  LocalReserve,
15
16
  LocalReserveStatus,
16
17
  LocalTable,
@@ -319,4 +320,7 @@ export class Partner {
319
320
 
320
321
  @OneToMany(() => Gallery, (gallery) => gallery.created_by)
321
322
  galleries: Gallery[];
323
+
324
+ @OneToMany(() => LocalChange, (localChange) => localChange.created_by)
325
+ local_changes: LocalChange[];
322
326
  }
@@ -73,6 +73,7 @@ export { VerificationCode } from "./entities/VerificationCode";
73
73
  export { PartnerPlatformSectionPermissionAssociate } from "./entities/PartnerPlatformSectionPermissionAssociate";
74
74
  export { MasterSession } from "./entities/MasterSession";
75
75
  export { CountryHoliday } from "./entities/CountryHoliday";
76
+ export { LocalChange } from "./entities/LocalChange";
76
77
 
77
78
  export { LocalsCompany } from "./views/LocalsCompany";
78
79
  export { VerifyLocals } from "./views/VerifyLocals";
@@ -43,9 +43,6 @@ export class LocalsCompanyInformationForTheTable {
43
43
  @ViewColumn({ transformer: jsonTransformer })
44
44
  details: any | null;
45
45
 
46
- @ViewColumn({ transformer: jsonTransformer })
47
- changes: any | null;
48
-
49
46
  @ViewColumn()
50
47
  created: Date;
51
48
 
@@ -74,19 +71,31 @@ export class LocalsCompanyInformationForTheTable {
74
71
  contact_details: any | null;
75
72
 
76
73
  @ViewColumn()
77
- review_status: number;
74
+ local_change_id: number;
75
+
76
+ @ViewColumn()
77
+ local_change_operation_type: number;
78
+
79
+ @ViewColumn()
80
+ local_change_comments: string | null;
81
+
82
+ @ViewColumn()
83
+ local_change_created: Date;
78
84
 
79
85
  @ViewColumn()
80
- operation_type: number;
86
+ local_change_status: number;
81
87
 
82
88
  @ViewColumn()
83
- reviewed_by: number | null;
89
+ local_change_created_by: number | null;
84
90
 
85
91
  @ViewColumn()
86
- review_date: Date | null;
92
+ local_change_assigned_to: number | null;
93
+
94
+ @ViewColumn({ transformer: jsonTransformer })
95
+ local_change_changes: any;
87
96
 
88
97
  @ViewColumn()
89
- review_comments: string;
98
+ local_change_local: number;
90
99
 
91
100
  @ViewColumn()
92
101
  type_local: string;
@@ -226,51 +235,6 @@ export class LocalsCompanyInformationForTheTable {
226
235
  @ViewColumn()
227
236
  partner_updated: Date;
228
237
 
229
- @ViewColumn()
230
- master_reviewed_id: number;
231
-
232
- @ViewColumn()
233
- master_reviewed_code: string;
234
-
235
- @ViewColumn()
236
- master_reviewed_document: string | null;
237
-
238
- @ViewColumn()
239
- master_reviewed_name: string;
240
-
241
- @ViewColumn()
242
- master_reviewed_surname: string;
243
-
244
- @ViewColumn()
245
- master_reviewed_full_name: string;
246
-
247
- @ViewColumn()
248
- master_reviewed_email: string;
249
-
250
- @ViewColumn()
251
- master_reviewed_phone: string | null;
252
-
253
- @ViewColumn()
254
- master_reviewed_city: number;
255
-
256
- @ViewColumn()
257
- master_reviewed_address: string | null;
258
-
259
- @ViewColumn({ transformer: jsonTransformer })
260
- master_reviewed_profile: any | null;
261
-
262
- @ViewColumn()
263
- master_reviewed_created: Date;
264
-
265
- @ViewColumn()
266
- master_reviewed_updated: Date | null;
267
-
268
- @ViewColumn()
269
- master_reviewed_status: number;
270
-
271
- @ViewColumn()
272
- master_reviewed_visible: number;
273
-
274
238
  @ViewColumn()
275
239
  square_id: number;
276
240