@optimatech88/titomeet-shared-lib 1.0.35 → 1.0.37

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.
Files changed (26) hide show
  1. package/.github/workflows/npm-publish.yml +34 -0
  2. package/dist/auth/auth.guard.d.ts.map +1 -1
  3. package/dist/auth/auth.guard.js.map +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +1 -3
  7. package/dist/index.js.map +1 -1
  8. package/package.json +44 -44
  9. package/prisma/migrations/20250805002500_added_provider_on_event/migration.sql +433 -0
  10. package/prisma/migrations/migration_lock.toml +1 -1
  11. package/prisma/schema.prisma +347 -339
  12. package/src/auth/auth.guard.ts +1 -0
  13. package/src/index.ts +0 -3
  14. package/prisma/migrations/20250320090311_save_data/migration.sql +0 -284
  15. package/prisma/migrations/20250327150554_added_provider_category/migration.sql +0 -46
  16. package/prisma/migrations/20250401154936_updates/migration.sql +0 -79
  17. package/prisma/migrations/20250401164742_added_orders/migration.sql +0 -143
  18. package/prisma/migrations/20250504144629_update_chat/migration.sql +0 -44
  19. package/prisma/migrations/20250528182042_updated_user_model/migration.sql +0 -11
  20. package/prisma/migrations/20250530152731_updated_model/migration.sql +0 -1
  21. package/prisma/migrations/20250530152845_updated_model/migration.sql +0 -1
  22. package/prisma/migrations/20250604094431_added_user_interests/migration.sql +0 -16
  23. package/prisma/migrations/20250604105002_added_category_children/migration.sql +0 -31
  24. package/prisma/migrations/20250611180441_added_chat_files/migration.sql +0 -11
  25. package/prisma/migrations/20250617111807_updated_notification_type/migration.sql +0 -13
  26. package/prisma/migrations/20250716081532_added_newslettter/migration.sql +0 -13
@@ -1,339 +1,347 @@
1
- generator client {
2
- provider = "prisma-client-js"
3
- }
4
-
5
- datasource db {
6
- provider = "postgresql"
7
- url = env("DATABASE_URL")
8
- }
9
-
10
- model User {
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[]
28
- notificationsReceived Notification[] @relation("NotificationRecipient")
29
- notificationsSent Notification[] @relation("NotificationSender")
30
- orders Order[]
31
- providers Provider[]
32
- reviews Review[]
33
-
34
- userInterests UserInterests?
35
- }
36
-
37
- model Account {
38
- id String @id @default(cuid())
39
- refreshToken String @unique
40
- expiresAt DateTime
41
- userId String
42
- user User @relation(fields: [userId], references: [id])
43
- }
44
-
45
- model Address {
46
- id String @id @default(uuid())
47
- name String
48
- line2 String?
49
- city String?
50
- state String?
51
- country String
52
- postalCode String?
53
- createdAt DateTime @default(now())
54
- updatedAt DateTime @updatedAt
55
- countryCode String?
56
- latitude Float?
57
- longitude Float?
58
- type String @default("suburb")
59
- events Event[]
60
- Provider Provider[]
61
- }
62
-
63
- model EventCategory {
64
- id String @id @default(cuid())
65
- name String @unique
66
- description String?
67
- createdAt DateTime @default(now())
68
- updatedAt DateTime @updatedAt
69
- active Boolean @default(true)
70
- events Event[] @relation("EventToEventCategory")
71
- userInterests UserInterests[]
72
-
73
- parentId String?
74
- parent EventCategory? @relation("EventCategoryParent", fields: [parentId], references: [id])
75
-
76
-
77
- children EventCategory[] @relation("EventCategoryParent")
78
- }
79
-
80
- model Event {
81
- id String @id @default(cuid())
82
- name String
83
- description String
84
- startDate DateTime
85
- endDate DateTime
86
- startTime String
87
- endTime String
88
- capacity Int
89
- coverPicture String
90
- badge String
91
- tags String[]
92
- accessType EventAccess @default(FREE)
93
- visibility EventVisibility @default(PUBLIC)
94
- status EventStatus @default(DRAFT)
95
- addressId String
96
- postedById String
97
- createdAt DateTime @default(now())
98
- updatedAt DateTime @updatedAt
99
- chat Chat?
100
- address Address @relation(fields: [addressId], references: [id])
101
- postedBy User @relation(fields: [postedById], references: [id])
102
- prices EventPrice[]
103
- favorites Favorite[]
104
- orders Order[]
105
- categories EventCategory[] @relation("EventToEventCategory")
106
- providers Provider[] @relation("EventToProvider")
107
- }
108
-
109
- model EventPrice {
110
- id String @id @default(uuid())
111
- name String
112
- amount Float
113
- description String?
114
- eventId String
115
- createdAt DateTime @default(now())
116
- updatedAt DateTime @updatedAt
117
- event Event @relation(fields: [eventId], references: [id])
118
- orderItems OrderItem[]
119
- }
120
-
121
- model Chat {
122
- id String @id @default(cuid())
123
- name String
124
- eventId String @unique
125
- createdAt DateTime @default(now())
126
- updatedAt DateTime @updatedAt
127
- event Event @relation(fields: [eventId], references: [id])
128
- users ChatUser[]
129
- messages Message[]
130
- }
131
-
132
- model ChatUser {
133
- id String @id @default(cuid())
134
- chatId String
135
- userId String
136
- createdAt DateTime @default(now())
137
- updatedAt DateTime @updatedAt
138
- chat Chat @relation(fields: [chatId], references: [id])
139
- user User @relation(fields: [userId], references: [id])
140
- }
141
-
142
- model Message {
143
- id String @id @default(cuid())
144
- chatId String
145
- senderId String
146
- createdAt DateTime @default(now())
147
- updatedAt DateTime @updatedAt
148
- files Json?
149
- text String
150
- chat Chat @relation(fields: [chatId], references: [id])
151
- sender User @relation(fields: [senderId], references: [id])
152
- }
153
-
154
- model Notification {
155
- id String @id @default(cuid())
156
- notifiedToId String
157
- userId String?
158
- type NotificationType
159
- read Boolean @default(false)
160
- data Json?
161
- createdAt DateTime @default(now())
162
- updatedAt DateTime @updatedAt
163
- notifiedTo User @relation("NotificationRecipient", fields: [notifiedToId], references: [id])
164
- user User? @relation("NotificationSender", fields: [userId], references: [id])
165
- }
166
-
167
- model ProviderCategory {
168
- id String @id @default(cuid())
169
- name String @unique
170
- description String?
171
- active Boolean @default(true)
172
- createdAt DateTime @default(now())
173
- updatedAt DateTime @updatedAt
174
- providers Provider[]
175
- }
176
-
177
- model Provider {
178
- id String @id @default(cuid())
179
- name String
180
- description String?
181
- image String?
182
- userId String
183
- status ProviderStatus @default(PENDING)
184
- createdAt DateTime @default(now())
185
- updatedAt DateTime @updatedAt
186
- addressId String?
187
- categoryId String
188
- docs Json?
189
- email String?
190
- phoneNumber String?
191
- pricingDetails String?
192
- rating Float?
193
- website String?
194
- address Address? @relation(fields: [addressId], references: [id])
195
- category ProviderCategory @relation(fields: [categoryId], references: [id])
196
- user User @relation(fields: [userId], references: [id])
197
- reviews Review[]
198
- events Event[] @relation("EventToProvider")
199
- }
200
-
201
- model Review {
202
- id String @id @default(cuid())
203
- rating Float
204
- comment String?
205
- providerId String
206
- userId String
207
- createdAt DateTime @default(now())
208
- updatedAt DateTime @updatedAt
209
- provider Provider @relation(fields: [providerId], references: [id])
210
- user User @relation(fields: [userId], references: [id])
211
- }
212
-
213
- model Favorite {
214
- id String @id @default(cuid())
215
- userId String
216
- eventId String
217
- createdAt DateTime @default(now())
218
- updatedAt DateTime @updatedAt
219
- event Event @relation(fields: [eventId], references: [id])
220
- user User @relation(fields: [userId], references: [id])
221
- }
222
-
223
- model Order {
224
- id String @id @default(cuid())
225
- userId String
226
- eventId String
227
- email String
228
- status OrderStatus @default(PENDING)
229
- totalAmount Float
230
- paymentIntentId String? @unique
231
- paymentStatus PaymentStatus @default(PENDING)
232
- createdAt DateTime @default(now())
233
- updatedAt DateTime @updatedAt
234
- event Event @relation(fields: [eventId], references: [id])
235
- user User @relation(fields: [userId], references: [id])
236
- items OrderItem[]
237
- }
238
-
239
- model OrderItem {
240
- id String @id @default(cuid())
241
- orderId String
242
- eventPriceId String
243
- quantity Int
244
- unitPrice Float
245
- createdAt DateTime @default(now())
246
- updatedAt DateTime @updatedAt
247
- eventPrice EventPrice @relation(fields: [eventPriceId], references: [id])
248
- order Order @relation(fields: [orderId], references: [id])
249
- }
250
-
251
-
252
- model UserInterests {
253
- id String @id @default(cuid())
254
-
255
- interests EventCategory[]
256
-
257
- userId String @unique
258
- user User @relation(fields: [userId], references: [id])
259
-
260
- createdAt DateTime @default(now())
261
- updatedAt DateTime @updatedAt
262
- }
263
-
264
- enum UserRole {
265
- SUPER_ADMIN
266
- ADMIN
267
- USER
268
- }
269
-
270
- enum UserStatus {
271
- ACTIVE
272
- INACTIVE
273
- DELETED
274
- }
275
-
276
- enum EventAccess {
277
- FREE
278
- PAID
279
- }
280
-
281
- enum EventVisibility {
282
- PUBLIC
283
- PRIVATE
284
- }
285
-
286
- enum EventStatus {
287
- DRAFT
288
- PUBLISHED
289
- PENDING
290
- CANCELLED
291
- }
292
-
293
- enum MediaType {
294
- image
295
- video
296
- audio
297
- pdf
298
- }
299
-
300
- enum NotificationType {
301
- NEW_MESSAGE
302
- EVENT_REMINDER
303
- EVENT_PARTICIPATION_CONFIRMATION
304
- EVENT_VALIDATION
305
- EVENT_REJECTION
306
- EVENT_ASSIGNMENT
307
- EVENT_ASSIGNMENT_APPROVAL
308
- EVENT_ASSIGNMENT_REJECTION
309
- }
310
-
311
- enum ProviderStatus {
312
- PENDING
313
- APPROVED
314
- REJECTED
315
- }
316
-
317
- enum OrderStatus {
318
- PENDING
319
- CONFIRMED
320
- CANCELLED
321
- REFUNDED
322
- }
323
-
324
- enum PaymentStatus {
325
- PENDING
326
- COMPLETED
327
- FAILED
328
- REFUNDED
329
- }
330
-
331
-
332
- model Newsletter {
333
- id String @id @default(cuid())
334
- email String @unique
335
- unsubscribedAt DateTime?
336
-
337
- createdAt DateTime @default(now())
338
- updatedAt DateTime @updatedAt
339
- }
1
+ generator client {
2
+ provider = "prisma-client-js"
3
+ }
4
+
5
+ datasource db {
6
+ provider = "postgresql"
7
+ url = env("DATABASE_URL")
8
+ }
9
+
10
+ model User {
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[]
28
+ notificationsReceived Notification[] @relation("NotificationRecipient")
29
+ notificationsSent Notification[] @relation("NotificationSender")
30
+ orders Order[]
31
+ providers Provider[]
32
+ reviews Review[]
33
+
34
+ userInterests UserInterests?
35
+ }
36
+
37
+ model Account {
38
+ id String @id @default(cuid())
39
+ refreshToken String @unique
40
+ expiresAt DateTime
41
+ userId String
42
+ user User @relation(fields: [userId], references: [id])
43
+ }
44
+
45
+ model Address {
46
+ id String @id @default(uuid())
47
+ name String
48
+ line2 String?
49
+ city String?
50
+ state String?
51
+ country String
52
+ postalCode String?
53
+ createdAt DateTime @default(now())
54
+ updatedAt DateTime @updatedAt
55
+ countryCode String?
56
+ latitude Float?
57
+ longitude Float?
58
+ type String @default("suburb")
59
+ events Event[]
60
+ Provider Provider[]
61
+ }
62
+
63
+ model EventCategory {
64
+ id String @id @default(cuid())
65
+ name String @unique
66
+ description String?
67
+ createdAt DateTime @default(now())
68
+ updatedAt DateTime @updatedAt
69
+ active Boolean @default(true)
70
+ events Event[] @relation("EventToEventCategory")
71
+ userInterests UserInterests[]
72
+
73
+ parentId String?
74
+ parent EventCategory? @relation("EventCategoryParent", fields: [parentId], references: [id])
75
+
76
+ children EventCategory[] @relation("EventCategoryParent")
77
+ }
78
+
79
+ model Event {
80
+ id String @id @default(cuid())
81
+ name String
82
+ description String
83
+ startDate DateTime
84
+ endDate DateTime
85
+ startTime String
86
+ endTime String
87
+ capacity Int
88
+ coverPicture String
89
+ badge String
90
+ tags String[]
91
+ accessType EventAccess @default(FREE)
92
+ visibility EventVisibility @default(PUBLIC)
93
+ status EventStatus @default(DRAFT)
94
+ addressId String
95
+ postedById String
96
+ createdAt DateTime @default(now())
97
+ updatedAt DateTime @updatedAt
98
+ chat Chat?
99
+ address Address @relation(fields: [addressId], references: [id])
100
+ postedBy User @relation(fields: [postedById], references: [id])
101
+ prices EventPrice[]
102
+ favorites Favorite[]
103
+ orders Order[]
104
+ categories EventCategory[] @relation("EventToEventCategory")
105
+ providers ProviderOnEvent[]
106
+ }
107
+
108
+ model EventPrice {
109
+ id String @id @default(uuid())
110
+ name String
111
+ amount Float
112
+ description String?
113
+ eventId String
114
+ createdAt DateTime @default(now())
115
+ updatedAt DateTime @updatedAt
116
+ event Event @relation(fields: [eventId], references: [id])
117
+ orderItems OrderItem[]
118
+ }
119
+
120
+ model Chat {
121
+ id String @id @default(cuid())
122
+ name String
123
+ eventId String @unique
124
+ createdAt DateTime @default(now())
125
+ updatedAt DateTime @updatedAt
126
+ event Event @relation(fields: [eventId], references: [id])
127
+ users ChatUser[]
128
+ messages Message[]
129
+ }
130
+
131
+ model ChatUser {
132
+ id String @id @default(cuid())
133
+ chatId String
134
+ userId String
135
+ createdAt DateTime @default(now())
136
+ updatedAt DateTime @updatedAt
137
+ chat Chat @relation(fields: [chatId], references: [id])
138
+ user User @relation(fields: [userId], references: [id])
139
+ }
140
+
141
+ model Message {
142
+ id String @id @default(cuid())
143
+ chatId String
144
+ senderId String
145
+ createdAt DateTime @default(now())
146
+ updatedAt DateTime @updatedAt
147
+ files Json?
148
+ text String
149
+ chat Chat @relation(fields: [chatId], references: [id])
150
+ sender User @relation(fields: [senderId], references: [id])
151
+ }
152
+
153
+ model Notification {
154
+ id String @id @default(cuid())
155
+ notifiedToId String
156
+ userId String?
157
+ type NotificationType
158
+ read Boolean @default(false)
159
+ data Json?
160
+ createdAt DateTime @default(now())
161
+ updatedAt DateTime @updatedAt
162
+ notifiedTo User @relation("NotificationRecipient", fields: [notifiedToId], references: [id])
163
+ user User? @relation("NotificationSender", fields: [userId], references: [id])
164
+ }
165
+
166
+ model ProviderCategory {
167
+ id String @id @default(cuid())
168
+ name String @unique
169
+ description String?
170
+ active Boolean @default(true)
171
+ createdAt DateTime @default(now())
172
+ updatedAt DateTime @updatedAt
173
+ providers Provider[]
174
+ }
175
+
176
+ model Provider {
177
+ id String @id @default(cuid())
178
+ name String
179
+ description String?
180
+ image String?
181
+ userId String
182
+ status ProviderStatus @default(PENDING)
183
+ createdAt DateTime @default(now())
184
+ updatedAt DateTime @updatedAt
185
+ addressId String?
186
+ categoryId String
187
+ docs Json?
188
+ email String?
189
+ phoneNumber String?
190
+ pricingDetails String?
191
+ rating Float?
192
+ website String?
193
+ address Address? @relation(fields: [addressId], references: [id])
194
+ category ProviderCategory @relation(fields: [categoryId], references: [id])
195
+ user User @relation(fields: [userId], references: [id])
196
+ reviews Review[]
197
+ events ProviderOnEvent[]
198
+ }
199
+
200
+ model ProviderOnEvent {
201
+ id String @id @default(cuid())
202
+ providerId String
203
+ provider Provider @relation(fields: [providerId], references: [id])
204
+ eventId String
205
+ event Event @relation(fields: [eventId], references: [id])
206
+
207
+ createdAt DateTime @default(now())
208
+ updatedAt DateTime @updatedAt
209
+ }
210
+
211
+ model Review {
212
+ id String @id @default(cuid())
213
+ rating Float
214
+ comment String?
215
+ providerId String
216
+ userId String
217
+ createdAt DateTime @default(now())
218
+ updatedAt DateTime @updatedAt
219
+ provider Provider @relation(fields: [providerId], references: [id])
220
+ user User @relation(fields: [userId], references: [id])
221
+ }
222
+
223
+ model Favorite {
224
+ id String @id @default(cuid())
225
+ userId String
226
+ eventId String
227
+ createdAt DateTime @default(now())
228
+ updatedAt DateTime @updatedAt
229
+ event Event @relation(fields: [eventId], references: [id])
230
+ user User @relation(fields: [userId], references: [id])
231
+ }
232
+
233
+ model Order {
234
+ id String @id @default(cuid())
235
+ userId String
236
+ eventId String
237
+ email String
238
+ status OrderStatus @default(PENDING)
239
+ totalAmount Float
240
+ paymentIntentId String? @unique
241
+ paymentStatus PaymentStatus @default(PENDING)
242
+ createdAt DateTime @default(now())
243
+ updatedAt DateTime @updatedAt
244
+ event Event @relation(fields: [eventId], references: [id])
245
+ user User @relation(fields: [userId], references: [id])
246
+ items OrderItem[]
247
+ }
248
+
249
+ model OrderItem {
250
+ id String @id @default(cuid())
251
+ orderId String
252
+ eventPriceId String
253
+ quantity Int
254
+ unitPrice Float
255
+ createdAt DateTime @default(now())
256
+ updatedAt DateTime @updatedAt
257
+ eventPrice EventPrice @relation(fields: [eventPriceId], references: [id])
258
+ order Order @relation(fields: [orderId], references: [id])
259
+ }
260
+
261
+ model UserInterests {
262
+ id String @id @default(cuid())
263
+
264
+ interests EventCategory[]
265
+
266
+ userId String @unique
267
+ user User @relation(fields: [userId], references: [id])
268
+
269
+ createdAt DateTime @default(now())
270
+ updatedAt DateTime @updatedAt
271
+ }
272
+
273
+ enum UserRole {
274
+ SUPER_ADMIN
275
+ ADMIN
276
+ USER
277
+ }
278
+
279
+ enum UserStatus {
280
+ ACTIVE
281
+ INACTIVE
282
+ DELETED
283
+ }
284
+
285
+ enum EventAccess {
286
+ FREE
287
+ PAID
288
+ }
289
+
290
+ enum EventVisibility {
291
+ PUBLIC
292
+ PRIVATE
293
+ }
294
+
295
+ enum EventStatus {
296
+ DRAFT
297
+ PUBLISHED
298
+ PENDING
299
+ CANCELLED
300
+ }
301
+
302
+ enum MediaType {
303
+ image
304
+ video
305
+ audio
306
+ pdf
307
+ }
308
+
309
+ enum NotificationType {
310
+ NEW_MESSAGE
311
+ EVENT_REMINDER
312
+ EVENT_PARTICIPATION_CONFIRMATION
313
+ EVENT_VALIDATION
314
+ EVENT_REJECTION
315
+ EVENT_ASSIGNMENT
316
+ EVENT_ASSIGNMENT_APPROVAL
317
+ EVENT_ASSIGNMENT_REJECTION
318
+ }
319
+
320
+ enum ProviderStatus {
321
+ PENDING
322
+ APPROVED
323
+ REJECTED
324
+ }
325
+
326
+ enum OrderStatus {
327
+ PENDING
328
+ CONFIRMED
329
+ CANCELLED
330
+ REFUNDED
331
+ }
332
+
333
+ enum PaymentStatus {
334
+ PENDING
335
+ COMPLETED
336
+ FAILED
337
+ REFUNDED
338
+ }
339
+
340
+ model Newsletter {
341
+ id String @id @default(cuid())
342
+ email String @unique
343
+ unsubscribedAt DateTime?
344
+
345
+ createdAt DateTime @default(now())
346
+ updatedAt DateTime @updatedAt
347
+ }