@takentrade/takentrade-libs 1.2.68 → 1.2.70

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.
@@ -112,12 +112,35 @@ export declare enum NatsSubjects {
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
+ COOPERATIVE_COOPERATIVE_CREATE = "cooperative.cooperative.create",
116
+ COOPERATIVE_COOPERATIVE_LIST = "cooperative.cooperative.list",
117
+ COOPERATIVE_COOPERATIVE_GET = "cooperative.cooperative.get",
118
+ COOPERATIVE_COOPERATIVE_UPDATE = "cooperative.cooperative.update",
119
+ COOPERATIVE_COOPERATIVE_DELETE = "cooperative.cooperative.delete",
120
+ COOPERATIVE_MEMBER_LIST = "cooperative.member.list",
121
+ COOPERATIVE_CONTRIBUTION_LIST = "cooperative.contribution.list",
122
+ COOPERATIVE_DISTRIBUTION_LIST = "cooperative.distribution.list",
123
+ COOPERATIVE_TRANSACTION_LIST = "cooperative.transaction.list",
124
+ COOPERATIVE_MEMBER_CREATE = "cooperative.member.create",
125
+ COOPERATIVE_MEMBER_GET = "cooperative.member.get",
126
+ COOPERATIVE_MEMBER_UPDATE = "cooperative.member.update",
127
+ COOPERATIVE_MEMBER_DELETE = "cooperative.member.delete",
128
+ COOPERATIVE_CONTRIBUTION_CREATE = "cooperative.contribution.create",
129
+ COOPERATIVE_CONTRIBUTION_GET = "cooperative.contribution.get",
130
+ COOPERATIVE_CONTRIBUTION_UPDATE = "cooperative.contribution.update",
131
+ COOPERATIVE_CONTRIBUTION_DELETE = "cooperative.contribution.delete",
132
+ COOPERATIVE_DISTRIBUTION_CREATE = "cooperative.distribution.create",
133
+ COOPERATIVE_DISTRIBUTION_GET = "cooperative.distribution.get",
134
+ COOPERATIVE_DISTRIBUTION_UPDATE = "cooperative.distribution.update",
135
+ COOPERATIVE_DISTRIBUTION_DELETE = "cooperative.distribution.delete",
136
+ COOPERATIVE_TRANSACTION_CREATE = "cooperative.transaction.create",
137
+ COOPERATIVE_TRANSACTION_GET = "cooperative.transaction.get",
138
+ COOPERATIVE_TRANSACTION_UPDATE = "cooperative.transaction.update",
139
+ COOPERATIVE_TRANSACTION_DELETE = "cooperative.transaction.delete",
140
+ COOPERATIVE_JOIN = "cooperative.join",
141
+ COOPERATIVE_CONTRIBUTE = "cooperative.contribute",
142
+ COOPERATIVE_DISTRIBUTE = "cooperative.distribute",
143
+ COOPERATIVE_CURRENT_CYCLE = "cooperative.current-cycle",
121
144
  ADMIN_CREATE = "admin.create",
122
145
  ADMIN_DEBIT_CUSTOMER = "admin.customer.debit",
123
146
  ADMIN_CREDIT_CUSTOMER = "admin.customer.credit",
@@ -141,13 +141,41 @@ var NatsSubjects;
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
+ // Cooperative Subjects
145
+ NatsSubjects["COOPERATIVE_COOPERATIVE_CREATE"] = "cooperative.cooperative.create";
146
+ NatsSubjects["COOPERATIVE_COOPERATIVE_LIST"] = "cooperative.cooperative.list";
147
+ NatsSubjects["COOPERATIVE_COOPERATIVE_GET"] = "cooperative.cooperative.get";
148
+ NatsSubjects["COOPERATIVE_COOPERATIVE_UPDATE"] = "cooperative.cooperative.update";
149
+ NatsSubjects["COOPERATIVE_COOPERATIVE_DELETE"] = "cooperative.cooperative.delete";
150
+ NatsSubjects["COOPERATIVE_MEMBER_LIST"] = "cooperative.member.list";
151
+ NatsSubjects["COOPERATIVE_CONTRIBUTION_LIST"] = "cooperative.contribution.list";
152
+ NatsSubjects["COOPERATIVE_DISTRIBUTION_LIST"] = "cooperative.distribution.list";
153
+ NatsSubjects["COOPERATIVE_TRANSACTION_LIST"] = "cooperative.transaction.list";
154
+ // CooperativeMember Subjects
155
+ NatsSubjects["COOPERATIVE_MEMBER_CREATE"] = "cooperative.member.create";
156
+ NatsSubjects["COOPERATIVE_MEMBER_GET"] = "cooperative.member.get";
157
+ NatsSubjects["COOPERATIVE_MEMBER_UPDATE"] = "cooperative.member.update";
158
+ NatsSubjects["COOPERATIVE_MEMBER_DELETE"] = "cooperative.member.delete";
159
+ // Contribution Subjects
160
+ NatsSubjects["COOPERATIVE_CONTRIBUTION_CREATE"] = "cooperative.contribution.create";
161
+ NatsSubjects["COOPERATIVE_CONTRIBUTION_GET"] = "cooperative.contribution.get";
162
+ NatsSubjects["COOPERATIVE_CONTRIBUTION_UPDATE"] = "cooperative.contribution.update";
163
+ NatsSubjects["COOPERATIVE_CONTRIBUTION_DELETE"] = "cooperative.contribution.delete";
164
+ // Distribution Subjects
165
+ NatsSubjects["COOPERATIVE_DISTRIBUTION_CREATE"] = "cooperative.distribution.create";
166
+ NatsSubjects["COOPERATIVE_DISTRIBUTION_GET"] = "cooperative.distribution.get";
167
+ NatsSubjects["COOPERATIVE_DISTRIBUTION_UPDATE"] = "cooperative.distribution.update";
168
+ NatsSubjects["COOPERATIVE_DISTRIBUTION_DELETE"] = "cooperative.distribution.delete";
169
+ // CooperativeTransaction Subjects
170
+ NatsSubjects["COOPERATIVE_TRANSACTION_CREATE"] = "cooperative.transaction.create";
171
+ NatsSubjects["COOPERATIVE_TRANSACTION_GET"] = "cooperative.transaction.get";
172
+ NatsSubjects["COOPERATIVE_TRANSACTION_UPDATE"] = "cooperative.transaction.update";
173
+ NatsSubjects["COOPERATIVE_TRANSACTION_DELETE"] = "cooperative.transaction.delete";
174
+ // Business Logic Subjects
175
+ NatsSubjects["COOPERATIVE_JOIN"] = "cooperative.join";
176
+ NatsSubjects["COOPERATIVE_CONTRIBUTE"] = "cooperative.contribute";
177
+ NatsSubjects["COOPERATIVE_DISTRIBUTE"] = "cooperative.distribute";
178
+ NatsSubjects["COOPERATIVE_CURRENT_CYCLE"] = "cooperative.current-cycle";
151
179
  // Admin operations
152
180
  NatsSubjects["ADMIN_CREATE"] = "admin.create";
153
181
  NatsSubjects["ADMIN_DEBIT_CUSTOMER"] = "admin.customer.debit";
@@ -1,6 +1,6 @@
1
1
  import { ClientProxy } from '@nestjs/microservices';
2
2
  import { OTPNotificationChannel } from './notification.enum';
3
- import { AccountFreezeEmailData, AccountStatementEmailData, AccountUnfreezeEmailData, AjoCancellationEmailData, AjoContributionEmailData, AjoInviteEmailData, AjoMembershipUpdateEmailData, ContactMessageEmailData, CreditTransactionMailData, CustomMailSendOptions, DebitTransactionMailData, ElectricityEmailData, InvestmentCancellationEmailData, LoanApprovedEmailData, LoanRepaymentConfirmationEmailData, LoanRepaymentFailedEmailData, NewLoanApplicationEmailData, OTPMailData, PasswordResetMailData, ResetTransactionPinEmailData, AjoContributionConfirmationEmailData, InvestmentConfirmationEmailData, SendPushNotificationInput, BaseEmailData, EducationEmailData, EmailVerificationMailData, DeviceVerificationMailData, NewDeviceNotificationData } from './notification.interface';
3
+ import { AccountFreezeEmailData, AccountStatementEmailData, AccountUnfreezeEmailData, AjoCancellationEmailData, AjoContributionEmailData, AjoInviteEmailData, AjoMembershipUpdateEmailData, ContactMessageEmailData, CreditTransactionMailData, CustomMailSendOptions, DebitTransactionMailData, ElectricityEmailData, InvestmentCancellationEmailData, LoanApprovedEmailData, LoanRepaymentConfirmationEmailData, LoanRepaymentFailedEmailData, NewLoanApplicationEmailData, OTPMailData, PasswordResetMailData, ResetTransactionPinEmailData, AjoContributionConfirmationEmailData, InvestmentConfirmationEmailData, SendPushNotificationInput, BaseEmailData, EducationEmailData, EmailVerificationMailData, DeviceVerificationMailData, NewDeviceNotificationData, SubAccountReportEmailData } from './notification.interface';
4
4
  export declare class NotificationClient {
5
5
  private readonly natsClient;
6
6
  constructor(natsClient: ClientProxy);
@@ -50,6 +50,13 @@ export declare class NotificationClient {
50
50
  sendEducationPurchaseEmail(to: string, data: Omit<EducationEmailData, keyof BaseEmailData>): Promise<void>;
51
51
  sendDeviceVerificationEmail(to: string, data: Omit<DeviceVerificationMailData, keyof BaseEmailData>): Promise<void>;
52
52
  sendNewDeviceNotificationEmail(to: string, data: Omit<NewDeviceNotificationData, keyof BaseEmailData>): Promise<void>;
53
+ sendNewDeviceNotification(to: string, data: NewDeviceNotificationData): Promise<void>;
54
+ /**
55
+ * Sends a sub-account report email with the provided data
56
+ * @param to Recipient email address
57
+ * @param data Sub-account report data
58
+ */
59
+ sendSubAccountReportEmail(to: string, data: SubAccountReportEmailData): Promise<void>;
53
60
  sendWelcomeMail(to: string, data: BaseEmailData): Promise<void>;
54
61
  /**
55
62
  * Sends generated OTP to a recipient
@@ -206,6 +206,22 @@ let NotificationClient = class NotificationClient {
206
206
  data,
207
207
  });
208
208
  }
209
+ async sendNewDeviceNotification(to, data) {
210
+ this.validateEmailAddress(to);
211
+ this.natsClient.emit(notification_enum_1.NotificationSubcribedNATSSubject.NEW_DEVICE_NOTIFICATION_MAIL, {
212
+ to,
213
+ data,
214
+ });
215
+ }
216
+ /**
217
+ * Sends a sub-account report email with the provided data
218
+ * @param to Recipient email address
219
+ * @param data Sub-account report data
220
+ */
221
+ async sendSubAccountReportEmail(to, data) {
222
+ this.validateEmailAddress(to);
223
+ this.natsClient.emit(notification_enum_1.NotificationSubcribedNATSSubject.SUB_ACCOUNT_REPORT_MAIL, { to, data });
224
+ }
209
225
  async sendWelcomeMail(to, data) {
210
226
  this.validateEmailAddress(to);
211
227
  this.natsClient.emit(notification_enum_1.NotificationSubcribedNATSSubject.WELCOME_MAIL, {
@@ -35,6 +35,7 @@ export declare enum NotificationSubcribedNATSSubject {
35
35
  DEVICE_VERIFICATION_MAIL = "notification.mail.device.verification",
36
36
  DEVICE_VERIFICATION_SMS = "notification.mail.device.verification.sms",
37
37
  NEW_DEVICE_NOTIFICATION_MAIL = "notification.mail.new.device",
38
+ SUB_ACCOUNT_REPORT_MAIL = "notification.mail.subaccount.report",
38
39
  NOTIFICATION_TEXT = "notification.text",
39
40
  NOTIFICATION_OTP_TEXT = "notification.text.otp",
40
41
  NOTIFICATION_OTP_VOICE = "notification.voice.otp",
@@ -42,6 +42,7 @@ var NotificationSubcribedNATSSubject;
42
42
  NotificationSubcribedNATSSubject["DEVICE_VERIFICATION_MAIL"] = "notification.mail.device.verification";
43
43
  NotificationSubcribedNATSSubject["DEVICE_VERIFICATION_SMS"] = "notification.mail.device.verification.sms";
44
44
  NotificationSubcribedNATSSubject["NEW_DEVICE_NOTIFICATION_MAIL"] = "notification.mail.new.device";
45
+ NotificationSubcribedNATSSubject["SUB_ACCOUNT_REPORT_MAIL"] = "notification.mail.subaccount.report";
45
46
  // TEXT
46
47
  NotificationSubcribedNATSSubject["NOTIFICATION_TEXT"] = "notification.text";
47
48
  NotificationSubcribedNATSSubject["NOTIFICATION_OTP_TEXT"] = "notification.text.otp";
@@ -156,3 +156,12 @@ export interface NewDeviceNotificationData extends BaseEmailData {
156
156
  deviceInfo?: string;
157
157
  location?: string;
158
158
  }
159
+ export interface SubAccountReportEmailData {
160
+ subAccounts: Array<{
161
+ name: string;
162
+ type: string;
163
+ balance: number | string;
164
+ currency: string;
165
+ isActive: boolean;
166
+ }>;
167
+ }