test-entity-library-asm 3.2.9 → 3.2.11
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/BusinessType.d.ts +2 -2
- package/dist/entities/BusinessType.js +10 -8
- package/dist/entities/BusinessTypeProduct.d.ts +2 -2
- package/dist/entities/BusinessTypeProduct.js +2 -2
- package/dist/entities/Category.d.ts +6 -6
- package/dist/entities/Category.js +12 -6
- package/dist/entities/Company.d.ts +6 -6
- package/dist/entities/Company.js +3 -3
- package/dist/entities/Country.d.ts +1 -1
- package/dist/entities/DiscountCodeCompany.d.ts +8 -8
- package/dist/entities/DiscountCodeCompany.js +26 -24
- package/dist/entities/DiscountCodeUser.d.ts +9 -9
- package/dist/entities/DiscountCodeUser.js +35 -33
- package/dist/entities/Local.d.ts +2 -2
- package/dist/entities/Local.js +1 -1
- package/dist/entities/LocalPlan.d.ts +2 -2
- package/dist/entities/LocalPlan.js +18 -18
- package/dist/entities/LocalQualification.d.ts +3 -3
- package/dist/entities/LocalQualification.js +17 -12
- package/dist/entities/Master.d.ts +2 -2
- package/dist/entities/Master.js +1 -1
- package/dist/entities/MasterNotification.d.ts +4 -4
- package/dist/entities/MasterNotification.js +3 -3
- package/dist/entities/MasterRole.d.ts +1 -1
- package/dist/entities/MasterRole.js +1 -1
- package/dist/entities/Partner.d.ts +6 -5
- package/dist/entities/Partner.js +7 -3
- package/dist/entities/PartnerNotification.d.ts +4 -4
- package/dist/entities/PartnerNotification.js +3 -3
- package/dist/entities/PartnerPermission.d.ts +4 -4
- package/dist/entities/PartnerPermission.js +18 -18
- package/dist/entities/PartnerPermissionSection.d.ts +3 -3
- package/dist/entities/PartnerPermissionSection.js +13 -13
- package/dist/entities/PartnerPlatform.d.ts +3 -3
- package/dist/entities/PartnerPlatform.js +10 -10
- package/dist/entities/PartnerRole.d.ts +5 -5
- package/dist/entities/PartnerRole.js +22 -22
- package/dist/entities/PartnerSession.d.ts +1 -1
- package/dist/entities/PartnerSession.js +1 -4
- package/dist/entities/PaymentMethod.d.ts +4 -6
- package/dist/entities/PaymentMethod.js +11 -22
- package/dist/entities/Plan.d.ts +3 -3
- package/dist/entities/Plan.js +19 -14
- package/dist/entities/PosSystem.d.ts +2 -2
- package/dist/entities/PosSystem.js +12 -12
- package/dist/entities/Product.d.ts +5 -5
- package/dist/entities/Product.js +14 -5
- package/dist/entities/ProductTopping.d.ts +3 -3
- package/dist/entities/ProductTopping.js +9 -9
- package/dist/entities/Request.d.ts +2 -5
- package/dist/entities/Request.js +2 -18
- package/dist/entities/RequestLocal.d.ts +2 -1
- package/dist/entities/RequestLocal.js +4 -0
- package/dist/entities/RequestLocalHistory.d.ts +2 -2
- package/dist/entities/RequestLocalHistory.js +2 -2
- package/dist/entities/RequestLocalPayment.d.ts +19 -0
- package/dist/entities/RequestLocalPayment.js +159 -0
- package/dist/entities/ServicePlan.d.ts +4 -4
- package/dist/entities/ServicePlan.js +21 -23
- package/dist/entities/Square.d.ts +6 -6
- package/dist/entities/Square.js +18 -18
- package/dist/entities/ToppingImage.d.ts +1 -1
- package/dist/entities/ToppingImage.js +1 -1
- package/dist/entities/User.d.ts +7 -6
- package/dist/entities/User.js +22 -20
- package/dist/entities/UserAddress.d.ts +2 -2
- package/dist/entities/UserAddress.js +2 -3
- package/dist/entities/UserPaymentMethod.d.ts +17 -0
- package/dist/entities/UserPaymentMethod.js +118 -0
- package/dist/entities/VerifyLocal.d.ts +4 -4
- package/dist/entities/VerifyLocal.js +32 -32
- package/dist/entities/productGroupComplement.d.ts +5 -5
- package/dist/entities/productGroupComplement.js +3 -3
- package/dist/entities.views.routes.d.ts +2 -0
- package/dist/entities.views.routes.js +5 -1
- package/package.json +1 -1
- package/src/entities/BusinessType.ts +16 -15
- package/src/entities/BusinessTypeProduct.ts +2 -2
- package/src/entities/Category.ts +13 -7
- package/src/entities/Company.ts +8 -8
- package/src/entities/Country.ts +1 -1
- package/src/entities/DiscountCodeCompany.ts +43 -42
- package/src/entities/DiscountCodeUser.ts +52 -50
- package/src/entities/Local.ts +2 -15
- package/src/entities/LocalPlan.ts +31 -31
- package/src/entities/LocalQualification.ts +24 -25
- package/src/entities/Master.ts +2 -2
- package/src/entities/MasterNotification.ts +4 -4
- package/src/entities/MasterRole.ts +1 -1
- package/src/entities/Partner.ts +11 -4
- package/src/entities/PartnerNotification.ts +4 -4
- package/src/entities/PartnerPermission.ts +27 -27
- package/src/entities/PartnerPermissionSection.ts +21 -21
- package/src/entities/PartnerPlatform.ts +17 -17
- package/src/entities/PartnerRole.ts +30 -30
- package/src/entities/PartnerSession.ts +4 -11
- package/src/entities/PaymentMethod.ts +14 -21
- package/src/entities/Plan.ts +31 -26
- package/src/entities/PosSystem.ts +21 -21
- package/src/entities/Product.ts +16 -7
- package/src/entities/ProductTopping.ts +17 -17
- package/src/entities/Request.ts +3 -32
- package/src/entities/RequestLocal.ts +7 -1
- package/src/entities/RequestLocalHistory.ts +2 -2
- package/src/entities/RequestLocalPayment.ts +145 -0
- package/src/entities/ServicePlan.ts +40 -41
- package/src/entities/Square.ts +31 -31
- package/src/entities/ToppingImage.ts +1 -1
- package/src/entities/User.ts +26 -22
- package/src/entities/UserAddress.ts +2 -3
- package/src/entities/UserPaymentMethod.ts +99 -0
- package/src/entities/VerifyLocal.ts +51 -51
- package/src/entities/productGroupComplement.ts +5 -5
- package/src/entities.views.routes.ts +2 -0
|
@@ -1,44 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
ManyToOne,
|
|
6
|
-
PrimaryColumn
|
|
7
|
-
} from 'typeorm'
|
|
8
|
-
import { Local } from './Local'
|
|
9
|
-
import { User } from './User'
|
|
1
|
+
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
|
|
2
|
+
import { Local } from "./Local";
|
|
3
|
+
import { User } from "./User";
|
|
4
|
+
import { DateTransformer } from "../transformers/dateTransformer";
|
|
10
5
|
|
|
11
|
-
@Entity(
|
|
6
|
+
@Entity("local_qualification", {
|
|
12
7
|
comment:
|
|
13
|
-
|
|
8
|
+
"Valoración que los usuarios le dan a los locales cada vez qué realicen una orden, no es obligatorio.\r\n\r\nTodos los locales cuando se crean y no tienen reseñas quedarán con puntaje de 5.",
|
|
14
9
|
})
|
|
15
10
|
export class LocalQualification {
|
|
16
11
|
@PrimaryColumn({
|
|
17
|
-
comment:
|
|
12
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
18
13
|
})
|
|
19
|
-
id: number
|
|
14
|
+
id: number;
|
|
20
15
|
|
|
21
16
|
@Column({
|
|
22
17
|
comment:
|
|
23
|
-
|
|
18
|
+
"Calificación que tiene el local.\r\n1. Mínimo: Mal servicio.\r\n5. Máximo: Excelente servicio\r\n\r\nLa calificación se evalúa haciéndole 3 o 4 preguntas al usuario:\r\n1. Qué tal fue el servicio a la hora de realizar el pedido.\r\n......",
|
|
24
19
|
})
|
|
25
|
-
qualification: number
|
|
20
|
+
qualification: number;
|
|
26
21
|
|
|
27
22
|
@ManyToOne(() => Local, (local) => local.qualifications, {
|
|
28
|
-
onDelete:
|
|
29
|
-
onUpdate:
|
|
23
|
+
onDelete: "CASCADE",
|
|
24
|
+
onUpdate: "NO ACTION",
|
|
30
25
|
})
|
|
31
|
-
@JoinColumn({ name:
|
|
32
|
-
local: Local
|
|
26
|
+
@JoinColumn({ name: "local" })
|
|
27
|
+
local: Local;
|
|
33
28
|
|
|
34
29
|
@ManyToOne(() => User, (user) => user.qualifications, {
|
|
35
30
|
nullable: true,
|
|
36
|
-
onDelete:
|
|
37
|
-
onUpdate:
|
|
31
|
+
onDelete: "SET NULL",
|
|
32
|
+
onUpdate: "NO ACTION",
|
|
38
33
|
})
|
|
39
|
-
@JoinColumn({ name:
|
|
40
|
-
user: User
|
|
34
|
+
@JoinColumn({ name: "user" })
|
|
35
|
+
user: User | null;
|
|
41
36
|
|
|
42
|
-
@Column({
|
|
43
|
-
|
|
37
|
+
@Column({
|
|
38
|
+
type: "datetime",
|
|
39
|
+
transformer: new DateTransformer(),
|
|
40
|
+
comment: "Fecha de creación del registro.",
|
|
41
|
+
})
|
|
42
|
+
created: string;
|
|
44
43
|
}
|
package/src/entities/Master.ts
CHANGED
|
@@ -34,7 +34,7 @@ export class Master {
|
|
|
34
34
|
unique: true,
|
|
35
35
|
comment: "Número de documento del master.",
|
|
36
36
|
})
|
|
37
|
-
document: string;
|
|
37
|
+
document: string | null;
|
|
38
38
|
|
|
39
39
|
@Column({ length: 50, comment: "Nombre del master." })
|
|
40
40
|
name: string;
|
|
@@ -79,7 +79,7 @@ export class Master {
|
|
|
79
79
|
comment:
|
|
80
80
|
"Campo de tipo JSON donde se guarda información necesaria para el registro.",
|
|
81
81
|
})
|
|
82
|
-
profile: any;
|
|
82
|
+
profile: any | null;
|
|
83
83
|
|
|
84
84
|
@Column({
|
|
85
85
|
type: "datetime",
|
|
@@ -27,7 +27,7 @@ export class MasterNotification {
|
|
|
27
27
|
nullable: true,
|
|
28
28
|
})
|
|
29
29
|
@JoinColumn({ name: "master" })
|
|
30
|
-
master: Master;
|
|
30
|
+
master: Master | null;
|
|
31
31
|
|
|
32
32
|
@ManyToOne(() => Partner, (partner) => partner.partner_notifications, {
|
|
33
33
|
onDelete: "CASCADE",
|
|
@@ -35,7 +35,7 @@ export class MasterNotification {
|
|
|
35
35
|
nullable: true,
|
|
36
36
|
})
|
|
37
37
|
@JoinColumn({ name: "partner" })
|
|
38
|
-
partner: Partner;
|
|
38
|
+
partner: Partner | null;
|
|
39
39
|
|
|
40
40
|
@Column({
|
|
41
41
|
length: 200,
|
|
@@ -48,7 +48,7 @@ export class MasterNotification {
|
|
|
48
48
|
nullable: true,
|
|
49
49
|
comment: "Descripción de la notificación.",
|
|
50
50
|
})
|
|
51
|
-
description: string;
|
|
51
|
+
description: string | null;
|
|
52
52
|
|
|
53
53
|
@Column({
|
|
54
54
|
type: "text",
|
|
@@ -57,7 +57,7 @@ export class MasterNotification {
|
|
|
57
57
|
comment:
|
|
58
58
|
"Configuración adicional de la notificación, como enlaces, qué hace después de darle click...",
|
|
59
59
|
})
|
|
60
|
-
settings: any;
|
|
60
|
+
settings: any | null;
|
|
61
61
|
|
|
62
62
|
@Column({
|
|
63
63
|
default: 1,
|
|
@@ -34,7 +34,7 @@ export class MasterRole {
|
|
|
34
34
|
comment:
|
|
35
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
36
|
})
|
|
37
|
-
description: string;
|
|
37
|
+
description: string | null;
|
|
38
38
|
|
|
39
39
|
@Column({
|
|
40
40
|
default: 1,
|
package/src/entities/Partner.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
PartnerSession,
|
|
15
15
|
Product,
|
|
16
16
|
RequestLocalHistory,
|
|
17
|
+
RequestLocalPayment,
|
|
17
18
|
VerifyLocal,
|
|
18
19
|
} from "..";
|
|
19
20
|
import { DateTransformer } from "../transformers/dateTransformer";
|
|
@@ -41,7 +42,7 @@ export class Partner {
|
|
|
41
42
|
nullable: true,
|
|
42
43
|
})
|
|
43
44
|
@JoinColumn({ name: "company" })
|
|
44
|
-
company: Company;
|
|
45
|
+
company: Company | null;
|
|
45
46
|
|
|
46
47
|
@Column({ length: 30, unique: true, comment: "Código único del partner." })
|
|
47
48
|
code: string;
|
|
@@ -52,7 +53,7 @@ export class Partner {
|
|
|
52
53
|
unique: true,
|
|
53
54
|
comment: "Número de documento del partner.",
|
|
54
55
|
})
|
|
55
|
-
document: string;
|
|
56
|
+
document: string | null;
|
|
56
57
|
|
|
57
58
|
@Column({ length: 50, comment: "Nombre del partner." })
|
|
58
59
|
name: string;
|
|
@@ -82,7 +83,7 @@ export class Partner {
|
|
|
82
83
|
city: City;
|
|
83
84
|
|
|
84
85
|
@Column({ nullable: true, length: 100, comment: "Dirección del partner." })
|
|
85
|
-
address: string;
|
|
86
|
+
address: string | null;
|
|
86
87
|
|
|
87
88
|
@Column({
|
|
88
89
|
length: 255,
|
|
@@ -97,7 +98,7 @@ export class Partner {
|
|
|
97
98
|
comment:
|
|
98
99
|
"Campo de tipo JSON donde se guarda información necesaria para el registro.",
|
|
99
100
|
})
|
|
100
|
-
profile: any;
|
|
101
|
+
profile: any | null;
|
|
101
102
|
|
|
102
103
|
@Column({
|
|
103
104
|
default: 0,
|
|
@@ -225,4 +226,10 @@ export class Partner {
|
|
|
225
226
|
(requestLocalHistory) => requestLocalHistory.updated_by
|
|
226
227
|
)
|
|
227
228
|
updated_by_history: RequestLocalHistory[];
|
|
229
|
+
|
|
230
|
+
@OneToMany(
|
|
231
|
+
() => RequestLocalPayment,
|
|
232
|
+
(requestLocalPayment) => requestLocalPayment.partner
|
|
233
|
+
)
|
|
234
|
+
requests_local_payment: RequestLocalPayment[];
|
|
228
235
|
}
|
|
@@ -27,7 +27,7 @@ export class PartnerNotification {
|
|
|
27
27
|
nullable: true,
|
|
28
28
|
})
|
|
29
29
|
@JoinColumn({ name: "partner" })
|
|
30
|
-
partner: Partner;
|
|
30
|
+
partner: Partner | null;
|
|
31
31
|
|
|
32
32
|
@ManyToOne(() => Master, (master) => master.masters_notification, {
|
|
33
33
|
onDelete: "CASCADE",
|
|
@@ -35,7 +35,7 @@ export class PartnerNotification {
|
|
|
35
35
|
nullable: true,
|
|
36
36
|
})
|
|
37
37
|
@JoinColumn({ name: "master" })
|
|
38
|
-
master: Master;
|
|
38
|
+
master: Master | null;
|
|
39
39
|
|
|
40
40
|
@Column({
|
|
41
41
|
length: 200,
|
|
@@ -48,7 +48,7 @@ export class PartnerNotification {
|
|
|
48
48
|
nullable: true,
|
|
49
49
|
comment: "Descripción de la notificación.",
|
|
50
50
|
})
|
|
51
|
-
description: string;
|
|
51
|
+
description: string | null;
|
|
52
52
|
|
|
53
53
|
@Column({
|
|
54
54
|
type: "text",
|
|
@@ -57,7 +57,7 @@ export class PartnerNotification {
|
|
|
57
57
|
comment:
|
|
58
58
|
"Configuración adicional de la notificación, como enlaces, qué hace después de darle click...",
|
|
59
59
|
})
|
|
60
|
-
settings: any;
|
|
60
|
+
settings: any | null;
|
|
61
61
|
|
|
62
62
|
@Column({
|
|
63
63
|
default: 1,
|
|
@@ -6,75 +6,75 @@ import {
|
|
|
6
6
|
ManyToMany,
|
|
7
7
|
ManyToOne,
|
|
8
8
|
PrimaryGeneratedColumn,
|
|
9
|
-
} from
|
|
10
|
-
import { PartnerRole } from
|
|
11
|
-
import { PartnerPermissionSection } from
|
|
9
|
+
} from "typeorm";
|
|
10
|
+
import { PartnerRole } from "./PartnerRole";
|
|
11
|
+
import { PartnerPermissionSection } from "..";
|
|
12
12
|
|
|
13
|
-
@Entity(
|
|
13
|
+
@Entity("partner_permission", {
|
|
14
14
|
comment:
|
|
15
|
-
|
|
15
|
+
"Permisos que estarán disponibles en la plataforma para los usuarios (partners).",
|
|
16
16
|
})
|
|
17
17
|
export class PartnerPermission {
|
|
18
18
|
@PrimaryGeneratedColumn({
|
|
19
|
-
comment:
|
|
19
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
20
20
|
})
|
|
21
|
-
id: number
|
|
21
|
+
id: number;
|
|
22
22
|
|
|
23
|
-
@Column({ length: 10, unique: true, comment:
|
|
24
|
-
code: string
|
|
23
|
+
@Column({ length: 10, unique: true, comment: "Código del permiso." })
|
|
24
|
+
code: string;
|
|
25
25
|
|
|
26
26
|
@ManyToOne(
|
|
27
27
|
() => PartnerPermissionSection,
|
|
28
28
|
(partnerPermissionSection) =>
|
|
29
29
|
partnerPermissionSection.partner_permissions_sections,
|
|
30
30
|
{
|
|
31
|
-
onDelete:
|
|
32
|
-
onUpdate:
|
|
31
|
+
onDelete: "RESTRICT",
|
|
32
|
+
onUpdate: "NO ACTION",
|
|
33
33
|
}
|
|
34
34
|
)
|
|
35
|
-
@JoinColumn({ name:
|
|
36
|
-
section: PartnerPermissionSection
|
|
35
|
+
@JoinColumn({ name: "section" })
|
|
36
|
+
section: PartnerPermissionSection;
|
|
37
37
|
|
|
38
38
|
@Column({
|
|
39
39
|
length: 40,
|
|
40
40
|
comment:
|
|
41
|
-
|
|
41
|
+
"Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
|
|
42
42
|
})
|
|
43
|
-
name: string
|
|
43
|
+
name: string;
|
|
44
44
|
|
|
45
45
|
@Column({
|
|
46
46
|
length: 40,
|
|
47
47
|
comment:
|
|
48
|
-
|
|
48
|
+
"Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
|
|
49
49
|
nullable: true,
|
|
50
50
|
})
|
|
51
|
-
description: string
|
|
51
|
+
description: string | null;
|
|
52
52
|
|
|
53
53
|
@Column({
|
|
54
54
|
length: 20,
|
|
55
|
-
comment:
|
|
55
|
+
comment: "Icono de la sección para los permisos.",
|
|
56
56
|
nullable: true,
|
|
57
57
|
})
|
|
58
|
-
icon: string
|
|
58
|
+
icon: string | null;
|
|
59
59
|
|
|
60
60
|
@Column({
|
|
61
61
|
default: 1,
|
|
62
62
|
comment:
|
|
63
|
-
|
|
63
|
+
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
64
64
|
})
|
|
65
|
-
status: number
|
|
65
|
+
status: number;
|
|
66
66
|
|
|
67
67
|
@ManyToMany(() => PartnerRole, (partnerRole) => partnerRole.roles_permissions)
|
|
68
68
|
@JoinTable({
|
|
69
|
-
name:
|
|
69
|
+
name: "partner_role_permission",
|
|
70
70
|
joinColumn: {
|
|
71
|
-
name:
|
|
72
|
-
referencedColumnName:
|
|
71
|
+
name: "permission",
|
|
72
|
+
referencedColumnName: "id",
|
|
73
73
|
},
|
|
74
74
|
inverseJoinColumn: {
|
|
75
|
-
name:
|
|
76
|
-
referencedColumnName:
|
|
75
|
+
name: "role",
|
|
76
|
+
referencedColumnName: "id",
|
|
77
77
|
},
|
|
78
78
|
})
|
|
79
|
-
roles_permissions: PartnerRole[]
|
|
79
|
+
roles_permissions: PartnerRole[];
|
|
80
80
|
}
|
|
@@ -5,65 +5,65 @@ import {
|
|
|
5
5
|
ManyToOne,
|
|
6
6
|
OneToMany,
|
|
7
7
|
PrimaryGeneratedColumn,
|
|
8
|
-
} from
|
|
9
|
-
import { PartnerPermission, PartnerPlatform } from
|
|
8
|
+
} from "typeorm";
|
|
9
|
+
import { PartnerPermission, PartnerPlatform } from "..";
|
|
10
10
|
|
|
11
|
-
@Entity(
|
|
11
|
+
@Entity("partner_permission_section", {
|
|
12
12
|
comment:
|
|
13
|
-
|
|
13
|
+
"Tabla creada para agregar las secciones para lo permisos del partner.",
|
|
14
14
|
})
|
|
15
15
|
export class PartnerPermissionSection {
|
|
16
16
|
@PrimaryGeneratedColumn({
|
|
17
|
-
comment:
|
|
17
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
18
18
|
})
|
|
19
|
-
id: number
|
|
19
|
+
id: number;
|
|
20
20
|
|
|
21
|
-
@Column({ length: 10, unique: true, comment:
|
|
22
|
-
code: string
|
|
21
|
+
@Column({ length: 10, unique: true, comment: "Código del permiso." })
|
|
22
|
+
code: string;
|
|
23
23
|
|
|
24
24
|
@ManyToOne(
|
|
25
25
|
() => PartnerPlatform,
|
|
26
26
|
(partnerPlatform) => partnerPlatform.partner_platform_sections,
|
|
27
27
|
{
|
|
28
|
-
onDelete:
|
|
29
|
-
onUpdate:
|
|
28
|
+
onDelete: "RESTRICT",
|
|
29
|
+
onUpdate: "NO ACTION",
|
|
30
30
|
}
|
|
31
31
|
)
|
|
32
|
-
@JoinColumn({ name:
|
|
33
|
-
platform: PartnerPlatform
|
|
32
|
+
@JoinColumn({ name: "platform" })
|
|
33
|
+
platform: PartnerPlatform;
|
|
34
34
|
|
|
35
35
|
@Column({
|
|
36
36
|
length: 40,
|
|
37
37
|
comment:
|
|
38
|
-
|
|
38
|
+
"Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
|
|
39
39
|
})
|
|
40
|
-
name: string
|
|
40
|
+
name: string;
|
|
41
41
|
|
|
42
42
|
@Column({
|
|
43
43
|
length: 40,
|
|
44
44
|
comment:
|
|
45
|
-
|
|
45
|
+
"Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
|
|
46
46
|
nullable: true,
|
|
47
47
|
})
|
|
48
|
-
description: string
|
|
48
|
+
description: string | null;
|
|
49
49
|
|
|
50
50
|
@Column({
|
|
51
51
|
length: 20,
|
|
52
|
-
comment:
|
|
52
|
+
comment: "Icono de la sección para los permisos.",
|
|
53
53
|
nullable: true,
|
|
54
54
|
})
|
|
55
|
-
icon: string
|
|
55
|
+
icon: string | null;
|
|
56
56
|
|
|
57
57
|
@Column({
|
|
58
58
|
default: 1,
|
|
59
59
|
comment:
|
|
60
|
-
|
|
60
|
+
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
61
61
|
})
|
|
62
|
-
status: number
|
|
62
|
+
status: number;
|
|
63
63
|
|
|
64
64
|
@OneToMany(
|
|
65
65
|
() => PartnerPermission,
|
|
66
66
|
(partnerPermissionSection) => partnerPermissionSection.section
|
|
67
67
|
)
|
|
68
|
-
partner_permissions_sections: PartnerPermission[]
|
|
68
|
+
partner_permissions_sections: PartnerPermission[];
|
|
69
69
|
}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from
|
|
2
|
-
import { PartnerPermissionSection } from
|
|
1
|
+
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
|
|
2
|
+
import { PartnerPermissionSection } from "..";
|
|
3
3
|
|
|
4
|
-
@Entity(
|
|
5
|
-
comment:
|
|
4
|
+
@Entity("partner_platform", {
|
|
5
|
+
comment: "Tabla creada para agregar las plataformas de los usuarios.",
|
|
6
6
|
})
|
|
7
7
|
export class PartnerPlatform {
|
|
8
8
|
@PrimaryGeneratedColumn({
|
|
9
|
-
comment:
|
|
9
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
10
10
|
})
|
|
11
|
-
id: number
|
|
11
|
+
id: number;
|
|
12
12
|
|
|
13
|
-
@Column({ length: 10, unique: true, comment:
|
|
14
|
-
code: string
|
|
13
|
+
@Column({ length: 10, unique: true, comment: "Código de la sección." })
|
|
14
|
+
code: string;
|
|
15
15
|
|
|
16
16
|
@Column({
|
|
17
17
|
length: 40,
|
|
18
18
|
comment:
|
|
19
|
-
|
|
19
|
+
"Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
|
|
20
20
|
})
|
|
21
|
-
name: string
|
|
21
|
+
name: string;
|
|
22
22
|
|
|
23
23
|
@Column({
|
|
24
24
|
length: 40,
|
|
25
25
|
comment:
|
|
26
|
-
|
|
26
|
+
"Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.",
|
|
27
27
|
nullable: true,
|
|
28
28
|
})
|
|
29
|
-
description: string
|
|
29
|
+
description: string | null;
|
|
30
30
|
|
|
31
31
|
@Column({
|
|
32
32
|
length: 20,
|
|
33
|
-
comment:
|
|
33
|
+
comment: "Icono de la sección para los permisos.",
|
|
34
34
|
nullable: true,
|
|
35
35
|
})
|
|
36
|
-
icon: string
|
|
36
|
+
icon: string | null;
|
|
37
37
|
|
|
38
38
|
@Column({
|
|
39
39
|
default: 1,
|
|
40
40
|
comment:
|
|
41
|
-
|
|
41
|
+
"Estado en el que se encuentra el registro:\r\n1. Activo: El partner tiene acceso.\r\n0. Inactivo: El partner no tiene acceso a la plataforma.",
|
|
42
42
|
})
|
|
43
|
-
status: number
|
|
43
|
+
status: number;
|
|
44
44
|
|
|
45
45
|
@OneToMany(
|
|
46
46
|
() => PartnerPermissionSection,
|
|
47
47
|
(partnerPermissionSection) => partnerPermissionSection.platform
|
|
48
48
|
)
|
|
49
|
-
partner_platform_sections: PartnerPermissionSection[]
|
|
49
|
+
partner_platform_sections: PartnerPermissionSection[];
|
|
50
50
|
}
|
|
@@ -6,38 +6,38 @@ import {
|
|
|
6
6
|
ManyToMany,
|
|
7
7
|
ManyToOne,
|
|
8
8
|
PrimaryGeneratedColumn,
|
|
9
|
-
} from
|
|
10
|
-
import {
|
|
11
|
-
import { Partner } from
|
|
12
|
-
import {
|
|
9
|
+
} from "typeorm";
|
|
10
|
+
import { Company } from "./Company";
|
|
11
|
+
import { Partner } from "./Partner";
|
|
12
|
+
import { PartnerPermission } from "./PartnerPermission";
|
|
13
13
|
|
|
14
|
-
@Entity(
|
|
14
|
+
@Entity("partner_role", {
|
|
15
15
|
comment:
|
|
16
|
-
|
|
16
|
+
"Roles que se le pueden agregar a un usuario (partner) en la plataforma.",
|
|
17
17
|
})
|
|
18
18
|
export class PartnerRole {
|
|
19
19
|
@PrimaryGeneratedColumn({
|
|
20
|
-
comment:
|
|
20
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
21
21
|
})
|
|
22
|
-
id: number
|
|
22
|
+
id: number;
|
|
23
23
|
|
|
24
|
-
@Column({ length: 10, unique: true, comment:
|
|
25
|
-
code: string
|
|
24
|
+
@Column({ length: 10, unique: true, comment: "Código único del rol." })
|
|
25
|
+
code: string;
|
|
26
26
|
|
|
27
27
|
@ManyToOne(() => Company, (company) => company.roles_company, {
|
|
28
|
-
onDelete:
|
|
29
|
-
onUpdate:
|
|
28
|
+
onDelete: "CASCADE",
|
|
29
|
+
onUpdate: "NO ACTION",
|
|
30
30
|
nullable: true,
|
|
31
31
|
})
|
|
32
|
-
@JoinColumn({ name:
|
|
33
|
-
company: Company
|
|
32
|
+
@JoinColumn({ name: "company" })
|
|
33
|
+
company: Company | null;
|
|
34
34
|
|
|
35
35
|
@Column({
|
|
36
36
|
length: 40,
|
|
37
37
|
comment:
|
|
38
38
|
'Id de la variable que se encuentra en los archivos "locale" para el multilenguaje.\r\n\r\nCabe recordar qué los usuarios también pueden crear roles, estos deben ir normal, sin id para el lenguaje.',
|
|
39
39
|
})
|
|
40
|
-
name: string
|
|
40
|
+
name: string;
|
|
41
41
|
|
|
42
42
|
@Column({
|
|
43
43
|
length: 200,
|
|
@@ -45,43 +45,43 @@ export class PartnerRole {
|
|
|
45
45
|
comment:
|
|
46
46
|
'Id de la variable que se encuentra en los archivos "locale" para el multilenguaje.\r\n\r\nCabe recordar qué los usuarios también pueden crear roles, estos deben ir normal, sin id para el lenguaje.',
|
|
47
47
|
})
|
|
48
|
-
description: string
|
|
48
|
+
description: string | null;
|
|
49
49
|
|
|
50
50
|
@Column({
|
|
51
51
|
default: 1,
|
|
52
52
|
comment:
|
|
53
|
-
|
|
53
|
+
"Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
|
|
54
54
|
})
|
|
55
|
-
status: number
|
|
55
|
+
status: number;
|
|
56
56
|
|
|
57
57
|
@ManyToMany(
|
|
58
58
|
() => PartnerPermission,
|
|
59
59
|
(partnerPermission) => partnerPermission.roles_permissions
|
|
60
60
|
)
|
|
61
61
|
@JoinTable({
|
|
62
|
-
name:
|
|
62
|
+
name: "partner_role_permission",
|
|
63
63
|
joinColumn: {
|
|
64
|
-
name:
|
|
65
|
-
referencedColumnName:
|
|
64
|
+
name: "role",
|
|
65
|
+
referencedColumnName: "id",
|
|
66
66
|
},
|
|
67
67
|
inverseJoinColumn: {
|
|
68
|
-
name:
|
|
69
|
-
referencedColumnName:
|
|
68
|
+
name: "permission",
|
|
69
|
+
referencedColumnName: "id",
|
|
70
70
|
},
|
|
71
71
|
})
|
|
72
|
-
roles_permissions: PartnerPermission[]
|
|
72
|
+
roles_permissions: PartnerPermission[];
|
|
73
73
|
|
|
74
74
|
@ManyToMany(() => Partner, (partner) => partner.partners_roles)
|
|
75
75
|
@JoinTable({
|
|
76
|
-
name:
|
|
76
|
+
name: "partner_assigned_role",
|
|
77
77
|
joinColumn: {
|
|
78
|
-
name:
|
|
79
|
-
referencedColumnName:
|
|
78
|
+
name: "role",
|
|
79
|
+
referencedColumnName: "id",
|
|
80
80
|
},
|
|
81
81
|
inverseJoinColumn: {
|
|
82
|
-
name:
|
|
83
|
-
referencedColumnName:
|
|
82
|
+
name: "partner",
|
|
83
|
+
referencedColumnName: "id",
|
|
84
84
|
},
|
|
85
85
|
})
|
|
86
|
-
partners_roles: Partner[]
|
|
86
|
+
partners_roles: Partner[];
|
|
87
87
|
}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Entity,
|
|
3
2
|
Column,
|
|
4
|
-
|
|
5
|
-
ManyToOne,
|
|
3
|
+
Entity,
|
|
6
4
|
JoinColumn,
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
ManyToOne,
|
|
6
|
+
PrimaryGeneratedColumn
|
|
9
7
|
} from "typeorm";
|
|
10
|
-
import { Country } from "./Country";
|
|
11
|
-
import { City } from "./City";
|
|
12
8
|
import { Partner } from "..";
|
|
13
9
|
import { DateTransformer } from "../transformers/dateTransformer";
|
|
14
10
|
|
|
@@ -49,7 +45,6 @@ export class PartnerSession {
|
|
|
49
45
|
|
|
50
46
|
@Column({
|
|
51
47
|
type: "datetime",
|
|
52
|
-
default: () => "CURRENT_TIMESTAMP",
|
|
53
48
|
comment: "Fecha de inicio de la sesión.",
|
|
54
49
|
transformer: new DateTransformer(),
|
|
55
50
|
})
|
|
@@ -61,7 +56,7 @@ export class PartnerSession {
|
|
|
61
56
|
comment: "Fecha de finalización de la sesión.",
|
|
62
57
|
transformer: new DateTransformer(),
|
|
63
58
|
})
|
|
64
|
-
finish_time: Date;
|
|
59
|
+
finish_time: Date | null;
|
|
65
60
|
|
|
66
61
|
@Column({
|
|
67
62
|
default: 1,
|
|
@@ -72,7 +67,6 @@ export class PartnerSession {
|
|
|
72
67
|
|
|
73
68
|
@Column({
|
|
74
69
|
type: "datetime",
|
|
75
|
-
default: () => "CURRENT_TIMESTAMP",
|
|
76
70
|
comment: "Fecha de creación del registro.",
|
|
77
71
|
transformer: new DateTransformer(),
|
|
78
72
|
})
|
|
@@ -80,7 +74,6 @@ export class PartnerSession {
|
|
|
80
74
|
|
|
81
75
|
@Column({
|
|
82
76
|
type: "datetime",
|
|
83
|
-
default: () => "CURRENT_TIMESTAMP",
|
|
84
77
|
comment: "Fecha de actualización del registro.",
|
|
85
78
|
transformer: new DateTransformer(),
|
|
86
79
|
})
|