gemcap-be-common 1.3.8 → 1.3.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 (72) hide show
  1. package/db/new-summary.js +3 -3
  2. package/db/new-summary.ts +3 -3
  3. package/helpers/excel.helper.js +6 -2
  4. package/helpers/excel.helper.ts +19 -12
  5. package/package.json +1 -1
  6. package/public/emails/black_feather/broker-report.html +13 -0
  7. package/public/emails/black_feather/daily-updates.html +10 -0
  8. package/public/emails/black_feather/financial-external-on-stop.html +19 -0
  9. package/public/emails/black_feather/financial-external-until-stop_date.html +18 -0
  10. package/public/emails/black_feather/financial-internal.html +13 -0
  11. package/public/emails/black_feather/interest-statement-only-term.html +17 -0
  12. package/public/emails/black_feather/interest-statement.html +16 -0
  13. package/public/emails/black_feather/internal-inconsistent.html +13 -0
  14. package/public/emails/black_feather/loan-upload.html +9 -0
  15. package/public/emails/black_feather/notification.html +13 -0
  16. package/public/emails/black_feather/password-reset.html +29 -0
  17. package/public/emails/black_feather/plaid-reminder.html +24 -0
  18. package/public/emails/black_feather/prospect-form-reminder.html +16 -0
  19. package/public/emails/black_feather/prospect-form.html +17 -0
  20. package/public/emails/black_feather/signature-financial-only.html +48 -0
  21. package/public/emails/black_feather/signature-financial.html +55 -0
  22. package/public/emails/black_feather/signature-goat.html +21 -0
  23. package/public/emails/black_feather/signature.html +55 -0
  24. package/public/emails/black_feather/simple-mail.html +9 -0
  25. package/public/emails/broker-report.html +13 -0
  26. package/public/emails/daily-updates.html +10 -0
  27. package/public/emails/financial-external-on-stop.html +19 -0
  28. package/public/emails/financial-external-until-stop_date.html +18 -0
  29. package/public/emails/financial-internal.html +13 -0
  30. package/public/emails/gemcap/broker-report.html +13 -0
  31. package/public/emails/gemcap/daily-updates.html +10 -0
  32. package/public/emails/gemcap/financial-external-on-stop.html +19 -0
  33. package/public/emails/gemcap/financial-external-until-stop_date.html +18 -0
  34. package/public/emails/gemcap/financial-internal.html +13 -0
  35. package/public/emails/gemcap/interest-statement-only-term.html +17 -0
  36. package/public/emails/gemcap/interest-statement.html +18 -0
  37. package/public/emails/gemcap/internal-inconsistent.html +13 -0
  38. package/public/emails/gemcap/loan-upload.html +9 -0
  39. package/public/emails/gemcap/notification.html +13 -0
  40. package/public/emails/gemcap/password-reset.html +29 -0
  41. package/public/emails/gemcap/plaid-reminder.html +24 -0
  42. package/public/emails/gemcap/prospect-form-reminder.html +16 -0
  43. package/public/emails/gemcap/prospect-form.html +17 -0
  44. package/public/emails/gemcap/signature-financial-only.html +74 -0
  45. package/public/emails/gemcap/signature-financial.html +74 -0
  46. package/public/emails/gemcap/signature-goat.html +18 -0
  47. package/public/emails/gemcap/signature.html +74 -0
  48. package/public/emails/gemcap/simple-mail.html +9 -0
  49. package/public/emails/interest-statement-only-term.html +17 -0
  50. package/public/emails/interest-statement.html +18 -0
  51. package/public/emails/internal-inconsistent.html +13 -0
  52. package/public/emails/loan-upload.html +9 -0
  53. package/public/emails/notification.html +13 -0
  54. package/public/emails/password-reset.html +29 -0
  55. package/public/emails/plaid-reminder.html +24 -0
  56. package/public/emails/prospect-form-reminder.html +16 -0
  57. package/public/emails/prospect-form.html +17 -0
  58. package/public/emails/signature-financial-only.html +48 -0
  59. package/public/emails/signature-financial.html +55 -0
  60. package/public/emails/signature-goat.html +21 -0
  61. package/public/emails/signature.html +55 -0
  62. package/public/emails/simple-mail.html +9 -0
  63. package/public/images/black_feather/gradient.png +0 -0
  64. package/public/images/black_feather/logo.png +0 -0
  65. package/public/images/gemcap/gradient.png +0 -0
  66. package/public/images/gemcap/logo.png +0 -0
  67. package/public/images/plaid-reminder-instruction.png +0 -0
  68. package/public/plaid/connect.html +27 -0
  69. package/public/plaid/connect.js +64 -0
  70. package/services/loan-transactions.service.js +0 -2
  71. package/services/loan-transactions.service.ts +0 -2
  72. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,17 @@
1
+ <html lang="en">
2
+ <body>
3
+
4
+ <p>Dear ${CONTACT_NAME}</p>
5
+
6
+ <p>To advance your loan application, please complete the details in this link. The link is available for 10 days.
7
+ Anybody with this link can update the due diligence and application form during this period.</p>
8
+
9
+ <a href="${LINK}">${LINK}</a>
10
+
11
+ <p>We look forward to receiving your due diligence information and working with you. Failure to provide due diligence on
12
+ a timely basis will result in delays to your loan application being processed.</p>
13
+
14
+ ${signature}
15
+
16
+ </body>
17
+ </html>
@@ -0,0 +1,48 @@
1
+ <br>
2
+ <p>Regards,</p>
3
+ <br>
4
+
5
+ <table>
6
+ <tbody>
7
+ <tr>
8
+ <td>
9
+ <table>
10
+ <tbody>
11
+ <tr>
12
+ <td></td>
13
+ </tr>
14
+ <tr>
15
+ <td></td>
16
+ </tr>
17
+ <tr>
18
+ <td><span style="color: #321900; font-weight: bold">Finance Department</span></td>
19
+ </tr>
20
+ </tbody>
21
+ </table>
22
+
23
+ <table>
24
+ <tbody>
25
+ <tr>
26
+ <td><span style="color: #7d7f85; font-weight: bold">e:</span></td>
27
+ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;finance@blackfeatherfunding.com</td>
28
+ </tr>
29
+ </tbody>
30
+ </table>
31
+
32
+ <table>
33
+ <tbody>
34
+ <tr>
35
+ <td><span style="color: #7d7f85; font-weight: bold">The Lighter way to do Lending ™</span></td>
36
+ </tr>
37
+ <tr>
38
+ <td><span style="color: #7d7f85; font-weight: bold">2222 N Alamo St San Antonio, TX 78215</span></td>
39
+ </tr>
40
+ </tbody>
41
+ </table>
42
+ </td>
43
+ <td>
44
+ <img src="https://black-feather-public.s3.us-east-2.amazonaws.com/logo.png" alt="My Image">
45
+ </td>
46
+ </tr>
47
+ </tbody>
48
+ </table>
@@ -0,0 +1,55 @@
1
+ <br>
2
+ <p>Regards,</p>
3
+ <br>
4
+
5
+ <table>
6
+ <tbody>
7
+ <tr>
8
+ <td>
9
+ <table>
10
+ <tbody>
11
+ <tr>
12
+ <td><span style="color:#321900; font-weight: bold; font-size: 20.0pt">Scott Mills</span></td>
13
+ <td></td>
14
+ </tr>
15
+ <tr>
16
+ <td></td>
17
+ <td></td>
18
+ </tr>
19
+ <tr>
20
+ <td><span style="color: #321900; font-weight: bold">Chief Financial Officer</span></td>
21
+ <td></td>
22
+ </tr>
23
+ </tbody>
24
+ </table>
25
+
26
+ <table>
27
+ <tbody>
28
+ <tr>
29
+ <td><span style="color: #7d7f85; font-weight: bold">t:</span></td>
30
+ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;210.660.3326</td>
31
+ </tr>
32
+ <tr>
33
+ <td><span style="color: #7d7f85; font-weight: bold">e:</span></td>
34
+ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scott@blackfeatherfunding.com</td>
35
+ </tr>
36
+ </tbody>
37
+ </table>
38
+
39
+ <table>
40
+ <tbody>
41
+ <tr>
42
+ <td><span style="color: #7d7f85; font-weight: bold">The Lighter way to do Lending ™</span></td>
43
+ </tr>
44
+ <tr>
45
+ <td><span style="color: #7d7f85; font-weight: bold">2222 N Alamo St San Antonio, TX 78215</span></td>
46
+ </tr>
47
+ </tbody>
48
+ </table>
49
+ </td>
50
+ <td>
51
+ <img src="https://black-feather-public.s3.us-east-2.amazonaws.com/logo.png" alt="My Image">
52
+ </td>
53
+ </tr>
54
+ </tbody>
55
+ </table>
@@ -0,0 +1,21 @@
1
+ <br>
2
+
3
+ <table>
4
+ <tbody>
5
+ <tr>
6
+ <td>
7
+
8
+ <table>
9
+ <tbody>
10
+ <tr>
11
+ <td><span style="color: #7d7f85; font-weight: bold">The Lighter way to do Lending ™</span></td>
12
+ </tr>
13
+ </tbody>
14
+ </table>
15
+ </td>
16
+ <td>
17
+ <img src="https://black-feather-public.s3.us-east-2.amazonaws.com/logo.png" alt="My Image">
18
+ </td>
19
+ </tr>
20
+ </tbody>
21
+ </table>
@@ -0,0 +1,55 @@
1
+ <br>
2
+ <p>Regards,</p>
3
+ <br>
4
+
5
+ <table>
6
+ <tbody>
7
+ <tr>
8
+ <td>
9
+ <table>
10
+ <tbody>
11
+ <tr>
12
+ <td><span style="color:#321900; font-weight: bold; font-size: 20.0pt">Scott Mills</span></td>
13
+ <td></td>
14
+ </tr>
15
+ <tr>
16
+ <td></td>
17
+ <td></td>
18
+ </tr>
19
+ <tr>
20
+ <td><span style="color: #321900; font-weight: bold">Chief Compliance Officer</span></td>
21
+ <td></td>
22
+ </tr>
23
+ </tbody>
24
+ </table>
25
+
26
+ <table>
27
+ <tbody>
28
+ <tr>
29
+ <td><span style="color: #7d7f85; font-weight: bold">t:</span></td>
30
+ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;210.660.3326</td>
31
+ </tr>
32
+ <tr>
33
+ <td><span style="color: #7d7f85; font-weight: bold">e:</span></td>
34
+ <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scott@blackfeatherfunding.com</td>
35
+ </tr>
36
+ </tbody>
37
+ </table>
38
+
39
+ <table>
40
+ <tbody>
41
+ <tr>
42
+ <td><span style="color: #7d7f85; font-weight: bold">The Lighter way to do Lending ™</span></td>
43
+ </tr>
44
+ <tr>
45
+ <td><span style="color: #7d7f85; font-weight: bold">2222 N Alamo St San Antonio, TX 78215</span></td>
46
+ </tr>
47
+ </tbody>
48
+ </table>
49
+ </td>
50
+ <td>
51
+ <img src="https://black-feather-public.s3.us-east-2.amazonaws.com/logo.png" alt="My Image">
52
+ </td>
53
+ </tr>
54
+ </tbody>
55
+ </table>
@@ -0,0 +1,9 @@
1
+ <html lang="en">
2
+ <body>
3
+
4
+ ${emailText}
5
+
6
+ ${signature}
7
+
8
+ </body>
9
+ </html>
Binary file
@@ -0,0 +1,27 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8"/>
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <title>Connect your account to Plaid</title>
9
+ </head>
10
+ <body class="flex justify-center text-center">
11
+ <div class="flex flex-col w-96 m-6 bg-gray-200 rounded-lg m-6 p-3">
12
+ <a
13
+ class="bg-green-900 text-white rounded-lg p-5 inline-block drop-shadow-md m-3 opacity-50"
14
+ href="#"
15
+ id="startLink"
16
+ >Connect my bank</a>
17
+ <a
18
+ class="bg-blue-600 text-white rounded-lg p-5 inline-block drop-shadow-md m-3 hover:bg-blue-400"
19
+ href="#"
20
+ id="getBackLink"
21
+ >Go back</a>
22
+ <a class="underline hover:bg-gray-600" href="https://plaid.com/" target="_blank">About Plaid</a>
23
+ </div>
24
+ <script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>
25
+ <script src="connect.js"></script>
26
+ </body>
27
+ </html>
@@ -0,0 +1,64 @@
1
+ let linkTokenData;
2
+ let keycloakToken;
3
+ let borrowerId;
4
+ let redirectLink;
5
+
6
+ const initializeLink = async () => {
7
+ const linkTokenResponse = await fetch('/api/plaid/create_link_token');
8
+ linkTokenData = await linkTokenResponse.json();
9
+ if (linkTokenData.error) {
10
+ document.querySelector("#startLink").innerHTML = linkTokenData.message;
11
+ document.querySelector("#startLink").classList.remove('opacity-50');
12
+ document.querySelector("#startLink").classList.remove('bg-green-900');
13
+ document.querySelector("#startLink").classList.add('bg-red-600');
14
+ document.querySelector("#startLink").removeEventListener('click', startLink);
15
+ } else {
16
+ document.querySelector("#startLink").classList.remove('opacity-50');
17
+ document.querySelector("#startLink").classList.add('hover:bg-green-700');
18
+ }
19
+ };
20
+
21
+ const getBackLink = () => {
22
+ const url = new URL(window.location);
23
+ const searchParams = url.searchParams;
24
+ window.location.href = searchParams.get('redirectLink');
25
+ };
26
+
27
+ const startLink = () => {
28
+ if (linkTokenData === undefined) {
29
+ return;
30
+ }
31
+
32
+ const handler = Plaid.create({
33
+ token: linkTokenData.link_token,
34
+ onSuccess: async (publicToken) => await exchangeToken(publicToken, keycloakToken, borrowerId, redirectLink),
35
+ onExit: (err, metadata) => {
36
+ },
37
+ onEvent: (eventName) => {
38
+ },
39
+ });
40
+ handler.open();
41
+ };
42
+
43
+ const exchangeToken = async (publicToken, keycloakToken, borrowerId, redirectLink) => {
44
+ const url = new URL(window.location);
45
+ const searchParams = url.searchParams;
46
+ keycloakToken = searchParams.get('authorization');
47
+ borrowerId = searchParams.get('borrowerId');
48
+ redirectLink = searchParams.get('redirectLink');
49
+
50
+ await fetch(
51
+ '/api/plaid/exchange_public_token',
52
+ {
53
+ method: 'POST',
54
+ headers: { 'Content-type': 'application/json' },
55
+ body: JSON.stringify({ public_token: publicToken, keycloakToken, borrowerId }),
56
+ },
57
+ );
58
+ window.location.href = redirectLink;
59
+ }
60
+
61
+ document.querySelector("#startLink").addEventListener('click', startLink);
62
+ document.querySelector("#getBackLink").addEventListener('click', getBackLink);
63
+
64
+ initializeLink().then();
@@ -894,11 +894,9 @@ class LoanTransactionsService {
894
894
  const dailyTransactions = await this.getUnsentTransactionForDate(borrower._id.toString(), effectiveDate);
895
895
  const transactionIds = dailyTransactions.map((tr) => tr._id.toString());
896
896
  const { transactions, transactionIdsToMark, } = await this.getTransactionReport(transactionIds, borrower._id.toString(), effectiveDate);
897
- console.log(borrower.name, transactionIdsToMark.length);
898
897
  if (transactionIdsToMark.length === 0) {
899
898
  return;
900
899
  }
901
- console.log(borrower.name, '========> will be sent');
902
900
  const attachedFile = await this.uploadsService.convertDataToFile(transactions);
903
901
  const attachment = { filename: `${fileName}.xlsx`, content: attachedFile };
904
902
  const attachedPDFs = await this.attachedFilesService.getAttachedRealFilesByTransactionFileId(borrower._id.toString(), (0, dayjs_1.default)(effectiveDate).format('YYYY-MM-DD'));
@@ -995,11 +995,9 @@ export class LoanTransactionsService {
995
995
  transactions,
996
996
  transactionIdsToMark,
997
997
  } = await this.getTransactionReport(transactionIds, borrower._id.toString(), effectiveDate);
998
- console.log(borrower.name, transactionIdsToMark.length);
999
998
  if (transactionIdsToMark.length === 0) {
1000
999
  return;
1001
1000
  }
1002
- console.log(borrower.name, '========> will be sent');
1003
1001
  const attachedFile = await this.uploadsService.convertDataToFile(transactions);
1004
1002
  const attachment = { filename: `${fileName}.xlsx`, content: attachedFile };
1005
1003
  const attachedPDFs = await this.attachedFilesService.getAttachedRealFilesByTransactionFileId(borrower._id.toString(), dayjs(effectiveDate).format('YYYY-MM-DD'));