test-entity-library-asm 2.8.7 → 2.8.8

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.
@@ -1,12 +1,12 @@
1
- import { City } from './City';
2
- import { Company } from './Company';
3
- import { DiscountCodeUser } from './DiscountCodeUser';
4
- import { Local } from './Local';
5
- import { PartnerRole } from './PartnerRole';
6
- import { Terminal } from './Terminal';
7
- import { TerminalSession } from './TerminalSession';
8
- import { PartnerNotification } from './PartnerNotification';
9
- import { VerifyLocal } from '..';
1
+ import { City } from "./City";
2
+ import { Company } from "./Company";
3
+ import { DiscountCodeUser } from "./DiscountCodeUser";
4
+ import { Local } from "./Local";
5
+ import { PartnerRole } from "./PartnerRole";
6
+ import { Terminal } from "./Terminal";
7
+ import { TerminalSession } from "./TerminalSession";
8
+ import { PartnerNotification } from "./PartnerNotification";
9
+ import { VerifyLocal } from "..";
10
10
  export declare class Partner {
11
11
  id: number;
12
12
  company: Company;
@@ -34,4 +34,5 @@ export declare class Partner {
34
34
  sessions: TerminalSession[];
35
35
  partners_notification: PartnerNotification[];
36
36
  verifyLocals: VerifyLocal[];
37
+ partners_to_notification: PartnerNotification[];
37
38
  }
@@ -27,21 +27,21 @@ var Partner = /** @class */ (function () {
27
27
  }
28
28
  __decorate([
29
29
  (0, typeorm_1.PrimaryGeneratedColumn)({
30
- comment: 'Número de identificación (ID) único de cada registro.',
30
+ comment: "Número de identificación (ID) único de cada registro.",
31
31
  }),
32
32
  __metadata("design:type", Number)
33
33
  ], Partner.prototype, "id", void 0);
34
34
  __decorate([
35
35
  (0, typeorm_1.ManyToOne)(function () { return Company_1.Company; }, function (company) { return company.partners_company; }, {
36
- onDelete: 'CASCADE',
37
- onUpdate: 'NO ACTION',
36
+ onDelete: "CASCADE",
37
+ onUpdate: "NO ACTION",
38
38
  nullable: true,
39
39
  }),
40
- (0, typeorm_1.JoinColumn)({ name: 'company' }),
40
+ (0, typeorm_1.JoinColumn)({ name: "company" }),
41
41
  __metadata("design:type", Company_1.Company)
42
42
  ], Partner.prototype, "company", void 0);
43
43
  __decorate([
44
- (0, typeorm_1.Column)({ length: 30, unique: true, comment: 'Código único del partner.' }),
44
+ (0, typeorm_1.Column)({ length: 30, unique: true, comment: "Código único del partner." }),
45
45
  __metadata("design:type", String)
46
46
  ], Partner.prototype, "code", void 0);
47
47
  __decorate([
@@ -49,23 +49,23 @@ var Partner = /** @class */ (function () {
49
49
  length: 14,
50
50
  nullable: true,
51
51
  unique: true,
52
- comment: 'Número de documento del partner.',
52
+ comment: "Número de documento del partner.",
53
53
  }),
54
54
  __metadata("design:type", String)
55
55
  ], Partner.prototype, "document", void 0);
56
56
  __decorate([
57
- (0, typeorm_1.Column)({ length: 50, comment: 'Nombre del partner.' }),
57
+ (0, typeorm_1.Column)({ length: 50, comment: "Nombre del partner." }),
58
58
  __metadata("design:type", String)
59
59
  ], Partner.prototype, "name", void 0);
60
60
  __decorate([
61
- (0, typeorm_1.Column)({ length: 50, comment: 'Apellidos del partner.' }),
61
+ (0, typeorm_1.Column)({ length: 50, comment: "Apellidos del partner." }),
62
62
  __metadata("design:type", String)
63
63
  ], Partner.prototype, "surname", void 0);
64
64
  __decorate([
65
65
  (0, typeorm_1.Column)({
66
66
  length: 100,
67
67
  unique: true,
68
- comment: 'Correo electrónico del partner.',
68
+ comment: "Correo electrónico del partner.",
69
69
  }),
70
70
  __metadata("design:type", String)
71
71
  ], Partner.prototype, "email", void 0);
@@ -73,57 +73,57 @@ var Partner = /** @class */ (function () {
73
73
  (0, typeorm_1.Column)({
74
74
  length: 12,
75
75
  unique: true,
76
- comment: 'Número de celular del partner.',
76
+ comment: "Número de celular del partner.",
77
77
  }),
78
78
  __metadata("design:type", String)
79
79
  ], Partner.prototype, "phone", void 0);
80
80
  __decorate([
81
81
  (0, typeorm_1.ManyToOne)(function () { return City_1.City; }, function (city) { return city.partners; }, {
82
- onDelete: 'RESTRICT',
83
- onUpdate: 'NO ACTION',
82
+ onDelete: "RESTRICT",
83
+ onUpdate: "NO ACTION",
84
84
  }),
85
- (0, typeorm_1.JoinColumn)({ name: 'city' }),
85
+ (0, typeorm_1.JoinColumn)({ name: "city" }),
86
86
  __metadata("design:type", City_1.City)
87
87
  ], Partner.prototype, "city", void 0);
88
88
  __decorate([
89
- (0, typeorm_1.Column)({ nullable: true, length: 100, comment: 'Dirección del partner.' }),
89
+ (0, typeorm_1.Column)({ nullable: true, length: 100, comment: "Dirección del partner." }),
90
90
  __metadata("design:type", String)
91
91
  ], Partner.prototype, "address", void 0);
92
92
  __decorate([
93
93
  (0, typeorm_1.Column)({
94
94
  length: 255,
95
- comment: 'Contraseña almacenada tipo SHA256 del partner.',
95
+ comment: "Contraseña almacenada tipo SHA256 del partner.",
96
96
  }),
97
97
  __metadata("design:type", String)
98
98
  ], Partner.prototype, "password", void 0);
99
99
  __decorate([
100
100
  (0, typeorm_1.Column)({
101
- type: 'longtext',
101
+ type: "longtext",
102
102
  nullable: true,
103
103
  transformer: jsonTransformer_1.jsonTransformer,
104
- comment: 'Campo de tipo JSON donde se guarda información necesaria para el registro.',
104
+ comment: "Campo de tipo JSON donde se guarda información necesaria para el registro.",
105
105
  }),
106
106
  __metadata("design:type", Object)
107
107
  ], Partner.prototype, "profile", void 0);
108
108
  __decorate([
109
109
  (0, typeorm_1.Column)({
110
110
  default: 0,
111
- comment: 'En este campo sabemos sí el usuario que está en la tabla es dueño de una empresa/company en la plataforma.',
111
+ comment: "En este campo sabemos sí el usuario que está en la tabla es dueño de una empresa/company en la plataforma.",
112
112
  }),
113
113
  __metadata("design:type", Number)
114
114
  ], Partner.prototype, "owner", void 0);
115
115
  __decorate([
116
116
  (0, typeorm_1.Column)({
117
- type: 'datetime',
118
- comment: 'Fecha de creación del registro.',
117
+ type: "datetime",
118
+ comment: "Fecha de creación del registro.",
119
119
  transformer: new dateTransformer_1.DateTransformer(),
120
120
  }),
121
121
  __metadata("design:type", Date)
122
122
  ], Partner.prototype, "created", void 0);
123
123
  __decorate([
124
124
  (0, typeorm_1.Column)({
125
- type: 'datetime',
126
- comment: 'Fecha de actualización del registro.',
125
+ type: "datetime",
126
+ comment: "Fecha de actualización del registro.",
127
127
  transformer: new dateTransformer_1.DateTransformer(),
128
128
  }),
129
129
  __metadata("design:type", Date)
@@ -131,14 +131,14 @@ var Partner = /** @class */ (function () {
131
131
  __decorate([
132
132
  (0, typeorm_1.Column)({
133
133
  default: 1,
134
- comment: '¿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.',
134
+ comment: "¿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.",
135
135
  }),
136
136
  __metadata("design:type", Number)
137
137
  ], Partner.prototype, "status", void 0);
138
138
  __decorate([
139
139
  (0, typeorm_1.Column)({
140
140
  default: 1,
141
- comment: 'Es el estado para verificar si se envía en la papelera o no.',
141
+ comment: "Es el estado para verificar si se envía en la papelera o no.",
142
142
  }),
143
143
  __metadata("design:type", Number)
144
144
  ], Partner.prototype, "visible", void 0);
@@ -157,14 +157,14 @@ var Partner = /** @class */ (function () {
157
157
  __decorate([
158
158
  (0, typeorm_1.ManyToMany)(function () { return Local_1.Local; }, function (local) { return local.locals_partners; }),
159
159
  (0, typeorm_1.JoinTable)({
160
- name: 'local_partner',
160
+ name: "local_partner",
161
161
  joinColumn: {
162
- name: 'partner',
163
- referencedColumnName: 'id',
162
+ name: "partner",
163
+ referencedColumnName: "id",
164
164
  },
165
165
  inverseJoinColumn: {
166
- name: 'local',
167
- referencedColumnName: 'id',
166
+ name: "local",
167
+ referencedColumnName: "id",
168
168
  },
169
169
  }),
170
170
  __metadata("design:type", Array)
@@ -172,14 +172,14 @@ var Partner = /** @class */ (function () {
172
172
  __decorate([
173
173
  (0, typeorm_1.ManyToMany)(function () { return PartnerRole_1.PartnerRole; }, function (partnerLocal) { return partnerLocal.partners_roles; }),
174
174
  (0, typeorm_1.JoinTable)({
175
- name: 'partner_assigned_role',
175
+ name: "partner_assigned_role",
176
176
  joinColumn: {
177
- name: 'partner',
178
- referencedColumnName: 'id',
177
+ name: "partner",
178
+ referencedColumnName: "id",
179
179
  },
180
180
  inverseJoinColumn: {
181
- name: 'role',
182
- referencedColumnName: 'id',
181
+ name: "role",
182
+ referencedColumnName: "id",
183
183
  },
184
184
  }),
185
185
  __metadata("design:type", Array)
@@ -187,14 +187,14 @@ var Partner = /** @class */ (function () {
187
187
  __decorate([
188
188
  (0, typeorm_1.ManyToMany)(function () { return Terminal_1.Terminal; }, function (terminal) { return terminal.partners; }),
189
189
  (0, typeorm_1.JoinTable)({
190
- name: 'partner_terminal',
190
+ name: "partner_terminal",
191
191
  joinColumn: {
192
- name: 'partner',
193
- referencedColumnName: 'id',
192
+ name: "partner",
193
+ referencedColumnName: "id",
194
194
  },
195
195
  inverseJoinColumn: {
196
- name: 'terminal',
197
- referencedColumnName: 'id',
196
+ name: "terminal",
197
+ referencedColumnName: "id",
198
198
  },
199
199
  }),
200
200
  __metadata("design:type", Array)
@@ -211,9 +211,24 @@ var Partner = /** @class */ (function () {
211
211
  (0, typeorm_1.OneToMany)(function () { return __1.VerifyLocal; }, function (verifyLocal) { return verifyLocal.partner; }),
212
212
  __metadata("design:type", Array)
213
213
  ], Partner.prototype, "verifyLocals", void 0);
214
+ __decorate([
215
+ (0, typeorm_1.ManyToMany)(function () { return PartnerNotification_1.PartnerNotification; }),
216
+ (0, typeorm_1.JoinTable)({
217
+ name: "partner_to_notification",
218
+ joinColumn: {
219
+ name: "partner_notification",
220
+ referencedColumnName: "id",
221
+ },
222
+ inverseJoinColumn: {
223
+ name: "partner",
224
+ referencedColumnName: "id",
225
+ },
226
+ }),
227
+ __metadata("design:type", Array)
228
+ ], Partner.prototype, "partners_to_notification", void 0);
214
229
  Partner = __decorate([
215
230
  (0, typeorm_1.Entity)({
216
- comment: '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.',
231
+ comment: "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.",
217
232
  })
218
233
  ], Partner);
219
234
  return Partner;
@@ -1,5 +1,5 @@
1
- import { Partner } from './Partner';
2
- import { Master } from './Master';
1
+ import { Partner } from "./Partner";
2
+ import { Master } from "./Master";
3
3
  export declare class PartnerNotification {
4
4
  id: number;
5
5
  partner: Partner;
@@ -9,4 +9,5 @@ export declare class PartnerNotification {
9
9
  settings: any;
10
10
  status: number;
11
11
  created: Date;
12
+ partner_to_notifications: Partner[];
12
13
  }
@@ -20,30 +20,32 @@ var PartnerNotification = /** @class */ (function () {
20
20
  }
21
21
  __decorate([
22
22
  (0, typeorm_1.PrimaryGeneratedColumn)({
23
- comment: 'ID único para cada notificación',
23
+ comment: "ID único para cada notificación",
24
24
  }),
25
25
  __metadata("design:type", Number)
26
26
  ], PartnerNotification.prototype, "id", void 0);
27
27
  __decorate([
28
28
  (0, typeorm_1.ManyToOne)(function () { return Partner_1.Partner; }, function (partner) { return partner.partners_notification; }, {
29
- onDelete: 'CASCADE',
30
- onUpdate: 'NO ACTION',
29
+ onDelete: "CASCADE",
30
+ onUpdate: "NO ACTION",
31
+ nullable: true,
31
32
  }),
32
- (0, typeorm_1.JoinColumn)({ name: 'partner' }),
33
+ (0, typeorm_1.JoinColumn)({ name: "partner" }),
33
34
  __metadata("design:type", Partner_1.Partner)
34
35
  ], PartnerNotification.prototype, "partner", void 0);
35
36
  __decorate([
36
37
  (0, typeorm_1.ManyToOne)(function () { return Master_1.Master; }, function (master) { return master.masters_notification; }, {
37
- onDelete: 'CASCADE',
38
- onUpdate: 'NO ACTION',
38
+ onDelete: "CASCADE",
39
+ onUpdate: "NO ACTION",
40
+ nullable: true,
39
41
  }),
40
- (0, typeorm_1.JoinColumn)({ name: 'master' }),
42
+ (0, typeorm_1.JoinColumn)({ name: "master" }),
41
43
  __metadata("design:type", Master_1.Master)
42
44
  ], PartnerNotification.prototype, "master", void 0);
43
45
  __decorate([
44
46
  (0, typeorm_1.Column)({
45
47
  length: 200,
46
- comment: 'Nombre de la notificación.',
48
+ comment: "Nombre de la notificación.",
47
49
  }),
48
50
  __metadata("design:type", String)
49
51
  ], PartnerNotification.prototype, "name", void 0);
@@ -51,37 +53,44 @@ var PartnerNotification = /** @class */ (function () {
51
53
  (0, typeorm_1.Column)({
52
54
  length: 400,
53
55
  nullable: true,
54
- comment: 'Descripción de la notificación.',
56
+ comment: "Descripción de la notificación.",
55
57
  }),
56
58
  __metadata("design:type", String)
57
59
  ], PartnerNotification.prototype, "description", void 0);
58
60
  __decorate([
59
61
  (0, typeorm_1.Column)({
60
- type: 'text',
62
+ type: "text",
61
63
  nullable: true,
62
64
  transformer: jsonTransformer_1.jsonTransformer,
63
- comment: 'Configuración adicional de la notificación, como enlaces, qué hace después de darle click...',
65
+ comment: "Configuración adicional de la notificación, como enlaces, qué hace después de darle click...",
64
66
  }),
65
67
  __metadata("design:type", Object)
66
68
  ], PartnerNotification.prototype, "settings", void 0);
67
69
  __decorate([
68
70
  (0, typeorm_1.Column)({
69
71
  default: 1,
70
- comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
72
+ comment: "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
71
73
  }),
72
74
  __metadata("design:type", Number)
73
75
  ], PartnerNotification.prototype, "status", void 0);
74
76
  __decorate([
75
77
  (0, typeorm_1.Column)({
76
- type: 'datetime',
77
- comment: 'Fecha de creación de la notificación.',
78
+ type: "datetime",
79
+ comment: "Fecha de creación de la notificación.",
78
80
  transformer: new dateTransformer_1.DateTransformer(),
79
81
  }),
80
82
  __metadata("design:type", Date)
81
83
  ], PartnerNotification.prototype, "created", void 0);
84
+ __decorate([
85
+ (0, typeorm_1.ManyToMany)(function () { return Partner_1.Partner; }),
86
+ (0, typeorm_1.JoinTable)({
87
+ name: "partner_to_notification",
88
+ }),
89
+ __metadata("design:type", Array)
90
+ ], PartnerNotification.prototype, "partner_to_notifications", void 0);
82
91
  PartnerNotification = __decorate([
83
- (0, typeorm_1.Entity)('partner_notification', {
84
- comment: 'Tabla creada para almacenar las notificaciones del usuario.',
92
+ (0, typeorm_1.Entity)("partner_notification", {
93
+ comment: "Tabla creada para almacenar las notificaciones del usuario.",
85
94
  })
86
95
  ], PartnerNotification);
87
96
  return PartnerNotification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "2.8.7",
3
+ "version": "2.8.8",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,194 +8,207 @@ import {
8
8
  ManyToOne,
9
9
  OneToMany,
10
10
  PrimaryGeneratedColumn,
11
- } from 'typeorm'
12
- import { jsonTransformer } from '../transformers/jsonTransformer'
13
- import { City } from './City'
14
- import { Company } from './Company'
15
- import { DiscountCodeUser } from './DiscountCodeUser'
16
- import { Local } from './Local'
17
- import { PartnerRole } from './PartnerRole'
18
- import { Terminal } from './Terminal'
19
- import { TerminalSession } from './TerminalSession'
20
- import { DateTransformer } from '../transformers/dateTransformer'
21
- import { PartnerNotification } from './PartnerNotification'
22
- import { VerifyLocal } from '..'
11
+ } from "typeorm";
12
+ import { jsonTransformer } from "../transformers/jsonTransformer";
13
+ import { City } from "./City";
14
+ import { Company } from "./Company";
15
+ import { DiscountCodeUser } from "./DiscountCodeUser";
16
+ import { Local } from "./Local";
17
+ import { PartnerRole } from "./PartnerRole";
18
+ import { Terminal } from "./Terminal";
19
+ import { TerminalSession } from "./TerminalSession";
20
+ import { DateTransformer } from "../transformers/dateTransformer";
21
+ import { PartnerNotification } from "./PartnerNotification";
22
+ import { VerifyLocal } from "..";
23
23
 
24
24
  @Entity({
25
25
  comment:
26
- '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.',
26
+ "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.",
27
27
  })
28
28
  export class Partner {
29
29
  @PrimaryGeneratedColumn({
30
- comment: 'Número de identificación (ID) único de cada registro.',
30
+ comment: "Número de identificación (ID) único de cada registro.",
31
31
  })
32
- id: number
32
+ id: number;
33
33
 
34
34
  @ManyToOne(() => Company, (company) => company.partners_company, {
35
- onDelete: 'CASCADE',
36
- onUpdate: 'NO ACTION',
35
+ onDelete: "CASCADE",
36
+ onUpdate: "NO ACTION",
37
37
  nullable: true,
38
38
  })
39
- @JoinColumn({ name: 'company' })
40
- company: Company
39
+ @JoinColumn({ name: "company" })
40
+ company: Company;
41
41
 
42
- @Column({ length: 30, unique: true, comment: 'Código único del partner.' })
43
- code: string
42
+ @Column({ length: 30, unique: true, comment: "Código único del partner." })
43
+ code: string;
44
44
 
45
45
  @Column({
46
46
  length: 14,
47
47
  nullable: true,
48
48
  unique: true,
49
- comment: 'Número de documento del partner.',
49
+ comment: "Número de documento del partner.",
50
50
  })
51
- document: string
51
+ document: string;
52
52
 
53
- @Column({ length: 50, comment: 'Nombre del partner.' })
54
- name: string
53
+ @Column({ length: 50, comment: "Nombre del partner." })
54
+ name: string;
55
55
 
56
- @Column({ length: 50, comment: 'Apellidos del partner.' })
57
- surname: string
56
+ @Column({ length: 50, comment: "Apellidos del partner." })
57
+ surname: string;
58
58
 
59
59
  @Column({
60
60
  length: 100,
61
61
  unique: true,
62
- comment: 'Correo electrónico del partner.',
62
+ comment: "Correo electrónico del partner.",
63
63
  })
64
- email: string
64
+ email: string;
65
65
 
66
66
  @Column({
67
67
  length: 12,
68
68
  unique: true,
69
- comment: 'Número de celular del partner.',
69
+ comment: "Número de celular del partner.",
70
70
  })
71
- phone: string
71
+ phone: string;
72
72
 
73
73
  @ManyToOne(() => City, (city) => city.partners, {
74
- onDelete: 'RESTRICT',
75
- onUpdate: 'NO ACTION',
74
+ onDelete: "RESTRICT",
75
+ onUpdate: "NO ACTION",
76
76
  })
77
- @JoinColumn({ name: 'city' })
78
- city: City
77
+ @JoinColumn({ name: "city" })
78
+ city: City;
79
79
 
80
- @Column({ nullable: true, length: 100, comment: 'Dirección del partner.' })
81
- address: string
80
+ @Column({ nullable: true, length: 100, comment: "Dirección del partner." })
81
+ address: string;
82
82
 
83
83
  @Column({
84
84
  length: 255,
85
- comment: 'Contraseña almacenada tipo SHA256 del partner.',
85
+ comment: "Contraseña almacenada tipo SHA256 del partner.",
86
86
  })
87
- password: string
87
+ password: string;
88
88
 
89
89
  @Column({
90
- type: 'longtext',
90
+ type: "longtext",
91
91
  nullable: true,
92
92
  transformer: jsonTransformer,
93
93
  comment:
94
- 'Campo de tipo JSON donde se guarda información necesaria para el registro.',
94
+ "Campo de tipo JSON donde se guarda información necesaria para el registro.",
95
95
  })
96
- profile: any
96
+ profile: any;
97
97
 
98
98
  @Column({
99
99
  default: 0,
100
100
  comment:
101
- 'En este campo sabemos sí el usuario que está en la tabla es dueño de una empresa/company en la plataforma.',
101
+ "En este campo sabemos sí el usuario que está en la tabla es dueño de una empresa/company en la plataforma.",
102
102
  })
103
- owner: number
103
+ owner: number;
104
104
 
105
105
  @Column({
106
- type: 'datetime',
107
- comment: 'Fecha de creación del registro.',
106
+ type: "datetime",
107
+ comment: "Fecha de creación del registro.",
108
108
  transformer: new DateTransformer(),
109
109
  })
110
- created: Date
110
+ created: Date;
111
111
 
112
112
  @Column({
113
- type: 'datetime',
114
- comment: 'Fecha de actualización del registro.',
113
+ type: "datetime",
114
+ comment: "Fecha de actualización del registro.",
115
115
  transformer: new DateTransformer(),
116
116
  })
117
- updated: Date
117
+ updated: Date;
118
118
 
119
119
  @Column({
120
120
  default: 1,
121
121
  comment:
122
- '¿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.',
122
+ "¿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.",
123
123
  })
124
- status: number
124
+ status: number;
125
125
 
126
126
  @Column({
127
127
  default: 1,
128
- comment:
129
- 'Es el estado para verificar si se envía en la papelera o no.',
128
+ comment: "Es el estado para verificar si se envía en la papelera o no.",
130
129
  })
131
- visible: number
130
+ visible: number;
132
131
 
133
132
  @OneToMany(() => Company, (company) => company.partner)
134
- companies: Company[]
133
+ companies: Company[];
135
134
 
136
135
  @OneToMany(
137
136
  () => DiscountCodeUser,
138
137
  (discountCodeUser) => discountCodeUser.updated_by
139
138
  )
140
- discount_code_partners: DiscountCodeUser[]
139
+ discount_code_partners: DiscountCodeUser[];
141
140
 
142
141
  @OneToMany(() => Local, (local) => local.updated_by)
143
- locals: Local[]
142
+ locals: Local[];
144
143
 
145
144
  @ManyToMany(() => Local, (local) => local.locals_partners)
146
145
  @JoinTable({
147
- name: 'local_partner',
146
+ name: "local_partner",
148
147
  joinColumn: {
149
- name: 'partner',
150
- referencedColumnName: 'id',
148
+ name: "partner",
149
+ referencedColumnName: "id",
151
150
  },
152
151
  inverseJoinColumn: {
153
- name: 'local',
154
- referencedColumnName: 'id',
152
+ name: "local",
153
+ referencedColumnName: "id",
155
154
  },
156
155
  })
157
- locals_partner: Local[]
156
+ locals_partner: Local[];
158
157
 
159
158
  @ManyToMany(() => PartnerRole, (partnerLocal) => partnerLocal.partners_roles)
160
159
  @JoinTable({
161
- name: 'partner_assigned_role',
160
+ name: "partner_assigned_role",
162
161
  joinColumn: {
163
- name: 'partner',
164
- referencedColumnName: 'id',
162
+ name: "partner",
163
+ referencedColumnName: "id",
165
164
  },
166
165
  inverseJoinColumn: {
167
- name: 'role',
168
- referencedColumnName: 'id',
166
+ name: "role",
167
+ referencedColumnName: "id",
169
168
  },
170
169
  })
171
- partners_roles: PartnerRole[]
170
+ partners_roles: PartnerRole[];
172
171
 
173
172
  @ManyToMany(() => Terminal, (terminal) => terminal.partners)
174
173
  @JoinTable({
175
- name: 'partner_terminal',
174
+ name: "partner_terminal",
176
175
  joinColumn: {
177
- name: 'partner',
178
- referencedColumnName: 'id',
176
+ name: "partner",
177
+ referencedColumnName: "id",
179
178
  },
180
179
  inverseJoinColumn: {
181
- name: 'terminal',
182
- referencedColumnName: 'id',
180
+ name: "terminal",
181
+ referencedColumnName: "id",
183
182
  },
184
183
  })
185
- terminals: Terminal[]
184
+ terminals: Terminal[];
186
185
 
187
186
  @OneToMany(
188
187
  () => TerminalSession,
189
188
  (terminalSession) => terminalSession.partner
190
189
  )
191
- sessions: TerminalSession[]
190
+ sessions: TerminalSession[];
192
191
 
193
192
  @OneToMany(
194
193
  () => PartnerNotification,
195
194
  (partnerNotification) => partnerNotification.partner
196
195
  )
197
- partners_notification: PartnerNotification[]
196
+ partners_notification: PartnerNotification[];
198
197
 
199
198
  @OneToMany(() => VerifyLocal, (verifyLocal) => verifyLocal.partner)
200
- verifyLocals: VerifyLocal[]
199
+ verifyLocals: VerifyLocal[];
200
+
201
+ @ManyToMany(() => PartnerNotification)
202
+ @JoinTable({
203
+ name: "partner_to_notification",
204
+ joinColumn: {
205
+ name: "partner_notification",
206
+ referencedColumnName: "id",
207
+ },
208
+ inverseJoinColumn: {
209
+ name: "partner",
210
+ referencedColumnName: "id",
211
+ },
212
+ })
213
+ partners_to_notification: PartnerNotification[];
201
214
  }
@@ -2,70 +2,80 @@ import {
2
2
  Column,
3
3
  Entity,
4
4
  JoinColumn,
5
+ JoinTable,
6
+ ManyToMany,
5
7
  ManyToOne,
6
8
  PrimaryGeneratedColumn,
7
- } from 'typeorm'
8
- import { Partner } from './Partner'
9
- import { DateTransformer } from '../transformers/dateTransformer'
10
- import { jsonTransformer } from '../transformers/jsonTransformer'
11
- import { Master } from './Master'
9
+ } from "typeorm";
10
+ import { Partner } from "./Partner";
11
+ import { DateTransformer } from "../transformers/dateTransformer";
12
+ import { jsonTransformer } from "../transformers/jsonTransformer";
13
+ import { Master } from "./Master";
12
14
 
13
- @Entity('partner_notification', {
14
- comment: 'Tabla creada para almacenar las notificaciones del usuario.',
15
+ @Entity("partner_notification", {
16
+ comment: "Tabla creada para almacenar las notificaciones del usuario.",
15
17
  })
16
18
  export class PartnerNotification {
17
19
  @PrimaryGeneratedColumn({
18
- comment: 'ID único para cada notificación',
20
+ comment: "ID único para cada notificación",
19
21
  })
20
- id: number
22
+ id: number;
21
23
 
22
24
  @ManyToOne(() => Partner, (partner) => partner.partners_notification, {
23
- onDelete: 'CASCADE',
24
- onUpdate: 'NO ACTION',
25
+ onDelete: "CASCADE",
26
+ onUpdate: "NO ACTION",
27
+ nullable: true,
25
28
  })
26
- @JoinColumn({ name: 'partner' })
27
- partner: Partner
29
+ @JoinColumn({ name: "partner" })
30
+ partner: Partner;
28
31
 
29
32
  @ManyToOne(() => Master, (master) => master.masters_notification, {
30
- onDelete: 'CASCADE',
31
- onUpdate: 'NO ACTION',
33
+ onDelete: "CASCADE",
34
+ onUpdate: "NO ACTION",
35
+ nullable: true,
32
36
  })
33
- @JoinColumn({ name: 'master' })
34
- master: Master
37
+ @JoinColumn({ name: "master" })
38
+ master: Master;
35
39
 
36
40
  @Column({
37
41
  length: 200,
38
- comment: 'Nombre de la notificación.',
42
+ comment: "Nombre de la notificación.",
39
43
  })
40
- name: string
44
+ name: string;
41
45
 
42
46
  @Column({
43
47
  length: 400,
44
48
  nullable: true,
45
- comment: 'Descripción de la notificación.',
49
+ comment: "Descripción de la notificación.",
46
50
  })
47
- description: string
51
+ description: string;
48
52
 
49
53
  @Column({
50
- type: 'text',
54
+ type: "text",
51
55
  nullable: true,
52
56
  transformer: jsonTransformer,
53
57
  comment:
54
- 'Configuración adicional de la notificación, como enlaces, qué hace después de darle click...',
58
+ "Configuración adicional de la notificación, como enlaces, qué hace después de darle click...",
55
59
  })
56
- settings: any
60
+ settings: any;
57
61
 
58
62
  @Column({
59
63
  default: 1,
60
64
  comment:
61
- 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
65
+ "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
62
66
  })
63
- status: number
67
+ status: number;
64
68
 
65
69
  @Column({
66
- type: 'datetime',
67
- comment: 'Fecha de creación de la notificación.',
70
+ type: "datetime",
71
+ comment: "Fecha de creación de la notificación.",
68
72
  transformer: new DateTransformer(),
69
73
  })
70
- created: Date
74
+ created: Date;
75
+
76
+ @ManyToMany(() => Partner)
77
+ @JoinTable({
78
+ name: "partner_to_notification",
79
+ })
80
+ partner_to_notifications: Partner[];
71
81
  }