test-entity-library-asm 1.1.9 → 1.2.1
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 -18
- package/dist/entities/Configuration.d.ts +2 -1
- package/dist/entities/Configuration.js +26 -4
- package/dist/entities/Country.js +14 -9
- 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 +33 -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 -17
- package/src/entities/Configuration.ts +10 -4
- package/src/entities/Country.ts +16 -10
- 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 +18 -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
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { BaseEntity, Column, Entity, OneToMany, PrimaryColumn } from 'typeorm'
|
|
2
|
+
import { Local } from './Local'
|
|
3
|
+
|
|
4
|
+
@Entity({
|
|
5
|
+
comment:
|
|
6
|
+
'Centros comerciales registrados/agregados a la plataforma. \n\nDel centro comercial es importante saber si tiene una plazoleta de comida.',
|
|
7
|
+
})
|
|
8
|
+
export class Square extends BaseEntity {
|
|
9
|
+
@PrimaryColumn({
|
|
10
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
11
|
+
})
|
|
12
|
+
id: number
|
|
13
|
+
|
|
14
|
+
@Column({ length: 50, comment: 'Nombre del centro comercial/plazoleta.' })
|
|
15
|
+
name: string
|
|
16
|
+
|
|
17
|
+
@Column({ length: 100, comment: 'Dirección del centro comercial/plazoleta.' })
|
|
18
|
+
address: string
|
|
19
|
+
|
|
20
|
+
@Column({
|
|
21
|
+
type: 'mediumtext',
|
|
22
|
+
nullable: true,
|
|
23
|
+
comment:
|
|
24
|
+
'Campo de tipo JSON por si se llega a necesitar agregar otras columnas para las plazoletas de los centros comerciales.',
|
|
25
|
+
})
|
|
26
|
+
details: string
|
|
27
|
+
|
|
28
|
+
@Column({
|
|
29
|
+
comment:
|
|
30
|
+
'Cantidad máxima de locales para ese del centro comercial/plazoleta.',
|
|
31
|
+
})
|
|
32
|
+
maximum_number_locals: number
|
|
33
|
+
|
|
34
|
+
@Column({
|
|
35
|
+
length: 50,
|
|
36
|
+
nullable: true,
|
|
37
|
+
comment: 'Correo electrónico del centro comercial/plazoleta.',
|
|
38
|
+
})
|
|
39
|
+
email: string
|
|
40
|
+
|
|
41
|
+
@Column({
|
|
42
|
+
length: 15,
|
|
43
|
+
nullable: true,
|
|
44
|
+
comment: 'Número de celular del centro comercial/plazoleta.',
|
|
45
|
+
})
|
|
46
|
+
phone: string
|
|
47
|
+
|
|
48
|
+
@Column({
|
|
49
|
+
default: 1,
|
|
50
|
+
comment: 'Si la plazoleta está o no activa:\r\n1. Activa.\r\n0. Inactiva.',
|
|
51
|
+
})
|
|
52
|
+
status: number
|
|
53
|
+
|
|
54
|
+
@OneToMany(() => Local, (local) => local.square)
|
|
55
|
+
locals: Local[]
|
|
56
|
+
}
|
package/src/entities/Terminal.ts
CHANGED
|
@@ -5,16 +5,32 @@ import {
|
|
|
5
5
|
ManyToMany,
|
|
6
6
|
JoinTable,
|
|
7
7
|
OneToMany,
|
|
8
|
+
ManyToOne,
|
|
9
|
+
JoinColumn,
|
|
8
10
|
} from 'typeorm'
|
|
9
11
|
import { User } from './User'
|
|
10
12
|
import { TerminalSession } from './TerminalSession'
|
|
13
|
+
import { Local } from './Local'
|
|
11
14
|
|
|
12
|
-
@Entity(
|
|
15
|
+
@Entity({
|
|
16
|
+
comment:
|
|
17
|
+
'Tabla creada para asignar terminales a los computadores que estén en un local y así poder recibir pedidos.',
|
|
18
|
+
})
|
|
13
19
|
export class Terminal {
|
|
14
|
-
@PrimaryGeneratedColumn(
|
|
20
|
+
@PrimaryGeneratedColumn({
|
|
21
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
22
|
+
})
|
|
15
23
|
id: number
|
|
16
24
|
|
|
17
|
-
@
|
|
25
|
+
@ManyToOne(() => Local, (local) => local.terminals, {
|
|
26
|
+
nullable: true,
|
|
27
|
+
onDelete: 'CASCADE',
|
|
28
|
+
onUpdate: 'NO ACTION',
|
|
29
|
+
})
|
|
30
|
+
@JoinColumn({ name: 'local' })
|
|
31
|
+
local: Local
|
|
32
|
+
|
|
33
|
+
@Column({ length: 50, comment: 'Nombre de la terminal.' })
|
|
18
34
|
name: string
|
|
19
35
|
|
|
20
36
|
@Column({
|
|
@@ -25,7 +41,11 @@ export class Terminal {
|
|
|
25
41
|
})
|
|
26
42
|
settings: string
|
|
27
43
|
|
|
28
|
-
@Column({
|
|
44
|
+
@Column({
|
|
45
|
+
default: 1,
|
|
46
|
+
comment:
|
|
47
|
+
'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
48
|
+
})
|
|
29
49
|
status: number
|
|
30
50
|
|
|
31
51
|
@ManyToMany(() => User)
|
|
@@ -1,32 +1,50 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
BaseEntity,
|
|
3
3
|
Column,
|
|
4
|
-
|
|
5
|
-
ManyToOne,
|
|
4
|
+
Entity,
|
|
6
5
|
JoinColumn,
|
|
6
|
+
ManyToOne,
|
|
7
|
+
PrimaryGeneratedColumn,
|
|
7
8
|
} from 'typeorm'
|
|
8
|
-
import { User } from './User'
|
|
9
9
|
import { Terminal } from './Terminal'
|
|
10
|
+
import { User } from './User'
|
|
10
11
|
|
|
11
|
-
@Entity('terminal_session'
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
@Entity('terminal_session', {
|
|
13
|
+
comment:
|
|
14
|
+
'Tabla creada para llevar el control de los inicios de sesión de los usuarios que tiene permiso de esa terminal.',
|
|
15
|
+
})
|
|
16
|
+
export class TerminalSession extends BaseEntity {
|
|
17
|
+
@PrimaryGeneratedColumn({
|
|
18
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
19
|
+
})
|
|
14
20
|
id: number
|
|
15
21
|
|
|
16
|
-
@ManyToOne(() => User, (user) => user.terminalUsers, {
|
|
22
|
+
@ManyToOne(() => User, (user) => user.terminalUsers, {
|
|
23
|
+
nullable: true,
|
|
24
|
+
onDelete: 'CASCADE',
|
|
25
|
+
onUpdate: 'NO ACTION',
|
|
26
|
+
})
|
|
17
27
|
@JoinColumn({ name: 'user' })
|
|
18
28
|
user: User
|
|
19
29
|
|
|
20
30
|
@ManyToOne(() => Terminal, (terminal) => terminal.terminalsUser, {
|
|
21
31
|
nullable: true,
|
|
32
|
+
onDelete: 'CASCADE',
|
|
33
|
+
onUpdate: 'NO ACTION',
|
|
22
34
|
})
|
|
23
35
|
@JoinColumn({ name: 'terminal' })
|
|
24
36
|
terminal: Terminal
|
|
25
37
|
|
|
26
|
-
@Column({
|
|
38
|
+
@Column({
|
|
39
|
+
type: 'datetime',
|
|
40
|
+
comment: 'Fecha de inicio de sesión en la terminal.',
|
|
41
|
+
})
|
|
27
42
|
open: Date
|
|
28
43
|
|
|
29
|
-
@Column({
|
|
44
|
+
@Column({
|
|
45
|
+
type: 'datetime',
|
|
46
|
+
comment: 'Fecha de finalización de la sesión en la terminal.',
|
|
47
|
+
})
|
|
30
48
|
close: Date
|
|
31
49
|
|
|
32
50
|
@Column({
|
package/src/entities/TypeFood.ts
CHANGED
|
@@ -4,18 +4,31 @@ import {
|
|
|
4
4
|
PrimaryGeneratedColumn,
|
|
5
5
|
ManyToMany,
|
|
6
6
|
JoinTable,
|
|
7
|
+
BaseEntity,
|
|
7
8
|
} from 'typeorm'
|
|
8
9
|
import { Company } from './Company'
|
|
9
10
|
|
|
10
|
-
@Entity('type_food'
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
@Entity('type_food', {
|
|
12
|
+
comment: 'Tipo de comida que va a tener la plataforma.',
|
|
13
|
+
})
|
|
14
|
+
export class TypeFood extends BaseEntity {
|
|
15
|
+
@PrimaryGeneratedColumn({
|
|
16
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
17
|
+
})
|
|
13
18
|
id: number
|
|
14
19
|
|
|
15
|
-
@Column({
|
|
20
|
+
@Column({
|
|
21
|
+
length: 40,
|
|
22
|
+
comment:
|
|
23
|
+
'ID de la variable que se encuentra en los archivos `locales` para el multilenguaje.',
|
|
24
|
+
})
|
|
16
25
|
name: string
|
|
17
26
|
|
|
18
|
-
@Column({
|
|
27
|
+
@Column({
|
|
28
|
+
default: 1,
|
|
29
|
+
comment:
|
|
30
|
+
'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
|
|
31
|
+
})
|
|
19
32
|
status: number
|
|
20
33
|
|
|
21
34
|
@ManyToMany(() => Company)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseEntity,
|
|
3
|
+
Column,
|
|
4
|
+
Entity,
|
|
5
|
+
OneToMany,
|
|
6
|
+
PrimaryGeneratedColumn,
|
|
7
|
+
} from 'typeorm'
|
|
8
|
+
import { ProductIngredient } from './ProductIngredient'
|
|
9
|
+
|
|
10
|
+
@Entity('type_measure_ingredient', {
|
|
11
|
+
comment:
|
|
12
|
+
'Unidades de medida que el cliente va a poder agregar para medir en los ingredientes que va a tener cada producto.',
|
|
13
|
+
})
|
|
14
|
+
export class TypeMeasureIngredient extends BaseEntity {
|
|
15
|
+
@PrimaryGeneratedColumn({
|
|
16
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
17
|
+
})
|
|
18
|
+
id: number
|
|
19
|
+
|
|
20
|
+
@Column({
|
|
21
|
+
length: 50,
|
|
22
|
+
comment:
|
|
23
|
+
'Nombre que va a tener la medida, este elemento tiene qué ir con el id/key de los lenguajes. Ver la carpeta locales en el proyecto frontend para ver el id que corresponde a la descripción.',
|
|
24
|
+
})
|
|
25
|
+
name: string
|
|
26
|
+
|
|
27
|
+
@Column({
|
|
28
|
+
length: 50,
|
|
29
|
+
comment:
|
|
30
|
+
'Descripción que va a tener la medida, este elemento tiene qué ir con el id/key de los lenguajes.\r\n\r\nVer la carpeta locales en el proyecto frontend para ver el id que corresponde a la descripción.',
|
|
31
|
+
})
|
|
32
|
+
description: string
|
|
33
|
+
|
|
34
|
+
@Column({
|
|
35
|
+
default: 1,
|
|
36
|
+
comment:
|
|
37
|
+
'Estado que del item tipo de medida del ingrediente.\r\n1. Activo.\r\n0. Inactivo.',
|
|
38
|
+
})
|
|
39
|
+
status: number
|
|
40
|
+
|
|
41
|
+
@OneToMany(
|
|
42
|
+
() => ProductIngredient,
|
|
43
|
+
(productIngredient) => productIngredient.type_measure_ingredient
|
|
44
|
+
)
|
|
45
|
+
type_measure_ingredients: ProductIngredient[]
|
|
46
|
+
}
|
package/src/entities/User.ts
CHANGED
|
@@ -1,78 +1,119 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
BaseEntity,
|
|
3
3
|
Column,
|
|
4
|
-
|
|
5
|
-
ManyToOne,
|
|
4
|
+
Entity,
|
|
6
5
|
JoinColumn,
|
|
7
|
-
ManyToMany,
|
|
8
6
|
JoinTable,
|
|
7
|
+
ManyToMany,
|
|
8
|
+
ManyToOne,
|
|
9
9
|
OneToMany,
|
|
10
|
+
PrimaryGeneratedColumn,
|
|
10
11
|
} from 'typeorm'
|
|
11
12
|
import { City } from './City'
|
|
12
|
-
import {
|
|
13
|
-
import { TerminalSession } from './TerminalSession'
|
|
14
|
-
import { Plan } from './Plan'
|
|
13
|
+
import { CodeRedemptionHistoryUser } from './CodeRedemptionHistoryUser'
|
|
15
14
|
import { Company } from './Company'
|
|
16
|
-
import { Local } from './Local'
|
|
17
15
|
import { DiscountCodeCompany } from './DiscountCodeCompany'
|
|
18
16
|
import { DiscountCodeUser } from './DiscountCodeUser'
|
|
19
|
-
import {
|
|
17
|
+
import { Local } from './Local'
|
|
18
|
+
import { LocalQualification } from './LocalQualification'
|
|
20
19
|
import { Master } from './Master'
|
|
20
|
+
import { Plan } from './Plan'
|
|
21
|
+
import { Request } from './Request'
|
|
22
|
+
import { RequestProduct } from './RequestProduct'
|
|
23
|
+
import { RequestProductGroupComplement } from './RequestProductGroupComplement'
|
|
24
|
+
import { Terminal } from './Terminal'
|
|
25
|
+
import { TerminalSession } from './TerminalSession'
|
|
21
26
|
|
|
22
|
-
@Entity()
|
|
23
|
-
export class User {
|
|
24
|
-
@PrimaryGeneratedColumn(
|
|
27
|
+
@Entity({ comment: 'Usuarios registrados en la plataforma.' })
|
|
28
|
+
export class User extends BaseEntity {
|
|
29
|
+
@PrimaryGeneratedColumn({
|
|
30
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
31
|
+
})
|
|
25
32
|
id: number
|
|
26
33
|
|
|
27
|
-
@Column({ length: 30, unique: true })
|
|
34
|
+
@Column({ length: 30, unique: true, comment: 'Código único del usuario.' })
|
|
28
35
|
code: string
|
|
29
36
|
|
|
30
|
-
@Column(
|
|
31
|
-
|
|
37
|
+
@Column({
|
|
38
|
+
length: 14,
|
|
39
|
+
unique: true,
|
|
40
|
+
comment: 'Número de documento del usuario.',
|
|
41
|
+
})
|
|
42
|
+
document: string
|
|
32
43
|
|
|
33
|
-
@Column({ length: 50 })
|
|
44
|
+
@Column({ length: 50, comment: 'Nombre del usuario.' })
|
|
34
45
|
name: string
|
|
35
46
|
|
|
36
|
-
@Column({ length: 50 })
|
|
47
|
+
@Column({ length: 50, comment: 'Apellidos del usuario.' })
|
|
37
48
|
surname: string
|
|
38
49
|
|
|
39
|
-
@Column({
|
|
50
|
+
@Column({
|
|
51
|
+
length: 60,
|
|
52
|
+
unique: true,
|
|
53
|
+
comment: 'Correo electrónico del usuario.',
|
|
54
|
+
})
|
|
40
55
|
email: string
|
|
41
56
|
|
|
42
|
-
@Column({
|
|
57
|
+
@Column({
|
|
58
|
+
length: 12,
|
|
59
|
+
unique: true,
|
|
60
|
+
comment: 'Número de celular del usuario.',
|
|
61
|
+
})
|
|
43
62
|
phone: string
|
|
44
63
|
|
|
45
|
-
@ManyToOne(() => City, (city) => city.users
|
|
64
|
+
@ManyToOne(() => City, (city) => city.users, {
|
|
65
|
+
onDelete: 'RESTRICT',
|
|
66
|
+
onUpdate: 'NO ACTION',
|
|
67
|
+
})
|
|
46
68
|
@JoinColumn({ name: 'city' })
|
|
47
69
|
city: City
|
|
48
70
|
|
|
49
|
-
@Column({ nullable: true, length: 100 })
|
|
71
|
+
@Column({ nullable: true, length: 100, comment: 'Dirección del usuario.' })
|
|
50
72
|
address: string
|
|
51
73
|
|
|
52
|
-
@Column({
|
|
74
|
+
@Column({
|
|
75
|
+
type: 'decimal',
|
|
76
|
+
precision: 10,
|
|
77
|
+
scale: 8,
|
|
78
|
+
nullable: true,
|
|
79
|
+
comment: 'Latitude de la dirección del usuario.',
|
|
80
|
+
})
|
|
53
81
|
latitude: number
|
|
54
82
|
|
|
55
|
-
@Column({
|
|
83
|
+
@Column({
|
|
84
|
+
type: 'decimal',
|
|
85
|
+
precision: 10,
|
|
86
|
+
scale: 8,
|
|
87
|
+
nullable: true,
|
|
88
|
+
comment: 'Longitude de la dirección del usuario.',
|
|
89
|
+
})
|
|
56
90
|
longitude: number
|
|
57
91
|
|
|
58
|
-
@Column({
|
|
92
|
+
@Column({
|
|
93
|
+
length: 20,
|
|
94
|
+
comment: 'Contraseña almacenada tipo MD5 del usuario.',
|
|
95
|
+
})
|
|
59
96
|
password: string
|
|
60
97
|
|
|
61
98
|
@Column({
|
|
62
99
|
type: 'longtext',
|
|
63
100
|
nullable: true,
|
|
64
101
|
comment:
|
|
65
|
-
'Campo de tipo JSON donde se guarda información necesaria para el
|
|
102
|
+
'Campo de tipo JSON donde se guarda información necesaria para el registro.',
|
|
66
103
|
})
|
|
67
104
|
profile: string
|
|
68
105
|
|
|
69
|
-
@Column({ type: 'datetime' })
|
|
106
|
+
@Column({ type: 'datetime', comment: 'Fecha de creación del registro.' })
|
|
70
107
|
created: Date
|
|
71
108
|
|
|
72
|
-
@Column({ type: 'datetime' })
|
|
109
|
+
@Column({ type: 'datetime', comment: 'Fecha de actualización del registro.' })
|
|
73
110
|
updated: Date
|
|
74
111
|
|
|
75
|
-
@Column({
|
|
112
|
+
@Column({
|
|
113
|
+
default: 1,
|
|
114
|
+
comment:
|
|
115
|
+
'¿El usuario tiene acceso a la plataforma?:\r\n1. Activo: El usuario tiene acceso.\r\n0. Inactivo: El usuario no tiene acceso a la plataforma.',
|
|
116
|
+
})
|
|
76
117
|
status: number
|
|
77
118
|
|
|
78
119
|
@ManyToMany(() => Terminal)
|
|
@@ -119,4 +160,28 @@ export class User {
|
|
|
119
160
|
|
|
120
161
|
@OneToMany(() => Master, (master) => master.user)
|
|
121
162
|
masters: Master[]
|
|
163
|
+
|
|
164
|
+
@OneToMany(
|
|
165
|
+
() => LocalQualification,
|
|
166
|
+
(localQualification) => localQualification.user
|
|
167
|
+
)
|
|
168
|
+
qualifications: LocalQualification[]
|
|
169
|
+
|
|
170
|
+
@OneToMany(() => Request, (request) => request.user)
|
|
171
|
+
requests: Request[]
|
|
172
|
+
|
|
173
|
+
@ManyToMany(() => Request)
|
|
174
|
+
@JoinTable({
|
|
175
|
+
name: 'request_group',
|
|
176
|
+
})
|
|
177
|
+
requests_group: Request[]
|
|
178
|
+
|
|
179
|
+
@OneToMany(() => RequestProduct, (requestProduct) => requestProduct.user)
|
|
180
|
+
request_products: RequestProduct[]
|
|
181
|
+
|
|
182
|
+
@OneToMany(
|
|
183
|
+
() => RequestProductGroupComplement,
|
|
184
|
+
(requestProduct) => requestProduct.user
|
|
185
|
+
)
|
|
186
|
+
request_product_group_complements: RequestProductGroupComplement[]
|
|
122
187
|
}
|
|
@@ -4,29 +4,45 @@ import {
|
|
|
4
4
|
PrimaryGeneratedColumn,
|
|
5
5
|
ManyToOne,
|
|
6
6
|
JoinColumn,
|
|
7
|
+
BaseEntity,
|
|
8
|
+
OneToMany,
|
|
7
9
|
} from 'typeorm'
|
|
8
10
|
import { ProductGroup } from './ProductGroup'
|
|
11
|
+
import { RequestProductGroupComplement } from './RequestProductGroupComplement'
|
|
9
12
|
|
|
10
13
|
@Entity('product_group_complement', {
|
|
11
|
-
comment:
|
|
14
|
+
comment:
|
|
15
|
+
'Los complementos que tiene el grupo de un producto (product_group_complement).',
|
|
12
16
|
})
|
|
13
|
-
export class ProductGroupComplement {
|
|
14
|
-
@PrimaryGeneratedColumn(
|
|
17
|
+
export class ProductGroupComplement extends BaseEntity {
|
|
18
|
+
@PrimaryGeneratedColumn({
|
|
19
|
+
comment: 'Número de identificación (ID) único de cada registro.',
|
|
20
|
+
})
|
|
15
21
|
id: number
|
|
16
22
|
|
|
17
23
|
@ManyToOne(
|
|
18
24
|
() => ProductGroup,
|
|
19
|
-
(productGroup) => productGroup.groups_complement
|
|
25
|
+
(productGroup) => productGroup.groups_complement,
|
|
26
|
+
{
|
|
27
|
+
onDelete: 'CASCADE',
|
|
28
|
+
onUpdate: 'NO ACTION',
|
|
29
|
+
}
|
|
20
30
|
)
|
|
21
31
|
@JoinColumn({ name: 'group_id' })
|
|
22
32
|
group_id: ProductGroup
|
|
23
33
|
|
|
24
|
-
@Column({ length: 30 })
|
|
34
|
+
@Column({ length: 30, comment: 'Nombre del complemento.' })
|
|
25
35
|
name: string
|
|
26
36
|
|
|
27
|
-
@Column({ length: 20 })
|
|
37
|
+
@Column({ length: 20, comment: 'Precio del complemento.' })
|
|
28
38
|
price: string
|
|
29
39
|
|
|
30
|
-
@Column()
|
|
40
|
+
@Column({ comment: 'El orden en que aparece los grupos en el producto.' })
|
|
31
41
|
position: number
|
|
42
|
+
|
|
43
|
+
@OneToMany(
|
|
44
|
+
() => RequestProductGroupComplement,
|
|
45
|
+
(requestProduct) => requestProduct.product_group_complement
|
|
46
|
+
)
|
|
47
|
+
request_product_group_complements: RequestProductGroupComplement[]
|
|
32
48
|
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Entity,
|
|
3
|
-
Column,
|
|
4
|
-
PrimaryGeneratedColumn,
|
|
5
|
-
ManyToOne,
|
|
6
|
-
JoinColumn,
|
|
7
|
-
} from 'typeorm'
|
|
8
|
-
import { Category } from './Category'
|
|
9
|
-
import { Day } from './Day'
|
|
10
|
-
|
|
11
|
-
@Entity('schedule_category', {
|
|
12
|
-
comment:
|
|
13
|
-
'Acá podemos agregar los horarios para las categorías de los productos. O sea, si una categoría sólo está los miércoles, entonces podría agregar el día y los horarios.',
|
|
14
|
-
})
|
|
15
|
-
export class ScheduleCategory {
|
|
16
|
-
@PrimaryGeneratedColumn()
|
|
17
|
-
id: number
|
|
18
|
-
|
|
19
|
-
@ManyToOne(() => Category, { onDelete: 'CASCADE', onUpdate: 'NO ACTION' })
|
|
20
|
-
@JoinColumn({ name: 'category' })
|
|
21
|
-
category: Category
|
|
22
|
-
|
|
23
|
-
@ManyToOne(() => Day, { onDelete: 'CASCADE', onUpdate: 'NO ACTION' })
|
|
24
|
-
@JoinColumn({ name: 'day' })
|
|
25
|
-
day: Day
|
|
26
|
-
|
|
27
|
-
@Column()
|
|
28
|
-
start_time: string
|
|
29
|
-
|
|
30
|
-
@Column()
|
|
31
|
-
end_time: string
|
|
32
|
-
}
|