@vqnguyen1/piece-fis-ibs 0.0.4 → 0.0.5

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 (36) hide show
  1. package/package.json +2 -2
  2. package/project.json +22 -0
  3. package/src/index.ts +320 -0
  4. package/src/lib/actions/bank-control.ts +378 -0
  5. package/src/lib/actions/customer.ts +1574 -0
  6. package/src/lib/actions/deposit.ts +749 -0
  7. package/src/lib/actions/get-customer.ts +73 -0
  8. package/src/lib/actions/loan.ts +925 -0
  9. package/src/lib/actions/search-customers.ts +143 -0
  10. package/src/lib/actions/security.ts +170 -0
  11. package/tsconfig.json +19 -0
  12. package/tsconfig.lib.json +10 -0
  13. package/src/index.d.ts +0 -16
  14. package/src/index.js +0 -204
  15. package/src/index.js.map +0 -1
  16. package/src/lib/actions/bank-control.d.ts +0 -110
  17. package/src/lib/actions/bank-control.js +0 -371
  18. package/src/lib/actions/bank-control.js.map +0 -1
  19. package/src/lib/actions/customer.d.ts +0 -888
  20. package/src/lib/actions/customer.js +0 -1563
  21. package/src/lib/actions/customer.js.map +0 -1
  22. package/src/lib/actions/deposit.d.ts +0 -406
  23. package/src/lib/actions/deposit.js +0 -739
  24. package/src/lib/actions/deposit.js.map +0 -1
  25. package/src/lib/actions/get-customer.d.ts +0 -12
  26. package/src/lib/actions/get-customer.js +0 -69
  27. package/src/lib/actions/get-customer.js.map +0 -1
  28. package/src/lib/actions/loan.d.ts +0 -506
  29. package/src/lib/actions/loan.js +0 -910
  30. package/src/lib/actions/loan.js.map +0 -1
  31. package/src/lib/actions/search-customers.d.ts +0 -17
  32. package/src/lib/actions/search-customers.js +0 -127
  33. package/src/lib/actions/search-customers.js.map +0 -1
  34. package/src/lib/actions/security.d.ts +0 -38
  35. package/src/lib/actions/security.js +0 -173
  36. package/src/lib/actions/security.js.map +0 -1
@@ -0,0 +1,925 @@
1
+ import { createAction, Property } from '@activepieces/pieces-framework';
2
+ import { httpClient, HttpMethod } from '@activepieces/pieces-common';
3
+ import { fisIbsAuth } from '../..';
4
+
5
+ // Helper function to build headers
6
+ function buildHeaders(auth: any, ibsAuthorization?: string): Record<string, string> {
7
+ const headers: Record<string, string> = {
8
+ 'Content-Type': 'application/json',
9
+ 'organization-id': auth.organizationId,
10
+ 'source-id': auth.sourceId,
11
+ 'application-id': auth.applicationId,
12
+ 'uuid': crypto.randomUUID(),
13
+ 'ibs-authorization': ibsAuthorization || auth.ibsAuthorization,
14
+ };
15
+ if (auth.securityTokenType) {
16
+ headers['security-token-type'] = auth.securityTokenType;
17
+ }
18
+ return headers;
19
+ }
20
+
21
+ // ============================================
22
+ // IBS-Loan-Accounts.json
23
+ // ============================================
24
+
25
+ export const loan_get_account = createAction({
26
+ auth: fisIbsAuth,
27
+ name: 'loan_get_account',
28
+ displayName: 'Loan - Get Account',
29
+ description: 'Retrieve loan account information',
30
+ props: {
31
+ ibsAuthorization: Property.ShortText({
32
+ displayName: 'IBS Authorization',
33
+ required: false,
34
+ }),
35
+ acctNbr: Property.ShortText({
36
+ displayName: 'Account Number',
37
+ required: true,
38
+ }),
39
+ },
40
+ async run(context) {
41
+ const auth = context.auth as any;
42
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
43
+
44
+ const response = await httpClient.sendRequest({
45
+ method: HttpMethod.GET,
46
+ url: `${auth.baseUrl}/IBSLNACCT/v4/accounts/${context.propsValue.acctNbr}`,
47
+ headers,
48
+ });
49
+ return response.body;
50
+ },
51
+ });
52
+
53
+ export const loan_create_account = createAction({
54
+ auth: fisIbsAuth,
55
+ name: 'loan_create_account',
56
+ displayName: 'Loan - Create Account',
57
+ description: 'Create a new loan account',
58
+ props: {
59
+ ibsAuthorization: Property.ShortText({
60
+ displayName: 'IBS Authorization',
61
+ required: false,
62
+ }),
63
+ accountData: Property.Object({
64
+ displayName: 'Account Data',
65
+ required: true,
66
+ }),
67
+ },
68
+ async run(context) {
69
+ const auth = context.auth as any;
70
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
71
+
72
+ const response = await httpClient.sendRequest({
73
+ method: HttpMethod.POST,
74
+ url: `${auth.baseUrl}/IBSLNACCT/v4/accounts`,
75
+ headers,
76
+ body: context.propsValue.accountData,
77
+ });
78
+ return response.body;
79
+ },
80
+ });
81
+
82
+ export const loan_update_account = createAction({
83
+ auth: fisIbsAuth,
84
+ name: 'loan_update_account',
85
+ displayName: 'Loan - Update Account',
86
+ description: 'Update a loan account',
87
+ props: {
88
+ ibsAuthorization: Property.ShortText({
89
+ displayName: 'IBS Authorization',
90
+ required: false,
91
+ }),
92
+ acctNbr: Property.ShortText({
93
+ displayName: 'Account Number',
94
+ required: true,
95
+ }),
96
+ accountData: Property.Object({
97
+ displayName: 'Account Data',
98
+ required: true,
99
+ }),
100
+ },
101
+ async run(context) {
102
+ const auth = context.auth as any;
103
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
104
+
105
+ const response = await httpClient.sendRequest({
106
+ method: HttpMethod.PUT,
107
+ url: `${auth.baseUrl}/IBSLNACCT/v4/accounts/${context.propsValue.acctNbr}`,
108
+ headers,
109
+ body: context.propsValue.accountData,
110
+ });
111
+ return response.body;
112
+ },
113
+ });
114
+
115
+ // ============================================
116
+ // IBS-Loan-Notes.json
117
+ // ============================================
118
+
119
+ export const loan_get_notes = createAction({
120
+ auth: fisIbsAuth,
121
+ name: 'loan_get_notes',
122
+ displayName: 'Loan - Get Notes',
123
+ description: 'Retrieve loan notes',
124
+ props: {
125
+ ibsAuthorization: Property.ShortText({
126
+ displayName: 'IBS Authorization',
127
+ required: false,
128
+ }),
129
+ acctNbr: Property.ShortText({
130
+ displayName: 'Account Number',
131
+ required: true,
132
+ }),
133
+ },
134
+ async run(context) {
135
+ const auth = context.auth as any;
136
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
137
+
138
+ const response = await httpClient.sendRequest({
139
+ method: HttpMethod.GET,
140
+ url: `${auth.baseUrl}/IBSLNNOTE/v4/accounts/${context.propsValue.acctNbr}/notes`,
141
+ headers,
142
+ });
143
+ return response.body;
144
+ },
145
+ });
146
+
147
+ export const loan_create_note = createAction({
148
+ auth: fisIbsAuth,
149
+ name: 'loan_create_note',
150
+ displayName: 'Loan - Create Note',
151
+ description: 'Create a new loan note',
152
+ props: {
153
+ ibsAuthorization: Property.ShortText({
154
+ displayName: 'IBS Authorization',
155
+ required: false,
156
+ }),
157
+ acctNbr: Property.ShortText({
158
+ displayName: 'Account Number',
159
+ required: true,
160
+ }),
161
+ noteData: Property.Object({
162
+ displayName: 'Note Data',
163
+ required: true,
164
+ }),
165
+ },
166
+ async run(context) {
167
+ const auth = context.auth as any;
168
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
169
+
170
+ const response = await httpClient.sendRequest({
171
+ method: HttpMethod.POST,
172
+ url: `${auth.baseUrl}/IBSLNNOTE/v4/accounts/${context.propsValue.acctNbr}/notes`,
173
+ headers,
174
+ body: context.propsValue.noteData,
175
+ });
176
+ return response.body;
177
+ },
178
+ });
179
+
180
+ export const loan_get_note_balances = createAction({
181
+ auth: fisIbsAuth,
182
+ name: 'loan_get_note_balances',
183
+ displayName: 'Loan - Get Note Balances',
184
+ description: 'Retrieve loan note balances',
185
+ props: {
186
+ ibsAuthorization: Property.ShortText({
187
+ displayName: 'IBS Authorization',
188
+ required: false,
189
+ }),
190
+ acctNbr: Property.ShortText({
191
+ displayName: 'Account Number',
192
+ required: true,
193
+ }),
194
+ noteNbr: Property.ShortText({
195
+ displayName: 'Note Number',
196
+ required: true,
197
+ }),
198
+ },
199
+ async run(context) {
200
+ const auth = context.auth as any;
201
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
202
+
203
+ const response = await httpClient.sendRequest({
204
+ method: HttpMethod.GET,
205
+ url: `${auth.baseUrl}/IBSLNNOTE/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/balances`,
206
+ headers,
207
+ });
208
+ return response.body;
209
+ },
210
+ });
211
+
212
+ export const loan_renew_note = createAction({
213
+ auth: fisIbsAuth,
214
+ name: 'loan_renew_note',
215
+ displayName: 'Loan - Renew Note',
216
+ description: 'Renew a loan note',
217
+ props: {
218
+ ibsAuthorization: Property.ShortText({
219
+ displayName: 'IBS Authorization',
220
+ required: false,
221
+ }),
222
+ acctNbr: Property.ShortText({
223
+ displayName: 'Account Number',
224
+ required: true,
225
+ }),
226
+ noteNbr: Property.ShortText({
227
+ displayName: 'Note Number',
228
+ required: true,
229
+ }),
230
+ renewalData: Property.Object({
231
+ displayName: 'Renewal Data',
232
+ required: true,
233
+ }),
234
+ },
235
+ async run(context) {
236
+ const auth = context.auth as any;
237
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
238
+
239
+ const response = await httpClient.sendRequest({
240
+ method: HttpMethod.POST,
241
+ url: `${auth.baseUrl}/IBSLNNOTE/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/renewals`,
242
+ headers,
243
+ body: context.propsValue.renewalData,
244
+ });
245
+ return response.body;
246
+ },
247
+ });
248
+
249
+ export const loan_increase_note = createAction({
250
+ auth: fisIbsAuth,
251
+ name: 'loan_increase_note',
252
+ displayName: 'Loan - Increase Note',
253
+ description: 'Increase a loan note amount',
254
+ props: {
255
+ ibsAuthorization: Property.ShortText({
256
+ displayName: 'IBS Authorization',
257
+ required: false,
258
+ }),
259
+ acctNbr: Property.ShortText({
260
+ displayName: 'Account Number',
261
+ required: true,
262
+ }),
263
+ noteNbr: Property.ShortText({
264
+ displayName: 'Note Number',
265
+ required: true,
266
+ }),
267
+ increaseData: Property.Object({
268
+ displayName: 'Increase Data',
269
+ required: true,
270
+ }),
271
+ },
272
+ async run(context) {
273
+ const auth = context.auth as any;
274
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
275
+
276
+ const response = await httpClient.sendRequest({
277
+ method: HttpMethod.POST,
278
+ url: `${auth.baseUrl}/IBSLNNOTE/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/increase`,
279
+ headers,
280
+ body: context.propsValue.increaseData,
281
+ });
282
+ return response.body;
283
+ },
284
+ });
285
+
286
+ // ============================================
287
+ // IBS-Loan-Payments.json
288
+ // ============================================
289
+
290
+ export const loan_get_payment_info = createAction({
291
+ auth: fisIbsAuth,
292
+ name: 'loan_get_payment_info',
293
+ displayName: 'Loan - Get Payment Info',
294
+ description: 'Retrieve loan payment information',
295
+ props: {
296
+ ibsAuthorization: Property.ShortText({
297
+ displayName: 'IBS Authorization',
298
+ required: false,
299
+ }),
300
+ acctNbr: Property.ShortText({
301
+ displayName: 'Account Number',
302
+ required: true,
303
+ }),
304
+ noteNbr: Property.ShortText({
305
+ displayName: 'Note Number',
306
+ required: true,
307
+ }),
308
+ },
309
+ async run(context) {
310
+ const auth = context.auth as any;
311
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
312
+
313
+ const response = await httpClient.sendRequest({
314
+ method: HttpMethod.GET,
315
+ url: `${auth.baseUrl}/IBSLNPMT/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/payments`,
316
+ headers,
317
+ });
318
+ return response.body;
319
+ },
320
+ });
321
+
322
+ export const loan_post_payment = createAction({
323
+ auth: fisIbsAuth,
324
+ name: 'loan_post_payment',
325
+ displayName: 'Loan - Post Payment',
326
+ description: 'Post a loan payment',
327
+ props: {
328
+ ibsAuthorization: Property.ShortText({
329
+ displayName: 'IBS Authorization',
330
+ required: false,
331
+ }),
332
+ acctNbr: Property.ShortText({
333
+ displayName: 'Account Number',
334
+ required: true,
335
+ }),
336
+ noteNbr: Property.ShortText({
337
+ displayName: 'Note Number',
338
+ required: true,
339
+ }),
340
+ paymentData: Property.Object({
341
+ displayName: 'Payment Data',
342
+ required: true,
343
+ }),
344
+ },
345
+ async run(context) {
346
+ const auth = context.auth as any;
347
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
348
+
349
+ const response = await httpClient.sendRequest({
350
+ method: HttpMethod.POST,
351
+ url: `${auth.baseUrl}/IBSLNPMT/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/payments`,
352
+ headers,
353
+ body: context.propsValue.paymentData,
354
+ });
355
+ return response.body;
356
+ },
357
+ });
358
+
359
+ export const loan_reverse_payment = createAction({
360
+ auth: fisIbsAuth,
361
+ name: 'loan_reverse_payment',
362
+ displayName: 'Loan - Reverse Payment',
363
+ description: 'Reverse a loan payment',
364
+ props: {
365
+ ibsAuthorization: Property.ShortText({
366
+ displayName: 'IBS Authorization',
367
+ required: false,
368
+ }),
369
+ acctNbr: Property.ShortText({
370
+ displayName: 'Account Number',
371
+ required: true,
372
+ }),
373
+ noteNbr: Property.ShortText({
374
+ displayName: 'Note Number',
375
+ required: true,
376
+ }),
377
+ reversalData: Property.Object({
378
+ displayName: 'Reversal Data',
379
+ required: true,
380
+ }),
381
+ },
382
+ async run(context) {
383
+ const auth = context.auth as any;
384
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
385
+
386
+ const response = await httpClient.sendRequest({
387
+ method: HttpMethod.POST,
388
+ url: `${auth.baseUrl}/IBSLNPMT/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/reversals`,
389
+ headers,
390
+ body: context.propsValue.reversalData,
391
+ });
392
+ return response.body;
393
+ },
394
+ });
395
+
396
+ // ============================================
397
+ // IBS-Loan-Collateral.json
398
+ // ============================================
399
+
400
+ export const loan_get_collateral = createAction({
401
+ auth: fisIbsAuth,
402
+ name: 'loan_get_collateral',
403
+ displayName: 'Loan - Get Collateral',
404
+ description: 'Retrieve loan collateral information',
405
+ props: {
406
+ ibsAuthorization: Property.ShortText({
407
+ displayName: 'IBS Authorization',
408
+ required: false,
409
+ }),
410
+ acctNbr: Property.ShortText({
411
+ displayName: 'Account Number',
412
+ required: true,
413
+ }),
414
+ noteNbr: Property.ShortText({
415
+ displayName: 'Note Number',
416
+ required: true,
417
+ }),
418
+ },
419
+ async run(context) {
420
+ const auth = context.auth as any;
421
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
422
+
423
+ const response = await httpClient.sendRequest({
424
+ method: HttpMethod.GET,
425
+ url: `${auth.baseUrl}/IBSLNCOLL/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/multiple-collateral`,
426
+ headers,
427
+ });
428
+ return response.body;
429
+ },
430
+ });
431
+
432
+ export const loan_create_collateral = createAction({
433
+ auth: fisIbsAuth,
434
+ name: 'loan_create_collateral',
435
+ displayName: 'Loan - Create Collateral',
436
+ description: 'Add collateral to a loan note',
437
+ props: {
438
+ ibsAuthorization: Property.ShortText({
439
+ displayName: 'IBS Authorization',
440
+ required: false,
441
+ }),
442
+ acctNbr: Property.ShortText({
443
+ displayName: 'Account Number',
444
+ required: true,
445
+ }),
446
+ noteNbr: Property.ShortText({
447
+ displayName: 'Note Number',
448
+ required: true,
449
+ }),
450
+ collateralData: Property.Object({
451
+ displayName: 'Collateral Data',
452
+ required: true,
453
+ }),
454
+ },
455
+ async run(context) {
456
+ const auth = context.auth as any;
457
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
458
+
459
+ const response = await httpClient.sendRequest({
460
+ method: HttpMethod.POST,
461
+ url: `${auth.baseUrl}/IBSLNCOLL/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/collateral`,
462
+ headers,
463
+ body: context.propsValue.collateralData,
464
+ });
465
+ return response.body;
466
+ },
467
+ });
468
+
469
+ export const loan_update_collateral = createAction({
470
+ auth: fisIbsAuth,
471
+ name: 'loan_update_collateral',
472
+ displayName: 'Loan - Update Collateral',
473
+ description: 'Update loan collateral',
474
+ props: {
475
+ ibsAuthorization: Property.ShortText({
476
+ displayName: 'IBS Authorization',
477
+ required: false,
478
+ }),
479
+ acctNbr: Property.ShortText({
480
+ displayName: 'Account Number',
481
+ required: true,
482
+ }),
483
+ noteNbr: Property.ShortText({
484
+ displayName: 'Note Number',
485
+ required: true,
486
+ }),
487
+ seqNbr: Property.ShortText({
488
+ displayName: 'Sequence Number',
489
+ required: true,
490
+ }),
491
+ collateralData: Property.Object({
492
+ displayName: 'Collateral Data',
493
+ required: true,
494
+ }),
495
+ },
496
+ async run(context) {
497
+ const auth = context.auth as any;
498
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
499
+
500
+ const response = await httpClient.sendRequest({
501
+ method: HttpMethod.PUT,
502
+ url: `${auth.baseUrl}/IBSLNCOLL/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/collateral/${context.propsValue.seqNbr}`,
503
+ headers,
504
+ body: context.propsValue.collateralData,
505
+ });
506
+ return response.body;
507
+ },
508
+ });
509
+
510
+ export const loan_delete_collateral = createAction({
511
+ auth: fisIbsAuth,
512
+ name: 'loan_delete_collateral',
513
+ displayName: 'Loan - Delete Collateral',
514
+ description: 'Remove collateral from a loan note',
515
+ props: {
516
+ ibsAuthorization: Property.ShortText({
517
+ displayName: 'IBS Authorization',
518
+ required: false,
519
+ }),
520
+ acctNbr: Property.ShortText({
521
+ displayName: 'Account Number',
522
+ required: true,
523
+ }),
524
+ noteNbr: Property.ShortText({
525
+ displayName: 'Note Number',
526
+ required: true,
527
+ }),
528
+ seqNbr: Property.ShortText({
529
+ displayName: 'Sequence Number',
530
+ required: true,
531
+ }),
532
+ },
533
+ async run(context) {
534
+ const auth = context.auth as any;
535
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
536
+
537
+ const response = await httpClient.sendRequest({
538
+ method: HttpMethod.DELETE,
539
+ url: `${auth.baseUrl}/IBSLNCOLL/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/collateral/${context.propsValue.seqNbr}`,
540
+ headers,
541
+ });
542
+ return response.body;
543
+ },
544
+ });
545
+
546
+ // ============================================
547
+ // IBS-Loan-Fees.json
548
+ // ============================================
549
+
550
+ export const loan_get_fees = createAction({
551
+ auth: fisIbsAuth,
552
+ name: 'loan_get_fees',
553
+ displayName: 'Loan - Get Fees',
554
+ description: 'Retrieve loan fee information',
555
+ props: {
556
+ ibsAuthorization: Property.ShortText({
557
+ displayName: 'IBS Authorization',
558
+ required: false,
559
+ }),
560
+ acctNbr: Property.ShortText({
561
+ displayName: 'Account Number',
562
+ required: true,
563
+ }),
564
+ noteNbr: Property.ShortText({
565
+ displayName: 'Note Number',
566
+ required: true,
567
+ }),
568
+ },
569
+ async run(context) {
570
+ const auth = context.auth as any;
571
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
572
+
573
+ const response = await httpClient.sendRequest({
574
+ method: HttpMethod.GET,
575
+ url: `${auth.baseUrl}/IBSLNFEE/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/fees`,
576
+ headers,
577
+ });
578
+ return response.body;
579
+ },
580
+ });
581
+
582
+ export const loan_create_fee = createAction({
583
+ auth: fisIbsAuth,
584
+ name: 'loan_create_fee',
585
+ displayName: 'Loan - Create Fee',
586
+ description: 'Add a fee to a loan note',
587
+ props: {
588
+ ibsAuthorization: Property.ShortText({
589
+ displayName: 'IBS Authorization',
590
+ required: false,
591
+ }),
592
+ acctNbr: Property.ShortText({
593
+ displayName: 'Account Number',
594
+ required: true,
595
+ }),
596
+ noteNbr: Property.ShortText({
597
+ displayName: 'Note Number',
598
+ required: true,
599
+ }),
600
+ feeData: Property.Object({
601
+ displayName: 'Fee Data',
602
+ required: true,
603
+ }),
604
+ },
605
+ async run(context) {
606
+ const auth = context.auth as any;
607
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
608
+
609
+ const response = await httpClient.sendRequest({
610
+ method: HttpMethod.POST,
611
+ url: `${auth.baseUrl}/IBSLNFEE/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/fees`,
612
+ headers,
613
+ body: context.propsValue.feeData,
614
+ });
615
+ return response.body;
616
+ },
617
+ });
618
+
619
+ // ============================================
620
+ // IBS-Loan-Payoffs.json
621
+ // ============================================
622
+
623
+ export const loan_get_payoff_quote = createAction({
624
+ auth: fisIbsAuth,
625
+ name: 'loan_get_payoff_quote',
626
+ displayName: 'Loan - Get Payoff Quote',
627
+ description: 'Get a payoff quote for a loan',
628
+ props: {
629
+ ibsAuthorization: Property.ShortText({
630
+ displayName: 'IBS Authorization',
631
+ required: false,
632
+ }),
633
+ acctNbr: Property.ShortText({
634
+ displayName: 'Account Number',
635
+ required: true,
636
+ }),
637
+ noteNbr: Property.ShortText({
638
+ displayName: 'Note Number',
639
+ required: true,
640
+ }),
641
+ payoffDate: Property.ShortText({
642
+ displayName: 'Payoff Date',
643
+ description: 'YYYY-MM-DD format',
644
+ required: false,
645
+ }),
646
+ },
647
+ async run(context) {
648
+ const auth = context.auth as any;
649
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
650
+
651
+ const params = new URLSearchParams();
652
+ if (context.propsValue.payoffDate) params.append('payoffDate', context.propsValue.payoffDate);
653
+
654
+ const queryString = params.toString();
655
+ const url = `${auth.baseUrl}/IBSLNPOFF/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/payoff-quote${queryString ? '?' + queryString : ''}`;
656
+
657
+ const response = await httpClient.sendRequest({
658
+ method: HttpMethod.GET,
659
+ url,
660
+ headers,
661
+ });
662
+ return response.body;
663
+ },
664
+ });
665
+
666
+ export const loan_payoff = createAction({
667
+ auth: fisIbsAuth,
668
+ name: 'loan_payoff',
669
+ displayName: 'Loan - Payoff',
670
+ description: 'Pay off a loan',
671
+ props: {
672
+ ibsAuthorization: Property.ShortText({
673
+ displayName: 'IBS Authorization',
674
+ required: false,
675
+ }),
676
+ acctNbr: Property.ShortText({
677
+ displayName: 'Account Number',
678
+ required: true,
679
+ }),
680
+ noteNbr: Property.ShortText({
681
+ displayName: 'Note Number',
682
+ required: true,
683
+ }),
684
+ payoffData: Property.Object({
685
+ displayName: 'Payoff Data',
686
+ required: true,
687
+ }),
688
+ },
689
+ async run(context) {
690
+ const auth = context.auth as any;
691
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
692
+
693
+ const response = await httpClient.sendRequest({
694
+ method: HttpMethod.POST,
695
+ url: `${auth.baseUrl}/IBSLNPOFF/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/payoff`,
696
+ headers,
697
+ body: context.propsValue.payoffData,
698
+ });
699
+ return response.body;
700
+ },
701
+ });
702
+
703
+ // ============================================
704
+ // IBS-Loan-Rate-Changes.json
705
+ // ============================================
706
+
707
+ export const loan_change_rate_immediate = createAction({
708
+ auth: fisIbsAuth,
709
+ name: 'loan_change_rate_immediate',
710
+ displayName: 'Loan - Change Rate (Immediate)',
711
+ description: 'Immediately change the interest rate on a loan',
712
+ props: {
713
+ ibsAuthorization: Property.ShortText({
714
+ displayName: 'IBS Authorization',
715
+ required: false,
716
+ }),
717
+ acctNbr: Property.ShortText({
718
+ displayName: 'Account Number',
719
+ required: true,
720
+ }),
721
+ noteNbr: Property.ShortText({
722
+ displayName: 'Note Number',
723
+ required: true,
724
+ }),
725
+ rateData: Property.Object({
726
+ displayName: 'Rate Data',
727
+ required: true,
728
+ }),
729
+ },
730
+ async run(context) {
731
+ const auth = context.auth as any;
732
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
733
+
734
+ const response = await httpClient.sendRequest({
735
+ method: HttpMethod.POST,
736
+ url: `${auth.baseUrl}/IBSLNRATE/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/rate-changes-immediate`,
737
+ headers,
738
+ body: context.propsValue.rateData,
739
+ });
740
+ return response.body;
741
+ },
742
+ });
743
+
744
+ export const loan_get_pending_rate_changes = createAction({
745
+ auth: fisIbsAuth,
746
+ name: 'loan_get_pending_rate_changes',
747
+ displayName: 'Loan - Get Pending Rate Changes',
748
+ description: 'Get pending rate changes for a loan',
749
+ props: {
750
+ ibsAuthorization: Property.ShortText({
751
+ displayName: 'IBS Authorization',
752
+ required: false,
753
+ }),
754
+ acctNbr: Property.ShortText({
755
+ displayName: 'Account Number',
756
+ required: true,
757
+ }),
758
+ noteNbr: Property.ShortText({
759
+ displayName: 'Note Number',
760
+ required: true,
761
+ }),
762
+ },
763
+ async run(context) {
764
+ const auth = context.auth as any;
765
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
766
+
767
+ const response = await httpClient.sendRequest({
768
+ method: HttpMethod.GET,
769
+ url: `${auth.baseUrl}/IBSLNRATE/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/rate-changes-pending`,
770
+ headers,
771
+ });
772
+ return response.body;
773
+ },
774
+ });
775
+
776
+ // ============================================
777
+ // IBS-Loan-Note-Transactions.json
778
+ // ============================================
779
+
780
+ export const loan_get_transactions = createAction({
781
+ auth: fisIbsAuth,
782
+ name: 'loan_get_transactions',
783
+ displayName: 'Loan - Get Transactions',
784
+ description: 'Get loan note transactions',
785
+ props: {
786
+ ibsAuthorization: Property.ShortText({
787
+ displayName: 'IBS Authorization',
788
+ required: false,
789
+ }),
790
+ acctNbr: Property.ShortText({
791
+ displayName: 'Account Number',
792
+ required: true,
793
+ }),
794
+ noteNbr: Property.ShortText({
795
+ displayName: 'Note Number',
796
+ required: true,
797
+ }),
798
+ },
799
+ async run(context) {
800
+ const auth = context.auth as any;
801
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
802
+
803
+ const response = await httpClient.sendRequest({
804
+ method: HttpMethod.GET,
805
+ url: `${auth.baseUrl}/IBSLNTRAN/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/transactions`,
806
+ headers,
807
+ });
808
+ return response.body;
809
+ },
810
+ });
811
+
812
+ export const loan_disburse = createAction({
813
+ auth: fisIbsAuth,
814
+ name: 'loan_disburse',
815
+ displayName: 'Loan - Disburse',
816
+ description: 'Disburse funds from a loan',
817
+ props: {
818
+ ibsAuthorization: Property.ShortText({
819
+ displayName: 'IBS Authorization',
820
+ required: false,
821
+ }),
822
+ acctNbr: Property.ShortText({
823
+ displayName: 'Account Number',
824
+ required: true,
825
+ }),
826
+ noteNbr: Property.ShortText({
827
+ displayName: 'Note Number',
828
+ required: true,
829
+ }),
830
+ disbursementData: Property.Object({
831
+ displayName: 'Disbursement Data',
832
+ required: true,
833
+ }),
834
+ },
835
+ async run(context) {
836
+ const auth = context.auth as any;
837
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
838
+
839
+ const response = await httpClient.sendRequest({
840
+ method: HttpMethod.POST,
841
+ url: `${auth.baseUrl}/IBSLNTRAN/v4/accounts/${context.propsValue.acctNbr}/notes/${context.propsValue.noteNbr}/disbursement`,
842
+ headers,
843
+ body: context.propsValue.disbursementData,
844
+ });
845
+ return response.body;
846
+ },
847
+ });
848
+
849
+ // ============================================
850
+ // IBS-Loan-Boarding.json
851
+ // ============================================
852
+
853
+ export const loan_board = createAction({
854
+ auth: fisIbsAuth,
855
+ name: 'loan_board',
856
+ displayName: 'Loan - Board Loan',
857
+ description: 'Board a new loan into the system',
858
+ props: {
859
+ ibsAuthorization: Property.ShortText({
860
+ displayName: 'IBS Authorization',
861
+ required: false,
862
+ }),
863
+ loanData: Property.Object({
864
+ displayName: 'Loan Data',
865
+ required: true,
866
+ }),
867
+ },
868
+ async run(context) {
869
+ const auth = context.auth as any;
870
+ const headers = buildHeaders(auth, context.propsValue.ibsAuthorization);
871
+
872
+ const response = await httpClient.sendRequest({
873
+ method: HttpMethod.POST,
874
+ url: `${auth.baseUrl}/IBSLNBOARD/v4/loans`,
875
+ headers,
876
+ body: context.propsValue.loanData,
877
+ });
878
+ return response.body;
879
+ },
880
+ });
881
+
882
+ // Export all loan actions
883
+ export const loanActions = [
884
+ // Account Management
885
+ loan_get_account,
886
+ loan_create_account,
887
+ loan_update_account,
888
+
889
+ // Notes
890
+ loan_get_notes,
891
+ loan_create_note,
892
+ loan_get_note_balances,
893
+ loan_renew_note,
894
+ loan_increase_note,
895
+
896
+ // Payments
897
+ loan_get_payment_info,
898
+ loan_post_payment,
899
+ loan_reverse_payment,
900
+
901
+ // Collateral
902
+ loan_get_collateral,
903
+ loan_create_collateral,
904
+ loan_update_collateral,
905
+ loan_delete_collateral,
906
+
907
+ // Fees
908
+ loan_get_fees,
909
+ loan_create_fee,
910
+
911
+ // Payoffs
912
+ loan_get_payoff_quote,
913
+ loan_payoff,
914
+
915
+ // Rate Changes
916
+ loan_change_rate_immediate,
917
+ loan_get_pending_rate_changes,
918
+
919
+ // Transactions
920
+ loan_get_transactions,
921
+ loan_disburse,
922
+
923
+ // Boarding
924
+ loan_board,
925
+ ];