test-entity-library-asm 2.8.7 → 2.8.9

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.
@@ -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.9",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -7,149 +7,167 @@ import {
7
7
  ManyToOne,
8
8
  OneToMany,
9
9
  PrimaryGeneratedColumn,
10
- } from 'typeorm'
11
- import { MasterNotification, PartnerNotification, ReassignReview, VerifyLocal } from '..'
12
- import { DateTransformer } from '../transformers/dateTransformer'
13
- import { jsonTransformer } from '../transformers/jsonTransformer'
14
- import { City } from './City'
15
- import { DiscountCodeCompany } from './DiscountCodeCompany'
16
- import { MasterRole } from './MasterRole'
10
+ } from "typeorm";
11
+ import {
12
+ MasterNotification,
13
+ PartnerNotification,
14
+ ReassignReview,
15
+ VerifyLocal,
16
+ } from "..";
17
+ import { DateTransformer } from "../transformers/dateTransformer";
18
+ import { jsonTransformer } from "../transformers/jsonTransformer";
19
+ import { City } from "./City";
20
+ import { DiscountCodeCompany } from "./DiscountCodeCompany";
21
+ import { MasterRole } from "./MasterRole";
17
22
 
18
23
  @Entity({
19
24
  comment:
20
- 'Tabla agregada para los usuarios qué son administradores de la plataforma.',
25
+ "Tabla agregada para los usuarios qué son administradores de la plataforma.",
21
26
  })
22
27
  export class Master {
23
28
  @PrimaryGeneratedColumn({
24
- comment: 'Número de identificación (ID) único de cada registro.',
29
+ comment: "Número de identificación (ID) único de cada registro.",
25
30
  })
26
- id: number
31
+ id: number;
27
32
 
28
- @Column({ length: 30, unique: true, comment: 'Código único del master.' })
29
- code: string
33
+ @Column({ length: 30, unique: true, comment: "Código único del master." })
34
+ code: string;
30
35
 
31
36
  @Column({
32
37
  length: 14,
33
38
  nullable: true,
34
39
  unique: true,
35
- comment: 'Número de documento del master.',
40
+ comment: "Número de documento del master.",
36
41
  })
37
- document: string
42
+ document: string;
38
43
 
39
- @Column({ length: 50, comment: 'Nombre del master.' })
40
- name: string
44
+ @Column({ length: 50, comment: "Nombre del master." })
45
+ name: string;
41
46
 
42
- @Column({ length: 50, comment: 'Apellidos del master.' })
43
- surname: string
47
+ @Column({ length: 50, comment: "Apellidos del master." })
48
+ surname: string;
44
49
 
45
50
  @Column({
46
51
  length: 100,
47
52
  unique: true,
48
- comment: 'Correo electrónico del master.',
53
+ comment: "Correo electrónico del master.",
49
54
  })
50
- email: string
55
+ email: string;
51
56
 
52
57
  @Column({
53
58
  length: 12,
54
59
  unique: true,
55
- comment: 'Número de celular del master.',
60
+ comment: "Número de celular del master.",
56
61
  })
57
- phone: string
62
+ phone: string;
58
63
 
59
64
  @ManyToOne(() => City, (city) => city.masters, {
60
- onDelete: 'RESTRICT',
61
- onUpdate: 'NO ACTION',
65
+ onDelete: "RESTRICT",
66
+ onUpdate: "NO ACTION",
62
67
  })
63
- @JoinColumn({ name: 'city' })
64
- city: City
68
+ @JoinColumn({ name: "city" })
69
+ city: City;
65
70
 
66
- @Column({ nullable: true, length: 100, comment: 'Dirección del master.' })
67
- address: string
71
+ @Column({ nullable: true, length: 100, comment: "Dirección del master." })
72
+ address: string;
68
73
 
69
74
  @Column({
70
75
  length: 255,
71
- comment: 'Contraseña almacenada tipo SHA256 del master.',
76
+ comment: "Contraseña almacenada tipo SHA256 del master.",
72
77
  })
73
- password: string
78
+ password: string;
74
79
 
75
80
  @Column({
76
- type: 'longtext',
81
+ type: "longtext",
77
82
  nullable: true,
78
83
  transformer: jsonTransformer,
79
84
  comment:
80
- 'Campo de tipo JSON donde se guarda información necesaria para el registro.',
85
+ "Campo de tipo JSON donde se guarda información necesaria para el registro.",
81
86
  })
82
- profile: any
87
+ profile: any;
83
88
 
84
89
  @Column({
85
- type: 'datetime',
90
+ type: "datetime",
86
91
  transformer: new DateTransformer(),
87
- comment: 'Fecha de creación del registro.',
92
+ comment: "Fecha de creación del registro.",
88
93
  })
89
- created: Date
94
+ created: Date;
90
95
 
91
96
  @Column({
92
- type: 'datetime',
97
+ type: "datetime",
93
98
  transformer: new DateTransformer(),
94
- comment: 'Fecha de actualización del registro.',
99
+ comment: "Fecha de actualización del registro.",
95
100
  })
96
- updated: Date
101
+ updated: Date;
97
102
 
98
103
  @Column({
99
104
  default: 1,
100
105
  comment:
101
- '¿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.',
106
+ "¿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.",
102
107
  })
103
- status: number
108
+ status: number;
104
109
 
105
110
  @Column({
106
111
  default: 1,
107
- comment:
108
- 'Es el estado para verificar si se envía en la papelera o no.',
112
+ comment: "Es el estado para verificar si se envía en la papelera o no.",
109
113
  })
110
- visible: number
114
+ visible: number;
111
115
 
112
116
  @OneToMany(
113
117
  () => DiscountCodeCompany,
114
118
  (discountCodeCompany) => discountCodeCompany.updated_by
115
119
  )
116
- discount_code_companies: DiscountCodeCompany[]
120
+ discount_code_companies: DiscountCodeCompany[];
117
121
 
118
122
  @ManyToMany(() => MasterRole)
119
123
  @JoinTable({
120
- name: 'master_assigned_role',
124
+ name: "master_assigned_role",
121
125
  joinColumn: {
122
- name: 'master',
123
- referencedColumnName: 'id',
126
+ name: "master",
127
+ referencedColumnName: "id",
124
128
  },
125
129
  inverseJoinColumn: {
126
- name: 'role',
127
- referencedColumnName: 'id',
130
+ name: "role",
131
+ referencedColumnName: "id",
128
132
  },
129
133
  })
130
- masters_roles: MasterRole[]
134
+ masters_roles: MasterRole[];
131
135
 
132
136
  @OneToMany(() => VerifyLocal, (verifyLocal) => verifyLocal.partner)
133
- verifyLocals: VerifyLocal[]
137
+ verifyLocals: VerifyLocal[];
134
138
 
135
139
  @OneToMany(
136
140
  () => MasterNotification,
137
141
  (masterNotification) => masterNotification.master
138
142
  )
139
- master_notifications: MasterNotification[]
143
+ master_notifications: MasterNotification[];
140
144
 
141
145
  @OneToMany(
142
146
  () => ReassignReview,
143
147
  (reassignReview) => reassignReview.previous_master
144
148
  )
145
- reassign_reviews: ReassignReview[]
149
+ reassign_reviews: ReassignReview[];
146
150
 
147
151
  @OneToMany(() => ReassignReview, (reassignReview) => reassignReview.new_user)
148
- reassign_review_news: ReassignReview[]
152
+ reassign_review_news: ReassignReview[];
153
+
154
+ @ManyToMany(() => MasterNotification)
155
+ @JoinTable({
156
+ name: "master_to_notification",
157
+ joinColumn: {
158
+ name: "master_notification",
159
+ referencedColumnName: "id",
160
+ },
161
+ inverseJoinColumn: {
162
+ name: "master",
163
+ referencedColumnName: "id",
164
+ },
165
+ })
166
+ masters_to_notification: MasterNotification[];
149
167
 
150
168
  @OneToMany(
151
169
  () => PartnerNotification,
152
170
  (partner_notification) => partner_notification.master
153
171
  )
154
- masters_notification: PartnerNotification[]
172
+ masters_notification: PartnerNotification[];
155
173
  }
@@ -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 { Master } from '..'
9
- import { DateTransformer } from '../transformers/dateTransformer'
10
- import { jsonTransformer } from '../transformers/jsonTransformer'
9
+ } from "typeorm";
10
+ import { Master, Partner } from "..";
11
+ import { DateTransformer } from "../transformers/dateTransformer";
12
+ import { jsonTransformer } from "../transformers/jsonTransformer";
11
13
 
12
- @Entity('master_notification', {
14
+ @Entity("master_notification", {
13
15
  comment:
14
- 'Tabla creada para las notificaciones del master (administrador) de la plataforma.',
16
+ "Tabla creada para las notificaciones del master (administrador) de la plataforma.",
15
17
  })
16
18
  export class MasterNotification {
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(() => Master, (master) => master.master_notifications, {
23
- onDelete: 'CASCADE',
24
- onUpdate: 'NO ACTION',
25
+ onDelete: "CASCADE",
26
+ onUpdate: "NO ACTION",
27
+ nullable: true,
25
28
  })
26
- @JoinColumn({ name: 'master' })
27
- master: Master
29
+ @JoinColumn({ name: "master" })
30
+ master: Master;
31
+
32
+ @ManyToOne(() => Partner, (partner) => partner.partner_notifications, {
33
+ onDelete: "CASCADE",
34
+ onUpdate: "NO ACTION",
35
+ nullable: true,
36
+ })
37
+ @JoinColumn({ name: "partner" })
38
+ partner: Partner;
28
39
 
29
40
  @Column({
30
41
  length: 200,
31
- comment: 'Nombre de la notificación.',
42
+ comment: "Nombre de la notificación.",
32
43
  })
33
- name: string
44
+ name: string;
34
45
 
35
46
  @Column({
36
47
  length: 400,
37
48
  nullable: true,
38
- comment: 'Descripción de la notificación.',
49
+ comment: "Descripción de la notificación.",
39
50
  })
40
- description: string
51
+ description: string;
41
52
 
42
53
  @Column({
43
- type: 'text',
54
+ type: "text",
44
55
  nullable: true,
45
56
  transformer: jsonTransformer,
46
57
  comment:
47
- '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...",
48
59
  })
49
- settings: any
60
+ settings: any;
50
61
 
51
62
  @Column({
52
63
  default: 1,
53
64
  comment:
54
- 'Si la notificación está pendiente o leída:\r\n1. Pendiente.\r\n2. Leída.',
65
+ "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
55
66
  })
56
- type: number
67
+ status: number;
57
68
 
58
69
  @Column({
59
- default: 1,
60
- comment:
61
- 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
70
+ type: "datetime",
71
+ comment: "Fecha de creación de la notificación.",
72
+ transformer: new DateTransformer(),
62
73
  })
63
- status: number
74
+ created: Date;
64
75
 
65
- @Column({
66
- type: 'datetime',
67
- comment: 'Fecha de creación de la notificación.',
68
- transformer: new DateTransformer(),
76
+ @ManyToMany(() => Master)
77
+ @JoinTable({
78
+ name: "master_to_notification",
69
79
  })
70
- created: Date
80
+ master_to_notifications: Master[];
71
81
  }