cat-documents-ng 1.0.27 → 1.0.28
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/Shared/constant/URLS.d.ts +2 -0
- package/fesm2022/cat-documents-ng.mjs +78 -88
- package/fesm2022/cat-documents-ng.mjs.map +1 -1
- package/lib/document/services/document-http.service.d.ts +12 -0
- package/lib/document/services/document-upload-business.service.d.ts +8 -0
- package/lib/document/services/document-upload-data.service.d.ts +8 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import * as i6 from '@angular/common';
|
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import { firstValueFrom, EMPTY, tap, catchError, throwError, of, combineLatest, Subject, Observable, takeUntil, Subscription, debounceTime as debounceTime$1, distinctUntilChanged as distinctUntilChanged$1, BehaviorSubject } from 'rxjs';
|
|
6
6
|
import * as i2 from '@angular/common/http';
|
|
7
|
-
import {
|
|
7
|
+
import { HttpParams, HttpHeaders, HttpClientModule } from '@angular/common/http';
|
|
8
8
|
import { __decorate } from 'tslib';
|
|
9
9
|
import { EntityStore, StoreConfig, QueryEntity } from '@datorama/akita';
|
|
10
10
|
import { debounceTime, distinctUntilChanged, switchMap, map, catchError as catchError$1 } from 'rxjs/operators';
|
|
@@ -1106,6 +1106,8 @@ class URLS {
|
|
|
1106
1106
|
static DOCUMENT_REQUEST = "documents/requestDocument";
|
|
1107
1107
|
static VALUATION_REPORT = "valuationReport/";
|
|
1108
1108
|
static CONVERT_TO_PDF = "documents/convert-email-to-pdf";
|
|
1109
|
+
static BROKER_DOCUMENT_CATAGORIES = "documentTypes/getAllCategoriesForBrokerBySource/";
|
|
1110
|
+
static BROKER_DOCUMENT_TYPES = "documentTypes/getAllDocumentTypesForBrokerByCategoryId/";
|
|
1109
1111
|
}
|
|
1110
1112
|
|
|
1111
1113
|
/**
|
|
@@ -1421,10 +1423,7 @@ class DocumentHttpService {
|
|
|
1421
1423
|
getFoldersData(contextId) {
|
|
1422
1424
|
if (!contextId)
|
|
1423
1425
|
return EMPTY;
|
|
1424
|
-
|
|
1425
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1426
|
-
});
|
|
1427
|
-
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}${URLS.FOLDERS}${contextId}`, { headers }).pipe(tap((folders) => {
|
|
1426
|
+
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}${URLS.FOLDERS}${contextId}`).pipe(tap((folders) => {
|
|
1428
1427
|
this.documentStore.setFolders(folders);
|
|
1429
1428
|
}), catchError((error) => {
|
|
1430
1429
|
return throwError(() => new Error(error));
|
|
@@ -1437,10 +1436,7 @@ class DocumentHttpService {
|
|
|
1437
1436
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1438
1437
|
*/
|
|
1439
1438
|
getDocumentCatagories(contextId) {
|
|
1440
|
-
|
|
1441
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1442
|
-
});
|
|
1443
|
-
return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`, { headers })
|
|
1439
|
+
return this.http.get(`${this.apiUrl}${URLS.DOCUMENTS_CATAGORIES}/${contextId}`)
|
|
1444
1440
|
.pipe(tap((response) => {
|
|
1445
1441
|
if (response && response.categories) {
|
|
1446
1442
|
this.documentStore.setDocumentCategories(response.categories);
|
|
@@ -1470,10 +1466,7 @@ class DocumentHttpService {
|
|
|
1470
1466
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1471
1467
|
*/
|
|
1472
1468
|
getAlertsByDocumentID(documentId) {
|
|
1473
|
-
|
|
1474
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1475
|
-
});
|
|
1476
|
-
return this.http.get(`${this.apiUrl}${URLS.ALERT_BY_DOCUMENT_ID}${documentId}`, { headers }).pipe(tap((documentAlert) => {
|
|
1469
|
+
return this.http.get(`${this.apiUrl}${URLS.ALERT_BY_DOCUMENT_ID}${documentId}`).pipe(tap((documentAlert) => {
|
|
1477
1470
|
this.documentStore.setDocumentAlert(documentAlert);
|
|
1478
1471
|
}), catchError((error) => {
|
|
1479
1472
|
return throwError(() => new Error(error));
|
|
@@ -1486,10 +1479,7 @@ class DocumentHttpService {
|
|
|
1486
1479
|
* @returns {Observable<any>} Observable that emits the transformed data for dropdown options.
|
|
1487
1480
|
*/
|
|
1488
1481
|
getDocumentByFolderID(folderId, contextId) {
|
|
1489
|
-
|
|
1490
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1491
|
-
});
|
|
1492
|
-
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${URLS.PARENT_DOCUMENT_TYPE_ID}${folderId}${URLS.CONTEXT_ID}${contextId}`, { headers }).pipe(tap((records) => {
|
|
1482
|
+
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD}/${URLS.PARENT_DOCUMENT_TYPE_ID}${folderId}${URLS.CONTEXT_ID}${contextId}`).pipe(tap((records) => {
|
|
1493
1483
|
this.documentStore.set(records);
|
|
1494
1484
|
}), catchError((error) => {
|
|
1495
1485
|
return throwError(() => new Error(error));
|
|
@@ -1504,10 +1494,7 @@ class DocumentHttpService {
|
|
|
1504
1494
|
* @returns {Observable<DocumentModel>} An observable that emits the updated DocumentModel.
|
|
1505
1495
|
*/
|
|
1506
1496
|
updateDocumentName(documentId, payload) {
|
|
1507
|
-
|
|
1508
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1509
|
-
});
|
|
1510
|
-
return this.http.put(`${this.apiUrl}${URLS.ALIAS_NAME}${documentId}`, payload, { headers }).pipe(catchError((error) => {
|
|
1497
|
+
return this.http.put(`${this.apiUrl}${URLS.ALIAS_NAME}${documentId}`, payload).pipe(catchError((error) => {
|
|
1511
1498
|
return throwError(() => new Error(error));
|
|
1512
1499
|
}));
|
|
1513
1500
|
}
|
|
@@ -1519,10 +1506,7 @@ class DocumentHttpService {
|
|
|
1519
1506
|
getUserListByContextId(contextId) {
|
|
1520
1507
|
if (!contextId)
|
|
1521
1508
|
return EMPTY;
|
|
1522
|
-
|
|
1523
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1524
|
-
});
|
|
1525
|
-
return this.http.get(`${this.apiUrl}${URLS.USERLIST}${contextId}`, { headers }).pipe(tap((userList) => {
|
|
1509
|
+
return this.http.get(`${this.apiUrl}${URLS.USERLIST}${contextId}`).pipe(tap((userList) => {
|
|
1526
1510
|
this.documentStore.setUserList(userList);
|
|
1527
1511
|
}), catchError((error) => {
|
|
1528
1512
|
return throwError(() => new Error(error));
|
|
@@ -1538,9 +1522,6 @@ class DocumentHttpService {
|
|
|
1538
1522
|
getStatusDocumentCount(applicationId, contextId = null, categoryId = null) {
|
|
1539
1523
|
if (!applicationId)
|
|
1540
1524
|
return EMPTY;
|
|
1541
|
-
let headers = new HttpHeaders({
|
|
1542
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1543
|
-
});
|
|
1544
1525
|
let url = `${this.apiUrl}${URLS.STATUS_DOCUMENT_COUNT}${applicationId}`;
|
|
1545
1526
|
let params = new HttpParams();
|
|
1546
1527
|
const contextParam = contextId || null;
|
|
@@ -1550,7 +1531,7 @@ class DocumentHttpService {
|
|
|
1550
1531
|
if (categoryId) {
|
|
1551
1532
|
params = params.set(SHARED.CATEGORY, categoryId);
|
|
1552
1533
|
}
|
|
1553
|
-
return this.http.get(url, { params
|
|
1534
|
+
return this.http.get(url, { params }).pipe(tap((statusData) => {
|
|
1554
1535
|
this.documentStore.setStatusData(statusData);
|
|
1555
1536
|
}), catchError((error) => {
|
|
1556
1537
|
return throwError(() => new Error(error));
|
|
@@ -1568,9 +1549,6 @@ class DocumentHttpService {
|
|
|
1568
1549
|
* @returns {Observable<any>} An observable that emits the filtered document data.
|
|
1569
1550
|
*/
|
|
1570
1551
|
getDocumentsBySelection(contextId, menuItem, userId, status, searchKey = null) {
|
|
1571
|
-
let headers = new HttpHeaders({
|
|
1572
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1573
|
-
});
|
|
1574
1552
|
let params = new HttpParams();
|
|
1575
1553
|
if (userId) {
|
|
1576
1554
|
params = params.set(SHARED.CONTEXT_ID, userId);
|
|
@@ -1581,7 +1559,7 @@ class DocumentHttpService {
|
|
|
1581
1559
|
if (searchKey) {
|
|
1582
1560
|
params = params.set(SHARED.SEARCH_KEY, searchKey);
|
|
1583
1561
|
}
|
|
1584
|
-
return this.http.get(`${this.apiUrl}${URLS.GETALL}/${contextId}`, { params
|
|
1562
|
+
return this.http.get(`${this.apiUrl}${URLS.GETALL}/${contextId}`, { params }).pipe(tap((response) => {
|
|
1585
1563
|
if (response.documents) {
|
|
1586
1564
|
this.documentStore.setDocumentList(response.documents);
|
|
1587
1565
|
}
|
|
@@ -1593,10 +1571,7 @@ class DocumentHttpService {
|
|
|
1593
1571
|
if (!documentId) {
|
|
1594
1572
|
return of([]);
|
|
1595
1573
|
}
|
|
1596
|
-
|
|
1597
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1598
|
-
});
|
|
1599
|
-
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_HISTORY}${documentId}`, { headers }).pipe(catchError((error) => {
|
|
1574
|
+
return this.http.get(`${this.apiUrl}${URLS.DOCUMENT_HISTORY}${documentId}`).pipe(catchError((error) => {
|
|
1600
1575
|
return throwError(() => new Error(error));
|
|
1601
1576
|
}));
|
|
1602
1577
|
}
|
|
@@ -1608,10 +1583,31 @@ class DocumentHttpService {
|
|
|
1608
1583
|
getCategoriesBySource(source) {
|
|
1609
1584
|
if (!source)
|
|
1610
1585
|
return EMPTY;
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
});
|
|
1614
|
-
|
|
1586
|
+
return this.http.get(`${this.apiUrl}${URLS.GET_CATEGORIES_BY_SOURCE}${source}`).pipe(catchError((error) => {
|
|
1587
|
+
return throwError(() => new Error(error));
|
|
1588
|
+
}));
|
|
1589
|
+
}
|
|
1590
|
+
/**
|
|
1591
|
+
* Fetches broker document categories by source.
|
|
1592
|
+
* @param {string} source - The source type (Broker).
|
|
1593
|
+
* @returns {Observable<DocumentCategory[]>} Observable that emits the categories.
|
|
1594
|
+
*/
|
|
1595
|
+
getBrokerDocumentCatagoriesBySource(source) {
|
|
1596
|
+
if (!source)
|
|
1597
|
+
return EMPTY;
|
|
1598
|
+
return this.http.get(`${this.apiUrl}${URLS.BROKER_DOCUMENT_CATAGORIES}${source}`).pipe(catchError((error) => {
|
|
1599
|
+
return throwError(() => new Error(error));
|
|
1600
|
+
}));
|
|
1601
|
+
}
|
|
1602
|
+
/**
|
|
1603
|
+
* Fetches broker document types by category ID.
|
|
1604
|
+
* @param {string} categoryId - The category ID to fetch document types for.
|
|
1605
|
+
* @returns {Observable<DocumentTypeModel[]>} Observable that emits the document types.
|
|
1606
|
+
*/
|
|
1607
|
+
getBrokerDocumentTypesByCategoryId(categoryId) {
|
|
1608
|
+
if (!categoryId)
|
|
1609
|
+
return EMPTY;
|
|
1610
|
+
return this.http.get(`${this.apiUrl}${URLS.BROKER_DOCUMENT_TYPES}${categoryId}`).pipe(catchError((error) => {
|
|
1615
1611
|
return throwError(() => new Error(error));
|
|
1616
1612
|
}));
|
|
1617
1613
|
}
|
|
@@ -1623,10 +1619,7 @@ class DocumentHttpService {
|
|
|
1623
1619
|
getDocumentTypesByCategory(categoryId) {
|
|
1624
1620
|
if (!categoryId)
|
|
1625
1621
|
return EMPTY;
|
|
1626
|
-
|
|
1627
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1628
|
-
});
|
|
1629
|
-
return this.http.get(`${this.apiUrl}${URLS.GET_DOCUMENT_TYPES_BY_CATEGORY}${categoryId}`, { headers }).pipe(catchError((error) => {
|
|
1622
|
+
return this.http.get(`${this.apiUrl}${URLS.GET_DOCUMENT_TYPES_BY_CATEGORY}${categoryId}`).pipe(catchError((error) => {
|
|
1630
1623
|
return throwError(() => new Error(error));
|
|
1631
1624
|
}));
|
|
1632
1625
|
}
|
|
@@ -1636,10 +1629,7 @@ class DocumentHttpService {
|
|
|
1636
1629
|
* @returns {Observable<any>} Observable that emits the upload response.
|
|
1637
1630
|
*/
|
|
1638
1631
|
uploadFile(formData) {
|
|
1639
|
-
|
|
1640
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1641
|
-
});
|
|
1642
|
-
return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD_FILE}`, formData, { headers }).pipe(catchError((error) => {
|
|
1632
|
+
return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_UPLOAD_FILE}`, formData).pipe(catchError((error) => {
|
|
1643
1633
|
return throwError(() => new Error(error));
|
|
1644
1634
|
}));
|
|
1645
1635
|
}
|
|
@@ -1649,10 +1639,7 @@ class DocumentHttpService {
|
|
|
1649
1639
|
* @returns {Observable<any>} Observable that emits the save response.
|
|
1650
1640
|
*/
|
|
1651
1641
|
saveDocumentUpload(payload) {
|
|
1652
|
-
|
|
1653
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1654
|
-
});
|
|
1655
|
-
return this.http.post(`${this.apiUrl}${URLS.SAVE_DOCUMENT_UPLOAD}`, payload, { headers }).pipe(catchError((error) => {
|
|
1642
|
+
return this.http.post(`${this.apiUrl}${URLS.SAVE_DOCUMENT_UPLOAD}`, payload).pipe(catchError((error) => {
|
|
1656
1643
|
return throwError(() => new Error(error));
|
|
1657
1644
|
}));
|
|
1658
1645
|
}
|
|
@@ -1667,10 +1654,7 @@ class DocumentHttpService {
|
|
|
1667
1654
|
const payload = {
|
|
1668
1655
|
statusUpdateDescription: statusUpdateDescription
|
|
1669
1656
|
};
|
|
1670
|
-
|
|
1671
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1672
|
-
});
|
|
1673
|
-
return this.http.put(`${this.apiUrl}${URLS.UPDATE_DOCUMENT_STATUS}${documentId}/${status}`, payload, { headers }).pipe(tap((response) => {
|
|
1657
|
+
return this.http.put(`${this.apiUrl}${URLS.UPDATE_DOCUMENT_STATUS}${documentId}/${status}`, payload).pipe(tap((response) => {
|
|
1674
1658
|
if (response && response.status) {
|
|
1675
1659
|
const normalizedStatus = this.normalizeStatus(response.status);
|
|
1676
1660
|
response.normalizedStatus = normalizedStatus;
|
|
@@ -1703,10 +1687,7 @@ class DocumentHttpService {
|
|
|
1703
1687
|
* @returns {Observable<any>} Observable that emits the delete response
|
|
1704
1688
|
*/
|
|
1705
1689
|
deleteDocument(documentId, contextId) {
|
|
1706
|
-
|
|
1707
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1708
|
-
});
|
|
1709
|
-
return this.http.delete(`${this.apiUrl}${URLS.DELETE_DOCUMENT}${documentId}`, { headers }).pipe(tap(() => {
|
|
1690
|
+
return this.http.delete(`${this.apiUrl}${URLS.DELETE_DOCUMENT}${documentId}`).pipe(tap(() => {
|
|
1710
1691
|
this.getDocumentCatagories(contextId).subscribe();
|
|
1711
1692
|
this.getUserListByContextId(contextId).subscribe();
|
|
1712
1693
|
this.getStatusDocumentCount(contextId).subscribe();
|
|
@@ -1722,10 +1703,7 @@ class DocumentHttpService {
|
|
|
1722
1703
|
* @returns {Observable<ArrayBuffer>} Observable that emits the file data as ArrayBuffer
|
|
1723
1704
|
*/
|
|
1724
1705
|
downloadExcelFile(documentUrl) {
|
|
1725
|
-
|
|
1726
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1727
|
-
});
|
|
1728
|
-
return this.http.get(documentUrl, { headers,
|
|
1706
|
+
return this.http.get(documentUrl, {
|
|
1729
1707
|
responseType: 'arraybuffer'
|
|
1730
1708
|
}).pipe(catchError((error) => {
|
|
1731
1709
|
return throwError(() => new Error(error));
|
|
@@ -1738,10 +1716,7 @@ class DocumentHttpService {
|
|
|
1738
1716
|
* @returns {Observable<string>} Observable that emits the file data as string
|
|
1739
1717
|
*/
|
|
1740
1718
|
downloadCsvFile(documentUrl) {
|
|
1741
|
-
|
|
1742
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1743
|
-
});
|
|
1744
|
-
return this.http.get(documentUrl, { headers,
|
|
1719
|
+
return this.http.get(documentUrl, {
|
|
1745
1720
|
responseType: 'text'
|
|
1746
1721
|
}).pipe(catchError((error) => {
|
|
1747
1722
|
return throwError(() => new Error(error));
|
|
@@ -1753,28 +1728,22 @@ class DocumentHttpService {
|
|
|
1753
1728
|
* @returns Observable of file content as text
|
|
1754
1729
|
*/
|
|
1755
1730
|
downloadEmailFile(documentUrl) {
|
|
1756
|
-
let headers = new HttpHeaders({
|
|
1757
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1758
|
-
});
|
|
1759
1731
|
const isAzureBlobStorage = documentUrl.includes('.blob.core.windows.net');
|
|
1760
1732
|
if (isAzureBlobStorage) {
|
|
1761
|
-
return this.http.get(documentUrl, {
|
|
1733
|
+
return this.http.get(documentUrl, {
|
|
1762
1734
|
responseType: 'text'
|
|
1763
1735
|
}).pipe(catchError((error) => {
|
|
1764
1736
|
return throwError(() => new Error('Failed to download email file. Please check if the file URL is valid and accessible.'));
|
|
1765
1737
|
}));
|
|
1766
1738
|
}
|
|
1767
1739
|
else {
|
|
1768
|
-
return this.http.get(documentUrl
|
|
1740
|
+
return this.http.get(documentUrl).pipe(catchError((error) => {
|
|
1769
1741
|
return throwError(() => new Error('Failed to download email file. Please check if the file URL is valid and accessible.'));
|
|
1770
1742
|
}));
|
|
1771
1743
|
}
|
|
1772
1744
|
}
|
|
1773
1745
|
documentRequest(payload) {
|
|
1774
|
-
|
|
1775
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1776
|
-
});
|
|
1777
|
-
return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_REQUEST}`, payload, { headers }).pipe(catchError((error) => {
|
|
1746
|
+
return this.http.post(`${this.apiUrl}${URLS.DOCUMENT_REQUEST}`, payload).pipe(catchError((error) => {
|
|
1778
1747
|
return throwError(() => new Error(error));
|
|
1779
1748
|
}));
|
|
1780
1749
|
}
|
|
@@ -1786,10 +1755,7 @@ class DocumentHttpService {
|
|
|
1786
1755
|
getValuationReportByContextId(contextId) {
|
|
1787
1756
|
if (!contextId)
|
|
1788
1757
|
return EMPTY;
|
|
1789
|
-
|
|
1790
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1791
|
-
});
|
|
1792
|
-
return this.http.get(`${this.apiUrl}${URLS.VALUATION_REPORT}${contextId}`, { headers }).pipe(catchError((error) => {
|
|
1758
|
+
return this.http.get(`${this.apiUrl}${URLS.VALUATION_REPORT}${contextId}`).pipe(catchError((error) => {
|
|
1793
1759
|
// Return empty object if no data found or error occurs
|
|
1794
1760
|
return of(null);
|
|
1795
1761
|
}));
|
|
@@ -1803,10 +1769,7 @@ class DocumentHttpService {
|
|
|
1803
1769
|
if (!documentUrl)
|
|
1804
1770
|
return EMPTY;
|
|
1805
1771
|
const payload = { documentUrl: documentUrl };
|
|
1806
|
-
|
|
1807
|
-
'Authorization': `Bearer 3def65bf-2dfc-466b-85a3-13cd1db0960e`
|
|
1808
|
-
});
|
|
1809
|
-
return this.http.post(`${this.apiUrl}${URLS.CONVERT_TO_PDF}`, payload, { headers,
|
|
1772
|
+
return this.http.post(`${this.apiUrl}${URLS.CONVERT_TO_PDF}`, payload, {
|
|
1810
1773
|
responseType: 'blob'
|
|
1811
1774
|
}).pipe(catchError((error) => {
|
|
1812
1775
|
return throwError(() => new Error(error?.message || 'Failed to convert email to PDF'));
|
|
@@ -3054,12 +3017,24 @@ class DocumentUploadBusinessService {
|
|
|
3054
3017
|
loadCategories(assignmentType) {
|
|
3055
3018
|
return this.documentHttpService.getCategoriesBySource(assignmentType);
|
|
3056
3019
|
}
|
|
3020
|
+
/**
|
|
3021
|
+
* Loads categories based on assignment type
|
|
3022
|
+
*/
|
|
3023
|
+
loadBrokerCategories(assignmentType) {
|
|
3024
|
+
return this.documentHttpService.getBrokerDocumentCatagoriesBySource(assignmentType);
|
|
3025
|
+
}
|
|
3057
3026
|
/**
|
|
3058
3027
|
* Loads document types based on category
|
|
3059
3028
|
*/
|
|
3060
3029
|
loadDocumentTypes(categoryId) {
|
|
3061
3030
|
return this.documentHttpService.getDocumentTypesByCategory(categoryId);
|
|
3062
3031
|
}
|
|
3032
|
+
/**
|
|
3033
|
+
* Loads broker document types based on category
|
|
3034
|
+
*/
|
|
3035
|
+
loadBrokerDocumentTypes(categoryId) {
|
|
3036
|
+
return this.documentHttpService.getBrokerDocumentTypesByCategoryId(categoryId);
|
|
3037
|
+
}
|
|
3063
3038
|
/**
|
|
3064
3039
|
* Filters applicants based on assignment type
|
|
3065
3040
|
*/
|
|
@@ -3396,6 +3371,21 @@ class DocumentUploadDataService {
|
|
|
3396
3371
|
}
|
|
3397
3372
|
return this.businessService.loadCategories(assignmentType);
|
|
3398
3373
|
}
|
|
3374
|
+
/**
|
|
3375
|
+
* Loads categories and handles the response
|
|
3376
|
+
*/
|
|
3377
|
+
loadBrokerCategories(assignmentType, onSuccess, onError) {
|
|
3378
|
+
if (!assignmentType) {
|
|
3379
|
+
return new Observable();
|
|
3380
|
+
}
|
|
3381
|
+
return this.businessService.loadBrokerCategories(assignmentType);
|
|
3382
|
+
}
|
|
3383
|
+
/**
|
|
3384
|
+
* Loads broker document types and handles the response
|
|
3385
|
+
*/
|
|
3386
|
+
loadBrokerDocumentTypes(categoryId, onSuccess, onError) {
|
|
3387
|
+
return this.businessService.loadBrokerDocumentTypes(categoryId);
|
|
3388
|
+
}
|
|
3399
3389
|
/**
|
|
3400
3390
|
* Loads document types and handles the response
|
|
3401
3391
|
*/
|
|
@@ -4158,14 +4148,14 @@ class RequestDocumentComponent {
|
|
|
4158
4148
|
}
|
|
4159
4149
|
loadCategories() {
|
|
4160
4150
|
this.isLoadingCategories = true;
|
|
4161
|
-
this.dataService.
|
|
4151
|
+
this.dataService.loadBrokerCategories(this.selectedAssignmentType, (categories) => this.handleCategoriesLoaded(categories), (error) => this.handleError('Failed to Load Categories', error, () => this.isLoadingCategories = false)).pipe(takeUntil(this.destroy$)).subscribe({
|
|
4162
4152
|
next: (categories) => this.handleCategoriesLoaded(categories),
|
|
4163
4153
|
error: (error) => this.handleError('Failed to Load Categories', error, () => this.isLoadingCategories = false)
|
|
4164
4154
|
});
|
|
4165
4155
|
}
|
|
4166
4156
|
loadDocumentTypes() {
|
|
4167
4157
|
this.isLoadingDocumentTypes = true;
|
|
4168
|
-
this.dataService.
|
|
4158
|
+
this.dataService.loadBrokerDocumentTypes(this.selectedCategory, (documentTypes) => this.handleDocumentTypesLoaded(documentTypes), (error) => this.handleError('Failed to Load Document Types', error, () => this.isLoadingDocumentTypes = false)).pipe(takeUntil(this.destroy$)).subscribe({
|
|
4169
4159
|
next: (documentTypes) => this.handleDocumentTypesLoaded(documentTypes),
|
|
4170
4160
|
error: (error) => this.handleError('Failed to Load Document Types', error, () => this.isLoadingDocumentTypes = false)
|
|
4171
4161
|
});
|