@duvdu-v1/duvdu 1.1.277 → 1.1.279

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.
@@ -1,2 +1 @@
1
- declare const bullRedis: Promise<import("ioredis/built/Redis").default>;
2
- export { bullRedis };
1
+ export declare const getBullRedis: () => Promise<import("ioredis/built/Redis").default>;
@@ -1,8 +1,17 @@
1
1
  "use strict";
2
2
  // // bullmq-redis.ts
3
3
  // import IORedis from 'ioredis';
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
4
13
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.bullRedis = void 0;
14
+ exports.getBullRedis = void 0;
6
15
  // const bullRedis = new IORedis({
7
16
  // host: process.env.REDIS_HOST?.split('://')[1]?.split(':')[0] || 'localhost',
8
17
  // port: parseInt(process.env.REDIS_HOST?.split(':').pop() || '6379'),
@@ -17,6 +26,8 @@ exports.bullRedis = void 0;
17
26
  // export { bullRedis };
18
27
  // bullmq-redis.ts
19
28
  const redis_connection_1 = require("./redis-connection");
20
- // Use the existing Redis client from redis-connection.ts
21
- const bullRedis = (0, redis_connection_1.getRedisClient)();
22
- exports.bullRedis = bullRedis;
29
+ // Create a function that returns the Redis client for BullMQ
30
+ const getBullRedis = () => __awaiter(void 0, void 0, void 0, function* () {
31
+ return yield (0, redis_connection_1.getRedisClient)();
32
+ });
33
+ exports.getBullRedis = getBullRedis;
@@ -28,6 +28,10 @@ export declare enum TransactionStatus {
28
28
  SUCCESS = "success",
29
29
  FAILED = "failed"
30
30
  }
31
+ export declare enum TransactionType {
32
+ DEPOSIT = "deposit",
33
+ WITHDRAW = "withdraw"
34
+ }
31
35
  export interface ITransaction {
32
36
  currency: string;
33
37
  amount: number;
@@ -36,6 +40,8 @@ export interface ITransaction {
36
40
  status: string;
37
41
  timeStamp: Date;
38
42
  model: string;
43
+ isSubscription: boolean;
44
+ type: TransactionType;
39
45
  }
40
46
  export declare const Transaction: import("mongoose").Model<ITransaction, {}, {}, {}, import("mongoose").Document<unknown, {}, ITransaction> & ITransaction & {
41
47
  _id: Types.ObjectId;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Transaction = exports.TransactionStatus = void 0;
3
+ exports.Transaction = exports.TransactionType = exports.TransactionStatus = void 0;
4
4
  const mongoose_1 = require("mongoose");
5
5
  const model_names_1 = require("../types/model-names");
6
6
  var TransactionStatus;
@@ -9,6 +9,11 @@ var TransactionStatus;
9
9
  TransactionStatus["SUCCESS"] = "success";
10
10
  TransactionStatus["FAILED"] = "failed";
11
11
  })(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
12
+ var TransactionType;
13
+ (function (TransactionType) {
14
+ TransactionType["DEPOSIT"] = "deposit";
15
+ TransactionType["WITHDRAW"] = "withdraw";
16
+ })(TransactionType || (exports.TransactionType = TransactionType = {}));
12
17
  exports.Transaction = (0, mongoose_1.model)(model_names_1.MODELS.transaction, new mongoose_1.Schema({
13
18
  currency: { type: String, default: 'EGP' },
14
19
  amount: { type: Number, default: 0 },
@@ -17,4 +22,6 @@ exports.Transaction = (0, mongoose_1.model)(model_names_1.MODELS.transaction, ne
17
22
  status: { type: String, default: TransactionStatus.PENDING },
18
23
  timeStamp: { type: Date, default: Date.now },
19
24
  model: { type: String, default: null },
25
+ isSubscription: { type: Boolean, default: false },
26
+ type: { type: String, default: TransactionType.DEPOSIT },
20
27
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.277",
3
+ "version": "1.1.279",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [