test-entity-library-asm 1.3.4 → 1.3.6

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.
Files changed (83) hide show
  1. package/dist/entities/City.d.ts +8 -2
  2. package/dist/entities/City.js +17 -2
  3. package/dist/entities/CodeRedemptionHistoryCompany.d.ts +1 -1
  4. package/dist/entities/CodeRedemptionHistoryCompany.js +1 -1
  5. package/dist/entities/Company.d.ts +5 -5
  6. package/dist/entities/Company.js +8 -8
  7. package/dist/entities/DiscountCodeCompany.d.ts +2 -2
  8. package/dist/entities/DiscountCodeCompany.js +3 -3
  9. package/dist/entities/DiscountCodeUser.d.ts +2 -2
  10. package/dist/entities/DiscountCodeUser.js +3 -3
  11. package/dist/entities/Local.d.ts +10 -8
  12. package/dist/entities/Local.js +20 -12
  13. package/dist/entities/LocalQualification.d.ts +1 -1
  14. package/dist/entities/LocalQualification.js +1 -1
  15. package/dist/entities/Master.d.ts +19 -2
  16. package/dist/entities/Master.js +95 -8
  17. package/dist/entities/MasterPermission.d.ts +9 -0
  18. package/dist/entities/MasterPermission.js +63 -0
  19. package/dist/entities/MasterRole.d.ts +11 -0
  20. package/dist/entities/MasterRole.js +88 -0
  21. package/dist/entities/Partner.d.ts +30 -0
  22. package/dist/entities/Partner.js +153 -0
  23. package/dist/entities/PartnerPermission.d.ts +9 -0
  24. package/dist/entities/PartnerPermission.js +63 -0
  25. package/dist/entities/PartnerRole.d.ts +11 -0
  26. package/dist/entities/PartnerRole.js +88 -0
  27. package/dist/entities/PaymentMethod.d.ts +2 -0
  28. package/dist/entities/PaymentMethod.js +8 -0
  29. package/dist/entities/Plan.d.ts +2 -2
  30. package/dist/entities/Plan.js +3 -3
  31. package/dist/entities/Product.d.ts +3 -1
  32. package/dist/entities/Product.js +9 -1
  33. package/dist/entities/Request.d.ts +2 -2
  34. package/dist/entities/Request.js +2 -2
  35. package/dist/entities/Square.d.ts +2 -0
  36. package/dist/entities/Square.js +9 -1
  37. package/dist/entities/Terminal.d.ts +2 -2
  38. package/dist/entities/Terminal.js +5 -5
  39. package/dist/entities/TerminalSession.d.ts +2 -2
  40. package/dist/entities/TerminalSession.js +4 -4
  41. package/dist/entities/User.d.ts +10 -17
  42. package/dist/entities/User.js +69 -50
  43. package/dist/entities/UserAddress.d.ts +14 -0
  44. package/dist/entities/UserAddress.js +98 -0
  45. package/dist/index.d.ts +1 -1
  46. package/dist/index.js +10 -1
  47. package/package.json +1 -1
  48. package/src/entities/Category.ts +3 -5
  49. package/src/entities/CategorySchedule.ts +3 -4
  50. package/src/entities/City.ts +17 -6
  51. package/src/entities/CodeRedemptionHistoryCompany.ts +4 -5
  52. package/src/entities/Company.ts +12 -12
  53. package/src/entities/Configuration.ts +1 -1
  54. package/src/entities/Country.ts +2 -3
  55. package/src/entities/Day.ts +1 -1
  56. package/src/entities/DiscountCodeCompany.ts +7 -7
  57. package/src/entities/DiscountCodeUser.ts +3 -2
  58. package/src/entities/Local.ts +23 -17
  59. package/src/entities/LocalQualification.ts +4 -5
  60. package/src/entities/Master.ts +91 -11
  61. package/src/entities/{Permission.ts → MasterPermission.ts} +11 -11
  62. package/src/entities/MasterRole.ts +73 -0
  63. package/src/entities/Partner.ts +140 -0
  64. package/src/entities/PartnerPermission.ts +49 -0
  65. package/src/entities/{Role.ts → PartnerRole.ts} +26 -18
  66. package/src/entities/PaymentMethod.ts +7 -1
  67. package/src/entities/Plan.ts +6 -7
  68. package/src/entities/Product.ts +13 -5
  69. package/src/entities/ProductIngredient.ts +1 -2
  70. package/src/entities/ProductTopping.ts +3 -4
  71. package/src/entities/Request.ts +3 -4
  72. package/src/entities/RequestProduct.ts +1 -2
  73. package/src/entities/RequestProductGroupComplement.ts +0 -1
  74. package/src/entities/RequestStatus.ts +1 -2
  75. package/src/entities/Square.ts +16 -2
  76. package/src/entities/Terminal.ts +5 -4
  77. package/src/entities/TerminalSession.ts +3 -3
  78. package/src/entities/TypeFood.ts +3 -4
  79. package/src/entities/TypeMeasureIngredient.ts +1 -2
  80. package/src/entities/User.ts +64 -48
  81. package/src/entities/UserAddress.ts +81 -0
  82. package/src/index.ts +12 -6
  83. package/src/entities/RoleVisibleTo.ts +0 -34
@@ -1,24 +1,24 @@
1
1
  import {
2
- Entity,
3
2
  Column,
4
- PrimaryGeneratedColumn,
5
- ManyToOne,
3
+ Entity,
6
4
  JoinColumn,
7
- ManyToMany,
8
5
  JoinTable,
6
+ ManyToMany,
7
+ ManyToOne,
9
8
  OneToMany,
10
- BaseEntity,
9
+ PrimaryGeneratedColumn,
11
10
  } from 'typeorm'
12
- import { Company } from './Company'
13
- import { City } from './City'
14
- import { User } from './User'
15
- import { Product } from './Product'
16
11
  import { Category } from './Category'
17
- import { Square } from './Square'
18
- import { PaymentMethod } from './PaymentMethod'
12
+ import { City } from './City'
13
+ import { Company } from './Company'
19
14
  import { LocalQualification } from './LocalQualification'
15
+ import { PaymentMethod } from './PaymentMethod'
16
+ import { Product } from './Product'
20
17
  import { Request } from './Request'
18
+ import { Square } from './Square'
21
19
  import { Terminal } from './Terminal'
20
+ import { User } from './User'
21
+ import { Partner } from './Partner'
22
22
 
23
23
  @Entity({ comment: 'Locales disponibles de las empresas (company).' })
24
24
  export class Local {
@@ -67,12 +67,12 @@ export class Local {
67
67
  @Column({ type: 'datetime' })
68
68
  updated: Date
69
69
 
70
- @ManyToOne(() => User, (user) => user.locals, {
70
+ @ManyToOne(() => Partner, (partner) => partner.locals, {
71
71
  onDelete: 'NO ACTION',
72
72
  onUpdate: 'NO ACTION',
73
73
  })
74
74
  @JoinColumn({ name: 'update_by' })
75
- updated_by: User
75
+ updated_by: Partner
76
76
 
77
77
  @ManyToOne(() => Square, (square) => square.locals, {
78
78
  onDelete: 'RESTRICT',
@@ -88,11 +88,11 @@ export class Local {
88
88
  })
89
89
  status: number
90
90
 
91
- @ManyToMany(() => User)
91
+ @ManyToMany(() => Partner)
92
92
  @JoinTable({
93
- name: 'local_user',
93
+ name: 'local_partner',
94
94
  joinColumn: {
95
- name: 'user',
95
+ name: 'partner',
96
96
  referencedColumnName: 'id',
97
97
  },
98
98
  inverseJoinColumn: {
@@ -100,7 +100,7 @@ export class Local {
100
100
  referencedColumnName: 'id',
101
101
  },
102
102
  })
103
- users: User[]
103
+ locals_partners: Partner[]
104
104
 
105
105
  @OneToMany(() => Product, (product) => product.local)
106
106
  products: Product[]
@@ -125,4 +125,10 @@ export class Local {
125
125
 
126
126
  @OneToMany(() => Terminal, (terminal) => terminal.local)
127
127
  terminals: Terminal[]
128
+
129
+ @ManyToMany(() => User)
130
+ @JoinTable({
131
+ name: 'user_favorite_local',
132
+ })
133
+ users_favorite_local: User[]
128
134
  }
@@ -1,13 +1,12 @@
1
1
  import {
2
- Entity,
3
2
  Column,
4
- PrimaryColumn,
5
- ManyToOne,
3
+ Entity,
6
4
  JoinColumn,
7
- BaseEntity,
5
+ ManyToOne,
6
+ PrimaryColumn
8
7
  } from 'typeorm'
9
- import { User } from './User'
10
8
  import { Local } from './Local'
9
+ import { User } from './User'
11
10
 
12
11
  @Entity('local_qualification', {
13
12
  comment:
@@ -1,28 +1,108 @@
1
1
  import {
2
- Entity,
3
2
  Column,
4
- PrimaryColumn,
5
- ManyToOne,
3
+ Entity,
6
4
  JoinColumn,
7
- BaseEntity,
5
+ JoinTable,
6
+ ManyToMany,
7
+ ManyToOne,
8
+ OneToMany,
9
+ PrimaryGeneratedColumn,
8
10
  } from 'typeorm'
9
- import { User } from './User'
11
+ import { City } from './City'
12
+ import { DiscountCodeCompany } from './DiscountCodeCompany'
13
+ import { MasterRole } from './MasterRole'
14
+ import { Plan } from './Plan'
10
15
 
11
- @Entity()
16
+ @Entity({
17
+ comment:
18
+ 'Tabla agregada para los usuarios qué son administradores de la plataforma.',
19
+ })
12
20
  export class Master {
13
- @PrimaryColumn({
21
+ @PrimaryGeneratedColumn({
14
22
  comment: 'Número de identificación (ID) único de cada registro.',
15
23
  })
16
24
  id: number
17
25
 
18
- @ManyToOne(() => User, (user) => user.masters)
19
- @JoinColumn({ name: 'user' })
20
- user: User
26
+ @Column({ length: 30, unique: true, comment: 'Código único del master.' })
27
+ code: string
28
+
29
+ @Column({
30
+ length: 14,
31
+ nullable: true,
32
+ unique: true,
33
+ comment: 'Número de documento del master.',
34
+ })
35
+ document: string
36
+
37
+ @Column({ length: 50, comment: 'Nombre del master.' })
38
+ name: string
39
+
40
+ @Column({ length: 50, comment: 'Apellidos del master.' })
41
+ surname: string
42
+
43
+ @Column({
44
+ length: 100,
45
+ unique: true,
46
+ comment: 'Correo electrónico del master.',
47
+ })
48
+ email: string
49
+
50
+ @Column({
51
+ length: 12,
52
+ unique: true,
53
+ comment: 'Número de celular del master.',
54
+ })
55
+ phone: string
56
+
57
+ @ManyToOne(() => City, (city) => city.masters, {
58
+ onDelete: 'RESTRICT',
59
+ onUpdate: 'NO ACTION',
60
+ })
61
+ @JoinColumn({ name: 'city' })
62
+ city: City
63
+
64
+ @Column({ nullable: true, length: 100, comment: 'Dirección del master.' })
65
+ address: string
66
+
67
+ @Column({
68
+ length: 100,
69
+ comment: 'Contraseña almacenada tipo MD5 del master.',
70
+ })
71
+ password: string
72
+
73
+ @Column({
74
+ type: 'longtext',
75
+ nullable: true,
76
+ comment:
77
+ 'Campo de tipo JSON donde se guarda información necesaria para el registro.',
78
+ })
79
+ profile: string
80
+
81
+ @Column({ type: 'datetime', comment: 'Fecha de creación del registro.' })
82
+ created: Date
83
+
84
+ @Column({ type: 'datetime', comment: 'Fecha de actualización del registro.' })
85
+ updated: Date
21
86
 
22
87
  @Column({
23
88
  default: 1,
24
89
  comment:
25
- 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
90
+ '¿El master tiene acceso a la plataforma?:\r\n1. Activo: El master tiene acceso.\r\n0. Inactivo: El master no tiene acceso a la plataforma.',
26
91
  })
27
92
  status: number
93
+
94
+ @OneToMany(
95
+ () => DiscountCodeCompany,
96
+ (discountCodeCompany) => discountCodeCompany.updated_by
97
+ )
98
+ discount_code_companies: DiscountCodeCompany[]
99
+
100
+ @ManyToMany(() => MasterRole)
101
+ @JoinTable({
102
+ name: 'master_assigned_role',
103
+ })
104
+ masters_roles: MasterRole[]
105
+
106
+ @OneToMany(() => Plan, (plan) => plan.created_by)
107
+ plans: Plan[]
28
108
  }
@@ -1,17 +1,17 @@
1
1
  import {
2
- Entity,
3
2
  Column,
4
- PrimaryGeneratedColumn,
5
- ManyToMany,
3
+ Entity,
6
4
  JoinTable,
7
- BaseEntity,
5
+ ManyToMany,
6
+ PrimaryGeneratedColumn,
8
7
  } from 'typeorm'
9
- import { Role } from './Role'
8
+ import { MasterRole } from './MasterRole'
10
9
 
11
- @Entity('permission', {
12
- comment: 'Permisos que va a tener cada rol.',
10
+ @Entity('master_permission', {
11
+ comment:
12
+ 'Permisos que estarán disponibles en la plataforma para los usuarios (masters).',
13
13
  })
14
- export class Permission {
14
+ export class MasterPermission {
15
15
  @PrimaryGeneratedColumn({
16
16
  comment: 'Número de identificación (ID) único de cada registro.',
17
17
  })
@@ -41,9 +41,9 @@ export class Permission {
41
41
  })
42
42
  status: number
43
43
 
44
- @ManyToMany(() => Role)
44
+ @ManyToMany(() => MasterRole)
45
45
  @JoinTable({
46
- name: 'role_permission',
46
+ name: 'master_role_permission',
47
47
  })
48
- roles: Role[]
48
+ roles: MasterRole[]
49
49
  }
@@ -0,0 +1,73 @@
1
+ import {
2
+ Column,
3
+ Entity,
4
+ JoinTable,
5
+ ManyToMany,
6
+ PrimaryGeneratedColumn,
7
+ } from 'typeorm'
8
+ import { Master } from './Master'
9
+ import { MasterPermission } from './MasterPermission'
10
+
11
+ @Entity('master_role', {
12
+ comment:
13
+ 'Roles que se le pueden agregar a un usuario (master) en la plataforma.',
14
+ })
15
+ export class MasterRole {
16
+ @PrimaryGeneratedColumn({
17
+ comment: 'Número de identificación (ID) único de cada registro.',
18
+ })
19
+ id: number
20
+
21
+ @Column({ length: 10, unique: true, comment: 'Código único del rol.' })
22
+ code: string
23
+
24
+ @Column({
25
+ length: 40,
26
+ comment:
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
+ })
29
+ name: string
30
+
31
+ @Column({
32
+ length: 40,
33
+ nullable: true,
34
+ comment:
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
+ })
37
+ description: string
38
+
39
+ @Column({
40
+ default: 1,
41
+ comment:
42
+ 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
43
+ })
44
+ status: number
45
+
46
+ @ManyToMany(() => MasterPermission)
47
+ @JoinTable({
48
+ name: 'master_role_permission',
49
+ joinColumn: {
50
+ name: 'permission',
51
+ referencedColumnName: 'id',
52
+ },
53
+ inverseJoinColumn: {
54
+ name: 'role',
55
+ referencedColumnName: 'id',
56
+ },
57
+ })
58
+ roles_permissions: MasterPermission[]
59
+
60
+ @ManyToMany(() => Master)
61
+ @JoinTable({
62
+ name: 'master_assigned_role',
63
+ joinColumn: {
64
+ name: 'master',
65
+ referencedColumnName: 'id',
66
+ },
67
+ inverseJoinColumn: {
68
+ name: 'role',
69
+ referencedColumnName: 'id',
70
+ },
71
+ })
72
+ masters_roles: Master[]
73
+ }
@@ -0,0 +1,140 @@
1
+ import {
2
+ Column,
3
+ Entity,
4
+ JoinColumn,
5
+ JoinTable,
6
+ ManyToMany,
7
+ ManyToOne,
8
+ OneToMany,
9
+ PrimaryGeneratedColumn,
10
+ } from 'typeorm'
11
+ import { City } from './City'
12
+ import { CodeRedemptionHistoryUser } from './CodeRedemptionHistoryUser'
13
+ import { Company } from './Company'
14
+ import { DiscountCodeCompany } from './DiscountCodeCompany'
15
+ import { DiscountCodeUser } from './DiscountCodeUser'
16
+ import { Local } from './Local'
17
+ import { LocalQualification } from './LocalQualification'
18
+ import { Master } from './Master'
19
+ import { Plan } from './Plan'
20
+ import { Request } from './Request'
21
+ import { RequestProduct } from './RequestProduct'
22
+ import { RequestProductGroupComplement } from './RequestProductGroupComplement'
23
+ import { TerminalSession } from './TerminalSession'
24
+ import { PartnerRole } from './PartnerRole'
25
+ import { Terminal } from './Terminal'
26
+
27
+ @Entity({
28
+ comment:
29
+ 'Tabla agregada para los usuarios qué quieran registrar su local o empresa de comida rápida en la plataforma.\r\n\r\nEste usuario es independiente a los usuarios de la tabla `user` ya que tiene diferentes plataformas.\r\n\r\nTambién van a estar los usuarios qué el administrador/dueño desee agregar como empleados/colaboradores.',
30
+ })
31
+ export class Partner {
32
+ @PrimaryGeneratedColumn({
33
+ comment: 'Número de identificación (ID) único de cada registro.',
34
+ })
35
+ id: number
36
+
37
+ @Column({ length: 30, unique: true, comment: 'Código único del partner.' })
38
+ code: string
39
+
40
+ @Column({
41
+ length: 14,
42
+ nullable: true,
43
+ unique: true,
44
+ comment: 'Número de documento del partner.',
45
+ })
46
+ document: string
47
+
48
+ @Column({ length: 50, comment: 'Nombre del partner.' })
49
+ name: string
50
+
51
+ @Column({ length: 50, comment: 'Apellidos del partner.' })
52
+ surname: string
53
+
54
+ @Column({
55
+ length: 100,
56
+ unique: true,
57
+ comment: 'Correo electrónico del partner.',
58
+ })
59
+ email: string
60
+
61
+ @Column({
62
+ length: 12,
63
+ unique: true,
64
+ comment: 'Número de celular del partner.',
65
+ })
66
+ phone: string
67
+
68
+ @ManyToOne(() => City, (city) => city.partners, {
69
+ onDelete: 'RESTRICT',
70
+ onUpdate: 'NO ACTION',
71
+ })
72
+ @JoinColumn({ name: 'city' })
73
+ city: City
74
+
75
+ @Column({ nullable: true, length: 100, comment: 'Dirección del partner.' })
76
+ address: string
77
+
78
+ @Column({
79
+ length: 100,
80
+ comment: 'Contraseña almacenada tipo MD5 del partner.',
81
+ })
82
+ password: string
83
+
84
+ @Column({
85
+ type: 'longtext',
86
+ nullable: true,
87
+ comment:
88
+ 'Campo de tipo JSON donde se guarda información necesaria para el registro.',
89
+ })
90
+ profile: string
91
+
92
+ @Column({ type: 'datetime', comment: 'Fecha de creación del registro.' })
93
+ created: Date
94
+
95
+ @Column({ type: 'datetime', comment: 'Fecha de actualización del registro.' })
96
+ updated: Date
97
+
98
+ @Column({
99
+ default: 1,
100
+ comment:
101
+ '¿El partner tiene acceso a la plataforma?:\r\n1. Activo: El partner tiene acceso.\r\n0. Inactivo: El partner no tiene acceso a la plataforma.',
102
+ })
103
+ status: number
104
+
105
+ @OneToMany(() => Company, (company) => company.partner)
106
+ companies: Company[]
107
+
108
+ @OneToMany(
109
+ () => DiscountCodeUser,
110
+ (discountCodeUser) => discountCodeUser.updated_by
111
+ )
112
+ discount_code_partners: DiscountCodeUser[]
113
+
114
+ @OneToMany(() => Local, (local) => local.updated_by)
115
+ locals: Local[]
116
+
117
+ @ManyToMany(() => Local)
118
+ @JoinTable({
119
+ name: 'local_partner',
120
+ })
121
+ locals_partner: Local[]
122
+
123
+ @ManyToMany(() => PartnerRole)
124
+ @JoinTable({
125
+ name: 'partner_assigned_role',
126
+ })
127
+ partners_roles: PartnerRole[]
128
+
129
+ @ManyToMany(() => Terminal)
130
+ @JoinTable({
131
+ name: 'partner_terminal',
132
+ })
133
+ terminals: Terminal[]
134
+
135
+ @OneToMany(
136
+ () => TerminalSession,
137
+ (terminalSession) => terminalSession.partner
138
+ )
139
+ sessions: TerminalSession[]
140
+ }
@@ -0,0 +1,49 @@
1
+ import {
2
+ Column,
3
+ Entity,
4
+ JoinTable,
5
+ ManyToMany,
6
+ PrimaryGeneratedColumn,
7
+ } from 'typeorm'
8
+ import { PartnerRole } from './PartnerRole'
9
+
10
+ @Entity('partner_permission', {
11
+ comment:
12
+ 'Permisos que estarán disponibles en la plataforma para los usuarios (partners).',
13
+ })
14
+ export class PartnerPermission {
15
+ @PrimaryGeneratedColumn({
16
+ comment: 'Número de identificación (ID) único de cada registro.',
17
+ })
18
+ id: number
19
+
20
+ @Column({ length: 10, unique: true, comment: 'Código del permiso.' })
21
+ code: string
22
+
23
+ @Column({
24
+ length: 40,
25
+ comment:
26
+ 'Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.',
27
+ })
28
+ name: string
29
+
30
+ @Column({
31
+ length: 40,
32
+ comment:
33
+ 'Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.',
34
+ })
35
+ description: string
36
+
37
+ @Column({
38
+ default: 1,
39
+ comment:
40
+ 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
41
+ })
42
+ status: number
43
+
44
+ @ManyToMany(() => PartnerRole)
45
+ @JoinTable({
46
+ name: 'partner_role_permission',
47
+ })
48
+ roles_permissions: PartnerRole[]
49
+ }
@@ -1,24 +1,24 @@
1
1
  import {
2
- Entity,
3
2
  Column,
4
- PrimaryGeneratedColumn,
5
- ManyToMany,
3
+ Entity,
6
4
  JoinTable,
7
- OneToMany,
5
+ ManyToMany,
6
+ PrimaryGeneratedColumn,
8
7
  } from 'typeorm'
9
- import { Permission } from './Permission'
10
- import { RoleVisibleTo } from './RoleVisibleTo'
8
+ import { PartnerPermission } from './PartnerPermission'
9
+ import { Partner } from './Partner'
11
10
 
12
- @Entity({
13
- comment: 'Roles que se le pueden agregar a un usuario en la plataforma.',
11
+ @Entity('partner_role', {
12
+ comment:
13
+ 'Roles que se le pueden agregar a un usuario (partner) en la plataforma.',
14
14
  })
15
- export class Role {
15
+ export class PartnerRole {
16
16
  @PrimaryGeneratedColumn({
17
17
  comment: 'Número de identificación (ID) único de cada registro.',
18
18
  })
19
19
  id: number
20
20
 
21
- @Column({ length: 10, comment: 'Código único del rol.' })
21
+ @Column({ length: 10, unique: true, comment: 'Código único del rol.' })
22
22
  code: string
23
23
 
24
24
  @Column({
@@ -43,9 +43,9 @@ export class Role {
43
43
  })
44
44
  status: number
45
45
 
46
- @ManyToMany(() => Permission)
46
+ @ManyToMany(() => PartnerPermission)
47
47
  @JoinTable({
48
- name: 'role_permission',
48
+ name: 'partner_role_permission',
49
49
  joinColumn: {
50
50
  name: 'permission',
51
51
  referencedColumnName: 'id',
@@ -55,11 +55,19 @@ export class Role {
55
55
  referencedColumnName: 'id',
56
56
  },
57
57
  })
58
- permissions: Permission[]
58
+ roles_permissions: PartnerPermission[]
59
59
 
60
- @OneToMany(() => RoleVisibleTo, (roleVisibleTo) => roleVisibleTo.role)
61
- rolesVisibleTo: RoleVisibleTo[]
62
-
63
- @OneToMany(() => RoleVisibleTo, (roleVisibleTo) => roleVisibleTo.visible_to)
64
- visiblesTo: RoleVisibleTo[]
60
+ @ManyToMany(() => Partner)
61
+ @JoinTable({
62
+ name: 'partner_assigned_role',
63
+ joinColumn: {
64
+ name: 'partner',
65
+ referencedColumnName: 'id',
66
+ },
67
+ inverseJoinColumn: {
68
+ name: 'role',
69
+ referencedColumnName: 'id',
70
+ },
71
+ })
72
+ partners_roles: Partner[]
65
73
  }
@@ -1,5 +1,4 @@
1
1
  import {
2
- BaseEntity,
3
2
  Column,
4
3
  Entity,
5
4
  JoinTable,
@@ -9,6 +8,7 @@ import {
9
8
  } from 'typeorm'
10
9
  import { Local } from './Local'
11
10
  import { Request } from './Request'
11
+ import { User } from './User'
12
12
 
13
13
  @Entity('payment_method', {
14
14
  comment:
@@ -69,4 +69,10 @@ export class PaymentMethod {
69
69
 
70
70
  @OneToMany(() => Request, (request) => request.payment_method)
71
71
  requests: Request[]
72
+
73
+ @ManyToMany(() => User)
74
+ @JoinTable({
75
+ name: 'user_payment_method',
76
+ })
77
+ user_payments_method: User[]
72
78
  }
@@ -1,14 +1,13 @@
1
1
  import {
2
- Entity,
3
2
  Column,
4
- PrimaryGeneratedColumn,
5
- ManyToOne,
3
+ Entity,
6
4
  JoinColumn,
5
+ ManyToOne,
7
6
  OneToMany,
8
- BaseEntity,
7
+ PrimaryGeneratedColumn,
9
8
  } from 'typeorm'
10
- import { User } from './User'
11
9
  import { Company } from './Company'
10
+ import { Master } from './Master'
12
11
 
13
12
  @Entity({
14
13
  comment: 'Planes que tendrá la plataforma para las empresas (company)',
@@ -50,13 +49,13 @@ export class Plan {
50
49
  @Column({ type: 'date', comment: 'Fecha de expiración del registro.' })
51
50
  expiration: Date
52
51
 
53
- @ManyToOne(() => User, (user) => user.plans, {
52
+ @ManyToOne(() => Master, (user) => user.plans, {
54
53
  nullable: true,
55
54
  onDelete: 'RESTRICT',
56
55
  onUpdate: 'NO ACTION',
57
56
  })
58
57
  @JoinColumn({ name: 'created_by' })
59
- created_by: User
58
+ created_by: Master
60
59
 
61
60
  @Column({
62
61
  default: 1,
@@ -1,17 +1,19 @@
1
1
  import {
2
- Entity,
3
2
  Column,
4
- PrimaryGeneratedColumn,
5
- ManyToOne,
3
+ Entity,
6
4
  JoinColumn,
5
+ JoinTable,
6
+ ManyToMany,
7
+ ManyToOne,
7
8
  OneToMany,
8
- BaseEntity,
9
+ PrimaryGeneratedColumn,
9
10
  } from 'typeorm'
11
+ import { Category } from './Category'
10
12
  import { Local } from './Local'
11
13
  import { ProductGroup } from './ProductGroup'
12
- import { Category } from './Category'
13
14
  import { ProductIngredient } from './ProductIngredient'
14
15
  import { RequestProduct } from './RequestProduct'
16
+ import { User } from './User'
15
17
 
16
18
  @Entity({
17
19
  comment:
@@ -97,4 +99,10 @@ export class Product {
97
99
 
98
100
  @OneToMany(() => RequestProduct, (requestProduct) => requestProduct.product)
99
101
  request_products: RequestProduct[]
102
+
103
+ @ManyToMany(() => User)
104
+ @JoinTable({
105
+ name: 'user_favorite_product',
106
+ })
107
+ users_favorite_product: User[]
100
108
  }