@optimatech88/titomeet-shared-lib 1.0.28 → 1.0.30
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/auth/auth.guard.d.ts.map +1 -1
- package/dist/auth/auth.guard.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20250530152731_updated_model/migration.sql +1 -0
- package/prisma/migrations/20250530152845_updated_model/migration.sql +1 -0
- package/prisma/schema.prisma +216 -271
- package/src/auth/auth.guard.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.guard.d.ts","sourceRoot":"","sources":["../../src/auth/auth.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC,qBACa,SAAU,YAAW,WAAW;IAKzC,OAAO,CAAC,UAAU;IAJpB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,MAAM,CAA8B;gBAGlC,UAAU,EAAE,UAAU;IAK1B,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IA+B9D,OAAO,CAAC,sBAAsB;
|
|
1
|
+
{"version":3,"file":"auth.guard.d.ts","sourceRoot":"","sources":["../../src/auth/auth.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,gBAAgB,EAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzC,qBACa,SAAU,YAAW,WAAW;IAKzC,OAAO,CAAC,UAAU;IAJpB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,MAAM,CAA8B;gBAGlC,UAAU,EAAE,UAAU;IAK1B,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IA+B9D,OAAO,CAAC,sBAAs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GAAE;qCAKW,gBAAU;GAJrB,cAAc,CA2C1B"}
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
-- This is an empty migration.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
-- This is an empty migration.
|
package/prisma/schema.prisma
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
// This is your Prisma schema file,
|
|
2
|
-
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
3
|
-
|
|
4
|
-
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
|
5
|
-
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
|
6
|
-
|
|
7
1
|
generator client {
|
|
8
2
|
provider = "prisma-client-js"
|
|
9
3
|
}
|
|
@@ -13,334 +7,285 @@ datasource db {
|
|
|
13
7
|
url = env("DATABASE_URL")
|
|
14
8
|
}
|
|
15
9
|
|
|
16
|
-
|
|
17
|
-
enum UserRole {
|
|
18
|
-
SUPER_ADMIN
|
|
19
|
-
ADMIN
|
|
20
|
-
USER
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
enum UserStatus {
|
|
24
|
-
ACTIVE
|
|
25
|
-
INACTIVE
|
|
26
|
-
DELETED
|
|
27
|
-
}
|
|
28
|
-
|
|
29
10
|
model User {
|
|
30
|
-
id
|
|
31
|
-
username
|
|
32
|
-
email
|
|
33
|
-
firstName
|
|
34
|
-
lastName
|
|
35
|
-
password
|
|
36
|
-
role
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
messages
|
|
47
|
-
events Event[]
|
|
11
|
+
id String @id @default(cuid())
|
|
12
|
+
username String @unique
|
|
13
|
+
email String @unique
|
|
14
|
+
firstName String
|
|
15
|
+
lastName String
|
|
16
|
+
password String?
|
|
17
|
+
role UserRole @default(USER)
|
|
18
|
+
profilePicture String?
|
|
19
|
+
createdAt DateTime @default(now())
|
|
20
|
+
updatedAt DateTime @updatedAt
|
|
21
|
+
emailVerified Boolean @default(false)
|
|
22
|
+
status UserStatus @default(ACTIVE)
|
|
23
|
+
accounts Account[]
|
|
24
|
+
chatUsers ChatUser[]
|
|
25
|
+
events Event[]
|
|
26
|
+
favorites Favorite[]
|
|
27
|
+
messages Message[]
|
|
48
28
|
notificationsReceived Notification[] @relation("NotificationRecipient")
|
|
49
|
-
notificationsSent
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
favorites Favorite[]
|
|
54
|
-
orders Order[]
|
|
55
|
-
chatUsers ChatUser[]
|
|
29
|
+
notificationsSent Notification[] @relation("NotificationSender")
|
|
30
|
+
orders Order[]
|
|
31
|
+
providers Provider[]
|
|
32
|
+
reviews Review[]
|
|
56
33
|
}
|
|
57
34
|
|
|
58
35
|
model Account {
|
|
59
|
-
id
|
|
60
|
-
refreshToken
|
|
61
|
-
expiresAt
|
|
62
|
-
|
|
63
|
-
userId
|
|
36
|
+
id String @id @default(cuid())
|
|
37
|
+
refreshToken String @unique
|
|
38
|
+
expiresAt DateTime
|
|
39
|
+
userId String
|
|
40
|
+
user User @relation(fields: [userId], references: [id])
|
|
64
41
|
}
|
|
65
42
|
|
|
66
43
|
model Address {
|
|
67
|
-
id
|
|
68
|
-
name
|
|
69
|
-
line2
|
|
70
|
-
city
|
|
71
|
-
state
|
|
72
|
-
country
|
|
44
|
+
id String @id @default(uuid())
|
|
45
|
+
name String
|
|
46
|
+
line2 String?
|
|
47
|
+
city String?
|
|
48
|
+
state String?
|
|
49
|
+
country String
|
|
50
|
+
postalCode String?
|
|
51
|
+
createdAt DateTime @default(now())
|
|
52
|
+
updatedAt DateTime @updatedAt
|
|
73
53
|
countryCode String?
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
events Event[]
|
|
81
|
-
createdAt DateTime @default(now())
|
|
82
|
-
updatedAt DateTime @updatedAt
|
|
83
|
-
|
|
84
|
-
Provider Provider[]
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
enum EventAccess {
|
|
88
|
-
FREE
|
|
89
|
-
PAID
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
enum EventVisibility {
|
|
93
|
-
PUBLIC
|
|
94
|
-
PRIVATE
|
|
54
|
+
latitude Float?
|
|
55
|
+
longitude Float?
|
|
56
|
+
type String @default("suburb")
|
|
57
|
+
events Event[]
|
|
58
|
+
Provider Provider[]
|
|
95
59
|
}
|
|
96
60
|
|
|
97
61
|
model EventCategory {
|
|
98
|
-
id
|
|
99
|
-
name
|
|
62
|
+
id String @id @default(cuid())
|
|
63
|
+
name String @unique
|
|
100
64
|
description String?
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
active
|
|
104
|
-
|
|
105
|
-
createdAt DateTime @default(now())
|
|
106
|
-
updatedAt DateTime @updatedAt
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
enum EventStatus {
|
|
110
|
-
DRAFT
|
|
111
|
-
PENDING
|
|
112
|
-
PUBLISHED
|
|
113
|
-
CANCELLED
|
|
65
|
+
createdAt DateTime @default(now())
|
|
66
|
+
updatedAt DateTime @updatedAt
|
|
67
|
+
active Boolean @default(true)
|
|
68
|
+
events Event[] @relation("EventToEventCategory")
|
|
114
69
|
}
|
|
115
70
|
|
|
116
71
|
model Event {
|
|
117
|
-
id
|
|
118
|
-
name
|
|
119
|
-
description
|
|
120
|
-
startDate
|
|
121
|
-
endDate
|
|
122
|
-
startTime
|
|
123
|
-
endTime
|
|
124
|
-
|
|
125
|
-
capacity Int
|
|
72
|
+
id String @id @default(cuid())
|
|
73
|
+
name String
|
|
74
|
+
description String
|
|
75
|
+
startDate DateTime
|
|
76
|
+
endDate DateTime
|
|
77
|
+
startTime String
|
|
78
|
+
endTime String
|
|
79
|
+
capacity Int
|
|
126
80
|
coverPicture String
|
|
127
|
-
badge
|
|
128
|
-
tags
|
|
129
|
-
accessType
|
|
130
|
-
visibility
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
address
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
providers
|
|
144
|
-
|
|
145
|
-
createdAt DateTime @default(now())
|
|
146
|
-
updatedAt DateTime @updatedAt
|
|
147
|
-
|
|
148
|
-
favorites Favorite[]
|
|
149
|
-
|
|
150
|
-
orders Order[]
|
|
81
|
+
badge String
|
|
82
|
+
tags String[]
|
|
83
|
+
accessType EventAccess @default(FREE)
|
|
84
|
+
visibility EventVisibility @default(PUBLIC)
|
|
85
|
+
status EventStatus @default(DRAFT)
|
|
86
|
+
addressId String
|
|
87
|
+
postedById String
|
|
88
|
+
createdAt DateTime @default(now())
|
|
89
|
+
updatedAt DateTime @updatedAt
|
|
90
|
+
chat Chat?
|
|
91
|
+
address Address @relation(fields: [addressId], references: [id])
|
|
92
|
+
postedBy User @relation(fields: [postedById], references: [id])
|
|
93
|
+
prices EventPrice[]
|
|
94
|
+
favorites Favorite[]
|
|
95
|
+
orders Order[]
|
|
96
|
+
categories EventCategory[] @relation("EventToEventCategory")
|
|
97
|
+
providers Provider[] @relation("EventToProvider")
|
|
151
98
|
}
|
|
152
99
|
|
|
153
100
|
model EventPrice {
|
|
154
|
-
id String
|
|
155
|
-
name String
|
|
101
|
+
id String @id @default(uuid())
|
|
102
|
+
name String
|
|
156
103
|
amount Float
|
|
157
104
|
description String?
|
|
158
|
-
event Event @relation(fields: [eventId], references: [id])
|
|
159
105
|
eventId String
|
|
160
|
-
|
|
161
|
-
|
|
106
|
+
createdAt DateTime @default(now())
|
|
107
|
+
updatedAt DateTime @updatedAt
|
|
108
|
+
event Event @relation(fields: [eventId], references: [id])
|
|
162
109
|
orderItems OrderItem[]
|
|
163
|
-
|
|
164
|
-
createdAt DateTime @default(now())
|
|
165
|
-
updatedAt DateTime @updatedAt
|
|
166
110
|
}
|
|
167
111
|
|
|
168
112
|
model Chat {
|
|
169
|
-
id String
|
|
113
|
+
id String @id @default(cuid())
|
|
170
114
|
name String
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
115
|
+
eventId String @unique
|
|
116
|
+
createdAt DateTime @default(now())
|
|
117
|
+
updatedAt DateTime @updatedAt
|
|
118
|
+
event Event @relation(fields: [eventId], references: [id])
|
|
174
119
|
users ChatUser[]
|
|
175
|
-
|
|
176
|
-
createdAt DateTime @default(now())
|
|
177
|
-
updatedAt DateTime @updatedAt
|
|
120
|
+
messages Message[]
|
|
178
121
|
}
|
|
179
122
|
|
|
180
123
|
model ChatUser {
|
|
181
|
-
id
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
updatedAt DateTime @updatedAt
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
enum MediaType {
|
|
192
|
-
image
|
|
193
|
-
video
|
|
194
|
-
audio
|
|
195
|
-
pdf
|
|
124
|
+
id String @id @default(cuid())
|
|
125
|
+
chatId String
|
|
126
|
+
userId String
|
|
127
|
+
createdAt DateTime @default(now())
|
|
128
|
+
updatedAt DateTime @updatedAt
|
|
129
|
+
chat Chat @relation(fields: [chatId], references: [id])
|
|
130
|
+
user User @relation(fields: [userId], references: [id])
|
|
196
131
|
}
|
|
197
132
|
|
|
198
133
|
model Message {
|
|
199
|
-
id
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
mediaUrl String?
|
|
134
|
+
id String @id @default(cuid())
|
|
135
|
+
chatId String
|
|
136
|
+
senderId String
|
|
137
|
+
createdAt DateTime @default(now())
|
|
138
|
+
updatedAt DateTime @updatedAt
|
|
139
|
+
mediaUrl String?
|
|
140
|
+
text String
|
|
207
141
|
mediaType MediaType?
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
updatedAt DateTime @updatedAt
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
enum NotificationType {
|
|
215
|
-
NEW_MESSAGE
|
|
216
|
-
EVENT_REMINDER
|
|
217
|
-
EVENT_PARTICIPATION_CONFIRMATION
|
|
142
|
+
chat Chat @relation(fields: [chatId], references: [id])
|
|
143
|
+
sender User @relation(fields: [senderId], references: [id])
|
|
218
144
|
}
|
|
219
145
|
|
|
220
146
|
model Notification {
|
|
221
|
-
id
|
|
222
|
-
notifiedTo User @relation("NotificationRecipient", fields: [notifiedToId], references: [id])
|
|
147
|
+
id String @id @default(cuid())
|
|
223
148
|
notifiedToId String
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
149
|
+
userId String?
|
|
150
|
+
type NotificationType
|
|
151
|
+
read Boolean @default(false)
|
|
152
|
+
data Json?
|
|
153
|
+
createdAt DateTime @default(now())
|
|
154
|
+
updatedAt DateTime @updatedAt
|
|
155
|
+
notifiedTo User @relation("NotificationRecipient", fields: [notifiedToId], references: [id])
|
|
156
|
+
user User? @relation("NotificationSender", fields: [userId], references: [id])
|
|
232
157
|
}
|
|
233
158
|
|
|
234
159
|
model ProviderCategory {
|
|
235
|
-
id
|
|
236
|
-
name
|
|
160
|
+
id String @id @default(cuid())
|
|
161
|
+
name String @unique
|
|
237
162
|
description String?
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
createdAt DateTime @default(now())
|
|
243
|
-
updatedAt DateTime @updatedAt
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
enum ProviderStatus {
|
|
247
|
-
PENDING
|
|
248
|
-
APPROVED
|
|
249
|
-
REJECTED
|
|
163
|
+
active Boolean @default(true)
|
|
164
|
+
createdAt DateTime @default(now())
|
|
165
|
+
updatedAt DateTime @updatedAt
|
|
166
|
+
providers Provider[]
|
|
250
167
|
}
|
|
251
168
|
|
|
252
169
|
model Provider {
|
|
253
|
-
id
|
|
254
|
-
name
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
170
|
+
id String @id @default(cuid())
|
|
171
|
+
name String
|
|
172
|
+
description String?
|
|
173
|
+
image String?
|
|
174
|
+
userId String
|
|
175
|
+
status ProviderStatus @default(PENDING)
|
|
176
|
+
createdAt DateTime @default(now())
|
|
177
|
+
updatedAt DateTime @updatedAt
|
|
178
|
+
addressId String?
|
|
179
|
+
categoryId String
|
|
180
|
+
docs Json?
|
|
181
|
+
email String?
|
|
182
|
+
phoneNumber String?
|
|
260
183
|
pricingDetails String?
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
categoryId String
|
|
269
|
-
|
|
270
|
-
reviews Review[]
|
|
271
|
-
|
|
272
|
-
user User @relation(fields: [userId], references: [id])
|
|
273
|
-
userId String
|
|
274
|
-
|
|
275
|
-
events Event[]
|
|
276
|
-
|
|
277
|
-
status ProviderStatus @default(PENDING)
|
|
278
|
-
|
|
279
|
-
createdAt DateTime @default(now())
|
|
280
|
-
updatedAt DateTime @updatedAt
|
|
184
|
+
rating Float?
|
|
185
|
+
website String?
|
|
186
|
+
address Address? @relation(fields: [addressId], references: [id])
|
|
187
|
+
category ProviderCategory @relation(fields: [categoryId], references: [id])
|
|
188
|
+
user User @relation(fields: [userId], references: [id])
|
|
189
|
+
reviews Review[]
|
|
190
|
+
events Event[] @relation("EventToProvider")
|
|
281
191
|
}
|
|
282
192
|
|
|
283
193
|
model Review {
|
|
284
|
-
id
|
|
285
|
-
rating
|
|
286
|
-
comment
|
|
287
|
-
provider Provider @relation(fields: [providerId], references: [id])
|
|
194
|
+
id String @id @default(cuid())
|
|
195
|
+
rating Float
|
|
196
|
+
comment String?
|
|
288
197
|
providerId String
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
updatedAt DateTime @updatedAt
|
|
198
|
+
userId String
|
|
199
|
+
createdAt DateTime @default(now())
|
|
200
|
+
updatedAt DateTime @updatedAt
|
|
201
|
+
provider Provider @relation(fields: [providerId], references: [id])
|
|
202
|
+
user User @relation(fields: [userId], references: [id])
|
|
295
203
|
}
|
|
296
204
|
|
|
297
205
|
model Favorite {
|
|
298
|
-
id
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
event Event @relation(fields: [eventId], references: [id])
|
|
302
|
-
eventId String
|
|
303
|
-
|
|
206
|
+
id String @id @default(cuid())
|
|
207
|
+
userId String
|
|
208
|
+
eventId String
|
|
304
209
|
createdAt DateTime @default(now())
|
|
305
210
|
updatedAt DateTime @updatedAt
|
|
211
|
+
event Event @relation(fields: [eventId], references: [id])
|
|
212
|
+
user User @relation(fields: [userId], references: [id])
|
|
306
213
|
}
|
|
307
214
|
|
|
308
|
-
// Add new Order model
|
|
309
215
|
model Order {
|
|
310
|
-
id
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
paymentIntentId String? @unique // For Stripe integration
|
|
324
|
-
paymentStatus PaymentStatus @default(PENDING)
|
|
325
|
-
|
|
326
|
-
createdAt DateTime @default(now())
|
|
327
|
-
updatedAt DateTime @updatedAt
|
|
216
|
+
id String @id @default(cuid())
|
|
217
|
+
userId String
|
|
218
|
+
eventId String
|
|
219
|
+
email String
|
|
220
|
+
status OrderStatus @default(PENDING)
|
|
221
|
+
totalAmount Float
|
|
222
|
+
paymentIntentId String? @unique
|
|
223
|
+
paymentStatus PaymentStatus @default(PENDING)
|
|
224
|
+
createdAt DateTime @default(now())
|
|
225
|
+
updatedAt DateTime @updatedAt
|
|
226
|
+
event Event @relation(fields: [eventId], references: [id])
|
|
227
|
+
user User @relation(fields: [userId], references: [id])
|
|
228
|
+
items OrderItem[]
|
|
328
229
|
}
|
|
329
230
|
|
|
330
|
-
// Add new OrderItem model
|
|
331
231
|
model OrderItem {
|
|
332
|
-
id
|
|
333
|
-
|
|
334
|
-
orderId String
|
|
335
|
-
|
|
336
|
-
eventPrice EventPrice @relation(fields: [eventPriceId], references: [id])
|
|
232
|
+
id String @id @default(cuid())
|
|
233
|
+
orderId String
|
|
337
234
|
eventPriceId String
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
235
|
+
quantity Int
|
|
236
|
+
unitPrice Float
|
|
237
|
+
createdAt DateTime @default(now())
|
|
238
|
+
updatedAt DateTime @updatedAt
|
|
239
|
+
eventPrice EventPrice @relation(fields: [eventPriceId], references: [id])
|
|
240
|
+
order Order @relation(fields: [orderId], references: [id])
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
enum UserRole {
|
|
244
|
+
SUPER_ADMIN
|
|
245
|
+
ADMIN
|
|
246
|
+
USER
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
enum UserStatus {
|
|
250
|
+
ACTIVE
|
|
251
|
+
INACTIVE
|
|
252
|
+
DELETED
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
enum EventAccess {
|
|
256
|
+
FREE
|
|
257
|
+
PAID
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
enum EventVisibility {
|
|
261
|
+
PUBLIC
|
|
262
|
+
PRIVATE
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
enum EventStatus {
|
|
266
|
+
DRAFT
|
|
267
|
+
PUBLISHED
|
|
268
|
+
PENDING
|
|
269
|
+
CANCELLED
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
enum MediaType {
|
|
273
|
+
image
|
|
274
|
+
video
|
|
275
|
+
audio
|
|
276
|
+
pdf
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
enum NotificationType {
|
|
280
|
+
NEW_MESSAGE
|
|
281
|
+
EVENT_REMINDER
|
|
282
|
+
EVENT_PARTICIPATION_CONFIRMATION
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
enum ProviderStatus {
|
|
286
|
+
PENDING
|
|
287
|
+
APPROVED
|
|
288
|
+
REJECTED
|
|
344
289
|
}
|
|
345
290
|
|
|
346
291
|
enum OrderStatus {
|
|
@@ -355,4 +300,4 @@ enum PaymentStatus {
|
|
|
355
300
|
COMPLETED
|
|
356
301
|
FAILED
|
|
357
302
|
REFUNDED
|
|
358
|
-
}
|
|
303
|
+
}
|
package/src/auth/auth.guard.ts
CHANGED
|
@@ -54,7 +54,6 @@ export class AuthGuard implements CanActivate {
|
|
|
54
54
|
|
|
55
55
|
private extractTokenFromHeader(request: Request & { headers: IncomingHttpHeaders }): string | undefined {
|
|
56
56
|
const [type, token] = request.headers.authorization?.split(' ') ?? [];
|
|
57
|
-
//this.logger.log('extractTokenFromHeader', {type, token});
|
|
58
57
|
return type === 'Bearer' ? token : undefined;
|
|
59
58
|
}
|
|
60
59
|
}
|