@optimatech88/titomeet-shared-lib 1.0.40 → 1.0.42

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, Provider, ProviderStatus, EventCategory, Review, ProviderCategory, Order, OrderStatus, OrderItem, PaymentStatus, Chat, ChatUser, Message, Notification, NotificationType, ProviderOnEvent, UserInterests, UserStatus, ProviderOnEventStatus } 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, ProviderOnEvent, UserInterests, UserStatus, ProviderOnEventStatus, Pricing, PricingType, PricingDuration, Transaction, TransactionStatus, PaymentMethod } 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,EAC3B,QAAQ,EAAE,KAAK,EAAE,WAAW,EAC5B,eAAe,EAAE,WAAW,EAC5B,UAAU,EAAE,OAAO,EACnB,QAAQ,EACR,cAAc,EACd,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,SAAS,EACT,aAAa,EACb,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,UAAU,EACV,qBAAqB,EACxB,MAAM,gBAAgB,CAAC;AAGxB,cAAc,mBAAmB,CAAC;AAClC,cAAc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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.ProviderOnEventStatus = exports.UserStatus = exports.NotificationType = exports.PaymentStatus = exports.OrderStatus = exports.ProviderStatus = exports.EventStatus = exports.EventVisibility = exports.EventAccess = exports.UserRole = exports.PrismaClient = void 0;
17
+ exports.JwtService = exports.PaymentMethod = exports.TransactionStatus = exports.PricingDuration = exports.PricingType = exports.ProviderOnEventStatus = exports.UserStatus = 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; } });
@@ -28,6 +28,10 @@ Object.defineProperty(exports, "PaymentStatus", { enumerable: true, get: functio
28
28
  Object.defineProperty(exports, "NotificationType", { enumerable: true, get: function () { return client_1.NotificationType; } });
29
29
  Object.defineProperty(exports, "UserStatus", { enumerable: true, get: function () { return client_1.UserStatus; } });
30
30
  Object.defineProperty(exports, "ProviderOnEventStatus", { enumerable: true, get: function () { return client_1.ProviderOnEventStatus; } });
31
+ Object.defineProperty(exports, "PricingType", { enumerable: true, get: function () { return client_1.PricingType; } });
32
+ Object.defineProperty(exports, "PricingDuration", { enumerable: true, get: function () { return client_1.PricingDuration; } });
33
+ Object.defineProperty(exports, "TransactionStatus", { enumerable: true, get: function () { return client_1.TransactionStatus; } });
34
+ Object.defineProperty(exports, "PaymentMethod", { enumerable: true, get: function () { return client_1.PaymentMethod; } });
31
35
  __exportStar(require("./auth/auth.guard"), exports);
32
36
  __exportStar(require("./auth/auth.module"), exports);
33
37
  __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,yCAuBwB;AAtBpB,sGAAA,YAAY,OAAA;AACZ,kGAAA,QAAQ,OAAA;AAAS,qGAAA,WAAW,OAAA;AAC5B,yGAAA,eAAe,OAAA;AAAE,qGAAA,WAAW,OAAA;AAG5B,wGAAA,cAAc,OAAA;AAKd,qGAAA,WAAW,OAAA;AAEX,uGAAA,aAAa,OAAA;AAKb,0GAAA,gBAAgB,OAAA;AAGhB,oGAAA,UAAU,OAAA;AACV,+GAAA,qBAAqB,OAAA;AAIzB,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,yCA6BwB;AA5BpB,sGAAA,YAAY,OAAA;AACZ,kGAAA,QAAQ,OAAA;AAAS,qGAAA,WAAW,OAAA;AAC5B,yGAAA,eAAe,OAAA;AAAE,qGAAA,WAAW,OAAA;AAG5B,wGAAA,cAAc,OAAA;AAKd,qGAAA,WAAW,OAAA;AAEX,uGAAA,aAAa,OAAA;AAKb,0GAAA,gBAAgB,OAAA;AAGhB,oGAAA,UAAU,OAAA;AACV,+GAAA,qBAAqB,OAAA;AAErB,qGAAA,WAAW,OAAA;AACX,yGAAA,eAAe,OAAA;AAEf,2GAAA,iBAAiB,OAAA;AACjB,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimatech88/titomeet-shared-lib",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -0,0 +1,43 @@
1
+ -- CreateEnum
2
+ CREATE TYPE "public"."PricingType" AS ENUM ('EVENT_CREATOR', 'PROVIDER');
3
+
4
+ -- CreateEnum
5
+ CREATE TYPE "public"."PricingDuration" AS ENUM ('WEEKLY', 'BI_WEEKLY', 'MONTHLY', 'YEARLY');
6
+
7
+ -- CreateEnum
8
+ CREATE TYPE "public"."PaymentMethod" AS ENUM ('MOBILE_MONEY');
9
+
10
+ -- CreateEnum
11
+ CREATE TYPE "public"."TransactionStatus" AS ENUM ('PENDING', 'COMPLETED', 'FAILED');
12
+
13
+ -- CreateTable
14
+ CREATE TABLE "public"."Pricing" (
15
+ "id" TEXT NOT NULL,
16
+ "type" "public"."PricingType" NOT NULL DEFAULT 'EVENT_CREATOR',
17
+ "duration" "public"."PricingDuration" NOT NULL DEFAULT 'MONTHLY',
18
+ "amount" DOUBLE PRECISION NOT NULL,
19
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
20
+ "updatedAt" TIMESTAMP(3) NOT NULL,
21
+
22
+ CONSTRAINT "Pricing_pkey" PRIMARY KEY ("id")
23
+ );
24
+
25
+ -- CreateTable
26
+ CREATE TABLE "public"."Transaction" (
27
+ "id" TEXT NOT NULL,
28
+ "amount" DOUBLE PRECISION NOT NULL,
29
+ "paymentMethod" "public"."PaymentMethod" NOT NULL DEFAULT 'MOBILE_MONEY',
30
+ "pricingId" TEXT,
31
+ "userId" TEXT NOT NULL,
32
+ "status" "public"."TransactionStatus" NOT NULL DEFAULT 'PENDING',
33
+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
34
+ "updatedAt" TIMESTAMP(3) NOT NULL,
35
+
36
+ CONSTRAINT "Transaction_pkey" PRIMARY KEY ("id")
37
+ );
38
+
39
+ -- AddForeignKey
40
+ ALTER TABLE "public"."Transaction" ADD CONSTRAINT "Transaction_pricingId_fkey" FOREIGN KEY ("pricingId") REFERENCES "public"."Pricing"("id") ON DELETE SET NULL ON UPDATE CASCADE;
41
+
42
+ -- AddForeignKey
43
+ ALTER TABLE "public"."Transaction" ADD CONSTRAINT "Transaction_userId_fkey" FOREIGN KEY ("userId") REFERENCES "public"."User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "public"."Transaction" ADD COLUMN "expiresAt" TIMESTAMP(3);
@@ -0,0 +1,2 @@
1
+ -- AlterTable
2
+ ALTER TABLE "public"."Transaction" ADD COLUMN "reference" TEXT;
@@ -32,6 +32,7 @@ model User {
32
32
  reviews Review[]
33
33
 
34
34
  userInterests UserInterests?
35
+ transactions Transaction[]
35
36
  }
36
37
 
37
38
  model Account {
@@ -353,3 +354,59 @@ model Newsletter {
353
354
  createdAt DateTime @default(now())
354
355
  updatedAt DateTime @updatedAt
355
356
  }
357
+
358
+ enum PricingType {
359
+ EVENT_CREATOR
360
+ PROVIDER
361
+ }
362
+
363
+ enum PricingDuration {
364
+ WEEKLY
365
+ BI_WEEKLY
366
+ MONTHLY
367
+ YEARLY
368
+ }
369
+
370
+ model Pricing {
371
+ id String @id @default(cuid())
372
+
373
+ type PricingType @default(EVENT_CREATOR)
374
+ duration PricingDuration @default(MONTHLY)
375
+ amount Float
376
+
377
+ createdAt DateTime @default(now())
378
+ updatedAt DateTime @updatedAt
379
+ transactions Transaction[]
380
+ }
381
+
382
+ enum PaymentMethod {
383
+ MOBILE_MONEY
384
+ }
385
+
386
+ enum TransactionStatus {
387
+ PENDING
388
+ COMPLETED
389
+ FAILED
390
+ }
391
+
392
+ model Transaction {
393
+ id String @id @default(cuid())
394
+
395
+ amount Float
396
+ paymentMethod PaymentMethod @default(MOBILE_MONEY)
397
+
398
+ pricingId String?
399
+ pricing Pricing? @relation(fields: [pricingId], references: [id])
400
+
401
+ userId String
402
+ user User @relation(fields: [userId], references: [id])
403
+
404
+ status TransactionStatus @default(PENDING)
405
+
406
+ reference String?
407
+
408
+ expiresAt DateTime?
409
+
410
+ createdAt DateTime @default(now())
411
+ updatedAt DateTime @updatedAt
412
+ }
package/src/index.ts CHANGED
@@ -21,7 +21,13 @@ export {
21
21
  ProviderOnEvent,
22
22
  UserInterests,
23
23
  UserStatus,
24
- ProviderOnEventStatus
24
+ ProviderOnEventStatus,
25
+ Pricing,
26
+ PricingType,
27
+ PricingDuration,
28
+ Transaction,
29
+ TransactionStatus,
30
+ PaymentMethod
25
31
  } from '@prisma/client';
26
32
 
27
33
  //auth