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