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.
- package/dist/entities/Master.d.ts +5 -4
- package/dist/entities/Master.js +41 -26
- package/dist/entities/MasterNotification.d.ts +3 -2
- package/dist/entities/MasterNotification.js +30 -20
- package/dist/entities/Partner.d.ts +11 -9
- package/dist/entities/Partner.js +59 -40
- package/dist/entities/PartnerNotification.d.ts +3 -2
- package/dist/entities/PartnerNotification.js +25 -16
- package/package.json +1 -1
- package/src/entities/Master.ts +74 -56
- package/src/entities/MasterNotification.ts +40 -30
- package/src/entities/Partner.ts +98 -79
- package/src/entities/PartnerNotification.ts +39 -29
|
@@ -20,30 +20,32 @@ var PartnerNotification = /** @class */ (function () {
|
|
|
20
20
|
}
|
|
21
21
|
__decorate([
|
|
22
22
|
(0, typeorm_1.PrimaryGeneratedColumn)({
|
|
23
|
-
comment:
|
|
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:
|
|
30
|
-
onUpdate:
|
|
29
|
+
onDelete: "CASCADE",
|
|
30
|
+
onUpdate: "NO ACTION",
|
|
31
|
+
nullable: true,
|
|
31
32
|
}),
|
|
32
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
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:
|
|
38
|
-
onUpdate:
|
|
38
|
+
onDelete: "CASCADE",
|
|
39
|
+
onUpdate: "NO ACTION",
|
|
40
|
+
nullable: true,
|
|
39
41
|
}),
|
|
40
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
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:
|
|
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:
|
|
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:
|
|
62
|
+
type: "text",
|
|
61
63
|
nullable: true,
|
|
62
64
|
transformer: jsonTransformer_1.jsonTransformer,
|
|
63
|
-
comment:
|
|
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:
|
|
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:
|
|
77
|
-
comment:
|
|
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)(
|
|
84
|
-
comment:
|
|
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
package/src/entities/Master.ts
CHANGED
|
@@ -7,149 +7,167 @@ import {
|
|
|
7
7
|
ManyToOne,
|
|
8
8
|
OneToMany,
|
|
9
9
|
PrimaryGeneratedColumn,
|
|
10
|
-
} from
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
25
|
+
"Tabla agregada para los usuarios qué son administradores de la plataforma.",
|
|
21
26
|
})
|
|
22
27
|
export class Master {
|
|
23
28
|
@PrimaryGeneratedColumn({
|
|
24
|
-
comment:
|
|
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:
|
|
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:
|
|
40
|
+
comment: "Número de documento del master.",
|
|
36
41
|
})
|
|
37
|
-
document: string
|
|
42
|
+
document: string;
|
|
38
43
|
|
|
39
|
-
@Column({ length: 50, comment:
|
|
40
|
-
name: string
|
|
44
|
+
@Column({ length: 50, comment: "Nombre del master." })
|
|
45
|
+
name: string;
|
|
41
46
|
|
|
42
|
-
@Column({ length: 50, comment:
|
|
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:
|
|
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:
|
|
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:
|
|
61
|
-
onUpdate:
|
|
65
|
+
onDelete: "RESTRICT",
|
|
66
|
+
onUpdate: "NO ACTION",
|
|
62
67
|
})
|
|
63
|
-
@JoinColumn({ name:
|
|
64
|
-
city: City
|
|
68
|
+
@JoinColumn({ name: "city" })
|
|
69
|
+
city: City;
|
|
65
70
|
|
|
66
|
-
@Column({ nullable: true, length: 100, comment:
|
|
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:
|
|
76
|
+
comment: "Contraseña almacenada tipo SHA256 del master.",
|
|
72
77
|
})
|
|
73
|
-
password: string
|
|
78
|
+
password: string;
|
|
74
79
|
|
|
75
80
|
@Column({
|
|
76
|
-
type:
|
|
81
|
+
type: "longtext",
|
|
77
82
|
nullable: true,
|
|
78
83
|
transformer: jsonTransformer,
|
|
79
84
|
comment:
|
|
80
|
-
|
|
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:
|
|
90
|
+
type: "datetime",
|
|
86
91
|
transformer: new DateTransformer(),
|
|
87
|
-
comment:
|
|
92
|
+
comment: "Fecha de creación del registro.",
|
|
88
93
|
})
|
|
89
|
-
created: Date
|
|
94
|
+
created: Date;
|
|
90
95
|
|
|
91
96
|
@Column({
|
|
92
|
-
type:
|
|
97
|
+
type: "datetime",
|
|
93
98
|
transformer: new DateTransformer(),
|
|
94
|
-
comment:
|
|
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
|
-
|
|
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:
|
|
124
|
+
name: "master_assigned_role",
|
|
121
125
|
joinColumn: {
|
|
122
|
-
name:
|
|
123
|
-
referencedColumnName:
|
|
126
|
+
name: "master",
|
|
127
|
+
referencedColumnName: "id",
|
|
124
128
|
},
|
|
125
129
|
inverseJoinColumn: {
|
|
126
|
-
name:
|
|
127
|
-
referencedColumnName:
|
|
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
|
|
8
|
-
import { Master } from
|
|
9
|
-
import { DateTransformer } from
|
|
10
|
-
import { jsonTransformer } from
|
|
9
|
+
} from "typeorm";
|
|
10
|
+
import { Master, Partner } from "..";
|
|
11
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
12
|
+
import { jsonTransformer } from "../transformers/jsonTransformer";
|
|
11
13
|
|
|
12
|
-
@Entity(
|
|
14
|
+
@Entity("master_notification", {
|
|
13
15
|
comment:
|
|
14
|
-
|
|
16
|
+
"Tabla creada para las notificaciones del master (administrador) de la plataforma.",
|
|
15
17
|
})
|
|
16
18
|
export class MasterNotification {
|
|
17
19
|
@PrimaryGeneratedColumn({
|
|
18
|
-
comment:
|
|
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:
|
|
24
|
-
onUpdate:
|
|
25
|
+
onDelete: "CASCADE",
|
|
26
|
+
onUpdate: "NO ACTION",
|
|
27
|
+
nullable: true,
|
|
25
28
|
})
|
|
26
|
-
@JoinColumn({ name:
|
|
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:
|
|
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:
|
|
49
|
+
comment: "Descripción de la notificación.",
|
|
39
50
|
})
|
|
40
|
-
description: string
|
|
51
|
+
description: string;
|
|
41
52
|
|
|
42
53
|
@Column({
|
|
43
|
-
type:
|
|
54
|
+
type: "text",
|
|
44
55
|
nullable: true,
|
|
45
56
|
transformer: jsonTransformer,
|
|
46
57
|
comment:
|
|
47
|
-
|
|
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
|
-
|
|
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
|
-
|
|
67
|
+
status: number;
|
|
57
68
|
|
|
58
69
|
@Column({
|
|
59
|
-
|
|
60
|
-
comment:
|
|
61
|
-
|
|
70
|
+
type: "datetime",
|
|
71
|
+
comment: "Fecha de creación de la notificación.",
|
|
72
|
+
transformer: new DateTransformer(),
|
|
62
73
|
})
|
|
63
|
-
|
|
74
|
+
created: Date;
|
|
64
75
|
|
|
65
|
-
@
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
transformer: new DateTransformer(),
|
|
76
|
+
@ManyToMany(() => Master)
|
|
77
|
+
@JoinTable({
|
|
78
|
+
name: "master_to_notification",
|
|
69
79
|
})
|
|
70
|
-
|
|
80
|
+
master_to_notifications: Master[];
|
|
71
81
|
}
|