@takentrade/takentrade-libs 3.3.4 → 4.0.1
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/common/enums/index.d.ts +2 -1
- package/dist/common/enums/index.js +2 -1
- package/dist/common/enums/transaction.enum.d.ts +85 -0
- package/dist/common/enums/transaction.enum.js +97 -0
- package/dist/common/health/health.controller.d.ts +1 -1
- package/dist/nats/constants/nats.constants.d.ts +13 -25
- package/dist/nats/constants/nats.constants.js +17 -28
- package/dist/nats/events/index.d.ts +100 -2
- package/dist/nats/events/index.js +0 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
|
@@ -14,5 +14,6 @@ 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
|
-
__exportStar(require("./ticket.enum"), exports);
|
|
18
17
|
__exportStar(require("./support-action.enum"), exports);
|
|
18
|
+
__exportStar(require("./ticket.enum"), exports);
|
|
19
|
+
__exportStar(require("./transaction.enum"), exports);
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
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 = {}));
|
|
@@ -5,5 +5,5 @@ export declare class HealthController {
|
|
|
5
5
|
private memory;
|
|
6
6
|
private microservice;
|
|
7
7
|
constructor(health: HealthCheckService, disk: DiskHealthIndicator, memory: MemoryHealthIndicator, microservice: MicroserviceHealthIndicator);
|
|
8
|
-
check(): Promise<import("@nestjs/terminus").HealthCheckResult
|
|
8
|
+
check(): Promise<import("@nestjs/terminus").HealthCheckResult<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<"nats"> & import("@nestjs/terminus").HealthIndicatorResult<"memory_rss"> & import("@nestjs/terminus").HealthIndicatorResult<"memory_heap"> & import("@nestjs/terminus").HealthIndicatorResult<"storage">, Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<"nats"> & import("@nestjs/terminus").HealthIndicatorResult<"memory_rss"> & import("@nestjs/terminus").HealthIndicatorResult<"memory_heap"> & import("@nestjs/terminus").HealthIndicatorResult<"storage">> | undefined, Partial<import("@nestjs/terminus").HealthIndicatorResult<string, import("@nestjs/terminus").HealthIndicatorStatus, Record<string, any>> & import("@nestjs/terminus").HealthIndicatorResult<"nats"> & import("@nestjs/terminus").HealthIndicatorResult<"memory_rss"> & import("@nestjs/terminus").HealthIndicatorResult<"memory_heap"> & import("@nestjs/terminus").HealthIndicatorResult<"storage">> | undefined>>;
|
|
9
9
|
}
|
|
@@ -8,14 +8,9 @@ export declare const DEFAULT_NATS_CONFIG: {
|
|
|
8
8
|
maxReconnectAttempts: number;
|
|
9
9
|
};
|
|
10
10
|
export declare enum NatsSubjects {
|
|
11
|
-
SUBACCOUNT_UPDATE_AMOUNT = "subaccount.amount.update",
|
|
12
|
-
SUBACCOUNT_GET_BY_ID = "subaccount.get.by.id",
|
|
13
|
-
SUBACCOUNT_GET_ALL = "subaccount.get.all",
|
|
14
11
|
USER_CHECK = "user.check",
|
|
15
12
|
USER_CREATED = "user.created",
|
|
16
13
|
USER_GET_PREFERENCE = "user.preference.get",
|
|
17
|
-
NOTIFICATION_UPDATE_TOKEN = "notification.token.update",
|
|
18
|
-
NOTIFICATION_SEND = "notification.send",
|
|
19
14
|
NOTIFICATION_GET_ALL = "notification.get.all",
|
|
20
15
|
NOTIFICATION_GET_BY_ID = "notification.get.by.id",
|
|
21
16
|
NOTIFICATION_MARK_AS_READ = "notification.mark.as.read",
|
|
@@ -25,27 +20,20 @@ export declare enum NatsSubjects {
|
|
|
25
20
|
GET_ALL_USERS_FCM_TOKENS = "user.get.all.fcm_tokens",
|
|
26
21
|
GET_USER_BY_ID = "user.get.by_id",
|
|
27
22
|
GET_USER_BALANCE = "user.get.balance",
|
|
28
|
-
CHAT_GET_CONVERSATIONS = "chat.conversations.get",
|
|
29
|
-
CHAT_GET_CONVERSATION = "chat.conversation.get",
|
|
30
|
-
CHAT_GET_MESSAGES = "chat.messages.get",
|
|
31
|
-
CHAT_CLOSE_CONVERSATION = "chat.conversation.close",
|
|
32
|
-
CHAT_ASSIGN_SUPPORT = "chat.conversation.assign",
|
|
33
|
-
AJO_PLANS_GET = "ajo.plans.get",
|
|
34
|
-
AJO_CREATE = "ajo.create",
|
|
35
|
-
AJO_LIST = "ajo.list",
|
|
36
|
-
AJO_GET = "ajo.get",
|
|
37
|
-
AJO_JOIN = "ajo.join",
|
|
38
|
-
AJO_CONTRIBUTE = "ajo.contribute",
|
|
39
|
-
AJO_PAYOUT = "ajo.payout",
|
|
40
|
-
AJO_CONTRIBUTIONS_GET = "ajo.contributions.get",
|
|
41
|
-
AJO_UPDATE = "ajo.update",
|
|
42
|
-
AJO_ADMIN_CYCLE = "ajo.admin.cycle",
|
|
43
23
|
PROVIDUS_GET_ACCOUNT = "providus.account.get",
|
|
44
24
|
PROVIDUS_DEBIT_CUSTOMER = "providus.customer.debit",
|
|
45
25
|
PROVIDUS_CREDIT_CUSTOMER = "providus.customer.credit",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
26
|
+
CREATE_PROVIDUS_ACCOUNT = "providus.account.create",
|
|
27
|
+
KYC_VERIFIED = "kyc.verified",
|
|
28
|
+
KYC_REJECTED = "kyc.rejected",
|
|
29
|
+
VAS_TRANSACTION_SUCCESS = "vas.transaction.success",
|
|
30
|
+
VAS_TRANSACTION_FAILED = "vas.transaction.failed",
|
|
31
|
+
AJO_MEMBER_JOINED = "ajo.member.joined",
|
|
32
|
+
AJO_CONTRIBUTION_SUCCESS = "ajo.contribution.success",
|
|
33
|
+
AJO_MATURED = "ajo.matured",
|
|
34
|
+
REFERRAL_REWARD_CLAIMED = "referral.reward.claimed",
|
|
35
|
+
WITHDRAWAL_REQUESTED = "withdrawal.requested",
|
|
36
|
+
WITHDRAWAL_PROCESSED = "withdrawal.processed",
|
|
37
|
+
ADMIN_GET_TERMII_BALANCE = "admin.termii.balance.get",
|
|
38
|
+
ADMIN_GET_KUDISMS_BALANCE = "admin.kudisms.balance.get"
|
|
51
39
|
}
|
|
@@ -12,17 +12,11 @@ exports.DEFAULT_NATS_CONFIG = {
|
|
|
12
12
|
};
|
|
13
13
|
var NatsSubjects;
|
|
14
14
|
(function (NatsSubjects) {
|
|
15
|
-
// Subaccount operations
|
|
16
|
-
NatsSubjects["SUBACCOUNT_UPDATE_AMOUNT"] = "subaccount.amount.update";
|
|
17
|
-
NatsSubjects["SUBACCOUNT_GET_BY_ID"] = "subaccount.get.by.id";
|
|
18
|
-
NatsSubjects["SUBACCOUNT_GET_ALL"] = "subaccount.get.all";
|
|
19
15
|
// User operations
|
|
20
16
|
NatsSubjects["USER_CHECK"] = "user.check";
|
|
21
17
|
NatsSubjects["USER_CREATED"] = "user.created";
|
|
22
18
|
NatsSubjects["USER_GET_PREFERENCE"] = "user.preference.get";
|
|
23
19
|
// Notification operations
|
|
24
|
-
NatsSubjects["NOTIFICATION_UPDATE_TOKEN"] = "notification.token.update";
|
|
25
|
-
NatsSubjects["NOTIFICATION_SEND"] = "notification.send";
|
|
26
20
|
NatsSubjects["NOTIFICATION_GET_ALL"] = "notification.get.all";
|
|
27
21
|
NatsSubjects["NOTIFICATION_GET_BY_ID"] = "notification.get.by.id";
|
|
28
22
|
NatsSubjects["NOTIFICATION_MARK_AS_READ"] = "notification.mark.as.read";
|
|
@@ -33,32 +27,27 @@ var NatsSubjects;
|
|
|
33
27
|
NatsSubjects["GET_ALL_USERS_FCM_TOKENS"] = "user.get.all.fcm_tokens";
|
|
34
28
|
NatsSubjects["GET_USER_BY_ID"] = "user.get.by_id";
|
|
35
29
|
NatsSubjects["GET_USER_BALANCE"] = "user.get.balance";
|
|
36
|
-
// Chat operations
|
|
37
|
-
NatsSubjects["CHAT_GET_CONVERSATIONS"] = "chat.conversations.get";
|
|
38
|
-
NatsSubjects["CHAT_GET_CONVERSATION"] = "chat.conversation.get";
|
|
39
|
-
NatsSubjects["CHAT_GET_MESSAGES"] = "chat.messages.get";
|
|
40
|
-
NatsSubjects["CHAT_CLOSE_CONVERSATION"] = "chat.conversation.close";
|
|
41
|
-
NatsSubjects["CHAT_ASSIGN_SUPPORT"] = "chat.conversation.assign";
|
|
42
|
-
// Ajo operations
|
|
43
|
-
NatsSubjects["AJO_PLANS_GET"] = "ajo.plans.get";
|
|
44
|
-
NatsSubjects["AJO_CREATE"] = "ajo.create";
|
|
45
|
-
NatsSubjects["AJO_LIST"] = "ajo.list";
|
|
46
|
-
NatsSubjects["AJO_GET"] = "ajo.get";
|
|
47
|
-
NatsSubjects["AJO_JOIN"] = "ajo.join";
|
|
48
|
-
NatsSubjects["AJO_CONTRIBUTE"] = "ajo.contribute";
|
|
49
|
-
NatsSubjects["AJO_PAYOUT"] = "ajo.payout";
|
|
50
|
-
NatsSubjects["AJO_CONTRIBUTIONS_GET"] = "ajo.contributions.get";
|
|
51
|
-
NatsSubjects["AJO_UPDATE"] = "ajo.update";
|
|
52
|
-
NatsSubjects["AJO_ADMIN_CYCLE"] = "ajo.admin.cycle";
|
|
53
30
|
// Providus account operations
|
|
54
31
|
NatsSubjects["PROVIDUS_GET_ACCOUNT"] = "providus.account.get";
|
|
55
32
|
NatsSubjects["PROVIDUS_DEBIT_CUSTOMER"] = "providus.customer.debit";
|
|
56
33
|
NatsSubjects["PROVIDUS_CREDIT_CUSTOMER"] = "providus.customer.credit";
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
NatsSubjects["
|
|
60
|
-
NatsSubjects["
|
|
61
|
-
|
|
34
|
+
NatsSubjects["CREATE_PROVIDUS_ACCOUNT"] = "providus.account.create";
|
|
35
|
+
// KYC operations
|
|
36
|
+
NatsSubjects["KYC_VERIFIED"] = "kyc.verified";
|
|
37
|
+
NatsSubjects["KYC_REJECTED"] = "kyc.rejected";
|
|
38
|
+
// VAS operations
|
|
39
|
+
NatsSubjects["VAS_TRANSACTION_SUCCESS"] = "vas.transaction.success";
|
|
40
|
+
NatsSubjects["VAS_TRANSACTION_FAILED"] = "vas.transaction.failed";
|
|
41
|
+
// Ajo / Thrift operations
|
|
42
|
+
NatsSubjects["AJO_MEMBER_JOINED"] = "ajo.member.joined";
|
|
43
|
+
NatsSubjects["AJO_CONTRIBUTION_SUCCESS"] = "ajo.contribution.success";
|
|
44
|
+
NatsSubjects["AJO_MATURED"] = "ajo.matured";
|
|
45
|
+
// Reward operations
|
|
46
|
+
NatsSubjects["REFERRAL_REWARD_CLAIMED"] = "referral.reward.claimed";
|
|
47
|
+
// Withdrawal operations
|
|
48
|
+
NatsSubjects["WITHDRAWAL_REQUESTED"] = "withdrawal.requested";
|
|
49
|
+
NatsSubjects["WITHDRAWAL_PROCESSED"] = "withdrawal.processed";
|
|
62
50
|
// Other Admin operations
|
|
63
51
|
NatsSubjects["ADMIN_GET_TERMII_BALANCE"] = "admin.termii.balance.get";
|
|
52
|
+
NatsSubjects["ADMIN_GET_KUDISMS_BALANCE"] = "admin.kudisms.balance.get";
|
|
64
53
|
})(NatsSubjects || (exports.NatsSubjects = NatsSubjects = {}));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TransactionCategory, TransactionStatus } from '../../common/enums/transaction.enum';
|
|
1
2
|
/**
|
|
2
3
|
* NATS Event Contracts
|
|
3
4
|
* TypeScript interfaces for inter-service communication via NATS
|
|
@@ -6,8 +7,12 @@ export interface UserCreatedEvent {
|
|
|
6
7
|
userId: string;
|
|
7
8
|
email: string;
|
|
8
9
|
phone: string;
|
|
10
|
+
username: string;
|
|
9
11
|
firstname?: string;
|
|
10
12
|
lastname?: string;
|
|
13
|
+
middlename?: string;
|
|
14
|
+
gender?: string;
|
|
15
|
+
dateOfBirth?: string;
|
|
11
16
|
referralCode?: string;
|
|
12
17
|
createdAt: string;
|
|
13
18
|
}
|
|
@@ -15,9 +20,14 @@ export interface PaymentSuccessEvent {
|
|
|
15
20
|
transactionId: string;
|
|
16
21
|
userId: string;
|
|
17
22
|
amount: number;
|
|
23
|
+
fee?: number;
|
|
18
24
|
currency: string;
|
|
25
|
+
category?: string;
|
|
19
26
|
provider: 'PROVIDUS' | 'PAYSTACK';
|
|
20
27
|
reference: string;
|
|
28
|
+
providerReference?: string;
|
|
29
|
+
balanceBefore?: number;
|
|
30
|
+
balanceAfter?: number;
|
|
21
31
|
metadata?: Record<string, any>;
|
|
22
32
|
timestamp: string;
|
|
23
33
|
}
|
|
@@ -36,8 +46,12 @@ export interface TransactionProcessedEvent {
|
|
|
36
46
|
transactionId: string;
|
|
37
47
|
userId: string;
|
|
38
48
|
type: 'CREDIT' | 'DEBIT';
|
|
49
|
+
category: string;
|
|
39
50
|
amount: number;
|
|
40
|
-
|
|
51
|
+
fee: number;
|
|
52
|
+
balanceBefore: number;
|
|
53
|
+
balanceAfter: number;
|
|
54
|
+
reference: string;
|
|
41
55
|
description: string;
|
|
42
56
|
metadata?: Record<string, any>;
|
|
43
57
|
timestamp: string;
|
|
@@ -45,7 +59,7 @@ export interface TransactionProcessedEvent {
|
|
|
45
59
|
export interface NotificationSentEvent {
|
|
46
60
|
notificationId: string;
|
|
47
61
|
userId: string;
|
|
48
|
-
channel: 'EMAIL' | 'SMS' | 'PUSH';
|
|
62
|
+
channel: 'EMAIL' | 'SMS' | 'PUSH' | 'VOICE';
|
|
49
63
|
type: string;
|
|
50
64
|
status: 'SENT' | 'FAILED';
|
|
51
65
|
timestamp: string;
|
|
@@ -55,6 +69,8 @@ export interface SavingsMaturedEvent {
|
|
|
55
69
|
userId: string;
|
|
56
70
|
amount: number;
|
|
57
71
|
interest: number;
|
|
72
|
+
interestRate?: number;
|
|
73
|
+
balance: number;
|
|
58
74
|
plan: string;
|
|
59
75
|
maturityDate: string;
|
|
60
76
|
timestamp: string;
|
|
@@ -64,6 +80,9 @@ export interface LoanApprovedEvent {
|
|
|
64
80
|
userId: string;
|
|
65
81
|
amount: number;
|
|
66
82
|
interestRate: number;
|
|
83
|
+
totalInterest: number;
|
|
84
|
+
processingFee: number;
|
|
85
|
+
duration: string;
|
|
67
86
|
repaymentDate: string;
|
|
68
87
|
timestamp: string;
|
|
69
88
|
}
|
|
@@ -72,5 +91,84 @@ export interface LoanRepaidEvent {
|
|
|
72
91
|
userId: string;
|
|
73
92
|
amount: number;
|
|
74
93
|
remainingBalance: number;
|
|
94
|
+
reference?: string;
|
|
95
|
+
timestamp: string;
|
|
96
|
+
}
|
|
97
|
+
export interface CreateProvidusAccountEvent {
|
|
98
|
+
userId: string;
|
|
99
|
+
bvn?: string;
|
|
100
|
+
firstName?: string;
|
|
101
|
+
lastName?: string;
|
|
102
|
+
dateOfBirth?: string;
|
|
103
|
+
phoneNumber?: string;
|
|
104
|
+
email?: string;
|
|
105
|
+
address?: string;
|
|
106
|
+
}
|
|
107
|
+
export interface KycVerifiedEvent {
|
|
108
|
+
userId: string;
|
|
109
|
+
verificationId: string;
|
|
110
|
+
bvn: string;
|
|
111
|
+
timestamp: string;
|
|
112
|
+
}
|
|
113
|
+
export interface KycRejectedEvent {
|
|
114
|
+
userId: string;
|
|
115
|
+
verificationId: string;
|
|
116
|
+
reason: string;
|
|
117
|
+
timestamp: string;
|
|
118
|
+
}
|
|
119
|
+
export interface VasTransactionEvent {
|
|
120
|
+
transactionId: string;
|
|
121
|
+
userId: string;
|
|
122
|
+
serviceId: string;
|
|
123
|
+
category: TransactionCategory;
|
|
124
|
+
amount: number;
|
|
125
|
+
recipientIdentifier: string;
|
|
126
|
+
status: TransactionStatus;
|
|
127
|
+
provider: string;
|
|
128
|
+
reference: string;
|
|
129
|
+
timestamp: string;
|
|
130
|
+
}
|
|
131
|
+
export interface AjoContributionEvent {
|
|
132
|
+
ajoId: string;
|
|
133
|
+
userId: string;
|
|
134
|
+
amount: number;
|
|
135
|
+
reference: string;
|
|
136
|
+
status: TransactionStatus;
|
|
137
|
+
timestamp: string;
|
|
138
|
+
}
|
|
139
|
+
export interface AjoMemberJoinedEvent {
|
|
140
|
+
ajoId: string;
|
|
141
|
+
userId: string;
|
|
142
|
+
joinedAt: string;
|
|
143
|
+
timestamp: string;
|
|
144
|
+
}
|
|
145
|
+
export interface ReferralRewardClaimedEvent {
|
|
146
|
+
userId: string;
|
|
147
|
+
referralId: string;
|
|
148
|
+
amount: number;
|
|
149
|
+
reference: string;
|
|
150
|
+
timestamp: string;
|
|
151
|
+
}
|
|
152
|
+
export interface WithdrawalRequestedEvent {
|
|
153
|
+
withdrawalId: string;
|
|
154
|
+
userId: string;
|
|
155
|
+
amount: number;
|
|
156
|
+
bankName: string;
|
|
157
|
+
accountNumber: string;
|
|
158
|
+
status: TransactionStatus;
|
|
159
|
+
timestamp: string;
|
|
160
|
+
}
|
|
161
|
+
export interface ProvidusDebitEvent {
|
|
162
|
+
userId: string;
|
|
163
|
+
amount: number;
|
|
164
|
+
reference: string;
|
|
165
|
+
metadata?: Record<string, any>;
|
|
166
|
+
timestamp: string;
|
|
167
|
+
}
|
|
168
|
+
export interface ProvidusCreditEvent {
|
|
169
|
+
userId: string;
|
|
170
|
+
amount: number;
|
|
171
|
+
reference: string;
|
|
172
|
+
metadata?: Record<string, any>;
|
|
75
173
|
timestamp: string;
|
|
76
174
|
}
|