test-entity-library-asm 3.2.13 → 3.3.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/AuthenticationCredential.d.ts +1 -1
- package/dist/entities/AuthenticationCredential.js +16 -7
- package/dist/entities/Bank.js +5 -0
- package/dist/entities/BusinessType.js +9 -3
- package/dist/entities/BusinessTypeProduct.js +4 -1
- package/dist/entities/Category.d.ts +3 -3
- package/dist/entities/Category.js +24 -8
- package/dist/entities/CategoryDate.js +3 -2
- package/dist/entities/CategorySchedule.js +3 -2
- package/dist/entities/City.d.ts +8 -8
- package/dist/entities/City.js +13 -10
- package/dist/entities/CodeRedemptionHistoryCompany.d.ts +2 -2
- package/dist/entities/CodeRedemptionHistoryCompany.js +19 -9
- package/dist/entities/CodeRedemptionHistoryUser.d.ts +2 -2
- package/dist/entities/CodeRedemptionHistoryUser.js +21 -11
- package/dist/entities/Company.js +14 -2
- package/dist/entities/Configuration.js +5 -4
- package/dist/entities/Country.d.ts +1 -1
- package/dist/entities/Country.js +15 -5
- package/dist/entities/Day.js +3 -0
- package/dist/entities/DiscountCodeCompany.js +11 -1
- package/dist/entities/DiscountCodeUser.js +17 -2
- package/dist/entities/Local.d.ts +1 -1
- package/dist/entities/Local.js +10 -3
- package/dist/entities/LocalPlan.js +9 -0
- package/dist/entities/LocalQualification.js +4 -1
- package/dist/entities/Master.js +25 -4
- package/dist/entities/MasterNotification.js +7 -0
- package/dist/entities/MasterPermission.js +11 -1
- package/dist/entities/MasterRole.js +12 -1
- package/dist/entities/Partner.js +28 -4
- package/dist/entities/PartnerNotification.js +7 -0
- package/dist/entities/PartnerPermission.d.ts +1 -1
- package/dist/entities/PartnerPermission.js +15 -2
- package/dist/entities/PartnerPermissionSection.js +14 -1
- package/dist/entities/PartnerPlatform.js +14 -1
- package/dist/entities/PartnerRole.js +12 -1
- package/dist/entities/PartnerSession.js +8 -0
- package/dist/entities/PaymentMethod.d.ts +2 -2
- package/dist/entities/PaymentMethod.js +10 -1
- package/dist/entities/Plan.d.ts +1 -1
- package/dist/entities/Plan.js +16 -3
- package/dist/entities/PosSystem.d.ts +2 -2
- package/dist/entities/PosSystem.js +16 -4
- package/dist/entities/Product.d.ts +2 -2
- package/dist/entities/Product.js +30 -6
- package/dist/entities/ProductDate.js +3 -2
- package/dist/entities/ProductGroup.d.ts +3 -3
- package/dist/entities/ProductGroup.js +24 -14
- package/dist/entities/ProductIngredient.d.ts +2 -2
- package/dist/entities/ProductIngredient.js +16 -13
- package/dist/entities/ProductSchedule.js +3 -2
- package/dist/entities/ProductTopping.js +4 -0
- package/dist/entities/Region.d.ts +2 -2
- package/dist/entities/Region.js +12 -8
- package/dist/entities/Request.d.ts +1 -1
- package/dist/entities/Request.js +14 -2
- package/dist/entities/RequestLocal.js +13 -1
- package/dist/entities/RequestLocalHistory.js +8 -1
- package/dist/entities/RequestLocalPayment.js +10 -0
- package/dist/entities/RequestProduct.d.ts +3 -3
- package/dist/entities/RequestProduct.js +19 -15
- package/dist/entities/RequestProductGroupComplement.d.ts +3 -3
- package/dist/entities/RequestProductGroupComplement.js +14 -13
- package/dist/entities/Square.d.ts +2 -2
- package/dist/entities/Square.js +36 -5
- package/dist/entities/ToppingImage.js +6 -0
- package/dist/entities/TypeMeasureIngredient.d.ts +1 -1
- package/dist/entities/TypeMeasureIngredient.js +11 -6
- package/dist/entities/User.d.ts +2 -2
- package/dist/entities/User.js +22 -5
- package/dist/entities/UserAddress.js +14 -1
- package/dist/entities/UserPaymentMethod.d.ts +1 -1
- package/dist/entities/UserPaymentMethod.js +13 -1
- package/dist/entities/VerifyLocal.d.ts +2 -2
- package/dist/entities/VerifyLocal.js +11 -0
- package/dist/entities/productGroupComplement.js +23 -3
- package/package.json +1 -1
- package/src/entities/AuthenticationCredential.ts +24 -15
- package/src/entities/Bank.ts +8 -6
- package/src/entities/BusinessType.ts +9 -2
- package/src/entities/BusinessTypeProduct.ts +4 -1
- package/src/entities/Category.ts +24 -8
- package/src/entities/CategoryDate.ts +3 -2
- package/src/entities/CategorySchedule.ts +3 -2
- package/src/entities/City.ts +31 -28
- package/src/entities/CodeRedemptionHistoryCompany.ts +28 -18
- package/src/entities/CodeRedemptionHistoryUser.ts +31 -21
- package/src/entities/Company.ts +14 -2
- package/src/entities/Configuration.ts +8 -7
- package/src/entities/Country.ts +15 -5
- package/src/entities/Day.ts +4 -1
- package/src/entities/DiscountCodeCompany.ts +11 -1
- package/src/entities/DiscountCodeUser.ts +17 -2
- package/src/entities/Local.ts +12 -11
- package/src/entities/LocalPlan.ts +9 -0
- package/src/entities/LocalQualification.ts +4 -1
- package/src/entities/Master.ts +25 -4
- package/src/entities/MasterNotification.ts +7 -0
- package/src/entities/MasterPermission.ts +11 -1
- package/src/entities/MasterRole.ts +12 -1
- package/src/entities/Partner.ts +28 -4
- package/src/entities/PartnerNotification.ts +7 -0
- package/src/entities/PartnerPermission.ts +15 -2
- package/src/entities/PartnerPermissionSection.ts +14 -1
- package/src/entities/PartnerPlatform.ts +14 -1
- package/src/entities/PartnerRole.ts +12 -1
- package/src/entities/PartnerSession.ts +9 -1
- package/src/entities/PaymentMethod.ts +11 -2
- package/src/entities/Plan.ts +17 -4
- package/src/entities/PosSystem.ts +16 -4
- package/src/entities/Product.ts +31 -7
- package/src/entities/ProductDate.ts +3 -3
- package/src/entities/ProductGroup.ts +40 -30
- package/src/entities/ProductIngredient.ts +27 -24
- package/src/entities/ProductSchedule.ts +3 -2
- package/src/entities/ProductTopping.ts +4 -0
- package/src/entities/Region.ts +22 -19
- package/src/entities/Request.ts +14 -2
- package/src/entities/RequestLocal.ts +13 -1
- package/src/entities/RequestLocalHistory.ts +8 -1
- package/src/entities/RequestLocalPayment.ts +10 -0
- package/src/entities/RequestProduct.ts +30 -26
- package/src/entities/RequestProductGroupComplement.ts +23 -22
- package/src/entities/Square.ts +37 -6
- package/src/entities/ToppingImage.ts +6 -0
- package/src/entities/TypeMeasureIngredient.ts +18 -18
- package/src/entities/User.ts +23 -6
- package/src/entities/UserAddress.ts +14 -1
- package/src/entities/UserPaymentMethod.ts +13 -1
- package/src/entities/VerifyLocal.ts +13 -2
- package/src/entities/productGroupComplement.ts +23 -3
package/src/entities/Plan.ts
CHANGED
|
@@ -7,20 +7,26 @@ import {
|
|
|
7
7
|
PrimaryGeneratedColumn,
|
|
8
8
|
} from "typeorm";
|
|
9
9
|
import { LocalPlan } from "..";
|
|
10
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
10
11
|
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
11
12
|
import { Company } from "./Company";
|
|
12
|
-
import { DateTransformer } from "../transformers/dateTransformer";
|
|
13
13
|
|
|
14
14
|
@Entity({
|
|
15
15
|
comment: "Planes que tendrá la plataforma para las empresas (company)",
|
|
16
16
|
})
|
|
17
17
|
export class Plan {
|
|
18
18
|
@PrimaryGeneratedColumn({
|
|
19
|
+
type: "int",
|
|
19
20
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
20
21
|
})
|
|
21
22
|
id: number;
|
|
22
23
|
|
|
23
|
-
@Column({
|
|
24
|
+
@Column({
|
|
25
|
+
length: 20,
|
|
26
|
+
type: "varchar",
|
|
27
|
+
unique: true,
|
|
28
|
+
comment: "Código del plan.",
|
|
29
|
+
})
|
|
24
30
|
code: string;
|
|
25
31
|
|
|
26
32
|
@ManyToOne(() => Company, (company) => company.plans_company, {
|
|
@@ -32,6 +38,7 @@ export class Plan {
|
|
|
32
38
|
|
|
33
39
|
@Column({
|
|
34
40
|
length: 50,
|
|
41
|
+
type: "varchar",
|
|
35
42
|
comment:
|
|
36
43
|
"Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
|
|
37
44
|
})
|
|
@@ -41,12 +48,16 @@ export class Plan {
|
|
|
41
48
|
type: "mediumtext",
|
|
42
49
|
transformer: jsonTransformer,
|
|
43
50
|
nullable: true,
|
|
51
|
+
default: null,
|
|
44
52
|
comment:
|
|
45
53
|
"Campo de tipo JSON donde se guarda información necesaria para el plan",
|
|
46
54
|
})
|
|
47
|
-
description:
|
|
55
|
+
description: any | null;
|
|
48
56
|
|
|
49
|
-
@Column(
|
|
57
|
+
@Column({
|
|
58
|
+
type: "int",
|
|
59
|
+
comment: "Cantidad de locales a los que está el plan.",
|
|
60
|
+
})
|
|
50
61
|
quantity_locals: number;
|
|
51
62
|
|
|
52
63
|
@Column({
|
|
@@ -61,6 +72,8 @@ export class Plan {
|
|
|
61
72
|
|
|
62
73
|
@Column({
|
|
63
74
|
default: 1,
|
|
75
|
+
type: "int",
|
|
76
|
+
width: 1,
|
|
64
77
|
comment:
|
|
65
78
|
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
66
79
|
})
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
PrimaryGeneratedColumn,
|
|
8
8
|
} from "typeorm";
|
|
9
9
|
import { AuthenticationCredential, Local } from "..";
|
|
10
|
+
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
10
11
|
|
|
11
12
|
@Entity({
|
|
12
13
|
name: "pos_system",
|
|
@@ -15,29 +16,38 @@ import { AuthenticationCredential, Local } from "..";
|
|
|
15
16
|
})
|
|
16
17
|
export class PosSystem {
|
|
17
18
|
@PrimaryGeneratedColumn({
|
|
19
|
+
type: "int",
|
|
18
20
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
19
21
|
})
|
|
20
22
|
id: number;
|
|
21
23
|
|
|
22
|
-
@Column({ length: 50, comment: "Nombre del registro." })
|
|
24
|
+
@Column({ length: 50, type: "varchar", comment: "Nombre del registro." })
|
|
23
25
|
name: string;
|
|
24
26
|
|
|
25
|
-
@Column({
|
|
27
|
+
@Column({
|
|
28
|
+
length: 300,
|
|
29
|
+
type: "varchar",
|
|
30
|
+
nullable: true,
|
|
31
|
+
default: null,
|
|
32
|
+
comment: "Descripción del registro.",
|
|
33
|
+
})
|
|
26
34
|
description: string | null;
|
|
27
35
|
|
|
28
36
|
@Column({
|
|
29
37
|
type: "text",
|
|
38
|
+
transformer: jsonTransformer,
|
|
30
39
|
comment:
|
|
31
40
|
'Esto será un JSON, donde va a tener información de lo que necesita para poder una petición hacia el sistema POS para traer los productos, es decir:\r\n\r\n1. type: Tipo de endpoint que tiene los productos (GET o POST)\r\n\r\n2. endpoint_name: Este es un string que será la url de la solicitud para traerse los productos que hay en el sistema POS.\r\n\r\n3. query_parameters: Este un objeto donde se van a guardar los clave valor de cada item qué necesitemos, es decir:\r\n{"productId": "product_id"...}\r\n{"ProductId: "product_id"...}\r\n{"productid": "product_id"...}\r\n\r\nEntonces, con este elemento se puede saber el parámetro que nosotros (asumano) usamos, y el parámetro que necesita el api (POS).\r\n',
|
|
32
41
|
})
|
|
33
|
-
endpoint_products:
|
|
42
|
+
endpoint_products: any;
|
|
34
43
|
|
|
35
44
|
@Column({
|
|
36
45
|
type: "text",
|
|
46
|
+
transformer: jsonTransformer,
|
|
37
47
|
comment:
|
|
38
48
|
'Esto será un JSON, donde va a tener información de lo que necesita para poder una petición hacia el sistema POS para realizar un pedido, es decir:\r\n\r\n1. type: Tipo de endpoint que tiene los pedidos (GET o POST) (Acá todos los desarrolladores deberían usar POST, ya que es una creación, pero hay casos en que no los usan, toca validar).\r\n\r\n2. endpoint_name: Este es un string que será la url de la solicitud para crear un pedido en el sistema POS.\r\n\r\n3. query_parameters: Este un objeto donde se van a guardar los clave valor de cada item qué necesitemos, es decir:\r\n{"productId": "product_id"...}\r\n{"ProductId: "product_id"...}\r\n{"productid": "product_id"...}\r\n\r\nEntonces, con este elemento se puede saber el parámetro que nosotros (asumano) usamos, y el parámetro que necesita el api (POS) para poder crear el pedido.\r\n',
|
|
39
49
|
})
|
|
40
|
-
endpoint_order:
|
|
50
|
+
endpoint_order: any;
|
|
41
51
|
|
|
42
52
|
@ManyToOne(
|
|
43
53
|
() => AuthenticationCredential,
|
|
@@ -53,6 +63,8 @@ export class PosSystem {
|
|
|
53
63
|
|
|
54
64
|
@Column({
|
|
55
65
|
default: 1,
|
|
66
|
+
type: "int",
|
|
67
|
+
width: 1,
|
|
56
68
|
comment:
|
|
57
69
|
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
58
70
|
})
|
package/src/entities/Product.ts
CHANGED
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
OneToMany,
|
|
9
9
|
PrimaryGeneratedColumn,
|
|
10
10
|
} from "typeorm";
|
|
11
|
+
import { Partner, ProductDate, ProductSchedule } from "..";
|
|
12
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
13
|
+
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
11
14
|
import { Category } from "./Category";
|
|
12
15
|
import { ProductGroup } from "./ProductGroup";
|
|
13
16
|
import { ProductIngredient } from "./ProductIngredient";
|
|
14
17
|
import { RequestProduct } from "./RequestProduct";
|
|
15
18
|
import { User } from "./User";
|
|
16
|
-
import { Partner, ProductDate, ProductSchedule } from "..";
|
|
17
|
-
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
18
|
-
import { DateTransformer } from "../transformers/dateTransformer";
|
|
19
19
|
|
|
20
20
|
@Entity({
|
|
21
21
|
comment:
|
|
@@ -23,6 +23,7 @@ import { DateTransformer } from "../transformers/dateTransformer";
|
|
|
23
23
|
})
|
|
24
24
|
export class Product {
|
|
25
25
|
@PrimaryGeneratedColumn({
|
|
26
|
+
type: "int",
|
|
26
27
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
27
28
|
})
|
|
28
29
|
id: number;
|
|
@@ -34,20 +35,23 @@ export class Product {
|
|
|
34
35
|
@JoinColumn({ name: "category" })
|
|
35
36
|
category: Category;
|
|
36
37
|
|
|
37
|
-
@Column({ length: 50, comment: "Nombre del producto." })
|
|
38
|
+
@Column({ length: 50, type: "varchar", comment: "Nombre del producto." })
|
|
38
39
|
name: string;
|
|
39
40
|
|
|
40
41
|
@Column({
|
|
41
42
|
length: 400,
|
|
43
|
+
type: "varchar",
|
|
42
44
|
comment: "Detalles del producto. \n\n ¿Qué contiene?",
|
|
43
45
|
})
|
|
44
46
|
details: string;
|
|
45
47
|
|
|
46
|
-
@Column({ length: 20, comment: "Precio del producto." })
|
|
48
|
+
@Column({ length: 20, type: "varchar", comment: "Precio del producto." })
|
|
47
49
|
price: string;
|
|
48
50
|
|
|
49
51
|
@Column({
|
|
50
52
|
default: 0,
|
|
53
|
+
type: "int",
|
|
54
|
+
width: 1,
|
|
51
55
|
comment:
|
|
52
56
|
"¿El producto cuenta con restricción de edad?\r\n1. Cuenta con restricción.\r\n0. No cuenta con restricción.",
|
|
53
57
|
})
|
|
@@ -55,16 +59,22 @@ export class Product {
|
|
|
55
59
|
|
|
56
60
|
@Column({
|
|
57
61
|
default: 0,
|
|
62
|
+
type: "int",
|
|
63
|
+
width: 1,
|
|
58
64
|
comment: "¿El producto es un combo?\r\n1. Combo.\r\n0. No es un combo.",
|
|
59
65
|
})
|
|
60
66
|
combo: number;
|
|
61
67
|
|
|
62
|
-
@Column({
|
|
68
|
+
@Column({
|
|
69
|
+
type: "int",
|
|
70
|
+
comment: "En qué posición se va a mostrar el producto.",
|
|
71
|
+
})
|
|
63
72
|
position: number;
|
|
64
73
|
|
|
65
74
|
@Column({
|
|
66
75
|
type: "text",
|
|
67
76
|
nullable: true,
|
|
77
|
+
default: null,
|
|
68
78
|
transformer: jsonTransformer,
|
|
69
79
|
comment: "Campo de tipo json para guardar el id y la url de la foto",
|
|
70
80
|
})
|
|
@@ -72,14 +82,18 @@ export class Product {
|
|
|
72
82
|
|
|
73
83
|
@Column({
|
|
74
84
|
type: "mediumtext",
|
|
85
|
+
transformer: jsonTransformer,
|
|
75
86
|
nullable: true,
|
|
87
|
+
default: null,
|
|
76
88
|
comment:
|
|
77
89
|
"Campo de tipo JSON donde se guarda información necesaria para el registro.",
|
|
78
90
|
})
|
|
79
|
-
additional_information:
|
|
91
|
+
additional_information: any | null;
|
|
80
92
|
|
|
81
93
|
@Column({
|
|
82
94
|
nullable: true,
|
|
95
|
+
type: "int",
|
|
96
|
+
width: 1,
|
|
83
97
|
comment:
|
|
84
98
|
"Campo para saber el tipo de horario que se va a mostrar en la aplicación:\n 1. Días. \n2. Fecha específica.",
|
|
85
99
|
default: null,
|
|
@@ -102,6 +116,8 @@ export class Product {
|
|
|
102
116
|
|
|
103
117
|
@Column({
|
|
104
118
|
type: "datetime",
|
|
119
|
+
nullable: true,
|
|
120
|
+
default: null,
|
|
105
121
|
transformer: new DateTransformer(),
|
|
106
122
|
comment: "Fecha de actualización del registro.",
|
|
107
123
|
})
|
|
@@ -110,6 +126,7 @@ export class Product {
|
|
|
110
126
|
@ManyToOne(() => Partner, (partner) => partner.partners_update_by, {
|
|
111
127
|
onDelete: "RESTRICT",
|
|
112
128
|
onUpdate: "NO ACTION",
|
|
129
|
+
nullable: true,
|
|
113
130
|
})
|
|
114
131
|
@JoinColumn({ name: "updated_by" })
|
|
115
132
|
updated_by: Partner;
|
|
@@ -117,6 +134,7 @@ export class Product {
|
|
|
117
134
|
@Column({
|
|
118
135
|
type: "mediumtext",
|
|
119
136
|
nullable: true,
|
|
137
|
+
default: null,
|
|
120
138
|
transformer: jsonTransformer,
|
|
121
139
|
comment:
|
|
122
140
|
"Valores qué se van a mostrar mientras se aprueban los nuevos cambios.",
|
|
@@ -125,6 +143,8 @@ export class Product {
|
|
|
125
143
|
|
|
126
144
|
@Column({
|
|
127
145
|
default: 1,
|
|
146
|
+
type: "int",
|
|
147
|
+
width: 1,
|
|
128
148
|
comment:
|
|
129
149
|
"Estado en el que está el elemento: \n0. Inactivo. \n1. Activo. \n2. Eliminado.",
|
|
130
150
|
})
|
|
@@ -132,6 +152,8 @@ export class Product {
|
|
|
132
152
|
|
|
133
153
|
@Column({
|
|
134
154
|
default: 1,
|
|
155
|
+
type: "int",
|
|
156
|
+
width: 1,
|
|
135
157
|
comment:
|
|
136
158
|
"Estado en el que se encuentra la revisión de los cambios: \n1. En revisión. \n2. Rechazado.",
|
|
137
159
|
})
|
|
@@ -139,6 +161,8 @@ export class Product {
|
|
|
139
161
|
|
|
140
162
|
@Column({
|
|
141
163
|
nullable: true,
|
|
164
|
+
default: null,
|
|
165
|
+
type: "varchar",
|
|
142
166
|
length: 600,
|
|
143
167
|
comment: "Comentarios u observaciones de la revisión.",
|
|
144
168
|
})
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
ManyToOne,
|
|
6
6
|
PrimaryGeneratedColumn,
|
|
7
7
|
} from "typeorm";
|
|
8
|
-
import { Category } from "./Category";
|
|
9
8
|
import { Product } from "..";
|
|
10
9
|
|
|
11
10
|
@Entity("product_date", {
|
|
@@ -13,6 +12,7 @@ import { Product } from "..";
|
|
|
13
12
|
})
|
|
14
13
|
export class ProductDate {
|
|
15
14
|
@PrimaryGeneratedColumn({
|
|
15
|
+
type: "int",
|
|
16
16
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
17
17
|
})
|
|
18
18
|
id: number;
|
|
@@ -30,9 +30,9 @@ export class ProductDate {
|
|
|
30
30
|
})
|
|
31
31
|
date: Date;
|
|
32
32
|
|
|
33
|
-
@Column({ comment: "Hora de inicio." })
|
|
33
|
+
@Column({ type: "varchar", comment: "Hora de inicio." })
|
|
34
34
|
start_time: string;
|
|
35
35
|
|
|
36
|
-
@Column({ comment: "Hora de finalización." })
|
|
36
|
+
@Column({ type: "varchar", comment: "Hora de finalización." })
|
|
37
37
|
end_time: string;
|
|
38
38
|
}
|
|
@@ -1,72 +1,82 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Entity,
|
|
3
2
|
Column,
|
|
4
|
-
|
|
5
|
-
ManyToOne,
|
|
3
|
+
Entity,
|
|
6
4
|
JoinColumn,
|
|
5
|
+
ManyToOne,
|
|
7
6
|
OneToMany,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
PrimaryGeneratedColumn,
|
|
8
|
+
} from "typeorm";
|
|
9
|
+
import { Product } from "./Product";
|
|
10
|
+
import { ProductTopping } from "./ProductTopping";
|
|
11
|
+
import { ProductGroupComplement } from "./productGroupComplement";
|
|
12
12
|
|
|
13
|
-
@Entity(
|
|
13
|
+
@Entity("product_group", {
|
|
14
14
|
comment:
|
|
15
|
-
|
|
15
|
+
"Grupos para agregar al topping por producto.\r\n\r\nEstos elementos que se agreguen acá estarán visibles para los usuarios en la APP.",
|
|
16
16
|
})
|
|
17
17
|
export class ProductGroup {
|
|
18
18
|
@PrimaryGeneratedColumn({
|
|
19
|
-
|
|
19
|
+
type: "int",
|
|
20
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
20
21
|
})
|
|
21
|
-
id: number
|
|
22
|
+
id: number;
|
|
22
23
|
|
|
23
24
|
@ManyToOne(() => Product, (product) => product.product_groups, {
|
|
24
|
-
onDelete:
|
|
25
|
-
onUpdate:
|
|
25
|
+
onDelete: "CASCADE",
|
|
26
|
+
onUpdate: "NO ACTION",
|
|
26
27
|
})
|
|
27
|
-
@JoinColumn({ name:
|
|
28
|
-
product: Product
|
|
28
|
+
@JoinColumn({ name: "product" })
|
|
29
|
+
product: Product;
|
|
29
30
|
|
|
30
31
|
@ManyToOne(
|
|
31
32
|
() => ProductTopping,
|
|
32
33
|
(productTopping) => productTopping.product_groups,
|
|
33
34
|
{
|
|
34
|
-
onDelete:
|
|
35
|
-
onUpdate:
|
|
35
|
+
onDelete: "CASCADE",
|
|
36
|
+
onUpdate: "NO ACTION",
|
|
36
37
|
}
|
|
37
38
|
)
|
|
38
|
-
@JoinColumn({ name:
|
|
39
|
-
topping: ProductTopping
|
|
39
|
+
@JoinColumn({ name: "topping" })
|
|
40
|
+
topping: ProductTopping;
|
|
40
41
|
|
|
41
|
-
@Column({ length: 30, comment:
|
|
42
|
-
name: string
|
|
42
|
+
@Column({ length: 30, type: "varchar", comment: "Nombre del grupo." })
|
|
43
|
+
name: string;
|
|
43
44
|
|
|
44
45
|
@Column({
|
|
45
46
|
default: 1,
|
|
47
|
+
type: "int",
|
|
48
|
+
width: 1,
|
|
46
49
|
comment:
|
|
47
|
-
|
|
50
|
+
"El `type` se refiere a si el grupo es opcional o si es requerido:\r\n1. Opcional.\r\n2. Requerido.",
|
|
48
51
|
})
|
|
49
|
-
type: number
|
|
52
|
+
type: number;
|
|
50
53
|
|
|
51
54
|
@Column({
|
|
52
55
|
default: 0,
|
|
56
|
+
type: "int",
|
|
57
|
+
width: 1,
|
|
53
58
|
comment:
|
|
54
|
-
|
|
59
|
+
"Cantidad mínima que el usuario puede agregar para el grupo.\r\n\r\n- Cuando `type` es `Requerido (2)` entonces la cantidad mínima debería ser 1.\r\n\r\n- Cuando `type` es `Opcional (1)` entonces la cantidad puede ser 0.",
|
|
55
60
|
})
|
|
56
|
-
minimum_quantity: number
|
|
61
|
+
minimum_quantity: number;
|
|
57
62
|
|
|
58
63
|
@Column({
|
|
59
64
|
default: 0,
|
|
60
|
-
|
|
65
|
+
type: "int",
|
|
66
|
+
width: 1,
|
|
67
|
+
comment: "Cantidad máxima que el usuario puede agregar para el grupo.",
|
|
61
68
|
})
|
|
62
|
-
maximum_quantity: number
|
|
69
|
+
maximum_quantity: number;
|
|
63
70
|
|
|
64
|
-
@Column({
|
|
65
|
-
|
|
71
|
+
@Column({
|
|
72
|
+
type: "int",
|
|
73
|
+
comment: "El orden en que aparece los grupos en el producto.",
|
|
74
|
+
})
|
|
75
|
+
position: number;
|
|
66
76
|
|
|
67
77
|
@OneToMany(
|
|
68
78
|
() => ProductGroupComplement,
|
|
69
79
|
(productGroupComplement) => productGroupComplement.group_id
|
|
70
80
|
)
|
|
71
|
-
groups_complement: ProductGroupComplement[]
|
|
81
|
+
groups_complement: ProductGroupComplement[];
|
|
72
82
|
}
|
|
@@ -3,52 +3,55 @@ import {
|
|
|
3
3
|
Entity,
|
|
4
4
|
JoinColumn,
|
|
5
5
|
ManyToOne,
|
|
6
|
-
PrimaryGeneratedColumn
|
|
7
|
-
} from
|
|
8
|
-
import { Product } from
|
|
9
|
-
import { TypeMeasureIngredient } from
|
|
6
|
+
PrimaryGeneratedColumn,
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import { Product } from "./Product";
|
|
9
|
+
import { TypeMeasureIngredient } from "./TypeMeasureIngredient";
|
|
10
10
|
|
|
11
|
-
@Entity(
|
|
11
|
+
@Entity("product_ingredient", {
|
|
12
12
|
comment:
|
|
13
|
-
|
|
13
|
+
"Ingredientes que tendrá un producto específico. Esto se hace para guardar la información del inventario que se tiene y el que se gasta diario, esto genera un reporte donde el cliente puede ver qué cosas fueron usadas.",
|
|
14
14
|
})
|
|
15
15
|
export class ProductIngredient {
|
|
16
16
|
@PrimaryGeneratedColumn({
|
|
17
|
-
|
|
17
|
+
type: "int",
|
|
18
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
18
19
|
})
|
|
19
|
-
id: number
|
|
20
|
+
id: number;
|
|
20
21
|
|
|
21
22
|
@ManyToOne(() => Product, (product) => product.product_ingredients, {
|
|
22
|
-
onDelete:
|
|
23
|
-
onUpdate:
|
|
23
|
+
onDelete: "CASCADE",
|
|
24
|
+
onUpdate: "NO ACTION",
|
|
24
25
|
})
|
|
25
|
-
@JoinColumn({ name:
|
|
26
|
-
product: Product
|
|
26
|
+
@JoinColumn({ name: "product" })
|
|
27
|
+
product: Product;
|
|
27
28
|
|
|
28
|
-
@Column({ length: 30, comment:
|
|
29
|
-
name: string
|
|
29
|
+
@Column({ length: 30, type: "varchar", comment: "Nombre del ingrediente." })
|
|
30
|
+
name: string;
|
|
30
31
|
|
|
31
32
|
@ManyToOne(
|
|
32
33
|
() => TypeMeasureIngredient,
|
|
33
34
|
(typeMeasureIngredient) => typeMeasureIngredient.type_measure_ingredients,
|
|
34
35
|
{
|
|
35
|
-
onDelete:
|
|
36
|
-
onUpdate:
|
|
36
|
+
onDelete: "CASCADE",
|
|
37
|
+
onUpdate: "NO ACTION",
|
|
37
38
|
}
|
|
38
39
|
)
|
|
39
|
-
@JoinColumn({ name:
|
|
40
|
-
type_measure_ingredient: TypeMeasureIngredient
|
|
40
|
+
@JoinColumn({ name: "type_measure_ingredient" })
|
|
41
|
+
type_measure_ingredient: TypeMeasureIngredient;
|
|
41
42
|
|
|
42
|
-
@Column({ comment:
|
|
43
|
-
quantity: number
|
|
43
|
+
@Column({ type: "int", comment: "Cantidad del ingrediente." })
|
|
44
|
+
quantity: number;
|
|
44
45
|
|
|
45
|
-
@Column({ type:
|
|
46
|
-
created: Date
|
|
46
|
+
@Column({ type: "datetime", comment: "Fecha de creación del registro." })
|
|
47
|
+
created: Date;
|
|
47
48
|
|
|
48
49
|
@Column({
|
|
49
50
|
default: 1,
|
|
51
|
+
type: "int",
|
|
52
|
+
width: 1,
|
|
50
53
|
comment:
|
|
51
|
-
|
|
54
|
+
"Estado del registro, es decir:\r\n1. Activo: Es visible en los reportes de inventario.\r\n0. Inactivo: No será visible en los reportes de inventario.",
|
|
52
55
|
})
|
|
53
|
-
status: number
|
|
56
|
+
status: number;
|
|
54
57
|
}
|
|
@@ -13,6 +13,7 @@ import { Day } from "./Day";
|
|
|
13
13
|
})
|
|
14
14
|
export class ProductSchedule {
|
|
15
15
|
@PrimaryGeneratedColumn({
|
|
16
|
+
type: "int",
|
|
16
17
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
17
18
|
})
|
|
18
19
|
id: number;
|
|
@@ -31,9 +32,9 @@ export class ProductSchedule {
|
|
|
31
32
|
@JoinColumn({ name: "day" })
|
|
32
33
|
day: Day;
|
|
33
34
|
|
|
34
|
-
@Column({ comment: "Hora de inicio." })
|
|
35
|
+
@Column({ type: "varchar", length: 5, comment: "Hora de inicio." })
|
|
35
36
|
start_time: string;
|
|
36
37
|
|
|
37
|
-
@Column({ comment: "Hora de finalización." })
|
|
38
|
+
@Column({ type: "varchar", length: 5, comment: "Hora de finalización." })
|
|
38
39
|
end_time: string;
|
|
39
40
|
}
|
|
@@ -15,6 +15,7 @@ import { ProductGroup } from "./ProductGroup";
|
|
|
15
15
|
})
|
|
16
16
|
export class ProductTopping {
|
|
17
17
|
@PrimaryGeneratedColumn({
|
|
18
|
+
type: "int",
|
|
18
19
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
19
20
|
})
|
|
20
21
|
id: number;
|
|
@@ -29,6 +30,7 @@ export class ProductTopping {
|
|
|
29
30
|
|
|
30
31
|
@Column({
|
|
31
32
|
length: 50,
|
|
33
|
+
type: "varchar",
|
|
32
34
|
comment:
|
|
33
35
|
"El `name` se refiere al id de los archivos de lenguaje que está en `locales` del proyecto. \n\nEsto se hace para qué sirva el multilenguaje en el proyecto. \n\nCabe recalcar qué las empresas pueden crear sus propios toppings, entonces no pasa nada el lenguaje en el que ellos lo escriban.",
|
|
34
36
|
})
|
|
@@ -36,6 +38,8 @@ export class ProductTopping {
|
|
|
36
38
|
|
|
37
39
|
@Column({
|
|
38
40
|
default: 1,
|
|
41
|
+
type: "int",
|
|
42
|
+
width: 1,
|
|
39
43
|
comment:
|
|
40
44
|
"Estado del registro, es decir:\r\n1. Activo: Es visible en los reportes de inventario.\r\n0. Inactivo: No será visible en los reportes de inventario.",
|
|
41
45
|
})
|
package/src/entities/Region.ts
CHANGED
|
@@ -1,45 +1,48 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Entity,
|
|
3
2
|
Column,
|
|
4
|
-
|
|
5
|
-
ManyToOne,
|
|
3
|
+
Entity,
|
|
6
4
|
JoinColumn,
|
|
5
|
+
ManyToOne,
|
|
7
6
|
OneToMany,
|
|
8
|
-
|
|
9
|
-
} from
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
PrimaryGeneratedColumn,
|
|
8
|
+
} from "typeorm";
|
|
9
|
+
import { City } from "./City";
|
|
10
|
+
import { Country } from "./Country";
|
|
12
11
|
|
|
13
12
|
@Entity({
|
|
14
|
-
comment:
|
|
13
|
+
comment: "Regiones/departamentos donde estará visible la plataforma.",
|
|
15
14
|
})
|
|
16
15
|
export class Region {
|
|
17
16
|
@PrimaryGeneratedColumn({
|
|
18
|
-
|
|
17
|
+
type: "int",
|
|
18
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
19
19
|
})
|
|
20
|
-
id: number
|
|
20
|
+
id: number;
|
|
21
21
|
|
|
22
22
|
@ManyToOne(() => Country, (country) => country.regions, {
|
|
23
|
-
onDelete:
|
|
24
|
-
onUpdate:
|
|
23
|
+
onDelete: "RESTRICT",
|
|
24
|
+
onUpdate: "NO ACTION",
|
|
25
25
|
})
|
|
26
|
-
@JoinColumn({ name:
|
|
27
|
-
country: Country
|
|
26
|
+
@JoinColumn({ name: "country" })
|
|
27
|
+
country: Country;
|
|
28
28
|
|
|
29
29
|
@Column({
|
|
30
30
|
length: 50,
|
|
31
|
+
type: "varchar",
|
|
31
32
|
comment:
|
|
32
|
-
|
|
33
|
+
"Nombre de la región/departamento/estado.\r\n\r\nID/KEY de la variable que se encuentra en los archivos `locales` para el multilenguaje.",
|
|
33
34
|
})
|
|
34
|
-
name: string
|
|
35
|
+
name: string;
|
|
35
36
|
|
|
36
37
|
@Column({
|
|
37
38
|
default: 1,
|
|
39
|
+
type: "int",
|
|
40
|
+
width: 1,
|
|
38
41
|
comment:
|
|
39
|
-
|
|
42
|
+
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
40
43
|
})
|
|
41
|
-
status: number
|
|
44
|
+
status: number;
|
|
42
45
|
|
|
43
46
|
@OneToMany(() => City, (city) => city.region)
|
|
44
|
-
cities: City[]
|
|
47
|
+
cities: City[];
|
|
45
48
|
}
|
package/src/entities/Request.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { User } from "./User";
|
|
|
20
20
|
})
|
|
21
21
|
export class Request {
|
|
22
22
|
@PrimaryGeneratedColumn({
|
|
23
|
+
type: "int",
|
|
23
24
|
comment: "Número de identificación (ID) único de cada registro.",
|
|
24
25
|
})
|
|
25
26
|
id: number;
|
|
@@ -27,6 +28,7 @@ export class Request {
|
|
|
27
28
|
@Column({
|
|
28
29
|
length: 50,
|
|
29
30
|
unique: true,
|
|
31
|
+
type: "varchar",
|
|
30
32
|
comment:
|
|
31
33
|
"Código único de cada pedido.\r\nEste código servirá para filtrar por pedidos en la plataforma terminal, y si se va a pagar en efectivo, entonces puede dictar ese número o generar un código QR para leer y traer la información.",
|
|
32
34
|
})
|
|
@@ -50,6 +52,8 @@ export class Request {
|
|
|
50
52
|
|
|
51
53
|
@Column({
|
|
52
54
|
default: 1,
|
|
55
|
+
type: "int",
|
|
56
|
+
width: 1,
|
|
53
57
|
comment:
|
|
54
58
|
"Este campo hace referencia a si el tipo es:\r\n\r\n1. Individual: Un solo usuario ordena y paga.\r\n\r\n2. Grupal: El usuario principal puede agregar a otros colaboradores para realizar un pedido grupal (a tener en cuenta que el usuario principal es el único que puede realizar el pago del pedido).",
|
|
55
59
|
})
|
|
@@ -57,20 +61,26 @@ export class Request {
|
|
|
57
61
|
|
|
58
62
|
@Column({
|
|
59
63
|
default: 1,
|
|
64
|
+
type: "int",
|
|
65
|
+
width: 1,
|
|
60
66
|
comment:
|
|
61
67
|
"Puedo saber si el pedido es para:\r\n1. Comer en el establecimiento.\r\n2. Recoger para llevar.\r\n3. Para llevar.",
|
|
62
68
|
})
|
|
63
69
|
order_type: number;
|
|
64
70
|
|
|
65
71
|
@Column({
|
|
66
|
-
|
|
72
|
+
type: "decimal",
|
|
73
|
+
precision: 10,
|
|
74
|
+
scale: 2,
|
|
67
75
|
comment:
|
|
68
76
|
"Costo total del pedido, aquí toca tener en cuenta los productos (request_product) que se agreguen al pedido (request) y los complementos (request_product_group_complement).",
|
|
69
77
|
})
|
|
70
|
-
order_cost:
|
|
78
|
+
order_cost: number;
|
|
71
79
|
|
|
72
80
|
@Column({
|
|
73
81
|
default: 0,
|
|
82
|
+
type: "int",
|
|
83
|
+
width: 1,
|
|
74
84
|
comment:
|
|
75
85
|
"Estado en el que se encuentra un pedido.\r\n0. En proceso: El usuario está agregando los productos del/los local/es.\r\n1. Creado: El usuario ya creó el pedido con los prductos en los/el local/es especificado/s.\r\n2. Cancelado: El usuario canceló el pedido, esto sólo se permite si aún no está pago el pedido.\r\n3. Rechazado: Si un local canceló el pedido por x circustancias. Cabe resaltar que si el pedido fue solicitado a más de un local, el estado 3 sólo se agregaría al pedido si todos los locales cancelaron (Se tiene un estado para cada local en la tabla request_local) -> Aún no se sabe si este estado va.\r\n4. Finalizado: El pedido fue entregado y también pagado. Si el pedido se realizó en varios locales, entonces sólo se pasará a Finalizado, cuando todos los locales a los que se le hizo el pedido están pagos y con los productos entregados.",
|
|
76
86
|
})
|
|
@@ -78,6 +88,7 @@ export class Request {
|
|
|
78
88
|
|
|
79
89
|
@Column({
|
|
80
90
|
length: 400,
|
|
91
|
+
type: "varchar",
|
|
81
92
|
comment:
|
|
82
93
|
"Los detalles que el usuario agrega al pedido, puede ser alguna sugerencia u otra cosa.",
|
|
83
94
|
})
|
|
@@ -85,6 +96,7 @@ export class Request {
|
|
|
85
96
|
|
|
86
97
|
@Column({
|
|
87
98
|
length: 400,
|
|
99
|
+
type: "varchar",
|
|
88
100
|
comment: "Comentarios del pedido, este los realiza el cliente (local).",
|
|
89
101
|
})
|
|
90
102
|
comments: string;
|