test-entity-library-asm 1.1.8 → 1.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/Category.d.ts +5 -3
- package/dist/entities/Category.js +38 -13
- package/dist/entities/CategorySchedule.d.ts +10 -0
- package/dist/entities/CategorySchedule.js +67 -0
- package/dist/entities/City.d.ts +3 -2
- package/dist/entities/City.js +35 -10
- package/dist/entities/CodeRedemptionHistoryCompany.d.ts +4 -3
- package/dist/entities/CodeRedemptionHistoryCompany.js +31 -10
- package/dist/entities/CodeRedemptionHistoryUser.js +13 -6
- package/dist/entities/Company.d.ts +2 -1
- package/dist/entities/Company.js +64 -26
- package/dist/entities/Configuration.d.ts +2 -1
- package/dist/entities/Configuration.js +26 -4
- package/dist/entities/Country.d.ts +2 -1
- package/dist/entities/Country.js +33 -11
- package/dist/entities/Day.d.ts +2 -1
- package/dist/entities/Day.js +31 -6
- package/dist/entities/DiscountCodeCompany.d.ts +2 -1
- package/dist/entities/DiscountCodeCompany.js +42 -12
- package/dist/entities/DiscountCodeUser.js +24 -13
- package/dist/entities/Local.d.ts +14 -2
- package/dist/entities/Local.js +73 -13
- package/dist/entities/LocalQualification.d.ts +10 -0
- package/dist/entities/LocalQualification.js +76 -0
- package/dist/entities/Master.d.ts +2 -1
- package/dist/entities/Master.js +26 -4
- package/dist/entities/PaymentMethod.d.ts +13 -0
- package/dist/entities/PaymentMethod.js +102 -0
- package/dist/entities/Permission.d.ts +2 -1
- package/dist/entities/Permission.js +32 -8
- package/dist/entities/Plan.d.ts +2 -1
- package/dist/entities/Plan.js +38 -10
- package/dist/entities/Product.d.ts +8 -1
- package/dist/entities/Product.js +62 -12
- package/dist/entities/ProductGroup.js +16 -8
- package/dist/entities/ProductIngredient.d.ts +12 -0
- package/dist/entities/ProductIngredient.js +84 -0
- package/dist/entities/ProductTopping.d.ts +2 -1
- package/dist/entities/ProductTopping.js +33 -7
- package/dist/entities/Region.d.ts +3 -2
- package/dist/entities/Region.js +40 -10
- package/dist/entities/Request.d.ts +21 -0
- package/dist/entities/Request.js +137 -0
- package/dist/entities/RequestProduct.d.ts +12 -0
- package/dist/entities/RequestProduct.js +85 -0
- package/dist/entities/RequestProductGroupComplement.d.ts +11 -0
- package/dist/entities/RequestProductGroupComplement.js +80 -0
- package/dist/entities/RequestStatus.d.ts +11 -0
- package/dist/entities/RequestStatus.js +85 -0
- package/dist/entities/Role.js +11 -4
- package/dist/entities/RoleVisibleTo.d.ts +2 -1
- package/dist/entities/RoleVisibleTo.js +30 -5
- package/dist/entities/Square.d.ts +13 -0
- package/dist/entities/Square.js +97 -0
- package/dist/entities/Terminal.d.ts +2 -0
- package/dist/entities/Terminal.js +21 -4
- package/dist/entities/TerminalSession.d.ts +3 -2
- package/dist/entities/TerminalSession.js +41 -8
- package/dist/entities/TypeFood.d.ts +2 -1
- package/dist/entities/TypeFood.js +41 -6
- package/dist/entities/TypeMeasureIngredient.d.ts +9 -0
- package/dist/entities/TypeMeasureIngredient.js +73 -0
- package/dist/entities/User.d.ts +17 -7
- package/dist/entities/User.js +104 -25
- package/dist/entities/productGroupComplement.d.ts +4 -1
- package/dist/entities/productGroupComplement.js +35 -8
- package/package.json +1 -1
- package/src/entities/Category.ts +33 -15
- package/src/entities/CategorySchedule.ts +35 -0
- package/src/entities/City.ts +18 -8
- package/src/entities/CodeRedemptionHistoryCompany.ts +17 -9
- package/src/entities/CodeRedemptionHistoryUser.ts +15 -6
- package/src/entities/Company.ts +51 -25
- package/src/entities/Configuration.ts +10 -4
- package/src/entities/Country.ts +23 -11
- package/src/entities/Day.ts +16 -6
- package/src/entities/DiscountCodeCompany.ts +26 -11
- package/src/entities/DiscountCodeUser.ts +25 -12
- package/src/entities/Local.ts +54 -12
- package/src/entities/LocalQualification.ts +45 -0
- package/src/entities/Master.ts +17 -4
- package/src/entities/PaymentMethod.ts +72 -0
- package/src/entities/Permission.ts +16 -7
- package/src/entities/Plan.ts +22 -9
- package/src/entities/Product.ts +47 -11
- package/src/entities/ProductGroup.ts +18 -8
- package/src/entities/ProductIngredient.ts +55 -0
- package/src/entities/ProductTopping.ts +17 -6
- package/src/entities/Region.ts +24 -8
- package/src/entities/Request.ts +107 -0
- package/src/entities/RequestProduct.ts +51 -0
- package/src/entities/RequestProductGroupComplement.ts +55 -0
- package/src/entities/RequestStatus.ts +55 -0
- package/src/entities/Role.ts +12 -4
- package/src/entities/RoleVisibleTo.ts +13 -4
- package/src/entities/Square.ts +56 -0
- package/src/entities/Terminal.ts +24 -4
- package/src/entities/TerminalSession.ts +28 -10
- package/src/entities/TypeFood.ts +26 -5
- package/src/entities/TypeMeasureIngredient.ts +46 -0
- package/src/entities/User.ts +93 -28
- package/src/entities/productGroupComplement.ts +23 -7
- package/src/entities/ScheduleCategory.ts +0 -32
package/src/entities/Company.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
ManyToMany,
|
|
8
8
|
JoinTable,
|
|
9
9
|
OneToMany,
|
|
10
|
+
BaseEntity,
|
|
10
11
|
} from 'typeorm'
|
|
11
12
|
import { City } from './City'
|
|
12
13
|
import { User } from './User'
|
|
@@ -17,19 +18,30 @@ import { CodeRedemptionHistoryCompany } from './CodeRedemptionHistoryCompany'
|
|
|
17
18
|
import { DiscountCodeUser } from './DiscountCodeUser'
|
|
18
19
|
import { ProductTopping } from './ProductTopping'
|
|
19
20
|
|
|
20
|
-
@Entity(
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
@Entity({
|
|
22
|
+
comment:
|
|
23
|
+
'Tabla creada para las empresas de comida rápida que deseen registrarse en la plataforma.',
|
|
24
|
+
})
|
|
25
|
+
export class Company extends BaseEntity {
|
|
26
|
+
@PrimaryGeneratedColumn({
|
|
27
|
+
comment: 'Número de identificación (ID) único de cada empresa.',
|
|
28
|
+
})
|
|
23
29
|
id: number
|
|
24
30
|
|
|
25
|
-
@Column({ length: 50 })
|
|
31
|
+
@Column({ length: 50, comment: 'Nombre de la empresa.' })
|
|
26
32
|
name: string
|
|
27
33
|
|
|
28
|
-
@ManyToOne(() => City, (city) => city.companies
|
|
34
|
+
@ManyToOne(() => City, (city) => city.companies, {
|
|
35
|
+
onDelete: 'RESTRICT',
|
|
36
|
+
onUpdate: 'NO ACTION',
|
|
37
|
+
})
|
|
29
38
|
@JoinColumn({ name: 'city' })
|
|
30
39
|
city: City
|
|
31
40
|
|
|
32
|
-
@ManyToOne(() => User, (city) => city.companies
|
|
41
|
+
@ManyToOne(() => User, (city) => city.companies, {
|
|
42
|
+
onDelete: 'CASCADE',
|
|
43
|
+
onUpdate: 'NO ACTION',
|
|
44
|
+
})
|
|
33
45
|
@JoinColumn({ name: 'user' })
|
|
34
46
|
user: User
|
|
35
47
|
|
|
@@ -37,21 +49,29 @@ export class Company {
|
|
|
37
49
|
type: 'longtext',
|
|
38
50
|
nullable: true,
|
|
39
51
|
comment:
|
|
40
|
-
'Campo de tipo JSON donde se guarda información necesaria para la empresa',
|
|
52
|
+
'Campo de tipo JSON donde se guarda información necesaria para la empresa.',
|
|
41
53
|
})
|
|
42
54
|
profile: string
|
|
43
55
|
|
|
44
|
-
@Column({
|
|
56
|
+
@Column({
|
|
57
|
+
default: 1,
|
|
58
|
+
comment:
|
|
59
|
+
'Cantidad de locales qué la empresa de comida rápida puede tener por defecto, por defecto es un solo local.',
|
|
60
|
+
})
|
|
45
61
|
quantity_locals: number
|
|
46
62
|
|
|
47
|
-
@Column({
|
|
63
|
+
@Column({
|
|
64
|
+
default: 6,
|
|
65
|
+
comment:
|
|
66
|
+
'La cantidad de usuarios que puede asociar a la empresa, es decir, si la empresa desea agregar cajeros, administradores para cada punto lo puede hacer. Por defecto, la cantidad de usuarios que puede tener la empresa es de 6.',
|
|
67
|
+
})
|
|
48
68
|
quantity_users: number
|
|
49
69
|
|
|
50
70
|
@Column({
|
|
51
71
|
type: 'longtext',
|
|
52
72
|
nullable: true,
|
|
53
73
|
comment:
|
|
54
|
-
'Información de tipo JSON donde se guarda la información legal de la empresa',
|
|
74
|
+
'Información de tipo JSON donde se guarda la información legal de la empresa.',
|
|
55
75
|
})
|
|
56
76
|
legal_information: string
|
|
57
77
|
|
|
@@ -59,37 +79,43 @@ export class Company {
|
|
|
59
79
|
type: 'longtext',
|
|
60
80
|
nullable: true,
|
|
61
81
|
comment:
|
|
62
|
-
'Información de tipo JSON donde se guarda la información del representante legal del representante',
|
|
82
|
+
'Información de tipo JSON donde se guarda la información del representante legal del representante.',
|
|
63
83
|
})
|
|
64
84
|
legal_agent: string
|
|
65
85
|
|
|
66
|
-
@ManyToOne(() => Plan, (plan) => plan.companies
|
|
86
|
+
@ManyToOne(() => Plan, (plan) => plan.companies, {
|
|
87
|
+
onDelete: 'RESTRICT',
|
|
88
|
+
onUpdate: 'RESTRICT',
|
|
89
|
+
})
|
|
67
90
|
@JoinColumn({ name: 'plan' })
|
|
68
91
|
plan: Plan
|
|
69
92
|
|
|
70
|
-
@Column({ type: 'datetime' })
|
|
93
|
+
@Column({ type: 'datetime', comment: 'Fecha creación de la empresa.' })
|
|
71
94
|
created: Date
|
|
72
95
|
|
|
73
|
-
@Column({
|
|
96
|
+
@Column({
|
|
97
|
+
type: 'date',
|
|
98
|
+
nullable: true,
|
|
99
|
+
comment: 'Cuándo expira el plan de la empresa.',
|
|
100
|
+
})
|
|
74
101
|
expiration: Date
|
|
75
102
|
|
|
76
|
-
@Column({
|
|
103
|
+
@Column({
|
|
104
|
+
type: 'datetime',
|
|
105
|
+
comment: 'Fecha de actualización de la empresa.',
|
|
106
|
+
})
|
|
77
107
|
updated: Date
|
|
78
108
|
|
|
79
|
-
@Column({
|
|
109
|
+
@Column({
|
|
110
|
+
default: 1,
|
|
111
|
+
comment:
|
|
112
|
+
'Estado de la empresa, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
113
|
+
})
|
|
80
114
|
status: number
|
|
81
115
|
|
|
82
|
-
@ManyToMany(() => TypeFood)
|
|
116
|
+
@ManyToMany(() => TypeFood, { onDelete: 'CASCADE', onUpdate: 'NO ACTION' })
|
|
83
117
|
@JoinTable({
|
|
84
118
|
name: 'type_food_company',
|
|
85
|
-
joinColumn: {
|
|
86
|
-
name: 'company',
|
|
87
|
-
referencedColumnName: 'id',
|
|
88
|
-
},
|
|
89
|
-
inverseJoinColumn: {
|
|
90
|
-
name: 'type_food',
|
|
91
|
-
referencedColumnName: 'id',
|
|
92
|
-
},
|
|
93
119
|
})
|
|
94
120
|
types_food: TypeFood[]
|
|
95
121
|
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { Entity, Column, PrimaryColumn } from 'typeorm'
|
|
1
|
+
import { Entity, Column, PrimaryColumn, BaseEntity } from 'typeorm'
|
|
2
2
|
|
|
3
|
-
@Entity(
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
@Entity({
|
|
4
|
+
comment:
|
|
5
|
+
'Esta tabla tiene como fin agregar toda la información de la empresa, logos, urls de documentación, nombres, urls de las páginas... \n\n Esto se se guarda como un string de tipo JSON para que sea fácil almacenarlo y generar nuevos campos si es necesario.',
|
|
6
|
+
})
|
|
7
|
+
export class Configuration extends BaseEntity {
|
|
8
|
+
@PrimaryColumn({
|
|
9
|
+
length: 20,
|
|
10
|
+
comment: 'Nombre del perfil que se está usando en la aplicación.',
|
|
11
|
+
})
|
|
6
12
|
profile: string
|
|
7
13
|
|
|
8
14
|
@Column({
|
package/src/entities/Country.ts
CHANGED
|
@@ -1,42 +1,54 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
Column,
|
|
4
|
+
PrimaryGeneratedColumn,
|
|
5
|
+
OneToMany,
|
|
6
|
+
BaseEntity,
|
|
7
|
+
} from 'typeorm'
|
|
2
8
|
import { Region } from './Region'
|
|
3
9
|
|
|
4
|
-
@Entity()
|
|
5
|
-
export class Country {
|
|
6
|
-
@PrimaryGeneratedColumn(
|
|
10
|
+
@Entity({ comment: 'Países donde está disponible la plataforma.' })
|
|
11
|
+
export class Country extends BaseEntity {
|
|
12
|
+
@PrimaryGeneratedColumn({
|
|
13
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
14
|
+
})
|
|
7
15
|
id: number
|
|
8
16
|
|
|
9
|
-
@Column({ length: 10 })
|
|
17
|
+
@Column({ length: 10, comment: 'Código del país.' })
|
|
10
18
|
code: string
|
|
11
19
|
|
|
12
|
-
@Column({ length: 50 })
|
|
20
|
+
@Column({ length: 50, comment: 'Nombre del país.' })
|
|
13
21
|
name: string
|
|
14
22
|
|
|
15
23
|
@Column({
|
|
16
24
|
length: 10,
|
|
17
25
|
comment:
|
|
18
|
-
'Usamos esta columna para saber la moneda del país y sugerírsela al usuario o al local',
|
|
26
|
+
'Usamos esta columna para saber la moneda del país y sugerírsela al usuario o al local.',
|
|
19
27
|
})
|
|
20
28
|
currency: string
|
|
21
29
|
|
|
22
|
-
@Column({ length: 10 })
|
|
30
|
+
@Column({ length: 10, comment: 'Prefijo para los números de teléfono.' })
|
|
23
31
|
prefix: string
|
|
24
32
|
|
|
25
33
|
@Column({
|
|
26
34
|
type: 'longtext',
|
|
27
35
|
comment:
|
|
28
|
-
'Esta columna de tipo JSON nos sirve para agregar toda la información que se necesita a nivel de información legal de la empresa que se registre, ya que para cada país cambia la información',
|
|
36
|
+
'Esta columna de tipo JSON nos sirve para agregar toda la información que se necesita a nivel de información legal de la empresa que se registre, ya que para cada país cambia la información.',
|
|
29
37
|
})
|
|
30
38
|
legal_information: string
|
|
31
39
|
|
|
32
40
|
@Column({
|
|
33
41
|
type: 'longtext',
|
|
34
42
|
comment:
|
|
35
|
-
'Columna de tipo JSON para almacenar la información que se necesita para la información del representante legal de la empresa',
|
|
43
|
+
'Columna de tipo JSON para almacenar la información que se necesita para la información del representante legal de la empresa.',
|
|
36
44
|
})
|
|
37
45
|
legal_agent: string
|
|
38
46
|
|
|
39
|
-
@Column({
|
|
47
|
+
@Column({
|
|
48
|
+
default: 1,
|
|
49
|
+
comment:
|
|
50
|
+
'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
51
|
+
})
|
|
40
52
|
status: number
|
|
41
53
|
|
|
42
54
|
@OneToMany(() => Region, (region) => region.country)
|
package/src/entities/Day.ts
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm'
|
|
1
|
+
import { Entity, Column, PrimaryGeneratedColumn, BaseEntity } from 'typeorm'
|
|
2
2
|
|
|
3
|
-
@Entity()
|
|
4
|
-
export class Day {
|
|
5
|
-
@PrimaryGeneratedColumn(
|
|
3
|
+
@Entity({ comment: 'Días de la semana.' })
|
|
4
|
+
export class Day extends BaseEntity {
|
|
5
|
+
@PrimaryGeneratedColumn({
|
|
6
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
7
|
+
})
|
|
6
8
|
id: number
|
|
7
9
|
|
|
8
|
-
@Column({
|
|
10
|
+
@Column({
|
|
11
|
+
length: 50,
|
|
12
|
+
comment:
|
|
13
|
+
'Nombre del día.\r\n\r\nID/KEY de la variable que se encuentra en los archivos "locale" para el multilenguaje.',
|
|
14
|
+
})
|
|
9
15
|
name: string
|
|
10
16
|
|
|
11
|
-
@Column({
|
|
17
|
+
@Column({
|
|
18
|
+
default: 1,
|
|
19
|
+
comment:
|
|
20
|
+
'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
21
|
+
})
|
|
12
22
|
status: number
|
|
13
23
|
}
|
|
@@ -5,19 +5,27 @@ import {
|
|
|
5
5
|
ManyToOne,
|
|
6
6
|
JoinColumn,
|
|
7
7
|
OneToMany,
|
|
8
|
+
BaseEntity,
|
|
8
9
|
} from 'typeorm'
|
|
9
10
|
import { User } from './User'
|
|
10
11
|
import { CodeRedemptionHistoryCompany } from './CodeRedemptionHistoryCompany'
|
|
11
12
|
|
|
12
|
-
@Entity('discount_code_company'
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
@Entity('discount_code_company', {
|
|
14
|
+
comment: 'Códigos de descuento para las empresas.',
|
|
15
|
+
})
|
|
16
|
+
export class DiscountCodeCompany extends BaseEntity {
|
|
17
|
+
@PrimaryGeneratedColumn({
|
|
18
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
19
|
+
})
|
|
15
20
|
id: number
|
|
16
21
|
|
|
17
|
-
@Column({
|
|
22
|
+
@Column({
|
|
23
|
+
length: 10,
|
|
24
|
+
comment: 'Código de descuento para las empresas (company).',
|
|
25
|
+
})
|
|
18
26
|
code: string
|
|
19
27
|
|
|
20
|
-
@Column({ length: 10 })
|
|
28
|
+
@Column({ length: 10, comment: 'Descuento que se aplica.' })
|
|
21
29
|
discount: string
|
|
22
30
|
|
|
23
31
|
@Column({
|
|
@@ -30,23 +38,30 @@ export class DiscountCodeCompany {
|
|
|
30
38
|
@Column({
|
|
31
39
|
default: 1,
|
|
32
40
|
comment:
|
|
33
|
-
'Con esto validamos si la empresa puede usar el código una vez o varias veces:\r\n1. Una sola vez.\r\n0. Más de una vez.\r\n\r\nCon esto validamos sí tenemos qué ir a buscar a la tabla code_redemption_history_company',
|
|
41
|
+
'Con esto validamos si la empresa puede usar el código una vez o varias veces:\r\n1. Una sola vez.\r\n0. Más de una vez.\r\n\r\nCon esto validamos sí tenemos qué ir a buscar a la tabla code_redemption_history_company.',
|
|
34
42
|
})
|
|
35
43
|
single_use: number
|
|
36
44
|
|
|
37
|
-
@Column({ type: 'datetime' })
|
|
45
|
+
@Column({ type: 'datetime', comment: 'Fecha de creación del registro.' })
|
|
38
46
|
created: Date
|
|
39
47
|
|
|
40
|
-
@Column({ type: 'date' })
|
|
48
|
+
@Column({ type: 'date', comment: 'Fecha de expiración del registro.' })
|
|
41
49
|
expiration: Date
|
|
42
50
|
|
|
43
|
-
@Column({ type: 'datetime' })
|
|
51
|
+
@Column({ type: 'datetime', comment: 'Fecha de expiración del registro.' })
|
|
44
52
|
updated: Date
|
|
45
53
|
|
|
46
|
-
@Column({
|
|
54
|
+
@Column({
|
|
55
|
+
default: 1,
|
|
56
|
+
comment:
|
|
57
|
+
'Estado del registro, es decir: \n 1. Activo: Es visible en la plataforma. \n 0. Inactivo: No será visible en la plataforma.',
|
|
58
|
+
})
|
|
47
59
|
status: number
|
|
48
60
|
|
|
49
|
-
@ManyToOne(() => User, (user) => user.discount_code_companies
|
|
61
|
+
@ManyToOne(() => User, (user) => user.discount_code_companies, {
|
|
62
|
+
onDelete: 'CASCADE',
|
|
63
|
+
onUpdate: 'NO ACTION',
|
|
64
|
+
})
|
|
50
65
|
@JoinColumn({ name: 'update_by' })
|
|
51
66
|
updated_by: User
|
|
52
67
|
|
|
@@ -10,19 +10,26 @@ import { User } from './User'
|
|
|
10
10
|
import { Company } from './Company'
|
|
11
11
|
import { CodeRedemptionHistoryUser } from './CodeRedemptionHistoryUser'
|
|
12
12
|
|
|
13
|
-
@Entity('discount_code_user'
|
|
13
|
+
@Entity('discount_code_user', {
|
|
14
|
+
comment: 'Códigos de descuento para los usuarios.',
|
|
15
|
+
})
|
|
14
16
|
export class DiscountCodeUser {
|
|
15
|
-
@PrimaryGeneratedColumn(
|
|
17
|
+
@PrimaryGeneratedColumn({
|
|
18
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
19
|
+
})
|
|
16
20
|
id: number
|
|
17
21
|
|
|
18
|
-
@ManyToOne(() => Company, (company) => company.discount_code_users
|
|
22
|
+
@ManyToOne(() => Company, (company) => company.discount_code_users, {
|
|
23
|
+
onDelete: 'CASCADE',
|
|
24
|
+
onUpdate: 'NO ACTION',
|
|
25
|
+
})
|
|
19
26
|
@JoinColumn({ name: 'company' })
|
|
20
27
|
company: Company
|
|
21
28
|
|
|
22
|
-
@Column({ length: 10 })
|
|
29
|
+
@Column({ length: 10, comment: 'Código del descuento para compartirlo.' })
|
|
23
30
|
code: string
|
|
24
31
|
|
|
25
|
-
@Column({ length: 10 })
|
|
32
|
+
@Column({ length: 10, comment: 'Descuento que se aplica.' })
|
|
26
33
|
discount: string
|
|
27
34
|
|
|
28
35
|
@Column({
|
|
@@ -38,26 +45,32 @@ export class DiscountCodeUser {
|
|
|
38
45
|
})
|
|
39
46
|
single_use: number
|
|
40
47
|
|
|
41
|
-
@Column({ type: 'datetime' })
|
|
48
|
+
@Column({ type: 'datetime', comment: 'Fecha de creación del registro.' })
|
|
42
49
|
created: Date
|
|
43
50
|
|
|
44
|
-
@Column({ type: 'date' })
|
|
51
|
+
@Column({ type: 'date', comment: 'Fecha de expiración del registro.' })
|
|
45
52
|
expiration: Date
|
|
46
53
|
|
|
47
|
-
@ManyToOne(() => User, (user) => user.discount_code_users
|
|
54
|
+
@ManyToOne(() => User, (user) => user.discount_code_users, {
|
|
55
|
+
onDelete: 'CASCADE',
|
|
56
|
+
onUpdate: 'NO ACTION',
|
|
57
|
+
})
|
|
48
58
|
@JoinColumn({ name: 'updated_by' })
|
|
49
59
|
updated_by: User
|
|
50
60
|
|
|
51
|
-
@Column({ type: 'datetime' })
|
|
61
|
+
@Column({ type: 'datetime', comment: 'Fecha de actualización.' })
|
|
52
62
|
updated: Date
|
|
53
63
|
|
|
54
|
-
@Column({
|
|
64
|
+
@Column({
|
|
65
|
+
default: 1,
|
|
66
|
+
comment:
|
|
67
|
+
'Estado del registro, es decir: \n 1. Activo: Es visible en la plataforma. \n 0. Inactivo: No será visible en la plataforma.',
|
|
68
|
+
})
|
|
55
69
|
status: number
|
|
56
70
|
|
|
57
71
|
@OneToMany(
|
|
58
72
|
() => CodeRedemptionHistoryUser,
|
|
59
|
-
(codeRedemptionHistoryUser) =>
|
|
60
|
-
codeRedemptionHistoryUser.discount_code_user
|
|
73
|
+
(codeRedemptionHistoryUser) => codeRedemptionHistoryUser.discount_code_user
|
|
61
74
|
)
|
|
62
75
|
code_redemptions_history_users: CodeRedemptionHistoryUser[]
|
|
63
76
|
}
|
package/src/entities/Local.ts
CHANGED
|
@@ -7,25 +7,40 @@ import {
|
|
|
7
7
|
ManyToMany,
|
|
8
8
|
JoinTable,
|
|
9
9
|
OneToMany,
|
|
10
|
+
BaseEntity,
|
|
10
11
|
} from 'typeorm'
|
|
11
12
|
import { Company } from './Company'
|
|
12
13
|
import { City } from './City'
|
|
13
14
|
import { User } from './User'
|
|
14
15
|
import { Product } from './Product'
|
|
16
|
+
import { Category } from './Category'
|
|
17
|
+
import { Square } from './Square'
|
|
18
|
+
import { PaymentMethod } from './PaymentMethod'
|
|
19
|
+
import { LocalQualification } from './LocalQualification'
|
|
20
|
+
import { Request } from './Request'
|
|
21
|
+
import { Terminal } from './Terminal'
|
|
15
22
|
|
|
16
|
-
@Entity()
|
|
17
|
-
export class Local {
|
|
18
|
-
@PrimaryGeneratedColumn(
|
|
23
|
+
@Entity({ comment: 'Locales disponibles de las empresas (company).' })
|
|
24
|
+
export class Local extends BaseEntity {
|
|
25
|
+
@PrimaryGeneratedColumn({
|
|
26
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
27
|
+
})
|
|
19
28
|
id: number
|
|
20
29
|
|
|
21
|
-
@ManyToOne(() => Company, (company) => company.locals
|
|
30
|
+
@ManyToOne(() => Company, (company) => company.locals, {
|
|
31
|
+
onDelete: 'CASCADE',
|
|
32
|
+
onUpdate: 'NO ACTION',
|
|
33
|
+
})
|
|
22
34
|
@JoinColumn({ name: 'company' })
|
|
23
35
|
company: Company
|
|
24
36
|
|
|
25
37
|
@Column({ length: 100 })
|
|
26
38
|
name: string
|
|
27
39
|
|
|
28
|
-
@ManyToOne(() => City, (city) => city.locals
|
|
40
|
+
@ManyToOne(() => City, (city) => city.locals, {
|
|
41
|
+
onDelete: 'RESTRICT',
|
|
42
|
+
onUpdate: 'NO ACTION',
|
|
43
|
+
})
|
|
29
44
|
@JoinColumn({ name: 'city' })
|
|
30
45
|
city: City
|
|
31
46
|
|
|
@@ -52,19 +67,25 @@ export class Local {
|
|
|
52
67
|
@Column({ type: 'datetime' })
|
|
53
68
|
updated: Date
|
|
54
69
|
|
|
55
|
-
@ManyToOne(() => User, (user) => user.locals
|
|
70
|
+
@ManyToOne(() => User, (user) => user.locals, {
|
|
71
|
+
onDelete: 'NO ACTION',
|
|
72
|
+
onUpdate: 'NO ACTION',
|
|
73
|
+
})
|
|
56
74
|
@JoinColumn({ name: 'update_by' })
|
|
57
75
|
updated_by: User
|
|
58
76
|
|
|
77
|
+
@ManyToOne(() => Square, (square) => square.locals, {
|
|
78
|
+
onDelete: 'RESTRICT',
|
|
79
|
+
onUpdate: 'NO ACTION',
|
|
80
|
+
})
|
|
81
|
+
@JoinColumn({ name: 'square' })
|
|
82
|
+
square: Square
|
|
83
|
+
|
|
59
84
|
@Column({
|
|
60
|
-
|
|
61
|
-
default: 0,
|
|
85
|
+
default: 1,
|
|
62
86
|
comment:
|
|
63
|
-
'
|
|
87
|
+
'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
64
88
|
})
|
|
65
|
-
square: number
|
|
66
|
-
|
|
67
|
-
@Column({ default: 1 })
|
|
68
89
|
status: number
|
|
69
90
|
|
|
70
91
|
@ManyToMany(() => User)
|
|
@@ -83,4 +104,25 @@ export class Local {
|
|
|
83
104
|
|
|
84
105
|
@OneToMany(() => Product, (product) => product.local)
|
|
85
106
|
products: Product[]
|
|
107
|
+
|
|
108
|
+
@OneToMany(() => Category, (category) => category.local)
|
|
109
|
+
categories: Category[]
|
|
110
|
+
|
|
111
|
+
@ManyToMany(() => PaymentMethod)
|
|
112
|
+
@JoinTable({
|
|
113
|
+
name: 'local_payment_method',
|
|
114
|
+
})
|
|
115
|
+
payment_methods: PaymentMethod[]
|
|
116
|
+
|
|
117
|
+
@OneToMany(
|
|
118
|
+
() => LocalQualification,
|
|
119
|
+
(localQualification) => localQualification.local
|
|
120
|
+
)
|
|
121
|
+
qualifications: LocalQualification[]
|
|
122
|
+
|
|
123
|
+
@OneToMany(() => Request, (request) => request.local)
|
|
124
|
+
requests: Request[]
|
|
125
|
+
|
|
126
|
+
@OneToMany(() => Terminal, (terminal) => terminal.local)
|
|
127
|
+
terminals: Terminal[]
|
|
86
128
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
Column,
|
|
4
|
+
PrimaryColumn,
|
|
5
|
+
ManyToOne,
|
|
6
|
+
JoinColumn,
|
|
7
|
+
BaseEntity,
|
|
8
|
+
} from 'typeorm'
|
|
9
|
+
import { User } from './User'
|
|
10
|
+
import { Local } from './Local'
|
|
11
|
+
|
|
12
|
+
@Entity('local_qualification', {
|
|
13
|
+
comment:
|
|
14
|
+
'Valoración que los usuarios le dan a los locales cada vez qué realicen una orden, no es obligatorio.\r\n\r\nTodos los locales cuando se crean y no tienen reseñas quedarán con puntaje de 5.',
|
|
15
|
+
})
|
|
16
|
+
export class LocalQualification extends BaseEntity {
|
|
17
|
+
@PrimaryColumn({
|
|
18
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
19
|
+
})
|
|
20
|
+
id: number
|
|
21
|
+
|
|
22
|
+
@Column({
|
|
23
|
+
comment:
|
|
24
|
+
'Calificación que tiene el local.\r\n1. Mínimo: Mal servicio.\r\n5. Máximo: Excelente servicio\r\n\r\nLa calificación se evalúa haciéndole 3 o 4 preguntas al usuario:\r\n1. Qué tal fue el servicio a la hora de realizar el pedido.\r\n......',
|
|
25
|
+
})
|
|
26
|
+
qualification: number
|
|
27
|
+
|
|
28
|
+
@ManyToOne(() => Local, (local) => local.qualifications, {
|
|
29
|
+
onDelete: 'CASCADE',
|
|
30
|
+
onUpdate: 'NO ACTION',
|
|
31
|
+
})
|
|
32
|
+
@JoinColumn({ name: 'local' })
|
|
33
|
+
local: Local
|
|
34
|
+
|
|
35
|
+
@ManyToOne(() => User, (user) => user.qualifications, {
|
|
36
|
+
nullable: true,
|
|
37
|
+
onDelete: 'SET NULL',
|
|
38
|
+
onUpdate: 'NO ACTION',
|
|
39
|
+
})
|
|
40
|
+
@JoinColumn({ name: 'user' })
|
|
41
|
+
user: User
|
|
42
|
+
|
|
43
|
+
@Column({ type: 'datetime', comment: 'Fecha de creación del registro.' })
|
|
44
|
+
created: string
|
|
45
|
+
}
|
package/src/entities/Master.ts
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
Column,
|
|
4
|
+
PrimaryColumn,
|
|
5
|
+
ManyToOne,
|
|
6
|
+
JoinColumn,
|
|
7
|
+
BaseEntity,
|
|
8
|
+
} from 'typeorm'
|
|
2
9
|
import { User } from './User'
|
|
3
10
|
|
|
4
11
|
@Entity()
|
|
5
|
-
export class Master {
|
|
6
|
-
@PrimaryColumn(
|
|
12
|
+
export class Master extends BaseEntity {
|
|
13
|
+
@PrimaryColumn({
|
|
14
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
15
|
+
})
|
|
7
16
|
id: number
|
|
8
17
|
|
|
9
18
|
@ManyToOne(() => User, (user) => user.masters)
|
|
10
19
|
@JoinColumn({ name: 'user' })
|
|
11
20
|
user: User
|
|
12
21
|
|
|
13
|
-
@Column({
|
|
22
|
+
@Column({
|
|
23
|
+
default: 1,
|
|
24
|
+
comment:
|
|
25
|
+
'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
26
|
+
})
|
|
14
27
|
status: number
|
|
15
28
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseEntity,
|
|
3
|
+
Column,
|
|
4
|
+
Entity,
|
|
5
|
+
JoinTable,
|
|
6
|
+
ManyToMany,
|
|
7
|
+
OneToMany,
|
|
8
|
+
PrimaryColumn,
|
|
9
|
+
} from 'typeorm'
|
|
10
|
+
import { Local } from './Local'
|
|
11
|
+
import { Request } from './Request'
|
|
12
|
+
|
|
13
|
+
@Entity('payment_method', {
|
|
14
|
+
comment:
|
|
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
|
+
})
|
|
17
|
+
export class PaymentMethod extends BaseEntity {
|
|
18
|
+
@PrimaryColumn({
|
|
19
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
20
|
+
})
|
|
21
|
+
id: number
|
|
22
|
+
|
|
23
|
+
@Column({
|
|
24
|
+
length: 50,
|
|
25
|
+
comment:
|
|
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
|
+
})
|
|
28
|
+
name: string
|
|
29
|
+
|
|
30
|
+
@Column({
|
|
31
|
+
length: 50,
|
|
32
|
+
nullable: true,
|
|
33
|
+
comment:
|
|
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
|
+
})
|
|
36
|
+
description: string
|
|
37
|
+
|
|
38
|
+
@Column({
|
|
39
|
+
type: 'longtext',
|
|
40
|
+
nullable: true,
|
|
41
|
+
comment:
|
|
42
|
+
'Campo de tipo JSON donde se pueden agregar columnas u otros elementos que sean necesarios.',
|
|
43
|
+
})
|
|
44
|
+
settings: string
|
|
45
|
+
|
|
46
|
+
@Column({ type: 'datetime', comment: 'Fecha de creación del registro.' })
|
|
47
|
+
created: Date
|
|
48
|
+
|
|
49
|
+
@Column({
|
|
50
|
+
default: 1,
|
|
51
|
+
comment:
|
|
52
|
+
'Valida si el estado es visible para mostrar al cliente (local/company): \r\n1. Activo. \r\n0. Inactivo.',
|
|
53
|
+
})
|
|
54
|
+
status: number
|
|
55
|
+
|
|
56
|
+
@ManyToMany(() => Local)
|
|
57
|
+
@JoinTable({
|
|
58
|
+
name: 'local_payment_method',
|
|
59
|
+
joinColumn: {
|
|
60
|
+
name: 'local',
|
|
61
|
+
referencedColumnName: 'id',
|
|
62
|
+
},
|
|
63
|
+
inverseJoinColumn: {
|
|
64
|
+
name: 'payment_method',
|
|
65
|
+
referencedColumnName: 'id',
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
locals: Local[]
|
|
69
|
+
|
|
70
|
+
@OneToMany(() => Request, (request) => request.payment_method)
|
|
71
|
+
requests: Request[]
|
|
72
|
+
}
|