test-entity-library-asm 3.2.9 → 3.2.11
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/BusinessType.d.ts +2 -2
- package/dist/entities/BusinessType.js +10 -8
- package/dist/entities/BusinessTypeProduct.d.ts +2 -2
- package/dist/entities/BusinessTypeProduct.js +2 -2
- package/dist/entities/Category.d.ts +6 -6
- package/dist/entities/Category.js +12 -6
- package/dist/entities/Company.d.ts +6 -6
- package/dist/entities/Company.js +3 -3
- package/dist/entities/Country.d.ts +1 -1
- package/dist/entities/DiscountCodeCompany.d.ts +8 -8
- package/dist/entities/DiscountCodeCompany.js +26 -24
- package/dist/entities/DiscountCodeUser.d.ts +9 -9
- package/dist/entities/DiscountCodeUser.js +35 -33
- package/dist/entities/Local.d.ts +2 -2
- package/dist/entities/Local.js +1 -1
- package/dist/entities/LocalPlan.d.ts +2 -2
- package/dist/entities/LocalPlan.js +18 -18
- package/dist/entities/LocalQualification.d.ts +3 -3
- package/dist/entities/LocalQualification.js +17 -12
- package/dist/entities/Master.d.ts +2 -2
- package/dist/entities/Master.js +1 -1
- package/dist/entities/MasterNotification.d.ts +4 -4
- package/dist/entities/MasterNotification.js +3 -3
- package/dist/entities/MasterRole.d.ts +1 -1
- package/dist/entities/MasterRole.js +1 -1
- package/dist/entities/Partner.d.ts +6 -5
- package/dist/entities/Partner.js +7 -3
- package/dist/entities/PartnerNotification.d.ts +4 -4
- package/dist/entities/PartnerNotification.js +3 -3
- package/dist/entities/PartnerPermission.d.ts +4 -4
- package/dist/entities/PartnerPermission.js +18 -18
- package/dist/entities/PartnerPermissionSection.d.ts +3 -3
- package/dist/entities/PartnerPermissionSection.js +13 -13
- package/dist/entities/PartnerPlatform.d.ts +3 -3
- package/dist/entities/PartnerPlatform.js +10 -10
- package/dist/entities/PartnerRole.d.ts +5 -5
- package/dist/entities/PartnerRole.js +22 -22
- package/dist/entities/PartnerSession.d.ts +1 -1
- package/dist/entities/PartnerSession.js +1 -4
- package/dist/entities/PaymentMethod.d.ts +4 -6
- package/dist/entities/PaymentMethod.js +11 -22
- package/dist/entities/Plan.d.ts +3 -3
- package/dist/entities/Plan.js +19 -14
- package/dist/entities/PosSystem.d.ts +2 -2
- package/dist/entities/PosSystem.js +12 -12
- package/dist/entities/Product.d.ts +5 -5
- package/dist/entities/Product.js +14 -5
- package/dist/entities/ProductTopping.d.ts +3 -3
- package/dist/entities/ProductTopping.js +9 -9
- package/dist/entities/Request.d.ts +2 -5
- package/dist/entities/Request.js +2 -18
- package/dist/entities/RequestLocal.d.ts +2 -1
- package/dist/entities/RequestLocal.js +4 -0
- package/dist/entities/RequestLocalHistory.d.ts +2 -2
- package/dist/entities/RequestLocalHistory.js +2 -2
- package/dist/entities/RequestLocalPayment.d.ts +19 -0
- package/dist/entities/RequestLocalPayment.js +159 -0
- package/dist/entities/ServicePlan.d.ts +4 -4
- package/dist/entities/ServicePlan.js +21 -23
- package/dist/entities/Square.d.ts +6 -6
- package/dist/entities/Square.js +18 -18
- package/dist/entities/ToppingImage.d.ts +1 -1
- package/dist/entities/ToppingImage.js +1 -1
- package/dist/entities/User.d.ts +7 -6
- package/dist/entities/User.js +22 -20
- package/dist/entities/UserAddress.d.ts +2 -2
- package/dist/entities/UserAddress.js +2 -3
- package/dist/entities/UserPaymentMethod.d.ts +17 -0
- package/dist/entities/UserPaymentMethod.js +118 -0
- package/dist/entities/VerifyLocal.d.ts +4 -4
- package/dist/entities/VerifyLocal.js +32 -32
- package/dist/entities/productGroupComplement.d.ts +5 -5
- package/dist/entities/productGroupComplement.js +3 -3
- package/dist/entities.views.routes.d.ts +2 -0
- package/dist/entities.views.routes.js +5 -1
- package/package.json +1 -1
- package/src/entities/BusinessType.ts +16 -15
- package/src/entities/BusinessTypeProduct.ts +2 -2
- package/src/entities/Category.ts +13 -7
- package/src/entities/Company.ts +8 -8
- package/src/entities/Country.ts +1 -1
- package/src/entities/DiscountCodeCompany.ts +43 -42
- package/src/entities/DiscountCodeUser.ts +52 -50
- package/src/entities/Local.ts +2 -15
- package/src/entities/LocalPlan.ts +31 -31
- package/src/entities/LocalQualification.ts +24 -25
- package/src/entities/Master.ts +2 -2
- package/src/entities/MasterNotification.ts +4 -4
- package/src/entities/MasterRole.ts +1 -1
- package/src/entities/Partner.ts +11 -4
- package/src/entities/PartnerNotification.ts +4 -4
- package/src/entities/PartnerPermission.ts +27 -27
- package/src/entities/PartnerPermissionSection.ts +21 -21
- package/src/entities/PartnerPlatform.ts +17 -17
- package/src/entities/PartnerRole.ts +30 -30
- package/src/entities/PartnerSession.ts +4 -11
- package/src/entities/PaymentMethod.ts +14 -21
- package/src/entities/Plan.ts +31 -26
- package/src/entities/PosSystem.ts +21 -21
- package/src/entities/Product.ts +16 -7
- package/src/entities/ProductTopping.ts +17 -17
- package/src/entities/Request.ts +3 -32
- package/src/entities/RequestLocal.ts +7 -1
- package/src/entities/RequestLocalHistory.ts +2 -2
- package/src/entities/RequestLocalPayment.ts +145 -0
- package/src/entities/ServicePlan.ts +40 -41
- package/src/entities/Square.ts +31 -31
- package/src/entities/ToppingImage.ts +1 -1
- package/src/entities/User.ts +26 -22
- package/src/entities/UserAddress.ts +2 -3
- package/src/entities/UserPaymentMethod.ts +99 -0
- package/src/entities/VerifyLocal.ts +51 -51
- package/src/entities/productGroupComplement.ts +5 -5
- package/src/entities.views.routes.ts +2 -0
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
PrimaryColumn,
|
|
8
8
|
} from "typeorm";
|
|
9
9
|
import { Local } from "./Local";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { RequestLocalPayment } from "..";
|
|
11
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
12
12
|
|
|
13
13
|
@Entity("payment_method", {
|
|
14
14
|
comment:
|
|
@@ -33,7 +33,7 @@ export class PaymentMethod {
|
|
|
33
33
|
comment:
|
|
34
34
|
"Descripción del estado, este campo debe tener el id/key de cada lenguaje. \r\n\r\nVer la carpeta locales del proyecto frontend para ver el id de cada tipo de elemento.",
|
|
35
35
|
})
|
|
36
|
-
description: string;
|
|
36
|
+
description: string | null;
|
|
37
37
|
|
|
38
38
|
@Column({
|
|
39
39
|
type: "longtext",
|
|
@@ -41,9 +41,13 @@ export class PaymentMethod {
|
|
|
41
41
|
comment:
|
|
42
42
|
"Campo de tipo JSON donde se pueden agregar columnas u otros elementos que sean necesarios.",
|
|
43
43
|
})
|
|
44
|
-
settings: string;
|
|
44
|
+
settings: string | null;
|
|
45
45
|
|
|
46
|
-
@Column({
|
|
46
|
+
@Column({
|
|
47
|
+
type: "datetime",
|
|
48
|
+
transformer: new DateTransformer(),
|
|
49
|
+
comment: "Fecha de creación del registro.",
|
|
50
|
+
})
|
|
47
51
|
created: Date;
|
|
48
52
|
|
|
49
53
|
@Column({
|
|
@@ -67,20 +71,9 @@ export class PaymentMethod {
|
|
|
67
71
|
})
|
|
68
72
|
locals: Local[];
|
|
69
73
|
|
|
70
|
-
@OneToMany(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
name: "user_payment_method",
|
|
76
|
-
joinColumn: {
|
|
77
|
-
name: "payment_method",
|
|
78
|
-
referencedColumnName: "id",
|
|
79
|
-
},
|
|
80
|
-
inverseJoinColumn: {
|
|
81
|
-
name: "user",
|
|
82
|
-
referencedColumnName: "id",
|
|
83
|
-
},
|
|
84
|
-
})
|
|
85
|
-
user_payments_method: User[];
|
|
74
|
+
@OneToMany(
|
|
75
|
+
() => RequestLocalPayment,
|
|
76
|
+
(requestLocalPayment) => requestLocalPayment.payment_method
|
|
77
|
+
)
|
|
78
|
+
payment_methods: RequestLocalPayment[];
|
|
86
79
|
}
|
package/src/entities/Plan.ts
CHANGED
|
@@ -5,62 +5,67 @@ import {
|
|
|
5
5
|
ManyToOne,
|
|
6
6
|
OneToMany,
|
|
7
7
|
PrimaryGeneratedColumn,
|
|
8
|
-
} from
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
} from "typeorm";
|
|
9
|
+
import { LocalPlan } from "..";
|
|
10
|
+
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
11
|
+
import { Company } from "./Company";
|
|
12
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
12
13
|
|
|
13
14
|
@Entity({
|
|
14
|
-
comment:
|
|
15
|
+
comment: "Planes que tendrá la plataforma para las empresas (company)",
|
|
15
16
|
})
|
|
16
17
|
export class Plan {
|
|
17
18
|
@PrimaryGeneratedColumn({
|
|
18
|
-
comment:
|
|
19
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
19
20
|
})
|
|
20
|
-
id: number
|
|
21
|
+
id: number;
|
|
21
22
|
|
|
22
|
-
@Column({ length: 20, unique: true, comment:
|
|
23
|
-
code: string
|
|
23
|
+
@Column({ length: 20, unique: true, comment: "Código del plan." })
|
|
24
|
+
code: string;
|
|
24
25
|
|
|
25
26
|
@ManyToOne(() => Company, (company) => company.plans_company, {
|
|
26
|
-
onDelete:
|
|
27
|
-
onUpdate:
|
|
27
|
+
onDelete: "CASCADE",
|
|
28
|
+
onUpdate: "NO ACTION",
|
|
28
29
|
})
|
|
29
|
-
@JoinColumn({ name:
|
|
30
|
-
company: Company
|
|
30
|
+
@JoinColumn({ name: "company" })
|
|
31
|
+
company: Company;
|
|
31
32
|
|
|
32
33
|
@Column({
|
|
33
34
|
length: 50,
|
|
34
35
|
comment:
|
|
35
|
-
|
|
36
|
+
"Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
|
|
36
37
|
})
|
|
37
|
-
name: string
|
|
38
|
+
name: string;
|
|
38
39
|
|
|
39
40
|
@Column({
|
|
40
|
-
type:
|
|
41
|
+
type: "mediumtext",
|
|
41
42
|
transformer: jsonTransformer,
|
|
42
43
|
nullable: true,
|
|
43
44
|
comment:
|
|
44
|
-
|
|
45
|
+
"Campo de tipo JSON donde se guarda información necesaria para el plan",
|
|
45
46
|
})
|
|
46
|
-
description: string
|
|
47
|
+
description: string | null;
|
|
47
48
|
|
|
48
49
|
@Column()
|
|
49
|
-
quantity_locals: number
|
|
50
|
+
quantity_locals: number;
|
|
50
51
|
|
|
51
|
-
@Column({
|
|
52
|
-
|
|
52
|
+
@Column({
|
|
53
|
+
type: "datetime",
|
|
54
|
+
transformer: new DateTransformer(),
|
|
55
|
+
comment: "Fecha de creación del registro.",
|
|
56
|
+
})
|
|
57
|
+
created: Date;
|
|
53
58
|
|
|
54
|
-
@Column({ type:
|
|
55
|
-
expiration: Date
|
|
59
|
+
@Column({ type: "date", comment: "Fecha de expiración del registro." })
|
|
60
|
+
expiration: Date;
|
|
56
61
|
|
|
57
62
|
@Column({
|
|
58
63
|
default: 1,
|
|
59
64
|
comment:
|
|
60
|
-
|
|
65
|
+
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
61
66
|
})
|
|
62
|
-
status: number
|
|
67
|
+
status: number;
|
|
63
68
|
|
|
64
69
|
@OneToMany(() => LocalPlan, (localPlan) => localPlan.plan)
|
|
65
|
-
local_plans: LocalPlan[]
|
|
70
|
+
local_plans: LocalPlan[];
|
|
66
71
|
}
|
|
@@ -5,59 +5,59 @@ import {
|
|
|
5
5
|
ManyToOne,
|
|
6
6
|
OneToMany,
|
|
7
7
|
PrimaryGeneratedColumn,
|
|
8
|
-
} from
|
|
9
|
-
import { AuthenticationCredential, Local } from
|
|
8
|
+
} from "typeorm";
|
|
9
|
+
import { AuthenticationCredential, Local } from "..";
|
|
10
10
|
|
|
11
11
|
@Entity({
|
|
12
|
-
name:
|
|
12
|
+
name: "pos_system",
|
|
13
13
|
comment:
|
|
14
|
-
|
|
14
|
+
"Tabla creada para almacenar los sistemas POS que se quieran enlazar con nuestro sistema y así tener una integración más completa.",
|
|
15
15
|
})
|
|
16
16
|
export class PosSystem {
|
|
17
17
|
@PrimaryGeneratedColumn({
|
|
18
|
-
comment:
|
|
18
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
19
19
|
})
|
|
20
|
-
id: number
|
|
20
|
+
id: number;
|
|
21
21
|
|
|
22
|
-
@Column({ length: 50, comment:
|
|
23
|
-
name: string
|
|
22
|
+
@Column({ length: 50, comment: "Nombre del registro." })
|
|
23
|
+
name: string;
|
|
24
24
|
|
|
25
|
-
@Column({ length: 300, nullable: true, comment:
|
|
26
|
-
description: string
|
|
25
|
+
@Column({ length: 300, nullable: true, comment: "Descripción del registro." })
|
|
26
|
+
description: string | null;
|
|
27
27
|
|
|
28
28
|
@Column({
|
|
29
|
-
type:
|
|
29
|
+
type: "text",
|
|
30
30
|
comment:
|
|
31
31
|
'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
32
|
})
|
|
33
|
-
endpoint_products: string
|
|
33
|
+
endpoint_products: string;
|
|
34
34
|
|
|
35
35
|
@Column({
|
|
36
|
-
type:
|
|
36
|
+
type: "text",
|
|
37
37
|
comment:
|
|
38
38
|
'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
39
|
})
|
|
40
|
-
endpoint_order: string
|
|
40
|
+
endpoint_order: string;
|
|
41
41
|
|
|
42
42
|
@ManyToOne(
|
|
43
43
|
() => AuthenticationCredential,
|
|
44
44
|
(authenticationCredential) =>
|
|
45
45
|
authenticationCredential.authenticationCredentials,
|
|
46
46
|
{
|
|
47
|
-
onDelete:
|
|
48
|
-
onUpdate:
|
|
47
|
+
onDelete: "RESTRICT",
|
|
48
|
+
onUpdate: "NO ACTION",
|
|
49
49
|
}
|
|
50
50
|
)
|
|
51
|
-
@JoinColumn({ name:
|
|
52
|
-
authentication_credentials: AuthenticationCredential
|
|
51
|
+
@JoinColumn({ name: "authentication_credentials" })
|
|
52
|
+
authentication_credentials: AuthenticationCredential;
|
|
53
53
|
|
|
54
54
|
@Column({
|
|
55
55
|
default: 1,
|
|
56
56
|
comment:
|
|
57
|
-
|
|
57
|
+
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
58
58
|
})
|
|
59
|
-
status: number
|
|
59
|
+
status: number;
|
|
60
60
|
|
|
61
61
|
@OneToMany(() => Local, (local) => local.pos_system)
|
|
62
|
-
locals_pos_system: Local[]
|
|
62
|
+
locals_pos_system: Local[];
|
|
63
63
|
}
|
package/src/entities/Product.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { RequestProduct } from "./RequestProduct";
|
|
|
15
15
|
import { User } from "./User";
|
|
16
16
|
import { Partner, ProductDate, ProductSchedule } from "..";
|
|
17
17
|
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
18
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
18
19
|
|
|
19
20
|
@Entity({
|
|
20
21
|
comment:
|
|
@@ -67,7 +68,7 @@ export class Product {
|
|
|
67
68
|
transformer: jsonTransformer,
|
|
68
69
|
comment: "Campo de tipo json para guardar el id y la url de la foto",
|
|
69
70
|
})
|
|
70
|
-
photo: any;
|
|
71
|
+
photo: any | null;
|
|
71
72
|
|
|
72
73
|
@Column({
|
|
73
74
|
type: "mediumtext",
|
|
@@ -75,7 +76,7 @@ export class Product {
|
|
|
75
76
|
comment:
|
|
76
77
|
"Campo de tipo JSON donde se guarda información necesaria para el registro.",
|
|
77
78
|
})
|
|
78
|
-
additional_information: string;
|
|
79
|
+
additional_information: string | null;
|
|
79
80
|
|
|
80
81
|
@Column({
|
|
81
82
|
nullable: true,
|
|
@@ -83,7 +84,7 @@ export class Product {
|
|
|
83
84
|
"Campo para saber el tipo de horario que se va a mostrar en la aplicación:\n 1. Días. \n2. Fecha específica.",
|
|
84
85
|
default: null,
|
|
85
86
|
})
|
|
86
|
-
type_sales_hours: number;
|
|
87
|
+
type_sales_hours: number | null;
|
|
87
88
|
|
|
88
89
|
@ManyToOne(() => Partner, (partner) => partner.partners_created_by, {
|
|
89
90
|
onDelete: "RESTRICT",
|
|
@@ -92,10 +93,18 @@ export class Product {
|
|
|
92
93
|
@JoinColumn({ name: "created_by" })
|
|
93
94
|
created_by: Partner;
|
|
94
95
|
|
|
95
|
-
@Column({
|
|
96
|
+
@Column({
|
|
97
|
+
type: "datetime",
|
|
98
|
+
transformer: new DateTransformer(),
|
|
99
|
+
comment: "Fecha de creación del registro.",
|
|
100
|
+
})
|
|
96
101
|
created: Date;
|
|
97
102
|
|
|
98
|
-
@Column({
|
|
103
|
+
@Column({
|
|
104
|
+
type: "datetime",
|
|
105
|
+
transformer: new DateTransformer(),
|
|
106
|
+
comment: "Fecha de actualización del registro.",
|
|
107
|
+
})
|
|
99
108
|
updated: Date;
|
|
100
109
|
|
|
101
110
|
@ManyToOne(() => Partner, (partner) => partner.partners_update_by, {
|
|
@@ -112,7 +121,7 @@ export class Product {
|
|
|
112
121
|
comment:
|
|
113
122
|
"Valores qué se van a mostrar mientras se aprueban los nuevos cambios.",
|
|
114
123
|
})
|
|
115
|
-
current_values: any;
|
|
124
|
+
current_values: any | null;
|
|
116
125
|
|
|
117
126
|
@Column({
|
|
118
127
|
default: 1,
|
|
@@ -133,7 +142,7 @@ export class Product {
|
|
|
133
142
|
length: 600,
|
|
134
143
|
comment: "Comentarios u observaciones de la revisión.",
|
|
135
144
|
})
|
|
136
|
-
review_comment: string;
|
|
145
|
+
review_comment: string | null;
|
|
137
146
|
|
|
138
147
|
@OneToMany(() => ProductGroup, (productGroup) => productGroup.product)
|
|
139
148
|
product_groups: ProductGroup[];
|
|
@@ -4,43 +4,43 @@ import {
|
|
|
4
4
|
JoinColumn,
|
|
5
5
|
ManyToOne,
|
|
6
6
|
OneToMany,
|
|
7
|
-
PrimaryGeneratedColumn
|
|
8
|
-
} from
|
|
9
|
-
import { Company } from
|
|
10
|
-
import { ProductGroup } from
|
|
7
|
+
PrimaryGeneratedColumn,
|
|
8
|
+
} from "typeorm";
|
|
9
|
+
import { Company } from "./Company";
|
|
10
|
+
import { ProductGroup } from "./ProductGroup";
|
|
11
11
|
|
|
12
|
-
@Entity(
|
|
12
|
+
@Entity("product_topping", {
|
|
13
13
|
comment:
|
|
14
|
-
|
|
14
|
+
"Tabla donde habrán varios toppings por defecto para que el usuario los pueda agregar a sus productos y editarlos a su gusto.\r\n\r\nUn administrador/usuario con permisos podrá crear los toppings para cada empresa si es necesario.",
|
|
15
15
|
})
|
|
16
16
|
export class ProductTopping {
|
|
17
17
|
@PrimaryGeneratedColumn({
|
|
18
|
-
comment:
|
|
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(() => Company, (company) => company.product_toppings, {
|
|
23
23
|
nullable: true,
|
|
24
|
-
onDelete:
|
|
25
|
-
onUpdate:
|
|
24
|
+
onDelete: "CASCADE",
|
|
25
|
+
onUpdate: "NO ACTION",
|
|
26
26
|
})
|
|
27
|
-
@JoinColumn({ name:
|
|
28
|
-
company: Company
|
|
27
|
+
@JoinColumn({ name: "company" })
|
|
28
|
+
company: Company | null;
|
|
29
29
|
|
|
30
30
|
@Column({
|
|
31
31
|
length: 50,
|
|
32
32
|
comment:
|
|
33
|
-
|
|
33
|
+
"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
34
|
})
|
|
35
|
-
name: string
|
|
35
|
+
name: string;
|
|
36
36
|
|
|
37
37
|
@Column({
|
|
38
38
|
default: 1,
|
|
39
39
|
comment:
|
|
40
|
-
|
|
40
|
+
"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
41
|
})
|
|
42
|
-
status: number
|
|
42
|
+
status: number;
|
|
43
43
|
|
|
44
44
|
@OneToMany(() => ProductGroup, (productGroup) => productGroup.topping)
|
|
45
|
-
product_groups: ProductGroup[]
|
|
45
|
+
product_groups: ProductGroup[];
|
|
46
46
|
}
|
package/src/entities/Request.ts
CHANGED
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
} from "typeorm";
|
|
11
11
|
import { RequestLocal, UserAddress } from "..";
|
|
12
12
|
import { DateTransformer } from "../transformers/dateTransformer";
|
|
13
|
-
import { PaymentMethod } from "./PaymentMethod";
|
|
14
13
|
import { RequestProduct } from "./RequestProduct";
|
|
15
14
|
import { RequestProductGroupComplement } from "./RequestProductGroupComplement";
|
|
16
15
|
import { User } from "./User";
|
|
@@ -39,7 +38,7 @@ export class Request {
|
|
|
39
38
|
onUpdate: "NO ACTION",
|
|
40
39
|
})
|
|
41
40
|
@JoinColumn({ name: "user" })
|
|
42
|
-
user: User;
|
|
41
|
+
user: User | null;
|
|
43
42
|
|
|
44
43
|
@ManyToOne(() => UserAddress, (userAddress) => userAddress.requests, {
|
|
45
44
|
nullable: true,
|
|
@@ -63,13 +62,6 @@ export class Request {
|
|
|
63
62
|
})
|
|
64
63
|
order_type: number;
|
|
65
64
|
|
|
66
|
-
@ManyToOne(() => PaymentMethod, (paymentMethod) => paymentMethod.requests, {
|
|
67
|
-
onDelete: "RESTRICT",
|
|
68
|
-
onUpdate: "NO ACTION",
|
|
69
|
-
})
|
|
70
|
-
@JoinColumn({ name: "payment_method" })
|
|
71
|
-
payment_method: PaymentMethod;
|
|
72
|
-
|
|
73
65
|
@Column({
|
|
74
66
|
length: 30,
|
|
75
67
|
comment:
|
|
@@ -77,14 +69,6 @@ export class Request {
|
|
|
77
69
|
})
|
|
78
70
|
order_cost: string;
|
|
79
71
|
|
|
80
|
-
// !: Esta columna debería borrarse ya que ahora debería manejarse con otras tablas y eso.
|
|
81
|
-
@Column({
|
|
82
|
-
default: 0,
|
|
83
|
-
comment:
|
|
84
|
-
"Me indica si el pedido ya está pago o falta por pagar:\r\n0. No pagado.\r\n1. Pagado.",
|
|
85
|
-
})
|
|
86
|
-
paid_status: number;
|
|
87
|
-
|
|
88
72
|
@Column({
|
|
89
73
|
default: 0,
|
|
90
74
|
comment:
|
|
@@ -120,21 +104,8 @@ export class Request {
|
|
|
120
104
|
comment:
|
|
121
105
|
"Fecha en la que el cliente final hace la última actualización del pedido.",
|
|
122
106
|
})
|
|
123
|
-
updated: Date;
|
|
124
|
-
|
|
125
|
-
// @ManyToMany(() => Local, (local) => local.requests_local)
|
|
126
|
-
// @JoinTable({
|
|
127
|
-
// name: "request_local",
|
|
128
|
-
// joinColumn: {
|
|
129
|
-
// name: "request",
|
|
130
|
-
// referencedColumnName: "id",
|
|
131
|
-
// },
|
|
132
|
-
// inverseJoinColumn: {
|
|
133
|
-
// name: "local",
|
|
134
|
-
// referencedColumnName: "id",
|
|
135
|
-
// },
|
|
136
|
-
// })
|
|
137
|
-
// requests_local: Local[];
|
|
107
|
+
updated: Date | null;
|
|
108
|
+
|
|
138
109
|
@OneToMany(() => RequestLocal, (requestLocal) => requestLocal.request)
|
|
139
110
|
requests_local: RequestLocal[];
|
|
140
111
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
OneToMany,
|
|
7
7
|
PrimaryGeneratedColumn,
|
|
8
8
|
} from "typeorm";
|
|
9
|
-
import { Local, Request, RequestLocalHistory } from "..";
|
|
9
|
+
import { Local, Request, RequestLocalHistory, RequestLocalPayment } from "..";
|
|
10
10
|
import { DateTransformer } from "../transformers/dateTransformer";
|
|
11
11
|
|
|
12
12
|
@Entity({
|
|
@@ -72,4 +72,10 @@ export class RequestLocal {
|
|
|
72
72
|
(requestLocalHistory) => requestLocalHistory.request_local
|
|
73
73
|
)
|
|
74
74
|
requests_local_history: RequestLocalHistory[];
|
|
75
|
+
|
|
76
|
+
@OneToMany(
|
|
77
|
+
() => RequestLocalPayment,
|
|
78
|
+
(requestLocalPayment) => requestLocalPayment.request_local
|
|
79
|
+
)
|
|
80
|
+
payments_made: RequestLocalPayment[];
|
|
75
81
|
}
|
|
@@ -38,7 +38,7 @@ export class RequestLocalHistory {
|
|
|
38
38
|
nullable: true,
|
|
39
39
|
comment: "Comentarios del cambio de estado del registro.",
|
|
40
40
|
})
|
|
41
|
-
comment: string;
|
|
41
|
+
comment: string | null;
|
|
42
42
|
|
|
43
43
|
@ManyToOne(() => Partner, (partner) => partner.updated_by_history, {
|
|
44
44
|
onDelete: "CASCADE",
|
|
@@ -46,7 +46,7 @@ export class RequestLocalHistory {
|
|
|
46
46
|
nullable: true,
|
|
47
47
|
})
|
|
48
48
|
@JoinColumn({ name: "updated_by" })
|
|
49
|
-
updated_by: Partner;
|
|
49
|
+
updated_by: Partner | null;
|
|
50
50
|
|
|
51
51
|
@Column({
|
|
52
52
|
type: "datetime",
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Column,
|
|
3
|
+
Entity,
|
|
4
|
+
JoinColumn,
|
|
5
|
+
ManyToOne,
|
|
6
|
+
PrimaryGeneratedColumn,
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import {
|
|
9
|
+
Partner,
|
|
10
|
+
PaymentMethod,
|
|
11
|
+
RequestLocal,
|
|
12
|
+
User,
|
|
13
|
+
UserPaymentMethod,
|
|
14
|
+
} from "..";
|
|
15
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
16
|
+
|
|
17
|
+
@Entity({
|
|
18
|
+
comment:
|
|
19
|
+
"Tabla creada para almacenar y llevar el control del los pagos que se han realizado de los pedidos.",
|
|
20
|
+
name: "request_local_payment",
|
|
21
|
+
})
|
|
22
|
+
export class RequestLocalPayment {
|
|
23
|
+
@PrimaryGeneratedColumn({
|
|
24
|
+
comment: "ID único de cada registro.",
|
|
25
|
+
})
|
|
26
|
+
id: number;
|
|
27
|
+
|
|
28
|
+
@Column({
|
|
29
|
+
length: 40,
|
|
30
|
+
unique: true,
|
|
31
|
+
comment: "Código único de cada pago que se realiza.",
|
|
32
|
+
})
|
|
33
|
+
code: string;
|
|
34
|
+
|
|
35
|
+
@ManyToOne(() => User, (user) => user.payments_made, {
|
|
36
|
+
onDelete: "NO ACTION",
|
|
37
|
+
onUpdate: "NO ACTION",
|
|
38
|
+
nullable: true,
|
|
39
|
+
})
|
|
40
|
+
@JoinColumn({ name: "user" })
|
|
41
|
+
user: User | null;
|
|
42
|
+
|
|
43
|
+
@ManyToOne(() => RequestLocal, (requestLocal) => requestLocal.payments_made, {
|
|
44
|
+
onDelete: "NO ACTION",
|
|
45
|
+
onUpdate: "NO ACTION",
|
|
46
|
+
})
|
|
47
|
+
@JoinColumn({ name: "request_local" })
|
|
48
|
+
request_local: RequestLocal;
|
|
49
|
+
|
|
50
|
+
@ManyToOne(
|
|
51
|
+
() => PaymentMethod,
|
|
52
|
+
(paymentMethod) => paymentMethod.payment_methods,
|
|
53
|
+
{
|
|
54
|
+
onDelete: "NO ACTION",
|
|
55
|
+
onUpdate: "NO ACTION",
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
@JoinColumn({ name: "payment_method" })
|
|
59
|
+
payment_method: PaymentMethod;
|
|
60
|
+
|
|
61
|
+
@Column({
|
|
62
|
+
type: "decimal",
|
|
63
|
+
precision: 10,
|
|
64
|
+
scale: 2,
|
|
65
|
+
comment: "Monto que se paga del pedido.",
|
|
66
|
+
})
|
|
67
|
+
amount_paid: number;
|
|
68
|
+
|
|
69
|
+
@Column({
|
|
70
|
+
type: "decimal",
|
|
71
|
+
precision: 10,
|
|
72
|
+
scale: 2,
|
|
73
|
+
comment: "Monto restante para pagar.",
|
|
74
|
+
})
|
|
75
|
+
remaining_amount: number;
|
|
76
|
+
|
|
77
|
+
@Column({
|
|
78
|
+
length: 4,
|
|
79
|
+
nullable: true,
|
|
80
|
+
comment:
|
|
81
|
+
"Si se paga con tarjeta, entonces se almacenan los últimos 4 dígitos de la tarjeta de crédito/débito con el que se paga.",
|
|
82
|
+
})
|
|
83
|
+
card_last_four_digits: string | null;
|
|
84
|
+
|
|
85
|
+
@Column({
|
|
86
|
+
length: 50,
|
|
87
|
+
nullable: true,
|
|
88
|
+
comment:
|
|
89
|
+
"Si se paga con tarjeta, entonces se guarda el tipo de tarjeta con la que se paga.",
|
|
90
|
+
})
|
|
91
|
+
card_type: string | null;
|
|
92
|
+
|
|
93
|
+
@ManyToOne(() => UserPaymentMethod, (card) => card.cards, {
|
|
94
|
+
onDelete: "NO ACTION",
|
|
95
|
+
onUpdate: "NO ACTION",
|
|
96
|
+
nullable: true,
|
|
97
|
+
})
|
|
98
|
+
@JoinColumn({ name: "card" })
|
|
99
|
+
card: UserPaymentMethod | null;
|
|
100
|
+
|
|
101
|
+
@Column({
|
|
102
|
+
length: 255,
|
|
103
|
+
nullable: true,
|
|
104
|
+
comment: "Comentarios del pago, si aplica.",
|
|
105
|
+
})
|
|
106
|
+
comments: string | null;
|
|
107
|
+
|
|
108
|
+
@Column({
|
|
109
|
+
length: 1,
|
|
110
|
+
comment:
|
|
111
|
+
"Estado del pago:\r\n1. Aprobado.\r\n2. Rechazado.\r\n3. Pendiente.",
|
|
112
|
+
default: 3,
|
|
113
|
+
})
|
|
114
|
+
status: number;
|
|
115
|
+
|
|
116
|
+
@Column({
|
|
117
|
+
type: "datetime",
|
|
118
|
+
transformer: new DateTransformer(),
|
|
119
|
+
comment: "Fecha de creación del registro.",
|
|
120
|
+
})
|
|
121
|
+
created: Date;
|
|
122
|
+
|
|
123
|
+
@Column({
|
|
124
|
+
type: "datetime",
|
|
125
|
+
nullable: true,
|
|
126
|
+
transformer: new DateTransformer(),
|
|
127
|
+
comment: "Fecha de actualización del registro.",
|
|
128
|
+
})
|
|
129
|
+
updated: Date | null;
|
|
130
|
+
|
|
131
|
+
@ManyToOne(() => Partner, (partner) => partner.requests_local_payment, {
|
|
132
|
+
onDelete: "CASCADE",
|
|
133
|
+
onUpdate: "NO ACTION",
|
|
134
|
+
nullable: true,
|
|
135
|
+
})
|
|
136
|
+
@JoinColumn({ name: "partner" })
|
|
137
|
+
partner: Partner | null;
|
|
138
|
+
|
|
139
|
+
@Column({
|
|
140
|
+
length: 45,
|
|
141
|
+
nullable: true,
|
|
142
|
+
comment: "Dirección ip donde se hace la solicitud del pago.",
|
|
143
|
+
})
|
|
144
|
+
user_ip: string | null;
|
|
145
|
+
}
|