@optimatech88/titomeet-shared-lib 1.0.34 → 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.
@@ -54,6 +54,7 @@ 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});
57
58
  return type === 'Bearer' ? token : undefined;
58
59
  }
59
60
  }
package/src/index.ts CHANGED
@@ -18,9 +18,6 @@ export {
18
18
  Message,
19
19
  Notification,
20
20
  NotificationType,
21
- MediaType,
22
- UserStatus,
23
- UserInterests
24
21
  } from '@prisma/client';
25
22
 
26
23
  //auth
@@ -1,284 +0,0 @@
1
- -- CreateEnum
2
- CREATE TYPE "UserRole" AS ENUM ('SUPER_ADMIN', 'ADMIN', 'USER');
3
-
4
- -- CreateEnum
5
- CREATE TYPE "EventAccess" AS ENUM ('FREE', 'PAID');
6
-
7
- -- CreateEnum
8
- CREATE TYPE "EventVisibility" AS ENUM ('PUBLIC', 'PRIVATE');
9
-
10
- -- CreateEnum
11
- CREATE TYPE "EventStatus" AS ENUM ('DRAFT', 'PENDING', 'PUBLISHED', 'CANCELLED');
12
-
13
- -- CreateEnum
14
- CREATE TYPE "ParticipantStatus" AS ENUM ('PENDING', 'CONFIRMED', 'CANCELLED');
15
-
16
- -- CreateEnum
17
- CREATE TYPE "NotificationType" AS ENUM ('NEW_MESSAGE', 'EVENT_REMINDER', 'EVENT_PARTICIPATION_CONFIRMATION');
18
-
19
- -- CreateEnum
20
- CREATE TYPE "ProviderStatus" AS ENUM ('PENDING', 'APPROVED', 'REJECTED');
21
-
22
- -- CreateTable
23
- CREATE TABLE "User" (
24
- "id" TEXT NOT NULL,
25
- "username" TEXT NOT NULL,
26
- "email" TEXT NOT NULL,
27
- "firstName" TEXT NOT NULL,
28
- "lastName" TEXT NOT NULL,
29
- "password" TEXT,
30
- "role" "UserRole" NOT NULL DEFAULT 'USER',
31
- "profilePicture" TEXT,
32
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
33
- "updatedAt" TIMESTAMP(3) NOT NULL,
34
-
35
- CONSTRAINT "User_pkey" PRIMARY KEY ("id")
36
- );
37
-
38
- -- CreateTable
39
- CREATE TABLE "Account" (
40
- "id" TEXT NOT NULL,
41
- "refreshToken" TEXT NOT NULL,
42
- "expiresAt" TIMESTAMP(3) NOT NULL,
43
- "userId" TEXT NOT NULL,
44
-
45
- CONSTRAINT "Account_pkey" PRIMARY KEY ("id")
46
- );
47
-
48
- -- CreateTable
49
- CREATE TABLE "Address" (
50
- "id" TEXT NOT NULL,
51
- "name" TEXT NOT NULL,
52
- "line2" TEXT,
53
- "city" TEXT,
54
- "state" TEXT,
55
- "country" TEXT NOT NULL,
56
- "countryCode" TEXT,
57
- "postalCode" TEXT,
58
- "type" TEXT NOT NULL DEFAULT 'suburb',
59
- "latitude" DOUBLE PRECISION,
60
- "longitude" DOUBLE PRECISION,
61
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
62
- "updatedAt" TIMESTAMP(3) NOT NULL,
63
-
64
- CONSTRAINT "Address_pkey" PRIMARY KEY ("id")
65
- );
66
-
67
- -- CreateTable
68
- CREATE TABLE "EventCategory" (
69
- "id" TEXT NOT NULL,
70
- "name" TEXT NOT NULL,
71
- "description" TEXT,
72
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
73
- "updatedAt" TIMESTAMP(3) NOT NULL,
74
-
75
- CONSTRAINT "EventCategory_pkey" PRIMARY KEY ("id")
76
- );
77
-
78
- -- CreateTable
79
- CREATE TABLE "Event" (
80
- "id" TEXT NOT NULL,
81
- "name" TEXT NOT NULL,
82
- "description" TEXT NOT NULL,
83
- "startDate" TIMESTAMP(3) NOT NULL,
84
- "endDate" TIMESTAMP(3) NOT NULL,
85
- "startTime" TEXT NOT NULL,
86
- "endTime" TEXT NOT NULL,
87
- "capacity" INTEGER NOT NULL,
88
- "coverPicture" TEXT NOT NULL,
89
- "badge" TEXT NOT NULL,
90
- "tags" TEXT[],
91
- "accessType" "EventAccess" NOT NULL DEFAULT 'FREE',
92
- "visibility" "EventVisibility" NOT NULL DEFAULT 'PUBLIC',
93
- "status" "EventStatus" NOT NULL DEFAULT 'DRAFT',
94
- "addressId" TEXT NOT NULL,
95
- "postedById" TEXT NOT NULL,
96
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
97
- "updatedAt" TIMESTAMP(3) NOT NULL,
98
-
99
- CONSTRAINT "Event_pkey" PRIMARY KEY ("id")
100
- );
101
-
102
- -- CreateTable
103
- CREATE TABLE "EventPrice" (
104
- "id" TEXT NOT NULL,
105
- "name" TEXT NOT NULL,
106
- "amount" DOUBLE PRECISION NOT NULL,
107
- "description" TEXT,
108
- "eventId" TEXT NOT NULL,
109
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
110
- "updatedAt" TIMESTAMP(3) NOT NULL,
111
-
112
- CONSTRAINT "EventPrice_pkey" PRIMARY KEY ("id")
113
- );
114
-
115
- -- CreateTable
116
- CREATE TABLE "Chat" (
117
- "id" TEXT NOT NULL,
118
- "name" TEXT NOT NULL,
119
- "eventId" TEXT NOT NULL,
120
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
121
- "updatedAt" TIMESTAMP(3) NOT NULL,
122
-
123
- CONSTRAINT "Chat_pkey" PRIMARY KEY ("id")
124
- );
125
-
126
- -- CreateTable
127
- CREATE TABLE "Message" (
128
- "id" TEXT NOT NULL,
129
- "content" TEXT NOT NULL,
130
- "chatId" TEXT NOT NULL,
131
- "senderId" TEXT NOT NULL,
132
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
133
- "updatedAt" TIMESTAMP(3) NOT NULL,
134
-
135
- CONSTRAINT "Message_pkey" PRIMARY KEY ("id")
136
- );
137
-
138
- -- CreateTable
139
- CREATE TABLE "Participant" (
140
- "id" TEXT NOT NULL,
141
- "eventId" TEXT NOT NULL,
142
- "userId" TEXT NOT NULL,
143
- "status" "ParticipantStatus" NOT NULL DEFAULT 'PENDING',
144
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
145
- "updatedAt" TIMESTAMP(3) NOT NULL,
146
-
147
- CONSTRAINT "Participant_pkey" PRIMARY KEY ("id")
148
- );
149
-
150
- -- CreateTable
151
- CREATE TABLE "Notification" (
152
- "id" TEXT NOT NULL,
153
- "notifiedToId" TEXT NOT NULL,
154
- "userId" TEXT,
155
- "type" "NotificationType" NOT NULL,
156
- "read" BOOLEAN NOT NULL DEFAULT false,
157
- "data" JSONB,
158
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
159
- "updatedAt" TIMESTAMP(3) NOT NULL,
160
-
161
- CONSTRAINT "Notification_pkey" PRIMARY KEY ("id")
162
- );
163
-
164
- -- CreateTable
165
- CREATE TABLE "Provider" (
166
- "id" TEXT NOT NULL,
167
- "name" TEXT NOT NULL,
168
- "description" TEXT,
169
- "image" TEXT,
170
- "rating" DOUBLE PRECISION,
171
- "userId" TEXT NOT NULL,
172
- "status" "ProviderStatus" NOT NULL DEFAULT 'PENDING',
173
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
174
- "updatedAt" TIMESTAMP(3) NOT NULL,
175
-
176
- CONSTRAINT "Provider_pkey" PRIMARY KEY ("id")
177
- );
178
-
179
- -- CreateTable
180
- CREATE TABLE "Review" (
181
- "id" TEXT NOT NULL,
182
- "rating" DOUBLE PRECISION NOT NULL,
183
- "comment" TEXT,
184
- "providerId" TEXT NOT NULL,
185
- "userId" TEXT NOT NULL,
186
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
187
- "updatedAt" TIMESTAMP(3) NOT NULL,
188
-
189
- CONSTRAINT "Review_pkey" PRIMARY KEY ("id")
190
- );
191
-
192
- -- CreateTable
193
- CREATE TABLE "_EventToEventCategory" (
194
- "A" TEXT NOT NULL,
195
- "B" TEXT NOT NULL,
196
-
197
- CONSTRAINT "_EventToEventCategory_AB_pkey" PRIMARY KEY ("A","B")
198
- );
199
-
200
- -- CreateTable
201
- CREATE TABLE "_EventToProvider" (
202
- "A" TEXT NOT NULL,
203
- "B" TEXT NOT NULL,
204
-
205
- CONSTRAINT "_EventToProvider_AB_pkey" PRIMARY KEY ("A","B")
206
- );
207
-
208
- -- CreateIndex
209
- CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
210
-
211
- -- CreateIndex
212
- CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
213
-
214
- -- CreateIndex
215
- CREATE UNIQUE INDEX "Account_refreshToken_key" ON "Account"("refreshToken");
216
-
217
- -- CreateIndex
218
- CREATE UNIQUE INDEX "EventCategory_name_key" ON "EventCategory"("name");
219
-
220
- -- CreateIndex
221
- CREATE UNIQUE INDEX "Chat_eventId_key" ON "Chat"("eventId");
222
-
223
- -- CreateIndex
224
- CREATE UNIQUE INDEX "Participant_eventId_userId_key" ON "Participant"("eventId", "userId");
225
-
226
- -- CreateIndex
227
- CREATE INDEX "_EventToEventCategory_B_index" ON "_EventToEventCategory"("B");
228
-
229
- -- CreateIndex
230
- CREATE INDEX "_EventToProvider_B_index" ON "_EventToProvider"("B");
231
-
232
- -- AddForeignKey
233
- ALTER TABLE "Account" ADD CONSTRAINT "Account_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
234
-
235
- -- AddForeignKey
236
- ALTER TABLE "Event" ADD CONSTRAINT "Event_addressId_fkey" FOREIGN KEY ("addressId") REFERENCES "Address"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
237
-
238
- -- AddForeignKey
239
- ALTER TABLE "Event" ADD CONSTRAINT "Event_postedById_fkey" FOREIGN KEY ("postedById") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
240
-
241
- -- AddForeignKey
242
- ALTER TABLE "EventPrice" ADD CONSTRAINT "EventPrice_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
243
-
244
- -- AddForeignKey
245
- ALTER TABLE "Chat" ADD CONSTRAINT "Chat_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
246
-
247
- -- AddForeignKey
248
- ALTER TABLE "Message" ADD CONSTRAINT "Message_chatId_fkey" FOREIGN KEY ("chatId") REFERENCES "Chat"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
249
-
250
- -- AddForeignKey
251
- ALTER TABLE "Message" ADD CONSTRAINT "Message_senderId_fkey" FOREIGN KEY ("senderId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
252
-
253
- -- AddForeignKey
254
- ALTER TABLE "Participant" ADD CONSTRAINT "Participant_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
255
-
256
- -- AddForeignKey
257
- ALTER TABLE "Participant" ADD CONSTRAINT "Participant_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
258
-
259
- -- AddForeignKey
260
- ALTER TABLE "Notification" ADD CONSTRAINT "Notification_notifiedToId_fkey" FOREIGN KEY ("notifiedToId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
261
-
262
- -- AddForeignKey
263
- ALTER TABLE "Notification" ADD CONSTRAINT "Notification_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;
264
-
265
- -- AddForeignKey
266
- ALTER TABLE "Provider" ADD CONSTRAINT "Provider_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
267
-
268
- -- AddForeignKey
269
- ALTER TABLE "Review" ADD CONSTRAINT "Review_providerId_fkey" FOREIGN KEY ("providerId") REFERENCES "Provider"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
270
-
271
- -- AddForeignKey
272
- ALTER TABLE "Review" ADD CONSTRAINT "Review_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
273
-
274
- -- AddForeignKey
275
- ALTER TABLE "_EventToEventCategory" ADD CONSTRAINT "_EventToEventCategory_A_fkey" FOREIGN KEY ("A") REFERENCES "Event"("id") ON DELETE CASCADE ON UPDATE CASCADE;
276
-
277
- -- AddForeignKey
278
- ALTER TABLE "_EventToEventCategory" ADD CONSTRAINT "_EventToEventCategory_B_fkey" FOREIGN KEY ("B") REFERENCES "EventCategory"("id") ON DELETE CASCADE ON UPDATE CASCADE;
279
-
280
- -- AddForeignKey
281
- ALTER TABLE "_EventToProvider" ADD CONSTRAINT "_EventToProvider_A_fkey" FOREIGN KEY ("A") REFERENCES "Event"("id") ON DELETE CASCADE ON UPDATE CASCADE;
282
-
283
- -- AddForeignKey
284
- ALTER TABLE "_EventToProvider" ADD CONSTRAINT "_EventToProvider_B_fkey" FOREIGN KEY ("B") REFERENCES "Provider"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -1,46 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - Added the required column `categoryId` to the `Provider` table without a default value. This is not possible if the table is not empty.
5
-
6
- */
7
- -- AlterTable
8
- ALTER TABLE "Provider" ADD COLUMN "addressId" TEXT,
9
- ADD COLUMN "categoryId" TEXT NOT NULL;
10
-
11
- -- CreateTable
12
- CREATE TABLE "ProviderCategory" (
13
- "id" TEXT NOT NULL,
14
- "name" TEXT NOT NULL,
15
- "description" TEXT,
16
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
17
- "updatedAt" TIMESTAMP(3) NOT NULL,
18
-
19
- CONSTRAINT "ProviderCategory_pkey" PRIMARY KEY ("id")
20
- );
21
-
22
- -- CreateTable
23
- CREATE TABLE "Favorite" (
24
- "id" TEXT NOT NULL,
25
- "userId" TEXT NOT NULL,
26
- "eventId" TEXT NOT NULL,
27
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
28
- "updatedAt" TIMESTAMP(3) NOT NULL,
29
-
30
- CONSTRAINT "Favorite_pkey" PRIMARY KEY ("id")
31
- );
32
-
33
- -- CreateIndex
34
- CREATE UNIQUE INDEX "ProviderCategory_name_key" ON "ProviderCategory"("name");
35
-
36
- -- AddForeignKey
37
- ALTER TABLE "Provider" ADD CONSTRAINT "Provider_addressId_fkey" FOREIGN KEY ("addressId") REFERENCES "Address"("id") ON DELETE SET NULL ON UPDATE CASCADE;
38
-
39
- -- AddForeignKey
40
- ALTER TABLE "Provider" ADD CONSTRAINT "Provider_categoryId_fkey" FOREIGN KEY ("categoryId") REFERENCES "ProviderCategory"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
41
-
42
- -- AddForeignKey
43
- ALTER TABLE "Favorite" ADD CONSTRAINT "Favorite_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
44
-
45
- -- AddForeignKey
46
- ALTER TABLE "Favorite" ADD CONSTRAINT "Favorite_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -1,79 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - The values [PENDING,CANCELLED] on the enum `EventStatus` will be removed. If these variants are still used in the database, this will fail.
5
- - You are about to drop the column `countryCode` on the `Address` table. All the data in the column will be lost.
6
- - You are about to drop the column `latitude` on the `Address` table. All the data in the column will be lost.
7
- - You are about to drop the column `longitude` on the `Address` table. All the data in the column will be lost.
8
- - You are about to drop the column `type` on the `Address` table. All the data in the column will be lost.
9
- - You are about to drop the column `addressId` on the `Provider` table. All the data in the column will be lost.
10
- - You are about to drop the column `categoryId` on the `Provider` table. All the data in the column will be lost.
11
- - You are about to drop the column `rating` on the `Provider` table. All the data in the column will be lost.
12
- - You are about to drop the `Favorite` table. If the table is not empty, all the data it contains will be lost.
13
- - You are about to drop the `ProviderCategory` table. If the table is not empty, all the data it contains will be lost.
14
- - You are about to drop the `Review` table. If the table is not empty, all the data it contains will be lost.
15
- - Made the column `city` on table `Address` required. This step will fail if there are existing NULL values in that column.
16
- - Made the column `state` on table `Address` required. This step will fail if there are existing NULL values in that column.
17
- - Made the column `postalCode` on table `Address` required. This step will fail if there are existing NULL values in that column.
18
-
19
- */
20
- -- CreateEnum
21
- CREATE TYPE "OrderStatus" AS ENUM ('PENDING', 'CONFIRMED', 'CANCELLED', 'REFUNDED');
22
-
23
- -- CreateEnum
24
- CREATE TYPE "PaymentStatus" AS ENUM ('PENDING', 'COMPLETED', 'FAILED', 'REFUNDED');
25
-
26
- -- AlterEnum
27
- BEGIN;
28
- CREATE TYPE "EventStatus_new" AS ENUM ('DRAFT', 'PUBLISHED');
29
- ALTER TABLE "Event" ALTER COLUMN "status" DROP DEFAULT;
30
- ALTER TABLE "Event" ALTER COLUMN "status" TYPE "EventStatus_new" USING ("status"::text::"EventStatus_new");
31
- ALTER TYPE "EventStatus" RENAME TO "EventStatus_old";
32
- ALTER TYPE "EventStatus_new" RENAME TO "EventStatus";
33
- DROP TYPE "EventStatus_old";
34
- ALTER TABLE "Event" ALTER COLUMN "status" SET DEFAULT 'DRAFT';
35
- COMMIT;
36
-
37
- -- DropForeignKey
38
- ALTER TABLE "Favorite" DROP CONSTRAINT "Favorite_eventId_fkey";
39
-
40
- -- DropForeignKey
41
- ALTER TABLE "Favorite" DROP CONSTRAINT "Favorite_userId_fkey";
42
-
43
- -- DropForeignKey
44
- ALTER TABLE "Provider" DROP CONSTRAINT "Provider_addressId_fkey";
45
-
46
- -- DropForeignKey
47
- ALTER TABLE "Provider" DROP CONSTRAINT "Provider_categoryId_fkey";
48
-
49
- -- DropForeignKey
50
- ALTER TABLE "Review" DROP CONSTRAINT "Review_providerId_fkey";
51
-
52
- -- DropForeignKey
53
- ALTER TABLE "Review" DROP CONSTRAINT "Review_userId_fkey";
54
-
55
- -- DropIndex
56
- DROP INDEX "EventCategory_name_key";
57
-
58
- -- AlterTable
59
- ALTER TABLE "Address" DROP COLUMN "countryCode",
60
- DROP COLUMN "latitude",
61
- DROP COLUMN "longitude",
62
- DROP COLUMN "type",
63
- ALTER COLUMN "city" SET NOT NULL,
64
- ALTER COLUMN "state" SET NOT NULL,
65
- ALTER COLUMN "postalCode" SET NOT NULL;
66
-
67
- -- AlterTable
68
- ALTER TABLE "Provider" DROP COLUMN "addressId",
69
- DROP COLUMN "categoryId",
70
- DROP COLUMN "rating";
71
-
72
- -- DropTable
73
- DROP TABLE "Favorite";
74
-
75
- -- DropTable
76
- DROP TABLE "ProviderCategory";
77
-
78
- -- DropTable
79
- DROP TABLE "Review";
@@ -1,143 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - A unique constraint covering the columns `[name]` on the table `EventCategory` will be added. If there are existing duplicate values, this will fail.
5
- - Added the required column `categoryId` to the `Provider` table without a default value. This is not possible if the table is not empty.
6
-
7
- */
8
- -- AlterEnum
9
- -- This migration adds more than one value to an enum.
10
- -- With PostgreSQL versions 11 and earlier, this is not possible
11
- -- in a single migration. This can be worked around by creating
12
- -- multiple migrations, each migration adding only one value to
13
- -- the enum.
14
-
15
-
16
- ALTER TYPE "EventStatus" ADD VALUE 'PENDING';
17
- ALTER TYPE "EventStatus" ADD VALUE 'CANCELLED';
18
-
19
- -- AlterTable
20
- ALTER TABLE "Address" ADD COLUMN "countryCode" TEXT,
21
- ADD COLUMN "latitude" DOUBLE PRECISION,
22
- ADD COLUMN "longitude" DOUBLE PRECISION,
23
- ADD COLUMN "type" TEXT NOT NULL DEFAULT 'suburb',
24
- ALTER COLUMN "city" DROP NOT NULL,
25
- ALTER COLUMN "state" DROP NOT NULL,
26
- ALTER COLUMN "postalCode" DROP NOT NULL;
27
-
28
- -- AlterTable
29
- ALTER TABLE "EventCategory" ADD COLUMN "active" BOOLEAN NOT NULL DEFAULT true;
30
-
31
- -- AlterTable
32
- ALTER TABLE "Provider" ADD COLUMN "addressId" TEXT,
33
- ADD COLUMN "categoryId" TEXT NOT NULL,
34
- ADD COLUMN "docs" JSONB,
35
- ADD COLUMN "email" TEXT,
36
- ADD COLUMN "phoneNumber" TEXT,
37
- ADD COLUMN "pricingDetails" TEXT,
38
- ADD COLUMN "rating" DOUBLE PRECISION,
39
- ADD COLUMN "website" TEXT;
40
-
41
- -- CreateTable
42
- CREATE TABLE "ProviderCategory" (
43
- "id" TEXT NOT NULL,
44
- "name" TEXT NOT NULL,
45
- "description" TEXT,
46
- "active" BOOLEAN NOT NULL DEFAULT true,
47
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
48
- "updatedAt" TIMESTAMP(3) NOT NULL,
49
-
50
- CONSTRAINT "ProviderCategory_pkey" PRIMARY KEY ("id")
51
- );
52
-
53
- -- CreateTable
54
- CREATE TABLE "Review" (
55
- "id" TEXT NOT NULL,
56
- "rating" DOUBLE PRECISION NOT NULL,
57
- "comment" TEXT,
58
- "providerId" TEXT NOT NULL,
59
- "userId" TEXT NOT NULL,
60
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
61
- "updatedAt" TIMESTAMP(3) NOT NULL,
62
-
63
- CONSTRAINT "Review_pkey" PRIMARY KEY ("id")
64
- );
65
-
66
- -- CreateTable
67
- CREATE TABLE "Favorite" (
68
- "id" TEXT NOT NULL,
69
- "userId" TEXT NOT NULL,
70
- "eventId" TEXT NOT NULL,
71
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
72
- "updatedAt" TIMESTAMP(3) NOT NULL,
73
-
74
- CONSTRAINT "Favorite_pkey" PRIMARY KEY ("id")
75
- );
76
-
77
- -- CreateTable
78
- CREATE TABLE "Order" (
79
- "id" TEXT NOT NULL,
80
- "userId" TEXT NOT NULL,
81
- "eventId" TEXT NOT NULL,
82
- "email" TEXT NOT NULL,
83
- "status" "OrderStatus" NOT NULL DEFAULT 'PENDING',
84
- "totalAmount" DOUBLE PRECISION NOT NULL,
85
- "paymentIntentId" TEXT,
86
- "paymentStatus" "PaymentStatus" NOT NULL DEFAULT 'PENDING',
87
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
88
- "updatedAt" TIMESTAMP(3) NOT NULL,
89
-
90
- CONSTRAINT "Order_pkey" PRIMARY KEY ("id")
91
- );
92
-
93
- -- CreateTable
94
- CREATE TABLE "OrderItem" (
95
- "id" TEXT NOT NULL,
96
- "orderId" TEXT NOT NULL,
97
- "eventPriceId" TEXT NOT NULL,
98
- "quantity" INTEGER NOT NULL,
99
- "unitPrice" DOUBLE PRECISION NOT NULL,
100
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
101
- "updatedAt" TIMESTAMP(3) NOT NULL,
102
-
103
- CONSTRAINT "OrderItem_pkey" PRIMARY KEY ("id")
104
- );
105
-
106
- -- CreateIndex
107
- CREATE UNIQUE INDEX "ProviderCategory_name_key" ON "ProviderCategory"("name");
108
-
109
- -- CreateIndex
110
- CREATE UNIQUE INDEX "Order_paymentIntentId_key" ON "Order"("paymentIntentId");
111
-
112
- -- CreateIndex
113
- CREATE UNIQUE INDEX "EventCategory_name_key" ON "EventCategory"("name");
114
-
115
- -- AddForeignKey
116
- ALTER TABLE "Provider" ADD CONSTRAINT "Provider_addressId_fkey" FOREIGN KEY ("addressId") REFERENCES "Address"("id") ON DELETE SET NULL ON UPDATE CASCADE;
117
-
118
- -- AddForeignKey
119
- ALTER TABLE "Provider" ADD CONSTRAINT "Provider_categoryId_fkey" FOREIGN KEY ("categoryId") REFERENCES "ProviderCategory"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
120
-
121
- -- AddForeignKey
122
- ALTER TABLE "Review" ADD CONSTRAINT "Review_providerId_fkey" FOREIGN KEY ("providerId") REFERENCES "Provider"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
123
-
124
- -- AddForeignKey
125
- ALTER TABLE "Review" ADD CONSTRAINT "Review_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
126
-
127
- -- AddForeignKey
128
- ALTER TABLE "Favorite" ADD CONSTRAINT "Favorite_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
129
-
130
- -- AddForeignKey
131
- ALTER TABLE "Favorite" ADD CONSTRAINT "Favorite_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
132
-
133
- -- AddForeignKey
134
- ALTER TABLE "Order" ADD CONSTRAINT "Order_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
135
-
136
- -- AddForeignKey
137
- ALTER TABLE "Order" ADD CONSTRAINT "Order_eventId_fkey" FOREIGN KEY ("eventId") REFERENCES "Event"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
138
-
139
- -- AddForeignKey
140
- ALTER TABLE "OrderItem" ADD CONSTRAINT "OrderItem_orderId_fkey" FOREIGN KEY ("orderId") REFERENCES "Order"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
141
-
142
- -- AddForeignKey
143
- ALTER TABLE "OrderItem" ADD CONSTRAINT "OrderItem_eventPriceId_fkey" FOREIGN KEY ("eventPriceId") REFERENCES "EventPrice"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -1,44 +0,0 @@
1
- /*
2
- Warnings:
3
-
4
- - You are about to drop the column `content` on the `Message` table. All the data in the column will be lost.
5
- - You are about to drop the `Participant` table. If the table is not empty, all the data it contains will be lost.
6
- - Added the required column `text` to the `Message` table without a default value. This is not possible if the table is not empty.
7
-
8
- */
9
- -- DropForeignKey
10
- ALTER TABLE "Participant" DROP CONSTRAINT "Participant_eventId_fkey";
11
-
12
- -- DropForeignKey
13
- ALTER TABLE "Participant" DROP CONSTRAINT "Participant_userId_fkey";
14
-
15
- -- AlterTable
16
- ALTER TABLE "Message" DROP COLUMN "content",
17
- ADD COLUMN "mediaUrl" TEXT,
18
- ADD COLUMN "text" TEXT NOT NULL;
19
-
20
- -- AlterTable
21
- ALTER TABLE "User" ADD COLUMN "emailVerified" BOOLEAN NOT NULL DEFAULT false;
22
-
23
- -- DropTable
24
- DROP TABLE "Participant";
25
-
26
- -- DropEnum
27
- DROP TYPE "ParticipantStatus";
28
-
29
- -- CreateTable
30
- CREATE TABLE "ChatUser" (
31
- "id" TEXT NOT NULL,
32
- "chatId" TEXT NOT NULL,
33
- "userId" TEXT NOT NULL,
34
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
35
- "updatedAt" TIMESTAMP(3) NOT NULL,
36
-
37
- CONSTRAINT "ChatUser_pkey" PRIMARY KEY ("id")
38
- );
39
-
40
- -- AddForeignKey
41
- ALTER TABLE "ChatUser" ADD CONSTRAINT "ChatUser_chatId_fkey" FOREIGN KEY ("chatId") REFERENCES "Chat"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
42
-
43
- -- AddForeignKey
44
- ALTER TABLE "ChatUser" ADD CONSTRAINT "ChatUser_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -1,11 +0,0 @@
1
- -- CreateEnum
2
- CREATE TYPE "UserStatus" AS ENUM ('ACTIVE', 'INACTIVE', 'DELETED');
3
-
4
- -- CreateEnum
5
- CREATE TYPE "MediaType" AS ENUM ('image', 'video', 'audio', 'pdf');
6
-
7
- -- AlterTable
8
- ALTER TABLE "Message" ADD COLUMN "mediaType" "MediaType";
9
-
10
- -- AlterTable
11
- ALTER TABLE "User" ADD COLUMN "status" "UserStatus" NOT NULL DEFAULT 'ACTIVE';
@@ -1 +0,0 @@
1
- -- This is an empty migration.
@@ -1 +0,0 @@
1
- -- This is an empty migration.
@@ -1,16 +0,0 @@
1
- -- CreateTable
2
- CREATE TABLE "UserInterests" (
3
- "id" TEXT NOT NULL,
4
- "interests" TEXT[],
5
- "userId" TEXT NOT NULL,
6
- "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
7
- "updatedAt" TIMESTAMP(3) NOT NULL,
8
-
9
- CONSTRAINT "UserInterests_pkey" PRIMARY KEY ("id")
10
- );
11
-
12
- -- CreateIndex
13
- CREATE UNIQUE INDEX "UserInterests_userId_key" ON "UserInterests"("userId");
14
-
15
- -- AddForeignKey
16
- ALTER TABLE "UserInterests" ADD CONSTRAINT "UserInterests_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;