cat-documents-ng 0.2.54 → 0.2.56

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.
@@ -0,0 +1,47 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class CommonSidebarComponent {
4
+ visible: boolean;
5
+ position: 'left' | 'right';
6
+ width: string;
7
+ title: string;
8
+ showCloseButton: boolean;
9
+ modal: boolean;
10
+ dismissible: boolean;
11
+ closeOnEscape: boolean;
12
+ baseZIndex: number;
13
+ autoZIndex: boolean;
14
+ styleClass: string;
15
+ appendTo: string;
16
+ blockScroll: boolean;
17
+ closeIcon: string;
18
+ showSaveButton: boolean;
19
+ saveButtonText: string;
20
+ saveButtonDisabled: boolean;
21
+ visibleChange: EventEmitter<boolean>;
22
+ onShow: EventEmitter<void>;
23
+ onHide: EventEmitter<void>;
24
+ onSave: EventEmitter<void>;
25
+ /**
26
+ * Opens the sidebar
27
+ */
28
+ open(): void;
29
+ /**
30
+ * Closes the sidebar
31
+ */
32
+ close(): void;
33
+ /**
34
+ * Toggles the sidebar visibility
35
+ */
36
+ toggle(): void;
37
+ /**
38
+ * Handles the close button click
39
+ */
40
+ onCloseClick(): void;
41
+ /**
42
+ * Handles the mask click (when dismissible is true)
43
+ */
44
+ onMaskClick(): void;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<CommonSidebarComponent, never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<CommonSidebarComponent, "lib-common-sidebar", never, { "visible": { "alias": "visible"; "required": false; }; "position": { "alias": "position"; "required": false; }; "width": { "alias": "width"; "required": false; }; "title": { "alias": "title"; "required": false; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; }; "modal": { "alias": "modal"; "required": false; }; "dismissible": { "alias": "dismissible"; "required": false; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; }; "baseZIndex": { "alias": "baseZIndex"; "required": false; }; "autoZIndex": { "alias": "autoZIndex"; "required": false; }; "styleClass": { "alias": "styleClass"; "required": false; }; "appendTo": { "alias": "appendTo"; "required": false; }; "blockScroll": { "alias": "blockScroll"; "required": false; }; "closeIcon": { "alias": "closeIcon"; "required": false; }; "showSaveButton": { "alias": "showSaveButton"; "required": false; }; "saveButtonText": { "alias": "saveButtonText"; "required": false; }; "saveButtonDisabled": { "alias": "saveButtonDisabled"; "required": false; }; }, { "visibleChange": "visibleChange"; "onShow": "onShow"; "onHide": "onHide"; "onSave": "onSave"; }, never, ["[header]", "*"], false, never>;
47
+ }
@@ -89,6 +89,10 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
89
89
  * Completion counts for each category
90
90
  */
91
91
  categoryCompletionCounts: string[];
92
+ /**
93
+ * Getter to format category labels with proper suffix
94
+ */
95
+ get formattedCategoryLabels(): string[];
92
96
  /**
93
97
  * Creates an instance of DocumentListComponent.
94
98
  * @class
@@ -111,12 +115,6 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
111
115
  * @returns {void}
112
116
  */
113
117
  handleSaveClick(): void;
114
- /**
115
- * Handles the upload action for a document.
116
- * Validates if a document type is selected and logs the result.
117
- * @memberof DocumentListComponent
118
- */
119
- handleUploadDocument(): void;
120
118
  /**
121
119
  * Handles the visibility of the sidebar.
122
120
  * @param {boolean} isVisible - Indicates whether the sidebar should be visible or not.
@@ -130,7 +128,7 @@ export declare class DocumentListComponent implements OnInit, OnDestroy, OnChang
130
128
  /**
131
129
  * Sets up subscription to document list response from store
132
130
  */
133
- private setupDocumentListSubscription;
131
+ setupDocumentListSubscription(): void;
134
132
  /**
135
133
  * Handles table row click event
136
134
  */
@@ -1,11 +1,12 @@
1
- import { OnInit, OnDestroy } from '@angular/core';
1
+ import { OnInit, OnDestroy, EventEmitter } from '@angular/core';
2
2
  import { SHARED } from '../../../../Shared/constant/SHARED';
3
3
  import { DocumentHelperService } from '../../services/document.service';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class DocumentSearchComponent implements OnInit, OnDestroy {
6
6
  private documentHelperService;
7
7
  readonly SHARED: typeof SHARED;
8
- contextId?: string;
8
+ contextId: string;
9
+ onActionClick: EventEmitter<void>;
9
10
  searchTerm: string;
10
11
  private destroy$;
11
12
  constructor(documentHelperService: DocumentHelperService);
@@ -31,5 +32,5 @@ export declare class DocumentSearchComponent implements OnInit, OnDestroy {
31
32
  onClearSearch(): void;
32
33
  private searchSubject;
33
34
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentSearchComponent, never>;
34
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentSearchComponent, "document-search", never, { "contextId": { "alias": "contextId"; "required": false; }; }, {}, never, never, false, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentSearchComponent, "document-search", never, { "contextId": { "alias": "contextId"; "required": false; }; }, { "onActionClick": "onActionClick"; }, never, never, false, never>;
35
36
  }
@@ -1,120 +1,83 @@
1
- import { ChangeDetectorRef } from '@angular/core';
1
+ import { ChangeDetectorRef, OnDestroy } from '@angular/core';
2
2
  import { FileUpload } from 'primeng/fileupload';
3
3
  import { MessageService } from 'primeng/api';
4
4
  import { PrimeNGConfig } from 'primeng/api';
5
5
  import { FileFormatService } from '../../services/file-format.service';
6
6
  import { DocumentService } from '../../state/document.service';
7
7
  import { DocumentUploadService } from '../../services/document-upload.service';
8
+ import { DocumentUploadBusinessService, UploadedFile } from '../../services/document-upload-business.service';
9
+ import { DocumentUploadFormService } from '../../services/document-upload-form.service';
10
+ import { DocumentUploadDataService } from '../../services/document-upload-data.service';
11
+ import { UserListModel } from '../../models/user-list.model';
12
+ import { DocumentCategory } from '../../models/document-category.model';
13
+ import { DocumentTypeModel } from '../../models/document-type.model';
8
14
  import * as i0 from "@angular/core";
9
- /**
10
- * A component for handling document uploads, including file selection, removal, and progress tracking.
11
- * @class DocumentUploadComponent
12
- */
13
- export declare class DocumentUploadComponent {
15
+ export declare class DocumentUploadComponent implements OnDestroy {
14
16
  documentUpload: DocumentUploadService;
15
17
  uploadService: DocumentService;
16
18
  private config;
17
19
  fileFormatService: FileFormatService;
18
20
  messageService: MessageService;
19
21
  cdr: ChangeDetectorRef;
20
- /**
21
- * Represents the file size.
22
- * @type {number}
23
- */
24
- fileSize: string;
25
- /**
26
- * Represent contextId
27
- * @type {string}
28
- */
22
+ private businessService;
23
+ private formService;
24
+ private dataService;
29
25
  contextId: string;
30
- /**
31
- * To make file explorer visible.
32
- * @type {!FileUpload}
33
- */
34
26
  fileUploader: FileUpload;
27
+ selectedAssignmentType: 'Applicant' | 'Application' | null;
28
+ selectedApplicant: string;
29
+ selectedCategory: string;
30
+ selectedDocumentType: string;
31
+ applicantList: UserListModel[];
32
+ filteredApplicantList: UserListModel[];
33
+ categoryOptions: DocumentCategory[];
34
+ documentTypeOptions: DocumentTypeModel[];
35
+ uploadedFiles: UploadedFile[];
35
36
  fileProgress: Map<File, number>;
36
- /**
37
- * List of files selected for upload.
38
- * @type {File[]}
39
- */
40
- uploadedFiles: {
41
- file: File;
42
- formattedSize: string;
43
- progress: number;
44
- }[];
45
- /**
46
- * Percentage of the total size calculated for displaying upload progress.
47
- * @type {number}
48
- */
49
- totalSizePercent: number;
50
- /**
51
- * The current upload progress percentage (SHARED.INITIAL_VALUE-100).
52
- * @type {number}
53
- */
54
- uploadProgress: number;
55
- /**
56
- * Creates an instance of DocumentUploadComponent.
57
- * @class
58
- * @param {DocumentUploadService} documentUpload - Service for handling document upload.
59
- * @param {DocumentService} uploadService - Service for handling document upload.
60
- * @param {PrimeNGConfig} config - PrimeNG configuration.
61
- * @param {FileFormatService} fileFormatService - Service for formatting file sizes.
62
- * @param {MessageService} messageService - Service for displaying messages.
63
- * @param {ChangeDetectorRef} cdr - Service for detecting changes.
64
- */
65
- constructor(documentUpload: DocumentUploadService, uploadService: DocumentService, config: PrimeNGConfig, fileFormatService: FileFormatService, messageService: MessageService, cdr: ChangeDetectorRef);
66
- /**
67
- * Open the file explorer.
68
- * @param {*} event - The triggering event.
69
- * @param {() => void} callback - A callback function to execute.
70
- * @returns {void} - No return value.
71
- */
72
- choose(event: any, callback: () => void): void;
73
- /**
74
- * Prepares the files for upload by creating a FormData object.
75
- * This method appends each file to the FormData for submission.
76
- * @param {File} file - The file to upload.
77
- * @returns {void}
78
- */
79
- handleTemplatedUpload(file: File): void;
80
- /**
81
- * Handle the creation of formdata.
82
- * @param {File} file - The file to append in formdata.
83
- * @returns {*} - The formdata object.
84
- */
85
- handleCreateFormData(file: File): FormData;
86
- /**
87
- * Handles the event when new files are selected.
88
- * @param { { currentFiles: File[] } } event - The event containing the newly selected files.
89
- * @returns {void} - No return value.
90
- */
37
+ isLoadingApplicants: boolean;
38
+ isLoadingCategories: boolean;
39
+ isLoadingDocumentTypes: boolean;
40
+ isSaving: boolean;
41
+ isFormValid: boolean;
42
+ private destroy$;
43
+ constructor(documentUpload: DocumentUploadService, uploadService: DocumentService, config: PrimeNGConfig, fileFormatService: FileFormatService, messageService: MessageService, cdr: ChangeDetectorRef, businessService: DocumentUploadBusinessService, formService: DocumentUploadFormService, dataService: DocumentUploadDataService);
44
+ onAssignmentTypeChange(): void;
45
+ onCategoryChange(): void;
46
+ onDocumentTypeChange(): void;
47
+ onApplicantSelectionChange(): void;
91
48
  onSelectedFiles(event: {
92
49
  currentFiles: File[];
93
50
  }): void;
94
- /**
95
- * Formats the given file size in bytes into a readable format (e.g., KB, MB).
96
- * @param {number} bytes - The size of the file in bytes.
97
- * @returns {string} The formatted file size (e.g., '1.2 KB', '2.3 MB').
98
- */
99
- formatSize(bytes: number): void;
100
- /**
101
- * Handles the removal of a file from the uploaded files list.
102
- * @param {File} file - The file to be removed.
103
- * @param {number} index - The index of the file in the uploaded files list.
104
- */
51
+ loadApplicants(): void;
52
+ loadCategories(): void;
53
+ loadDocumentTypes(): void;
54
+ saveDocumentUpload(): void;
55
+ handleTemplatedUpload(file: File): void;
105
56
  handleDocumentRemove(file: File, index: number): void;
106
- /**
107
- * Major progress for the progress bar.
108
- * @param {File} file - File to check progress for.
109
- * @returns {number} - The progress percentage for the file.
110
- */
111
- getProgress(file: File): number;
112
- /**
113
- * Triggers the file upload dialog.
114
- * Opens the file explorer for selecting files.
115
- * @returns {void}
116
- */
57
+ choose(event: any, callback: () => void): void;
117
58
  triggerFileUpload(): void;
59
+ getSaveButtonDisabled(): boolean;
60
+ getProgress(file: File): number;
61
+ isFileUploading(file: File): boolean;
62
+ isFileUploaded(file: File): boolean;
63
+ isFileError(file: File): boolean;
64
+ resetForm(): void;
65
+ resetSelections(): void;
66
+ resetDocumentType(): void;
67
+ handleApplicantLoading(): void;
68
+ loadDocumentTypesIfCategorySelected(): void;
69
+ handleApplicantsLoaded(applicants: UserListModel[]): void;
70
+ handleApplicantsError(error: any): void;
71
+ handleCategoriesLoaded(categories: DocumentCategory[]): void;
72
+ handleCategoriesError(error: any): void;
73
+ handleDocumentTypesLoaded(documentTypes: DocumentTypeModel[]): void;
74
+ handleDocumentTypesError(error: any): void;
75
+ handleUploadSuccess(response: any): void;
76
+ handleUploadError(error: any): void;
77
+ filterApplicants(): void;
78
+ validateForm(): void;
79
+ saveDocumentMetadata(): void;
80
+ ngOnDestroy(): void;
118
81
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentUploadComponent, never>;
119
82
  static ɵcmp: i0.ɵɵComponentDeclaration<DocumentUploadComponent, "lib-document-upload", never, { "contextId": { "alias": "contextId"; "required": false; }; }, {}, never, never, false, never>;
120
83
  }
@@ -40,6 +40,10 @@ export declare class DocumentsMenuComponent implements OnInit, OnChanges {
40
40
  * @param {DocumentCategoryItem} item - catagory item
41
41
  */
42
42
  onMenuItemClick(event: any, item: DocumentCategoryItem): void;
43
+ /**
44
+ * Handle deselection to ensure immediate visual feedback
45
+ */
46
+ private handleDeselection;
43
47
  onSelectMenuItem(menuItemId: string): void;
44
48
  onUnselectMenuItem(): void;
45
49
  getSelectedMenuItem(): string | null;
@@ -5,6 +5,7 @@ import { DocumentQuery } from '../../state/document.query';
5
5
  import { UserListModel } from '../../models/user-list.model';
6
6
  import { StatusDataModel } from '../../models/status-data.model';
7
7
  import { DocumentCategory } from '../../models/document-category.model';
8
+ import { DocumentUploadComponent } from '../document-upload/document-upload.component';
8
9
  import * as i0 from "@angular/core";
9
10
  /**
10
11
  * The `FolderContainerComponent` is responsible for rendering a container
@@ -52,8 +53,40 @@ export declare class FolderContainerComponent implements OnInit {
52
53
  * Animation state for user list visibility
53
54
  */
54
55
  userListAnimationState: string;
56
+ /**
57
+ * Controls the visibility of the document upload sidebar
58
+ */
59
+ isDocumentUploadSidebarOpen: boolean;
60
+ /**
61
+ * Reference to the document upload component
62
+ */
63
+ documentUploadComponent: DocumentUploadComponent;
64
+ /**
65
+ * Tracks whether the save button should be disabled
66
+ */
67
+ isSaveButtonDisabled: boolean;
55
68
  constructor(documentQuery: DocumentQuery);
56
69
  ngOnInit(): void;
70
+ /**
71
+ * Called when the view is initialized to set up the save button state
72
+ */
73
+ ngAfterViewInit(): void;
74
+ /**
75
+ * Updates the save button disabled state based on the document upload component
76
+ */
77
+ private updateSaveButtonState;
78
+ /**
79
+ * Opens the document upload sidebar
80
+ */
81
+ openDocumentUploadSidebar(): void;
82
+ /**
83
+ * Handles the document upload sidebar hide event
84
+ */
85
+ onDocumentUploadSidebarHide(): void;
86
+ /**
87
+ * Handles the document upload save event
88
+ */
89
+ onDocumentUploadSave(): void;
57
90
  static ɵfac: i0.ɵɵFactoryDeclaration<FolderContainerComponent, never>;
58
91
  static ɵcmp: i0.ɵɵComponentDeclaration<FolderContainerComponent, "lib-folder-container", never, { "documentList": { "alias": "documentList"; "required": false; }; "folderList": { "alias": "folderList"; "required": false; }; "contextId": { "alias": "contextId"; "required": false; }; "userList": { "alias": "userList"; "required": false; }; "statusData": { "alias": "statusData"; "required": false; }; "categories": { "alias": "categories"; "required": false; }; }, {}, never, never, false, never>;
59
92
  }
@@ -14,28 +14,30 @@ import * as i12 from "./components/user-list/user-list.component";
14
14
  import * as i13 from "./components/document-status/document-status.component";
15
15
  import * as i14 from "./components/document-actions/document-actions.component";
16
16
  import * as i15 from "./components/document-search/document-search.component";
17
- import * as i16 from "@angular/common";
18
- import * as i17 from "primeng/accordion";
19
- import * as i18 from "@angular/common/http";
20
- import * as i19 from "primeng/button";
21
- import * as i20 from "primeng/sidebar";
22
- import * as i21 from "primeng/fileupload";
23
- import * as i22 from "primeng/progressbar";
24
- import * as i23 from "primeng/badge";
25
- import * as i24 from "primeng/listbox";
26
- import * as i25 from "primeng/checkbox";
27
- import * as i26 from "primeng/timeline";
28
- import * as i27 from "primeng/inputtextarea";
29
- import * as i28 from "@angular/forms";
30
- import * as i29 from "ng2-pdf-viewer";
31
- import * as i30 from "primeng/dialog";
32
- import * as i31 from "primeng/dropdown";
33
- import * as i32 from "primeng/inputtext";
34
- import * as i33 from "primeng/menu";
35
- import * as i34 from "primeng/panelmenu";
36
- import * as i35 from "primeng/card";
37
- import * as i36 from "primeng/table";
38
- import * as i37 from "../../Shared/shared.module";
17
+ import * as i16 from "./components/common-sidebar/common-sidebar.component";
18
+ import * as i17 from "@angular/common";
19
+ import * as i18 from "primeng/accordion";
20
+ import * as i19 from "@angular/common/http";
21
+ import * as i20 from "primeng/button";
22
+ import * as i21 from "primeng/sidebar";
23
+ import * as i22 from "primeng/fileupload";
24
+ import * as i23 from "primeng/progressbar";
25
+ import * as i24 from "primeng/badge";
26
+ import * as i25 from "primeng/listbox";
27
+ import * as i26 from "primeng/checkbox";
28
+ import * as i27 from "primeng/radiobutton";
29
+ import * as i28 from "primeng/timeline";
30
+ import * as i29 from "primeng/inputtextarea";
31
+ import * as i30 from "@angular/forms";
32
+ import * as i31 from "ng2-pdf-viewer";
33
+ import * as i32 from "primeng/dialog";
34
+ import * as i33 from "primeng/dropdown";
35
+ import * as i34 from "primeng/inputtext";
36
+ import * as i35 from "primeng/menu";
37
+ import * as i36 from "primeng/panelmenu";
38
+ import * as i37 from "primeng/card";
39
+ import * as i38 from "primeng/table";
40
+ import * as i39 from "../../Shared/shared.module";
39
41
  /**
40
42
  * @module DocumentModule
41
43
  *
@@ -45,6 +47,6 @@ import * as i37 from "../../Shared/shared.module";
45
47
  */
46
48
  export declare class DocumentModule {
47
49
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentModule, never>;
48
- static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent, typeof i8.DocumentHistoryComponent, typeof i9.DocumentDirective, typeof i10.LinkedDocumentComponent, typeof i11.DocumentsMenuComponent, typeof i12.UserListComponent, typeof i13.DocumentStatusComponent, typeof i14.DocumentActionsComponent, typeof i15.DocumentSearchComponent], [typeof i16.CommonModule, typeof i17.AccordionModule, typeof i18.HttpClientModule, typeof i19.ButtonModule, typeof i20.SidebarModule, typeof i21.FileUploadModule, typeof i22.ProgressBarModule, typeof i23.BadgeModule, typeof i24.ListboxModule, typeof i25.CheckboxModule, typeof i26.TimelineModule, typeof i27.InputTextareaModule, typeof i28.FormsModule, typeof i29.PdfViewerModule, typeof i30.DialogModule, typeof i31.DropdownModule, typeof i32.InputTextModule, typeof i33.MenuModule, typeof i34.PanelMenuModule, typeof i35.CardModule, typeof i36.TableModule, typeof i37.SharedModule, typeof i27.InputTextareaModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i14.DocumentActionsComponent, typeof i4.DocumentListComponent, typeof i9.DocumentDirective, typeof i15.DocumentSearchComponent]>;
50
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentModule, [typeof i1.DocumentContainerComponent, typeof i2.FolderContainerComponent, typeof i3.FolderBlockComponent, typeof i4.DocumentListComponent, typeof i5.DocumentListItemComponent, typeof i6.DocumentUploadComponent, typeof i7.DocumentViewerComponent, typeof i8.DocumentHistoryComponent, typeof i9.DocumentDirective, typeof i10.LinkedDocumentComponent, typeof i11.DocumentsMenuComponent, typeof i12.UserListComponent, typeof i13.DocumentStatusComponent, typeof i14.DocumentActionsComponent, typeof i15.DocumentSearchComponent, typeof i16.CommonSidebarComponent], [typeof i17.CommonModule, typeof i18.AccordionModule, typeof i19.HttpClientModule, typeof i20.ButtonModule, typeof i21.SidebarModule, typeof i22.FileUploadModule, typeof i23.ProgressBarModule, typeof i24.BadgeModule, typeof i25.ListboxModule, typeof i26.CheckboxModule, typeof i27.RadioButtonModule, typeof i28.TimelineModule, typeof i29.InputTextareaModule, typeof i30.FormsModule, typeof i31.PdfViewerModule, typeof i32.DialogModule, typeof i33.DropdownModule, typeof i34.InputTextModule, typeof i35.MenuModule, typeof i36.PanelMenuModule, typeof i37.CardModule, typeof i38.TableModule, typeof i39.SharedModule, typeof i29.InputTextareaModule], [typeof i1.DocumentContainerComponent, typeof i7.DocumentViewerComponent, typeof i14.DocumentActionsComponent, typeof i4.DocumentListComponent, typeof i9.DocumentDirective, typeof i15.DocumentSearchComponent, typeof i16.CommonSidebarComponent]>;
49
51
  static ɵinj: i0.ɵɵInjectorDeclaration<DocumentModule>;
50
52
  }
@@ -1,6 +1,8 @@
1
1
  import { DocumentHistoryItem, DocumentHistorySection } from '../models/document-history.model';
2
2
  import { DocumentHistoryStyleService } from './document-history-style.service';
3
3
  import { HttpClient } from '@angular/common/http';
4
+ import { SessionService } from '../../../Shared/services/session.service';
5
+ import { AppConfigService } from '../../../Shared/services/app-config.service';
4
6
  import * as i0 from "@angular/core";
5
7
  interface ProcessedDocumentHistoryItem extends DocumentHistoryItem {
6
8
  actionIcon: string;
@@ -17,7 +19,9 @@ interface ProcessedDocumentHistorySection extends DocumentHistorySection {
17
19
  export declare class DocumentHistoryService {
18
20
  private documentHistoryStyleService;
19
21
  private http;
20
- constructor(documentHistoryStyleService: DocumentHistoryStyleService, http: HttpClient);
22
+ private sessionService;
23
+ private appConfigService;
24
+ constructor(documentHistoryStyleService: DocumentHistoryStyleService, http: HttpClient, sessionService: SessionService, appConfigService: AppConfigService);
21
25
  /**
22
26
  * Get the CSS class for accordion styling based on the section's label
23
27
  */
@@ -36,6 +40,30 @@ export declare class DocumentHistoryService {
36
40
  * @param docName - The name of the document
37
41
  */
38
42
  downloadDocument(documentUrl: string, docName?: string): void;
43
+ /**
44
+ * Alternative download method that relies on HTTP interceptors for authentication
45
+ * @param documentUrl - The URL of the document to download
46
+ * @param docName - The name of the document
47
+ */
48
+ private downloadDocumentWithInterceptors;
49
+ /**
50
+ * Get the full URL for the document, handling relative URLs
51
+ * @private
52
+ * @param documentUrl - The document URL (can be relative or absolute)
53
+ * @returns {string} The full URL
54
+ */
55
+ private getFullUrl;
56
+ /**
57
+ * Get authentication headers for HTTP requests
58
+ * @private
59
+ * @returns {HttpHeaders} Headers with authentication token
60
+ */
61
+ private getAuthHeaders;
62
+ /**
63
+ * Debug method to help identify issues when the library is used in the main project
64
+ * @public
65
+ */
66
+ debugEnvironment(): void;
39
67
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentHistoryService, never>;
40
68
  static ɵprov: i0.ɵɵInjectableDeclaration<DocumentHistoryService>;
41
69
  }
@@ -2,9 +2,11 @@ import { Observable } from 'rxjs';
2
2
  import { AppConfigService } from '../../../Shared/services/app-config.service';
3
3
  import { DocumentStore } from '../state/document.store';
4
4
  import { HttpClient } from '@angular/common/http';
5
+ import { DocumentTypeModel } from '../models/document-type.model';
5
6
  import { DocumentAlertModel } from '../models/document-alert.model';
6
7
  import { DocumentModel } from '../models/document.model';
7
8
  import { FolderBlockModel } from '../models/folder.model';
9
+ import { DocumentCategory } from '../models/document-category.model';
8
10
  import { UserListModel } from '../models/user-list.model';
9
11
  import { StatusDataModel } from '../models/status-data.model';
10
12
  import { DocumentHistorySection } from '../models/document-history.model';
@@ -98,6 +100,30 @@ export declare class DocumentHttpService {
98
100
  */
99
101
  getDocumentsBySelection(contextId: string, menuItem: string | null, userId: string | null, status: string | null, searchKey?: string | null): Observable<any>;
100
102
  getDocumentHistory(documentId: string): Observable<DocumentHistorySection[]>;
103
+ /**
104
+ * Fetches document categories by source (Applicant/Application).
105
+ * @param {string} source - The source type (Applicant or Application).
106
+ * @returns {Observable<DocumentCategory[]>} Observable that emits the categories.
107
+ */
108
+ getCategoriesBySource(source: string): Observable<DocumentCategory[]>;
109
+ /**
110
+ * Fetches document types by category ID.
111
+ * @param {string} categoryId - The category ID to fetch document types for.
112
+ * @returns {Observable<DocumentTypeModel[]>} Observable that emits the document types.
113
+ */
114
+ getDocumentTypesByCategory(categoryId: string): Observable<DocumentTypeModel[]>;
115
+ /**
116
+ * Uploads a single file using the uploadFile API.
117
+ * @param {FormData} formData - The form data containing the file and metadata.
118
+ * @returns {Observable<any>} Observable that emits the upload response.
119
+ */
120
+ uploadFile(formData: FormData): Observable<any>;
121
+ /**
122
+ * Saves the complete document upload data.
123
+ * @param {any} payload - The document upload payload containing all necessary data.
124
+ * @returns {Observable<any>} Observable that emits the save response.
125
+ */
126
+ saveDocumentUpload(payload: any): Observable<any>;
101
127
  /**
102
128
  * Updates the status of a document by document ID
103
129
  * @param {string} documentId - The ID of the document to update
@@ -7,7 +7,6 @@ import { DocumentTableBuilderService } from './document-table-builder.service';
7
7
  import { DocumentHelperService } from './document.service';
8
8
  import { DocumentListItem, DocumentListResponse } from '../models/document-list-response.model';
9
9
  import { TableData } from '../../../Shared/components/table-primary/table-primary.model';
10
- import { Message } from 'primeng/api';
11
10
  import * as i0 from "@angular/core";
12
11
  export declare class DocumentListService {
13
12
  private documentUploadService;
@@ -25,10 +24,6 @@ export declare class DocumentListService {
25
24
  * Handle save click to update document name
26
25
  */
27
26
  handleSaveClick(fileName: string, selectedDocument: DocumentListItem): Observable<any>;
28
- /**
29
- * Handle document upload
30
- */
31
- handleUploadDocument(selectedOption: string | null): Observable<Message[]>;
32
27
  /**
33
28
  * Get completion count for a category
34
29
  */
@@ -0,0 +1,90 @@
1
+ import { Observable } from 'rxjs';
2
+ import { DocumentHttpService } from './document-http.service';
3
+ import { FileFormatService } from './file-format.service';
4
+ import { UserListModel } from '../models/user-list.model';
5
+ import { DocumentCategory } from '../models/document-category.model';
6
+ import { DocumentTypeModel } from '../models/document-type.model';
7
+ import * as i0 from "@angular/core";
8
+ export interface UploadedFile {
9
+ file: File;
10
+ formattedSize: string;
11
+ progress: number;
12
+ uploadResponse?: any;
13
+ }
14
+ export interface DocumentUploadPayload {
15
+ source: 'Applicant' | 'Application';
16
+ categoryId: string;
17
+ documentTypeId: string;
18
+ applicantId?: string;
19
+ contextId: string;
20
+ documents: {
21
+ fileName: string;
22
+ fileSize: number;
23
+ fileType: string;
24
+ file: File;
25
+ uploadedFileId?: string;
26
+ }[];
27
+ }
28
+ export declare class DocumentUploadBusinessService {
29
+ private documentHttpService;
30
+ private fileFormatService;
31
+ private destroy$;
32
+ constructor(documentHttpService: DocumentHttpService, fileFormatService: FileFormatService);
33
+ /**
34
+ * Loads applicants for a given context ID
35
+ */
36
+ loadApplicants(contextId: string): Observable<UserListModel[]>;
37
+ /**
38
+ * Loads categories based on assignment type
39
+ */
40
+ loadCategories(assignmentType: string): Observable<DocumentCategory[]>;
41
+ /**
42
+ * Loads document types based on category
43
+ */
44
+ loadDocumentTypes(categoryId: string): Observable<DocumentTypeModel[]>;
45
+ /**
46
+ * Filters applicants based on assignment type
47
+ */
48
+ filterApplicants(applicantList: UserListModel[], assignmentType: 'Applicant' | 'Application'): UserListModel[];
49
+ /**
50
+ * Validates form data
51
+ */
52
+ validateForm(assignmentType: 'Applicant' | 'Application' | null, selectedCategory: string, selectedDocumentType: string, selectedApplicant: string, uploadedFiles: UploadedFile[], categoryOptions: DocumentCategory[], documentTypeOptions: DocumentTypeModel[]): boolean;
53
+ /**
54
+ * Checks if save button should be disabled
55
+ */
56
+ isSaveButtonDisabled(assignmentType: 'Applicant' | 'Application' | null, selectedCategory: string, selectedDocumentType: string, selectedApplicant: string, uploadedFiles: UploadedFile[], isSaving: boolean): boolean;
57
+ /**
58
+ * Prepares upload payload
59
+ */
60
+ prepareUploadPayload(assignmentType: 'Applicant' | 'Application', selectedCategory: string, selectedDocumentType: string, selectedApplicant: string, uploadedFiles: UploadedFile[], contextId: string): DocumentUploadPayload;
61
+ /**
62
+ * Saves document upload
63
+ */
64
+ saveDocumentUpload(payload: DocumentUploadPayload): Observable<any>;
65
+ /**
66
+ * Formats file size
67
+ */
68
+ formatFileSize(fileSize: number, config: any): string;
69
+ /**
70
+ * Creates uploaded file object
71
+ */
72
+ createUploadedFile(file: File, formattedSize: string): UploadedFile;
73
+ /**
74
+ * Resets form data to initial state
75
+ */
76
+ getInitialFormState(): {
77
+ selectedAssignmentType: "Applicant";
78
+ selectedApplicant: string;
79
+ selectedCategory: string;
80
+ selectedDocumentType: string;
81
+ uploadedFiles: UploadedFile[];
82
+ isFormValid: boolean;
83
+ };
84
+ /**
85
+ * Destroys the service
86
+ */
87
+ destroy(): void;
88
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentUploadBusinessService, never>;
89
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentUploadBusinessService>;
90
+ }
@@ -0,0 +1,40 @@
1
+ import { Observable } from 'rxjs';
2
+ import { DocumentUploadBusinessService } from './document-upload-business.service';
3
+ import { DocumentUploadFormService } from './document-upload-form.service';
4
+ import { UserListModel } from '../models/user-list.model';
5
+ import { DocumentCategory } from '../models/document-category.model';
6
+ import { DocumentTypeModel } from '../models/document-type.model';
7
+ import * as i0 from "@angular/core";
8
+ export interface DataLoadingState {
9
+ isLoadingApplicants: boolean;
10
+ isLoadingCategories: boolean;
11
+ isLoadingDocumentTypes: boolean;
12
+ }
13
+ export declare class DocumentUploadDataService {
14
+ private businessService;
15
+ private formService;
16
+ private destroy$;
17
+ constructor(businessService: DocumentUploadBusinessService, formService: DocumentUploadFormService);
18
+ /**
19
+ * Loads applicants and handles the response
20
+ */
21
+ loadApplicants(contextId: string, onSuccess: (applicants: UserListModel[]) => void, onError: (error: any) => void): Observable<UserListModel[]>;
22
+ /**
23
+ * Loads categories and handles the response
24
+ */
25
+ loadCategories(assignmentType: string, onSuccess: (categories: DocumentCategory[]) => void, onError: (error: any) => void): Observable<DocumentCategory[]>;
26
+ /**
27
+ * Loads document types and handles the response
28
+ */
29
+ loadDocumentTypes(categoryId: string, onSuccess: (documentTypes: DocumentTypeModel[]) => void, onError: (error: any) => void): Observable<DocumentTypeModel[]>;
30
+ /**
31
+ * Handles applicants loaded successfully
32
+ */
33
+ handleApplicantsLoaded(applicants: UserListModel[], assignmentType: 'Applicant' | 'Application' | null): UserListModel[];
34
+ /**
35
+ * Destroys the service
36
+ */
37
+ destroy(): void;
38
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentUploadDataService, never>;
39
+ static ɵprov: i0.ɵɵInjectableDeclaration<DocumentUploadDataService>;
40
+ }