test-entity-library-asm 3.1.8 → 3.2.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/BusinessTypeProduct.d.ts +2 -2
- package/dist/entities/BusinessTypeProduct.js +15 -15
- package/dist/entities/Local.d.ts +2 -3
- package/dist/entities/Local.js +37 -10
- package/dist/entities/Master.js +4 -4
- package/dist/entities/MasterNotification.js +9 -1
- package/dist/entities/MasterPermission.d.ts +1 -1
- package/dist/entities/MasterPermission.js +17 -9
- package/dist/entities/MasterRole.d.ts +2 -2
- package/dist/entities/MasterRole.js +17 -17
- package/dist/entities/Partner.js +4 -4
- package/dist/entities/PartnerNotification.js +9 -1
- package/dist/entities/PaymentMethod.d.ts +3 -3
- package/dist/entities/PaymentMethod.js +25 -17
- package/dist/entities/Product.js +9 -1
- package/dist/entities/Request.d.ts +11 -7
- package/dist/entities/Request.js +68 -28
- package/dist/entities/Square.js +10 -2
- package/dist/entities/User.d.ts +11 -11
- package/dist/entities/User.js +52 -44
- package/package.json +1 -1
- package/src/entities/BusinessTypeProduct.ts +24 -24
- package/src/entities/Local.ts +40 -10
- package/src/entities/Master.ts +8 -9
- package/src/entities/MasterNotification.ts +9 -1
- package/src/entities/MasterPermission.ts +25 -17
- package/src/entities/MasterRole.ts +30 -27
- package/src/entities/Partner.ts +7 -4
- package/src/entities/PartnerNotification.ts +9 -1
- package/src/entities/PaymentMethod.ts +38 -30
- package/src/entities/Product.ts +9 -1
- package/src/entities/Request.ts +85 -45
- package/src/entities/Square.ts +11 -3
- package/src/entities/User.ts +93 -83
package/src/entities/Master.ts
CHANGED
|
@@ -8,11 +8,7 @@ import {
|
|
|
8
8
|
OneToMany,
|
|
9
9
|
PrimaryGeneratedColumn,
|
|
10
10
|
} from "typeorm";
|
|
11
|
-
import {
|
|
12
|
-
MasterNotification,
|
|
13
|
-
PartnerNotification,
|
|
14
|
-
VerifyLocal
|
|
15
|
-
} from "..";
|
|
11
|
+
import { MasterNotification, PartnerNotification, VerifyLocal } from "..";
|
|
16
12
|
import { DateTransformer } from "../transformers/dateTransformer";
|
|
17
13
|
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
18
14
|
import { City } from "./City";
|
|
@@ -118,7 +114,7 @@ export class Master {
|
|
|
118
114
|
)
|
|
119
115
|
discount_code_companies: DiscountCodeCompany[];
|
|
120
116
|
|
|
121
|
-
@ManyToMany(() => MasterRole)
|
|
117
|
+
@ManyToMany(() => MasterRole, (masterRole) => masterRole.masters_roles)
|
|
122
118
|
@JoinTable({
|
|
123
119
|
name: "master_assigned_role",
|
|
124
120
|
joinColumn: {
|
|
@@ -141,15 +137,18 @@ export class Master {
|
|
|
141
137
|
)
|
|
142
138
|
master_notifications: MasterNotification[];
|
|
143
139
|
|
|
144
|
-
@ManyToMany(
|
|
140
|
+
@ManyToMany(
|
|
141
|
+
() => MasterNotification,
|
|
142
|
+
(masterNotification) => masterNotification.master_to_notifications
|
|
143
|
+
)
|
|
145
144
|
@JoinTable({
|
|
146
145
|
name: "master_to_notification",
|
|
147
146
|
joinColumn: {
|
|
148
|
-
name: "
|
|
147
|
+
name: "master",
|
|
149
148
|
referencedColumnName: "id",
|
|
150
149
|
},
|
|
151
150
|
inverseJoinColumn: {
|
|
152
|
-
name: "
|
|
151
|
+
name: "master_notification",
|
|
153
152
|
referencedColumnName: "id",
|
|
154
153
|
},
|
|
155
154
|
})
|
|
@@ -73,9 +73,17 @@ export class MasterNotification {
|
|
|
73
73
|
})
|
|
74
74
|
created: Date;
|
|
75
75
|
|
|
76
|
-
@ManyToMany(() => Master)
|
|
76
|
+
@ManyToMany(() => Master, (master) => master.masters_to_notification)
|
|
77
77
|
@JoinTable({
|
|
78
78
|
name: "master_to_notification",
|
|
79
|
+
joinColumn: {
|
|
80
|
+
name: "master_notification",
|
|
81
|
+
referencedColumnName: "id",
|
|
82
|
+
},
|
|
83
|
+
inverseJoinColumn: {
|
|
84
|
+
name: "master",
|
|
85
|
+
referencedColumnName: "id",
|
|
86
|
+
},
|
|
79
87
|
})
|
|
80
88
|
master_to_notifications: Master[];
|
|
81
89
|
}
|
|
@@ -4,46 +4,54 @@ import {
|
|
|
4
4
|
JoinTable,
|
|
5
5
|
ManyToMany,
|
|
6
6
|
PrimaryGeneratedColumn,
|
|
7
|
-
} from
|
|
8
|
-
import { MasterRole } from
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import { MasterRole } from "./MasterRole";
|
|
9
9
|
|
|
10
|
-
@Entity(
|
|
10
|
+
@Entity("master_permission", {
|
|
11
11
|
comment:
|
|
12
|
-
|
|
12
|
+
"Permisos que estarán disponibles en la plataforma para los usuarios (masters).",
|
|
13
13
|
})
|
|
14
14
|
export class MasterPermission {
|
|
15
15
|
@PrimaryGeneratedColumn({
|
|
16
|
-
comment:
|
|
16
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
17
17
|
})
|
|
18
|
-
id: number
|
|
18
|
+
id: number;
|
|
19
19
|
|
|
20
|
-
@Column({ length: 10, unique: true, comment:
|
|
21
|
-
code: string
|
|
20
|
+
@Column({ length: 10, unique: true, comment: "Código del permiso." })
|
|
21
|
+
code: string;
|
|
22
22
|
|
|
23
23
|
@Column({
|
|
24
24
|
length: 40,
|
|
25
25
|
comment:
|
|
26
|
-
|
|
26
|
+
"Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
|
|
27
27
|
})
|
|
28
|
-
name: string
|
|
28
|
+
name: string;
|
|
29
29
|
|
|
30
30
|
@Column({
|
|
31
31
|
length: 40,
|
|
32
32
|
comment:
|
|
33
|
-
|
|
33
|
+
"Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
|
|
34
34
|
})
|
|
35
|
-
description: string
|
|
35
|
+
description: 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 la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
41
41
|
})
|
|
42
|
-
status: number
|
|
42
|
+
status: number;
|
|
43
43
|
|
|
44
|
-
@ManyToMany(() => MasterRole)
|
|
44
|
+
@ManyToMany(() => MasterRole, (masterRole) => masterRole.roles_permissions)
|
|
45
45
|
@JoinTable({
|
|
46
|
-
name:
|
|
46
|
+
name: "master_role_permission",
|
|
47
|
+
joinColumn: {
|
|
48
|
+
name: "permission",
|
|
49
|
+
referencedColumnName: "id",
|
|
50
|
+
},
|
|
51
|
+
inverseJoinColumn: {
|
|
52
|
+
name: "role",
|
|
53
|
+
referencedColumnName: "id",
|
|
54
|
+
},
|
|
47
55
|
})
|
|
48
|
-
roles: MasterRole[]
|
|
56
|
+
roles: MasterRole[];
|
|
49
57
|
}
|
|
@@ -4,29 +4,29 @@ import {
|
|
|
4
4
|
JoinTable,
|
|
5
5
|
ManyToMany,
|
|
6
6
|
PrimaryGeneratedColumn,
|
|
7
|
-
} from
|
|
8
|
-
import { Master } from
|
|
9
|
-
import { MasterPermission } from
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import { Master } from "./Master";
|
|
9
|
+
import { MasterPermission } from "./MasterPermission";
|
|
10
10
|
|
|
11
|
-
@Entity(
|
|
11
|
+
@Entity("master_role", {
|
|
12
12
|
comment:
|
|
13
|
-
|
|
13
|
+
"Roles que se le pueden agregar a un usuario (master) en la plataforma.",
|
|
14
14
|
})
|
|
15
15
|
export class MasterRole {
|
|
16
16
|
@PrimaryGeneratedColumn({
|
|
17
|
-
comment:
|
|
17
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
18
18
|
})
|
|
19
|
-
id: number
|
|
19
|
+
id: number;
|
|
20
20
|
|
|
21
|
-
@Column({ length: 10, unique: true, comment:
|
|
22
|
-
code: string
|
|
21
|
+
@Column({ length: 10, unique: true, comment: "Código único del rol." })
|
|
22
|
+
code: string;
|
|
23
23
|
|
|
24
24
|
@Column({
|
|
25
25
|
length: 40,
|
|
26
26
|
comment:
|
|
27
27
|
'Id de la variable que se encuentra en los archivos "locale" para el multilenguaje.\r\n\r\nCabe recordar qué los usuarios (master) también pueden crear roles, estos deben ir normal, sin id para el lenguaje.',
|
|
28
28
|
})
|
|
29
|
-
name: string
|
|
29
|
+
name: string;
|
|
30
30
|
|
|
31
31
|
@Column({
|
|
32
32
|
length: 40,
|
|
@@ -34,40 +34,43 @@ export class MasterRole {
|
|
|
34
34
|
comment:
|
|
35
35
|
'Id de la variable que se encuentra en los archivos "locale" para el multilenguaje.\r\n\r\nCabe recordar qué los usuarios (master) también pueden crear roles, estos deben ir normal, sin id para el lenguaje.',
|
|
36
36
|
})
|
|
37
|
-
description: string
|
|
37
|
+
description: string;
|
|
38
38
|
|
|
39
39
|
@Column({
|
|
40
40
|
default: 1,
|
|
41
41
|
comment:
|
|
42
|
-
|
|
42
|
+
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
43
43
|
})
|
|
44
|
-
status: number
|
|
44
|
+
status: number;
|
|
45
45
|
|
|
46
|
-
@ManyToMany(
|
|
46
|
+
@ManyToMany(
|
|
47
|
+
() => MasterPermission,
|
|
48
|
+
(masterPermission) => masterPermission.roles
|
|
49
|
+
)
|
|
47
50
|
@JoinTable({
|
|
48
|
-
name:
|
|
51
|
+
name: "master_role_permission",
|
|
49
52
|
joinColumn: {
|
|
50
|
-
name:
|
|
51
|
-
referencedColumnName:
|
|
53
|
+
name: "role",
|
|
54
|
+
referencedColumnName: "id",
|
|
52
55
|
},
|
|
53
56
|
inverseJoinColumn: {
|
|
54
|
-
name:
|
|
55
|
-
referencedColumnName:
|
|
57
|
+
name: "permission",
|
|
58
|
+
referencedColumnName: "id",
|
|
56
59
|
},
|
|
57
60
|
})
|
|
58
|
-
roles_permissions: MasterPermission[]
|
|
61
|
+
roles_permissions: MasterPermission[];
|
|
59
62
|
|
|
60
|
-
@ManyToMany(() => Master)
|
|
63
|
+
@ManyToMany(() => Master, (master) => master.masters_roles)
|
|
61
64
|
@JoinTable({
|
|
62
|
-
name:
|
|
65
|
+
name: "master_assigned_role",
|
|
63
66
|
joinColumn: {
|
|
64
|
-
name:
|
|
65
|
-
referencedColumnName:
|
|
67
|
+
name: "role",
|
|
68
|
+
referencedColumnName: "id",
|
|
66
69
|
},
|
|
67
70
|
inverseJoinColumn: {
|
|
68
|
-
name:
|
|
69
|
-
referencedColumnName:
|
|
71
|
+
name: "master",
|
|
72
|
+
referencedColumnName: "id",
|
|
70
73
|
},
|
|
71
74
|
})
|
|
72
|
-
masters_roles: Master[]
|
|
75
|
+
masters_roles: Master[];
|
|
73
76
|
}
|
package/src/entities/Partner.ts
CHANGED
|
@@ -158,7 +158,7 @@ export class Partner {
|
|
|
158
158
|
})
|
|
159
159
|
locals_partner: Local[];
|
|
160
160
|
|
|
161
|
-
@ManyToMany(() => PartnerRole, (
|
|
161
|
+
@ManyToMany(() => PartnerRole, (partnerRole) => partnerRole.partners_roles)
|
|
162
162
|
@JoinTable({
|
|
163
163
|
name: "partner_assigned_role",
|
|
164
164
|
joinColumn: {
|
|
@@ -181,15 +181,18 @@ export class Partner {
|
|
|
181
181
|
@OneToMany(() => VerifyLocal, (verifyLocal) => verifyLocal.partner)
|
|
182
182
|
verifyLocals: VerifyLocal[];
|
|
183
183
|
|
|
184
|
-
@ManyToMany(
|
|
184
|
+
@ManyToMany(
|
|
185
|
+
() => PartnerNotification,
|
|
186
|
+
(partnerNotification) => partnerNotification.partner_to_notifications
|
|
187
|
+
)
|
|
185
188
|
@JoinTable({
|
|
186
189
|
name: "partner_to_notification",
|
|
187
190
|
joinColumn: {
|
|
188
|
-
name: "
|
|
191
|
+
name: "partner",
|
|
189
192
|
referencedColumnName: "id",
|
|
190
193
|
},
|
|
191
194
|
inverseJoinColumn: {
|
|
192
|
-
name: "
|
|
195
|
+
name: "partner_notification",
|
|
193
196
|
referencedColumnName: "id",
|
|
194
197
|
},
|
|
195
198
|
})
|
|
@@ -73,9 +73,17 @@ export class PartnerNotification {
|
|
|
73
73
|
})
|
|
74
74
|
created: Date;
|
|
75
75
|
|
|
76
|
-
@ManyToMany(() => Partner)
|
|
76
|
+
@ManyToMany(() => Partner, (partner) => partner.partners_to_notification)
|
|
77
77
|
@JoinTable({
|
|
78
78
|
name: "partner_to_notification",
|
|
79
|
+
joinColumn: {
|
|
80
|
+
name: "partner_notification",
|
|
81
|
+
referencedColumnName: "id",
|
|
82
|
+
},
|
|
83
|
+
inverseJoinColumn: {
|
|
84
|
+
name: "partner",
|
|
85
|
+
referencedColumnName: "id",
|
|
86
|
+
},
|
|
79
87
|
})
|
|
80
88
|
partner_to_notifications: Partner[];
|
|
81
89
|
}
|
|
@@ -5,74 +5,82 @@ import {
|
|
|
5
5
|
ManyToMany,
|
|
6
6
|
OneToMany,
|
|
7
7
|
PrimaryColumn,
|
|
8
|
-
} from
|
|
9
|
-
import { Local } from
|
|
10
|
-
import { Request } from
|
|
11
|
-
import { User } from
|
|
8
|
+
} from "typeorm";
|
|
9
|
+
import { Local } from "./Local";
|
|
10
|
+
import { Request } from "./Request";
|
|
11
|
+
import { User } from "./User";
|
|
12
12
|
|
|
13
|
-
@Entity(
|
|
13
|
+
@Entity("payment_method", {
|
|
14
14
|
comment:
|
|
15
|
-
|
|
15
|
+
"Métodos de pago qué la plataforma tendrá disponible, estos serán visibles cuando un cliente (local) desee agregarlos para que se vean en los pedidos.",
|
|
16
16
|
})
|
|
17
17
|
export class PaymentMethod {
|
|
18
18
|
@PrimaryColumn({
|
|
19
|
-
comment:
|
|
19
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
20
20
|
})
|
|
21
|
-
id: number
|
|
21
|
+
id: number;
|
|
22
22
|
|
|
23
23
|
@Column({
|
|
24
24
|
length: 50,
|
|
25
25
|
comment:
|
|
26
|
-
|
|
26
|
+
"Nombre 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.",
|
|
27
27
|
})
|
|
28
|
-
name: string
|
|
28
|
+
name: string;
|
|
29
29
|
|
|
30
30
|
@Column({
|
|
31
31
|
length: 50,
|
|
32
32
|
nullable: true,
|
|
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;
|
|
37
37
|
|
|
38
38
|
@Column({
|
|
39
|
-
type:
|
|
39
|
+
type: "longtext",
|
|
40
40
|
nullable: true,
|
|
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;
|
|
45
45
|
|
|
46
|
-
@Column({ type:
|
|
47
|
-
created: Date
|
|
46
|
+
@Column({ type: "datetime", comment: "Fecha de creación del registro." })
|
|
47
|
+
created: Date;
|
|
48
48
|
|
|
49
49
|
@Column({
|
|
50
50
|
default: 1,
|
|
51
51
|
comment:
|
|
52
|
-
|
|
52
|
+
"Valida si el estado es visible para mostrar al cliente (local/company): \r\n1. Activo. \r\n0. Inactivo.",
|
|
53
53
|
})
|
|
54
|
-
status: number
|
|
54
|
+
status: number;
|
|
55
55
|
|
|
56
|
-
@ManyToMany(() => Local)
|
|
56
|
+
@ManyToMany(() => Local, (local) => local.payment_methods)
|
|
57
57
|
@JoinTable({
|
|
58
|
-
name:
|
|
58
|
+
name: "local_payment_method",
|
|
59
59
|
joinColumn: {
|
|
60
|
-
name:
|
|
61
|
-
referencedColumnName:
|
|
60
|
+
name: "payment_method",
|
|
61
|
+
referencedColumnName: "id",
|
|
62
62
|
},
|
|
63
63
|
inverseJoinColumn: {
|
|
64
|
-
name:
|
|
65
|
-
referencedColumnName:
|
|
64
|
+
name: "local",
|
|
65
|
+
referencedColumnName: "id",
|
|
66
66
|
},
|
|
67
67
|
})
|
|
68
|
-
locals: Local[]
|
|
68
|
+
locals: Local[];
|
|
69
69
|
|
|
70
70
|
@OneToMany(() => Request, (request) => request.payment_method)
|
|
71
|
-
requests: Request[]
|
|
71
|
+
requests: Request[];
|
|
72
72
|
|
|
73
|
-
@ManyToMany(() => User)
|
|
73
|
+
@ManyToMany(() => User, (user) => user.user_payments_method)
|
|
74
74
|
@JoinTable({
|
|
75
|
-
name:
|
|
75
|
+
name: "user_payment_method",
|
|
76
|
+
joinColumn: {
|
|
77
|
+
name: "payment_method",
|
|
78
|
+
referencedColumnName: "id",
|
|
79
|
+
},
|
|
80
|
+
inverseJoinColumn: {
|
|
81
|
+
name: "user",
|
|
82
|
+
referencedColumnName: "id",
|
|
83
|
+
},
|
|
76
84
|
})
|
|
77
|
-
user_payments_method: User[]
|
|
85
|
+
user_payments_method: User[];
|
|
78
86
|
}
|
package/src/entities/Product.ts
CHANGED
|
@@ -147,9 +147,17 @@ export class Product {
|
|
|
147
147
|
@OneToMany(() => RequestProduct, (requestProduct) => requestProduct.product)
|
|
148
148
|
request_products: RequestProduct[];
|
|
149
149
|
|
|
150
|
-
@ManyToMany(() => User)
|
|
150
|
+
@ManyToMany(() => User, (user) => user.user_favorite_products)
|
|
151
151
|
@JoinTable({
|
|
152
152
|
name: "user_favorite_product",
|
|
153
|
+
joinColumn: {
|
|
154
|
+
name: "product",
|
|
155
|
+
referencedColumnName: "id",
|
|
156
|
+
},
|
|
157
|
+
inverseJoinColumn: {
|
|
158
|
+
name: "user",
|
|
159
|
+
referencedColumnName: "id",
|
|
160
|
+
},
|
|
153
161
|
})
|
|
154
162
|
users_favorite_product: User[];
|
|
155
163
|
|
package/src/entities/Request.ts
CHANGED
|
@@ -6,101 +6,141 @@ import {
|
|
|
6
6
|
ManyToMany,
|
|
7
7
|
ManyToOne,
|
|
8
8
|
OneToMany,
|
|
9
|
-
PrimaryGeneratedColumn
|
|
10
|
-
} from
|
|
11
|
-
import { Local } from
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
9
|
+
PrimaryGeneratedColumn,
|
|
10
|
+
} from "typeorm";
|
|
11
|
+
import { Local } from "..";
|
|
12
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
13
|
+
import { PaymentMethod } from "./PaymentMethod";
|
|
14
|
+
import { RequestProduct } from "./RequestProduct";
|
|
15
|
+
import { RequestProductGroupComplement } from "./RequestProductGroupComplement";
|
|
16
|
+
import { RequestStatus } from "./RequestStatus";
|
|
17
|
+
import { User } from "./User";
|
|
17
18
|
|
|
18
19
|
@Entity({
|
|
19
20
|
comment:
|
|
20
|
-
|
|
21
|
+
"Tabla para agregar los pedidos realizados através de la plataforma.",
|
|
21
22
|
})
|
|
22
23
|
export class Request {
|
|
23
24
|
@PrimaryGeneratedColumn({
|
|
24
|
-
comment:
|
|
25
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
25
26
|
})
|
|
26
|
-
id: number
|
|
27
|
+
id: number;
|
|
27
28
|
|
|
28
29
|
@ManyToOne(() => User, (user) => user.requests, {
|
|
29
30
|
nullable: true,
|
|
30
|
-
onDelete:
|
|
31
|
-
onUpdate:
|
|
31
|
+
onDelete: "SET NULL",
|
|
32
|
+
onUpdate: "NO ACTION",
|
|
32
33
|
})
|
|
33
|
-
@JoinColumn({ name:
|
|
34
|
-
user: User
|
|
34
|
+
@JoinColumn({ name: "user" })
|
|
35
|
+
user: User;
|
|
35
36
|
|
|
36
|
-
@
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
@Column({
|
|
38
|
+
default: 1,
|
|
39
|
+
comment:
|
|
40
|
+
"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).",
|
|
39
41
|
})
|
|
40
|
-
|
|
41
|
-
local: Local
|
|
42
|
+
order_mode: number;
|
|
42
43
|
|
|
43
44
|
@Column({
|
|
44
45
|
default: 1,
|
|
45
46
|
comment:
|
|
46
|
-
|
|
47
|
+
"Puedo saber si el pedido es para:\r\n1. Comer en el establecimiento.\r\n2. Recoger para llevar.\r\n3. Para llevar.",
|
|
47
48
|
})
|
|
48
|
-
order_type: number
|
|
49
|
+
order_type: number;
|
|
49
50
|
|
|
50
51
|
@ManyToOne(() => PaymentMethod, (paymentMethod) => paymentMethod.requests, {
|
|
51
|
-
onDelete:
|
|
52
|
-
onUpdate:
|
|
52
|
+
onDelete: "RESTRICT",
|
|
53
|
+
onUpdate: "NO ACTION",
|
|
53
54
|
})
|
|
54
|
-
@JoinColumn({ name:
|
|
55
|
-
payment_method: PaymentMethod
|
|
55
|
+
@JoinColumn({ name: "payment_method" })
|
|
56
|
+
payment_method: PaymentMethod;
|
|
56
57
|
|
|
57
58
|
@Column({
|
|
58
59
|
length: 30,
|
|
59
60
|
comment:
|
|
60
|
-
|
|
61
|
+
"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).",
|
|
61
62
|
})
|
|
62
|
-
order_cost: string
|
|
63
|
+
order_cost: string;
|
|
64
|
+
|
|
65
|
+
// !: Esta columna debería borrarse ya que ahora debería manejarse con otras tablas y eso.
|
|
66
|
+
@Column({
|
|
67
|
+
default: 0,
|
|
68
|
+
comment:
|
|
69
|
+
"Me indica si el pedido ya está pago o falta por pagar:\r\n0. No pagado.\r\n1. Pagado.",
|
|
70
|
+
})
|
|
71
|
+
paid_status: number;
|
|
63
72
|
|
|
64
73
|
@ManyToOne(() => RequestStatus, (requestStatus) => requestStatus.requests, {
|
|
65
|
-
onDelete:
|
|
66
|
-
onUpdate:
|
|
74
|
+
onDelete: "RESTRICT",
|
|
75
|
+
onUpdate: "NO ACTION",
|
|
67
76
|
})
|
|
68
|
-
@JoinColumn({ name:
|
|
69
|
-
status: RequestStatus
|
|
77
|
+
@JoinColumn({ name: "status" })
|
|
78
|
+
status: RequestStatus;
|
|
70
79
|
|
|
71
80
|
@Column({
|
|
72
81
|
length: 400,
|
|
73
82
|
comment:
|
|
74
|
-
|
|
83
|
+
"Los detalles que el usuario agrega al pedido, puede ser alguna sugerencia u otra cosa.",
|
|
75
84
|
})
|
|
76
|
-
details: string
|
|
85
|
+
details: string;
|
|
77
86
|
|
|
78
87
|
@Column({
|
|
79
88
|
length: 400,
|
|
80
|
-
comment:
|
|
89
|
+
comment: "Comentarios del pedido, este los realiza el cliente (local).",
|
|
90
|
+
})
|
|
91
|
+
comments: string;
|
|
92
|
+
|
|
93
|
+
@Column({
|
|
94
|
+
type: "datetime",
|
|
95
|
+
transformer: new DateTransformer(),
|
|
96
|
+
comment: "Fecha en la que el cliente final crea el pedido.",
|
|
97
|
+
})
|
|
98
|
+
created: Date;
|
|
99
|
+
|
|
100
|
+
@Column({
|
|
101
|
+
type: "datetime",
|
|
102
|
+
transformer: new DateTransformer(),
|
|
103
|
+
nullable: true,
|
|
104
|
+
default: null,
|
|
105
|
+
comment:
|
|
106
|
+
"Fecha en la que el cliente final hace la última actualización del pedido.",
|
|
107
|
+
})
|
|
108
|
+
updated: Date;
|
|
109
|
+
|
|
110
|
+
@ManyToMany(() => Local, (local) => local.requests_local)
|
|
111
|
+
@JoinTable({
|
|
112
|
+
name: "request_local",
|
|
113
|
+
joinColumn: {
|
|
114
|
+
name: "request",
|
|
115
|
+
referencedColumnName: "id",
|
|
116
|
+
},
|
|
117
|
+
inverseJoinColumn: {
|
|
118
|
+
name: "local",
|
|
119
|
+
referencedColumnName: "id",
|
|
120
|
+
},
|
|
81
121
|
})
|
|
82
|
-
|
|
122
|
+
requests_local: Local[];
|
|
83
123
|
|
|
84
|
-
@ManyToMany(() => User)
|
|
124
|
+
@ManyToMany(() => User, (user) => user.requests_group)
|
|
85
125
|
@JoinTable({
|
|
86
|
-
name:
|
|
126
|
+
name: "request_group",
|
|
87
127
|
joinColumn: {
|
|
88
|
-
name:
|
|
89
|
-
referencedColumnName:
|
|
128
|
+
name: "request",
|
|
129
|
+
referencedColumnName: "id",
|
|
90
130
|
},
|
|
91
131
|
inverseJoinColumn: {
|
|
92
|
-
name:
|
|
93
|
-
referencedColumnName:
|
|
132
|
+
name: "user",
|
|
133
|
+
referencedColumnName: "id",
|
|
94
134
|
},
|
|
95
135
|
})
|
|
96
|
-
requests_group: User[]
|
|
136
|
+
requests_group: User[];
|
|
97
137
|
|
|
98
138
|
@OneToMany(() => RequestProduct, (requestProduct) => requestProduct.request)
|
|
99
|
-
request_products: RequestProduct[]
|
|
139
|
+
request_products: RequestProduct[];
|
|
100
140
|
|
|
101
141
|
@OneToMany(
|
|
102
142
|
() => RequestProductGroupComplement,
|
|
103
143
|
(requestProduct) => requestProduct.request
|
|
104
144
|
)
|
|
105
|
-
request_product_group_complements: RequestProductGroupComplement[]
|
|
145
|
+
request_product_group_complements: RequestProductGroupComplement[];
|
|
106
146
|
}
|
package/src/entities/Square.ts
CHANGED
|
@@ -78,9 +78,17 @@ export class Square {
|
|
|
78
78
|
@OneToMany(() => Local, (local) => local.square)
|
|
79
79
|
locals: Local[]
|
|
80
80
|
|
|
81
|
-
@ManyToMany(() => User)
|
|
81
|
+
@ManyToMany(() => User, (user) => user.user_favorite_squares)
|
|
82
82
|
@JoinTable({
|
|
83
|
-
name:
|
|
83
|
+
name: "user_favorite_square",
|
|
84
|
+
joinColumn: {
|
|
85
|
+
name: "square",
|
|
86
|
+
referencedColumnName: "id",
|
|
87
|
+
},
|
|
88
|
+
inverseJoinColumn: {
|
|
89
|
+
name: "user",
|
|
90
|
+
referencedColumnName: "id",
|
|
91
|
+
},
|
|
84
92
|
})
|
|
85
|
-
users_favorite_square: User[]
|
|
93
|
+
users_favorite_square: User[];
|
|
86
94
|
}
|