test-entity-library-asm 3.1.7 → 3.2.0
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/BusinessTypeProduct.d.ts +2 -2
- package/dist/entities/BusinessTypeProduct.js +15 -15
- package/dist/entities/Local.d.ts +2 -3
- package/dist/entities/Local.js +37 -10
- package/dist/entities/Master.js +4 -4
- package/dist/entities/MasterNotification.js +9 -1
- package/dist/entities/MasterPermission.d.ts +1 -1
- package/dist/entities/MasterPermission.js +17 -9
- package/dist/entities/MasterRole.d.ts +2 -2
- package/dist/entities/MasterRole.js +17 -17
- package/dist/entities/Partner.d.ts +1 -1
- package/dist/entities/Partner.js +5 -5
- package/dist/entities/PartnerNotification.js +9 -1
- package/dist/entities/PartnerSession.js +1 -1
- package/dist/entities/PaymentMethod.d.ts +3 -3
- package/dist/entities/PaymentMethod.js +25 -17
- package/dist/entities/Product.js +9 -1
- package/dist/entities/Request.d.ts +11 -7
- package/dist/entities/Request.js +68 -28
- package/dist/entities/Square.js +10 -2
- package/dist/entities/User.d.ts +11 -11
- package/dist/entities/User.js +52 -44
- package/package.json +1 -1
- package/src/entities/BusinessTypeProduct.ts +24 -24
- package/src/entities/Local.ts +40 -10
- package/src/entities/Master.ts +8 -9
- package/src/entities/MasterNotification.ts +9 -1
- package/src/entities/MasterPermission.ts +25 -17
- package/src/entities/MasterRole.ts +30 -27
- package/src/entities/Partner.ts +16 -7
- package/src/entities/PartnerNotification.ts +9 -1
- package/src/entities/PartnerSession.ts +1 -1
- package/src/entities/PaymentMethod.ts +38 -30
- package/src/entities/Product.ts +9 -1
- package/src/entities/Request.ts +85 -45
- package/src/entities/Square.ts +11 -3
- package/src/entities/User.ts +93 -83
package/src/entities/User.ts
CHANGED
|
@@ -7,183 +7,193 @@ import {
|
|
|
7
7
|
ManyToOne,
|
|
8
8
|
OneToMany,
|
|
9
9
|
PrimaryGeneratedColumn,
|
|
10
|
-
} from
|
|
11
|
-
import { City } from
|
|
12
|
-
import { CodeRedemptionHistoryUser } from
|
|
13
|
-
import { LocalQualification } from
|
|
14
|
-
import { Request } from
|
|
15
|
-
import { RequestProduct } from
|
|
16
|
-
import { RequestProductGroupComplement } from
|
|
17
|
-
import { UserAddress } from
|
|
18
|
-
import { PaymentMethod } from
|
|
19
|
-
import { Square } from
|
|
20
|
-
import { Local } from
|
|
21
|
-
import { Product } from
|
|
22
|
-
|
|
23
|
-
@Entity({ comment:
|
|
10
|
+
} from "typeorm";
|
|
11
|
+
import { City } from "./City";
|
|
12
|
+
import { CodeRedemptionHistoryUser } from "./CodeRedemptionHistoryUser";
|
|
13
|
+
import { LocalQualification } from "./LocalQualification";
|
|
14
|
+
import { Request } from "./Request";
|
|
15
|
+
import { RequestProduct } from "./RequestProduct";
|
|
16
|
+
import { RequestProductGroupComplement } from "./RequestProductGroupComplement";
|
|
17
|
+
import { UserAddress } from "./UserAddress";
|
|
18
|
+
import { PaymentMethod } from "./PaymentMethod";
|
|
19
|
+
import { Square } from "./Square";
|
|
20
|
+
import { Local } from "./Local";
|
|
21
|
+
import { Product } from "./Product";
|
|
22
|
+
|
|
23
|
+
@Entity({ comment: "Usuarios registrados en la plataforma." })
|
|
24
24
|
export class User {
|
|
25
25
|
@PrimaryGeneratedColumn({
|
|
26
|
-
comment:
|
|
26
|
+
comment: "Número de identificación (ID) único de cada registro.",
|
|
27
27
|
})
|
|
28
|
-
id: number
|
|
28
|
+
id: number;
|
|
29
29
|
|
|
30
|
-
@Column({ length: 30, unique: true, comment:
|
|
31
|
-
code: string
|
|
30
|
+
@Column({ length: 30, unique: true, comment: "Código único del usuario." })
|
|
31
|
+
code: string;
|
|
32
32
|
|
|
33
33
|
@Column({
|
|
34
34
|
length: 14,
|
|
35
35
|
unique: true,
|
|
36
|
-
comment:
|
|
36
|
+
comment: "Número de documento del usuario.",
|
|
37
37
|
})
|
|
38
|
-
document: string
|
|
38
|
+
document: string;
|
|
39
39
|
|
|
40
|
-
@Column({ length: 50, comment:
|
|
41
|
-
name: string
|
|
40
|
+
@Column({ length: 50, comment: "Nombre del usuario." })
|
|
41
|
+
name: string;
|
|
42
42
|
|
|
43
|
-
@Column({ length: 50, comment:
|
|
44
|
-
surname: string
|
|
43
|
+
@Column({ length: 50, comment: "Apellidos del usuario." })
|
|
44
|
+
surname: string;
|
|
45
45
|
|
|
46
46
|
@Column({
|
|
47
47
|
length: 60,
|
|
48
48
|
unique: true,
|
|
49
|
-
comment:
|
|
49
|
+
comment: "Correo electrónico del usuario.",
|
|
50
50
|
})
|
|
51
|
-
email: string
|
|
51
|
+
email: string;
|
|
52
52
|
|
|
53
53
|
@Column({
|
|
54
54
|
length: 12,
|
|
55
55
|
unique: true,
|
|
56
|
-
comment:
|
|
56
|
+
comment: "Número de celular del usuario.",
|
|
57
57
|
})
|
|
58
|
-
phone: string
|
|
58
|
+
phone: string;
|
|
59
59
|
|
|
60
60
|
@ManyToOne(() => City, (city) => city.users, {
|
|
61
|
-
onDelete:
|
|
62
|
-
onUpdate:
|
|
61
|
+
onDelete: "RESTRICT",
|
|
62
|
+
onUpdate: "NO ACTION",
|
|
63
63
|
})
|
|
64
|
-
@JoinColumn({ name:
|
|
65
|
-
city: City
|
|
64
|
+
@JoinColumn({ name: "city" })
|
|
65
|
+
city: City;
|
|
66
66
|
|
|
67
67
|
@Column({
|
|
68
68
|
length: 255,
|
|
69
|
-
comment:
|
|
69
|
+
comment: "Contraseña almacenada tipo SHA256 del usuario.",
|
|
70
70
|
})
|
|
71
|
-
password: string
|
|
71
|
+
password: string;
|
|
72
72
|
|
|
73
73
|
@Column({
|
|
74
|
-
type:
|
|
74
|
+
type: "longtext",
|
|
75
75
|
nullable: true,
|
|
76
76
|
comment:
|
|
77
|
-
|
|
77
|
+
"Campo de tipo JSON donde se guarda información necesaria para el registro.",
|
|
78
78
|
})
|
|
79
|
-
profile: string
|
|
79
|
+
profile: string;
|
|
80
80
|
|
|
81
|
-
@Column({ type:
|
|
82
|
-
created: Date
|
|
81
|
+
@Column({ type: "datetime", comment: "Fecha de creación del registro." })
|
|
82
|
+
created: Date;
|
|
83
83
|
|
|
84
|
-
@Column({ type:
|
|
85
|
-
updated: Date
|
|
84
|
+
@Column({ type: "datetime", comment: "Fecha de actualización del registro." })
|
|
85
|
+
updated: Date;
|
|
86
86
|
|
|
87
87
|
@Column({
|
|
88
88
|
default: 1,
|
|
89
89
|
comment:
|
|
90
|
-
|
|
90
|
+
"¿El usuario tiene acceso a la plataforma?:\r\n1. Activo: El usuario tiene acceso.\r\n0. Inactivo: El usuario no tiene acceso a la plataforma.",
|
|
91
91
|
})
|
|
92
|
-
status: number
|
|
92
|
+
status: number;
|
|
93
93
|
|
|
94
94
|
@Column({
|
|
95
95
|
default: 1,
|
|
96
|
-
comment:
|
|
97
|
-
'Es el estado para verificar si se envia en la papelara o no.',
|
|
96
|
+
comment: "Es el estado para verificar si se envia en la papelara o no.",
|
|
98
97
|
})
|
|
99
|
-
visible: number
|
|
98
|
+
visible: number;
|
|
100
99
|
|
|
101
100
|
@OneToMany(
|
|
102
101
|
() => CodeRedemptionHistoryUser,
|
|
103
102
|
(codeRedemptionHistoryUser) => codeRedemptionHistoryUser.user
|
|
104
103
|
)
|
|
105
|
-
code_redemption_history_users: CodeRedemptionHistoryUser[]
|
|
104
|
+
code_redemption_history_users: CodeRedemptionHistoryUser[];
|
|
106
105
|
|
|
107
106
|
@OneToMany(
|
|
108
107
|
() => LocalQualification,
|
|
109
108
|
(localQualification) => localQualification.user
|
|
110
109
|
)
|
|
111
|
-
qualifications: LocalQualification[]
|
|
110
|
+
qualifications: LocalQualification[];
|
|
112
111
|
|
|
113
112
|
@OneToMany(() => Request, (request) => request.user)
|
|
114
|
-
requests: Request[]
|
|
113
|
+
requests: Request[];
|
|
115
114
|
|
|
116
|
-
@ManyToMany(() => Request)
|
|
115
|
+
@ManyToMany(() => Request, (request) => request.requests_group)
|
|
117
116
|
@JoinTable({
|
|
118
|
-
name:
|
|
117
|
+
name: "request_group",
|
|
118
|
+
joinColumn: {
|
|
119
|
+
name: "user",
|
|
120
|
+
referencedColumnName: "id",
|
|
121
|
+
},
|
|
122
|
+
inverseJoinColumn: {
|
|
123
|
+
name: "request",
|
|
124
|
+
referencedColumnName: "id",
|
|
125
|
+
},
|
|
119
126
|
})
|
|
120
|
-
requests_group: Request[]
|
|
127
|
+
requests_group: Request[];
|
|
121
128
|
|
|
122
129
|
@OneToMany(() => RequestProduct, (requestProduct) => requestProduct.user)
|
|
123
|
-
request_products: RequestProduct[]
|
|
130
|
+
request_products: RequestProduct[];
|
|
124
131
|
|
|
125
132
|
@OneToMany(
|
|
126
133
|
() => RequestProductGroupComplement,
|
|
127
134
|
(requestProduct) => requestProduct.user
|
|
128
135
|
)
|
|
129
|
-
request_product_group_complements: RequestProductGroupComplement[]
|
|
136
|
+
request_product_group_complements: RequestProductGroupComplement[];
|
|
130
137
|
|
|
131
138
|
@OneToMany(() => UserAddress, (userAddress) => userAddress.user)
|
|
132
|
-
addresses: UserAddress[]
|
|
139
|
+
addresses: UserAddress[];
|
|
133
140
|
|
|
134
|
-
@ManyToMany(
|
|
141
|
+
@ManyToMany(
|
|
142
|
+
() => PaymentMethod,
|
|
143
|
+
(paymentMethod) => paymentMethod.user_payments_method
|
|
144
|
+
)
|
|
135
145
|
@JoinTable({
|
|
136
|
-
name:
|
|
146
|
+
name: "user_payment_method",
|
|
137
147
|
joinColumn: {
|
|
138
|
-
name:
|
|
139
|
-
referencedColumnName:
|
|
148
|
+
name: "user",
|
|
149
|
+
referencedColumnName: "id",
|
|
140
150
|
},
|
|
141
151
|
inverseJoinColumn: {
|
|
142
|
-
name:
|
|
143
|
-
referencedColumnName:
|
|
152
|
+
name: "payment_method",
|
|
153
|
+
referencedColumnName: "id",
|
|
144
154
|
},
|
|
145
155
|
})
|
|
146
|
-
user_payments_method: PaymentMethod[]
|
|
156
|
+
user_payments_method: PaymentMethod[];
|
|
147
157
|
|
|
148
|
-
@ManyToMany(() => Square)
|
|
158
|
+
@ManyToMany(() => Square, (square) => square.users_favorite_square)
|
|
149
159
|
@JoinTable({
|
|
150
|
-
name:
|
|
160
|
+
name: "user_favorite_square",
|
|
151
161
|
joinColumn: {
|
|
152
|
-
name:
|
|
153
|
-
referencedColumnName:
|
|
162
|
+
name: "user",
|
|
163
|
+
referencedColumnName: "id",
|
|
154
164
|
},
|
|
155
165
|
inverseJoinColumn: {
|
|
156
|
-
name:
|
|
157
|
-
referencedColumnName:
|
|
166
|
+
name: "square",
|
|
167
|
+
referencedColumnName: "id",
|
|
158
168
|
},
|
|
159
169
|
})
|
|
160
|
-
user_favorite_squares: Square[]
|
|
170
|
+
user_favorite_squares: Square[];
|
|
161
171
|
|
|
162
|
-
@ManyToMany(() => Local)
|
|
172
|
+
@ManyToMany(() => Local, (local) => local.users_favorite_local)
|
|
163
173
|
@JoinTable({
|
|
164
|
-
name:
|
|
174
|
+
name: "user_favorite_local",
|
|
165
175
|
joinColumn: {
|
|
166
|
-
name:
|
|
167
|
-
referencedColumnName:
|
|
176
|
+
name: "user",
|
|
177
|
+
referencedColumnName: "id",
|
|
168
178
|
},
|
|
169
179
|
inverseJoinColumn: {
|
|
170
|
-
name:
|
|
171
|
-
referencedColumnName:
|
|
180
|
+
name: "local",
|
|
181
|
+
referencedColumnName: "id",
|
|
172
182
|
},
|
|
173
183
|
})
|
|
174
|
-
user_favorite_locals: Local[]
|
|
184
|
+
user_favorite_locals: Local[];
|
|
175
185
|
|
|
176
|
-
@ManyToMany(() => Product)
|
|
186
|
+
@ManyToMany(() => Product, (product) => product.users_favorite_product)
|
|
177
187
|
@JoinTable({
|
|
178
|
-
name:
|
|
188
|
+
name: "user_favorite_product",
|
|
179
189
|
joinColumn: {
|
|
180
|
-
name:
|
|
181
|
-
referencedColumnName:
|
|
190
|
+
name: "user",
|
|
191
|
+
referencedColumnName: "id",
|
|
182
192
|
},
|
|
183
193
|
inverseJoinColumn: {
|
|
184
|
-
name:
|
|
185
|
-
referencedColumnName:
|
|
194
|
+
name: "product",
|
|
195
|
+
referencedColumnName: "id",
|
|
186
196
|
},
|
|
187
197
|
})
|
|
188
|
-
user_favorite_products: Product[]
|
|
198
|
+
user_favorite_products: Product[];
|
|
189
199
|
}
|