@takentrade/takentrade-libs 4.1.8 → 4.1.10

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.
Files changed (74) hide show
  1. package/README.md +15 -102
  2. package/dist/common/index.d.ts +0 -2
  3. package/dist/common/index.js +0 -2
  4. package/dist/common/utils/index.d.ts +0 -1
  5. package/dist/common/utils/index.js +0 -1
  6. package/dist/index.d.ts +0 -1
  7. package/dist/index.js +0 -1
  8. package/dist/nats/events/ajo.events.d.ts +14 -0
  9. package/dist/nats/events/index.d.ts +10 -174
  10. package/dist/nats/events/index.js +24 -0
  11. package/dist/nats/events/loans.events.d.ts +19 -0
  12. package/dist/nats/events/loans.events.js +2 -0
  13. package/dist/nats/events/notification.events.d.ts +8 -0
  14. package/dist/nats/events/notification.events.js +2 -0
  15. package/dist/nats/events/payment.events.d.ts +40 -0
  16. package/dist/nats/events/payment.events.js +2 -0
  17. package/dist/nats/events/providus.events.d.ts +14 -0
  18. package/dist/nats/events/providus.events.js +2 -0
  19. package/dist/nats/events/referral.events.d.ts +7 -0
  20. package/dist/nats/events/referral.events.js +2 -0
  21. package/dist/nats/events/savings.events.d.ts +11 -0
  22. package/dist/nats/events/savings.events.js +2 -0
  23. package/dist/nats/events/user.events.d.ts +35 -0
  24. package/dist/nats/events/user.events.js +2 -0
  25. package/dist/nats/events/vas.events.d.ts +12 -0
  26. package/dist/nats/events/vas.events.js +2 -0
  27. package/dist/nats/events/withdrawal.events.d.ts +9 -0
  28. package/dist/nats/events/withdrawal.events.js +2 -0
  29. package/dist/notification/broadcast-templates.d.ts +20 -20
  30. package/dist/notification/broadcast-templates.js +20 -20
  31. package/dist/rpc/rpc.client.d.ts +6 -8
  32. package/dist/rpc/rpc.client.js +59 -62
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/dist/utils/enums/subaccount.enum.d.ts +0 -4
  35. package/dist/utils/enums/subaccount.enum.js +1 -6
  36. package/dist/utils/index.d.ts +0 -2
  37. package/dist/utils/index.js +0 -2
  38. package/dist/utils/interfaces/index.d.ts +0 -1
  39. package/dist/utils/interfaces/index.js +0 -1
  40. package/dist/utils/utils/index.d.ts +0 -1
  41. package/dist/utils/utils/index.js +0 -1
  42. package/package.json +15 -12
  43. package/dist/bullmq/bullmq.module.d.ts +0 -2
  44. package/dist/bullmq/bullmq.module.js +0 -16
  45. package/dist/bullmq/bullmq.service.d.ts +0 -2
  46. package/dist/bullmq/bullmq.service.js +0 -16
  47. package/dist/bullmq/config/bull.config.d.ts +0 -22
  48. package/dist/bullmq/config/bull.config.js +0 -28
  49. package/dist/bullmq/index.d.ts +0 -2
  50. package/dist/bullmq/index.js +0 -18
  51. package/dist/common/dto/account.dto.d.ts +0 -18
  52. package/dist/common/dto/account.dto.js +0 -68
  53. package/dist/common/dto/index.d.ts +0 -2
  54. package/dist/common/dto/index.js +0 -18
  55. package/dist/common/dto/user.dto.d.ts +0 -34
  56. package/dist/common/dto/user.dto.js +0 -132
  57. package/dist/common/enums/index.d.ts +0 -3
  58. package/dist/common/enums/index.js +0 -19
  59. package/dist/common/enums/support-action.enum.d.ts +0 -7
  60. package/dist/common/enums/support-action.enum.js +0 -11
  61. package/dist/common/enums/ticket.enum.d.ts +0 -19
  62. package/dist/common/enums/ticket.enum.js +0 -25
  63. package/dist/common/enums/transaction.enum.d.ts +0 -85
  64. package/dist/common/enums/transaction.enum.js +0 -97
  65. package/dist/common/utils/string.utils.d.ts +0 -10
  66. package/dist/common/utils/string.utils.js +0 -34
  67. package/dist/utils/helpers/penalty.util.d.ts +0 -25
  68. package/dist/utils/helpers/penalty.util.js +0 -40
  69. package/dist/utils/helpers/role.util.d.ts +0 -8
  70. package/dist/utils/helpers/role.util.js +0 -18
  71. package/dist/utils/interfaces/general.interface.d.ts +0 -13
  72. package/dist/utils/utils/otp.d.ts +0 -1
  73. package/dist/utils/utils/otp.js +0 -102
  74. /package/dist/{utils/interfaces/general.interface.js → nats/events/ajo.events.js} +0 -0
@@ -1,85 +0,0 @@
1
- export declare enum TransactionType {
2
- CREDIT = "CREDIT",
3
- DEBIT = "DEBIT",
4
- DEPOSIT = "DEPOSIT",
5
- TOP_UP = "TOP_UP",
6
- WITHDRAWAL = "WITHDRAWAL",
7
- INTEREST_ACCRUAL = "INTEREST_ACCRUAL",
8
- TAX_DEDUCTION = "TAX_DEDUCTION",
9
- PAUSE = "PAUSE",
10
- CONTRIBUTION = "CONTRIBUTION",
11
- PAYOUT = "PAYOUT",
12
- FEE_DEDUCTION = "FEE_DEDUCTION"
13
- }
14
- export declare enum TransactionCategory {
15
- DEPOSIT = "DEPOSIT",
16
- WITHDRAWAL = "WITHDRAWAL",
17
- LOAN_DISBURSEMENT = "LOAN_DISBURSEMENT",
18
- LOAN_REPAYMENT = "LOAN_REPAYMENT",
19
- AJO_CONTRIBUTION = "AJO_CONTRIBUTION",
20
- AJO_TOPUP = "AJO_TOPUP",
21
- AJO_COMPLETION = "AJO_COMPLETION",
22
- AIRTIME = "AIRTIME",
23
- DATA = "DATA",
24
- ELECTRICITY = "ELECTRICITY",
25
- CABLETV = "CABLETV",
26
- BETTING = "BETTING",
27
- INTERNET = "INTERNET",
28
- EDUCATION = "EDUCATION",
29
- TRANSPORT = "TRANSPORT",
30
- DONATION = "DONATION",
31
- INSURANCE = "INSURANCE",
32
- TAX = "TAX",
33
- RELIGION = "RELIGION",
34
- TRANSFER = "TRANSFER",
35
- REFERRAL_BONUS = "REFERRAL_BONUS",
36
- FEES = "FEES",
37
- FEE_COLLECTION = "FEE_COLLECTION",
38
- PENALTY = "PENALTY",
39
- LOAN_INTEREST = "LOAN_INTEREST",
40
- AJO_FEE = "AJO_FEE"
41
- }
42
- export declare enum TransactionStatus {
43
- PENDING = "PENDING",
44
- SUCCESSFUL = "SUCCESSFUL",
45
- FAILED = "FAILED",
46
- REVERSED = "REVERSED"
47
- }
48
- export declare enum LoanStatus {
49
- PENDING = "PENDING",
50
- APPROVED = "APPROVED",
51
- DISBURSED = "DISBURSED",
52
- REPAID = "REPAID",
53
- OVERDUE = "OVERDUE",
54
- DECLINED = "DECLINED"
55
- }
56
- export declare enum SavingsStatus {
57
- ACTIVE = "ACTIVE",
58
- MATURED = "MATURED",
59
- CLOSED = "CLOSED",
60
- PENDING = "PENDING",
61
- SUSPENDED = "SUSPENDED"
62
- }
63
- export declare enum AjoStatus {
64
- ACTIVE = "ACTIVE",
65
- COMPLETED = "COMPLETED",
66
- CANCELLED = "CANCELLED",
67
- PAUSED = "PAUSED"
68
- }
69
- export declare enum AjoMembershipStatus {
70
- PENDING = "PENDING",
71
- ACTIVE = "ACTIVE",
72
- INACTIVE = "INACTIVE",
73
- REMOVED = "REMOVED"
74
- }
75
- export declare enum AjoType {
76
- PERSONAL = "PERSONAL",
77
- FAMILY = "FAMILY",
78
- FRIEND = "FRIEND",
79
- GROUP = "GROUP"
80
- }
81
- export declare enum Frequency {
82
- DAILY = "DAILY",
83
- WEEKLY = "WEEKLY",
84
- MONTHLY = "MONTHLY"
85
- }
@@ -1,97 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Frequency = exports.AjoType = exports.AjoMembershipStatus = exports.AjoStatus = exports.SavingsStatus = exports.LoanStatus = exports.TransactionStatus = exports.TransactionCategory = exports.TransactionType = void 0;
4
- var TransactionType;
5
- (function (TransactionType) {
6
- TransactionType["CREDIT"] = "CREDIT";
7
- TransactionType["DEBIT"] = "DEBIT";
8
- TransactionType["DEPOSIT"] = "DEPOSIT";
9
- TransactionType["TOP_UP"] = "TOP_UP";
10
- TransactionType["WITHDRAWAL"] = "WITHDRAWAL";
11
- TransactionType["INTEREST_ACCRUAL"] = "INTEREST_ACCRUAL";
12
- TransactionType["TAX_DEDUCTION"] = "TAX_DEDUCTION";
13
- TransactionType["PAUSE"] = "PAUSE";
14
- TransactionType["CONTRIBUTION"] = "CONTRIBUTION";
15
- TransactionType["PAYOUT"] = "PAYOUT";
16
- TransactionType["FEE_DEDUCTION"] = "FEE_DEDUCTION";
17
- })(TransactionType || (exports.TransactionType = TransactionType = {}));
18
- var TransactionCategory;
19
- (function (TransactionCategory) {
20
- TransactionCategory["DEPOSIT"] = "DEPOSIT";
21
- TransactionCategory["WITHDRAWAL"] = "WITHDRAWAL";
22
- TransactionCategory["LOAN_DISBURSEMENT"] = "LOAN_DISBURSEMENT";
23
- TransactionCategory["LOAN_REPAYMENT"] = "LOAN_REPAYMENT";
24
- TransactionCategory["AJO_CONTRIBUTION"] = "AJO_CONTRIBUTION";
25
- TransactionCategory["AJO_TOPUP"] = "AJO_TOPUP";
26
- TransactionCategory["AJO_COMPLETION"] = "AJO_COMPLETION";
27
- TransactionCategory["AIRTIME"] = "AIRTIME";
28
- TransactionCategory["DATA"] = "DATA";
29
- TransactionCategory["ELECTRICITY"] = "ELECTRICITY";
30
- TransactionCategory["CABLETV"] = "CABLETV";
31
- TransactionCategory["BETTING"] = "BETTING";
32
- TransactionCategory["INTERNET"] = "INTERNET";
33
- TransactionCategory["EDUCATION"] = "EDUCATION";
34
- TransactionCategory["TRANSPORT"] = "TRANSPORT";
35
- TransactionCategory["DONATION"] = "DONATION";
36
- TransactionCategory["INSURANCE"] = "INSURANCE";
37
- TransactionCategory["TAX"] = "TAX";
38
- TransactionCategory["RELIGION"] = "RELIGION";
39
- TransactionCategory["TRANSFER"] = "TRANSFER";
40
- TransactionCategory["REFERRAL_BONUS"] = "REFERRAL_BONUS";
41
- TransactionCategory["FEES"] = "FEES";
42
- TransactionCategory["FEE_COLLECTION"] = "FEE_COLLECTION";
43
- TransactionCategory["PENALTY"] = "PENALTY";
44
- TransactionCategory["LOAN_INTEREST"] = "LOAN_INTEREST";
45
- TransactionCategory["AJO_FEE"] = "AJO_FEE";
46
- })(TransactionCategory || (exports.TransactionCategory = TransactionCategory = {}));
47
- var TransactionStatus;
48
- (function (TransactionStatus) {
49
- TransactionStatus["PENDING"] = "PENDING";
50
- TransactionStatus["SUCCESSFUL"] = "SUCCESSFUL";
51
- TransactionStatus["FAILED"] = "FAILED";
52
- TransactionStatus["REVERSED"] = "REVERSED";
53
- })(TransactionStatus || (exports.TransactionStatus = TransactionStatus = {}));
54
- var LoanStatus;
55
- (function (LoanStatus) {
56
- LoanStatus["PENDING"] = "PENDING";
57
- LoanStatus["APPROVED"] = "APPROVED";
58
- LoanStatus["DISBURSED"] = "DISBURSED";
59
- LoanStatus["REPAID"] = "REPAID";
60
- LoanStatus["OVERDUE"] = "OVERDUE";
61
- LoanStatus["DECLINED"] = "DECLINED";
62
- })(LoanStatus || (exports.LoanStatus = LoanStatus = {}));
63
- var SavingsStatus;
64
- (function (SavingsStatus) {
65
- SavingsStatus["ACTIVE"] = "ACTIVE";
66
- SavingsStatus["MATURED"] = "MATURED";
67
- SavingsStatus["CLOSED"] = "CLOSED";
68
- SavingsStatus["PENDING"] = "PENDING";
69
- SavingsStatus["SUSPENDED"] = "SUSPENDED";
70
- })(SavingsStatus || (exports.SavingsStatus = SavingsStatus = {}));
71
- var AjoStatus;
72
- (function (AjoStatus) {
73
- AjoStatus["ACTIVE"] = "ACTIVE";
74
- AjoStatus["COMPLETED"] = "COMPLETED";
75
- AjoStatus["CANCELLED"] = "CANCELLED";
76
- AjoStatus["PAUSED"] = "PAUSED";
77
- })(AjoStatus || (exports.AjoStatus = AjoStatus = {}));
78
- var AjoMembershipStatus;
79
- (function (AjoMembershipStatus) {
80
- AjoMembershipStatus["PENDING"] = "PENDING";
81
- AjoMembershipStatus["ACTIVE"] = "ACTIVE";
82
- AjoMembershipStatus["INACTIVE"] = "INACTIVE";
83
- AjoMembershipStatus["REMOVED"] = "REMOVED";
84
- })(AjoMembershipStatus || (exports.AjoMembershipStatus = AjoMembershipStatus = {}));
85
- var AjoType;
86
- (function (AjoType) {
87
- AjoType["PERSONAL"] = "PERSONAL";
88
- AjoType["FAMILY"] = "FAMILY";
89
- AjoType["FRIEND"] = "FRIEND";
90
- AjoType["GROUP"] = "GROUP";
91
- })(AjoType || (exports.AjoType = AjoType = {}));
92
- var Frequency;
93
- (function (Frequency) {
94
- Frequency["DAILY"] = "DAILY";
95
- Frequency["WEEKLY"] = "WEEKLY";
96
- Frequency["MONTHLY"] = "MONTHLY";
97
- })(Frequency || (exports.Frequency = Frequency = {}));
@@ -1,10 +0,0 @@
1
- /**
2
- * Formats phone number for display
3
- * 2348012345678 → +234 801 234 5678
4
- */
5
- export declare const formatPhoneNumber: (phone: string) => string;
6
- /**
7
- * Masks phone number for security
8
- * +2348012345678 → +234****5678
9
- */
10
- export declare const maskPhoneNumber: (phone: string) => string;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.maskPhoneNumber = exports.formatPhoneNumber = void 0;
4
- /**
5
- * Formats phone number for display
6
- * 2348012345678 → +234 801 234 5678
7
- */
8
- const formatPhoneNumber = (phone) => {
9
- const cleaned = phone.replace(/[\s\-\(\)]/g, '');
10
- // Ensure it starts with 234
11
- let formatted = cleaned;
12
- if (formatted.startsWith('0')) {
13
- formatted = '234' + formatted.substring(1);
14
- }
15
- // Format as +234 801 234 5678
16
- if (formatted.startsWith('234')) {
17
- return `+234 ${formatted.substring(3, 6)} ${formatted.substring(6, 9)} ${formatted.substring(9)}`;
18
- }
19
- return phone;
20
- };
21
- exports.formatPhoneNumber = formatPhoneNumber;
22
- /**
23
- * Masks phone number for security
24
- * +2348012345678 → +234****5678
25
- */
26
- const maskPhoneNumber = (phone) => {
27
- const cleaned = phone.replace(/[\s\-\(\)]/g, '');
28
- if (cleaned.length < 8)
29
- return phone;
30
- const prefix = cleaned.substring(0, 4);
31
- const suffix = cleaned.slice(-4);
32
- return `${prefix}****${suffix}`;
33
- };
34
- exports.maskPhoneNumber = maskPhoneNumber;
@@ -1,25 +0,0 @@
1
- interface PenaltyTier {
2
- maxDays: number;
3
- rate: number;
4
- }
5
- /**
6
- * Calculates the penalty rate based on the number of days a loan repayment is delayed.
7
- * Uses predefined penalty tiers to determine the rate.
8
- *
9
- * @param delayInDays - The number of days the loan repayment is delayed.
10
- * @returns The penalty rate as a decimal (e.g., 0.025 for 2.5%).
11
- */
12
- export declare const calculatePenalty: (delayInDays: number) => number;
13
- /**
14
- * Calculates the penalty amount based on the principal and the number of days delayed.
15
- *
16
- * @param principal - The principal amount of the loan.
17
- * @param delayInDays - The number of days the loan repayment is delayed.
18
- * @returns The penalty amount.
19
- */
20
- export declare const calculatePenaltyAmount: (principal: number, delayInDays: number) => number;
21
- /**
22
- * Get all penalty tiers
23
- */
24
- export declare const getPenaltyTiers: () => PenaltyTier[];
25
- export {};
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPenaltyTiers = exports.calculatePenaltyAmount = exports.calculatePenalty = void 0;
4
- const PENALTY_TIERS = [
5
- { maxDays: 7, rate: 0.025 }, // 2.5% for first week
6
- { maxDays: 14, rate: 0.05 }, // 5% for second week
7
- { maxDays: 21, rate: 0.075 }, // 7.5% for third week
8
- { maxDays: Infinity, rate: 0.1 }, // 10% for anything beyond
9
- ];
10
- /**
11
- * Calculates the penalty rate based on the number of days a loan repayment is delayed.
12
- * Uses predefined penalty tiers to determine the rate.
13
- *
14
- * @param delayInDays - The number of days the loan repayment is delayed.
15
- * @returns The penalty rate as a decimal (e.g., 0.025 for 2.5%).
16
- */
17
- const calculatePenalty = (delayInDays) => {
18
- const tier = PENALTY_TIERS.find((tier) => delayInDays <= tier.maxDays);
19
- return tier ? tier.rate : PENALTY_TIERS[PENALTY_TIERS.length - 1].rate;
20
- };
21
- exports.calculatePenalty = calculatePenalty;
22
- /**
23
- * Calculates the penalty amount based on the principal and the number of days delayed.
24
- *
25
- * @param principal - The principal amount of the loan.
26
- * @param delayInDays - The number of days the loan repayment is delayed.
27
- * @returns The penalty amount.
28
- */
29
- const calculatePenaltyAmount = (principal, delayInDays) => {
30
- const rate = (0, exports.calculatePenalty)(delayInDays);
31
- return principal * rate;
32
- };
33
- exports.calculatePenaltyAmount = calculatePenaltyAmount;
34
- /**
35
- * Get all penalty tiers
36
- */
37
- const getPenaltyTiers = () => {
38
- return [...PENALTY_TIERS];
39
- };
40
- exports.getPenaltyTiers = getPenaltyTiers;
@@ -1,8 +0,0 @@
1
- /**
2
- * Check if role is an admin role
3
- */
4
- export declare const isAdminRole: (roleName: string) => boolean;
5
- /**
6
- * Get base role
7
- */
8
- export declare const getBaseRole: () => string;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBaseRole = exports.isAdminRole = void 0;
4
- const BASE_ROLE = 'USER';
5
- /**
6
- * Check if role is an admin role
7
- */
8
- const isAdminRole = (roleName) => {
9
- return roleName !== BASE_ROLE;
10
- };
11
- exports.isAdminRole = isAdminRole;
12
- /**
13
- * Get base role
14
- */
15
- const getBaseRole = () => {
16
- return BASE_ROLE;
17
- };
18
- exports.getBaseRole = getBaseRole;
@@ -1,13 +0,0 @@
1
- export interface AddEmail {
2
- email: string;
3
- }
4
- export interface VerifyEmail {
5
- otp: number;
6
- otpReference: string;
7
- }
8
- export interface EditAddress {
9
- countryId: string;
10
- stateId: string;
11
- lgaId: string;
12
- address: string;
13
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,102 +0,0 @@
1
- "use strict";
2
- // import { Schema, model, Document } from 'mongoose';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- // export interface IOTP extends Document {
5
- // key: string;
6
- // otp: number;
7
- // action: string;
8
- // user_agent: string;
9
- // ip_address: string;
10
- // verify: boolean;
11
- // created_date: Date;
12
- // }
13
- // const OTPSchema = new Schema<IOTP>({
14
- // key: { type: String, required: true },
15
- // otp: { type: String, required: true },
16
- // action: { type: String, required: true },
17
- // user_agent: { type: String },
18
- // ip_address: { type: String },
19
- // verify: { type: Boolean, default: false },
20
- // created_date: { type: Date, default: Date.now },
21
- // });
22
- // const OTPManager = model<IOTP>('OTPManager', OTPSchema);
23
- // export default OTPManager;
24
- // import * as base64 from 'base64-js';
25
- // import { decrypt, encrypt } from './utils';
26
- // function generateKey(key: string): string {
27
- // const keyString: string = key + process.env.SECRETKEY;
28
- // const encodedKey: string = base64.fromByteArray(
29
- // Buffer.from(keyString, 'utf-8'),
30
- // );
31
- // return encodedKey;
32
- // }
33
- // async function generateOTP(
34
- // credential: string,
35
- // action: string,
36
- // ip_address: string,
37
- // user_agent: string,
38
- // ): Promise<{ otp: string | null; countdown: number }> {
39
- // const key: string = generateKey(
40
- // credential + ip_address + user_agent + action,
41
- // );
42
- // try {
43
- // const existingOTP = await OTPManager.findOne({
44
- // key,
45
- // created_date: { $gte: new Date(Date.now() - 30 * 1000) },
46
- // });
47
- // if (existingOTP) {
48
- // const countdown = Math.round(
49
- // (existingOTP.created_date.getTime() + 30 * 1000 - Date.now()) / 1000,
50
- // );
51
- // return { otp: null, countdown };
52
- // }
53
- // const otpCode: string = Math.random().toString().slice(2, 8);
54
- // await OTPManager.deleteMany({ key });
55
- // await OTPManager.create({
56
- // key,
57
- // otp: encrypt(otpCode, ''),
58
- // action,
59
- // ip_address,
60
- // user_agent,
61
- // });
62
- // return { otp: otpCode, countdown: 0 };
63
- // } catch (error) {
64
- // console.error('Error generating OTP:', error);
65
- // return { otp: null, countdown: 0 };
66
- // }
67
- // }
68
- // async function verifyOTP(
69
- // otp: string,
70
- // credential: string,
71
- // user_agent: string,
72
- // ip_address: string,
73
- // action: string,
74
- // ): Promise<{ isVerify: boolean; message: string }> {
75
- // const key: string = generateKey(
76
- // credential + ip_address + user_agent + action,
77
- // );
78
- // try {
79
- // const otpModel: IOTP | null = await OTPManager.findOne({ key });
80
- // if (!otpModel) {
81
- // return { isVerify: false, message: 'INVALID_OTP' };
82
- // }
83
- // const expireTime: Date = new Date(
84
- // otpModel.created_date.getTime() + 5 * 60 * 1000,
85
- // ); // Adding 5 minutes to the created date
86
- // const currentTime: Date = new Date();
87
- // if (expireTime < currentTime) {
88
- // await OTPManager.deleteMany({ key });
89
- // return { isVerify: false, message: 'INVALID_OR_EXPIRED_OTP' };
90
- // }
91
- // if (otp === decrypt(otpModel.otp, '')) {
92
- // await OTPManager.deleteMany({ key });
93
- // return { isVerify: true, message: 'OTP_VERIFIED' };
94
- // } else {
95
- // return { isVerify: false, message: 'INVALID_OTP' };
96
- // }
97
- // } catch (error) {
98
- // console.log(` verify error error ` + error);
99
- // return { isVerify: false, message: 'ERROR_OCCURED' };
100
- // }
101
- // }
102
- // export { generateOTP, verifyOTP };