@experts_hub/shared 1.0.26 → 1.0.28

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.
@@ -0,0 +1,11 @@
1
+ export declare abstract class BaseEntity {
2
+ id: number;
3
+ uuid: string;
4
+ createdAt: Date;
5
+ createdBy: number;
6
+ updatedAt: Date;
7
+ updatedBy: number;
8
+ isDeleted: boolean;
9
+ deletedBy: number;
10
+ deletedAt: Date;
11
+ }
@@ -1,2 +1,3 @@
1
+ export * from './base.entity';
1
2
  export * from './user.entity';
2
3
  export * from './refresh-token.entity';
@@ -1,14 +1,33 @@
1
+ import { BaseEntity } from './base.entity';
1
2
  import { RefreshToken } from './refresh-token.entity';
2
- export declare class User {
3
- id: string;
3
+ export declare enum AccountType {
4
+ ADMIN = "ADMIN",
5
+ SUB_ADMIN = "SUB_ADMIN",
6
+ CLIENT = "CLIENT",
7
+ FREELANCER = "FREELANCER"
8
+ }
9
+ export declare enum AccountStatus {
10
+ INACTIVE = "INACTIVE",
11
+ ACTIVE = "ACTIVE",
12
+ SUSPENDED = "SUSPENDED",
13
+ BLOCKED = "BLOCKED"
14
+ }
15
+ export declare class User extends BaseEntity {
16
+ uniqueId: string;
4
17
  username: string;
5
- email: string;
6
- password: string;
7
18
  firstName: string;
8
19
  lastName: string;
9
- role: string;
10
- isActive: boolean;
11
- createdAt: Date;
12
- updatedAt: Date;
20
+ dateOfBirth: Date;
21
+ gender: string;
22
+ profilePictureUrl: string;
23
+ email: string;
24
+ mobile: string;
25
+ password: string;
26
+ accountType: AccountType;
27
+ accountStatus: AccountStatus;
28
+ isEmailVerified: boolean;
29
+ isMobileVerified: boolean;
30
+ lastLoginAt: Date;
31
+ lastLoginIp: string;
13
32
  refreshTokens: RefreshToken[];
14
33
  }
package/dist/index.d.mts CHANGED
@@ -14,6 +14,18 @@ declare const UserTCPAdapter: () => MicroserviceOptions;
14
14
 
15
15
  declare const UserRMQAdapter: (mode?: string) => MicroserviceOptions;
16
16
 
17
+ declare abstract class BaseEntity {
18
+ id: number;
19
+ uuid: string;
20
+ createdAt: Date;
21
+ createdBy: number;
22
+ updatedAt: Date;
23
+ updatedBy: number;
24
+ isDeleted: boolean;
25
+ deletedBy: number;
26
+ deletedAt: Date;
27
+ }
28
+
17
29
  declare class RefreshToken {
18
30
  id: string;
19
31
  userId: string;
@@ -26,18 +38,36 @@ declare class RefreshToken {
26
38
  user: User;
27
39
  }
28
40
 
29
- declare class User {
30
- id: string;
41
+ declare enum AccountType {
42
+ ADMIN = "ADMIN",
43
+ SUB_ADMIN = "SUB_ADMIN",
44
+ CLIENT = "CLIENT",
45
+ FREELANCER = "FREELANCER"
46
+ }
47
+ declare enum AccountStatus {
48
+ INACTIVE = "INACTIVE",
49
+ ACTIVE = "ACTIVE",
50
+ SUSPENDED = "SUSPENDED",
51
+ BLOCKED = "BLOCKED"
52
+ }
53
+ declare class User extends BaseEntity {
54
+ uniqueId: string;
31
55
  username: string;
32
- email: string;
33
- password: string;
34
56
  firstName: string;
35
57
  lastName: string;
36
- role: string;
37
- isActive: boolean;
38
- createdAt: Date;
39
- updatedAt: Date;
58
+ dateOfBirth: Date;
59
+ gender: string;
60
+ profilePictureUrl: string;
61
+ email: string;
62
+ mobile: string;
63
+ password: string;
64
+ accountType: AccountType;
65
+ accountStatus: AccountStatus;
66
+ isEmailVerified: boolean;
67
+ isMobileVerified: boolean;
68
+ lastLoginAt: Date;
69
+ lastLoginIp: string;
40
70
  refreshTokens: RefreshToken[];
41
71
  }
42
72
 
43
- export { AUTHENTICATION_PATTERN, RefreshToken, User, UserRMQAdapter, UserTCPAdapter };
73
+ export { AUTHENTICATION_PATTERN, AccountStatus, AccountType, BaseEntity, RefreshToken, User, UserRMQAdapter, UserTCPAdapter };
package/dist/index.d.ts CHANGED
@@ -14,6 +14,18 @@ declare const UserTCPAdapter: () => MicroserviceOptions;
14
14
 
15
15
  declare const UserRMQAdapter: (mode?: string) => MicroserviceOptions;
16
16
 
17
+ declare abstract class BaseEntity {
18
+ id: number;
19
+ uuid: string;
20
+ createdAt: Date;
21
+ createdBy: number;
22
+ updatedAt: Date;
23
+ updatedBy: number;
24
+ isDeleted: boolean;
25
+ deletedBy: number;
26
+ deletedAt: Date;
27
+ }
28
+
17
29
  declare class RefreshToken {
18
30
  id: string;
19
31
  userId: string;
@@ -26,18 +38,36 @@ declare class RefreshToken {
26
38
  user: User;
27
39
  }
28
40
 
29
- declare class User {
30
- id: string;
41
+ declare enum AccountType {
42
+ ADMIN = "ADMIN",
43
+ SUB_ADMIN = "SUB_ADMIN",
44
+ CLIENT = "CLIENT",
45
+ FREELANCER = "FREELANCER"
46
+ }
47
+ declare enum AccountStatus {
48
+ INACTIVE = "INACTIVE",
49
+ ACTIVE = "ACTIVE",
50
+ SUSPENDED = "SUSPENDED",
51
+ BLOCKED = "BLOCKED"
52
+ }
53
+ declare class User extends BaseEntity {
54
+ uniqueId: string;
31
55
  username: string;
32
- email: string;
33
- password: string;
34
56
  firstName: string;
35
57
  lastName: string;
36
- role: string;
37
- isActive: boolean;
38
- createdAt: Date;
39
- updatedAt: Date;
58
+ dateOfBirth: Date;
59
+ gender: string;
60
+ profilePictureUrl: string;
61
+ email: string;
62
+ mobile: string;
63
+ password: string;
64
+ accountType: AccountType;
65
+ accountStatus: AccountStatus;
66
+ isEmailVerified: boolean;
67
+ isMobileVerified: boolean;
68
+ lastLoginAt: Date;
69
+ lastLoginIp: string;
40
70
  refreshTokens: RefreshToken[];
41
71
  }
42
72
 
43
- export { AUTHENTICATION_PATTERN, RefreshToken, User, UserRMQAdapter, UserTCPAdapter };
73
+ export { AUTHENTICATION_PATTERN, AccountStatus, AccountType, BaseEntity, RefreshToken, User, UserRMQAdapter, UserTCPAdapter };
package/dist/index.js CHANGED
@@ -28,6 +28,9 @@ var __decorateClass = (decorators, target, key, kind) => {
28
28
  var index_exports = {};
29
29
  __export(index_exports, {
30
30
  AUTHENTICATION_PATTERN: () => AUTHENTICATION_PATTERN,
31
+ AccountStatus: () => AccountStatus,
32
+ AccountType: () => AccountType,
33
+ BaseEntity: () => BaseEntity,
31
34
  RefreshToken: () => RefreshToken,
32
35
  User: () => User,
33
36
  UserRMQAdapter: () => UserRMQAdapter,
@@ -118,87 +121,169 @@ var UserRMQAdapter = (mode = "microservice") => {
118
121
  return config3;
119
122
  };
120
123
 
124
+ // src/entities/base.entity.ts
125
+ var import_typeorm = require("typeorm");
126
+ var BaseEntity = class {
127
+ };
128
+ __decorateClass([
129
+ (0, import_typeorm.PrimaryGeneratedColumn)("increment", { type: "integer" })
130
+ ], BaseEntity.prototype, "id", 2);
131
+ __decorateClass([
132
+ (0, import_typeorm.Column)({ type: "uuid" }),
133
+ (0, import_typeorm.Generated)("uuid")
134
+ ], BaseEntity.prototype, "uuid", 2);
135
+ __decorateClass([
136
+ (0, import_typeorm.CreateDateColumn)({ name: "created_at", type: "timestamp with time zone" })
137
+ ], BaseEntity.prototype, "createdAt", 2);
138
+ __decorateClass([
139
+ (0, import_typeorm.Column)({ name: "created_by", type: "integer", nullable: true })
140
+ ], BaseEntity.prototype, "createdBy", 2);
141
+ __decorateClass([
142
+ (0, import_typeorm.UpdateDateColumn)({ name: "updated_at", type: "timestamp with time zone" })
143
+ ], BaseEntity.prototype, "updatedAt", 2);
144
+ __decorateClass([
145
+ (0, import_typeorm.Column)({ name: "updated_by", type: "integer", nullable: true })
146
+ ], BaseEntity.prototype, "updatedBy", 2);
147
+ __decorateClass([
148
+ (0, import_typeorm.Column)({ name: "is_deleted", type: "boolean", default: false })
149
+ ], BaseEntity.prototype, "isDeleted", 2);
150
+ __decorateClass([
151
+ (0, import_typeorm.Column)({ name: "deleted_by", type: "integer", nullable: true })
152
+ ], BaseEntity.prototype, "deletedBy", 2);
153
+ __decorateClass([
154
+ (0, import_typeorm.DeleteDateColumn)({
155
+ name: "deleted_at",
156
+ type: "timestamp with time zone",
157
+ nullable: true
158
+ })
159
+ ], BaseEntity.prototype, "deletedAt", 2);
160
+
121
161
  // src/entities/user.entity.ts
122
- var import_typeorm2 = require("typeorm");
162
+ var import_typeorm3 = require("typeorm");
123
163
 
124
164
  // src/entities/refresh-token.entity.ts
125
- var import_typeorm = require("typeorm");
165
+ var import_typeorm2 = require("typeorm");
126
166
  var RefreshToken = class {
127
167
  };
128
168
  __decorateClass([
129
- (0, import_typeorm.PrimaryGeneratedColumn)("uuid")
169
+ (0, import_typeorm2.PrimaryGeneratedColumn)("uuid")
130
170
  ], RefreshToken.prototype, "id", 2);
131
171
  __decorateClass([
132
- (0, import_typeorm.Column)({ name: "user_id" })
172
+ (0, import_typeorm2.Column)({ name: "user_id", type: "integer" })
133
173
  ], RefreshToken.prototype, "userId", 2);
134
174
  __decorateClass([
135
- (0, import_typeorm.Column)({ name: "token_id" })
175
+ (0, import_typeorm2.Column)({ name: "token_id", type: "varchar" })
136
176
  ], RefreshToken.prototype, "tokenId", 2);
137
177
  __decorateClass([
138
- (0, import_typeorm.Column)({ name: "device_info", type: "json", nullable: true })
178
+ (0, import_typeorm2.Column)({ name: "device_info", type: "json", nullable: true })
139
179
  ], RefreshToken.prototype, "deviceInfo", 2);
140
180
  __decorateClass([
141
- (0, import_typeorm.Column)({ name: "is_revoked", default: false })
181
+ (0, import_typeorm2.Column)({ name: "is_revoked", type: "boolean", default: false })
142
182
  ], RefreshToken.prototype, "isRevoked", 2);
143
183
  __decorateClass([
144
- (0, import_typeorm.Column)({ name: "expires_at" })
184
+ (0, import_typeorm2.Column)({ name: "expires_at", type: "timestamp with time zone" })
145
185
  ], RefreshToken.prototype, "expiresAt", 2);
146
186
  __decorateClass([
147
- (0, import_typeorm.CreateDateColumn)({ name: "created_at" })
187
+ (0, import_typeorm2.CreateDateColumn)({ name: "created_at", type: "timestamp with time zone" })
148
188
  ], RefreshToken.prototype, "createdAt", 2);
149
189
  __decorateClass([
150
- (0, import_typeorm.UpdateDateColumn)({ name: "updated_at" })
190
+ (0, import_typeorm2.UpdateDateColumn)({ name: "updated_at", type: "timestamp with time zone" })
151
191
  ], RefreshToken.prototype, "updatedAt", 2);
152
192
  __decorateClass([
153
- (0, import_typeorm.ManyToOne)(() => User, (user) => user.refreshTokens),
154
- (0, import_typeorm.JoinColumn)({ name: "user_id" })
193
+ (0, import_typeorm2.ManyToOne)(() => User, (user) => user.refreshTokens),
194
+ (0, import_typeorm2.JoinColumn)({ name: "user_id" })
155
195
  ], RefreshToken.prototype, "user", 2);
156
196
  RefreshToken = __decorateClass([
157
- (0, import_typeorm.Entity)("refresh_tokens")
197
+ (0, import_typeorm2.Entity)("refresh_tokens")
158
198
  ], RefreshToken);
159
199
 
160
200
  // src/entities/user.entity.ts
161
- var User = class {
201
+ var AccountType = /* @__PURE__ */ ((AccountType2) => {
202
+ AccountType2["ADMIN"] = "ADMIN";
203
+ AccountType2["SUB_ADMIN"] = "SUB_ADMIN";
204
+ AccountType2["CLIENT"] = "CLIENT";
205
+ AccountType2["FREELANCER"] = "FREELANCER";
206
+ return AccountType2;
207
+ })(AccountType || {});
208
+ var AccountStatus = /* @__PURE__ */ ((AccountStatus2) => {
209
+ AccountStatus2["INACTIVE"] = "INACTIVE";
210
+ AccountStatus2["ACTIVE"] = "ACTIVE";
211
+ AccountStatus2["SUSPENDED"] = "SUSPENDED";
212
+ AccountStatus2["BLOCKED"] = "BLOCKED";
213
+ return AccountStatus2;
214
+ })(AccountStatus || {});
215
+ var User = class extends BaseEntity {
162
216
  };
163
217
  __decorateClass([
164
- (0, import_typeorm2.PrimaryGeneratedColumn)("uuid")
165
- ], User.prototype, "id", 2);
218
+ (0, import_typeorm3.Column)({ name: "unique_id", type: "varchar", unique: true })
219
+ ], User.prototype, "uniqueId", 2);
166
220
  __decorateClass([
167
- (0, import_typeorm2.Column)({ unique: true })
221
+ (0, import_typeorm3.Column)({ name: "username", type: "varchar", unique: true, nullable: true })
168
222
  ], User.prototype, "username", 2);
169
223
  __decorateClass([
170
- (0, import_typeorm2.Column)({ unique: true })
224
+ (0, import_typeorm3.Column)({ name: "first_name", type: "varchar", length: 100, nullable: true })
225
+ ], User.prototype, "firstName", 2);
226
+ __decorateClass([
227
+ (0, import_typeorm3.Column)({ name: "last_name", type: "varchar", length: 100, nullable: true })
228
+ ], User.prototype, "lastName", 2);
229
+ __decorateClass([
230
+ (0, import_typeorm3.Column)({ name: "date_of_birth", type: "date", nullable: true })
231
+ ], User.prototype, "dateOfBirth", 2);
232
+ __decorateClass([
233
+ (0, import_typeorm3.Column)({ name: "gender", type: "varchar", length: 10, nullable: true })
234
+ ], User.prototype, "gender", 2);
235
+ __decorateClass([
236
+ (0, import_typeorm3.Column)({ name: "profile_picture_url", type: "text", nullable: true })
237
+ ], User.prototype, "profilePictureUrl", 2);
238
+ __decorateClass([
239
+ (0, import_typeorm3.Column)({ name: "email", type: "varchar", unique: true })
171
240
  ], User.prototype, "email", 2);
172
241
  __decorateClass([
173
- (0, import_typeorm2.Column)()
242
+ (0, import_typeorm3.Column)({ name: "mobile", type: "varchar", unique: true, nullable: true })
243
+ ], User.prototype, "mobile", 2);
244
+ __decorateClass([
245
+ (0, import_typeorm3.Column)({ name: "password", type: "varchar" })
174
246
  ], User.prototype, "password", 2);
175
247
  __decorateClass([
176
- (0, import_typeorm2.Column)({ name: "first_name", nullable: true })
177
- ], User.prototype, "firstName", 2);
248
+ (0, import_typeorm3.Column)({
249
+ name: "account_type",
250
+ type: "enum",
251
+ enum: AccountType,
252
+ default: "FREELANCER" /* FREELANCER */
253
+ })
254
+ ], User.prototype, "accountType", 2);
178
255
  __decorateClass([
179
- (0, import_typeorm2.Column)({ name: "last_name", nullable: true })
180
- ], User.prototype, "lastName", 2);
256
+ (0, import_typeorm3.Column)({
257
+ name: "account_status",
258
+ type: "enum",
259
+ enum: AccountStatus,
260
+ default: "INACTIVE" /* INACTIVE */
261
+ })
262
+ ], User.prototype, "accountStatus", 2);
181
263
  __decorateClass([
182
- (0, import_typeorm2.Column)({ default: "user" })
183
- ], User.prototype, "role", 2);
264
+ (0, import_typeorm3.Column)({ name: "is_email_verified", type: "boolean", default: false })
265
+ ], User.prototype, "isEmailVerified", 2);
184
266
  __decorateClass([
185
- (0, import_typeorm2.Column)({ name: "is_active", default: true })
186
- ], User.prototype, "isActive", 2);
267
+ (0, import_typeorm3.Column)({ name: "is_mobile_verified", type: "boolean", default: false })
268
+ ], User.prototype, "isMobileVerified", 2);
187
269
  __decorateClass([
188
- (0, import_typeorm2.CreateDateColumn)({ name: "created_at" })
189
- ], User.prototype, "createdAt", 2);
270
+ (0, import_typeorm3.Column)({ name: "last_login_at", type: "timestamp with time zone", nullable: true })
271
+ ], User.prototype, "lastLoginAt", 2);
190
272
  __decorateClass([
191
- (0, import_typeorm2.UpdateDateColumn)({ name: "updated_at" })
192
- ], User.prototype, "updatedAt", 2);
273
+ (0, import_typeorm3.Column)({ name: "last_login_ip", type: "varchar", nullable: true })
274
+ ], User.prototype, "lastLoginIp", 2);
193
275
  __decorateClass([
194
- (0, import_typeorm2.OneToMany)(() => RefreshToken, (token) => token.user)
276
+ (0, import_typeorm3.OneToMany)(() => RefreshToken, (token) => token.user)
195
277
  ], User.prototype, "refreshTokens", 2);
196
278
  User = __decorateClass([
197
- (0, import_typeorm2.Entity)("users")
279
+ (0, import_typeorm3.Entity)("users")
198
280
  ], User);
199
281
  // Annotate the CommonJS export names for ESM import in node:
200
282
  0 && (module.exports = {
201
283
  AUTHENTICATION_PATTERN,
284
+ AccountStatus,
285
+ AccountType,
286
+ BaseEntity,
202
287
  RefreshToken,
203
288
  User,
204
289
  UserRMQAdapter,
package/dist/index.mjs CHANGED
@@ -92,36 +92,88 @@ var UserRMQAdapter = (mode = "microservice") => {
92
92
  return config3;
93
93
  };
94
94
 
95
+ // src/entities/base.entity.ts
96
+ import {
97
+ CreateDateColumn,
98
+ PrimaryGeneratedColumn,
99
+ UpdateDateColumn,
100
+ Column,
101
+ DeleteDateColumn,
102
+ Generated
103
+ } from "typeorm";
104
+ var BaseEntity = class {
105
+ };
106
+ __decorateClass([
107
+ PrimaryGeneratedColumn("increment", { type: "integer" })
108
+ ], BaseEntity.prototype, "id", 2);
109
+ __decorateClass([
110
+ Column({ type: "uuid" }),
111
+ Generated("uuid")
112
+ ], BaseEntity.prototype, "uuid", 2);
113
+ __decorateClass([
114
+ CreateDateColumn({ name: "created_at", type: "timestamp with time zone" })
115
+ ], BaseEntity.prototype, "createdAt", 2);
116
+ __decorateClass([
117
+ Column({ name: "created_by", type: "integer", nullable: true })
118
+ ], BaseEntity.prototype, "createdBy", 2);
119
+ __decorateClass([
120
+ UpdateDateColumn({ name: "updated_at", type: "timestamp with time zone" })
121
+ ], BaseEntity.prototype, "updatedAt", 2);
122
+ __decorateClass([
123
+ Column({ name: "updated_by", type: "integer", nullable: true })
124
+ ], BaseEntity.prototype, "updatedBy", 2);
125
+ __decorateClass([
126
+ Column({ name: "is_deleted", type: "boolean", default: false })
127
+ ], BaseEntity.prototype, "isDeleted", 2);
128
+ __decorateClass([
129
+ Column({ name: "deleted_by", type: "integer", nullable: true })
130
+ ], BaseEntity.prototype, "deletedBy", 2);
131
+ __decorateClass([
132
+ DeleteDateColumn({
133
+ name: "deleted_at",
134
+ type: "timestamp with time zone",
135
+ nullable: true
136
+ })
137
+ ], BaseEntity.prototype, "deletedAt", 2);
138
+
95
139
  // src/entities/user.entity.ts
96
- import { Entity as Entity2, PrimaryGeneratedColumn as PrimaryGeneratedColumn2, Column as Column2, CreateDateColumn as CreateDateColumn2, UpdateDateColumn as UpdateDateColumn2, OneToMany } from "typeorm";
140
+ import { Entity as Entity2, Column as Column3, OneToMany } from "typeorm";
97
141
 
98
142
  // src/entities/refresh-token.entity.ts
99
- import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn, CreateDateColumn, UpdateDateColumn } from "typeorm";
143
+ import {
144
+ Entity,
145
+ PrimaryGeneratedColumn as PrimaryGeneratedColumn2,
146
+ Column as Column2,
147
+ ManyToOne,
148
+ JoinColumn,
149
+ CreateDateColumn as CreateDateColumn2,
150
+ UpdateDateColumn as UpdateDateColumn2
151
+ } from "typeorm";
100
152
  var RefreshToken = class {
101
153
  };
102
154
  __decorateClass([
103
- PrimaryGeneratedColumn("uuid")
155
+ PrimaryGeneratedColumn2("uuid")
104
156
  ], RefreshToken.prototype, "id", 2);
105
157
  __decorateClass([
106
- Column({ name: "user_id" })
158
+ Column2({ name: "user_id", type: "integer" })
107
159
  ], RefreshToken.prototype, "userId", 2);
108
160
  __decorateClass([
109
- Column({ name: "token_id" })
161
+ Column2({ name: "token_id", type: "varchar" })
110
162
  ], RefreshToken.prototype, "tokenId", 2);
111
163
  __decorateClass([
112
- Column({ name: "device_info", type: "json", nullable: true })
164
+ Column2({ name: "device_info", type: "json", nullable: true })
113
165
  ], RefreshToken.prototype, "deviceInfo", 2);
114
166
  __decorateClass([
115
- Column({ name: "is_revoked", default: false })
167
+ Column2({ name: "is_revoked", type: "boolean", default: false })
116
168
  ], RefreshToken.prototype, "isRevoked", 2);
117
169
  __decorateClass([
118
- Column({ name: "expires_at" })
170
+ Column2({ name: "expires_at", type: "timestamp with time zone" })
119
171
  ], RefreshToken.prototype, "expiresAt", 2);
120
172
  __decorateClass([
121
- CreateDateColumn({ name: "created_at" })
173
+ CreateDateColumn2({ name: "created_at", type: "timestamp with time zone" })
122
174
  ], RefreshToken.prototype, "createdAt", 2);
123
175
  __decorateClass([
124
- UpdateDateColumn({ name: "updated_at" })
176
+ UpdateDateColumn2({ name: "updated_at", type: "timestamp with time zone" })
125
177
  ], RefreshToken.prototype, "updatedAt", 2);
126
178
  __decorateClass([
127
179
  ManyToOne(() => User, (user) => user.refreshTokens),
@@ -132,38 +184,80 @@ RefreshToken = __decorateClass([
132
184
  ], RefreshToken);
133
185
 
134
186
  // src/entities/user.entity.ts
135
- var User = class {
187
+ var AccountType = /* @__PURE__ */ ((AccountType2) => {
188
+ AccountType2["ADMIN"] = "ADMIN";
189
+ AccountType2["SUB_ADMIN"] = "SUB_ADMIN";
190
+ AccountType2["CLIENT"] = "CLIENT";
191
+ AccountType2["FREELANCER"] = "FREELANCER";
192
+ return AccountType2;
193
+ })(AccountType || {});
194
+ var AccountStatus = /* @__PURE__ */ ((AccountStatus2) => {
195
+ AccountStatus2["INACTIVE"] = "INACTIVE";
196
+ AccountStatus2["ACTIVE"] = "ACTIVE";
197
+ AccountStatus2["SUSPENDED"] = "SUSPENDED";
198
+ AccountStatus2["BLOCKED"] = "BLOCKED";
199
+ return AccountStatus2;
200
+ })(AccountStatus || {});
201
+ var User = class extends BaseEntity {
136
202
  };
137
203
  __decorateClass([
138
- PrimaryGeneratedColumn2("uuid")
139
- ], User.prototype, "id", 2);
204
+ Column3({ name: "unique_id", type: "varchar", unique: true })
205
+ ], User.prototype, "uniqueId", 2);
140
206
  __decorateClass([
141
- Column2({ unique: true })
207
+ Column3({ name: "username", type: "varchar", unique: true, nullable: true })
142
208
  ], User.prototype, "username", 2);
143
209
  __decorateClass([
144
- Column2({ unique: true })
210
+ Column3({ name: "first_name", type: "varchar", length: 100, nullable: true })
211
+ ], User.prototype, "firstName", 2);
212
+ __decorateClass([
213
+ Column3({ name: "last_name", type: "varchar", length: 100, nullable: true })
214
+ ], User.prototype, "lastName", 2);
215
+ __decorateClass([
216
+ Column3({ name: "date_of_birth", type: "date", nullable: true })
217
+ ], User.prototype, "dateOfBirth", 2);
218
+ __decorateClass([
219
+ Column3({ name: "gender", type: "varchar", length: 10, nullable: true })
220
+ ], User.prototype, "gender", 2);
221
+ __decorateClass([
222
+ Column3({ name: "profile_picture_url", type: "text", nullable: true })
223
+ ], User.prototype, "profilePictureUrl", 2);
224
+ __decorateClass([
225
+ Column3({ name: "email", type: "varchar", unique: true })
145
226
  ], User.prototype, "email", 2);
146
227
  __decorateClass([
147
- Column2()
228
+ Column3({ name: "mobile", type: "varchar", unique: true, nullable: true })
229
+ ], User.prototype, "mobile", 2);
230
+ __decorateClass([
231
+ Column3({ name: "password", type: "varchar" })
148
232
  ], User.prototype, "password", 2);
149
233
  __decorateClass([
150
- Column2({ name: "first_name", nullable: true })
151
- ], User.prototype, "firstName", 2);
234
+ Column3({
235
+ name: "account_type",
236
+ type: "enum",
237
+ enum: AccountType,
238
+ default: "FREELANCER" /* FREELANCER */
239
+ })
240
+ ], User.prototype, "accountType", 2);
152
241
  __decorateClass([
153
- Column2({ name: "last_name", nullable: true })
154
- ], User.prototype, "lastName", 2);
242
+ Column3({
243
+ name: "account_status",
244
+ type: "enum",
245
+ enum: AccountStatus,
246
+ default: "INACTIVE" /* INACTIVE */
247
+ })
248
+ ], User.prototype, "accountStatus", 2);
155
249
  __decorateClass([
156
- Column2({ default: "user" })
157
- ], User.prototype, "role", 2);
250
+ Column3({ name: "is_email_verified", type: "boolean", default: false })
251
+ ], User.prototype, "isEmailVerified", 2);
158
252
  __decorateClass([
159
- Column2({ name: "is_active", default: true })
160
- ], User.prototype, "isActive", 2);
253
+ Column3({ name: "is_mobile_verified", type: "boolean", default: false })
254
+ ], User.prototype, "isMobileVerified", 2);
161
255
  __decorateClass([
162
- CreateDateColumn2({ name: "created_at" })
163
- ], User.prototype, "createdAt", 2);
256
+ Column3({ name: "last_login_at", type: "timestamp with time zone", nullable: true })
257
+ ], User.prototype, "lastLoginAt", 2);
164
258
  __decorateClass([
165
- UpdateDateColumn2({ name: "updated_at" })
166
- ], User.prototype, "updatedAt", 2);
259
+ Column3({ name: "last_login_ip", type: "varchar", nullable: true })
260
+ ], User.prototype, "lastLoginIp", 2);
167
261
  __decorateClass([
168
262
  OneToMany(() => RefreshToken, (token) => token.user)
169
263
  ], User.prototype, "refreshTokens", 2);
@@ -172,6 +266,9 @@ User = __decorateClass([
172
266
  ], User);
173
267
  export {
174
268
  AUTHENTICATION_PATTERN,
269
+ AccountStatus,
270
+ AccountType,
271
+ BaseEntity,
175
272
  RefreshToken,
176
273
  User,
177
274
  UserRMQAdapter,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@experts_hub/shared",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "description": "Shared DTOs, interfaces, and utilities for experts hub applications",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",