@optimatech88/titomeet-shared-lib 1.0.22 → 1.0.23

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './auth/auth.guard';
2
- export { PrismaClient, User, Account, UserRole, Event, EventAccess, EventVisibility, EventStatus, EventPrice, Address, Participant, ParticipantStatus, Provider, ProviderStatus, EventCategory, Review, ProviderCategory, Order, OrderStatus, OrderItem, PaymentStatus, } from '@prisma/client';
2
+ export { PrismaClient, User, Account, UserRole, Event, EventAccess, EventVisibility, EventStatus, EventPrice, Address, Provider, ProviderStatus, EventCategory, Review, ProviderCategory, Order, OrderStatus, OrderItem, PaymentStatus, Chat, ChatUser, Message, Notification, NotificationType, } from '@prisma/client';
3
3
  export * from './auth/auth.guard';
4
4
  export * from './auth/auth.module';
5
5
  export * from './auth/admin.middleware';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACH,YAAY,EAAE,IAAI,EAAE,OAAO,EACvB,QAAQ,EAAE,KAAK,EAAE,WAAW,EAC5B,eAAe,EAAE,WAAW,EAC5B,UAAU,EAAE,OAAO,EAAE,WAAW,EAChC,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,aAAa,EACb,MAAM,EACV,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,SAAS,EACT,aAAa,GACZ,MAAM,gBAAgB,CAAC;AAG5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACH,YAAY,EAAE,IAAI,EAAE,OAAO,EACvB,QAAQ,EAAE,KAAK,EAAE,WAAW,EAC5B,eAAe,EAAE,WAAW,EAC5B,UAAU,EAAE,OAAO,EACnB,QAAQ,EACR,cAAc,EACd,aAAa,EACb,MAAM,EACV,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,SAAS,EACT,aAAa,EACb,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,gBAAgB,GACf,MAAM,gBAAgB,CAAC;AAG5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AAGxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.JwtService = exports.PaymentStatus = exports.OrderStatus = exports.ProviderStatus = exports.ParticipantStatus = exports.EventStatus = exports.EventVisibility = exports.EventAccess = exports.UserRole = exports.PrismaClient = void 0;
17
+ exports.JwtService = exports.NotificationType = exports.PaymentStatus = exports.OrderStatus = exports.ProviderStatus = exports.EventStatus = exports.EventVisibility = exports.EventAccess = exports.UserRole = exports.PrismaClient = void 0;
18
18
  __exportStar(require("./auth/auth.guard"), exports);
19
19
  var client_1 = require("@prisma/client");
20
20
  Object.defineProperty(exports, "PrismaClient", { enumerable: true, get: function () { return client_1.PrismaClient; } });
@@ -22,10 +22,10 @@ Object.defineProperty(exports, "UserRole", { enumerable: true, get: function ()
22
22
  Object.defineProperty(exports, "EventAccess", { enumerable: true, get: function () { return client_1.EventAccess; } });
23
23
  Object.defineProperty(exports, "EventVisibility", { enumerable: true, get: function () { return client_1.EventVisibility; } });
24
24
  Object.defineProperty(exports, "EventStatus", { enumerable: true, get: function () { return client_1.EventStatus; } });
25
- Object.defineProperty(exports, "ParticipantStatus", { enumerable: true, get: function () { return client_1.ParticipantStatus; } });
26
25
  Object.defineProperty(exports, "ProviderStatus", { enumerable: true, get: function () { return client_1.ProviderStatus; } });
27
26
  Object.defineProperty(exports, "OrderStatus", { enumerable: true, get: function () { return client_1.OrderStatus; } });
28
27
  Object.defineProperty(exports, "PaymentStatus", { enumerable: true, get: function () { return client_1.PaymentStatus; } });
28
+ Object.defineProperty(exports, "NotificationType", { enumerable: true, get: function () { return client_1.NotificationType; } });
29
29
  __exportStar(require("./auth/auth.guard"), exports);
30
30
  __exportStar(require("./auth/auth.module"), exports);
31
31
  __exportStar(require("./auth/admin.middleware"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,yCAe4B;AAdxB,sGAAA,YAAY,OAAA;AACR,kGAAA,QAAQ,OAAA;AAAS,qGAAA,WAAW,OAAA;AAC5B,yGAAA,eAAe,OAAA;AAAE,qGAAA,WAAW,OAAA;AAE5B,2GAAA,iBAAiB,OAAA;AAEjB,wGAAA,cAAc,OAAA;AAKlB,qGAAA,WAAW,OAAA;AAEX,uGAAA,aAAa,OAAA;AAIjB,oDAAkC;AAClC,qDAAmC;AACnC,0DAAwC;AAGxC,uDAAqC;AACrC,wDAAsC;AAGtC,yDAAuC;AACvC,0DAAwC;AACxC,gDAA8B;AAC9B,0CAAwB;AACxB,0CAAwB;AACxB,wDAAsC;AACtC,iDAA+B;AAE/B,mCAAyC;AAAhC,iGAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,yCAmB4B;AAlBxB,sGAAA,YAAY,OAAA;AACR,kGAAA,QAAQ,OAAA;AAAS,qGAAA,WAAW,OAAA;AAC5B,yGAAA,eAAe,OAAA;AAAE,qGAAA,WAAW,OAAA;AAG5B,wGAAA,cAAc,OAAA;AAKlB,qGAAA,WAAW,OAAA;AAEX,uGAAA,aAAa,OAAA;AAKb,0GAAA,gBAAgB,OAAA;AAIpB,oDAAkC;AAClC,qDAAmC;AACnC,0DAAwC;AAGxC,uDAAqC;AACrC,wDAAsC;AAGtC,yDAAuC;AACvC,0DAAwC;AACxC,gDAA8B;AAC9B,0CAAwB;AACxB,0CAAwB;AACxB,wDAAsC;AACtC,iDAA+B;AAE/B,mCAAyC;AAAhC,iGAAA,UAAU,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimatech88/titomeet-shared-lib",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -8,7 +8,8 @@
8
8
  "build": "nest build",
9
9
  "format": "prettier --write \"src/**/*.ts\"",
10
10
  "generate": "npx prisma generate",
11
- "deploy:dev": "prisma migrate dev"
11
+ "deploy:dev": "prisma migrate dev",
12
+ "push": "npm run generate && npm run deploy:dev && npm run build"
12
13
  },
13
14
  "keywords": [],
14
15
  "author": "",
@@ -0,0 +1,44 @@
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;
@@ -30,6 +30,7 @@ model User {
30
30
  role UserRole @default(USER)
31
31
 
32
32
  profilePicture String?
33
+ emailVerified Boolean @default(false)
33
34
 
34
35
  createdAt DateTime @default(now())
35
36
  updatedAt DateTime @updatedAt
@@ -37,7 +38,6 @@ model User {
37
38
  accounts Account[]
38
39
  messages Message[]
39
40
  events Event[]
40
- participatedEvents Participant[]
41
41
  notificationsReceived Notification[] @relation("NotificationRecipient")
42
42
  notificationsSent Notification[] @relation("NotificationSender")
43
43
  providers Provider[]
@@ -45,6 +45,7 @@ model User {
45
45
 
46
46
  favorites Favorite[]
47
47
  orders Order[]
48
+ chatUsers ChatUser[]
48
49
  }
49
50
 
50
51
  model Account {
@@ -132,9 +133,6 @@ model Event {
132
133
  postedBy User @relation(fields: [postedById], references: [id])
133
134
  postedById String
134
135
 
135
- // Add participants relation
136
- participants Participant[]
137
-
138
136
  providers Provider[]
139
137
 
140
138
  createdAt DateTime @default(now())
@@ -166,43 +164,37 @@ model Chat {
166
164
  event Event @relation(fields: [eventId], references: [id])
167
165
  eventId String @unique // One-to-one relation with Event
168
166
  messages Message[]
167
+ users ChatUser[]
169
168
 
170
169
  createdAt DateTime @default(now())
171
170
  updatedAt DateTime @updatedAt
172
171
  }
173
172
 
173
+ model ChatUser {
174
+ id String @id @default(cuid())
175
+ chat Chat @relation(fields: [chatId], references: [id])
176
+ chatId String
177
+ user User @relation(fields: [userId], references: [id])
178
+ userId String
179
+
180
+ createdAt DateTime @default(now())
181
+ updatedAt DateTime @updatedAt
182
+ }
183
+
174
184
  model Message {
175
185
  id String @id @default(cuid())
176
- content String
186
+ text String
177
187
  chat Chat @relation(fields: [chatId], references: [id])
178
188
  chatId String
179
189
  sender User @relation(fields: [senderId], references: [id])
180
190
  senderId String
181
191
 
192
+ mediaUrl String?
193
+
182
194
  createdAt DateTime @default(now())
183
195
  updatedAt DateTime @updatedAt
184
196
  }
185
197
 
186
- // Add new Participant model
187
- model Participant {
188
- id String @id @default(cuid())
189
- event Event @relation(fields: [eventId], references: [id])
190
- eventId String
191
- user User @relation(fields: [userId], references: [id])
192
- userId String
193
- status ParticipantStatus @default(PENDING)
194
-
195
- createdAt DateTime @default(now())
196
- updatedAt DateTime @updatedAt
197
-
198
- @@unique([eventId, userId])
199
- }
200
-
201
- enum ParticipantStatus {
202
- PENDING
203
- CONFIRMED
204
- CANCELLED
205
- }
206
198
 
207
199
  enum NotificationType {
208
200
  NEW_MESSAGE
package/src/index.ts CHANGED
@@ -3,8 +3,7 @@ export {
3
3
  PrismaClient, User, Account,
4
4
  UserRole, Event, EventAccess,
5
5
  EventVisibility, EventStatus,
6
- EventPrice, Address, Participant,
7
- ParticipantStatus,
6
+ EventPrice, Address,
8
7
  Provider,
9
8
  ProviderStatus,
10
9
  EventCategory,
@@ -14,6 +13,11 @@ export {
14
13
  OrderStatus,
15
14
  OrderItem,
16
15
  PaymentStatus,
16
+ Chat,
17
+ ChatUser,
18
+ Message,
19
+ Notification,
20
+ NotificationType,
17
21
  } from '@prisma/client';
18
22
 
19
23
  //auth