test-entity-library-asm 3.0.2 → 3.1.0
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/Category.d.ts +3 -0
- package/dist/entities/Category.js +27 -2
- package/dist/entities/Product.d.ts +2 -0
- package/dist/entities/Product.js +19 -3
- package/dist/entities/ToppingImage.d.ts +9 -0
- package/dist/entities/ToppingImage.js +64 -0
- package/dist/entities/productGroupComplement.d.ts +9 -2
- package/dist/entities/productGroupComplement.js +57 -9
- package/dist/entities.views.routes.d.ts +1 -0
- package/dist/entities.views.routes.js +3 -1
- package/package.json +1 -1
- package/src/entities/Category.ts +27 -2
- package/src/entities/Product.ts +19 -3
- package/src/entities/ToppingImage.ts +45 -0
- package/src/entities/productGroupComplement.ts +68 -18
- package/src/entities.views.routes.ts +1 -0
|
@@ -7,11 +7,14 @@ export declare class Category {
|
|
|
7
7
|
name: string;
|
|
8
8
|
position: number;
|
|
9
9
|
type_sales_hours: number;
|
|
10
|
+
show_or_hide_item: number;
|
|
10
11
|
created_by: Partner;
|
|
11
12
|
created: Date;
|
|
12
13
|
updated: Date;
|
|
13
14
|
updated_by: Partner;
|
|
15
|
+
current_values: any;
|
|
14
16
|
status: number;
|
|
17
|
+
status_review: number;
|
|
15
18
|
review_comment: string;
|
|
16
19
|
products: Product[];
|
|
17
20
|
category_schedules: ScheduleCategory[];
|
|
@@ -14,6 +14,7 @@ var typeorm_1 = require("typeorm");
|
|
|
14
14
|
var Local_1 = require("./Local");
|
|
15
15
|
var Product_1 = require("./Product");
|
|
16
16
|
var __1 = require("..");
|
|
17
|
+
var jsonTransformer_1 = require("../transformers/jsonTransformer");
|
|
17
18
|
var Category = /** @class */ (function () {
|
|
18
19
|
function Category() {
|
|
19
20
|
}
|
|
@@ -47,6 +48,14 @@ var Category = /** @class */ (function () {
|
|
|
47
48
|
}),
|
|
48
49
|
__metadata("design:type", Number)
|
|
49
50
|
], Category.prototype, "type_sales_hours", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({
|
|
53
|
+
nullable: true,
|
|
54
|
+
comment: "Columna para saber el tipo de horario qué el usuario quiere para el elemento: \n1. Mostrar (Show). \n2. Ocultar (Hide)",
|
|
55
|
+
default: null,
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:type", Number)
|
|
58
|
+
], Category.prototype, "show_or_hide_item", void 0);
|
|
50
59
|
__decorate([
|
|
51
60
|
(0, typeorm_1.ManyToOne)(function () { return __1.Partner; }, function (partner) { return partner.partners_category_created_by; }, {
|
|
52
61
|
onDelete: "RESTRICT",
|
|
@@ -78,11 +87,27 @@ var Category = /** @class */ (function () {
|
|
|
78
87
|
], Category.prototype, "updated_by", void 0);
|
|
79
88
|
__decorate([
|
|
80
89
|
(0, typeorm_1.Column)({
|
|
81
|
-
|
|
82
|
-
|
|
90
|
+
type: "mediumtext",
|
|
91
|
+
nullable: true,
|
|
92
|
+
transformer: jsonTransformer_1.jsonTransformer,
|
|
93
|
+
comment: "Valores qué se van a mostrar mientras se aprueban los nuevos cambios.",
|
|
94
|
+
}),
|
|
95
|
+
__metadata("design:type", Object)
|
|
96
|
+
], Category.prototype, "current_values", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, typeorm_1.Column)({
|
|
99
|
+
default: 1,
|
|
100
|
+
comment: "Estado en el que está el elemento: \n0. Inactivo. \n1. Activo. \n2. Eliminado.",
|
|
83
101
|
}),
|
|
84
102
|
__metadata("design:type", Number)
|
|
85
103
|
], Category.prototype, "status", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, typeorm_1.Column)({
|
|
106
|
+
default: 1,
|
|
107
|
+
comment: "Estado en el que se encuentra la revisión de los cambios: \n1. En revisión. \n2. Rechazado.",
|
|
108
|
+
}),
|
|
109
|
+
__metadata("design:type", Number)
|
|
110
|
+
], Category.prototype, "status_review", void 0);
|
|
86
111
|
__decorate([
|
|
87
112
|
(0, typeorm_1.Column)({
|
|
88
113
|
nullable: true,
|
|
@@ -20,7 +20,9 @@ export declare class Product {
|
|
|
20
20
|
created: Date;
|
|
21
21
|
updated: Date;
|
|
22
22
|
updated_by: Partner;
|
|
23
|
+
current_values: any;
|
|
23
24
|
status: number;
|
|
25
|
+
status_review: number;
|
|
24
26
|
review_comment: string;
|
|
25
27
|
product_groups: ProductGroup[];
|
|
26
28
|
product_ingredients: ProductIngredient[];
|
package/dist/entities/Product.js
CHANGED
|
@@ -119,16 +119,32 @@ var Product = /** @class */ (function () {
|
|
|
119
119
|
], Product.prototype, "updated_by", void 0);
|
|
120
120
|
__decorate([
|
|
121
121
|
(0, typeorm_1.Column)({
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
type: "mediumtext",
|
|
123
|
+
nullable: true,
|
|
124
|
+
transformer: jsonTransformer_1.jsonTransformer,
|
|
125
|
+
comment: "Valores qué se van a mostrar mientras se aprueban los nuevos cambios.",
|
|
126
|
+
}),
|
|
127
|
+
__metadata("design:type", Object)
|
|
128
|
+
], Product.prototype, "current_values", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
(0, typeorm_1.Column)({
|
|
131
|
+
default: 1,
|
|
132
|
+
comment: "Estado en el que está el elemento: \n0. Inactivo. \n1. Activo. \n2. Eliminado.",
|
|
124
133
|
}),
|
|
125
134
|
__metadata("design:type", Number)
|
|
126
135
|
], Product.prototype, "status", void 0);
|
|
136
|
+
__decorate([
|
|
137
|
+
(0, typeorm_1.Column)({
|
|
138
|
+
default: 1,
|
|
139
|
+
comment: "Estado en el que se encuentra la revisión de los cambios: \n1. En revisión. \n2. Rechazado.",
|
|
140
|
+
}),
|
|
141
|
+
__metadata("design:type", Number)
|
|
142
|
+
], Product.prototype, "status_review", void 0);
|
|
127
143
|
__decorate([
|
|
128
144
|
(0, typeorm_1.Column)({
|
|
129
145
|
nullable: true,
|
|
130
146
|
length: 600,
|
|
131
|
-
comment: "
|
|
147
|
+
comment: "Comentarios u observaciones de la revisión.",
|
|
132
148
|
}),
|
|
133
149
|
__metadata("design:type", String)
|
|
134
150
|
], Product.prototype, "review_comment", void 0);
|
|
@@ -0,0 +1,64 @@
|
|
|
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.ToppingImage = void 0;
|
|
13
|
+
var typeorm_1 = require("typeorm");
|
|
14
|
+
var __1 = require("..");
|
|
15
|
+
var ToppingImage = /** @class */ (function () {
|
|
16
|
+
function ToppingImage() {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
20
|
+
comment: "ID único del registro.",
|
|
21
|
+
}),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], ToppingImage.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({
|
|
26
|
+
length: 100,
|
|
27
|
+
comment: "Nombre del registro.",
|
|
28
|
+
}),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], ToppingImage.prototype, "name", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({
|
|
33
|
+
length: 500,
|
|
34
|
+
nullable: true,
|
|
35
|
+
comment: "Nombres para los filtros de búsqueda de las imágenes.",
|
|
36
|
+
}),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], ToppingImage.prototype, "filter", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({
|
|
41
|
+
type: "text",
|
|
42
|
+
comment: "Campo de tipo JSON para guardar la imagen.",
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], ToppingImage.prototype, "image", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({
|
|
48
|
+
default: 1,
|
|
49
|
+
comment: "Estado de la imagen:\r\n1. Activo.\r\n0. Inactivo.",
|
|
50
|
+
}),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], ToppingImage.prototype, "status", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.OneToMany)(function () { return __1.ProductGroupComplement; }, function (productGroupComplement) { return productGroupComplement.image; }),
|
|
55
|
+
__metadata("design:type", Array)
|
|
56
|
+
], ToppingImage.prototype, "topping_images", void 0);
|
|
57
|
+
ToppingImage = __decorate([
|
|
58
|
+
(0, typeorm_1.Entity)("topping_image", {
|
|
59
|
+
comment: "Tabla creada para el manejo de las imágenes para los toppings. A la tabla a la que hace referencia es (product_group_complement)",
|
|
60
|
+
})
|
|
61
|
+
], ToppingImage);
|
|
62
|
+
return ToppingImage;
|
|
63
|
+
}());
|
|
64
|
+
exports.ToppingImage = ToppingImage;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import { ProductGroup } from
|
|
2
|
-
import { RequestProductGroupComplement } from
|
|
1
|
+
import { ProductGroup } from "./ProductGroup";
|
|
2
|
+
import { RequestProductGroupComplement } from "./RequestProductGroupComplement";
|
|
3
|
+
import { ToppingImage } from "..";
|
|
3
4
|
export declare class ProductGroupComplement {
|
|
4
5
|
id: number;
|
|
5
6
|
group_id: ProductGroup;
|
|
6
7
|
name: string;
|
|
8
|
+
image: ToppingImage;
|
|
7
9
|
price: string;
|
|
10
|
+
maximum_limit: number;
|
|
8
11
|
position: number;
|
|
12
|
+
current_values: any;
|
|
13
|
+
status: number;
|
|
14
|
+
status_review: number;
|
|
15
|
+
review_comment: string;
|
|
9
16
|
request_product_group_complements: RequestProductGroupComplement[];
|
|
10
17
|
}
|
|
@@ -13,42 +13,90 @@ exports.ProductGroupComplement = void 0;
|
|
|
13
13
|
var typeorm_1 = require("typeorm");
|
|
14
14
|
var ProductGroup_1 = require("./ProductGroup");
|
|
15
15
|
var RequestProductGroupComplement_1 = require("./RequestProductGroupComplement");
|
|
16
|
+
var __1 = require("..");
|
|
17
|
+
var jsonTransformer_1 = require("../transformers/jsonTransformer");
|
|
16
18
|
var ProductGroupComplement = /** @class */ (function () {
|
|
17
19
|
function ProductGroupComplement() {
|
|
18
20
|
}
|
|
19
21
|
__decorate([
|
|
20
22
|
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
21
|
-
comment:
|
|
23
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
22
24
|
}),
|
|
23
25
|
__metadata("design:type", Number)
|
|
24
26
|
], ProductGroupComplement.prototype, "id", void 0);
|
|
25
27
|
__decorate([
|
|
26
28
|
(0, typeorm_1.ManyToOne)(function () { return ProductGroup_1.ProductGroup; }, function (productGroup) { return productGroup.groups_complement; }, {
|
|
27
|
-
onDelete:
|
|
28
|
-
onUpdate:
|
|
29
|
+
onDelete: "CASCADE",
|
|
30
|
+
onUpdate: "NO ACTION",
|
|
29
31
|
}),
|
|
30
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
32
|
+
(0, typeorm_1.JoinColumn)({ name: "group_id" }),
|
|
31
33
|
__metadata("design:type", ProductGroup_1.ProductGroup)
|
|
32
34
|
], ProductGroupComplement.prototype, "group_id", void 0);
|
|
33
35
|
__decorate([
|
|
34
|
-
(0, typeorm_1.Column)({ length: 30, comment:
|
|
36
|
+
(0, typeorm_1.Column)({ length: 30, comment: "Nombre del complemento." }),
|
|
35
37
|
__metadata("design:type", String)
|
|
36
38
|
], ProductGroupComplement.prototype, "name", void 0);
|
|
37
39
|
__decorate([
|
|
38
|
-
(0, typeorm_1.
|
|
40
|
+
(0, typeorm_1.ManyToOne)(function () { return __1.ToppingImage; }, function (toppingImage) { return toppingImage.topping_images; }, {
|
|
41
|
+
onDelete: "RESTRICT",
|
|
42
|
+
onUpdate: "NO ACTION",
|
|
43
|
+
}),
|
|
44
|
+
(0, typeorm_1.JoinColumn)({ name: "image" }),
|
|
45
|
+
__metadata("design:type", __1.ToppingImage)
|
|
46
|
+
], ProductGroupComplement.prototype, "image", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ length: 20, nullable: true, comment: "Precio del complemento." }),
|
|
39
49
|
__metadata("design:type", String)
|
|
40
50
|
], ProductGroupComplement.prototype, "price", void 0);
|
|
41
51
|
__decorate([
|
|
42
|
-
(0, typeorm_1.Column)({
|
|
52
|
+
(0, typeorm_1.Column)({
|
|
53
|
+
nullable: true,
|
|
54
|
+
comment: "Límite máximo para poder agregar el complement (topping) al producto.",
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", Number)
|
|
57
|
+
], ProductGroupComplement.prototype, "maximum_limit", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ comment: "El orden en que aparece los grupos en el producto." }),
|
|
43
60
|
__metadata("design:type", Number)
|
|
44
61
|
], ProductGroupComplement.prototype, "position", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({
|
|
64
|
+
type: "mediumtext",
|
|
65
|
+
nullable: true,
|
|
66
|
+
transformer: jsonTransformer_1.jsonTransformer,
|
|
67
|
+
comment: "Valores qué se van a mostrar mientras se aprueban los nuevos cambios.",
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], ProductGroupComplement.prototype, "current_values", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({
|
|
73
|
+
default: 1,
|
|
74
|
+
comment: "Estado en el que está el elemento: \n0. Inactivo. \n1. Activo. \n2. Eliminado.",
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", Number)
|
|
77
|
+
], ProductGroupComplement.prototype, "status", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.Column)({
|
|
80
|
+
default: 1,
|
|
81
|
+
comment: "Estado en el que se encuentra la revisión de los cambios: \n1. En revisión. \n2. Rechazado.",
|
|
82
|
+
}),
|
|
83
|
+
__metadata("design:type", Number)
|
|
84
|
+
], ProductGroupComplement.prototype, "status_review", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.Column)({
|
|
87
|
+
nullable: true,
|
|
88
|
+
length: 600,
|
|
89
|
+
comment: "Comentarios u observaciones de la revisión.",
|
|
90
|
+
}),
|
|
91
|
+
__metadata("design:type", String)
|
|
92
|
+
], ProductGroupComplement.prototype, "review_comment", void 0);
|
|
45
93
|
__decorate([
|
|
46
94
|
(0, typeorm_1.OneToMany)(function () { return RequestProductGroupComplement_1.RequestProductGroupComplement; }, function (requestProduct) { return requestProduct.product_group_complement; }),
|
|
47
95
|
__metadata("design:type", Array)
|
|
48
96
|
], ProductGroupComplement.prototype, "request_product_group_complements", void 0);
|
|
49
97
|
ProductGroupComplement = __decorate([
|
|
50
|
-
(0, typeorm_1.Entity)(
|
|
51
|
-
comment:
|
|
98
|
+
(0, typeorm_1.Entity)("product_group_complement", {
|
|
99
|
+
comment: "Los complementos que tiene el grupo de un producto (product_group_complement).",
|
|
52
100
|
})
|
|
53
101
|
], ProductGroupComplement);
|
|
54
102
|
return ProductGroupComplement;
|
|
@@ -50,6 +50,7 @@ export { Bank } from "./entities/Bank";
|
|
|
50
50
|
export { CategoryDate } from "./entities/CategoryDate";
|
|
51
51
|
export { ProductSchedule } from "./entities/ProductSchedule";
|
|
52
52
|
export { ProductDate } from "./entities/ProductDate";
|
|
53
|
+
export { ToppingImage } from "./entities/ToppingImage";
|
|
53
54
|
export { LocalsCompany } from "./views/LocalsCompany";
|
|
54
55
|
export { VerifyLocals } from "./views/VerifyLocals";
|
|
55
56
|
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.CategoryDate = exports.Bank = exports.ServicePlan = exports.PartnerPlatform = exports.PartnerPermissionSection = exports.LocalPlan = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.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;
|
|
18
|
-
exports.CustomRepository = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.ProductDate = exports.ProductSchedule = void 0;
|
|
18
|
+
exports.CustomRepository = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.ToppingImage = exports.ProductDate = exports.ProductSchedule = 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");
|
|
@@ -120,6 +120,8 @@ var ProductSchedule_1 = require("./entities/ProductSchedule");
|
|
|
120
120
|
Object.defineProperty(exports, "ProductSchedule", { enumerable: true, get: function () { return ProductSchedule_1.ProductSchedule; } });
|
|
121
121
|
var ProductDate_1 = require("./entities/ProductDate");
|
|
122
122
|
Object.defineProperty(exports, "ProductDate", { enumerable: true, get: function () { return ProductDate_1.ProductDate; } });
|
|
123
|
+
var ToppingImage_1 = require("./entities/ToppingImage");
|
|
124
|
+
Object.defineProperty(exports, "ToppingImage", { enumerable: true, get: function () { return ToppingImage_1.ToppingImage; } });
|
|
123
125
|
var LocalsCompany_1 = require("./views/LocalsCompany");
|
|
124
126
|
Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
|
|
125
127
|
var VerifyLocals_1 = require("./views/VerifyLocals");
|
package/package.json
CHANGED
package/src/entities/Category.ts
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import { Local } from "./Local";
|
|
10
10
|
import { Product } from "./Product";
|
|
11
11
|
import { CategoryDate, Partner, ScheduleCategory } from "..";
|
|
12
|
+
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
12
13
|
|
|
13
14
|
@Entity({
|
|
14
15
|
comment:
|
|
@@ -41,6 +42,14 @@ export class Category {
|
|
|
41
42
|
})
|
|
42
43
|
type_sales_hours: number;
|
|
43
44
|
|
|
45
|
+
@Column({
|
|
46
|
+
nullable: true,
|
|
47
|
+
comment:
|
|
48
|
+
"Columna para saber el tipo de horario qué el usuario quiere para el elemento: \n1. Mostrar (Show). \n2. Ocultar (Hide)",
|
|
49
|
+
default: null,
|
|
50
|
+
})
|
|
51
|
+
show_or_hide_item: number;
|
|
52
|
+
|
|
44
53
|
@ManyToOne(() => Partner, (partner) => partner.partners_category_created_by, {
|
|
45
54
|
onDelete: "RESTRICT",
|
|
46
55
|
onUpdate: "NO ACTION",
|
|
@@ -67,12 +76,28 @@ export class Category {
|
|
|
67
76
|
updated_by: Partner;
|
|
68
77
|
|
|
69
78
|
@Column({
|
|
70
|
-
|
|
79
|
+
type: "mediumtext",
|
|
80
|
+
nullable: true,
|
|
81
|
+
transformer: jsonTransformer,
|
|
71
82
|
comment:
|
|
72
|
-
"
|
|
83
|
+
"Valores qué se van a mostrar mientras se aprueban los nuevos cambios.",
|
|
84
|
+
})
|
|
85
|
+
current_values: any;
|
|
86
|
+
|
|
87
|
+
@Column({
|
|
88
|
+
default: 1,
|
|
89
|
+
comment:
|
|
90
|
+
"Estado en el que está el elemento: \n0. Inactivo. \n1. Activo. \n2. Eliminado.",
|
|
73
91
|
})
|
|
74
92
|
status: number;
|
|
75
93
|
|
|
94
|
+
@Column({
|
|
95
|
+
default: 1,
|
|
96
|
+
comment:
|
|
97
|
+
"Estado en el que se encuentra la revisión de los cambios: \n1. En revisión. \n2. Rechazado.",
|
|
98
|
+
})
|
|
99
|
+
status_review: number;
|
|
100
|
+
|
|
76
101
|
@Column({
|
|
77
102
|
nullable: true,
|
|
78
103
|
length: 600,
|
package/src/entities/Product.ts
CHANGED
|
@@ -106,16 +106,32 @@ export class Product {
|
|
|
106
106
|
updated_by: Partner;
|
|
107
107
|
|
|
108
108
|
@Column({
|
|
109
|
-
|
|
109
|
+
type: "mediumtext",
|
|
110
|
+
nullable: true,
|
|
111
|
+
transformer: jsonTransformer,
|
|
110
112
|
comment:
|
|
111
|
-
"
|
|
113
|
+
"Valores qué se van a mostrar mientras se aprueban los nuevos cambios.",
|
|
114
|
+
})
|
|
115
|
+
current_values: any;
|
|
116
|
+
|
|
117
|
+
@Column({
|
|
118
|
+
default: 1,
|
|
119
|
+
comment:
|
|
120
|
+
"Estado en el que está el elemento: \n0. Inactivo. \n1. Activo. \n2. Eliminado.",
|
|
112
121
|
})
|
|
113
122
|
status: number;
|
|
114
123
|
|
|
124
|
+
@Column({
|
|
125
|
+
default: 1,
|
|
126
|
+
comment:
|
|
127
|
+
"Estado en el que se encuentra la revisión de los cambios: \n1. En revisión. \n2. Rechazado.",
|
|
128
|
+
})
|
|
129
|
+
status_review: number;
|
|
130
|
+
|
|
115
131
|
@Column({
|
|
116
132
|
nullable: true,
|
|
117
133
|
length: 600,
|
|
118
|
-
comment: "
|
|
134
|
+
comment: "Comentarios u observaciones de la revisión.",
|
|
119
135
|
})
|
|
120
136
|
review_comment: string;
|
|
121
137
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
|
2
|
+
import { City } from "./City";
|
|
3
|
+
import { ProductGroupComplement } from "..";
|
|
4
|
+
|
|
5
|
+
@Entity("topping_image", {
|
|
6
|
+
comment:
|
|
7
|
+
"Tabla creada para el manejo de las imágenes para los toppings. A la tabla a la que hace referencia es (product_group_complement)",
|
|
8
|
+
})
|
|
9
|
+
export class ToppingImage {
|
|
10
|
+
@PrimaryGeneratedColumn({
|
|
11
|
+
comment: "ID único del registro.",
|
|
12
|
+
})
|
|
13
|
+
id: number;
|
|
14
|
+
|
|
15
|
+
@Column({
|
|
16
|
+
length: 100,
|
|
17
|
+
comment: "Nombre del registro.",
|
|
18
|
+
})
|
|
19
|
+
name: string;
|
|
20
|
+
|
|
21
|
+
@Column({
|
|
22
|
+
length: 500,
|
|
23
|
+
nullable: true,
|
|
24
|
+
comment: "Nombres para los filtros de búsqueda de las imágenes.",
|
|
25
|
+
})
|
|
26
|
+
filter: string;
|
|
27
|
+
|
|
28
|
+
@Column({
|
|
29
|
+
type: "text",
|
|
30
|
+
comment: "Campo de tipo JSON para guardar la imagen.",
|
|
31
|
+
})
|
|
32
|
+
image: string;
|
|
33
|
+
|
|
34
|
+
@Column({
|
|
35
|
+
default: 1,
|
|
36
|
+
comment: "Estado de la imagen:\r\n1. Activo.\r\n0. Inactivo.",
|
|
37
|
+
})
|
|
38
|
+
status: number;
|
|
39
|
+
|
|
40
|
+
@OneToMany(
|
|
41
|
+
() => ProductGroupComplement,
|
|
42
|
+
(productGroupComplement) => productGroupComplement.image
|
|
43
|
+
)
|
|
44
|
+
topping_images: ProductGroupComplement[];
|
|
45
|
+
}
|
|
@@ -6,43 +6,93 @@ import {
|
|
|
6
6
|
JoinColumn,
|
|
7
7
|
BaseEntity,
|
|
8
8
|
OneToMany,
|
|
9
|
-
} from
|
|
10
|
-
import { ProductGroup } from
|
|
11
|
-
import { RequestProductGroupComplement } from
|
|
9
|
+
} from "typeorm";
|
|
10
|
+
import { ProductGroup } from "./ProductGroup";
|
|
11
|
+
import { RequestProductGroupComplement } from "./RequestProductGroupComplement";
|
|
12
|
+
import { ToppingImage } from "..";
|
|
13
|
+
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
12
14
|
|
|
13
|
-
@Entity(
|
|
15
|
+
@Entity("product_group_complement", {
|
|
14
16
|
comment:
|
|
15
|
-
|
|
17
|
+
"Los complementos que tiene el grupo de un producto (product_group_complement).",
|
|
16
18
|
})
|
|
17
19
|
export class ProductGroupComplement {
|
|
18
20
|
@PrimaryGeneratedColumn({
|
|
19
|
-
comment:
|
|
21
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
20
22
|
})
|
|
21
|
-
id: number
|
|
23
|
+
id: number;
|
|
22
24
|
|
|
23
25
|
@ManyToOne(
|
|
24
26
|
() => ProductGroup,
|
|
25
27
|
(productGroup) => productGroup.groups_complement,
|
|
26
28
|
{
|
|
27
|
-
onDelete:
|
|
28
|
-
onUpdate:
|
|
29
|
+
onDelete: "CASCADE",
|
|
30
|
+
onUpdate: "NO ACTION",
|
|
29
31
|
}
|
|
30
32
|
)
|
|
31
|
-
@JoinColumn({ name:
|
|
32
|
-
group_id: ProductGroup
|
|
33
|
+
@JoinColumn({ name: "group_id" })
|
|
34
|
+
group_id: ProductGroup;
|
|
33
35
|
|
|
34
|
-
@Column({ length: 30, comment:
|
|
35
|
-
name: string
|
|
36
|
+
@Column({ length: 30, comment: "Nombre del complemento." })
|
|
37
|
+
name: string;
|
|
36
38
|
|
|
37
|
-
@
|
|
38
|
-
|
|
39
|
+
@ManyToOne(
|
|
40
|
+
() => ToppingImage,
|
|
41
|
+
(toppingImage) => toppingImage.topping_images,
|
|
42
|
+
{
|
|
43
|
+
onDelete: "RESTRICT",
|
|
44
|
+
onUpdate: "NO ACTION",
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
@JoinColumn({ name: "image" })
|
|
48
|
+
image: ToppingImage;
|
|
49
|
+
|
|
50
|
+
@Column({ length: 20, nullable: true, comment: "Precio del complemento." })
|
|
51
|
+
price: string;
|
|
52
|
+
|
|
53
|
+
@Column({
|
|
54
|
+
nullable: true,
|
|
55
|
+
comment:
|
|
56
|
+
"Límite máximo para poder agregar el complement (topping) al producto.",
|
|
57
|
+
})
|
|
58
|
+
maximum_limit: number;
|
|
59
|
+
|
|
60
|
+
@Column({ comment: "El orden en que aparece los grupos en el producto." })
|
|
61
|
+
position: number;
|
|
39
62
|
|
|
40
|
-
@Column({
|
|
41
|
-
|
|
63
|
+
@Column({
|
|
64
|
+
type: "mediumtext",
|
|
65
|
+
nullable: true,
|
|
66
|
+
transformer: jsonTransformer,
|
|
67
|
+
comment:
|
|
68
|
+
"Valores qué se van a mostrar mientras se aprueban los nuevos cambios.",
|
|
69
|
+
})
|
|
70
|
+
current_values: any;
|
|
71
|
+
|
|
72
|
+
@Column({
|
|
73
|
+
default: 1,
|
|
74
|
+
comment:
|
|
75
|
+
"Estado en el que está el elemento: \n0. Inactivo. \n1. Activo. \n2. Eliminado.",
|
|
76
|
+
})
|
|
77
|
+
status: number;
|
|
78
|
+
|
|
79
|
+
@Column({
|
|
80
|
+
default: 1,
|
|
81
|
+
comment:
|
|
82
|
+
"Estado en el que se encuentra la revisión de los cambios: \n1. En revisión. \n2. Rechazado.",
|
|
83
|
+
})
|
|
84
|
+
status_review: number;
|
|
85
|
+
|
|
86
|
+
@Column({
|
|
87
|
+
nullable: true,
|
|
88
|
+
length: 600,
|
|
89
|
+
comment: "Comentarios u observaciones de la revisión.",
|
|
90
|
+
})
|
|
91
|
+
review_comment: string;
|
|
42
92
|
|
|
43
93
|
@OneToMany(
|
|
44
94
|
() => RequestProductGroupComplement,
|
|
45
95
|
(requestProduct) => requestProduct.product_group_complement
|
|
46
96
|
)
|
|
47
|
-
request_product_group_complements: RequestProductGroupComplement[]
|
|
97
|
+
request_product_group_complements: RequestProductGroupComplement[];
|
|
48
98
|
}
|
|
@@ -50,6 +50,7 @@ export { Bank } from "./entities/Bank";
|
|
|
50
50
|
export { CategoryDate } from "./entities/CategoryDate";
|
|
51
51
|
export { ProductSchedule } from "./entities/ProductSchedule";
|
|
52
52
|
export { ProductDate } from "./entities/ProductDate";
|
|
53
|
+
export { ToppingImage } from "./entities/ToppingImage";
|
|
53
54
|
|
|
54
55
|
export { LocalsCompany } from "./views/LocalsCompany";
|
|
55
56
|
export { VerifyLocals } from "./views/VerifyLocals";
|