@optimatech88/titomeet-shared-lib 1.0.39 → 1.0.41
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 +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/20250805005727_added_status/migration.sql +5 -0
- package/prisma/migrations/20250805131004_added_pricing/migration.sql +43 -0
- package/prisma/migrations/20250805131431_added_expiration_time/migration.sql +2 -0
- package/prisma/schema.prisma +63 -0
- package/src/index.ts +8 -1
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 } 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';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,
|
|
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,EACrB,OAAO,EACP,WAAW,EACX,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,aAAa,EAChB,MAAM,gBAAgB,CAAC;AAGxB,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.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; } });
|
|
@@ -27,6 +27,11 @@ Object.defineProperty(exports, "OrderStatus", { enumerable: true, get: function
|
|
|
27
27
|
Object.defineProperty(exports, "PaymentStatus", { enumerable: true, get: function () { return client_1.PaymentStatus; } });
|
|
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
|
+
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; } });
|
|
30
35
|
__exportStar(require("./auth/auth.guard"), exports);
|
|
31
36
|
__exportStar(require("./auth/auth.module"), exports);
|
|
32
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,
|
|
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
|
@@ -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;
|
package/prisma/schema.prisma
CHANGED
|
@@ -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 {
|
|
@@ -197,6 +198,12 @@ model Provider {
|
|
|
197
198
|
events ProviderOnEvent[]
|
|
198
199
|
}
|
|
199
200
|
|
|
201
|
+
enum ProviderOnEventStatus {
|
|
202
|
+
PENDING
|
|
203
|
+
APPROVED
|
|
204
|
+
REJECTED
|
|
205
|
+
}
|
|
206
|
+
|
|
200
207
|
model ProviderOnEvent {
|
|
201
208
|
id String @id @default(cuid())
|
|
202
209
|
providerId String
|
|
@@ -204,6 +211,8 @@ model ProviderOnEvent {
|
|
|
204
211
|
eventId String
|
|
205
212
|
event Event @relation(fields: [eventId], references: [id])
|
|
206
213
|
|
|
214
|
+
status ProviderOnEventStatus @default(PENDING)
|
|
215
|
+
|
|
207
216
|
createdAt DateTime @default(now())
|
|
208
217
|
updatedAt DateTime @updatedAt
|
|
209
218
|
}
|
|
@@ -345,3 +354,57 @@ model Newsletter {
|
|
|
345
354
|
createdAt DateTime @default(now())
|
|
346
355
|
updatedAt DateTime @updatedAt
|
|
347
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
|
+
expiresAt DateTime?
|
|
407
|
+
|
|
408
|
+
createdAt DateTime @default(now())
|
|
409
|
+
updatedAt DateTime @updatedAt
|
|
410
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -20,7 +20,14 @@ export {
|
|
|
20
20
|
NotificationType,
|
|
21
21
|
ProviderOnEvent,
|
|
22
22
|
UserInterests,
|
|
23
|
-
UserStatus
|
|
23
|
+
UserStatus,
|
|
24
|
+
ProviderOnEventStatus,
|
|
25
|
+
Pricing,
|
|
26
|
+
PricingType,
|
|
27
|
+
PricingDuration,
|
|
28
|
+
Transaction,
|
|
29
|
+
TransactionStatus,
|
|
30
|
+
PaymentMethod
|
|
24
31
|
} from '@prisma/client';
|
|
25
32
|
|
|
26
33
|
//auth
|