@takentrade/takentrade-libs 1.2.66 → 1.2.68
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.
|
@@ -11,9 +11,6 @@ export declare enum NatsSubjects {
|
|
|
11
11
|
SUBACCOUNT_UPDATE_AMOUNT = "subaccount.amount.update",
|
|
12
12
|
SUBACCOUNT_GET_BY_ID = "subaccount.get.by.id",
|
|
13
13
|
SUBACCOUNT_GET_ALL = "subaccount.get.all",
|
|
14
|
-
TRANSACTION_DEBIT = "account.transaction.debit",
|
|
15
|
-
TRANSACTION_CREDIT = "account.transaction.credit",
|
|
16
|
-
TRANSACTION_REVERSAL = "account.transaction.reversal",
|
|
17
14
|
ADMIN_GET_ALL_TRANSACTIONS = "admin.transaction.get.all",
|
|
18
15
|
ADMIN_GET_USER_TRANSACTIONS = "admin.transaction.user.get.all",
|
|
19
16
|
USER_GET_TRANSACTIONS = "user.transaction.get.all",
|
|
@@ -108,10 +105,19 @@ export declare enum NatsSubjects {
|
|
|
108
105
|
ACCOUNT_GET_RESTRICTIONS = "account.restrictions.get",
|
|
109
106
|
ACCOUNT_REMOVE_RESTRICTION = "account.restriction.remove",
|
|
110
107
|
ADMIN_GET_ALL_RESTRICTIONS = "admin.restrictions.get.all",
|
|
108
|
+
PROVIDUS_GET_ACCOUNT = "providus.account.get",
|
|
109
|
+
PROVIDUS_DEBIT_CUSTOMER = "providus.customer.debit",
|
|
110
|
+
PROVIDUS_CREDIT_CUSTOMER = "providus.customer.credit",
|
|
111
111
|
ACCOUNT_ADD_HOLD = "account.hold.add",
|
|
112
112
|
ACCOUNT_GET_HOLDS = "account.holds.get",
|
|
113
113
|
ACCOUNT_RELEASE_HOLD = "account.hold.release",
|
|
114
114
|
ADMIN_GET_ALL_HOLDS = "admin.holds.get.all",
|
|
115
|
+
COOPERATIVE_CREATE = "cooperative.create",
|
|
116
|
+
COOPERATIVE_ADD_MEMBER = "cooperative.member.add",
|
|
117
|
+
COOPERATIVE_GET_ALL = "cooperative.get.all",
|
|
118
|
+
COOPERATIVE_GET_BY_ID = "cooperative.get.by.id",
|
|
119
|
+
COOPERATIVE_GET_MEMBERS = "cooperative.members.get",
|
|
120
|
+
ADMIN_COOPERATIVE_GET_ALL = "admin.cooperative.get.all",
|
|
115
121
|
ADMIN_CREATE = "admin.create",
|
|
116
122
|
ADMIN_DEBIT_CUSTOMER = "admin.customer.debit",
|
|
117
123
|
ADMIN_CREDIT_CUSTOMER = "admin.customer.credit",
|
|
@@ -16,10 +16,6 @@ var NatsSubjects;
|
|
|
16
16
|
NatsSubjects["SUBACCOUNT_UPDATE_AMOUNT"] = "subaccount.amount.update";
|
|
17
17
|
NatsSubjects["SUBACCOUNT_GET_BY_ID"] = "subaccount.get.by.id";
|
|
18
18
|
NatsSubjects["SUBACCOUNT_GET_ALL"] = "subaccount.get.all";
|
|
19
|
-
// Transaction
|
|
20
|
-
NatsSubjects["TRANSACTION_DEBIT"] = "account.transaction.debit";
|
|
21
|
-
NatsSubjects["TRANSACTION_CREDIT"] = "account.transaction.credit";
|
|
22
|
-
NatsSubjects["TRANSACTION_REVERSAL"] = "account.transaction.reversal";
|
|
23
19
|
// Transaction queries
|
|
24
20
|
NatsSubjects["ADMIN_GET_ALL_TRANSACTIONS"] = "admin.transaction.get.all";
|
|
25
21
|
NatsSubjects["ADMIN_GET_USER_TRANSACTIONS"] = "admin.transaction.user.get.all";
|
|
@@ -136,11 +132,22 @@ var NatsSubjects;
|
|
|
136
132
|
NatsSubjects["ACCOUNT_GET_RESTRICTIONS"] = "account.restrictions.get";
|
|
137
133
|
NatsSubjects["ACCOUNT_REMOVE_RESTRICTION"] = "account.restriction.remove";
|
|
138
134
|
NatsSubjects["ADMIN_GET_ALL_RESTRICTIONS"] = "admin.restrictions.get.all";
|
|
135
|
+
// Providus account operations
|
|
136
|
+
NatsSubjects["PROVIDUS_GET_ACCOUNT"] = "providus.account.get";
|
|
137
|
+
NatsSubjects["PROVIDUS_DEBIT_CUSTOMER"] = "providus.customer.debit";
|
|
138
|
+
NatsSubjects["PROVIDUS_CREDIT_CUSTOMER"] = "providus.customer.credit";
|
|
139
139
|
// Account Holds
|
|
140
140
|
NatsSubjects["ACCOUNT_ADD_HOLD"] = "account.hold.add";
|
|
141
141
|
NatsSubjects["ACCOUNT_GET_HOLDS"] = "account.holds.get";
|
|
142
142
|
NatsSubjects["ACCOUNT_RELEASE_HOLD"] = "account.hold.release";
|
|
143
143
|
NatsSubjects["ADMIN_GET_ALL_HOLDS"] = "admin.holds.get.all";
|
|
144
|
+
// Cooperative operations
|
|
145
|
+
NatsSubjects["COOPERATIVE_CREATE"] = "cooperative.create";
|
|
146
|
+
NatsSubjects["COOPERATIVE_ADD_MEMBER"] = "cooperative.member.add";
|
|
147
|
+
NatsSubjects["COOPERATIVE_GET_ALL"] = "cooperative.get.all";
|
|
148
|
+
NatsSubjects["COOPERATIVE_GET_BY_ID"] = "cooperative.get.by.id";
|
|
149
|
+
NatsSubjects["COOPERATIVE_GET_MEMBERS"] = "cooperative.members.get";
|
|
150
|
+
NatsSubjects["ADMIN_COOPERATIVE_GET_ALL"] = "admin.cooperative.get.all";
|
|
144
151
|
// Admin operations
|
|
145
152
|
NatsSubjects["ADMIN_CREATE"] = "admin.create";
|
|
146
153
|
NatsSubjects["ADMIN_DEBIT_CUSTOMER"] = "admin.customer.debit";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnModuleDestroy, OnModuleInit } from '@nestjs/common';
|
|
2
2
|
import { PrismaClient } from '@prisma/client';
|
|
3
|
-
export declare class PrismaService extends PrismaClient implements OnModuleInit {
|
|
3
|
+
export declare class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
|
|
4
4
|
onModuleInit(): Promise<void>;
|
|
5
|
-
|
|
5
|
+
onModuleDestroy(): Promise<void>;
|
|
6
6
|
}
|
|
@@ -11,12 +11,16 @@ const common_1 = require("@nestjs/common");
|
|
|
11
11
|
const client_1 = require("@prisma/client");
|
|
12
12
|
let PrismaService = class PrismaService extends client_1.PrismaClient {
|
|
13
13
|
async onModuleInit() {
|
|
14
|
-
|
|
14
|
+
try {
|
|
15
|
+
await this.$connect();
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
common_1.Logger.error('Failed to connect to database', error);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
15
21
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
app.close().catch(console.error);
|
|
19
|
-
});
|
|
22
|
+
async onModuleDestroy() {
|
|
23
|
+
await this.$disconnect();
|
|
20
24
|
}
|
|
21
25
|
};
|
|
22
26
|
exports.PrismaService = PrismaService;
|