From cac1d11ad78e380a2f15aed4c067b3b089705aa5 Mon Sep 17 00:00:00 2001 From: Ralph Hopman Date: Tue, 14 Jan 2025 15:41:40 +0100 Subject: [PATCH] build: Use prettier for typescript Stop ignoring .ts files in prettier and fix existing issues. --- .prettierignore | 2 +- README.md | 4 +- cypress.config.ts | 20 +- docker-compose.yml | 1 - e2e/src/login/login.e2e-spec.ts | 1 - e2e/src/login/login.po.ts | 2 - .../account-transfers-routing.module.ts | 35 +- .../account-transfers.module.ts | 11 +- .../account-transfers.service.ts | 34 +- .../list-transactions.resolver.ts | 37 +- ...make-account-transfer-template.resolver.ts | 54 +- ...instructions-data-and-template.resolver.ts | 28 +- ...standing-instructions-template.resolver.ts | 52 +- .../view-account-transfer.resolver.ts | 26 +- .../view-standing-instructions.resolver.ts | 28 +- ...te-standing-instructions.component.spec.ts | 5 +- .../create-standing-instructions.component.ts | 140 +++- ...it-standing-instructions.component.spec.ts | 5 +- .../edit-standing-instructions.component.ts | 128 ++-- ...st-standing-instructions.component.spec.ts | 5 +- .../list-standing-instructions.component.ts | 25 +- .../list-transactions.component.spec.ts | 5 +- .../list-transactions.component.ts | 10 +- .../make-account-transfers.component.spec.ts | 5 +- .../make-account-transfers.component.ts | 67 +- .../view-account-transfer.component.spec.ts | 5 +- .../view-account-transfer.component.ts | 8 +- ...ew-standing-instructions.component.spec.ts | 5 +- .../view-standing-instructions.component.ts | 4 +- .../accounting/accounting-routing.module.ts | 19 +- .../accounting-rule.resolver.ts | 2 - .../accounting-rules-template.resolver.ts | 2 - .../accounting-rules.component.spec.ts | 5 +- .../accounting-rules.component.ts | 28 +- .../accounting-rules.resolver.ts | 2 - .../create-rule/create-rule.component.spec.ts | 5 +- .../create-rule/create-rule.component.ts | 55 +- .../edit-rule/edit-rule.component.spec.ts | 5 +- .../edit-rule/edit-rule.component.ts | 88 ++- ...one-of-the-fields-is-required.validator.ts | 6 +- .../view-rule/view-rule.component.spec.ts | 5 +- .../view-rule/view-rule.component.ts | 19 +- src/app/accounting/accounting.component.ts | 24 +- src/app/accounting/accounting.module.ts | 2 +- src/app/accounting/accounting.service.ts | 15 +- .../chart-of-accounts.component.spec.ts | 5 +- .../chart-of-accounts.component.ts | 41 +- .../chart-of-accounts.resolver.ts | 2 - .../chart-of-accounts-template.resolver.ts | 2 - .../create-gl-account.component.spec.ts | 5 +- .../create-gl-account.component.ts | 71 +- .../edit-gl-account.component.spec.ts | 5 +- .../edit-gl-account.component.ts | 93 ++- ...and-chart-of-accounts-template.resolver.ts | 27 +- .../gl-account-node.model.ts | 16 +- .../gl-account-tree.service.ts | 27 +- .../view-gl-account.component.spec.ts | 5 +- .../view-gl-account.component.ts | 24 +- .../closing-entries.component.spec.ts | 5 +- .../closing-entries.component.ts | 37 +- .../closing-entries.resolver.ts | 2 - .../closing-entries/closing-entry.resolver.ts | 2 - .../create-closure.component.spec.ts | 5 +- .../create-closure.component.ts | 33 +- .../edit-closure.component.spec.ts | 5 +- .../edit-closure/edit-closure.component.ts | 37 +- .../view-closure.component.spec.ts | 5 +- .../view-closure/view-closure.component.ts | 19 +- .../accounting-rules-associations.resolver.ts | 2 - .../common-resolvers/currencies.resolver.ts | 2 - .../common-resolvers/gl-accounts.resolver.ts | 2 - .../journal-entry-transaction.resolver.ts | 2 - .../loan-products.resolver.ts | 2 - .../common-resolvers/offices.resolver.ts | 2 - .../payment-types.resolver.ts | 2 - .../provisioning-categories.resolver.ts | 2 - .../create-journal-entry.component.spec.ts | 5 +- .../create-journal-entry.component.ts | 97 ++- ...nancial-activity-mapping.component.spec.ts | 5 +- ...te-financial-activity-mapping.component.ts | 61 +- ...ial-activity-mappings-template.resolver.ts | 2 - ...nancial-activity-mapping.component.spec.ts | 5 +- ...it-financial-activity-mapping.component.ts | 61 +- ...-activity-mapping-and-template.resolver.ts | 2 - ...ancial-activity-mappings.component.spec.ts | 5 +- .../financial-activity-mappings.component.ts | 40 +- .../financial-activity-mappings.resolver.ts | 2 - .../financial-activity-mapping.resolver.ts | 2 - ...nancial-activity-mapping.component.spec.ts | 5 +- ...ew-financial-activity-mapping.component.ts | 21 +- .../frequent-postings.component.spec.ts | 5 +- .../frequent-postings.component.ts | 100 ++- ...migrate-opening-balances.component.spec.ts | 5 +- .../migrate-opening-balances.component.ts | 78 +- ...one-of-the-fields-is-required.validator.ts | 6 +- .../periodic-accruals.component.spec.ts | 5 +- .../periodic-accruals.component.ts | 13 +- ...reate-provisioning-entry.component.spec.ts | 5 +- .../create-provisioning-entry.component.ts | 28 +- .../provisioning-entries.component.spec.ts | 5 +- .../provisioning-entries.component.ts | 40 +- .../provisioning-entries.resolver.ts | 2 - .../provisioning-entry-entries.resolver.ts | 2 - .../provisioning-entry.resolver.ts | 2 - .../view-provisioning-entry.component.spec.ts | 5 +- .../view-provisioning-entry.component.ts | 100 ++- .../provisioning-journal-entries.resolver.ts | 2 - ...isioning-journal-entries.component.spec.ts | 5 +- ...-provisioning-journal-entries.component.ts | 27 +- .../revert-transaction.component.spec.ts | 5 +- .../revert-transaction.component.ts | 8 +- .../journal-entry.datasource.ts | 17 +- .../search-journal-entry.component.spec.ts | 5 +- .../search-journal-entry.component.ts | 114 +-- src/app/app-routing.module.ts | 4 +- src/app/app.module.ts | 21 +- src/app/centers/centers-routing.module.ts | 28 +- .../activate-center.component.spec.ts | 5 +- .../activate-center.component.ts | 21 +- .../attach-center-meeting.component.spec.ts | 5 +- .../attach-center-meeting.component.ts | 69 +- .../center-actions.component.spec.ts | 5 +- .../center-actions.component.ts | 32 +- .../center-assign-staff.component.spec.ts | 5 +- .../center-assign-staff.component.ts | 17 +- .../center-attendance.component.spec.ts | 5 +- .../center-attendance.component.ts | 49 +- .../close-center.component.spec.ts | 5 +- .../close-center/close-center.component.ts | 26 +- ...-center-meeting-schedule.component.spec.ts | 5 +- .../edit-center-meeting-schedule.component.ts | 26 +- .../edit-center-meeting.component.spec.ts | 5 +- .../edit-center-meeting.component.ts | 79 +- .../manage-groups.component.spec.ts | 5 +- .../manage-groups/manage-groups.component.ts | 44 +- ...staff-assignment-history.component.spec.ts | 5 +- .../staff-assignment-history.component.ts | 8 +- .../centers-view.component.spec.ts | 5 +- .../centers-view/centers-view.component.ts | 28 +- .../datatable-tab.component.spec.ts | 5 +- .../datatable-tab/datatable-tab.component.ts | 1 - .../general-tab/general-tab.component.spec.ts | 5 +- .../general-tab/general-tab.component.ts | 22 +- .../notes-tab/notes-tab.component.spec.ts | 5 +- .../notes-tab/notes-tab.component.ts | 52 +- src/app/centers/centers.component.ts | 57 +- src/app/centers/centers.datasource.ts | 24 +- src/app/centers/centers.module.ts | 2 +- src/app/centers/centers.service.ts | 51 +- .../center-actions.resolver.ts | 4 +- .../center-data-and-template.resolver.ts | 26 +- .../center-datatable.resolver.ts | 28 +- .../center-datatables.resolver.ts | 24 +- .../common-resolvers/center-notes.resolver.ts | 26 +- .../center-resource.resolver.ts | 26 +- .../center-summary.resolver.ts | 26 +- .../common-resolvers/center-view.resolver.ts | 26 +- .../savings-account.resolver.ts | 26 +- .../create-center.component.spec.ts | 5 +- .../create-center/create-center.component.ts | 31 +- .../edit-center/edit-center.component.spec.ts | 5 +- .../edit-center/edit-center.component.ts | 27 +- .../client-address-step.component.spec.ts | 5 +- .../client-address-step.component.ts | 238 ++++--- .../client-datatable-step.component.spec.ts | 5 +- .../client-datatable-step.component.ts | 12 +- ...ent-family-member-dialog.component.spec.ts | 5 +- .../client-family-member-dialog.component.ts | 76 +- ...ient-family-members-step.component.spec.ts | 5 +- .../client-family-members-step.component.ts | 12 +- .../client-general-step.component.spec.ts | 5 +- .../client-general-step.component.ts | 95 ++- .../client-preview-step.component.spec.ts | 5 +- .../client-preview-step.component.ts | 8 +- src/app/clients/clients-routing.module.ts | 435 ++++++------ .../address-tab/address-tab.component.spec.ts | 5 +- .../address-tab/address-tab.component.ts | 287 +++++--- .../charge-overview.resolver.ts | 26 +- .../charges-overview.component.spec.ts | 5 +- .../charges-overview.component.ts | 21 +- .../client-pay-charges.component.spec.ts | 5 +- .../client-pay-charges.component.ts | 36 +- .../view-charge/view-charge.component.spec.ts | 5 +- .../view-charge/view-charge.component.ts | 31 +- .../accept-client-transfer.component.spec.ts | 5 +- .../accept-client-transfer.component.ts | 22 +- .../activate-client.component.spec.ts | 5 +- .../activate-client.component.ts | 21 +- .../add-client-charge.component.spec.ts | 5 +- .../add-client-charge.component.ts | 31 +- .../add-client-collateral.component.spec.ts | 5 +- .../add-client-collateral.component.ts | 58 +- .../client-actions.component.spec.ts | 5 +- .../client-actions.component.ts | 52 +- .../client-assign-staff.component.spec.ts | 5 +- .../client-assign-staff.component.ts | 17 +- .../client-screen-reports.component.spec.ts | 5 +- .../client-screen-reports.component.ts | 16 +- .../close-client.component.spec.ts | 5 +- .../close-client/close-client.component.ts | 26 +- ...create-self-service-user.component.spec.ts | 5 +- .../create-self-service-user.component.ts | 61 +- .../reactivate-client.component.spec.ts | 5 +- .../reactivate-client.component.ts | 21 +- .../reject-client-transfer.component.spec.ts | 5 +- .../reject-client-transfer.component.ts | 20 +- .../reject-client.component.spec.ts | 5 +- .../reject-client/reject-client.component.ts | 26 +- .../take-survey/take-survey.component.spec.ts | 5 +- .../take-survey/take-survey.component.ts | 27 +- .../transfer-client.component.spec.ts | 5 +- .../transfer-client.component.ts | 28 +- .../undo-client-rejection.component.spec.ts | 5 +- .../undo-client-rejection.component.ts | 21 +- .../undo-client-transfer.component.spec.ts | 5 +- .../undo-client-transfer.component.ts | 20 +- ...e-client-savings-account.component.spec.ts | 5 +- ...update-client-savings-account.component.ts | 17 +- .../view-survey/view-survey.component.spec.ts | 5 +- .../view-survey/view-survey.component.ts | 10 +- .../withdraw-client.component.spec.ts | 5 +- .../withdraw-client.component.ts | 26 +- .../clients-view.component.spec.ts | 5 +- .../clients-view/clients-view.component.ts | 88 +-- .../capture-image-dialog.component.spec.ts | 5 +- .../capture-image-dialog.component.ts | 25 +- .../delete-signature-dialog.component.spec.ts | 5 +- .../delete-signature-dialog.component.ts | 8 +- .../edit-notes-dialog.component.spec.ts | 5 +- .../edit-notes-dialog.component.ts | 11 +- .../unassign-staff-dialog.component.spec.ts | 5 +- .../unassign-staff-dialog.component.ts | 4 +- .../upload-document-dialog.component.spec.ts | 5 +- .../upload-document-dialog.component.ts | 21 +- .../upload-image-dialog.component.spec.ts | 5 +- .../upload-image-dialog.component.ts | 4 +- .../upload-signature-dialog.component.spec.ts | 5 +- .../upload-signature-dialog.component.ts | 4 +- .../view-signature-dialog.component.spec.ts | 5 +- .../view-signature-dialog.component.ts | 17 +- .../datatable-tab.component.spec.ts | 5 +- .../datatable-tab/datatable-tab.component.ts | 1 - .../documents-tab.component.spec.ts | 5 +- .../documents-tab/documents-tab.component.ts | 11 +- .../add-family-member.component.spec.ts | 5 +- .../add-family-member.component.ts | 59 +- .../edit-family-member.component.spec.ts | 5 +- .../edit-family-member.component.ts | 67 +- .../family-members-tab.component.spec.ts | 5 +- .../family-members-tab.component.ts | 17 +- .../general-tab/general-tab.component.spec.ts | 5 +- .../general-tab/general-tab.component.ts | 105 ++- .../identities-tab.component.spec.ts | 5 +- .../identities-tab.component.ts | 56 +- .../notes-tab/notes-tab.component.spec.ts | 5 +- .../notes-tab/notes-tab.component.ts | 17 +- src/app/clients/clients.component.ts | 36 +- src/app/clients/clients.module.ts | 6 +- src/app/clients/clients.service.ts | 56 +- .../client-accounts.resolver.ts | 26 +- .../client-actions.resolver.ts | 8 +- ...ent-address-fieldconfiguration.resolver.ts | 24 +- .../client-address-template.resolver.ts | 24 +- .../client-address.resolver.ts | 26 +- .../client-and-template.resolver.ts | 4 +- .../client-charge-view.resolver.ts | 28 +- .../client-charges.resolver.ts | 26 +- .../client-collateral.resolver.ts | 26 +- .../client-datatable.resolver.ts | 28 +- .../client-datatables.resolver.ts | 24 +- .../client-document.resolver.ts | 26 +- .../client-family-member.resolver.ts | 28 +- .../client-family-members.resolver.ts | 26 +- .../client-identifier-template.resolver.ts | 26 +- .../client-identities.resolver.ts | 52 +- .../common-resolvers/client-notes.resolver.ts | 26 +- .../client-summary.resolver.ts | 26 +- .../client-template.resolver.ts | 24 +- .../client-transaction-pay.resolver.ts | 28 +- .../common-resolvers/client-view.resolver.ts | 26 +- .../create-client.component.spec.ts | 5 +- .../create-client/create-client.component.ts | 20 +- .../edit-client/edit-client.component.spec.ts | 5 +- .../edit-client/edit-client.component.ts | 139 ++-- .../collaterals/collaterals-routing.module.ts | 8 +- src/app/collaterals/collaterals.module.ts | 3 +- src/app/collaterals/collaterals.service.ts | 16 +- .../client-collateral.resolver.ts | 28 +- .../edit-collateral.component.spec.ts | 5 +- .../edit-collateral.component.ts | 36 +- .../view-collateral.component.spec.ts | 5 +- .../view-collateral.component.ts | 17 +- .../collections/collections-routing.module.ts | 11 +- src/app/collections/collections.module.ts | 2 +- src/app/collections/collections.service.ts | 8 +- ...ividual-collection-sheet.component.spec.ts | 5 +- .../individual-collection-sheet.component.ts | 72 +- .../completion-dialog.component.spec.ts | 5 +- .../completion-dialog.component.ts | 8 +- .../configuration-wizard.component.spec.ts | 5 +- .../configuration-wizard.component.ts | 8 +- .../configuration-wizard.module.ts | 41 +- .../configuration-wizard.service.ts | 5 +- .../continue-setup-dialog.component.spec.ts | 5 +- .../continue-setup-dialog.component.ts | 8 +- .../next-step-dialog.component.spec.ts | 5 +- .../next-step-dialog.component.ts | 14 +- .../popover/popover-arrow.directive.ts | 8 +- .../popover/popover-close.directive.ts | 4 +- .../popover/popover-ref.ts | 31 +- .../popover/popover.component.spec.ts | 5 +- .../popover/popover.service.ts | 136 ++-- src/app/core/alert/alert.service.ts | 2 - .../authentication/authentication.guard.ts | 8 +- .../authentication.interceptor.ts | 2 - .../authentication/authentication.service.ts | 110 +-- src/app/core/core.module.ts | 4 +- src/app/core/dialogs/dialogs.ts | 3 +- src/app/core/http/api-prefix.interceptor.ts | 3 +- src/app/core/http/cache.interceptor.ts | 25 +- .../core/http/error-handler.interceptor.ts | 25 +- src/app/core/http/http-cache.service.ts | 4 +- src/app/core/http/http.service.ts | 32 +- src/app/core/i18n/i18n.service.ts | 4 +- src/app/core/logger/logger.service.ts | 14 +- .../core/progress-bar/progress-bar.service.ts | 2 - .../core/progress-bar/progress.interceptor.ts | 17 +- src/app/core/route/route-reusable-strategy.ts | 6 +- src/app/core/route/route.service.ts | 4 +- .../breadcrumb/breadcrumb.component.spec.ts | 5 +- .../shell/breadcrumb/breadcrumb.component.ts | 65 +- .../shell/content/content.component.spec.ts | 5 +- .../core/shell/content/content.component.ts | 4 +- src/app/core/shell/shell.component.spec.ts | 5 +- src/app/core/shell/shell.component.ts | 17 +- .../core/shell/sidenav/frequent-activities.ts | 2 +- .../shell/sidenav/sidenav.component.spec.ts | 5 +- .../core/shell/sidenav/sidenav.component.ts | 56 +- .../shell/toolbar/toolbar.component.spec.ts | 5 +- .../core/shell/toolbar/toolbar.component.ts | 53 +- src/app/core/utils/accounting.ts | 155 ++-- src/app/core/utils/charges.ts | 21 +- src/app/core/utils/commons.ts | 11 +- src/app/core/utils/datatables.ts | 95 ++- src/app/core/utils/dates.ts | 10 +- src/app/core/utils/dropdownOptions.ts | 39 +- src/app/core/utils/passwords-utility.ts | 56 +- .../fixed-deposit-account-actions.resolver.ts | 11 +- ...d-deposit-account-and-template.resolver.ts | 4 +- ...fixed-deposit-account-template.resolver.ts | 4 +- ...ed-deposit-account-transaction.resolver.ts | 4 +- .../fixed-deposit-account-view.resolver.ts | 4 +- ...te-fixed-deposit-account.component.spec.ts | 5 +- .../create-fixed-deposit-account.component.ts | 41 +- ...it-fixed-deposit-account.component.spec.ts | 5 +- .../edit-fixed-deposit-account.component.ts | 45 +- ...sit-account-charges-step.component.spec.ts | 5 +- ...-deposit-account-charges-step.component.ts | 37 +- ...sit-account-details-step.component.spec.ts | 5 +- ...-deposit-account-details-step.component.ts | 37 +- ...interest-rate-chart-step.component.spec.ts | 5 +- ...ount-interest-rate-chart-step.component.ts | 25 +- ...sit-account-preview-step.component.spec.ts | 5 +- ...-deposit-account-preview-step.component.ts | 34 +- ...it-account-settings-step.component.spec.ts | 5 +- ...deposit-account-settings-step.component.ts | 112 ++- ...posit-account-terms-step.component.spec.ts | 5 +- ...ed-deposit-account-terms-step.component.ts | 84 ++- .../charges-tab/charges-tab.component.spec.ts | 5 +- .../charges-tab/charges-tab.component.ts | 52 +- ...alculate-interest-dialog.component.spec.ts | 5 +- .../calculate-interest-dialog.component.ts | 4 +- ...inactivate-charge-dialog.component.spec.ts | 5 +- .../inactivate-charge-dialog.component.ts | 8 +- .../post-interest-dialog.component.spec.ts | 5 +- .../post-interest-dialog.component.ts | 4 +- ...ggle-withhold-tax-dialog.component.spec.ts | 5 +- .../toggle-withhold-tax-dialog.component.ts | 8 +- .../waive-charge-dialog.component.spec.ts | 5 +- .../waive-charge-dialog.component.ts | 8 +- .../datatable-tabs.component.spec.ts | 5 +- .../datatable-tabs.component.ts | 1 - ...xed-deposit-account-view.component.spec.ts | 5 +- .../fixed-deposit-account-view.component.ts | 48 +- .../fixed-deposits-buttons.config.ts | 14 +- .../general-tab/general-tab.component.spec.ts | 5 +- .../general-tab/general-tab.component.ts | 8 +- .../interest-rate-chart-tab.component.spec.ts | 5 +- .../interest-rate-chart-tab.component.ts | 23 +- ...tanding-instructions-tab.component.spec.ts | 5 +- .../standing-instructions-tab.component.ts | 29 +- .../transactions-tab.component.spec.ts | 5 +- .../transactions-tab.component.ts | 45 +- .../view-transaction.component.spec.ts | 5 +- .../view-transaction.component.ts | 28 +- ...e-fixed-deposits-account.component.spec.ts | 5 +- ...tivate-fixed-deposits-account.component.ts | 21 +- ...e-fixed-deposits-account.component.spec.ts | 5 +- ...charge-fixed-deposits-account.component.ts | 31 +- ...e-fixed-deposits-account.component.spec.ts | 5 +- ...pprove-fixed-deposits-account.component.ts | 23 +- ...e-fixed-deposits-account.component.spec.ts | 5 +- .../close-fixed-deposits-account.component.ts | 35 +- ...deposits-account-actions.component.spec.ts | 5 +- ...ixed-deposits-account-actions.component.ts | 32 +- ...eposits-cash-transaction.component.spec.ts | 5 +- ...xed-deposits-cash-transaction.component.ts | 40 +- ...e-fixed-deposits-account.component.spec.ts | 5 +- ...-close-fixed-deposits-account.component.ts | 41 +- ...t-fixed-deposits-account.component.spec.ts | 5 +- ...reject-fixed-deposits-account.component.ts | 23 +- ...l-fixed-deposits-account.component.spec.ts | 5 +- ...proval-fixed-deposits-account.component.ts | 26 +- ...t-fixed-deposits-account.component.spec.ts | 5 +- ...client-fixed-deposits-account.component.ts | 31 +- .../fixed-deposits-routing.module.ts | 36 +- .../fixed-deposits/fixed-deposits.module.ts | 4 +- .../fixed-deposits/fixed-deposits.service.ts | 24 +- ...urring-deposit-account-actions.resolver.ts | 21 +- ...g-deposit-account-and-template.resolver.ts | 28 +- ...t-account-transaction-template.resolver.ts | 33 +- ...ng-deposit-account-transaction.resolver.ts | 33 +- ...ecurring-deposits-account-data.resolver.ts | 4 +- ...ring-deposits-account-template.resolver.ts | 4 +- ...ecurring-deposits-account-view.resolver.ts | 4 +- ...curring-deposits-account.component.spec.ts | 5 +- ...te-recurring-deposits-account.component.ts | 40 +- ...ecurring-deposit-account.component.spec.ts | 5 +- ...dit-recurring-deposit-account.component.ts | 47 +- ...curring-deposits-account.component.spec.ts | 5 +- ...te-recurring-deposits-account.component.ts | 25 +- ...curring-deposits-account.component.spec.ts | 5 +- ...ge-recurring-deposits-account.component.ts | 29 +- ...curring-deposits-account.component.spec.ts | 5 +- ...ve-recurring-deposits-account.component.ts | 28 +- ...curring-deposits-account.component.spec.ts | 5 +- ...se-recurring-deposits-account.component.ts | 41 +- ...curring-deposits-account.component.spec.ts | 5 +- ...it-recurring-deposits-account.component.ts | 36 +- ...ecurring-deposit-account.component.spec.ts | 5 +- ...ose-recurring-deposit-account.component.ts | 26 +- ...deposits-account-actions.component.spec.ts | 5 +- ...ring-deposits-account-actions.component.ts | 50 +- ...curring-deposits-account.component.spec.ts | 5 +- ...ct-recurring-deposits-account.component.ts | 24 +- ...curring-deposits-account.component.spec.ts | 5 +- ...al-recurring-deposits-account.component.ts | 28 +- ...curring-deposits-account.component.spec.ts | 5 +- ...nt-recurring-deposits-account.component.ts | 28 +- ...its-account-charges-step.component.spec.ts | 5 +- ...deposits-account-charges-step.component.ts | 42 +- ...its-account-details-step.component.spec.ts | 5 +- ...deposits-account-details-step.component.ts | 55 +- ...interest-rate-chart-step.component.spec.ts | 5 +- ...ount-interest-rate-chart-step.component.ts | 26 +- ...its-account-preview-step.component.spec.ts | 5 +- ...deposits-account-preview-step.component.ts | 34 +- ...ts-account-settings-step.component.spec.ts | 5 +- ...eposits-account-settings-step.component.ts | 170 +++-- ...osits-account-terms-step.component.spec.ts | 5 +- ...g-deposits-account-terms-step.component.ts | 51 +- .../charges-tab/charges-tab.component.spec.ts | 5 +- .../charges-tab/charges-tab.component.ts | 42 +- ...osit-confirmation-dialog.component.spec.ts | 5 +- ...g-deposit-confirmation-dialog.component.ts | 8 +- .../datatable-tabs.component.spec.ts | 5 +- .../datatable-tabs.component.ts | 1 - .../general-tab/general-tab.component.spec.ts | 5 +- .../general-tab/general-tab.component.ts | 8 +- .../interest-rate-chart-tab.component.spec.ts | 5 +- .../interest-rate-chart-tab.component.ts | 24 +- ...ng-deposits-account-view.component.spec.ts | 5 +- ...curring-deposits-account-view.component.ts | 80 ++- .../recurring-deposits-buttons.config.ts | 22 +- ...tanding-instructions-tab.component.spec.ts | 5 +- .../standing-instructions-tab.component.ts | 33 +- .../edit-transaction.component.spec.ts | 5 +- .../edit-transaction.component.ts | 46 +- .../transactions-tab.component.spec.ts | 5 +- .../transactions-tab.component.ts | 43 +- .../view-transaction.component.spec.ts | 5 +- .../view-transaction.component.ts | 29 +- .../recurring-deposits-routing.module.ts | 39 +- .../recurring-deposits.module.ts | 2 +- .../recurring-deposits.service.ts | 33 +- src/app/directives/directives.module.ts | 12 +- src/app/directives/format-amount.directive.ts | 71 +- .../has-permission.directive.ts | 24 +- .../common-resolvers/glim-account-resolver.ts | 4 +- .../group-account.resolver.ts | 4 +- .../group-actions.resolver.ts | 4 +- .../group-data-and-template.resolver.ts | 4 +- .../group-datatable.resolver.ts | 4 +- .../group-datatables.resolver.ts | 4 +- .../common-resolvers/group-notes.resolver.ts | 4 +- .../group-summary.resolver.ts | 4 +- .../common-resolvers/group-view.resolver.ts | 4 +- .../common-resolvers/gsim-account-resolver.ts | 4 +- .../create-group.component.spec.ts | 5 +- .../create-group/create-group.component.ts | 62 +- .../edit-group/edit-group.component.spec.ts | 5 +- .../groups/edit-group/edit-group.component.ts | 49 +- src/app/groups/groups-routing.module.ts | 36 +- .../add-role/add-role.component.spec.ts | 5 +- .../add-role/add-role.component.ts | 30 +- .../committee-tab.component.spec.ts | 5 +- .../committee-tab/committee-tab.component.ts | 17 +- .../unassign-role-dialog.component.spec.ts | 5 +- .../unassign-role-dialog.component.ts | 8 +- .../unassign-staff-dialog.component.spec.ts | 5 +- .../unassign-staff-dialog.component.ts | 4 +- .../datatable-tabs.component.spec.ts | 5 +- .../datatable-tabs.component.ts | 2 - .../general-tab/general-tab.component.spec.ts | 5 +- .../general-tab/general-tab.component.ts | 77 +- .../activate-group.component.spec.ts | 5 +- .../activate-group.component.ts | 21 +- .../attach-group-meeting.component.spec.ts | 5 +- .../attach-group-meeting.component.ts | 71 +- .../close-group/close-group.component.spec.ts | 5 +- .../close-group/close-group.component.ts | 26 +- ...t-group-meeting-schedule.component.spec.ts | 5 +- .../edit-group-meeting-schedule.component.ts | 26 +- .../edit-group-meeting.component.spec.ts | 5 +- .../edit-group-meeting.component.ts | 79 +- .../group-actions.component.spec.ts | 5 +- .../group-actions/group-actions.component.ts | 32 +- .../group-assign-staff.component.spec.ts | 5 +- .../group-assign-staff.component.ts | 17 +- .../group-attendance.component.spec.ts | 5 +- .../group-attendance.component.ts | 42 +- .../group-transfer-clients.component.spec.ts | 5 +- .../group-transfer-clients.component.ts | 35 +- .../manage-group-members.component.spec.ts | 5 +- .../manage-group-members.component.ts | 32 +- .../groups-view/groups-view.component.spec.ts | 5 +- .../groups-view/groups-view.component.ts | 22 +- .../notes-tab/notes-tab.component.spec.ts | 5 +- .../notes-tab/notes-tab.component.ts | 13 +- src/app/groups/groups.component.ts | 39 +- src/app/groups/groups.datasource.ts | 24 +- src/app/groups/groups.module.ts | 4 +- src/app/groups/groups.service.ts | 36 +- src/app/home/activities.ts | 116 +-- .../amount-collected-pie.component.spec.ts | 5 +- .../amount-collected-pie.component.ts | 30 +- .../amount-disbursed-pie.component.spec.ts | 5 +- .../amount-disbursed-pie.component.ts | 50 +- .../client-trends-bar.component.spec.ts | 5 +- .../client-trends-bar.component.ts | 64 +- .../dashboard/dashboard.component.spec.ts | 5 +- src/app/home/dashboard/dashboard.component.ts | 49 +- src/app/home/home-routing.module.ts | 3 +- src/app/home/home.component.spec.ts | 5 +- src/app/home/home.component.ts | 62 +- src/app/home/home.module.ts | 6 +- src/app/home/home.service.ts | 36 +- .../timeout-dialog/idle-timeout.service.ts | 39 +- .../session-timeout-dialog.component.spec.ts | 5 +- .../session-timeout-dialog.component.ts | 5 +- .../warning-dialog.component.ts | 2 - src/app/keyboards-shortcut-config.ts | 374 +++++----- ...al-asset-owner-active-transfer.resolver.ts | 26 +- ...rnal-asset-owner-journal-entry.resolver.ts | 26 +- .../external-asset-owner.resolver.ts | 26 +- .../glim-loan-template.resolver.ts | 24 +- .../loan-action-button.resolver.ts | 7 +- .../loan-arrear-delinquency.resolver.ts | 23 +- .../loan-collaterals.resolver.ts | 8 +- .../loan-datatable.resolver.ts | 28 +- .../loan-datatables.resolver.ts | 24 +- .../loan-delinquency-actions.resolver.ts | 26 +- .../loan-delinquency-data.resolver.ts | 26 +- .../loan-delinquency-tags.resolver.ts | 26 +- .../loan-details-charges.resolver.ts | 26 +- .../common-resolvers/loan-details.resolver.ts | 28 +- .../loan-documents.resolver.ts | 26 +- .../common-resolvers/loan-notes.resolver.ts | 26 +- .../loan-reschedules.resolver.ts | 32 +- .../loan-term-variations.resolver.ts | 28 +- .../loans-account-and-template.resolver.ts | 24 +- .../loans-account-charge.resolver.ts | 30 +- .../loans-account-template.resolver.ts | 26 +- ...s-account-transaction-template.resolver.ts | 4 +- .../loans-account-transaction.resolver.ts | 4 +- .../loans-transaction-reciept.resolver.ts | 16 +- .../create-loans-account.component.spec.ts | 5 +- .../create-loans-account.component.ts | 40 +- ...elinquency-action-dialog.component.spec.ts | 5 +- ...oan-delinquency-action-dialog.component.ts | 20 +- ...nt-add-collateral-dialog.component.spec.ts | 5 +- ...account-add-collateral-dialog.component.ts | 34 +- ...guarantor-details-dialog.component.spec.ts | 5 +- ...view-guarantor-details-dialog.component.ts | 9 +- .../edit-loans-account.component.spec.ts | 5 +- .../edit-loans-account.component.ts | 41 +- .../create-glim-account.component.spec.ts | 5 +- .../create-glim-account.component.ts | 32 +- .../glim-charges-step.component.spec.ts | 5 +- .../glim-charges-step.component.ts | 56 +- .../glim-details-step.component.spec.ts | 5 +- .../glim-details-step.component.ts | 50 +- .../glim-preview-step.component.spec.ts | 5 +- .../glim-preview-step.component.ts | 20 +- .../glim-terms-step.component.spec.ts | 5 +- .../glim-terms-step.component.ts | 105 +-- .../glim-account-view.resolver.ts | 4 +- .../glim-account.component.spec.ts | 5 +- .../glim-account/glim-account.component.ts | 20 +- ...ans-account-charges-step.component.spec.ts | 5 +- .../loans-account-charges-step.component.ts | 48 +- ...s-account-datatable-step.component.spec.ts | 5 +- .../loans-account-datatable-step.component.ts | 16 +- ...ans-account-details-step.component.spec.ts | 5 +- .../loans-account-details-step.component.ts | 77 +- ...ans-account-preview-step.component.spec.ts | 5 +- .../loans-account-preview-step.component.ts | 19 +- ...ns-account-schedule-step.component.spec.ts | 5 +- .../loans-account-schedule-step.component.ts | 22 +- ...loans-account-terms-step.component.spec.ts | 5 +- .../loans-account-terms-step.component.ts | 352 +++++---- src/app/loans/loans-routing.module.ts | 68 +- .../account-details.component.spec.ts | 5 +- .../account-details.component.ts | 8 +- .../charges-tab/charges-tab.component.spec.ts | 5 +- .../charges-tab/charges-tab.component.ts | 69 +- .../datatable-tab.component.spec.ts | 5 +- .../datatable-tab/datatable-tab.component.ts | 2 - ...external-asset-owner-tab.component.spec.ts | 5 +- .../external-asset-owner-tab.component.ts | 32 +- .../external-asset-transfer.component.spec.ts | 5 +- .../external-asset-transfer.component.ts | 3 +- .../floating-interest-rates.component.spec.ts | 5 +- .../floating-interest-rates.component.ts | 9 +- .../general-tab/general-tab.component.spec.ts | 5 +- .../general-tab/general-tab.component.ts | 201 +++--- .../add-collateral.component.spec.ts | 5 +- .../add-collateral.component.ts | 26 +- .../add-interest-pause.component.html | 101 +-- .../add-interest-pause.component.scss | 13 +- .../add-interest-pause.component.spec.ts | 5 +- .../add-interest-pause.component.ts | 26 +- .../add-loan-charge.component.spec.ts | 5 +- .../add-loan-charge.component.ts | 41 +- .../adjust-loan-charge.component.spec.ts | 5 +- .../adjust-loan-charge.component.ts | 37 +- .../approve-loan.component.spec.ts | 5 +- .../approve-loan/approve-loan.component.ts | 24 +- .../asset-transfer-loan.component.spec.ts | 5 +- .../asset-transfer-loan.component.ts | 41 +- .../assign-loan-officer.component.spec.ts | 5 +- .../assign-loan-officer.component.ts | 27 +- .../charge-off/charge-off.component.spec.ts | 5 +- .../charge-off/charge-off.component.ts | 27 +- .../close-as-rescheduled.component.spec.ts | 5 +- .../close-as-rescheduled.component.ts | 23 +- .../create-guarantor.component.spec.ts | 5 +- .../create-guarantor.component.ts | 39 +- ...burse-to-savings-account.component.spec.ts | 5 +- .../disburse-to-savings-account.component.ts | 31 +- .../disburse/disburse.component.spec.ts | 5 +- .../disburse/disburse.component.ts | 39 +- .../edit-repayment-schedule.component.spec.ts | 5 +- .../edit-repayment-schedule.component.ts | 59 +- .../foreclosure/foreclosure.component.spec.ts | 5 +- .../foreclosure/foreclosure.component.ts | 48 +- .../loan-account-actions.component.html | 5 +- .../loan-account-actions.component.spec.ts | 5 +- .../loan-account-actions.component.ts | 149 ++-- ...an-credit-balance-refund.component.spec.ts | 5 +- .../loan-credit-balance-refund.component.ts | 31 +- .../loan-reaging.component.spec.ts | 5 +- .../loan-reaging/loan-reaging.component.ts | 36 +- .../loan-reamortize.component.spec.ts | 5 +- .../loan-reamortize.component.ts | 20 +- .../loan-reschedule.component.spec.ts | 5 +- .../loan-reschedule.component.ts | 43 +- .../loan-screen-reports.component.spec.ts | 5 +- .../loan-screen-reports.component.ts | 10 +- .../loans-account-close.component.spec.ts | 5 +- .../loans-account-close.component.ts | 24 +- .../make-repayment.component.spec.ts | 5 +- .../make-repayment.component.ts | 33 +- .../prepay-loan/prepay-loan.component.spec.ts | 5 +- .../prepay-loan/prepay-loan.component.ts | 37 +- .../recovery-repayment.component.spec.ts | 5 +- .../recovery-repayment.component.ts | 31 +- .../reject-loan/reject-loan.component.spec.ts | 5 +- .../reject-loan/reject-loan.component.ts | 23 +- .../undo-approval.component.spec.ts | 5 +- .../undo-approval/undo-approval.component.ts | 16 +- .../undo-disbursal.component.spec.ts | 5 +- .../undo-disbursal.component.ts | 14 +- .../view-guarantors.component.spec.ts | 5 +- .../view-guarantors.component.ts | 26 +- .../waive-interest.component.spec.ts | 5 +- .../waive-interest.component.ts | 30 +- .../withdrawn-by-client.component.spec.ts | 5 +- .../withdrawn-by-client.component.ts | 22 +- .../write-off-page.component.spec.ts | 5 +- .../write-off-page.component.ts | 27 +- .../loans-view/loan-accounts-button-config.ts | 114 ++- .../loan-collateral-tab.component.spec.ts | 5 +- .../loan-collateral-tab.component.ts | 9 +- ...oan-delinquency-tags-tab.component.spec.ts | 5 +- .../loan-delinquency-tags-tab.component.ts | 84 ++- .../loan-documents-tab.component.spec.ts | 5 +- .../loan-documents-tab.component.ts | 33 +- .../loan-term-variations-tab.component.html | 40 +- ...loan-term-variations-tab.component.spec.ts | 5 +- .../loan-term-variations-tab.component.ts | 29 +- .../loan-tranche-details.component.spec.ts | 5 +- .../loan-tranche-details.component.ts | 49 +- .../loans-view/loans-view.component.spec.ts | 5 +- .../loans/loans-view/loans-view.component.ts | 87 ++- .../notes-tab/notes-tab.component.spec.ts | 5 +- .../notes-tab/notes-tab.component.ts | 13 +- .../original-schedule-tab.component.spec.ts | 5 +- .../original-schedule-tab.component.ts | 13 +- .../overdue-charges-tab.component.spec.ts | 5 +- .../overdue-charges-tab.component.ts | 11 +- .../repayment-schedule-tab.component.spec.ts | 5 +- .../repayment-schedule-tab.component.ts | 51 +- .../reschedule-loan-tab.component.spec.ts | 5 +- .../reschedule-loan-tab.component.ts | 34 +- ...tanding-instructions-tab.component.spec.ts | 5 +- .../standing-instructions-tab.component.ts | 33 +- .../transactions-tab.component.spec.ts | 5 +- .../transactions-tab.component.ts | 121 +++- .../edit-transaction.component.spec.ts | 5 +- .../edit-transaction.component.ts | 51 +- .../export-transactions.component.spec.ts | 5 +- .../export-transactions.component.ts | 41 +- .../view-reciept.component.spec.ts | 5 +- .../view-reciept/view-reciept.component.ts | 10 +- .../view-transaction.component.spec.ts | 5 +- .../view-transaction.component.ts | 86 ++- .../view-charge/view-charge.component.spec.ts | 5 +- .../view-charge/view-charge.component.ts | 43 +- src/app/loans/loans.module.ts | 2 +- src/app/loans/loans.service.ts | 93 ++- src/app/loans/models/loan-account.model.ts | 169 +++-- .../models/loan-transaction-type.model.ts | 62 +- .../services/external-asset-owner.service.ts | 4 +- .../loans/services/external-asset-owner.ts | 15 +- .../login-form/login-form.component.spec.ts | 5 +- .../login/login-form/login-form.component.ts | 40 +- src/app/login/login-routing.module.ts | 2 +- src/app/login/login.component.spec.ts | 5 +- src/app/login/login.component.ts | 10 +- src/app/login/login.module.ts | 2 +- .../confirm-password.validator.ts | 2 +- .../reset-password.component.spec.ts | 5 +- .../reset-password.component.ts | 47 +- ...wo-factor-authentication.component.spec.ts | 5 +- .../two-factor-authentication.component.ts | 84 ++- .../center-navigation.component.spec.ts | 5 +- .../center-navigation.component.ts | 5 +- .../client-navigation.component.spec.ts | 5 +- .../client-navigation.component.ts | 4 +- .../group-navigation.component.spec.ts | 5 +- .../group-navigation.component.ts | 5 +- .../loan-account-table.component.spec.ts | 5 +- .../loan-account-table.component.ts | 25 +- .../member-groups.component.spec.ts | 5 +- .../member-groups/member-groups.component.ts | 9 +- .../navigation/navigation-routing.module.ts | 3 +- .../navigation/navigation.component.spec.ts | 5 +- src/app/navigation/navigation.component.ts | 20 +- src/app/navigation/navigation.module.ts | 2 +- src/app/navigation/navigation.service.ts | 21 +- .../office-navigation.component.spec.ts | 5 +- .../office-navigation.component.ts | 5 +- src/app/navigation/offices.resolver.ts | 2 - .../savings-account-table.component.spec.ts | 5 +- .../savings-account-table.component.ts | 25 +- .../share-account-table.component.spec.ts | 5 +- .../share-account-table.component.ts | 25 +- .../staff-navigation.component.spec.ts | 5 +- .../staff-navigation.component.ts | 4 +- src/app/not-found/not-found.component.spec.ts | 5 +- src/app/not-found/not-found.component.ts | 8 +- .../notifications-page.component.spec.ts | 5 +- .../notifications-page.component.ts | 29 +- .../notifications-routing.module.ts | 3 +- src/app/notifications/notifications.module.ts | 2 +- .../notifications/notifications.resolver.ts | 2 - .../notifications/notifications.service.ts | 29 +- .../adhoc-query-template.resolver.ts | 2 - .../adhoc-query/adhoc-query.component.spec.ts | 5 +- .../adhoc-query/adhoc-query.component.ts | 14 +- .../adhoc-queries.resolver.ts | 2 - .../adhoc-query-and-template.resolver.ts | 2 - .../common-resolvers/adhoc-query.resolver.ts | 2 - .../create-adhoc-query.component.spec.ts | 5 +- .../create-adhoc-query.component.ts | 58 +- .../edit-adhoc-query.component.spec.ts | 5 +- .../edit-adhoc-query.component.ts | 58 +- .../view-adhoc-query.component.spec.ts | 5 +- .../view-adhoc-query.component.ts | 15 +- .../bulk-import/bulk-import.component.spec.ts | 5 +- .../bulk-import/bulk-import.resolver.ts | 7 +- .../view-bulk-import/bulk-imports.ts | 254 +++---- .../view-bulk-import.component.spec.ts | 5 +- .../view-bulk-import.component.ts | 56 +- .../bulk-loan-reassignmnet.component.spec.ts | 5 +- .../bulk-loan-reassignmnet.component.ts | 30 +- .../currencies/currencies.component.spec.ts | 5 +- .../currencies/currencies.component.ts | 32 +- .../currencies/currencies.resolver.ts | 2 - .../manage-currencies.component.spec.ts | 5 +- .../manage-currencies.component.ts | 93 ++- .../create-employee.component.spec.ts | 5 +- .../create-employee.component.ts | 63 +- .../employees/edit-employee.resolver.ts | 4 +- .../edit-employee.component.spec.ts | 5 +- .../edit-employee/edit-employee.component.ts | 56 +- .../employees/employee.resolver.ts | 4 +- .../employees/employees.component.spec.ts | 5 +- .../employees/employees.component.ts | 32 +- .../employees/employees.resolver.ts | 2 - .../view-employee.component.spec.ts | 5 +- .../view-employee/view-employee.component.ts | 2 - ...-enity-data-table-checks.component.spec.ts | 5 +- ...reate-enity-data-table-checks.component.ts | 35 +- ...ity-data-table-checks-template.resolver.ts | 2 - ...entity-data-table-checks.component.spec.ts | 5 +- .../entity-data-table-checks.component.ts | 38 +- .../entity-data-table-checks.resolver.ts | 2 - .../advance-search-template.resolver.ts | 2 - .../fund-mapping.component.spec.ts | 5 +- .../fund-mapping/fund-mapping.component.ts | 67 +- .../create-holiday/checklist-db.class.ts | 63 +- .../create-holiday.component.spec.ts | 5 +- .../create-holiday.component.ts | 65 +- .../create-holiday/create-holiday.service.ts | 21 +- .../create-holiday/office-flat-item.class.ts | 10 +- .../create-holiday/office-item.class.ts | 6 +- .../edit-holiday.component.spec.ts | 5 +- .../edit-holiday/edit-holiday.component.ts | 56 +- .../holidays/holiday-template.resolver.ts | 2 - .../organization/holidays/holiday.resolver.ts | 4 +- .../holidays/holidays.component.spec.ts | 5 +- .../holidays/holidays.component.ts | 34 +- .../view-holidays.component.spec.ts | 5 +- .../view-holidays/view-holidays.component.ts | 30 +- .../investors/investors.component.spec.ts | 5 +- .../investors/investors.component.ts | 46 +- ...isioning-criteria-and-template.resolver.ts | 2 - ...provisioning-criteria-template.resolver.ts | 2 - .../loan-provisioning-criteria.resolver.ts | 2 - .../loan-provisioning-criterias.resolver.ts | 2 - ...an-provisioning-criteria.component.spec.ts | 5 +- ...te-loan-provisioning-criteria.component.ts | 160 +++-- ...an-provisioning-criteria.component.spec.ts | 5 +- ...it-loan-provisioning-criteria.component.ts | 161 +++-- ...an-provisioning-criteria.component.spec.ts | 5 +- .../loan-provisioning-criteria.component.ts | 9 +- ...an-provisioning-criteria.component.spec.ts | 5 +- ...ew-loan-provisioning-criteria.component.ts | 34 +- .../create-fund/create-fund.component.spec.ts | 5 +- .../create-fund/create-fund.component.ts | 29 +- .../edit-fund/edit-fund.component.spec.ts | 5 +- .../edit-fund/edit-fund.component.ts | 26 +- .../manage-funds.component.spec.ts | 5 +- .../manage-funds/manage-funds.component.ts | 54 +- .../manage-funds/manage-funds.resolver.ts | 2 - .../view-fund/view-fund.component.spec.ts | 5 +- .../view-fund/view-fund.component.ts | 2 - .../common-resolvers/edit-office.resolver.ts | 2 - .../office-datatable.resolver.ts | 4 +- .../office-datatables.resolver.ts | 4 +- .../common-resolvers/office.resolver.ts | 2 - .../common-resolvers/offices.resolver.ts | 2 - .../create-office.component.spec.ts | 5 +- .../create-office/create-office.component.ts | 76 +- .../edit-office/edit-office.component.spec.ts | 5 +- .../edit-office/edit-office.component.ts | 56 +- .../organization/offices/office-node.model.ts | 20 +- .../offices/office-tree-service.service.ts | 19 +- .../offices/offices.component.spec.ts | 5 +- .../organization/offices/offices.component.ts | 34 +- .../datatable-tabs.component.spec.ts | 5 +- .../datatable-tabs.component.ts | 1 - .../general-tab/general-tab.component.spec.ts | 5 +- .../general-tab/general-tab.component.ts | 2 - .../view-office/view-office.component.spec.ts | 5 +- .../view-office/view-office.component.ts | 2 - .../organization-routing.module.ts | 57 +- .../organization.component.spec.ts | 5 +- .../organization/organization.component.ts | 32 +- src/app/organization/organization.module.ts | 4 +- src/app/organization/organization.service.ts | 38 +- .../password-preferences-template.resolver.ts | 2 - .../password-preferences.component.spec.ts | 5 +- .../password-preferences.component.ts | 16 +- .../create-payment-type.component.spec.ts | 5 +- .../create-payment-type.component.ts | 28 +- .../edit-payment-type.component.spec.ts | 5 +- .../edit-payment-type.component.ts | 30 +- .../payment-types.component.spec.ts | 5 +- .../payment-types/payment-types.component.ts | 31 +- .../payment-types/payment-types.resolver.ts | 4 +- .../sms-campaign-template.resolver.ts | 2 - .../common-resolvers/sms-campaign.resolver.ts | 4 +- .../sms-campaigns.resolver.ts | 2 - .../create-campaign.component.spec.ts | 5 +- .../create-campaign.component.ts | 22 +- .../edit-campaign.component.spec.ts | 5 +- .../edit-campaign/edit-campaign.component.ts | 21 +- .../campaign-message-step.component.spec.ts | 5 +- .../campaign-message-step.component.ts | 4 +- .../campaign-preview-step.component.spec.ts | 5 +- .../campaign-preview-step.component.ts | 6 +- ...business-rule-parameters.component.spec.ts | 5 +- ...edit-business-rule-parameters.component.ts | 94 +-- .../edit-sms-campaign-step.component.spec.ts | 5 +- .../edit-sms-campaign-step.component.ts | 44 +- ...business-rule-parameters.component.spec.ts | 5 +- .../business-rule-parameters.component.ts | 70 +- .../sms-campaign-step.component.spec.ts | 5 +- .../sms-campaign-step.component.ts | 71 +- .../sms-campaigns.component.spec.ts | 5 +- .../sms-campaigns/sms-campaigns.component.ts | 28 +- .../view-campaign.component.spec.ts | 5 +- .../view-campaign/view-campaign.component.ts | 59 +- ...ing-instructions-history.component.spec.ts | 5 +- ...standing-instructions-history.component.ts | 39 +- ...standing-instructions-template.resolver.ts | 2 - .../allocate-cash.component.spec.ts | 5 +- .../allocate-cash/allocate-cash.component.ts | 62 +- .../cashiers/cashiers.component.spec.ts | 5 +- .../tellers/cashiers/cashiers.component.ts | 11 +- .../create-cashier.component.spec.ts | 5 +- .../create-cashier.component.ts | 37 +- .../edit-cashier.component.spec.ts | 5 +- .../edit-cashier/edit-cashier.component.ts | 49 +- .../settle-cash/settle-cash.component.spec.ts | 5 +- .../settle-cash/settle-cash.component.ts | 62 +- .../transactions.component.spec.ts | 5 +- .../transactions/transactions.component.ts | 22 +- .../view-cashier.component.spec.ts | 5 +- .../view-cashier/view-cashier.component.ts | 14 +- .../common-resolvers/cashier.resolver.ts | 2 - .../common-resolvers/cashiers.resolver.ts | 2 - .../common-resolvers/edit-cashier.resolver.ts | 2 - .../teller-transaction-template.resolver.ts | 2 - .../common-resolvers/teller.resolver.ts | 2 - .../common-resolvers/tellers.resolver.ts | 2 - .../create-teller.component.spec.ts | 5 +- .../create-teller/create-teller.component.ts | 56 +- .../edit-teller/edit-teller.component.spec.ts | 5 +- .../edit-teller/edit-teller.component.ts | 61 +- .../teller-transaction-template.resolver.ts | 2 - .../tellers/tellers.component.spec.ts | 5 +- .../organization/tellers/tellers.component.ts | 12 +- .../view-teller/view-teller.component.spec.ts | 5 +- .../view-teller/view-teller.component.ts | 19 +- .../working-days.component.spec.ts | 5 +- .../working-days/working-days.component.ts | 54 +- .../working-days/working-days.resolver.ts | 2 - src/app/pipes/accounts-filter.pipe.ts | 47 +- src/app/pipes/charges-filter.pipe.ts | 8 +- src/app/pipes/charges-penalty-filter.pipe.ts | 2 - src/app/pipes/date-format.pipe.spec.ts | 8 +- src/app/pipes/date-format.pipe.ts | 5 +- src/app/pipes/datetime-format.pipe.ts | 4 +- src/app/pipes/external-identifier.pipe.ts | 4 +- src/app/pipes/find.pipe.ts | 2 - src/app/pipes/format-number.pipe.ts | 9 +- src/app/pipes/pipes.module.ts | 93 +-- src/app/pipes/pretty-print.pipe.ts | 21 +- src/app/pipes/status-lookup.pipe.ts | 9 +- src/app/pipes/translate.pipe.ts | 4 +- src/app/pipes/truncate-text.pipe.ts | 2 - src/app/pipes/url-to-string.pipe.ts | 25 +- src/app/pipes/yesno.pipe.ts | 4 +- src/app/products/charges/charge.resolver.ts | 2 - .../charges/charges-template-and-resolver.ts | 20 +- .../charges/charges-template.resolver.ts | 2 - .../charges/charges.component.spec.ts | 5 +- src/app/products/charges/charges.component.ts | 41 +- src/app/products/charges/charges.resolver.ts | 2 - .../create-charge.component.spec.ts | 5 +- .../create-charge/create-charge.component.ts | 117 ++- .../edit-charge/edit-charge.component.spec.ts | 5 +- .../edit-charge/edit-charge.component.ts | 75 +- .../products/charges/models/charge.model.ts | 88 +-- .../view-charge/view-charge.component.spec.ts | 5 +- .../view-charge/view-charge.component.ts | 17 +- .../collaterals/collateral.resolver.ts | 2 - .../collaterals-template.resolver.ts | 22 +- .../collaterals/collaterals.component.spec.ts | 5 +- .../collaterals/collaterals.component.ts | 16 +- .../collaterals/collaterals.resolver.ts | 22 +- .../create-collateral.component.spec.ts | 5 +- .../create-collateral.component.ts | 54 +- .../edit-collateral.component.spec.ts | 5 +- .../edit-collateral.component.ts | 61 +- .../view-collateral.component.spec.ts | 5 +- .../view-collateral.component.ts | 31 +- ...ct-incentive-form-dialog.component.spec.ts | 5 +- ...product-incentive-form-dialog.component.ts | 67 +- ...te-fixed-deposit-product.component.spec.ts | 5 +- .../create-fixed-deposit-product.component.ts | 48 +- ...it-fixed-deposit-product.component.spec.ts | 5 +- .../edit-fixed-deposit-product.component.ts | 44 +- ...d-deposit-product-and-template.resolver.ts | 4 +- ...-product-accounting-step.component.spec.ts | 5 +- ...posit-product-accounting-step.component.ts | 269 ++++--- ...sit-product-charges-step.component.spec.ts | 5 +- ...-deposit-product-charges-step.component.ts | 19 +- ...it-product-currency-step.component.spec.ts | 5 +- ...deposit-product-currency-step.component.ts | 24 +- ...sit-product-details-step.component.spec.ts | 5 +- ...-deposit-product-details-step.component.ts | 23 +- ...interest-rate-chart-step.component.spec.ts | 5 +- ...duct-interest-rate-chart-step.component.ts | 147 ++-- ...sit-product-preview-step.component.spec.ts | 5 +- ...-deposit-product-preview-step.component.ts | 86 ++- ...it-product-settings-step.component.spec.ts | 5 +- ...deposit-product-settings-step.component.ts | 89 ++- ...posit-product-terms-step.component.spec.ts | 5 +- ...ed-deposit-product-terms-step.component.ts | 48 +- .../fixed-deposit-product.resolver.ts | 4 +- ...ixed-deposit-products-template.resolver.ts | 2 - .../fixed-deposit-products.component.spec.ts | 5 +- .../fixed-deposit-products.component.ts | 33 +- .../fixed-deposit-products.resolver.ts | 2 - ...ed-deposit-datatable-tab.component.spec.ts | 5 +- .../fixed-deposit-datatable-tab.component.ts | 1 - ...ixed-deposit-general-tab.component.spec.ts | 5 +- .../fixed-deposit-general-tab.component.ts | 45 +- ...ew-fixed-deposit-product.component.spec.ts | 5 +- .../view-fixed-deposit-product.component.ts | 3 - .../create-floating-rate.component.spec.ts | 5 +- .../create-floating-rate.component.ts | 68 +- .../edit-floating-rate.component.spec.ts | 5 +- .../edit-floating-rate.component.ts | 59 +- ...ating-rate-period-dialog.component.spec.ts | 5 +- .../floating-rate-period-dialog.component.ts | 28 +- .../floating-rates/floating-rate.resolver.ts | 2 - .../floating-rates.component.spec.ts | 5 +- .../floating-rates.component.ts | 19 +- .../floating-rates/floating-rates.resolver.ts | 2 - .../view-floating-rate.component.spec.ts | 5 +- .../view-floating-rate.component.ts | 16 +- .../loan-product-summary.component.spec.ts | 5 +- .../loan-product-summary.component.ts | 273 ++++--- .../create-loan-product.component.spec.ts | 5 +- .../create-loan-product.component.ts | 73 +- .../edit-loan-product.component.spec.ts | 5 +- .../edit-loan-product.component.ts | 74 +- .../loan-product-and-template.resolver.ts | 2 - .../loan-product-datatable.resolver.ts | 4 +- .../loan-product-datatables.resolver.ts | 3 +- ...oan-product-accounting-step.component.html | 12 +- ...-product-accounting-step.component.spec.ts | 5 +- .../loan-product-accounting-step.component.ts | 392 ++++++---- ...oan-product-charges-step.component.spec.ts | 5 +- .../loan-product-charges-step.component.ts | 31 +- ...an-product-currency-step.component.spec.ts | 5 +- .../loan-product-currency-step.component.ts | 26 +- ...oan-product-details-step.component.spec.ts | 5 +- .../loan-product-details-step.component.ts | 48 +- ...uct-interest-refund-step.component.spec.ts | 5 +- ...-product-interest-refund-step.component.ts | 20 +- ...e-payment-allocation-tab.component.spec.ts | 5 +- ...dvance-payment-allocation-tab.component.ts | 45 +- ...ct-payment-strategy-step.component.spec.ts | 5 +- ...product-payment-strategy-step.component.ts | 41 +- .../payment-allocation-model.ts | 98 ++- ...oan-product-preview-step.component.spec.ts | 5 +- .../loan-product-preview-step.component.ts | 8 +- ...an-product-settings-step.component.spec.ts | 5 +- .../loan-product-settings-step.component.ts | 672 +++++++++++------- .../loan-product-terms-step.component.spec.ts | 5 +- .../loan-product-terms-step.component.ts | 287 +++++--- .../loan-products/loan-product.resolver.ts | 4 +- .../loan-products-template.resolver.ts | 2 - .../loan-products.component.spec.ts | 5 +- .../loan-products/loan-products.component.ts | 32 +- .../loan-products/loan-products.resolver.ts | 2 - .../products/loan-products/loan-products.ts | 22 +- .../models/loan-account.model.ts | 44 +- .../models/loan-product.model.ts | 309 ++++---- .../services/processing-strategy.service.ts | 18 +- .../datatable-tab.component.spec.ts | 5 +- .../datatable-tab/datatable-tab.component.ts | 2 - .../general-tab/general-tab.component.spec.ts | 5 +- .../general-tab/general-tab.component.ts | 35 +- ...vance-paymeny-allocation.component.spec.ts | 5 +- ...ew-advance-paymeny-allocation.component.ts | 18 +- .../view-loan-product.component.spec.ts | 5 +- .../view-loan-product.component.ts | 2 - .../create-bucket.component.spec.ts | 5 +- .../create-bucket/create-bucket.component.ts | 42 +- .../delinquency-bucket.component.resolver.ts | 4 +- .../delinquency-bucket.component.spec.ts | 5 +- .../delinquency-bucket.component.ts | 5 +- .../edit-bucket/edit-bucket.component.spec.ts | 5 +- .../edit-bucket/edit-bucket.component.ts | 58 +- .../view-bucket/view-bucket.component.spec.ts | 5 +- .../view-bucket/view-bucket.component.ts | 10 +- .../create-range.component.spec.ts | 5 +- .../create-range/create-range.component.ts | 37 +- .../delinquency-range.component.resolver.ts | 2 - .../delinquency-range.component.spec.ts | 5 +- .../delinquency-range.component.ts | 11 +- .../edit-range/edit-range.component.spec.ts | 5 +- .../edit-range/edit-range.component.ts | 36 +- .../view-range/view-range.component.spec.ts | 5 +- .../view-range/view-range.component.ts | 8 +- ...nage-delinquency-buckets.component.spec.ts | 5 +- .../manage-delinquency-buckets.component.ts | 5 +- .../create-tax-component.component.spec.ts | 5 +- .../create-tax-component.component.ts | 49 +- .../edit-tax-component.component.spec.ts | 5 +- .../edit-tax-component.component.ts | 52 +- .../manage-tax-components.component.spec.ts | 5 +- .../manage-tax-components.component.ts | 11 +- .../manage-tax-components.resolver.ts | 2 - .../tax-component-template.resolver.ts | 2 - .../tax-component.resolver.ts | 1 - .../view-tax-component.component.spec.ts | 5 +- .../view-tax-component.component.ts | 2 - ...anage-tax-configurations.component.spec.ts | 5 +- .../manage-tax-configurations.component.ts | 7 +- .../create-tax-group.component.spec.ts | 5 +- .../create-tax-group.component.ts | 46 +- .../manage-tax-group-template.resolver.ts | 24 +- .../edit-tax-group.component.spec.ts | 5 +- .../edit-tax-group.component.ts | 49 +- .../edit-tax-group/edit-tax-group.resolver.ts | 25 +- .../manage-tax-groups.component.spec.ts | 5 +- .../manage-tax-groups.component.ts | 4 +- .../manage-tax-groups.resolver.ts | 2 - .../manage-tax-groups/tax-group.resolver.ts | 1 - .../view-tax-group.component.spec.ts | 5 +- .../view-tax-group.component.ts | 2 - .../create-product-mix.component.spec.ts | 5 +- .../create-product-mix.component.ts | 45 +- .../edit-product-mix.component.spec.ts | 5 +- .../edit-product-mix.component.ts | 23 +- .../products-mix-template.resolver.ts | 2 - .../products-mix.component.spec.ts | 5 +- .../products-mix/products-mix.component.ts | 4 +- .../products-mix/products-mix.resolver.ts | 2 - .../view-product-mix.componenent.spec.ts | 49 +- .../view-product-mix.component.ts | 207 +++--- .../view-product-mix.resolver.ts | 1 - src/app/products/products-routing.module.ts | 153 ++-- src/app/products/products.component.ts | 25 +- src/app/products/products.module.ts | 248 +++---- src/app/products/products.service.ts | 22 +- ...ecurring-deposit-product.component.spec.ts | 5 +- ...ate-recurring-deposit-product.component.ts | 48 +- ...ecurring-deposit-product.component.spec.ts | 5 +- ...dit-recurring-deposit-product.component.ts | 44 +- ...g-deposit-product-and-template.resolver.ts | 28 +- ...-product-accounting-step.component.spec.ts | 5 +- ...posit-product-accounting-step.component.ts | 284 +++++--- ...sit-product-charges-step.component.spec.ts | 5 +- ...-deposit-product-charges-step.component.ts | 21 +- ...it-product-currency-step.component.spec.ts | 5 +- ...deposit-product-currency-step.component.ts | 25 +- ...sit-product-details-step.component.spec.ts | 5 +- ...-deposit-product-details-step.component.ts | 23 +- ...interest-rate-chart-step.component.spec.ts | 5 +- ...duct-interest-rate-chart-step.component.ts | 143 ++-- ...sit-product-preview-step.component.spec.ts | 5 +- ...-deposit-product-preview-step.component.ts | 88 ++- ...it-product-settings-step.component.spec.ts | 5 +- ...deposit-product-settings-step.component.ts | 100 +-- ...posit-product-terms-step.component.spec.ts | 5 +- ...ng-deposit-product-terms-step.component.ts | 48 +- .../recurring-deposit-product.resolver.ts | 4 +- ...ring-deposit-products-template.resolver.ts | 4 +- ...curring-deposit-products.component.spec.ts | 5 +- .../recurring-deposit-products.component.ts | 54 +- .../recurring-deposit-products.resolver.ts | 2 - ...ng-deposit-datatable-tab.component.spec.ts | 5 +- ...curring-deposit-datatable-tab.component.ts | 2 - ...ring-deposit-general-tab.component.spec.ts | 5 +- ...recurring-deposit-general-tab.component.ts | 46 +- ...ecurring-deposit-product.component.spec.ts | 5 +- ...iew-recurring-deposit-product.component.ts | 2 - .../create-saving-product.component.spec.ts | 5 +- .../create-saving-product.component.ts | 42 +- .../edit-saving-product.component.spec.ts | 5 +- .../edit-saving-product.component.ts | 47 +- .../saving-product-and-template.resolver.ts | 2 - .../saving-product-datatable.resolver.ts | 4 +- .../saving-product-datatables.resolver.ts | 9 +- ...-product-accounting-step.component.spec.ts | 5 +- ...aving-product-accounting-step.component.ts | 293 +++++--- ...ing-product-charges-step.component.spec.ts | 5 +- .../saving-product-charges-step.component.ts | 18 +- ...ng-product-currency-step.component.spec.ts | 5 +- .../saving-product-currency-step.component.ts | 22 +- ...ing-product-details-step.component.spec.ts | 5 +- .../saving-product-details-step.component.ts | 20 +- ...ing-product-preview-step.component.spec.ts | 5 +- .../saving-product-preview-step.component.ts | 78 +- ...ng-product-settings-step.component.spec.ts | 5 +- .../saving-product-settings-step.component.ts | 101 ++- ...aving-product-terms-step.component.spec.ts | 5 +- .../saving-product-terms-step.component.ts | 37 +- .../saving-product.resolver.ts | 2 - .../saving-products-template.resolver.ts | 2 - .../saving-products.component.spec.ts | 5 +- .../saving-products.component.ts | 23 +- .../saving-products.resolver.ts | 2 - ...ng-product-datatable-tab.component.spec.ts | 5 +- .../saving-product-datatable-tab.component.ts | 1 - ...ving-product-general-tab.component.spec.ts | 5 +- .../saving-product-general-tab.component.ts | 24 +- .../view-saving-product.component.spec.ts | 5 +- .../view-saving-product.component.ts | 2 - .../create-dividend.component.spec.ts | 5 +- .../create-dividend.component.ts | 32 +- .../create-share-product.component.spec.ts | 5 +- .../create-share-product.component.ts | 45 +- .../dividends.component.spec.ts | 5 +- .../dividends.components.ts | 22 +- .../dividends.resolver.ts | 2 - .../edit-share-product.component.spec.ts | 5 +- .../edit-share-product.component.ts | 49 +- .../share-product-and-template.resolver.ts | 2 - .../share-product-datatable.resolver.ts | 10 +- .../share-product-datatables.resolver.ts | 9 +- .../share-products/share-product-resolver.ts | 2 - ...-product-accounting-step.component.spec.ts | 5 +- ...share-product-accounting-step.component.ts | 44 +- ...are-product-charges-step.component.spec.ts | 5 +- .../share-product-charges-step.component.ts | 21 +- ...re-product-currency-step.component.spec.ts | 5 +- .../share-product-currency-step.component.ts | 27 +- ...are-product-details-step.component.spec.ts | 5 +- .../share-product-details-step.component.ts | 23 +- ...roduct-market-price-step.component.spec.ts | 5 +- ...are-product-market-price-step.component.ts | 33 +- ...are-product-preview-step.component.spec.ts | 5 +- .../share-product-preview-step.component.ts | 16 +- ...re-product-settings-step.component.spec.ts | 5 +- .../share-product-settings-step.component.ts | 40 +- ...share-product-terms-step.component.spec.ts | 5 +- .../share-product-terms-step.component.ts | 38 +- .../share-products-template.resolver.ts | 2 - .../share-products.component.spec.ts | 5 +- .../share-products.component.ts | 32 +- .../share-products/share-products.resolver.ts | 2 - .../view-dividend-data.resolver.ts | 2 - .../view-dividend.component.spec.ts | 5 +- .../view-dividend/view-dividend.component.ts | 25 +- ...re-product-datatable-tab.component.spec.ts | 5 +- .../share-product-datatable-tab.component.ts | 2 - ...hare-product-general-tab.component.spec.ts | 5 +- .../share-product-general-tab.component.ts | 20 +- .../view-share-product.component.spec.ts | 5 +- .../view-share-product.component.ts | 2 - src/app/profile/profile-routing.module.ts | 7 +- src/app/profile/profile.component.spec.ts | 5 +- src/app/profile/profile.component.ts | 21 +- src/app/profile/profile.module.ts | 2 +- .../reports/common-models/chart-data.model.ts | 2 - .../common-models/report-parameter.model.ts | 52 +- .../common-models/select-option.model.ts | 12 +- .../common-resolvers/mixmappings.resolver.ts | 2 - .../common-resolvers/mixtaxonomy.resolver.ts | 2 - .../common-resolvers/reports.resolver.ts | 2 - .../common-resolvers/run-report.resolver.ts | 2 - src/app/reports/reports-routing.module.ts | 3 +- src/app/reports/reports.component.ts | 52 +- src/app/reports/reports.module.ts | 4 +- src/app/reports/reports.service.ts | 67 +- .../run-report/chart/chart.component.spec.ts | 5 +- .../run-report/chart/chart.component.ts | 57 +- .../pentaho/pentaho.component.spec.ts | 5 +- .../run-report/pentaho/pentaho.component.ts | 25 +- .../run-report/run-report.component.spec.ts | 5 +- .../run-report/run-report.component.ts | 106 +-- .../table-and-sms.component.spec.ts | 5 +- .../table-and-sms/table-and-sms.component.ts | 56 +- .../xbrl-report/xbrl-report.component.spec.ts | 5 +- .../xbrl-report/xbrl-report.component.ts | 45 +- src/app/reports/xbrl/xbrl.component.spec.ts | 5 +- src/app/reports/xbrl/xbrl.component.ts | 41 +- .../saving-documents.resolver.ts | 30 +- .../common-resolvers/saving-notes.resolver.ts | 30 +- .../savings-account-actions.resolver.ts | 10 +- .../savings-account-and-template.resolver.ts | 4 +- .../savings-account-charge.resolver.ts | 4 +- .../savings-account-template.resolver.ts | 6 +- ...s-account-transaction-template.resolver.ts | 4 +- .../savings-account-transaction.resolver.ts | 4 +- .../savings-account-view.resolver.ts | 4 +- .../savings-datatable.resolver.ts | 9 +- .../savings-datatables.resolver.ts | 4 +- .../savings-transaction-reciept.resolver.ts | 20 +- .../transaction-datatable.resolver.ts | 2 +- .../transaction-datatables.resolver.ts | 3 +- .../create-savings-account.component.spec.ts | 5 +- .../create-savings-account.component.ts | 37 +- .../edit-savings-account.component.spec.ts | 5 +- .../edit-savings-account.component.ts | 38 +- .../create-gsim-account.component.spec.ts | 5 +- .../create-gsim-account.component.ts | 53 +- .../gsim-account.component.spec.ts | 5 +- .../gsim-account/gsim-account.component.ts | 22 +- .../gsim-account/gsim-account.resolver.ts | 4 +- .../savings-account-transaction.model.ts | 93 ++- ...activate-savings-account.component.spec.ts | 5 +- .../activate-savings-account.component.ts | 21 +- ...d-charge-savings-account.component.spec.ts | 5 +- .../add-charge-savings-account.component.ts | 45 +- ...ual-fees-savings-account.component.spec.ts | 5 +- ...y-annual-fees-savings-account.component.ts | 43 +- .../approve-savings-account.component.spec.ts | 5 +- .../approve-savings-account.component.ts | 23 +- .../close-savings-account.component.spec.ts | 5 +- .../close-savings-account.component.ts | 32 +- .../manage-savings-account.component.spec.ts | 5 +- .../manage-savings-account.component.ts | 72 +- ...st-as-on-savings-account.component.spec.ts | 5 +- ...nterest-as-on-savings-account.component.ts | 29 +- .../reject-savings-account.component.spec.ts | 5 +- .../reject-savings-account.component.ts | 23 +- .../saving-account-actions.component.spec.ts | 5 +- .../saving-account-actions.component.ts | 54 +- ...ngs-account-assign-staff.component.spec.ts | 5 +- .../savings-account-assign-staff.component.ts | 23 +- ...ngs-account-transactions.component.spec.ts | 5 +- .../savings-account-transactions.component.ts | 49 +- ...s-account-unassign-staff.component.spec.ts | 5 +- ...avings-account-unassign-staff.component.ts | 21 +- ...approval-savings-account.component.spec.ts | 5 +- ...undo-approval-savings-account.component.ts | 16 +- ...y-client-savings-account.component.spec.ts | 5 +- ...raw-by-client-savings-account.component.ts | 23 +- ...ngs-account-charges-step.component.spec.ts | 5 +- .../savings-account-charges-step.component.ts | 59 +- ...ngs-account-details-step.component.spec.ts | 5 +- .../savings-account-details-step.component.ts | 59 +- ...ngs-account-preview-step.component.spec.ts | 5 +- .../savings-account-preview-step.component.ts | 12 +- ...vings-account-terms-step.component.spec.ts | 5 +- .../savings-account-terms-step.component.ts | 114 +-- .../charges-tab/charges-tab.component.spec.ts | 5 +- .../charges-tab/charges-tab.component.ts | 60 +- ...alculate-interest-dialog.component.spec.ts | 5 +- .../calculate-interest-dialog.component.ts | 4 +- ...inactivate-charge-dialog.component.spec.ts | 5 +- .../inactivate-charge-dialog.component.ts | 8 +- .../post-interest-dialog.component.spec.ts | 5 +- .../post-interest-dialog.component.ts | 4 +- .../release-amount-dialog.component.spec.ts | 5 +- .../release-amount-dialog.component.ts | 4 +- ...ggle-withhold-tax-dialog.component.spec.ts | 5 +- .../toggle-withhold-tax-dialog.component.ts | 8 +- .../undo-transaction-dialog.component.spec.ts | 5 +- .../undo-transaction-dialog.component.ts | 4 +- .../waive-charge-dialog.component.spec.ts | 5 +- .../waive-charge-dialog.component.ts | 8 +- .../datatable-tabs.component.spec.ts | 5 +- .../datatable-tabs.component.ts | 1 - .../general-tab/general-tab.component.spec.ts | 5 +- .../general-tab/general-tab.component.ts | 9 +- .../notes-tab/notes-tab.component.spec.ts | 5 +- .../notes-tab/notes-tab.component.ts | 21 +- .../savings-account-view.component.spec.ts | 5 +- .../savings-account-view.component.ts | 61 +- .../savings-buttons.config.ts | 54 +- .../savings-documents-tab.component.spec.ts | 5 +- .../savings-documents-tab.component.ts | 25 +- ...tanding-instructions-tab.component.spec.ts | 5 +- .../standing-instructions-tab.component.ts | 29 +- .../export-transactions.component.spec.ts | 5 +- .../export-transactions.component.ts | 51 +- .../transactions-tab.component.spec.ts | 5 +- .../transactions-tab.component.ts | 79 +- .../edit-transaction.component.spec.ts | 5 +- .../edit-transaction.component.ts | 49 +- .../view-reciept.component.spec.ts | 5 +- .../view-reciept/view-reciept.component.ts | 10 +- ...atatable-transaction-tab.component.spec.ts | 5 +- .../datatable-transaction-tab.component.ts | 1 - ...ransaction-datatable-tab.component.spec.ts | 5 +- ...ngs-transaction-datatable-tab.component.ts | 4 +- ...-transaction-general-tab.component.spec.ts | 5 +- ...vings-transaction-general-tab.component.ts | 38 +- .../view-transaction.component.spec.ts | 5 +- .../view-transaction.component.ts | 15 +- .../view-charge/view-charge.component.spec.ts | 5 +- .../view-charge/view-charge.component.ts | 49 +- src/app/savings/savings-routing.module.ts | 26 +- src/app/savings/savings.module.ts | 3 +- src/app/savings/savings.service.ts | 33 +- .../search-page/search-page.component.spec.ts | 5 +- .../search-page/search-page.component.ts | 82 ++- src/app/search/search-routing.module.ts | 3 +- src/app/search/search.model.ts | 27 +- src/app/search/search.module.ts | 2 +- src/app/search/search.resolver.ts | 2 - src/app/search/search.service.ts | 9 +- .../app-configuration.component.spec.ts | 5 +- .../app-configuration.component.ts | 4 +- .../self-service-routing.module.ts | 8 +- .../self-service.component.spec.ts | 5 +- .../self-service/self-service.component.ts | 4 +- src/app/self-service/self-service.module.ts | 2 +- .../task-management.component.spec.ts | 5 +- .../task-management.component.ts | 4 +- .../create-user/create-user.component.spec.ts | 5 +- .../create-user/create-user.component.ts | 33 +- .../edit-user/edit-user.component.spec.ts | 5 +- .../users/edit-user/edit-user.component.ts | 10 +- src/app/self-service/users/user.service.ts | 28 +- .../users/users.component.spec.ts | 5 +- src/app/self-service/users/users.component.ts | 18 +- .../view-user/view-user.component.spec.ts | 5 +- .../users/view-user/view-user.component.ts | 14 +- .../users/view-user/view-user.resolver.ts | 2 - src/app/settings/settings-routing.module.ts | 3 +- src/app/settings/settings.component.spec.ts | 5 +- src/app/settings/settings.component.ts | 32 +- src/app/settings/settings.module.ts | 2 +- src/app/settings/settings.service.ts | 16 +- .../account-number.component.spec.ts | 5 +- .../account-number.component.ts | 6 +- .../gl-account-display.component.spec.ts | 5 +- .../gl-account-display.component.ts | 11 +- .../gl-account-selector.component.spec.ts | 5 +- .../gl-account-selector.component.ts | 22 +- ...ournal-entry-transaction.component.spec.ts | 5 +- ...iew-journal-entry-transaction.component.ts | 58 +- .../view-journal-entry.component.spec.ts | 5 +- .../view-journal-entry.component.ts | 12 +- ...vings-accounting-details.component.spec.ts | 5 +- ...ew-savings-accounting-details.component.ts | 4 +- .../cancel-dialog.component.spec.ts | 5 +- .../cancel-dialog/cancel-dialog.component.ts | 8 +- .../change-password-dialog.component.spec.ts | 5 +- .../change-password-dialog.component.ts | 48 +- .../common-logic/tree-control.service.ts | 2 +- .../confirmation-dialog.component.spec.ts | 5 +- .../confirmation-dialog.component.ts | 10 +- .../delete-dialog.component.spec.ts | 5 +- .../delete-dialog/delete-dialog.component.ts | 8 +- .../disable-dialog.component.spec.ts | 5 +- .../disable-dialog.component.ts | 8 +- .../dropdown/dropdown.component.spec.ts | 5 +- src/app/shared/dropdown/dropdown.component.ts | 4 +- .../enable-dialog.component.spec.ts | 5 +- .../enable-dialog/enable-dialog.component.ts | 8 +- .../entity-name/entity-name.component.spec.ts | 5 +- .../entity-name/entity-name.component.ts | 7 +- .../error-dialog.component.spec.ts | 5 +- .../error-dialog/error-dialog.component.ts | 10 +- .../external-identifier.component.spec.ts | 5 +- .../external-identifier.component.ts | 14 +- .../file-upload/file-upload.component.spec.ts | 5 +- .../file-upload/file-upload.component.ts | 4 +- .../shared/footer/footer.component.spec.ts | 5 +- src/app/shared/footer/footer.component.ts | 43 +- .../form-dialog/form-dialog.component.spec.ts | 5 +- .../form-dialog/form-dialog.component.ts | 28 +- .../shared/form-dialog/form-group.service.ts | 10 +- .../formfield/formfield.component.spec.ts | 5 +- .../formfield/formfield.component.ts | 4 +- .../formfield/model/checkbox-base.ts | 9 +- .../formfield/model/datepicker-base.ts | 2 - .../formfield/model/datetimepicker-base.ts | 2 - .../formfield/model/formfield-base.ts | 32 +- .../form-dialog/formfield/model/input-base.ts | 2 - .../formfield/model/select-base.ts | 8 +- src/app/shared/icons.module.ts | 2 - .../input-amount.component.spec.ts | 5 +- .../input-amount/input-amount.component.ts | 6 +- ...eyboard-shortcuts-dialog.component.spec.ts | 5 +- .../keyboard-shortcuts-dialog.component.ts | 4 +- .../language-selector.component.spec.ts | 5 +- .../language-selector.component.ts | 10 +- .../shared/long-text/long-text.component.html | 4 +- .../long-text/long-text.component.spec.ts | 5 +- .../shared/long-text/long-text.component.ts | 6 +- src/app/shared/material.module.ts | 4 +- src/app/shared/models/general.model.ts | 84 +-- .../notifications-tray.component.spec.ts | 5 +- .../notifications-tray.component.ts | 30 +- .../search-tool/search-tool.component.spec.ts | 5 +- .../search-tool/search-tool.component.ts | 12 +- .../server-selector.component.spec.ts | 5 +- .../server-selector.component.ts | 19 +- src/app/shared/shared.module.ts | 2 +- .../stepper-buttons.component.spec.ts | 5 +- .../stepper-buttons.component.ts | 4 +- .../svg-icon/svg-icon.component.spec.ts | 5 +- src/app/shared/svg-icon/svg-icon.component.ts | 3 +- .../datatable-multi-row.component.spec.ts | 5 +- .../datatable-multi-row.component.ts | 55 +- .../datatable-single-row.component.spec.ts | 5 +- .../datatable-single-row.component.ts | 75 +- .../entity-datatable-tab.component.spec.ts | 5 +- .../entity-datatable-tab.component.ts | 4 +- .../entity-documents-tab.component.spec.ts | 5 +- .../entity-documents-tab.component.ts | 16 +- .../entity-notes-tab.component.spec.ts | 5 +- .../entity-notes-tab.component.ts | 42 +- .../tenant-selector.component.spec.ts | 5 +- .../tenant-selector.component.ts | 6 +- .../theme-picker/theme-manager.service.ts | 4 +- .../theme-picker.component.spec.ts | 5 +- .../theme-picker/theme-picker.component.ts | 6 +- .../theme-picker/theme-storage.service.ts | 4 +- .../theme-toggle.component.spec.ts | 5 +- .../theme-toggle/theme-toggle.component.ts | 12 +- .../shared/theme-toggle/theming.service.ts | 15 +- .../payment-detail-model.ts | 2 - ...ansaction-payment-detail.component.spec.ts | 5 +- .../transaction-payment-detail.component.ts | 5 +- .../shared/validators/percentage.validator.ts | 3 +- .../share-account-actions.resolver.ts | 4 +- .../share-account-and-template.resolver.ts | 4 +- .../share-account-view.resolver.ts | 4 +- .../shares-account-template.resolver.ts | 4 +- .../create-shares-account.component.spec.ts | 5 +- .../create-shares-account.component.ts | 33 +- .../edit-shares-account.component.spec.ts | 5 +- .../edit-shares-account.component.ts | 34 +- .../activate-shares-account.component.spec.ts | 5 +- .../activate-shares-account.component.ts | 21 +- .../apply-shares.component.spec.ts | 5 +- .../apply-shares/apply-shares.component.ts | 28 +- .../approve-shares-account.component.spec.ts | 5 +- .../approve-shares-account.component.ts | 23 +- .../approve-share-dialog.component.spec.ts | 5 +- .../approve-share-dialog.component.ts | 8 +- .../approve-shares.component.spec.ts | 5 +- .../approve-shares.component.ts | 43 +- .../close-shares-account.component.spec.ts | 5 +- .../close-shares-account.component.ts | 23 +- .../redeem-shares.component.spec.ts | 5 +- .../redeem-shares/redeem-shares.component.ts | 28 +- .../reject-shares-account.component.spec.ts | 5 +- .../reject-shares-account.component.ts | 23 +- .../reject-share-dialog.component.spec.ts | 5 +- .../reject-share-dialog.component.ts | 8 +- .../reject-shares.component.spec.ts | 5 +- .../reject-shares/reject-shares.component.ts | 29 +- .../shares-account-actions.component.spec.ts | 5 +- .../shares-account-actions.component.ts | 28 +- ...-approval-shares-account.component.spec.ts | 5 +- .../undo-approval-shares-account.component.ts | 10 +- ...res-account-charges-step.component.spec.ts | 5 +- .../shares-account-charges-step.component.ts | 21 +- ...res-account-details-step.component.spec.ts | 5 +- .../shares-account-details-step.component.ts | 30 +- ...res-account-preview-step.component.spec.ts | 5 +- .../shares-account-preview-step.component.ts | 11 +- ...hares-account-terms-step.component.spec.ts | 5 +- .../shares-account-terms-step.component.ts | 73 +- .../charges-tab/charges-tab.component.spec.ts | 5 +- .../charges-tab/charges-tab.component.ts | 16 +- .../dividends-tab.component.spec.ts | 5 +- .../dividends-tab/dividends-tab.component.ts | 2 - .../general-tab/general-tab.component.spec.ts | 5 +- .../general-tab/general-tab.component.ts | 1 - .../shares-account-view.component.spec.ts | 5 +- .../shares-account-view.component.ts | 17 +- .../shares-buttons.config.ts | 18 +- .../transactions-tab.component.spec.ts | 5 +- .../transactions-tab.component.ts | 2 - src/app/shares/shares-routing.module.ts | 6 +- src/app/shares/shares.module.ts | 4 +- src/app/shares/shares.service.ts | 2 - ...count-number-preferences.component.spec.ts | 5 +- .../account-number-preferences.component.ts | 4 +- .../account-number-preferences.resolver.ts | 2 - ...nt-number-preferences-template.resolver.ts | 2 - ...ccount-number-preference.component.spec.ts | 5 +- ...ate-account-number-preference.component.ts | 42 +- ...ccount-number-preference.component.spec.ts | 5 +- ...dit-account-number-preference.component.ts | 27 +- .../account-number-preference.resolver.ts | 2 - ...ccount-number-preference.component.spec.ts | 5 +- ...iew-account-number-preference.component.ts | 28 +- .../audit-trail-search-template.resolver.ts | 2 - .../audit-trails/audit-trail.datasource.ts | 15 +- .../audit-trails.component.spec.ts | 5 +- .../audit-trails/audit-trails.component.ts | 216 ++++-- .../view-audit/audit-trail.resolver.ts | 2 - .../view-audit/view-audit.component.spec.ts | 5 +- .../view-audit/view-audit.component.ts | 17 +- src/app/system/codes/code.resolver.ts | 2 - src/app/system/codes/codes.component.spec.ts | 5 +- src/app/system/codes/codes.component.ts | 26 +- src/app/system/codes/codes.resolver.ts | 2 - .../create-code/create-code.component.spec.ts | 5 +- .../create-code/create-code.component.ts | 52 +- .../edit-code/edit-code.component.spec.ts | 5 +- .../codes/edit-code/edit-code.component.ts | 30 +- .../codes/view-code/code-values.resolver.ts | 2 - .../view-code/view-code.component.spec.ts | 5 +- .../codes/view-code/view-code.component.ts | 86 +-- .../business-date-tab.component.spec.ts | 5 +- .../business-date-tab.component.ts | 37 +- .../configurations.component.spec.ts | 5 +- .../configurations.component.ts | 19 +- .../edit-configuration.component.spec.ts | 5 +- .../edit-configuration.component.ts | 41 +- .../global-configuration.resolver.ts | 20 +- ...lobal-configurations-tab.component.spec.ts | 5 +- .../global-configurations-tab.component.ts | 42 +- .../global-configurations.resolver.ts | 2 - ...gure-maker-checker-tasks.component.spec.ts | 5 +- ...configure-maker-checker-tasks.component.ts | 46 +- .../configure-maker-checker-tasks.resolver.ts | 24 +- ...entity-to-entity-mapping.component.spec.ts | 5 +- .../entity-to-entity-mapping.component.ts | 75 +- .../entity-to-entity-mapping.resolver.ts | 24 +- .../amazon-s3/amazon-s3.component.spec.ts | 5 +- .../amazon-s3/amazon-s3.component.ts | 7 +- .../amazon-s3/amazon-s3.resolver.ts | 2 - .../edit-amazon-s3.component.spec.ts | 5 +- .../edit-amazon-s3.component.ts | 27 +- .../edit-email/edit-email.component.spec.ts | 5 +- .../email/edit-email/edit-email.component.ts | 47 +- .../email/email.component.spec.ts | 5 +- .../email/email.component.ts | 7 +- .../external-services/email/email.resolver.ts | 2 - .../external-services.component.spec.ts | 5 +- .../external-services.component.ts | 7 +- .../edit-notification.component.spec.ts | 5 +- .../edit-notification.component.ts | 27 +- .../notification.component.spec.ts | 5 +- .../notification/notification.component.ts | 7 +- .../notification/notification.resolver.ts | 2 - .../sms/edit-sms/edit-sms.component.spec.ts | 5 +- .../sms/edit-sms/edit-sms.component.ts | 32 +- .../sms/sms.component.spec.ts | 5 +- .../external-services/sms/sms.component.ts | 11 +- .../external-services/sms/sms.resolver.ts | 2 - .../manage-data-tables/app-table-data.ts | 10 +- .../column-dialog.component.spec.ts | 5 +- .../column-dialog/column-dialog.component.ts | 88 ++- .../manage-data-tables/column-type-data.ts | 20 +- .../create-data-table.component.spec.ts | 5 +- .../create-data-table.component.ts | 119 ++-- .../manage-data-tables/data-table.resolver.ts | 3 - .../datatable-column.model.ts | 3 - .../edit-data-table.component.spec.ts | 5 +- .../edit-data-table.component.ts | 149 ++-- .../manage-data-tables.component.spec.ts | 5 +- .../manage-data-tables.component.ts | 30 +- .../manage-data-tables.resolver.ts | 2 - .../view-data-table.component.spec.ts | 5 +- .../view-data-table.component.ts | 36 +- .../manage-external-events.component.spec.ts | 5 +- .../manage-external-events.component.ts | 20 +- .../manage-external-events.resolver.ts | 23 +- .../add-event-dialog.component.spec.ts | 5 +- .../add-event-dialog.component.ts | 38 +- .../create-hook/create-hook.component.spec.ts | 5 +- .../create-hook/create-hook.component.ts | 99 ++- .../edit-hook/edit-hook.component.spec.ts | 5 +- .../edit-hook/edit-hook.component.ts | 114 ++- .../manage-hooks/hooks-template.resolver.ts | 2 - .../manage-hooks.component.spec.ts | 5 +- .../manage-hooks/manage-hooks.component.ts | 10 +- .../manage-hooks/manage-hooks.resolver.ts | 2 - .../manage-hooks/view-hook/hook.resolver.ts | 4 +- .../view-hook/view-hook.component.spec.ts | 5 +- .../view-hook/view-hook.component.ts | 15 +- .../cob-workflow.component.spec.ts | 5 +- .../cob-workflow/cob-workflow.component.ts | 7 +- .../loan-locked/loan-locked.component.spec.ts | 5 +- .../loan-locked/loan-locked.component.ts | 28 +- .../loan-locked/loan-locked.resolver.ts | 29 +- .../manage-jobs/manage-jobs.component.spec.ts | 5 +- .../manage-jobs/manage-jobs.component.ts | 7 +- ...ustom-parameters-popover.component.spec.ts | 5 +- .../custom-parameters-popover.component.ts | 22 +- .../custom-parameters-table.component.spec.ts | 5 +- .../custom-parameters-table.component.ts | 12 +- .../edit-scheduler-job.component.spec.ts | 5 +- .../edit-scheduler-job.component.ts | 29 +- .../error-log-popover.component.spec.ts | 5 +- .../error-log-popover.component.ts | 12 +- .../manage-scheduler-job.resolver.ts | 4 +- .../manage-scheduler-jobs.component.spec.ts | 5 +- .../manage-scheduler-jobs.component.ts | 100 +-- .../manage-scheduler-jobs.resolver.ts | 2 - .../models/scheduler-job.model.ts | 28 +- ...un-selected-jobs-popover.component.spec.ts | 5 +- .../run-selected-jobs-popover.component.ts | 35 +- .../run-selected-jobs-table.component.spec.ts | 5 +- .../run-selected-jobs-table.component.ts | 24 +- ...ew-history-scheduler-job.component.spec.ts | 5 +- .../view-history-scheduler-job.component.ts | 40 +- .../view-history-scheduler-job.resolver.ts | 2 - .../view-scheduler-job.component.spec.ts | 5 +- .../view-scheduler-job.component.ts | 4 +- .../view-scheduler-job.resolver.ts | 2 - .../workflow-diagram.component.spec.ts | 5 +- .../workflow-diagram.component.ts | 21 +- .../workflow-jobs.component.spec.ts | 5 +- .../workflow-jobs/workflow-jobs.component.ts | 122 ++-- .../workflow-jobs/workflow-jobs.resolver.ts | 18 +- .../create-report.component.spec.ts | 5 +- .../create-report/create-report.component.ts | 139 ++-- .../edit-report/edit-report.component.spec.ts | 5 +- .../edit-report/edit-report.component.ts | 145 ++-- .../manage-reports.component.spec.ts | 5 +- .../manage-reports.component.ts | 47 +- .../report-parameter-dialog.component.spec.ts | 5 +- .../report-parameter-dialog.component.ts | 18 +- .../report-template.resolver.ts | 2 - .../system/manage-reports/report.resolver.ts | 2 - .../system/manage-reports/reports.resolver.ts | 2 - .../view-report/view-report.component.spec.ts | 5 +- .../view-report/view-report.component.ts | 18 +- .../create-survey.component.spec.ts | 5 +- .../create-survey/create-survey.component.ts | 81 ++- .../edit-survey/edit-survey.component.spec.ts | 5 +- .../edit-survey/edit-survey.component.ts | 111 ++- .../manage-surveys.component.spec.ts | 5 +- .../manage-surveys.component.ts | 28 +- .../manage-surveys/manage-surveys.resolver.ts | 2 - src/app/system/manage-surveys/survey.model.ts | 32 +- .../system/manage-surveys/survey.resolver.ts | 2 - .../view-survey/view-survey.component.spec.ts | 5 +- .../view-survey/view-survey.component.ts | 16 +- .../add-role/add-role.component.spec.ts | 5 +- .../add-role/add-role.component.ts | 27 +- .../edit-role/edit-role.component.spec.ts | 5 +- .../edit-role/edit-role.component.ts | 12 +- .../roles-and-permissions.component.spec.ts | 5 +- .../roles-and-permissions.component.ts | 35 +- .../roles-and-permissions.resolver.ts | 2 - .../view-role/view-role.component.spec.ts | 5 +- .../view-role/view-role.component.ts | 67 +- .../view-role/view-role.resolver.ts | 26 +- src/app/system/system-routing.module.ts | 23 +- src/app/system/system.component.spec.ts | 5 +- src/app/system/system.component.ts | 20 +- src/app/system/system.module.ts | 4 +- src/app/system/system.service.ts | 31 +- src/app/system/version.service.ts | 4 +- .../checker-inbox.component.spec.ts | 5 +- .../checker-inbox/checker-inbox.component.ts | 54 +- .../client-approval.component.spec.ts | 5 +- .../client-approval.component.ts | 29 +- .../loan-approval.component.spec.ts | 5 +- .../loan-approval/loan-approval.component.ts | 36 +- .../loan-disbursal.component.spec.ts | 5 +- .../loan-disbursal.component.ts | 33 +- .../reschedule-loan.component.spec.ts | 5 +- .../reschedule-loan.component.ts | 34 +- .../checker-inbox-and-tasks.component.spec.ts | 5 +- .../checker-inbox-and-tasks.component.ts | 4 +- .../getCheckerInboxDetail.resolver.ts | 26 +- .../getGroupedClientsData.resolver.ts | 2 - .../getLoansToBeApproved.resolver.ts | 24 +- .../getLoansToBeDisbursed.resolver.ts | 24 +- .../common-resolvers/getOffices.resolver.ts | 24 +- .../getRescheduleLoans.resolver.ts | 24 +- .../getmakercheckers.resolver.ts | 2 - .../makerCheckerTemplate.resolver.ts | 24 +- src/app/tasks/tasks-routing.module.ts | 9 +- src/app/tasks/tasks.module.ts | 4 +- src/app/tasks/tasks.service.ts | 15 +- .../view-checker-inbox.component.spec.ts | 5 +- .../view-checker-inbox.component.ts | 26 +- .../create-template.resolver.ts | 2 - .../edit-template.resolver.ts | 2 - .../common-resolvers/template.resolver.ts | 2 - .../common-resolvers/templates.resolver.ts | 2 - .../create-template.component.spec.ts | 5 +- .../create-template.component.ts | 45 +- .../edit-template.component.spec.ts | 5 +- .../edit-template/edit-template.component.ts | 41 +- .../templates/template-parameter-labels.ts | 6 +- src/app/templates/templates-routing.module.ts | 3 +- src/app/templates/templates.component.spec.ts | 5 +- src/app/templates/templates.component.ts | 10 +- src/app/templates/templates.module.ts | 4 +- src/app/templates/templates.service.ts | 8 +- .../view-template.component.spec.ts | 5 +- .../view-template/view-template.component.ts | 19 +- .../create-user/create-user.component.spec.ts | 5 +- .../create-user/create-user.component.ts | 139 ++-- .../edit-user/edit-user.component.spec.ts | 5 +- .../users/edit-user/edit-user.component.ts | 69 +- src/app/users/user.resolver.ts | 1 - src/app/users/users-routing.module.ts | 3 +- src/app/users/users-template.resolver.ts | 2 - src/app/users/users.component.spec.ts | 5 +- src/app/users/users.component.ts | 30 +- src/app/users/users.module.ts | 2 +- src/app/users/users.resolver.ts | 2 - src/app/users/users.service.ts | 8 +- .../view-user/view-user.component.spec.ts | 5 +- .../users/view-user/view-user.component.ts | 21 +- src/app/web-app.component.ts | 65 +- src/assets/env.template.js | 7 +- src/environments/environment.prod.ts | 16 +- src/environments/environment.ts | 26 +- src/karma.conf.ts | 31 +- src/main.ts | 5 +- src/polyfills.ts | 12 +- src/test.ts | 10 +- 1812 files changed, 22516 insertions(+), 16862 deletions(-) diff --git a/.prettierignore b/.prettierignore index b590ac520..540201075 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,4 @@ /dist /node_modules **/.git -*.ts +src/environments/.env.ts diff --git a/README.md b/README.md index a66bf99c5..723111600 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Mifos X Web App ![build](https://github.com/openMF/web-app/actions/workflows/build.yml/badge.svg) [Slack](https://app.slack.com/client/T0F5GHE8Y/CJJGJLN10) +# Mifos X Web App ![build](https://github.com/openMF/web-app/actions/workflows/build.yml/badge.svg) [Slack](https://app.slack.com/client/T0F5GHE8Y/CJJGJLN10) Mifos X Web App is the revamped version of the Mifos X Community App, an effective financial inclusion solution and the default web application built on top of the Mifos X platform for the Mifos User Community. @@ -16,7 +16,7 @@ The latest code is continuously deployed at https://openmf.github.io/web-app/ wh [`nodeJs`](https://nodejs.org/en/download/) -3. Install [angular-cli](https://github.com/angular/angular-cli) globally. +2. Install [angular-cli](https://github.com/angular/angular-cli) globally. ``` npm install -g @angular/cli@16.0.2 diff --git a/cypress.config.ts b/cypress.config.ts index 681fee5aa..2a8789f75 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -1,24 +1,24 @@ -import { defineConfig } from "cypress"; +import { defineConfig } from 'cypress'; export default defineConfig({ - videosFolder: "cypress/videos", - screenshotsFolder: "cypress/screenshots", - fixturesFolder: "cypress/fixtures", + videosFolder: 'cypress/videos', + screenshotsFolder: 'cypress/screenshots', + fixturesFolder: 'cypress/fixtures', e2e: { // We've imported your old cypress plugins here. // You may want to clean this up later by importing these. setupNodeEvents(on, config) { - return require("./cypress/plugins/index.ts")(on, config); + return require('./cypress/plugins/index.ts')(on, config); }, - baseUrl: "http://localhost:4200", + baseUrl: 'http://localhost:4200' }, component: { devServer: { - framework: "angular", - bundler: "webpack", + framework: 'angular', + bundler: 'webpack' }, - specPattern: "**/*.cy.ts", - }, + specPattern: '**/*.cy.ts' + } }); diff --git a/docker-compose.yml b/docker-compose.yml index ec8553398..fc3e14a8f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,4 +24,3 @@ services: - MIFOS_SUPPORTED_LANGUAGES=cs-CS,de-DE,en-US,es-MX,fr-FR,it-IT,ko-KO,lt-LT,lv-LV,ne-NE,pt-PT,sw-SW - MIFOS_SESSION_IDLE_TIMEOUT=300000 - MIFOS_OAUTH_SERVER_ENABLED=false - \ No newline at end of file diff --git a/e2e/src/login/login.e2e-spec.ts b/e2e/src/login/login.e2e-spec.ts index 89952c441..1db752cdd 100644 --- a/e2e/src/login/login.e2e-spec.ts +++ b/e2e/src/login/login.e2e-spec.ts @@ -20,5 +20,4 @@ describe('app', () => { it('should login into the app', () => { page.validLogin(); }); - }); diff --git a/e2e/src/login/login.po.ts b/e2e/src/login/login.po.ts index c5b67a158..748b6bf6b 100644 --- a/e2e/src/login/login.po.ts +++ b/e2e/src/login/login.po.ts @@ -5,7 +5,6 @@ import { browser, element, by } from 'protractor'; * Login Page e2e page object */ export class LoginPage { - /** username field */ usernameField = element(by.css('input[formControlName="username"]')); /** password field */ @@ -37,5 +36,4 @@ export class LoginPage { this.passwordField.sendKeys('123'); this.loginButton.click(); } - } diff --git a/src/app/account-transfers/account-transfers-routing.module.ts b/src/app/account-transfers/account-transfers-routing.module.ts index 58f2e73f4..a81363ec6 100644 --- a/src/app/account-transfers/account-transfers-routing.module.ts +++ b/src/app/account-transfers/account-transfers-routing.module.ts @@ -26,7 +26,11 @@ const routes: Routes = [ children: [ { path: 'create-standing-instructions', - data: { title: 'Create Standing Instructions', breadcrumb: 'Create Standing Instructions', routeParamBreadcrumb: 'Create Standing Instructions' }, + data: { + title: 'Create Standing Instructions', + breadcrumb: 'Create Standing Instructions', + routeParamBreadcrumb: 'Create Standing Instructions' + }, component: CreateStandingInstructionsComponent, resolve: { standingIntructionsTemplate: StandingInstructionsTemplateResolver @@ -42,7 +46,11 @@ const routes: Routes = [ }, { path: 'list-standing-instructions', - data: { title: 'List Standing Instructions', breadcrumb: 'List Standing Instructions', routeParamBreadcrumb: 'List Standing Instructions' }, + data: { + title: 'List Standing Instructions', + breadcrumb: 'List Standing Instructions', + routeParamBreadcrumb: 'List Standing Instructions' + }, component: ListStandingInstructionsComponent, resolve: { standingIntructionsTemplate: StandingInstructionsTemplateResolver @@ -71,29 +79,33 @@ const routes: Routes = [ data: { title: 'View Standing Instructions', breadcrumb: 'view', routeParamBreadcrumb: false }, component: ViewStandingInstructionsComponent, resolve: { - standingInstructionsData: ViewStandingInstructionsResolver, - }, + standingInstructionsData: ViewStandingInstructionsResolver + } }, { path: 'edit', data: { title: 'Edit Standing Instructions', breadcrumb: 'edit', routeParamBreadcrumb: false }, component: EditStandingInstructionsComponent, resolve: { - standingInstructionsDataAndTemplate: StandingInstructionsDataAndTemplateResolver, - }, + standingInstructionsDataAndTemplate: StandingInstructionsDataAndTemplateResolver + } }, { path: 'list-account-transactions', - data: { title: 'List Account Transactions', breadcrumb: 'List Account Transactions', routeParamBreadcrumb: 'List Account Transactions' }, + data: { + title: 'List Account Transactions', + breadcrumb: 'List Account Transactions', + routeParamBreadcrumb: 'List Account Transactions' + }, component: ListTransactionsComponent, resolve: { listTransactionData: ListTransactionsResolver } - }, + } ] - }, + } ] - }, + } ]; @NgModule({ imports: [RouterModule.forChild(routes)], @@ -108,5 +120,4 @@ const routes: Routes = [ ViewAccountTransferResolver ] }) - -export class AccountTransfersRoutingModule { } +export class AccountTransfersRoutingModule {} diff --git a/src/app/account-transfers/account-transfers.module.ts b/src/app/account-transfers/account-transfers.module.ts index 002f0d6b9..5189f4ea4 100644 --- a/src/app/account-transfers/account-transfers.module.ts +++ b/src/app/account-transfers/account-transfers.module.ts @@ -21,7 +21,12 @@ import { ViewAccountTransferComponent } from './view-account-transfer/view-accou * All components related to Account Transfers functions should be declared here. */ @NgModule({ - imports: [SharedModule, PipesModule, DirectivesModule, AccountTransfersRoutingModule], + imports: [ + SharedModule, + PipesModule, + DirectivesModule, + AccountTransfersRoutingModule + ], declarations: [ ViewStandingInstructionsComponent, EditStandingInstructionsComponent, @@ -31,6 +36,6 @@ import { ViewAccountTransferComponent } from './view-account-transfer/view-accou ListTransactionsComponent, ViewAccountTransferComponent ], - providers: [ ] + providers: [] }) -export class AccountTransfersModule { } +export class AccountTransfersModule {} diff --git a/src/app/account-transfers/account-transfers.service.ts b/src/app/account-transfers/account-transfers.service.ts index 507e1a109..77d96980c 100644 --- a/src/app/account-transfers/account-transfers.service.ts +++ b/src/app/account-transfers/account-transfers.service.ts @@ -12,8 +12,7 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class AccountTransfersService { - - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * @params standingInstructionsId @@ -33,10 +32,16 @@ export class AccountTransfersService { return this.http.put(`/standinginstructions/${standinginstructionsId}`, data, { params: httpParams }); } - getStandingInstructionsTemplate(clientId: any, officeId: any, accountTypeId: string, formValue?: any): Observable { - let httpParams = new HttpParams().set('fromAccountType', accountTypeId) - .set('fromClientId', clientId) - .set('fromOfficeId', officeId); + getStandingInstructionsTemplate( + clientId: any, + officeId: any, + accountTypeId: string, + formValue?: any + ): Observable { + let httpParams = new HttpParams() + .set('fromAccountType', accountTypeId) + .set('fromClientId', clientId) + .set('fromOfficeId', officeId); if (formValue) { const propNames = Object.getOwnPropertyNames(formValue); for (let i = 0; i < propNames.length; i++) { @@ -52,8 +57,7 @@ export class AccountTransfersService { } newAccountTranferResource(id: any, accountTypeId: any, formValue?: any): Observable { - let httpParams = new HttpParams().set('fromAccountId', id) - .set('fromAccountType', accountTypeId); + let httpParams = new HttpParams().set('fromAccountId', id).set('fromAccountType', accountTypeId); if (formValue) { const propNames = Object.getOwnPropertyNames(formValue); for (let i = 0; i < propNames.length; i++) { @@ -62,7 +66,6 @@ export class AccountTransfersService { } } return this.http.get(`/accounttransfers/template`, { params: httpParams }); - } createAccountTransfer(data: any): Observable { @@ -94,18 +97,17 @@ export class AccountTransfersService { return this.http.delete(`/standinginstructions/${id}`, { params: httpParams }); } - getStandingInstructionsTransactions(standingInstructionsId: any, dateFormat: any, locale: any) { - const httpParams = new HttpParams().set('associations', 'transactions') - .set('dateFormat', dateFormat) - .set('limit', '14') - .set('locale', locale) - .set('offset', '0'); + const httpParams = new HttpParams() + .set('associations', 'transactions') + .set('dateFormat', dateFormat) + .set('limit', '14') + .set('locale', locale) + .set('offset', '0'); return this.http.get(`/standinginstructions/${standingInstructionsId}`, { params: httpParams }); } getViewAccountTransferDetails(transferId: any): Observable { return this.http.get(`/accounttransfers/${transferId}`); } - } diff --git a/src/app/account-transfers/common-resolvers/list-transactions.resolver.ts b/src/app/account-transfers/common-resolvers/list-transactions.resolver.ts index 78932d703..a47e01ebb 100644 --- a/src/app/account-transfers/common-resolvers/list-transactions.resolver.ts +++ b/src/app/account-transfers/common-resolvers/list-transactions.resolver.ts @@ -14,23 +14,24 @@ import { SettingsService } from 'app/settings/settings.service'; */ @Injectable() export class ListTransactionsResolver implements Resolve { + /** + * @param {AccountTransfersService} accountTransfersService Account Transfers service. + * @param {SettingsService} settingsService Settings Service. + */ + constructor( + private accountTransfersService: AccountTransfersService, + private settingsService: SettingsService + ) {} - /** - * @param {AccountTransfersService} accountTransfersService Account Transfers service. - * @param {SettingsService} settingsService Settings Service. - */ - constructor(private accountTransfersService: AccountTransfersService, - private settingsService: SettingsService) { } - - /** - * Returns the Standing Instructions Data. - * @param {ActivatedRouteSnapshot} route Route Snapshot - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const id = route.parent.paramMap.get('standingInstructionsId'); - const dateFormat = this.settingsService.dateFormat; - const locale = this.settingsService.language.code; - return this.accountTransfersService.getStandingInstructionsTransactions(id, dateFormat, locale); - } + /** + * Returns the Standing Instructions Data. + * @param {ActivatedRouteSnapshot} route Route Snapshot + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const id = route.parent.paramMap.get('standingInstructionsId'); + const dateFormat = this.settingsService.dateFormat; + const locale = this.settingsService.language.code; + return this.accountTransfersService.getStandingInstructionsTransactions(id, dateFormat, locale); + } } diff --git a/src/app/account-transfers/common-resolvers/make-account-transfer-template.resolver.ts b/src/app/account-transfers/common-resolvers/make-account-transfer-template.resolver.ts index 173702da0..faf98da92 100644 --- a/src/app/account-transfers/common-resolvers/make-account-transfer-template.resolver.ts +++ b/src/app/account-transfers/common-resolvers/make-account-transfer-template.resolver.ts @@ -13,34 +13,32 @@ import { AccountTransfersService } from '../account-transfers.service'; */ @Injectable() export class MakeAccountTransferTemplateResolver implements Resolve { + accountTypeId: string; + id: any; + /** + * @param {accountTransfersService} AccountTransfersService Account Transfers service. + */ + constructor(private accountTransfersService: AccountTransfersService) {} - accountTypeId: string; - id: any; - /** - * @param {accountTransfersService} AccountTransfersService Account Transfers service. - */ - constructor(private accountTransfersService: AccountTransfersService) { } - - /** - * Returns the Standing Instructions Data. - * @param {ActivatedRouteSnapshot} route Route Snapshot - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const accountType = route.queryParamMap.get('accountType'); - switch (accountType) { - case 'fromloans': - this.accountTypeId = '1'; - this.id = route.queryParamMap.get('loanId'); - break; - case 'fromsavings': - this.accountTypeId = '2'; - this.id = route.queryParamMap.get('savingsId'); - break; - default: - this.accountTypeId = '0'; - } - return this.accountTransfersService.newAccountTranferResource(this.id, this.accountTypeId); + /** + * Returns the Standing Instructions Data. + * @param {ActivatedRouteSnapshot} route Route Snapshot + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const accountType = route.queryParamMap.get('accountType'); + switch (accountType) { + case 'fromloans': + this.accountTypeId = '1'; + this.id = route.queryParamMap.get('loanId'); + break; + case 'fromsavings': + this.accountTypeId = '2'; + this.id = route.queryParamMap.get('savingsId'); + break; + default: + this.accountTypeId = '0'; } - + return this.accountTransfersService.newAccountTranferResource(this.id, this.accountTypeId); + } } diff --git a/src/app/account-transfers/common-resolvers/standing-instructions-data-and-template.resolver.ts b/src/app/account-transfers/common-resolvers/standing-instructions-data-and-template.resolver.ts index 4d69d51c0..37273b8d1 100644 --- a/src/app/account-transfers/common-resolvers/standing-instructions-data-and-template.resolver.ts +++ b/src/app/account-transfers/common-resolvers/standing-instructions-data-and-template.resolver.ts @@ -13,20 +13,18 @@ import { AccountTransfersService } from '../account-transfers.service'; */ @Injectable() export class StandingInstructionsDataAndTemplateResolver implements Resolve { + /** + * @param {accountTransfersService} AccountTransfersService Account Transfers service. + */ + constructor(private accountTransfersService: AccountTransfersService) {} - /** - * @param {accountTransfersService} AccountTransfersService Account Transfers service. - */ - constructor(private accountTransfersService: AccountTransfersService) { } - - /** - * Returns the Standing Instructions Data. - * @param {ActivatedRouteSnapshot} route Route Snapshot - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const standingInstructionsId = route.parent.paramMap.get('standingInstructionsId'); - return this.accountTransfersService.getStandingInstructionsDataAndTemplate(standingInstructionsId); - } - + /** + * Returns the Standing Instructions Data. + * @param {ActivatedRouteSnapshot} route Route Snapshot + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const standingInstructionsId = route.parent.paramMap.get('standingInstructionsId'); + return this.accountTransfersService.getStandingInstructionsDataAndTemplate(standingInstructionsId); + } } diff --git a/src/app/account-transfers/common-resolvers/standing-instructions-template.resolver.ts b/src/app/account-transfers/common-resolvers/standing-instructions-template.resolver.ts index 57c4696cf..d21c1241d 100644 --- a/src/app/account-transfers/common-resolvers/standing-instructions-template.resolver.ts +++ b/src/app/account-transfers/common-resolvers/standing-instructions-template.resolver.ts @@ -13,34 +13,32 @@ import { AccountTransfersService } from '../account-transfers.service'; */ @Injectable() export class StandingInstructionsTemplateResolver implements Resolve { + accountTypeId: string; - accountTypeId: string; + /** + * @param {accountTransfersService} AccountTransfersService Account Transfers service. + */ + constructor(private accountTransfersService: AccountTransfersService) {} - /** - * @param {accountTransfersService} AccountTransfersService Account Transfers service. - */ - constructor(private accountTransfersService: AccountTransfersService) { } - - /** - * Returns the Standing Instructions Data. - * @param {ActivatedRouteSnapshot} route Route Snapshot - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const officeId = route.queryParamMap.get('officeId'); - const accountType = route.queryParamMap.get('accountType'); - const clientId = route.parent.paramMap.get('clientId'); - switch (accountType) { - case 'fromloans': - this.accountTypeId = '1'; - break; - case 'fromsavings': - this.accountTypeId = '2'; - break; - default: - this.accountTypeId = '0'; - } - return this.accountTransfersService.getStandingInstructionsTemplate(clientId, officeId, this.accountTypeId); + /** + * Returns the Standing Instructions Data. + * @param {ActivatedRouteSnapshot} route Route Snapshot + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const officeId = route.queryParamMap.get('officeId'); + const accountType = route.queryParamMap.get('accountType'); + const clientId = route.parent.paramMap.get('clientId'); + switch (accountType) { + case 'fromloans': + this.accountTypeId = '1'; + break; + case 'fromsavings': + this.accountTypeId = '2'; + break; + default: + this.accountTypeId = '0'; } - + return this.accountTransfersService.getStandingInstructionsTemplate(clientId, officeId, this.accountTypeId); + } } diff --git a/src/app/account-transfers/common-resolvers/view-account-transfer.resolver.ts b/src/app/account-transfers/common-resolvers/view-account-transfer.resolver.ts index 95ecf5e5c..d5d4679f8 100644 --- a/src/app/account-transfers/common-resolvers/view-account-transfer.resolver.ts +++ b/src/app/account-transfers/common-resolvers/view-account-transfer.resolver.ts @@ -13,19 +13,17 @@ import { AccountTransfersService } from '../account-transfers.service'; */ @Injectable() export class ViewAccountTransferResolver implements Resolve { + /** + * @param {AccountTransfersService} AccountTransfersService Savings service. + */ + constructor(private accountTransfersService: AccountTransfersService) {} - /** - * @param {AccountTransfersService} AccountTransfersService Savings service. - */ - constructor(private accountTransfersService: AccountTransfersService) { } - - /** - * Returns the View Account Transfer data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const transferId = route.paramMap.get('transferid'); - return this.accountTransfersService.getViewAccountTransferDetails(transferId); - } - + /** + * Returns the View Account Transfer data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const transferId = route.paramMap.get('transferid'); + return this.accountTransfersService.getViewAccountTransferDetails(transferId); + } } diff --git a/src/app/account-transfers/common-resolvers/view-standing-instructions.resolver.ts b/src/app/account-transfers/common-resolvers/view-standing-instructions.resolver.ts index e115453c1..1cc93cdfa 100644 --- a/src/app/account-transfers/common-resolvers/view-standing-instructions.resolver.ts +++ b/src/app/account-transfers/common-resolvers/view-standing-instructions.resolver.ts @@ -13,20 +13,18 @@ import { AccountTransfersService } from '../account-transfers.service'; */ @Injectable() export class ViewStandingInstructionsResolver implements Resolve { + /** + * @param {accountTransfersService} AccountTransfersService Account Transfers service. + */ + constructor(private accountTransfersService: AccountTransfersService) {} - /** - * @param {accountTransfersService} AccountTransfersService Account Transfers service. - */ - constructor(private accountTransfersService: AccountTransfersService) { } - - /** - * Returns the Standing Instructions Data. - * @param {ActivatedRouteSnapshot} route Route Snapshot - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const standingInstructionsId = route.parent.paramMap.get('standingInstructionsId'); - return this.accountTransfersService.getStandingInstructionsData(standingInstructionsId); - } - + /** + * Returns the Standing Instructions Data. + * @param {ActivatedRouteSnapshot} route Route Snapshot + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const standingInstructionsId = route.parent.paramMap.get('standingInstructionsId'); + return this.accountTransfersService.getStandingInstructionsData(standingInstructionsId); + } } diff --git a/src/app/account-transfers/create-standing-instructions/create-standing-instructions.component.spec.ts b/src/app/account-transfers/create-standing-instructions/create-standing-instructions.component.spec.ts index aead9ad2b..7dd6b66ad 100644 --- a/src/app/account-transfers/create-standing-instructions/create-standing-instructions.component.spec.ts +++ b/src/app/account-transfers/create-standing-instructions/create-standing-instructions.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateStandingInstructionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateStandingInstructionsComponent ] - }) - .compileComponents(); + declarations: [CreateStandingInstructionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/account-transfers/create-standing-instructions/create-standing-instructions.component.ts b/src/app/account-transfers/create-standing-instructions/create-standing-instructions.component.ts index d9a15eb91..a045f59e5 100644 --- a/src/app/account-transfers/create-standing-instructions/create-standing-instructions.component.ts +++ b/src/app/account-transfers/create-standing-instructions/create-standing-instructions.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-standing-instructions.component.scss'] }) export class CreateStandingInstructionsComponent implements OnInit { - /** Standing Instructions Data */ standingIntructionsTemplate: any; /** Minimum date allowed. */ @@ -45,7 +44,7 @@ export class CreateStandingInstructionsComponent implements OnInit { /** From Account Data */ fromAccountData: any; /** Destination Type Data */ - destinationTypeData: { id: number; value: string; }[]; + destinationTypeData: { id: number; value: string }[]; /** To Office Type Data */ toOfficeTypeData: any; /** To Client Type Data */ @@ -76,12 +75,14 @@ export class CreateStandingInstructionsComponent implements OnInit { * @param {SettingsService} settingsService Settings Service * @param {Dates} dateUtils Date Utils */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private route: ActivatedRoute, private router: Router, private accountTransfersService: AccountTransfersService, private settingsService: SettingsService, - private dateUtils: Dates) { + private dateUtils: Dates + ) { this.route.data.subscribe((data: { standingIntructionsTemplate: any }) => { this.standingIntructionsTemplate = data.standingIntructionsTemplate; this.setParams(); @@ -113,7 +114,7 @@ export class CreateStandingInstructionsComponent implements OnInit { this.createCreateStandingInstructionsForm(); this.buildDependencies(); this.createStandingInstructionsForm.patchValue({ - 'applicant': this.standingIntructionsTemplate.fromClient.displayName + applicant: this.standingIntructionsTemplate.fromClient.displayName }); } @@ -122,26 +123,83 @@ export class CreateStandingInstructionsComponent implements OnInit { */ createCreateStandingInstructionsForm() { this.createStandingInstructionsForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'applicant': [{ value: '', disabled: true }], - 'transferType': ['', Validators.required], - 'priority': ['', Validators.required], - 'status': ['', Validators.required], - 'fromAccountType': ['', Validators.required], - 'fromAccountId': ['', Validators.required], - 'destination': ['', Validators.required], - 'toOfficeId': ['', Validators.required], - 'toClientId': ['', Validators.required], - 'toAccountType': ['', Validators.required], - 'toAccountId': ['', Validators.required], - 'instructionType': ['', Validators.required], - 'amount': ['', Validators.required], - 'validFrom': ['', Validators.required], - 'validTill': ['', Validators.required], - 'recurrenceType': ['', Validators.required], - 'recurrenceInterval': ['', Validators.required], - 'recurrenceFrequency': ['', Validators.required], - 'recurrenceOnMonthDay': ['', Validators.required] + name: [ + '', + Validators.required + ], + applicant: [{ value: '', disabled: true }], + transferType: [ + '', + Validators.required + ], + priority: [ + '', + Validators.required + ], + status: [ + '', + Validators.required + ], + fromAccountType: [ + '', + Validators.required + ], + fromAccountId: [ + '', + Validators.required + ], + destination: [ + '', + Validators.required + ], + toOfficeId: [ + '', + Validators.required + ], + toClientId: [ + '', + Validators.required + ], + toAccountType: [ + '', + Validators.required + ], + toAccountId: [ + '', + Validators.required + ], + instructionType: [ + '', + Validators.required + ], + amount: [ + '', + Validators.required + ], + validFrom: [ + '', + Validators.required + ], + validTill: [ + '', + Validators.required + ], + recurrenceType: [ + '', + Validators.required + ], + recurrenceInterval: [ + '', + Validators.required + ], + recurrenceFrequency: [ + '', + Validators.required + ], + recurrenceOnMonthDay: [ + '', + Validators.required + ] }); } @@ -152,7 +210,10 @@ export class CreateStandingInstructionsComponent implements OnInit { this.statusTypeData = this.standingIntructionsTemplate.statusOptions; this.fromAccountTypeData = this.standingIntructionsTemplate.fromAccountTypeOptions; this.fromAccountData = this.standingIntructionsTemplate.fromAccountOptions; - this.destinationTypeData = [{ id: 1, value: 'own account' }, { id: 2, value: 'with in bank' }]; + this.destinationTypeData = [ + { id: 1, value: 'own account' }, + { id: 2, value: 'with in bank' } + ]; this.toOfficeTypeData = this.standingIntructionsTemplate.toOfficeOptions; this.toClientTypeData = this.standingIntructionsTemplate.toClientOptions; this.toAccountTypeData = this.standingIntructionsTemplate.toAccountTypeOptions; @@ -170,8 +231,8 @@ export class CreateStandingInstructionsComponent implements OnInit { if (destination === 1) { this.allowclientedit = false; this.createStandingInstructionsForm.patchValue({ - 'toOfficeId': this.officeId, - 'toClientId': this.clientId + toOfficeId: this.officeId, + toClientId: this.clientId }); this.ToOfficeId = true; this.ToClientId = true; @@ -179,23 +240,24 @@ export class CreateStandingInstructionsComponent implements OnInit { } else { this.allowclientedit = true; this.createStandingInstructionsForm.patchValue({ - 'toOfficeId': '', - 'toClientId': '' + toOfficeId: '', + toClientId: '' }); this.createStandingInstructionsForm.controls['toOfficeId'].enable(); this.createStandingInstructionsForm.controls['toClientId'].enable(); } }); - } /** Executes on change of various select options */ changeEvent() { const formValue = this.refineObject(this.createStandingInstructionsForm.value); - this.accountTransfersService.getStandingInstructionsTemplate(this.clientId, this.officeId, this.accountTypeId, formValue).subscribe((response: any) => { - this.standingIntructionsTemplate = response; - this.setOptions(); - }); + this.accountTransfersService + .getStandingInstructionsTemplate(this.clientId, this.officeId, this.accountTypeId, formValue) + .subscribe((response: any) => { + this.standingIntructionsTemplate = response; + this.setOptions(); + }); } /** Refine Object @@ -219,7 +281,7 @@ export class CreateStandingInstructionsComponent implements OnInit { const dateFormat = this.settingsService.dateFormat; const locale = this.settingsService.language.code; const standingInstructionData = { - ... this.createStandingInstructionsForm.value, + ...this.createStandingInstructionsForm.value, dateFormat, locale, monthDayFormat: 'dd MMMM', @@ -227,7 +289,10 @@ export class CreateStandingInstructionsComponent implements OnInit { fromOfficeId: this.officeId, validFrom: this.dateUtils.formatDate(this.createStandingInstructionsForm.value.validFrom, dateFormat), validTill: this.dateUtils.formatDate(this.createStandingInstructionsForm.value.validTill, dateFormat), - recurrenceOnMonthDay: this.dateUtils.formatDate(this.createStandingInstructionsForm.value.recurrenceOnMonthDay, 'dd MMMM'), + recurrenceOnMonthDay: this.dateUtils.formatDate( + this.createStandingInstructionsForm.value.recurrenceOnMonthDay, + 'dd MMMM' + ) }; delete standingInstructionData['destination']; delete standingInstructionData['applicant']; @@ -235,5 +300,4 @@ export class CreateStandingInstructionsComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.spec.ts b/src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.spec.ts index 28151f4b3..794148f44 100644 --- a/src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.spec.ts +++ b/src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.spec.ts @@ -8,9 +8,8 @@ describe('EditStandingInstructionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditStandingInstructionsComponent ] - }) - .compileComponents(); + declarations: [EditStandingInstructionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.ts b/src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.ts index 18abf4d46..c88f0a27d 100644 --- a/src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.ts +++ b/src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./edit-standing-instructions.component.scss'] }) export class EditStandingInstructionsComponent implements OnInit { - /** Standing Instructions Data */ standingInstructionsData: any; /** Standing Instructions Id */ @@ -50,12 +49,14 @@ export class EditStandingInstructionsComponent implements OnInit { * @param {SettingsService} settingsService Settings Service * @param {Dates} dateUtils Date Utils */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private route: ActivatedRoute, private router: Router, private accountTransfersService: AccountTransfersService, private settingsService: SettingsService, - private dateUtils: Dates) { + private dateUtils: Dates + ) { this.route.data.subscribe((data: { standingInstructionsDataAndTemplate: any }) => { this.standingInstructionsData = data.standingInstructionsDataAndTemplate; this.standingInstructionsId = data.standingInstructionsDataAndTemplate.id; @@ -77,26 +78,28 @@ export class EditStandingInstructionsComponent implements OnInit { this.standingInstructionsData.recurrenceOnMonthDay.push(n); } this.editStandingInstructionsForm.patchValue({ - 'name': this.standingInstructionsData.name, - 'applicant': this.standingInstructionsData.fromClient.displayName, - 'type': this.standingInstructionsData.transferType.value, - 'priority': this.standingInstructionsData.priority.id, - 'status': this.standingInstructionsData.status.id, - 'fromAccountType': this.standingInstructionsData.fromAccountType.value, - 'fromAccount': this.standingInstructionsData.fromAccount.productName, - 'destination': this.allowclientedit ? 'Within Bank' : 'Own Account', - 'toOffice': this.standingInstructionsData.toOffice.name, - 'toClientId': this.standingInstructionsData.toClient.displayName, - 'toAccountType': this.standingInstructionsData.toAccountType.value, - 'toAccount': this.standingInstructionsData.toAccount.productName, - 'instructionType': this.standingInstructionsData.instructionType.id, - 'amount': this.standingInstructionsData.amount, - 'validFrom': this.standingInstructionsData.validFrom && new Date(this.standingInstructionsData.validFrom), - 'validTill': this.standingInstructionsData.validTill && new Date(this.standingInstructionsData.validTill), - 'recurrenceType': this.standingInstructionsData.recurrenceType.id, - 'recurrenceInterval': this.standingInstructionsData.recurrenceInterval, - 'recurrenceFrequency': this.standingInstructionsData.recurrenceFrequency.id, - 'recurrenceOnMonthDay': this.standingInstructionsData.recurrenceOnMonthDay && new Date(this.standingInstructionsData.recurrenceOnMonthDay) + name: this.standingInstructionsData.name, + applicant: this.standingInstructionsData.fromClient.displayName, + type: this.standingInstructionsData.transferType.value, + priority: this.standingInstructionsData.priority.id, + status: this.standingInstructionsData.status.id, + fromAccountType: this.standingInstructionsData.fromAccountType.value, + fromAccount: this.standingInstructionsData.fromAccount.productName, + destination: this.allowclientedit ? 'Within Bank' : 'Own Account', + toOffice: this.standingInstructionsData.toOffice.name, + toClientId: this.standingInstructionsData.toClient.displayName, + toAccountType: this.standingInstructionsData.toAccountType.value, + toAccount: this.standingInstructionsData.toAccount.productName, + instructionType: this.standingInstructionsData.instructionType.id, + amount: this.standingInstructionsData.amount, + validFrom: this.standingInstructionsData.validFrom && new Date(this.standingInstructionsData.validFrom), + validTill: this.standingInstructionsData.validTill && new Date(this.standingInstructionsData.validTill), + recurrenceType: this.standingInstructionsData.recurrenceType.id, + recurrenceInterval: this.standingInstructionsData.recurrenceInterval, + recurrenceFrequency: this.standingInstructionsData.recurrenceFrequency.id, + recurrenceOnMonthDay: + this.standingInstructionsData.recurrenceOnMonthDay && + new Date(this.standingInstructionsData.recurrenceOnMonthDay) }); } @@ -105,26 +108,41 @@ export class EditStandingInstructionsComponent implements OnInit { */ createEditStandingInstructionsForm() { this.editStandingInstructionsForm = this.formBuilder.group({ - 'name': [{value: '', disabled: true}], - 'applicant': [{ value: '', disabled: true }], - 'type': [{ value: '', disabled: true }], - 'priority': ['', Validators.required], - 'status': ['', Validators.required], - 'fromAccountType': [{ value: '', disabled: true }], - 'fromAccount': [{ value: '', disabled: true }], - 'destination': [{ value: '', disabled: true }], - 'toOffice': [{ value: '', disabled: true }], - 'toClientId': [{ value: '', disabled: true }], - 'toAccountType': [{ value: '', disabled: true }], - 'toAccount': [{ value: '', disabled: true }], - 'instructionType': '', - 'amount': '', - 'validFrom': ['', Validators.required], - 'validTill': ['', Validators.required], - 'recurrenceType': ['', Validators.required], - 'recurrenceInterval': '', - 'recurrenceFrequency': '', - 'recurrenceOnMonthDay': '' + name: [{ value: '', disabled: true }], + applicant: [{ value: '', disabled: true }], + type: [{ value: '', disabled: true }], + priority: [ + '', + Validators.required + ], + status: [ + '', + Validators.required + ], + fromAccountType: [{ value: '', disabled: true }], + fromAccount: [{ value: '', disabled: true }], + destination: [{ value: '', disabled: true }], + toOffice: [{ value: '', disabled: true }], + toClientId: [{ value: '', disabled: true }], + toAccountType: [{ value: '', disabled: true }], + toAccount: [{ value: '', disabled: true }], + instructionType: '', + amount: '', + validFrom: [ + '', + Validators.required + ], + validTill: [ + '', + Validators.required + ], + recurrenceType: [ + '', + Validators.required + ], + recurrenceInterval: '', + recurrenceFrequency: '', + recurrenceOnMonthDay: '' }); } @@ -147,19 +165,23 @@ export class EditStandingInstructionsComponent implements OnInit { dateFormat, instructionType: this.editStandingInstructionsForm.value.instructionType, locale, - monthDayFormat: 'dd MMMM', + monthDayFormat: 'dd MMMM', priority: this.editStandingInstructionsForm.value.priority, - recurrenceFrequency: this.editStandingInstructionsForm.value.recurrenceFrequency, - recurrenceInterval: this.editStandingInstructionsForm.value.recurrenceInterval, - recurrenceOnMonthDay: this.dateUtils.formatDate(this.editStandingInstructionsForm.value.recurrenceOnMonthDay, 'dd MMMM'), - recurrenceType: this.editStandingInstructionsForm.value.recurrenceType, - status: this.editStandingInstructionsForm.value.status, + recurrenceFrequency: this.editStandingInstructionsForm.value.recurrenceFrequency, + recurrenceInterval: this.editStandingInstructionsForm.value.recurrenceInterval, + recurrenceOnMonthDay: this.dateUtils.formatDate( + this.editStandingInstructionsForm.value.recurrenceOnMonthDay, + 'dd MMMM' + ), + recurrenceType: this.editStandingInstructionsForm.value.recurrenceType, + status: this.editStandingInstructionsForm.value.status, validFrom: this.dateUtils.formatDate(this.editStandingInstructionsForm.value.validFrom, dateFormat), validTill: this.dateUtils.formatDate(this.editStandingInstructionsForm.value.validTill, dateFormat) }; - this.accountTransfersService.updateStandingInstructionsData(this.standingInstructionsId, standingInstructionData).subscribe((response: any) => { - this.router.navigate(['../view'], { relativeTo: this.route }); - }); + this.accountTransfersService + .updateStandingInstructionsData(this.standingInstructionsId, standingInstructionData) + .subscribe((response: any) => { + this.router.navigate(['../view'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/account-transfers/list-standing-instructions/list-standing-instructions.component.spec.ts b/src/app/account-transfers/list-standing-instructions/list-standing-instructions.component.spec.ts index e25d1e592..60f4234d4 100644 --- a/src/app/account-transfers/list-standing-instructions/list-standing-instructions.component.spec.ts +++ b/src/app/account-transfers/list-standing-instructions/list-standing-instructions.component.spec.ts @@ -8,9 +8,8 @@ describe('ListStandingInstructionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ListStandingInstructionsComponent ] - }) - .compileComponents(); + declarations: [ListStandingInstructionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/account-transfers/list-standing-instructions/list-standing-instructions.component.ts b/src/app/account-transfers/list-standing-instructions/list-standing-instructions.component.ts index cc2e7980c..5715b4df4 100644 --- a/src/app/account-transfers/list-standing-instructions/list-standing-instructions.component.ts +++ b/src/app/account-transfers/list-standing-instructions/list-standing-instructions.component.ts @@ -22,7 +22,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./list-standing-instructions.component.scss'] }) export class ListStandingInstructionsComponent { - /** Recurring Deposits Data */ standingIntructionsTemplateData: any; /** Instructions Data */ @@ -50,14 +49,21 @@ export class ListStandingInstructionsComponent { /** Data source for instructions table. */ dataSource = new MatTableDataSource(); /** Columns to be displayed in instructions table. */ - displayedColumns: string[] = ['client', 'fromAccount', 'beneficiary', 'toAccount', 'amount', 'validity', 'actions']; + displayedColumns: string[] = [ + 'client', + 'fromAccount', + 'beneficiary', + 'toAccount', + 'amount', + 'validity', + 'actions' + ]; /** Instruction Table Reference */ @ViewChild('instructionsTable', { static: true }) instructionTableRef: MatTable; /** Paginator for centers table. */ @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; - /** * Retrieves Standing Instructions Data from `resolve`. * @param {ActivatedRoute} route Activated Route. @@ -65,10 +71,12 @@ export class ListStandingInstructionsComponent { * @param {SettingsService} settingsService Settings Service * @param {AccountTransfersService} accountTransfersService Account Transfers Service */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private accountTransfersService: AccountTransfersService, private settingsService: SettingsService, - private dialog: MatDialog) { + private dialog: MatDialog + ) { this.route.data.subscribe((data: { standingIntructionsTemplate: any }) => { this.standingIntructionsTemplateData = data.standingIntructionsTemplate; if (data.standingIntructionsTemplate.fromClient) { @@ -106,7 +114,7 @@ export class ListStandingInstructionsComponent { const dateFormat = this.settingsService.dateFormat; const locale = this.settingsService.language.code; const searchData = { - clientId : this.standingIntructionsTemplateData.fromClient.id || this.fromClientId.value, + clientId: this.standingIntructionsTemplateData.fromClient.id || this.fromClientId.value, clientName: this.standingIntructionsTemplateData.fromClient.displayName || this.clientNameControl.value, locale, dateFormat, @@ -130,11 +138,8 @@ export class ListStandingInstructionsComponent { }); deleteStandingInstructionDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.accountTransfersService.deleteStandingInstrucions(instructionId) - .subscribe(() => {}); + this.accountTransfersService.deleteStandingInstrucions(instructionId).subscribe(() => {}); } }); } - } - diff --git a/src/app/account-transfers/list-transactions/list-transactions.component.spec.ts b/src/app/account-transfers/list-transactions/list-transactions.component.spec.ts index 9222f1315..94b1f64e5 100644 --- a/src/app/account-transfers/list-transactions/list-transactions.component.spec.ts +++ b/src/app/account-transfers/list-transactions/list-transactions.component.spec.ts @@ -8,9 +8,8 @@ describe('ListTransactionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ListTransactionsComponent ] - }) - .compileComponents(); + declarations: [ListTransactionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/account-transfers/list-transactions/list-transactions.component.ts b/src/app/account-transfers/list-transactions/list-transactions.component.ts index dff0342a8..c7fe61fb3 100644 --- a/src/app/account-transfers/list-transactions/list-transactions.component.ts +++ b/src/app/account-transfers/list-transactions/list-transactions.component.ts @@ -13,14 +13,17 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./list-transactions.component.scss'] }) export class ListTransactionsComponent { - - /** List Transactions Data */ listTransactionData: any; /** Data source for instructions table. */ dataSource = new MatTableDataSource(); /** Columns to be displayed in instructions table. */ - displayedColumns: string[] = ['transactionDate', 'amount', 'notes', 'reversed']; + displayedColumns: string[] = [ + 'transactionDate', + 'amount', + 'notes', + 'reversed' + ]; /** Paginator for centers table. */ @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @@ -36,5 +39,4 @@ export class ListTransactionsComponent { this.dataSource.paginator = this.paginator; }); } - } diff --git a/src/app/account-transfers/make-account-transfers/make-account-transfers.component.spec.ts b/src/app/account-transfers/make-account-transfers/make-account-transfers.component.spec.ts index 6f16ad54a..100738304 100644 --- a/src/app/account-transfers/make-account-transfers/make-account-transfers.component.spec.ts +++ b/src/app/account-transfers/make-account-transfers/make-account-transfers.component.spec.ts @@ -8,9 +8,8 @@ describe('MakeAccountTransfersComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ MakeAccountTransfersComponent ] - }) - .compileComponents(); + declarations: [MakeAccountTransfersComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/account-transfers/make-account-transfers/make-account-transfers.component.ts b/src/app/account-transfers/make-account-transfers/make-account-transfers.component.ts index fa971609e..fca33ec1a 100644 --- a/src/app/account-transfers/make-account-transfers/make-account-transfers.component.ts +++ b/src/app/account-transfers/make-account-transfers/make-account-transfers.component.ts @@ -9,7 +9,6 @@ import { SettingsService } from 'app/settings/settings.service'; import { ClientsService } from 'app/clients/clients.service'; import { Dates } from 'app/core/utils/dates'; - /** * Create account transfers */ @@ -19,7 +18,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./make-account-transfers.component.scss'] }) export class MakeAccountTransfersComponent implements OnInit, AfterViewInit { - /** Standing Instructions Data */ accountTransferTemplateData: any; /** Minimum date allowed. */ @@ -55,13 +53,15 @@ export class MakeAccountTransfersComponent implements OnInit, AfterViewInit { * @param {SettingsService} settingsService Settings Service * @param {ClientsService} clientsService Clients Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private route: ActivatedRoute, private router: Router, private accountTransfersService: AccountTransfersService, private dateUtils: Dates, private settingsService: SettingsService, - private clientsService: ClientsService) { + private clientsService: ClientsService + ) { this.route.data.subscribe((data: { accountTransferTemplate: any }) => { this.accountTransferTemplateData = data.accountTransferTemplate; this.setParams(); @@ -98,13 +98,34 @@ export class MakeAccountTransfersComponent implements OnInit, AfterViewInit { */ createMakeAccountTransferForm() { this.makeAccountTransferForm = this.formBuilder.group({ - 'toOfficeId': ['', Validators.required], - 'toClientId': ['', Validators.required], - 'toAccountType': ['', Validators.required], - 'toAccountId': ['', Validators.required], - 'transferAmount': [this.accountTransferTemplateData.transferAmount, Validators.required], - 'transferDate': [this.settingsService.businessDate, Validators.required], - 'transferDescription': ['', Validators.required], + toOfficeId: [ + '', + Validators.required + ], + toClientId: [ + '', + Validators.required + ], + toAccountType: [ + '', + Validators.required + ], + toAccountId: [ + '', + Validators.required + ], + transferAmount: [ + this.accountTransferTemplateData.transferAmount, + Validators.required + ], + transferDate: [ + this.settingsService.businessDate, + Validators.required + ], + transferDescription: [ + '', + Validators.required + ] }); } @@ -118,17 +139,19 @@ export class MakeAccountTransfersComponent implements OnInit, AfterViewInit { /** Executes on change of various select options */ changeEvent() { const formValue = this.refineObject(this.makeAccountTransferForm.value); - this.accountTransfersService.newAccountTranferResource(this.id, this.accountTypeId, formValue).subscribe((response: any) => { - this.accountTransferTemplateData = response; - this.toClientTypeData = response.toClientOptions; - this.setOptions(); - }); + this.accountTransfersService + .newAccountTranferResource(this.id, this.accountTypeId, formValue) + .subscribe((response: any) => { + this.accountTransferTemplateData = response; + this.toClientTypeData = response.toClientOptions; + this.setOptions(); + }); } /** Refine Object * Removes the object param with null or '' values */ - refineObject(dataObj: { [x: string]: any; transferAmount: any; transferDate: any; transferDescription: any; }) { + refineObject(dataObj: { [x: string]: any; transferAmount: any; transferDate: any; transferDescription: any }) { delete dataObj.transferAmount; delete dataObj.transferDate; delete dataObj.transferDescription; @@ -151,10 +174,9 @@ export class MakeAccountTransfersComponent implements OnInit, AfterViewInit { ngAfterViewInit() { this.makeAccountTransferForm.controls.toClientId.valueChanges.subscribe((value: string) => { if (value.length >= 2) { - this.clientsService.getFilteredClients('displayName', 'ASC', true, value) - .subscribe((data: any) => { - this.clientsData = data.pageItems; - }); + this.clientsService.getFilteredClients('displayName', 'ASC', true, value).subscribe((data: any) => { + this.clientsData = data.pageItems; + }); this.changeEvent(); } }); @@ -176,7 +198,7 @@ export class MakeAccountTransfersComponent implements OnInit, AfterViewInit { const dateFormat = this.settingsService.dateFormat; const locale = this.settingsService.language.code; const makeAccountTransferData = { - ... this.makeAccountTransferForm.value, + ...this.makeAccountTransferForm.value, transferDate: this.dateUtils.formatDate(this.makeAccountTransferForm.value.transferDate, dateFormat), dateFormat, locale, @@ -190,5 +212,4 @@ export class MakeAccountTransfersComponent implements OnInit, AfterViewInit { this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - } diff --git a/src/app/account-transfers/view-account-transfer/view-account-transfer.component.spec.ts b/src/app/account-transfers/view-account-transfer/view-account-transfer.component.spec.ts index ef12f99b7..4e6802efd 100644 --- a/src/app/account-transfers/view-account-transfer/view-account-transfer.component.spec.ts +++ b/src/app/account-transfers/view-account-transfer/view-account-transfer.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewAccountTransferComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewAccountTransferComponent ] - }) - .compileComponents(); + declarations: [ViewAccountTransferComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/account-transfers/view-account-transfer/view-account-transfer.component.ts b/src/app/account-transfers/view-account-transfer/view-account-transfer.component.ts index 5f2a037e4..e4966d9dc 100644 --- a/src/app/account-transfers/view-account-transfer/view-account-transfer.component.ts +++ b/src/app/account-transfers/view-account-transfer/view-account-transfer.component.ts @@ -9,15 +9,16 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-account-transfer.component.scss'] }) export class ViewAccountTransferComponent { - viewAccountTransferData: any; /** * Retrieves the view account transfer data from `resolve`. * @param {ActivatedRoute} route Activated Route. * @param {Location} location Location. */ - constructor(private route: ActivatedRoute, - private location: Location) { + constructor( + private route: ActivatedRoute, + private location: Location + ) { this.route.data.subscribe((data: { viewAccountTransferData: any }) => { this.viewAccountTransferData = data.viewAccountTransferData; }); @@ -38,5 +39,4 @@ export class ViewAccountTransferComponent { transactionColor(): string { return this.viewAccountTransferData.reversed ? 'undo' : 'active'; } - } diff --git a/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.spec.ts b/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.spec.ts index ad2d63547..914a5b4a1 100644 --- a/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.spec.ts +++ b/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewStandingInstructionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewStandingInstructionsComponent ] - }) - .compileComponents(); + declarations: [ViewStandingInstructionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.ts b/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.ts index fa9237cc1..6d20ebbb6 100644 --- a/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.ts +++ b/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.ts @@ -8,7 +8,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-standing-instructions.component.scss'] }) export class ViewStandingInstructionsComponent { - /** Standing Instructions Data */ standingInstructionsData: any; /** Allow Client Edit */ @@ -19,12 +18,11 @@ export class ViewStandingInstructionsComponent { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe((data: { standingInstructionsData: any}) => { + this.route.data.subscribe((data: { standingInstructionsData: any }) => { this.standingInstructionsData = data.standingInstructionsData; if (this.standingInstructionsData.fromClient.id === this.standingInstructionsData.toClient.id) { this.allowclientedit = false; } }); } - } diff --git a/src/app/accounting/accounting-routing.module.ts b/src/app/accounting/accounting-routing.module.ts index dc556b3a8..cc2b004dd 100644 --- a/src/app/accounting/accounting-routing.module.ts +++ b/src/app/accounting/accounting-routing.module.ts @@ -84,7 +84,7 @@ const routes: Routes = [ resolve: { offices: OfficesResolver, glAccounts: GlAccountsResolver - }, + } }, { path: 'frequent-postings', @@ -121,7 +121,7 @@ const routes: Routes = [ } } ] - }, + } ] }, { @@ -199,7 +199,10 @@ const routes: Routes = [ }, { path: 'view/:id', - data: { title: 'View GL Account', routeResolveBreadcrumb: ['glAccountAndChartOfAccountsTemplate', 'name'] }, + data: { title: 'View GL Account', routeResolveBreadcrumb: [ + 'glAccountAndChartOfAccountsTemplate', + 'name' + ] }, resolve: { glAccountAndChartOfAccountsTemplate: GlAccountAndChartOfAccountsTemplateResolver }, @@ -282,7 +285,10 @@ const routes: Routes = [ }, { path: 'view/:id', - data: { title: 'View Accounting Rule', routeResolveBreadcrumb: ['accountingRule', 'name'] }, + data: { title: 'View Accounting Rule', routeResolveBreadcrumb: [ + 'accountingRule', + 'name' + ] }, resolve: { accountingRule: AccountingRuleResolver }, @@ -357,7 +363,7 @@ const routes: Routes = [ }, { path: 'journal-entry', - data: {title: 'Journal Entries', breadcrumb: 'Journal Entries' }, + data: { title: 'Journal Entries', breadcrumb: 'Journal Entries' }, children: [ { path: 'view/:id', @@ -378,6 +384,7 @@ const routes: Routes = [ ] } ]) + ]; /** @@ -415,4 +422,4 @@ const routes: Routes = [ ProvisioningJournalEntriesResolver ] }) -export class AccountingRoutingModule { } +export class AccountingRoutingModule {} diff --git a/src/app/accounting/accounting-rules/accounting-rule.resolver.ts b/src/app/accounting/accounting-rules/accounting-rule.resolver.ts index 056b6d060..8f797b5e9 100644 --- a/src/app/accounting/accounting-rules/accounting-rule.resolver.ts +++ b/src/app/accounting/accounting-rules/accounting-rule.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class AccountingRuleResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -27,5 +26,4 @@ export class AccountingRuleResolver implements Resolve { const id = route.paramMap.get('id'); return this.accountingService.getAccountingRule(id); } - } diff --git a/src/app/accounting/accounting-rules/accounting-rules-template.resolver.ts b/src/app/accounting/accounting-rules/accounting-rules-template.resolver.ts index 967e2fc00..24aa8e417 100644 --- a/src/app/accounting/accounting-rules/accounting-rules-template.resolver.ts +++ b/src/app/accounting/accounting-rules/accounting-rules-template.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class AccountingRulesTemplateResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class AccountingRulesTemplateResolver implements Resolve { resolve(): Observable { return this.accountingService.getAccountingRulesTemplate(); } - } diff --git a/src/app/accounting/accounting-rules/accounting-rules.component.spec.ts b/src/app/accounting/accounting-rules/accounting-rules.component.spec.ts index 0d3f08eba..69b3a50b8 100644 --- a/src/app/accounting/accounting-rules/accounting-rules.component.spec.ts +++ b/src/app/accounting/accounting-rules/accounting-rules.component.spec.ts @@ -8,9 +8,8 @@ describe('AccountingRulesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AccountingRulesComponent ] - }) - .compileComponents(); + declarations: [AccountingRulesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/accounting-rules/accounting-rules.component.ts b/src/app/accounting/accounting-rules/accounting-rules.component.ts index 98d4f9765..32ed5b0c7 100644 --- a/src/app/accounting/accounting-rules/accounting-rules.component.ts +++ b/src/app/accounting/accounting-rules/accounting-rules.component.ts @@ -14,11 +14,17 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./accounting-rules.component.scss'] }) export class AccountingRulesComponent implements OnInit { - /** Accounting rule data. */ accountingRuleData: any; /** Columns to be displayed in accounting rules table. */ - displayedColumns: string[] = ['name', 'officeName', 'debitTags', 'debitAccount', 'creditTags', 'creditAccount']; + displayedColumns: string[] = [ + 'name', + 'officeName', + 'debitTags', + 'debitAccount', + 'creditTags', + 'creditAccount' + ]; /** Data source for accounting rules table. */ dataSource: MatTableDataSource; @@ -49,16 +55,23 @@ export class AccountingRulesComponent implements OnInit { */ setAccountingRules() { this.accountingRuleData.forEach((accountingRule: any) => { - accountingRule.debitTags = accountingRule.debitTags ? accountingRule.debitTags.map((debitTag: any) => debitTag.tag.name).join(', ') : ''; - accountingRule.creditTags = accountingRule.creditTags ? accountingRule.creditTags.map((creditTag: any) => creditTag.tag.name).join(', ') : ''; + accountingRule.debitTags = accountingRule.debitTags + ? accountingRule.debitTags.map((debitTag: any) => debitTag.tag.name).join(', ') + : ''; + accountingRule.creditTags = accountingRule.creditTags + ? accountingRule.creditTags.map((creditTag: any) => creditTag.tag.name).join(', ') + : ''; }); this.dataSource = new MatTableDataSource(this.accountingRuleData); this.dataSource.paginator = this.paginator; this.dataSource.sortingDataAccessor = (accountingRule: any, property: any) => { switch (property) { - case 'debitAccount': return accountingRule.debitAccounts[0].name; - case 'creditAccount': return accountingRule.creditAccounts[0].name; - default: return accountingRule[property]; + case 'debitAccount': + return accountingRule.debitAccounts[0].name; + case 'creditAccount': + return accountingRule.creditAccounts[0].name; + default: + return accountingRule[property]; } }; this.dataSource.sort = this.sort; @@ -71,5 +84,4 @@ export class AccountingRulesComponent implements OnInit { applyFilter(filterValue: string) { this.dataSource.filter = filterValue.trim().toLowerCase(); } - } diff --git a/src/app/accounting/accounting-rules/accounting-rules.resolver.ts b/src/app/accounting/accounting-rules/accounting-rules.resolver.ts index f19b3944c..f0015c413 100644 --- a/src/app/accounting/accounting-rules/accounting-rules.resolver.ts +++ b/src/app/accounting/accounting-rules/accounting-rules.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class AccountingRulesResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class AccountingRulesResolver implements Resolve { resolve(): Observable { return this.accountingService.getAccountingRules(); } - } diff --git a/src/app/accounting/accounting-rules/create-rule/create-rule.component.spec.ts b/src/app/accounting/accounting-rules/create-rule/create-rule.component.spec.ts index 6ed4a6a38..3b2998e59 100644 --- a/src/app/accounting/accounting-rules/create-rule/create-rule.component.spec.ts +++ b/src/app/accounting/accounting-rules/create-rule/create-rule.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateRuleComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateRuleComponent ] - }) - .compileComponents(); + declarations: [CreateRuleComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/accounting-rules/create-rule/create-rule.component.ts b/src/app/accounting/accounting-rules/create-rule/create-rule.component.ts index 335ee2eec..dcc360aef 100644 --- a/src/app/accounting/accounting-rules/create-rule/create-rule.component.ts +++ b/src/app/accounting/accounting-rules/create-rule/create-rule.component.ts @@ -18,7 +18,6 @@ import { oneOfTheFieldsIsRequiredValidator } from '../one-of-the-fields-is-requi styleUrls: ['./create-rule.component.scss'] }) export class CreateRuleComponent implements OnInit { - /** Accounting rule form. */ accountingRuleForm: UntypedFormGroup; /** Office data. */ @@ -37,10 +36,12 @@ export class CreateRuleComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { accountingRulesTemplate: any }) => { this.officeData = data.accountingRulesTemplate.allowedOffices; this.glAccountData = data.accountingRulesTemplate.allowedAccounts; @@ -61,19 +62,28 @@ export class CreateRuleComponent implements OnInit { * Creates accounting rule form. */ createAccountingRuleForm() { - this.accountingRuleForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'officeId': ['', Validators.required], - 'debitRuleType': ['fixedAccount'], - 'accountToDebit': [''], - 'debitTags': [''], - 'allowMultipleDebitEntries': [''], - 'creditRuleType': ['fixedAccount'], - 'accountToCredit': [''], - 'creditTags': [''], - 'allowMultipleCreditEntries': [''], - 'description': [''] - }, { validator: oneOfTheFieldsIsRequiredValidator }); + this.accountingRuleForm = this.formBuilder.group( + { + name: [ + '', + Validators.required + ], + officeId: [ + '', + Validators.required + ], + debitRuleType: ['fixedAccount'], + accountToDebit: [''], + debitTags: [''], + allowMultipleDebitEntries: [''], + creditRuleType: ['fixedAccount'], + accountToCredit: [''], + creditTags: [''], + allowMultipleCreditEntries: [''], + description: [''] + }, + { validator: oneOfTheFieldsIsRequiredValidator } + ); } /** @@ -121,8 +131,13 @@ export class CreateRuleComponent implements OnInit { delete accountingRule.debitRuleType; delete accountingRule.creditRuleType; this.accountingService.createAccountingRule(accountingRule).subscribe((response: any) => { - this.router.navigate(['../view', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../view', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/accounting/accounting-rules/edit-rule/edit-rule.component.spec.ts b/src/app/accounting/accounting-rules/edit-rule/edit-rule.component.spec.ts index 97e4412f2..f86175502 100644 --- a/src/app/accounting/accounting-rules/edit-rule/edit-rule.component.spec.ts +++ b/src/app/accounting/accounting-rules/edit-rule/edit-rule.component.spec.ts @@ -8,9 +8,8 @@ describe('EditRuleComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditRuleComponent ] - }) - .compileComponents(); + declarations: [EditRuleComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/accounting-rules/edit-rule/edit-rule.component.ts b/src/app/accounting/accounting-rules/edit-rule/edit-rule.component.ts index 72edd8569..23227f2c7 100644 --- a/src/app/accounting/accounting-rules/edit-rule/edit-rule.component.ts +++ b/src/app/accounting/accounting-rules/edit-rule/edit-rule.component.ts @@ -18,7 +18,6 @@ import { oneOfTheFieldsIsRequiredValidator } from '../one-of-the-fields-is-requi styleUrls: ['./edit-rule.component.scss'] }) export class EditRuleComponent implements OnInit { - /** Accounting rule form. */ accountingRuleForm: UntypedFormGroup; /** Accounting rule. */ @@ -39,20 +38,19 @@ export class EditRuleComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router) { - this.route.data.subscribe((data: { - accountingRulesTemplate: any, - accountingRule: any - }) => { - this.officeData = data.accountingRulesTemplate.allowedOffices; - this.glAccountData = data.accountingRulesTemplate.allowedAccounts; - this.debitTagData = data.accountingRulesTemplate.allowedDebitTagOptions; - this.creditTagData = data.accountingRulesTemplate.allowedCreditTagOptions; - this.accountingRule = data.accountingRule; - }); + constructor( + private formBuilder: UntypedFormBuilder, + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router + ) { + this.route.data.subscribe((data: { accountingRulesTemplate: any; accountingRule: any }) => { + this.officeData = data.accountingRulesTemplate.allowedOffices; + this.glAccountData = data.accountingRulesTemplate.allowedAccounts; + this.debitTagData = data.accountingRulesTemplate.allowedDebitTagOptions; + this.creditTagData = data.accountingRulesTemplate.allowedCreditTagOptions; + this.accountingRule = data.accountingRule; + }); } /** @@ -67,26 +65,35 @@ export class EditRuleComponent implements OnInit { * Creates accounting rule form. */ createAccountingRuleForm() { - this.accountingRuleForm = this.formBuilder.group({ - 'name': [this.accountingRule.name, Validators.required], - 'officeId': [this.accountingRule.officeId, Validators.required], - 'debitRuleType': [''], - 'accountToDebit': [''], - 'debitTags': [''], - 'allowMultipleDebitEntries': [''], - 'creditRuleType': [''], - 'accountToCredit': [''], - 'creditTags': [''], - 'allowMultipleCreditEntries': [''], - 'description': [this.accountingRule.description] - }, { validator: oneOfTheFieldsIsRequiredValidator }); + this.accountingRuleForm = this.formBuilder.group( + { + name: [ + this.accountingRule.name, + Validators.required + ], + officeId: [ + this.accountingRule.officeId, + Validators.required + ], + debitRuleType: [''], + accountToDebit: [''], + debitTags: [''], + allowMultipleDebitEntries: [''], + creditRuleType: [''], + accountToCredit: [''], + creditTags: [''], + allowMultipleCreditEntries: [''], + description: [this.accountingRule.description] + }, + { validator: oneOfTheFieldsIsRequiredValidator } + ); } /** * Sets accounting rule form for selected accounting rule type. */ setAccountingRulesForm() { - this.accountingRuleForm.get('debitRuleType').valueChanges.subscribe(debitRuleType => { + this.accountingRuleForm.get('debitRuleType').valueChanges.subscribe((debitRuleType) => { if (debitRuleType === 'fixedAccount') { this.accountingRuleForm.get('debitTags').reset(); this.accountingRuleForm.get('allowMultipleDebitEntries').reset(); @@ -95,7 +102,7 @@ export class EditRuleComponent implements OnInit { this.accountingRuleForm.get('allowMultipleDebitEntries').setValue(false); } }); - this.accountingRuleForm.get('creditRuleType').valueChanges.subscribe(creditRuleType => { + this.accountingRuleForm.get('creditRuleType').valueChanges.subscribe((creditRuleType) => { if (creditRuleType === 'fixedAccount') { this.accountingRuleForm.get('creditTags').reset(); this.accountingRuleForm.get('allowMultipleCreditEntries').reset(); @@ -110,7 +117,9 @@ export class EditRuleComponent implements OnInit { this.accountingRuleForm.get('accountToDebit').setValue(this.accountingRule.debitAccounts[0].id); } else { this.accountingRuleForm.get('debitRuleType').setValue('listOfAccounts'); - this.accountingRuleForm.get('debitTags').setValue(this.accountingRule.debitTags.map((debitTag: any) => debitTag.tag.id)); + this.accountingRuleForm + .get('debitTags') + .setValue(this.accountingRule.debitTags.map((debitTag: any) => debitTag.tag.id)); this.accountingRuleForm.get('allowMultipleDebitEntries').setValue(this.accountingRule.allowMultipleDebitEntries); } @@ -119,8 +128,12 @@ export class EditRuleComponent implements OnInit { this.accountingRuleForm.get('accountToCredit').setValue(this.accountingRule.creditAccounts[0].id); } else { this.accountingRuleForm.get('creditRuleType').setValue('listOfAccounts'); - this.accountingRuleForm.get('creditTags').setValue(this.accountingRule.creditTags.map((creditTag: any) => creditTag.tag.id)); - this.accountingRuleForm.get('allowMultipleCreditEntries').setValue(this.accountingRule.allowMultipleCreditEntries); + this.accountingRuleForm + .get('creditTags') + .setValue(this.accountingRule.creditTags.map((creditTag: any) => creditTag.tag.id)); + this.accountingRuleForm + .get('allowMultipleCreditEntries') + .setValue(this.accountingRule.allowMultipleCreditEntries); } } @@ -145,8 +158,13 @@ export class EditRuleComponent implements OnInit { delete accountingRule.debitRuleType; delete accountingRule.creditRuleType; this.accountingService.updateAccountingRule(this.accountingRule.id, accountingRule).subscribe((response: any) => { - this.router.navigate(['../../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/accounting/accounting-rules/one-of-the-fields-is-required.validator.ts b/src/app/accounting/accounting-rules/one-of-the-fields-is-required.validator.ts index 98323805a..7be248693 100644 --- a/src/app/accounting/accounting-rules/one-of-the-fields-is-required.validator.ts +++ b/src/app/accounting/accounting-rules/one-of-the-fields-is-required.validator.ts @@ -2,10 +2,12 @@ import { UntypedFormGroup, ValidatorFn, ValidationErrors } from '@angular/forms'; /** Validates that one of the fields for debit or credit is filled for a given accounting rule type. */ -export const oneOfTheFieldsIsRequiredValidator: ValidatorFn = (accountingRuleForm: UntypedFormGroup): ValidationErrors | null => { +export const oneOfTheFieldsIsRequiredValidator: ValidatorFn = ( + accountingRuleForm: UntypedFormGroup +): ValidationErrors | null => { const accountToDebit = accountingRuleForm.controls.accountToDebit.value; const debitTags = accountingRuleForm.controls.debitTags.value; const accountToCredit = accountingRuleForm.controls.accountToCredit.value; const creditTags = accountingRuleForm.controls.creditTags.value; - return ((accountToDebit || debitTags) && (accountToCredit || creditTags)) ? null : { 'error': true }; + return (accountToDebit || debitTags) && (accountToCredit || creditTags) ? null : { error: true }; }; diff --git a/src/app/accounting/accounting-rules/view-rule/view-rule.component.spec.ts b/src/app/accounting/accounting-rules/view-rule/view-rule.component.spec.ts index 80b237050..e0d674991 100644 --- a/src/app/accounting/accounting-rules/view-rule/view-rule.component.spec.ts +++ b/src/app/accounting/accounting-rules/view-rule/view-rule.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewRuleComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewRuleComponent ] - }) - .compileComponents(); + declarations: [ViewRuleComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/accounting-rules/view-rule/view-rule.component.ts b/src/app/accounting/accounting-rules/view-rule/view-rule.component.ts index 39dcbf716..414e0d2c7 100644 --- a/src/app/accounting/accounting-rules/view-rule/view-rule.component.ts +++ b/src/app/accounting/accounting-rules/view-rule/view-rule.component.ts @@ -18,7 +18,6 @@ import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dial styleUrls: ['./view-rule.component.scss'] }) export class ViewRuleComponent { - /** Accounting rule. */ accountingRule: any; @@ -29,10 +28,12 @@ export class ViewRuleComponent { * @param {Router} router Router for navigation. * @param {MatDialog} dialog Dialog reference. */ - constructor(private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router, - public dialog: MatDialog) { + constructor( + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router, + public dialog: MatDialog + ) { this.route.data.subscribe((data: { accountingRule: any }) => { this.accountingRule = data.accountingRule; }); @@ -47,12 +48,10 @@ export class ViewRuleComponent { }); deleteAccountingRuleDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.accountingService.deleteAccountingRule(this.accountingRule.id) - .subscribe(() => { - this.router.navigate(['/accounting/accounting-rules']); - }); + this.accountingService.deleteAccountingRule(this.accountingRule.id).subscribe(() => { + this.router.navigate(['/accounting/accounting-rules']); + }); } }); } - } diff --git a/src/app/accounting/accounting.component.ts b/src/app/accounting/accounting.component.ts index 58eda2970..ffb60ae9e 100644 --- a/src/app/accounting/accounting.component.ts +++ b/src/app/accounting/accounting.component.ts @@ -15,7 +15,6 @@ import { PopoverService } from '../configuration-wizard/popover/popover.service' styleUrls: ['./accounting.component.scss'] }) export class AccountingComponent implements AfterViewInit { - /* Reference of Chart of Accounts */ @ViewChild('chartofAccounts') chartofAccounts: ElementRef; /* Template for popover on Chart of Accounts */ @@ -44,9 +43,11 @@ export class AccountingComponent implements AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { } + constructor( + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) {} /** * Popover function @@ -56,7 +57,12 @@ export class AccountingComponent implements AfterViewInit { * @param backdrop Boolean. * @param arrowNumber - The index of the boolean value to toggle. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -76,7 +82,12 @@ export class AccountingComponent implements AfterViewInit { } if (this.configurationWizardService.showMigrateOpeningBalances === true) { setTimeout(() => { - this.showPopover(this.templateMigrateOpeningBalances, this.migrateOpeningBalances.nativeElement, 'bottom', true); + this.showPopover( + this.templateMigrateOpeningBalances, + this.migrateOpeningBalances.nativeElement, + 'bottom', + true + ); }); } if (this.configurationWizardService.showClosingEntries === true) { @@ -181,5 +192,4 @@ export class AccountingComponent implements AfterViewInit { // Toggle the boolean value at the given index this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber]; } - } diff --git a/src/app/accounting/accounting.module.ts b/src/app/accounting/accounting.module.ts index 535528dd6..b4ce7a277 100644 --- a/src/app/accounting/accounting.module.ts +++ b/src/app/accounting/accounting.module.ts @@ -78,4 +78,4 @@ import { PipesModule } from 'app/pipes/pipes.module'; ViewProvisioningJournalEntriesComponent ] }) -export class AccountingModule { } +export class AccountingModule {} diff --git a/src/app/accounting/accounting.service.ts b/src/app/accounting/accounting.service.ts index 68e767d88..474298232 100644 --- a/src/app/accounting/accounting.service.ts +++ b/src/app/accounting/accounting.service.ts @@ -14,18 +14,17 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class AccountingService { - /** * @param {HttpClient} http Http Client to send requests. */ - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * @returns {Observable} Offices data ordered by id. */ getOffices(): Observable { const httpParams = new HttpParams().set('orderBy', 'id'); - return this.http.get('/offices', { params: httpParams }); + return this.http.get('/offices', { params: httpParams }); } /** @@ -66,10 +65,7 @@ export class AccountingService { * @returns {Observable} GL Accounts. */ getGlAccounts(): Observable { - const httpParams = new HttpParams() - .set('manualEntriesAllowed', 'true') - .set('usage', '1') - .set('disabled', 'false'); + const httpParams = new HttpParams().set('manualEntriesAllowed', 'true').set('usage', '1').set('disabled', 'false'); return this.http.get(`/glaccounts`, { params: httpParams }); } @@ -78,9 +74,7 @@ export class AccountingService { * @returns {Observable} Journal Entries. */ getJournalEntry(transactionId: string): Observable { - const httpParams = new HttpParams() - .set('transactionId', transactionId) - .set('transactionDetails', 'true'); + const httpParams = new HttpParams().set('transactionId', transactionId).set('transactionDetails', 'true'); return this.http.get(`/journalentries`, { params: httpParams }); } @@ -397,5 +391,4 @@ export class AccountingService { const httpParams = new HttpParams().set('command', 'recreateprovisioningentry'); return this.http.post(`/provisioningentries/${provisioningEntryId}`, {}, { params: httpParams }); } - } diff --git a/src/app/accounting/chart-of-accounts/chart-of-accounts.component.spec.ts b/src/app/accounting/chart-of-accounts/chart-of-accounts.component.spec.ts index 226cb278c..1b63e8478 100644 --- a/src/app/accounting/chart-of-accounts/chart-of-accounts.component.spec.ts +++ b/src/app/accounting/chart-of-accounts/chart-of-accounts.component.spec.ts @@ -8,9 +8,8 @@ describe('ChartOfAccountsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChartOfAccountsComponent ] - }) - .compileComponents(); + declarations: [ChartOfAccountsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/chart-of-accounts/chart-of-accounts.component.ts b/src/app/accounting/chart-of-accounts/chart-of-accounts.component.ts index c2f6a624a..e80b85d39 100644 --- a/src/app/accounting/chart-of-accounts/chart-of-accounts.component.ts +++ b/src/app/accounting/chart-of-accounts/chart-of-accounts.component.ts @@ -29,13 +29,19 @@ import { TreeControlService } from 'app/shared/common-logic/tree-control.service styleUrls: ['./chart-of-accounts.component.scss'] }) export class ChartOfAccountsComponent implements AfterViewInit, OnInit { - /** Button toggle group form control for type of view. (list/tree) */ viewGroup = new UntypedFormControl('listView'); /** GL Account data. */ glAccountData: any; /** Columns to be displayed in chart of accounts table. */ - displayedColumns: string[] = ['name', 'glCode', 'glAccountType', 'disabled', 'manualEntriesAllowed', 'usedAs']; + displayedColumns: string[] = [ + 'name', + 'glCode', + 'glAccountType', + 'disabled', + 'manualEntriesAllowed', + 'usedAs' + ]; /** Data source for chart of accounts table. */ tableDataSource: MatTableDataSource; /** Nested tree control for chart of accounts tree. */ @@ -69,12 +75,14 @@ export class ChartOfAccountsComponent implements AfterViewInit, OnInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private glAccountTreeService: GlAccountTreeService, - private route: ActivatedRoute, - private router: Router, - private treeControlService: TreeControlService, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { + constructor( + private glAccountTreeService: GlAccountTreeService, + private route: ActivatedRoute, + private router: Router, + private treeControlService: TreeControlService, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { this.route.data.subscribe((data: { chartOfAccounts: any }) => { this.glAccountData = data.chartOfAccounts; glAccountTreeService.initialize(this.glAccountData); @@ -102,9 +110,12 @@ export class ChartOfAccountsComponent implements AfterViewInit, OnInit { this.tableDataSource.paginator = this.paginator; this.tableDataSource.sortingDataAccessor = (glAccount: any, property: any) => { switch (property) { - case 'glAccountType': return glAccount.type.value; - case 'usedAs': return glAccount.usage.value; - default: return glAccount[property]; + case 'glAccountType': + return glAccount.type.value; + case 'usedAs': + return glAccount.usage.value; + default: + return glAccount[property]; } }; this.tableDataSource.sort = this.sort; @@ -158,7 +169,12 @@ export class ChartOfAccountsComponent implements AfterViewInit, OnInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -188,5 +204,4 @@ export class ChartOfAccountsComponent implements AfterViewInit, OnInit { toggleExpandCollapse() { this.isTreeExpanded = this.treeControlService.toggleExpandCollapse(this.nestedTreeControl, this.isTreeExpanded); } - } diff --git a/src/app/accounting/chart-of-accounts/chart-of-accounts.resolver.ts b/src/app/accounting/chart-of-accounts/chart-of-accounts.resolver.ts index 844226bef..746dbbc41 100644 --- a/src/app/accounting/chart-of-accounts/chart-of-accounts.resolver.ts +++ b/src/app/accounting/chart-of-accounts/chart-of-accounts.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class ChartOfAccountsResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class ChartOfAccountsResolver implements Resolve { resolve(): Observable { return this.accountingService.getChartOfAccounts(); } - } diff --git a/src/app/accounting/chart-of-accounts/create-gl-account/chart-of-accounts-template.resolver.ts b/src/app/accounting/chart-of-accounts/create-gl-account/chart-of-accounts-template.resolver.ts index 4aa047096..09d6faa4d 100644 --- a/src/app/accounting/chart-of-accounts/create-gl-account/chart-of-accounts-template.resolver.ts +++ b/src/app/accounting/chart-of-accounts/create-gl-account/chart-of-accounts-template.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../../accounting.service'; */ @Injectable() export class ChartOfAccountsTemplateResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class ChartOfAccountsTemplateResolver implements Resolve { resolve(): Observable { return this.accountingService.getChartOfAccountsTemplate(); } - } diff --git a/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.spec.ts b/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.spec.ts index df3ddf366..1eee28cd4 100644 --- a/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.spec.ts +++ b/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateGlAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateGlAccountComponent ] - }) - .compileComponents(); + declarations: [CreateGlAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.ts b/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.ts index 586486d06..116e4347f 100644 --- a/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.ts +++ b/src/app/accounting/chart-of-accounts/create-gl-account/create-gl-account.component.ts @@ -22,7 +22,6 @@ import { GLAccount } from 'app/shared/models/general.model'; styleUrls: ['./create-gl-account.component.scss'] }) export class CreateGlAccountComponent implements OnInit, AfterViewInit { - /** GL account form. */ glAccountForm: UntypedFormGroup; /** Chart of accounts data. */ @@ -57,14 +56,16 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit { * @param {PopoverService} popoverService PopoverService. * @param {Matdialog} dialog Matdialog. */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private accountingService: AccountingService, private route: ActivatedRoute, private router: Router, private configurationWizardService: ConfigurationWizardService, private popoverService: PopoverService, - public dialog: MatDialog) { - this.route.queryParamMap.subscribe(params => { + public dialog: MatDialog + ) { + this.route.queryParamMap.subscribe((params) => { this.accountTypeId = Number(params.get('accountType')); this.parentId = Number(params.get('parent')); if (this.parentId) { @@ -92,14 +93,26 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit { */ createGlAccountForm() { this.glAccountForm = this.formBuilder.group({ - 'type': ['', Validators.required], - 'name': ['', Validators.required], - 'usage': ['', Validators.required], - 'glCode': ['', Validators.required], - 'parentId': [this.parentId || undefined], - 'tagId': [''], - 'manualEntriesAllowed': [true], - 'description': [''] + type: [ + '', + Validators.required + ], + name: [ + '', + Validators.required + ], + usage: [ + '', + Validators.required + ], + glCode: [ + '', + Validators.required + ], + parentId: [this.parentId || undefined], + tagId: [''], + manualEntriesAllowed: [true], + description: [''] }); } @@ -107,21 +120,26 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit { * Sets gl account form for selected account type. */ setGLAccountForm() { - this.glAccountForm.get('type').valueChanges.subscribe(accountTypeId => { + this.glAccountForm.get('type').valueChanges.subscribe((accountTypeId) => { switch (accountTypeId) { - case 1: this.parentData = this.chartOfAccountsData.assetHeaderAccountOptions; + case 1: + this.parentData = this.chartOfAccountsData.assetHeaderAccountOptions; this.tagData = this.chartOfAccountsData.allowedAssetsTagOptions; break; - case 2: this.parentData = this.chartOfAccountsData.liabilityHeaderAccountOptions; + case 2: + this.parentData = this.chartOfAccountsData.liabilityHeaderAccountOptions; this.tagData = this.chartOfAccountsData.allowedLiabilitiesTagOptions; break; - case 3: this.parentData = this.chartOfAccountsData.equityHeaderAccountOptions; + case 3: + this.parentData = this.chartOfAccountsData.equityHeaderAccountOptions; this.tagData = this.chartOfAccountsData.allowedEquityTagOptions; break; - case 4: this.parentData = this.chartOfAccountsData.incomeHeaderAccountOptions; + case 4: + this.parentData = this.chartOfAccountsData.incomeHeaderAccountOptions; this.tagData = this.chartOfAccountsData.allowedIncomeTagOptions; break; - case 5: this.parentData = this.chartOfAccountsData.expenseHeaderAccountOptions; + case 5: + this.parentData = this.chartOfAccountsData.expenseHeaderAccountOptions; this.tagData = this.chartOfAccountsData.allowedExpensesTagOptions; break; } @@ -140,7 +158,13 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit { this.configurationWizardService.showChartofAccounts = false; this.openDialog(); } else { - this.router.navigate(['../view', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../view', + response.resourceId + ], + { relativeTo: this.route } + ); } }); } @@ -152,7 +176,12 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -192,7 +221,7 @@ export class CreateGlAccountComponent implements OnInit, AfterViewInit { const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, { data: { stepName: 'GL account' - }, + } }); continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => { if (response.step === 1) { diff --git a/src/app/accounting/chart-of-accounts/edit-gl-account/edit-gl-account.component.spec.ts b/src/app/accounting/chart-of-accounts/edit-gl-account/edit-gl-account.component.spec.ts index 29379a7ab..87dad9133 100644 --- a/src/app/accounting/chart-of-accounts/edit-gl-account/edit-gl-account.component.spec.ts +++ b/src/app/accounting/chart-of-accounts/edit-gl-account/edit-gl-account.component.spec.ts @@ -8,9 +8,8 @@ describe('EditGlAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditGlAccountComponent ] - }) - .compileComponents(); + declarations: [EditGlAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/chart-of-accounts/edit-gl-account/edit-gl-account.component.ts b/src/app/accounting/chart-of-accounts/edit-gl-account/edit-gl-account.component.ts index 5b29a167e..5d29b6e29 100644 --- a/src/app/accounting/chart-of-accounts/edit-gl-account/edit-gl-account.component.ts +++ b/src/app/accounting/chart-of-accounts/edit-gl-account/edit-gl-account.component.ts @@ -15,7 +15,6 @@ import { AccountingService } from '../../accounting.service'; styleUrls: ['./edit-gl-account.component.scss'] }) export class EditGlAccountComponent implements OnInit { - /** GL account form. */ glAccountForm: UntypedFormGroup; /** GL account and chart of accounts data. */ @@ -36,10 +35,12 @@ export class EditGlAccountComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { glAccountAndChartOfAccountsTemplate: any }) => { this.glAccount = data.glAccountAndChartOfAccountsTemplate; }); @@ -58,14 +59,29 @@ export class EditGlAccountComponent implements OnInit { */ createGlAccountForm() { this.glAccountForm = this.formBuilder.group({ - 'type': ['', Validators.required], - 'name': [this.glAccount.name, Validators.required], - 'usage': [this.glAccount.usage.id, Validators.required], - 'glCode': [this.glAccount.glCode, Validators.required], - 'parentId': [this.glAccount.parentId], - 'tagId': [this.glAccount.tagId.id], - 'manualEntriesAllowed': [this.glAccount.manualEntriesAllowed, Validators.required], - 'description': [this.glAccount.description] + type: [ + '', + Validators.required + ], + name: [ + this.glAccount.name, + Validators.required + ], + usage: [ + this.glAccount.usage.id, + Validators.required + ], + glCode: [ + this.glAccount.glCode, + Validators.required + ], + parentId: [this.glAccount.parentId], + tagId: [this.glAccount.tagId.id], + manualEntriesAllowed: [ + this.glAccount.manualEntriesAllowed, + Validators.required + ], + description: [this.glAccount.description] }); } @@ -75,23 +91,28 @@ export class EditGlAccountComponent implements OnInit { setGLAccountForm() { this.accountTypeData = this.glAccount.accountTypeOptions; this.accountUsageData = this.glAccount.usageOptions; - this.glAccountForm.get('type').valueChanges.subscribe(accountTypeId => { + this.glAccountForm.get('type').valueChanges.subscribe((accountTypeId) => { switch (accountTypeId) { - case 1: this.parentData = this.glAccount.assetHeaderAccountOptions; - this.tagData = this.glAccount.allowedAssetsTagOptions; - break; - case 2: this.parentData = this.glAccount.liabilityHeaderAccountOptions; - this.tagData = this.glAccount.allowedLiabilitiesTagOptions; - break; - case 3: this.parentData = this.glAccount.equityHeaderAccountOptions; - this.tagData = this.glAccount.allowedEquityTagOptions; - break; - case 4: this.parentData = this.glAccount.incomeHeaderAccountOptions; - this.tagData = this.glAccount.allowedIncomeTagOptions; - break; - case 5: this.parentData = this.glAccount.expenseHeaderAccountOptions; - this.tagData = this.glAccount.allowedExpensesTagOptions; - break; + case 1: + this.parentData = this.glAccount.assetHeaderAccountOptions; + this.tagData = this.glAccount.allowedAssetsTagOptions; + break; + case 2: + this.parentData = this.glAccount.liabilityHeaderAccountOptions; + this.tagData = this.glAccount.allowedLiabilitiesTagOptions; + break; + case 3: + this.parentData = this.glAccount.equityHeaderAccountOptions; + this.tagData = this.glAccount.allowedEquityTagOptions; + break; + case 4: + this.parentData = this.glAccount.incomeHeaderAccountOptions; + this.tagData = this.glAccount.allowedIncomeTagOptions; + break; + case 5: + this.parentData = this.glAccount.expenseHeaderAccountOptions; + this.tagData = this.glAccount.allowedExpensesTagOptions; + break; } }); @@ -103,10 +124,14 @@ export class EditGlAccountComponent implements OnInit { * if successful redirects to view updated account. */ submit() { - this.accountingService.updateGlAccount(this.glAccount.id, this.glAccountForm.value) - .subscribe((response: any) => { - this.router.navigate(['../../', response.resourceId], { relativeTo: this.route }); - }); + this.accountingService.updateGlAccount(this.glAccount.id, this.glAccountForm.value).subscribe((response: any) => { + this.router.navigate( + [ + '../../', + response.resourceId + ], + { relativeTo: this.route } + ); + }); } - } diff --git a/src/app/accounting/chart-of-accounts/gl-account-and-chart-of-accounts-template.resolver.ts b/src/app/accounting/chart-of-accounts/gl-account-and-chart-of-accounts-template.resolver.ts index 22c2484f7..1a4fabde7 100644 --- a/src/app/accounting/chart-of-accounts/gl-account-and-chart-of-accounts-template.resolver.ts +++ b/src/app/accounting/chart-of-accounts/gl-account-and-chart-of-accounts-template.resolver.ts @@ -14,7 +14,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class GlAccountAndChartOfAccountsTemplateResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -31,16 +30,21 @@ export class GlAccountAndChartOfAccountsTemplateResolver implements Resolve { let accountOptions = []; switch (glAccountData.type.value) { - case 'ASSET': accountOptions = glAccountData.assetHeaderAccountOptions; - break; - case 'EQUITY': accountOptions = glAccountData.equityHeaderAccountOptions; - break; - case 'EXPENSE': accountOptions = glAccountData.expenseHeaderAccountOptions; - break; - case 'INCOME': accountOptions = glAccountData.incomeHeaderAccountOptions; - break; - case 'LIABILITY': accountOptions = glAccountData.liabilityHeaderAccountOptions; - break; + case 'ASSET': + accountOptions = glAccountData.assetHeaderAccountOptions; + break; + case 'EQUITY': + accountOptions = glAccountData.equityHeaderAccountOptions; + break; + case 'EXPENSE': + accountOptions = glAccountData.expenseHeaderAccountOptions; + break; + case 'INCOME': + accountOptions = glAccountData.incomeHeaderAccountOptions; + break; + case 'LIABILITY': + accountOptions = glAccountData.liabilityHeaderAccountOptions; + break; } if (glAccountData.parentId) { glAccountData.parent = accountOptions.find((accountOption: any) => { @@ -51,5 +55,4 @@ export class GlAccountAndChartOfAccountsTemplateResolver implements Resolve { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewGlAccountComponent ] - }) - .compileComponents(); + declarations: [ViewGlAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/chart-of-accounts/view-gl-account/view-gl-account.component.ts b/src/app/accounting/chart-of-accounts/view-gl-account/view-gl-account.component.ts index a16568e31..522cf6462 100644 --- a/src/app/accounting/chart-of-accounts/view-gl-account/view-gl-account.component.ts +++ b/src/app/accounting/chart-of-accounts/view-gl-account/view-gl-account.component.ts @@ -19,7 +19,6 @@ import { Location } from '@angular/common'; styleUrls: ['./view-gl-account.component.scss'] }) export class ViewGlAccountComponent { - /** GL Account. */ glAccount: any; @@ -30,11 +29,13 @@ export class ViewGlAccountComponent { * @param {Router} router Router for navigation. * @param {MatDialog} dialog Dialog reference. */ - constructor(private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router, - private dialog: MatDialog, - private location: Location) { + constructor( + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router, + private dialog: MatDialog, + private location: Location + ) { this.route.data.subscribe((data: { glAccountAndChartOfAccountsTemplate: any }) => { this.glAccount = data.glAccountAndChartOfAccountsTemplate; }); @@ -49,10 +50,9 @@ export class ViewGlAccountComponent { }); deleteGlAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.accountingService.deleteGlAccount(this.glAccount.id) - .subscribe(() => { - this.router.navigate(['/accounting/chart-of-accounts']); - }); + this.accountingService.deleteGlAccount(this.glAccount.id).subscribe(() => { + this.router.navigate(['/accounting/chart-of-accounts']); + }); } }); } @@ -61,7 +61,8 @@ export class ViewGlAccountComponent { * Changes state of gl account. (enabled/disabled) */ changeGlAccountState() { - this.accountingService.updateGlAccount(this.glAccount.id, { disabled: !this.glAccount.disabled }) + this.accountingService + .updateGlAccount(this.glAccount.id, { disabled: !this.glAccount.disabled }) .subscribe((response: any) => { this.glAccount.disabled = response.changes.disabled; }); @@ -70,5 +71,4 @@ export class ViewGlAccountComponent { goBack(): void { this.location.back(); } - } diff --git a/src/app/accounting/closing-entries/closing-entries.component.spec.ts b/src/app/accounting/closing-entries/closing-entries.component.spec.ts index 5222b7e6d..a53288479 100644 --- a/src/app/accounting/closing-entries/closing-entries.component.spec.ts +++ b/src/app/accounting/closing-entries/closing-entries.component.spec.ts @@ -8,9 +8,8 @@ describe('ClosingEntriesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClosingEntriesComponent ] - }) - .compileComponents(); + declarations: [ClosingEntriesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/closing-entries/closing-entries.component.ts b/src/app/accounting/closing-entries/closing-entries.component.ts index 347e18942..4e67e7ec9 100644 --- a/src/app/accounting/closing-entries/closing-entries.component.ts +++ b/src/app/accounting/closing-entries/closing-entries.component.ts @@ -22,9 +22,13 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura styleUrls: ['./closing-entries.component.scss'] }) export class ClosingEntriesComponent implements OnInit, AfterViewInit { - /** Columns to be displayed in closing entries table. */ - displayedColumns: string[] = ['officeName', 'closingDate', 'comments', 'createdByUsername']; + displayedColumns: string[] = [ + 'officeName', + 'closingDate', + 'comments', + 'createdByUsername' + ]; /** Data source for closing entries table. */ dataSource: MatTableDataSource; /** Office name filter form control. */ @@ -57,14 +61,13 @@ export class ClosingEntriesComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private route: ActivatedRoute, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { - this.route.data.subscribe((data: { - offices: any, - glAccountClosures: any - }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { + this.route.data.subscribe((data: { offices: any; glAccountClosures: any }) => { this.officeData = data.offices; this.glAccountClosureData = data.glAccountClosures; }); @@ -101,11 +104,10 @@ export class ClosingEntriesComponent implements OnInit, AfterViewInit { * Sets filtered offices for autocomplete. */ setFilteredOffices() { - this.filteredOfficeData = this.officeName.valueChanges - .pipe( + this.filteredOfficeData = this.officeName.valueChanges.pipe( startWith(''), - map((office: any) => typeof office === 'string' ? office : office.name), - map((officeName: string) => officeName ? this.filterOfficeAutocompleteData(officeName) : this.officeData) + map((office: any) => (typeof office === 'string' ? office : office.name)), + map((officeName: string) => (officeName ? this.filterOfficeAutocompleteData(officeName) : this.officeData)) ); } @@ -125,7 +127,12 @@ export class ClosingEntriesComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } diff --git a/src/app/accounting/closing-entries/closing-entries.resolver.ts b/src/app/accounting/closing-entries/closing-entries.resolver.ts index 7e8b4e8a8..2b80e3ede 100644 --- a/src/app/accounting/closing-entries/closing-entries.resolver.ts +++ b/src/app/accounting/closing-entries/closing-entries.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class ClosingEntriesResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class ClosingEntriesResolver implements Resolve { resolve(): Observable { return this.accountingService.getAccountingClosures(); } - } diff --git a/src/app/accounting/closing-entries/closing-entry.resolver.ts b/src/app/accounting/closing-entries/closing-entry.resolver.ts index bae65d4aa..38afdd800 100644 --- a/src/app/accounting/closing-entries/closing-entry.resolver.ts +++ b/src/app/accounting/closing-entries/closing-entry.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class ClosingEntryResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -27,5 +26,4 @@ export class ClosingEntryResolver implements Resolve { const glAccountClosureId = route.paramMap.get('id'); return this.accountingService.getAccountingClosure(glAccountClosureId); } - } diff --git a/src/app/accounting/closing-entries/create-closure/create-closure.component.spec.ts b/src/app/accounting/closing-entries/create-closure/create-closure.component.spec.ts index 5057e46b7..ef71ffdd7 100644 --- a/src/app/accounting/closing-entries/create-closure/create-closure.component.spec.ts +++ b/src/app/accounting/closing-entries/create-closure/create-closure.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateClosureComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateClosureComponent ] - }) - .compileComponents(); + declarations: [CreateClosureComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/closing-entries/create-closure/create-closure.component.ts b/src/app/accounting/closing-entries/create-closure/create-closure.component.ts index 3af9c0e8b..3067f350c 100644 --- a/src/app/accounting/closing-entries/create-closure/create-closure.component.ts +++ b/src/app/accounting/closing-entries/create-closure/create-closure.component.ts @@ -16,7 +16,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-closure.component.scss'] }) export class CreateClosureComponent implements OnInit { - /** Minimum closing date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum closing date allowed. */ @@ -34,12 +33,14 @@ export class CreateClosureComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private accountingService: AccountingService, private settingsService: SettingsService, private dateUtils: Dates, private route: ActivatedRoute, - private router: Router) { + private router: Router + ) { this.route.data.subscribe((data: { offices: any }) => { this.officeData = data.offices; }); @@ -58,9 +59,15 @@ export class CreateClosureComponent implements OnInit { */ createAccountingClosureForm() { this.accountingClosureForm = this.formBuilder.group({ - 'officeId': ['', Validators.required], - 'closingDate': ['', Validators.required], - 'comments': [''] + officeId: [ + '', + Validators.required + ], + closingDate: [ + '', + Validators.required + ], + comments: [''] }); } @@ -74,11 +81,19 @@ export class CreateClosureComponent implements OnInit { accountingClosure.locale = this.settingsService.language.code; accountingClosure.dateFormat = this.settingsService.dateFormat; if (accountingClosure.closingDate) { - accountingClosure.closingDate = this.dateUtils.formatDate(accountingClosure.closingDate, this.settingsService.dateFormat); + accountingClosure.closingDate = this.dateUtils.formatDate( + accountingClosure.closingDate, + this.settingsService.dateFormat + ); } this.accountingService.createAccountingClosure(accountingClosure).subscribe((response: any) => { - this.router.navigate(['../view', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../view', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/accounting/closing-entries/edit-closure/edit-closure.component.spec.ts b/src/app/accounting/closing-entries/edit-closure/edit-closure.component.spec.ts index 1bc389aa0..c0de9a9be 100644 --- a/src/app/accounting/closing-entries/edit-closure/edit-closure.component.spec.ts +++ b/src/app/accounting/closing-entries/edit-closure/edit-closure.component.spec.ts @@ -8,9 +8,8 @@ describe('EditClosureComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditClosureComponent ] - }) - .compileComponents(); + declarations: [EditClosureComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/closing-entries/edit-closure/edit-closure.component.ts b/src/app/accounting/closing-entries/edit-closure/edit-closure.component.ts index 8675971da..b79e7b549 100644 --- a/src/app/accounting/closing-entries/edit-closure/edit-closure.component.ts +++ b/src/app/accounting/closing-entries/edit-closure/edit-closure.component.ts @@ -15,7 +15,6 @@ import { AccountingService } from '../../accounting.service'; styleUrls: ['./edit-closure.component.scss'] }) export class EditClosureComponent implements OnInit { - /** Accounting closure form. */ accountingClosureForm: UntypedFormGroup; /** GL Account closure. */ @@ -30,10 +29,12 @@ export class EditClosureComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { glAccountClosure: any }) => { this.glAccountClosure = data.glAccountClosure; }); @@ -52,9 +53,15 @@ export class EditClosureComponent implements OnInit { */ createAccountingClosureForm() { this.accountingClosureForm = this.formBuilder.group({ - 'officeId': [{ value: '', disabled: true }, Validators.required], - 'closingDate': [{ value: '', disabled: true }, Validators.required], - 'comments': [''] + officeId: [ + { value: '', disabled: true }, + Validators.required + ], + closingDate: [ + { value: '', disabled: true }, + Validators.required + ], + comments: [''] }); } @@ -68,17 +75,21 @@ export class EditClosureComponent implements OnInit { this.accountingClosureForm.get('comments').setValue(this.glAccountClosure.comments); } - /** * Submits the accounting closure form and updates accounting closure, * if successful redirects to view updated closure. */ submit() { - this.accountingService.updateAccountingClosure(this.glAccountClosure.id, - { comments: this.accountingClosureForm.value.comments }) + this.accountingService + .updateAccountingClosure(this.glAccountClosure.id, { comments: this.accountingClosureForm.value.comments }) .subscribe((response: any) => { - this.router.navigate(['../../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/accounting/closing-entries/view-closure/view-closure.component.spec.ts b/src/app/accounting/closing-entries/view-closure/view-closure.component.spec.ts index 9bd70a587..a29072265 100644 --- a/src/app/accounting/closing-entries/view-closure/view-closure.component.spec.ts +++ b/src/app/accounting/closing-entries/view-closure/view-closure.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewClosureComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewClosureComponent ] - }) - .compileComponents(); + declarations: [ViewClosureComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/closing-entries/view-closure/view-closure.component.ts b/src/app/accounting/closing-entries/view-closure/view-closure.component.ts index b840450d5..fe6c7dfb3 100644 --- a/src/app/accounting/closing-entries/view-closure/view-closure.component.ts +++ b/src/app/accounting/closing-entries/view-closure/view-closure.component.ts @@ -18,7 +18,6 @@ import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dial styleUrls: ['./view-closure.component.scss'] }) export class ViewClosureComponent { - /** GL Account closure. */ glAccountClosure: any; @@ -29,10 +28,12 @@ export class ViewClosureComponent { * @param {Router} router Router for navigation. * @param {MatDialog} dialog Dialog reference. */ - constructor(private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router, - public dialog: MatDialog) { + constructor( + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router, + public dialog: MatDialog + ) { this.route.data.subscribe((data: { glAccountClosure: any }) => { this.glAccountClosure = data.glAccountClosure; }); @@ -47,12 +48,10 @@ export class ViewClosureComponent { }); deleteAccountingClosureDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.accountingService.deleteAccountingClosure(this.glAccountClosure.id) - .subscribe(() => { - this.router.navigate(['/accounting/closing-entries']); - }); + this.accountingService.deleteAccountingClosure(this.glAccountClosure.id).subscribe(() => { + this.router.navigate(['/accounting/closing-entries']); + }); } }); } - } diff --git a/src/app/accounting/common-resolvers/accounting-rules-associations.resolver.ts b/src/app/accounting/common-resolvers/accounting-rules-associations.resolver.ts index d3b8e2837..cc8100d7e 100644 --- a/src/app/accounting/common-resolvers/accounting-rules-associations.resolver.ts +++ b/src/app/accounting/common-resolvers/accounting-rules-associations.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class AccountingRulesAssociationsResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class AccountingRulesAssociationsResolver implements Resolve { resolve(): Observable { return this.accountingService.getAccountingRules(true); } - } diff --git a/src/app/accounting/common-resolvers/currencies.resolver.ts b/src/app/accounting/common-resolvers/currencies.resolver.ts index b396c2489..ef781b636 100644 --- a/src/app/accounting/common-resolvers/currencies.resolver.ts +++ b/src/app/accounting/common-resolvers/currencies.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class CurrenciesResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class CurrenciesResolver implements Resolve { resolve(): Observable { return this.accountingService.getCurrencies(); } - } diff --git a/src/app/accounting/common-resolvers/gl-accounts.resolver.ts b/src/app/accounting/common-resolvers/gl-accounts.resolver.ts index f62ffca32..55cf36750 100644 --- a/src/app/accounting/common-resolvers/gl-accounts.resolver.ts +++ b/src/app/accounting/common-resolvers/gl-accounts.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class GlAccountsResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class GlAccountsResolver implements Resolve { resolve(): Observable { return this.accountingService.getGlAccounts(); } - } diff --git a/src/app/accounting/common-resolvers/journal-entry-transaction.resolver.ts b/src/app/accounting/common-resolvers/journal-entry-transaction.resolver.ts index d9615ca75..5080ce523 100644 --- a/src/app/accounting/common-resolvers/journal-entry-transaction.resolver.ts +++ b/src/app/accounting/common-resolvers/journal-entry-transaction.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class JournalEntryTransactionResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -27,5 +26,4 @@ export class JournalEntryTransactionResolver implements Resolve { const transactionId = route.paramMap.get('id'); return this.accountingService.getJournalEntry(transactionId); } - } diff --git a/src/app/accounting/common-resolvers/loan-products.resolver.ts b/src/app/accounting/common-resolvers/loan-products.resolver.ts index 30857554f..b2b4c1893 100644 --- a/src/app/accounting/common-resolvers/loan-products.resolver.ts +++ b/src/app/accounting/common-resolvers/loan-products.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class LoanProductsResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class LoanProductsResolver implements Resolve { resolve(): Observable { return this.accountingService.getLoanProducts(); } - } diff --git a/src/app/accounting/common-resolvers/offices.resolver.ts b/src/app/accounting/common-resolvers/offices.resolver.ts index 6327821d1..42aaa5703 100644 --- a/src/app/accounting/common-resolvers/offices.resolver.ts +++ b/src/app/accounting/common-resolvers/offices.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class OfficesResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class OfficesResolver implements Resolve { resolve(): Observable { return this.accountingService.getOffices(); } - } diff --git a/src/app/accounting/common-resolvers/payment-types.resolver.ts b/src/app/accounting/common-resolvers/payment-types.resolver.ts index 1a167e5d7..81e9e6bb4 100644 --- a/src/app/accounting/common-resolvers/payment-types.resolver.ts +++ b/src/app/accounting/common-resolvers/payment-types.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class PaymentTypesResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class PaymentTypesResolver implements Resolve { resolve(): Observable { return this.accountingService.getPaymentTypes(); } - } diff --git a/src/app/accounting/common-resolvers/provisioning-categories.resolver.ts b/src/app/accounting/common-resolvers/provisioning-categories.resolver.ts index b8fc9a948..cd39d919e 100644 --- a/src/app/accounting/common-resolvers/provisioning-categories.resolver.ts +++ b/src/app/accounting/common-resolvers/provisioning-categories.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class ProvisioningCategoriesResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class ProvisioningCategoriesResolver implements Resolve { resolve(): Observable { return this.accountingService.getProvisioningCategories(); } - } diff --git a/src/app/accounting/create-journal-entry/create-journal-entry.component.spec.ts b/src/app/accounting/create-journal-entry/create-journal-entry.component.spec.ts index 662f9a496..ff4cdc7c4 100644 --- a/src/app/accounting/create-journal-entry/create-journal-entry.component.spec.ts +++ b/src/app/accounting/create-journal-entry/create-journal-entry.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateJournalEntryComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateJournalEntryComponent ] - }) - .compileComponents(); + declarations: [CreateJournalEntryComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/create-journal-entry/create-journal-entry.component.ts b/src/app/accounting/create-journal-entry/create-journal-entry.component.ts index 62ea16749..6f48e2037 100644 --- a/src/app/accounting/create-journal-entry/create-journal-entry.component.ts +++ b/src/app/accounting/create-journal-entry/create-journal-entry.component.ts @@ -22,7 +22,6 @@ import { NextStepDialogComponent } from '../../configuration-wizard/next-step-di styleUrls: ['./create-journal-entry.component.scss'] }) export class CreateJournalEntryComponent implements OnInit, AfterViewInit { - /** Minimum transaction date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum transaction date allowed. */ @@ -53,7 +52,8 @@ export class CreateJournalEntryComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private accountingService: AccountingService, private settingsService: SettingsService, private dateUtils: Dates, @@ -61,13 +61,9 @@ export class CreateJournalEntryComponent implements OnInit, AfterViewInit { private router: Router, private dialog: MatDialog, private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { - this.route.data.subscribe((data: { - offices: any, - currencies: any, - paymentTypes: any, - glAccounts: any - }) => { + private popoverService: PopoverService + ) { + this.route.data.subscribe((data: { offices: any; currencies: any; paymentTypes: any; glAccounts: any }) => { this.officeData = data.offices; this.currencyData = data.currencies.selectedCurrencyOptions; this.paymentTypeData = data.paymentTypes; @@ -88,19 +84,28 @@ export class CreateJournalEntryComponent implements OnInit, AfterViewInit { */ createJournalEntryForm() { this.journalEntryForm = this.formBuilder.group({ - 'officeId': ['', Validators.required], - 'currencyCode': ['', Validators.required], - 'debits': this.formBuilder.array([this.createAffectedGLEntryForm()]), - 'credits': this.formBuilder.array([this.createAffectedGLEntryForm()]), - 'referenceNumber': [''], - 'transactionDate': ['', Validators.required], - 'paymentTypeId': [''], - 'accountNumber': [''], - 'checkNumber': [''], - 'routingCode': [''], - 'receiptNumber': [''], - 'bankNumber': [''], - 'comments': [''] + officeId: [ + '', + Validators.required + ], + currencyCode: [ + '', + Validators.required + ], + debits: this.formBuilder.array([this.createAffectedGLEntryForm()]), + credits: this.formBuilder.array([this.createAffectedGLEntryForm()]), + referenceNumber: [''], + transactionDate: [ + '', + Validators.required + ], + paymentTypeId: [''], + accountNumber: [''], + checkNumber: [''], + routingCode: [''], + receiptNumber: [''], + bankNumber: [''], + comments: [''] }); } @@ -110,8 +115,14 @@ export class CreateJournalEntryComponent implements OnInit, AfterViewInit { */ createAffectedGLEntryForm(): UntypedFormGroup { return this.formBuilder.group({ - 'glAccountId': ['', Validators.required], - 'amount': ['', Validators.required] + glAccountId: [ + '', + Validators.required + ], + amount: [ + '', + Validators.required + ] }); } @@ -158,10 +169,19 @@ export class CreateJournalEntryComponent implements OnInit, AfterViewInit { journalEntry.locale = this.settingsService.language.code; journalEntry.dateFormat = this.settingsService.dateFormat; if (journalEntry.transactionDate) { - journalEntry.transactionDate = this.dateUtils.formatDate(journalEntry.transactionDate, this.settingsService.dateFormat); + journalEntry.transactionDate = this.dateUtils.formatDate( + journalEntry.transactionDate, + this.settingsService.dateFormat + ); } - this.accountingService.createJournalEntry(journalEntry).subscribe(response => { - this.router.navigate(['../transactions/view', response.transactionId], { relativeTo: this.route }); + this.accountingService.createJournalEntry(journalEntry).subscribe((response) => { + this.router.navigate( + [ + '../transactions/view', + response.transactionId + ], + { relativeTo: this.route } + ); }); } @@ -172,7 +192,12 @@ export class CreateJournalEntryComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -206,21 +231,21 @@ export class CreateJournalEntryComponent implements OnInit, AfterViewInit { * Next Step (Products) Dialog Configuration Wizard. */ openNextStepDialog() { - const nextStepDialogRef = this.dialog.open( NextStepDialogComponent, { + const nextStepDialogRef = this.dialog.open(NextStepDialogComponent, { data: { nextStepName: 'Setup Products', previousStepName: 'Accounting', stepPercentage: 74 - }, + } }); nextStepDialogRef.afterClosed().subscribe((response: { nextStep: boolean }) => { - if (response.nextStep) { - this.configurationWizardService.showCreateJournalEntries = false; - this.configurationWizardService.showCharges = true; - this.router.navigate(['/products']); + if (response.nextStep) { + this.configurationWizardService.showCreateJournalEntries = false; + this.configurationWizardService.showCharges = true; + this.router.navigate(['/products']); } else { - this.configurationWizardService.showCreateJournalEntries = false; - this.router.navigate(['/home']); + this.configurationWizardService.showCreateJournalEntries = false; + this.router.navigate(['/home']); } }); } diff --git a/src/app/accounting/financial-activity-mappings/create-financial-activity-mapping/create-financial-activity-mapping.component.spec.ts b/src/app/accounting/financial-activity-mappings/create-financial-activity-mapping/create-financial-activity-mapping.component.spec.ts index 0f18d9dff..cb99d1b19 100644 --- a/src/app/accounting/financial-activity-mappings/create-financial-activity-mapping/create-financial-activity-mapping.component.spec.ts +++ b/src/app/accounting/financial-activity-mappings/create-financial-activity-mapping/create-financial-activity-mapping.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateFinancialActivityMappingComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateFinancialActivityMappingComponent ] - }) - .compileComponents(); + declarations: [CreateFinancialActivityMappingComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/financial-activity-mappings/create-financial-activity-mapping/create-financial-activity-mapping.component.ts b/src/app/accounting/financial-activity-mappings/create-financial-activity-mapping/create-financial-activity-mapping.component.ts index 6ef7d0666..afb78b155 100644 --- a/src/app/accounting/financial-activity-mappings/create-financial-activity-mapping/create-financial-activity-mapping.component.ts +++ b/src/app/accounting/financial-activity-mappings/create-financial-activity-mapping/create-financial-activity-mapping.component.ts @@ -16,7 +16,6 @@ import { GLAccount } from 'app/shared/models/general.model'; styleUrls: ['./create-financial-activity-mapping.component.scss'] }) export class CreateFinancialActivityMappingComponent implements OnInit { - /** Financial activity mapping form. */ financialActivityMappingForm: UntypedFormGroup; /** GL Account options. */ @@ -33,10 +32,12 @@ export class CreateFinancialActivityMappingComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { financialActivityAccountsTemplate: any }) => { this.glAccountOptions = data.financialActivityAccountsTemplate.glAccountOptions; this.financialActivityData = data.financialActivityAccountsTemplate.financialActivityOptions; @@ -56,8 +57,14 @@ export class CreateFinancialActivityMappingComponent implements OnInit { */ createFinancialActivityMappingForm() { this.financialActivityMappingForm = this.formBuilder.group({ - 'financialActivityId': ['', Validators.required], - 'glAccountId': ['', Validators.required] + financialActivityId: [ + '', + Validators.required + ], + glAccountId: [ + '', + Validators.required + ] }); } @@ -65,21 +72,23 @@ export class CreateFinancialActivityMappingComponent implements OnInit { * Sets the gl account data on the basis of selected financial activity. */ setGlAccountData() { - this.financialActivityMappingForm.get('financialActivityId').valueChanges - .subscribe(financialActivityId => { - switch (financialActivityId) { - case 100: - case 101: - case 102: - case 103: this.glAccountData = this.glAccountOptions.assetAccountOptions; + this.financialActivityMappingForm.get('financialActivityId').valueChanges.subscribe((financialActivityId) => { + switch (financialActivityId) { + case 100: + case 101: + case 102: + case 103: + this.glAccountData = this.glAccountOptions.assetAccountOptions; break; - case 200: - case 201: this.glAccountData = this.glAccountOptions.liabilityAccountOptions; + case 200: + case 201: + this.glAccountData = this.glAccountOptions.liabilityAccountOptions; break; - case 300: this.glAccountData = this.glAccountOptions.equityAccountOptions; + case 300: + this.glAccountData = this.glAccountOptions.equityAccountOptions; break; - } - }); + } + }); } /** @@ -87,10 +96,16 @@ export class CreateFinancialActivityMappingComponent implements OnInit { * if successful redirects to view created account. */ submit() { - this.accountingService.createFinancialActivityAccount(this.financialActivityMappingForm.value) + this.accountingService + .createFinancialActivityAccount(this.financialActivityMappingForm.value) .subscribe((response: any) => { - this.router.navigate(['../view', response.resourceId], { relativeTo: this.route }); - }); + this.router.navigate( + [ + '../view', + response.resourceId + ], + { relativeTo: this.route } + ); + }); } - } diff --git a/src/app/accounting/financial-activity-mappings/create-financial-activity-mapping/financial-activity-mappings-template.resolver.ts b/src/app/accounting/financial-activity-mappings/create-financial-activity-mapping/financial-activity-mappings-template.resolver.ts index c5454ee35..0dfa21fb1 100644 --- a/src/app/accounting/financial-activity-mappings/create-financial-activity-mapping/financial-activity-mappings-template.resolver.ts +++ b/src/app/accounting/financial-activity-mappings/create-financial-activity-mapping/financial-activity-mappings-template.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../../accounting.service'; */ @Injectable() export class FinancialActivityMappingsTemplateResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class FinancialActivityMappingsTemplateResolver implements Resolve { return this.accountingService.getFinancialActivityAccountsTemplate(); } - } diff --git a/src/app/accounting/financial-activity-mappings/edit-financial-activity-mapping/edit-financial-activity-mapping.component.spec.ts b/src/app/accounting/financial-activity-mappings/edit-financial-activity-mapping/edit-financial-activity-mapping.component.spec.ts index 4b9578295..2efe94583 100644 --- a/src/app/accounting/financial-activity-mappings/edit-financial-activity-mapping/edit-financial-activity-mapping.component.spec.ts +++ b/src/app/accounting/financial-activity-mappings/edit-financial-activity-mapping/edit-financial-activity-mapping.component.spec.ts @@ -8,9 +8,8 @@ describe('EditFinancialActivityMappingComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditFinancialActivityMappingComponent ] - }) - .compileComponents(); + declarations: [EditFinancialActivityMappingComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/financial-activity-mappings/edit-financial-activity-mapping/edit-financial-activity-mapping.component.ts b/src/app/accounting/financial-activity-mappings/edit-financial-activity-mapping/edit-financial-activity-mapping.component.ts index 09db71d91..dd4a16ab7 100644 --- a/src/app/accounting/financial-activity-mappings/edit-financial-activity-mapping/edit-financial-activity-mapping.component.ts +++ b/src/app/accounting/financial-activity-mappings/edit-financial-activity-mapping/edit-financial-activity-mapping.component.ts @@ -16,7 +16,6 @@ import { GLAccount } from 'app/shared/models/general.model'; styleUrls: ['./edit-financial-activity-mapping.component.scss'] }) export class EditFinancialActivityMappingComponent implements OnInit { - /** Financial activity mapping form. */ financialActivityMappingForm: UntypedFormGroup; /** GL Account options. */ @@ -39,10 +38,12 @@ export class EditFinancialActivityMappingComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuider: UntypedFormBuilder, - private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuider: UntypedFormBuilder, + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { financialActivityAccountAndTemplate: any }) => { this.financialActivityAccountId = data.financialActivityAccountAndTemplate.id; console.log(data.financialActivityAccountAndTemplate.financialActivityData); @@ -68,8 +69,14 @@ export class EditFinancialActivityMappingComponent implements OnInit { */ createFinancialActivityMappingForm() { this.financialActivityMappingForm = this.formBuider.group({ - 'financialActivityId': ['', Validators.required], - 'glAccountId': ['', Validators.required] + financialActivityId: [ + '', + Validators.required + ], + glAccountId: [ + '', + Validators.required + ] }); } @@ -77,21 +84,23 @@ export class EditFinancialActivityMappingComponent implements OnInit { * Sets the gl account data on the basis of selected financial activity. */ setGLAccountData() { - this.financialActivityMappingForm.get('financialActivityId').valueChanges - .subscribe(financialActivityId => { - switch (financialActivityId) { - case 100: - case 101: - case 102: - case 103: this.glAccountData = this.glAccountOptions.assetAccountOptions; + this.financialActivityMappingForm.get('financialActivityId').valueChanges.subscribe((financialActivityId) => { + switch (financialActivityId) { + case 100: + case 101: + case 102: + case 103: + this.glAccountData = this.glAccountOptions.assetAccountOptions; break; - case 200: - case 201: this.glAccountData = this.glAccountOptions.liabilityAccountOptions; + case 200: + case 201: + this.glAccountData = this.glAccountOptions.liabilityAccountOptions; break; - case 300: this.glAccountData = this.glAccountOptions.equityAccountOptions; + case 300: + this.glAccountData = this.glAccountOptions.equityAccountOptions; break; - } - }); + } + }); } /** @@ -99,10 +108,16 @@ export class EditFinancialActivityMappingComponent implements OnInit { * if successful redirects to view updated account. */ submit() { - this.accountingService.updateFinancialActivityAccount(this.financialActivityAccountId, this.financialActivityMappingForm.value) + this.accountingService + .updateFinancialActivityAccount(this.financialActivityAccountId, this.financialActivityMappingForm.value) .subscribe((response: any) => { - this.router.navigate(['../../', response.resourceId], { relativeTo: this.route }); - }); + this.router.navigate( + [ + '../../', + response.resourceId + ], + { relativeTo: this.route } + ); + }); } - } diff --git a/src/app/accounting/financial-activity-mappings/edit-financial-activity-mapping/financial-activity-mapping-and-template.resolver.ts b/src/app/accounting/financial-activity-mappings/edit-financial-activity-mapping/financial-activity-mapping-and-template.resolver.ts index c1e61da5c..0fa6e225f 100644 --- a/src/app/accounting/financial-activity-mappings/edit-financial-activity-mapping/financial-activity-mapping-and-template.resolver.ts +++ b/src/app/accounting/financial-activity-mappings/edit-financial-activity-mapping/financial-activity-mapping-and-template.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../../accounting.service'; */ @Injectable() export class FinancialActivityMappingAndTemplateResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -27,5 +26,4 @@ export class FinancialActivityMappingAndTemplateResolver implements Resolve { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FinancialActivityMappingsComponent ] - }) - .compileComponents(); + declarations: [FinancialActivityMappingsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/financial-activity-mappings/financial-activity-mappings.component.ts b/src/app/accounting/financial-activity-mappings/financial-activity-mappings.component.ts index bc92b227e..efe29e382 100644 --- a/src/app/accounting/financial-activity-mappings/financial-activity-mappings.component.ts +++ b/src/app/accounting/financial-activity-mappings/financial-activity-mappings.component.ts @@ -18,11 +18,15 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura styleUrls: ['./financial-activity-mappings.component.scss'] }) export class FinancialActivityMappingsComponent implements OnInit, AfterViewInit { - /** Financial activity account data. */ financialActivityAccountData: any; /** Columns to be displayed in financial activity mappings table. */ - displayedColumns: string[] = ['financialActivity', 'glAccountType', 'glAccountCode', 'glAccountName']; + displayedColumns: string[] = [ + 'financialActivity', + 'glAccountType', + 'glAccountCode', + 'glAccountName' + ]; /** Data source for financial activity mappings table. */ dataSource: MatTableDataSource; @@ -47,11 +51,13 @@ export class FinancialActivityMappingsComponent implements OnInit, AfterViewInit * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private route: ActivatedRoute, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { - this.route.data.subscribe(( data: { financialActivityAccounts: any }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { + this.route.data.subscribe((data: { financialActivityAccounts: any }) => { this.financialActivityAccountData = data.financialActivityAccounts; }); } @@ -71,10 +77,14 @@ export class FinancialActivityMappingsComponent implements OnInit, AfterViewInit this.dataSource.paginator = this.paginator; this.dataSource.sortingDataAccessor = (financialActivityAccount: any, property: any) => { switch (property) { - case 'financialActivity': return financialActivityAccount.financialActivityData.name; - case 'glAccountName': return financialActivityAccount.glAccountData.name; - case 'glAccountCode': return financialActivityAccount.glAccountData.glCode; - default: return financialActivityAccount[property]; + case 'financialActivity': + return financialActivityAccount.financialActivityData.name; + case 'glAccountName': + return financialActivityAccount.glAccountData.name; + case 'glAccountCode': + return financialActivityAccount.glAccountData.glCode; + default: + return financialActivityAccount[property]; } }; this.dataSource.sort = this.sort; @@ -87,7 +97,12 @@ export class FinancialActivityMappingsComponent implements OnInit, AfterViewInit * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -127,5 +142,4 @@ export class FinancialActivityMappingsComponent implements OnInit, AfterViewInit this.configurationWizardService.showAccountsLinked = true; this.router.navigate(['/accounting']); } - } diff --git a/src/app/accounting/financial-activity-mappings/financial-activity-mappings.resolver.ts b/src/app/accounting/financial-activity-mappings/financial-activity-mappings.resolver.ts index 52f7fce5e..494291f86 100644 --- a/src/app/accounting/financial-activity-mappings/financial-activity-mappings.resolver.ts +++ b/src/app/accounting/financial-activity-mappings/financial-activity-mappings.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class FinancialActivityMappingsResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class FinancialActivityMappingsResolver implements Resolve { resolve(): Observable { return this.accountingService.getFinancialActivityAccounts(); } - } diff --git a/src/app/accounting/financial-activity-mappings/view-financial-activity-mapping/financial-activity-mapping.resolver.ts b/src/app/accounting/financial-activity-mappings/view-financial-activity-mapping/financial-activity-mapping.resolver.ts index eb96001af..1287a43a7 100644 --- a/src/app/accounting/financial-activity-mappings/view-financial-activity-mapping/financial-activity-mapping.resolver.ts +++ b/src/app/accounting/financial-activity-mappings/view-financial-activity-mapping/financial-activity-mapping.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../../accounting.service'; */ @Injectable() export class FinancialActivityMappingResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -27,5 +26,4 @@ export class FinancialActivityMappingResolver implements Resolve { const financialActivityAccountId = route.paramMap.get('id'); return this.accountingService.getFinancialActivityAccount(financialActivityAccountId, false); } - } diff --git a/src/app/accounting/financial-activity-mappings/view-financial-activity-mapping/view-financial-activity-mapping.component.spec.ts b/src/app/accounting/financial-activity-mappings/view-financial-activity-mapping/view-financial-activity-mapping.component.spec.ts index 24ab1792c..f40724672 100644 --- a/src/app/accounting/financial-activity-mappings/view-financial-activity-mapping/view-financial-activity-mapping.component.spec.ts +++ b/src/app/accounting/financial-activity-mappings/view-financial-activity-mapping/view-financial-activity-mapping.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewFinancialActivityMappingComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewFinancialActivityMappingComponent ] - }) - .compileComponents(); + declarations: [ViewFinancialActivityMappingComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/financial-activity-mappings/view-financial-activity-mapping/view-financial-activity-mapping.component.ts b/src/app/accounting/financial-activity-mappings/view-financial-activity-mapping/view-financial-activity-mapping.component.ts index a0623bcb7..474326bf9 100644 --- a/src/app/accounting/financial-activity-mappings/view-financial-activity-mapping/view-financial-activity-mapping.component.ts +++ b/src/app/accounting/financial-activity-mappings/view-financial-activity-mapping/view-financial-activity-mapping.component.ts @@ -19,7 +19,6 @@ import { Location } from '@angular/common'; styleUrls: ['./view-financial-activity-mapping.component.scss'] }) export class ViewFinancialActivityMappingComponent { - /** Financial activity account ID. */ financialActivityAccountId: any; /** Financial activity account data. */ @@ -32,11 +31,13 @@ export class ViewFinancialActivityMappingComponent { * @param {Router} router Router for navigation. * @param {MatDialog} dialog Dialog reference. */ - constructor(private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router, - private dialog: MatDialog, - private location: Location) { + constructor( + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router, + private dialog: MatDialog, + private location: Location + ) { this.route.data.subscribe((data: { financialActivityAccount: any }) => { this.financialActivityAccount = data.financialActivityAccount; this.financialActivityAccountId = data.financialActivityAccount.id; @@ -52,10 +53,9 @@ export class ViewFinancialActivityMappingComponent { }); deleteFinancialActivityAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.accountingService.deleteFinancialActivityAccount(this.financialActivityAccountId) - .subscribe(() => { - this.router.navigate(['/accounting/financial-activity-mappings']); - }); + this.accountingService.deleteFinancialActivityAccount(this.financialActivityAccountId).subscribe(() => { + this.router.navigate(['/accounting/financial-activity-mappings']); + }); } }); } @@ -63,5 +63,4 @@ export class ViewFinancialActivityMappingComponent { goBack(): void { this.location.back(); } - } diff --git a/src/app/accounting/frequent-postings/frequent-postings.component.spec.ts b/src/app/accounting/frequent-postings/frequent-postings.component.spec.ts index 1fd110b01..b1856f8c4 100644 --- a/src/app/accounting/frequent-postings/frequent-postings.component.spec.ts +++ b/src/app/accounting/frequent-postings/frequent-postings.component.spec.ts @@ -8,9 +8,8 @@ describe('FrequentPostingsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FrequentPostingsComponent ] - }) - .compileComponents(); + declarations: [FrequentPostingsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/frequent-postings/frequent-postings.component.ts b/src/app/accounting/frequent-postings/frequent-postings.component.ts index c79ae1fab..17a6bdab1 100644 --- a/src/app/accounting/frequent-postings/frequent-postings.component.ts +++ b/src/app/accounting/frequent-postings/frequent-postings.component.ts @@ -16,7 +16,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./frequent-postings.component.scss'] }) export class FrequentPostingsComponent implements OnInit { - /** Minimum transaction date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum transaction date allowed. */ @@ -48,23 +47,20 @@ export class FrequentPostingsComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private accountingService: AccountingService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { - this.route.data.subscribe((data: { - offices: any, - accountingRules: any, - currencies: any, - paymentTypes: any - }) => { - this.officeData = data.offices; - this.accountingRuleData = data.accountingRules; - this.currencyData = data.currencies.selectedCurrencyOptions; - this.paymentTypeData = data.paymentTypes; - }); + constructor( + private formBuilder: UntypedFormBuilder, + private accountingService: AccountingService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router + ) { + this.route.data.subscribe((data: { offices: any; accountingRules: any; currencies: any; paymentTypes: any }) => { + this.officeData = data.offices; + this.accountingRuleData = data.accountingRules; + this.currencyData = data.currencies.selectedCurrencyOptions; + this.paymentTypeData = data.paymentTypes; + }); } /** @@ -81,20 +77,32 @@ export class FrequentPostingsComponent implements OnInit { */ createFrequentPostingsForm() { this.frequentPostingsForm = this.formBuilder.group({ - 'officeId': ['', Validators.required], - 'accountingRule': ['', Validators.required], - 'currencyCode': ['', Validators.required], - 'debits': this.formBuilder.array([]), - 'credits': this.formBuilder.array([]), - 'referenceNumber': [''], - 'transactionDate': ['', Validators.required], - 'paymentTypeId': [''], - 'accountNumber': [''], - 'checkNumber': [''], - 'routingCode': [''], - 'receiptNumber': [''], - 'bankNumber': [''], - 'comments': [''] + officeId: [ + '', + Validators.required + ], + accountingRule: [ + '', + Validators.required + ], + currencyCode: [ + '', + Validators.required + ], + debits: this.formBuilder.array([]), + credits: this.formBuilder.array([]), + referenceNumber: [''], + transactionDate: [ + '', + Validators.required + ], + paymentTypeId: [''], + accountNumber: [''], + checkNumber: [''], + routingCode: [''], + receiptNumber: [''], + bankNumber: [''], + comments: [''] }); } @@ -102,7 +110,7 @@ export class FrequentPostingsComponent implements OnInit { * Sets the affected gl entry form array. */ setAffectedGLEntryForm() { - this.frequentPostingsForm.get('accountingRule').valueChanges.subscribe(accountingRule => { + this.frequentPostingsForm.get('accountingRule').valueChanges.subscribe((accountingRule) => { while (this.debits.length) { this.debits.removeAt(0); } @@ -124,8 +132,14 @@ export class FrequentPostingsComponent implements OnInit { */ createAffectedGLEntryForm(): UntypedFormGroup { return this.formBuilder.group({ - 'glAccountId': ['', Validators.required], - 'amount': ['', Validators.required] + glAccountId: [ + '', + Validators.required + ], + amount: [ + '', + Validators.required + ] }); } @@ -173,11 +187,19 @@ export class FrequentPostingsComponent implements OnInit { journalEntry.locale = this.settingsService.language.code; journalEntry.dateFormat = this.settingsService.dateFormat; if (journalEntry.transactionDate instanceof Date) { - journalEntry.transactionDate = this.dateUtils.formatDate(journalEntry.transactionDate, this.settingsService.dateFormat); + journalEntry.transactionDate = this.dateUtils.formatDate( + journalEntry.transactionDate, + this.settingsService.dateFormat + ); } - this.accountingService.createJournalEntry(journalEntry).subscribe(response => { - this.router.navigate(['../transactions/view', response.transactionId], { relativeTo: this.route }); + this.accountingService.createJournalEntry(journalEntry).subscribe((response) => { + this.router.navigate( + [ + '../transactions/view', + response.transactionId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.spec.ts b/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.spec.ts index e8f96de53..5f091fb96 100644 --- a/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.spec.ts +++ b/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.spec.ts @@ -8,9 +8,8 @@ describe('MigrateOpeningBalancesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ MigrateOpeningBalancesComponent ] - }) - .compileComponents(); + declarations: [MigrateOpeningBalancesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.ts b/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.ts index a3c9eb8ec..8afcf4c4e 100644 --- a/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.ts +++ b/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.ts @@ -23,7 +23,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./migrate-opening-balances.component.scss'] }) export class MigrateOpeningBalancesComponent implements OnInit, AfterViewInit { - /** Minimum opening balances date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum opening balances date allowed. */ @@ -57,7 +56,8 @@ export class MigrateOpeningBalancesComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private accountingService: AccountingService, private settingsService: SettingsService, private dateUtils: Dates, @@ -65,11 +65,9 @@ export class MigrateOpeningBalancesComponent implements OnInit, AfterViewInit { private router: Router, private configurationWizardService: ConfigurationWizardService, private popoverService: PopoverService, - private translateService: TranslateService) { - this.route.data.subscribe((data: { - offices: any, - currencies: any - }) => { + private translateService: TranslateService + ) { + this.route.data.subscribe((data: { offices: any; currencies: any }) => { this.officeData = data.offices; this.currencyData = data.currencies.selectedCurrencyOptions; }); @@ -88,10 +86,19 @@ export class MigrateOpeningBalancesComponent implements OnInit, AfterViewInit { */ createOpeningBalancesForm() { this.openingBalancesForm = this.formBuilder.group({ - 'officeId': ['', Validators.required], - 'currencyCode': ['', Validators.required], - 'transactionDate': ['', Validators.required], - 'glAccountEntries': this.formBuilder.array([]) + officeId: [ + '', + Validators.required + ], + currencyCode: [ + '', + Validators.required + ], + transactionDate: [ + '', + Validators.required + ], + glAccountEntries: this.formBuilder.array([]) }); this.openingBalancesForm.controls.currencyCode.valueChanges.subscribe((value: string) => { @@ -105,11 +112,14 @@ export class MigrateOpeningBalancesComponent implements OnInit, AfterViewInit { * @returns {FormGroup} GL Account entry form. */ createGLAccountEntryForm(glAccount: any): UntypedFormGroup { - return this.formBuilder.group({ - 'glAccountId': [glAccount.glAccountId], - 'debit': [null], - 'credit': [null] - }, { validator: onlyOneOfTheFieldsIsRequiredValidator }); + return this.formBuilder.group( + { + glAccountId: [glAccount.glAccountId], + debit: [null], + credit: [null] + }, + { validator: onlyOneOfTheFieldsIsRequiredValidator } + ); } /** @@ -124,15 +134,17 @@ export class MigrateOpeningBalancesComponent implements OnInit, AfterViewInit { * Retrieves gl accounts on the basis of specified office. */ retrieveOpeningBalances() { - this.accountingService.retrieveOpeningBalances(this.openingBalancesForm.value.officeId) + this.accountingService + .retrieveOpeningBalances(this.openingBalancesForm.value.officeId) .subscribe((openingBalancesData: any) => { const entry = this.openingBalancesForm.get('glAccountEntries') as UntypedFormArray; - openingBalancesData.glAccounts = openingBalancesData.assetAccountOpeningBalances - .concat(openingBalancesData.liabityAccountOpeningBalances, - openingBalancesData.equityAccountOpeningBalances, - openingBalancesData.incomeAccountOpeningBalances, - openingBalancesData.expenseAccountOpeningBalances); + openingBalancesData.glAccounts = openingBalancesData.assetAccountOpeningBalances.concat( + openingBalancesData.liabityAccountOpeningBalances, + openingBalancesData.equityAccountOpeningBalances, + openingBalancesData.incomeAccountOpeningBalances, + openingBalancesData.expenseAccountOpeningBalances + ); openingBalancesData.glAccounts.forEach((glAccount: any) => { entry.push(this.createGLAccountEntryForm(glAccount)); @@ -143,7 +155,7 @@ export class MigrateOpeningBalancesComponent implements OnInit, AfterViewInit { entry.valueChanges.subscribe(() => { this.debitsSum = 0; this.creditsSum = 0; - entry.controls.forEach(value => { + entry.controls.forEach((value) => { this.debitsSum += value.value.debit; this.creditsSum += value.value.credit; }); @@ -161,7 +173,10 @@ export class MigrateOpeningBalancesComponent implements OnInit, AfterViewInit { openingBalances.locale = this.settingsService.language.code; openingBalances.dateFormat = this.settingsService.dateFormat; if (openingBalances.transactionDate instanceof Date) { - openingBalances.transactionDate = this.dateUtils.formatDate(openingBalances.transactionDate, this.settingsService.dateFormat); + openingBalances.transactionDate = this.dateUtils.formatDate( + openingBalances.transactionDate, + this.settingsService.dateFormat + ); } openingBalances.debits = []; openingBalances.credits = []; @@ -175,7 +190,10 @@ export class MigrateOpeningBalancesComponent implements OnInit, AfterViewInit { }); delete openingBalances.glAccountEntries; this.accountingService.defineOpeningBalances(openingBalances).subscribe((response: any) => { - this.router.navigate(['/accounting/journal-entries/transactions/view', response.transactionId]); + this.router.navigate([ + '/accounting/journal-entries/transactions/view', + response.transactionId + ]); }); } } @@ -187,7 +205,12 @@ export class MigrateOpeningBalancesComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -229,11 +252,10 @@ export class MigrateOpeningBalancesComponent implements OnInit, AfterViewInit { creditsSum = creditsSum + entry.credit; } }); - return (debitsSum > 0 && debitsSum === creditsSum); + return debitsSum > 0 && debitsSum === creditsSum; } glAccountTypeLabel(accountType: string): string { return this.translateService.instant('labels.inputs.accounting.' + accountType); } - } diff --git a/src/app/accounting/migrate-opening-balances/only-one-of-the-fields-is-required.validator.ts b/src/app/accounting/migrate-opening-balances/only-one-of-the-fields-is-required.validator.ts index 3ffa58659..b12a009e4 100644 --- a/src/app/accounting/migrate-opening-balances/only-one-of-the-fields-is-required.validator.ts +++ b/src/app/accounting/migrate-opening-balances/only-one-of-the-fields-is-required.validator.ts @@ -2,12 +2,14 @@ import { UntypedFormGroup, ValidatorFn, ValidationErrors } from '@angular/forms'; /** Validates that atleast one of the fields debit or credit is filled (but not both) for a given gl account. */ -export const onlyOneOfTheFieldsIsRequiredValidator: ValidatorFn = (glAccountEntriesForm: UntypedFormGroup): ValidationErrors | null => { +export const onlyOneOfTheFieldsIsRequiredValidator: ValidatorFn = ( + glAccountEntriesForm: UntypedFormGroup +): ValidationErrors | null => { const debit = glAccountEntriesForm.controls.debit.value; const credit = glAccountEntriesForm.controls.credit.value; if (debit && credit) { if (debit > 0 && credit > 0) { - return { 'error': true }; + return { error: true }; } } return null; diff --git a/src/app/accounting/periodic-accruals/periodic-accruals.component.spec.ts b/src/app/accounting/periodic-accruals/periodic-accruals.component.spec.ts index e3b1d1254..4f7f6a2b9 100644 --- a/src/app/accounting/periodic-accruals/periodic-accruals.component.spec.ts +++ b/src/app/accounting/periodic-accruals/periodic-accruals.component.spec.ts @@ -8,9 +8,8 @@ describe('PeriodicAccrualsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PeriodicAccrualsComponent ] - }) - .compileComponents(); + declarations: [PeriodicAccrualsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/periodic-accruals/periodic-accruals.component.ts b/src/app/accounting/periodic-accruals/periodic-accruals.component.ts index 6d1d5c2e8..6559e6455 100644 --- a/src/app/accounting/periodic-accruals/periodic-accruals.component.ts +++ b/src/app/accounting/periodic-accruals/periodic-accruals.component.ts @@ -16,7 +16,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./periodic-accruals.component.scss'] }) export class PeriodicAccrualsComponent implements OnInit { - /** Minimum accrue date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum accrue date allowed. */ @@ -31,12 +30,14 @@ export class PeriodicAccrualsComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private accountingService: AccountingService, private settingsService: SettingsService, private dateUtils: Dates, private route: ActivatedRoute, - private router: Router) { } + private router: Router + ) {} /** * Creates periodic accruals form. @@ -51,7 +52,10 @@ export class PeriodicAccrualsComponent implements OnInit { */ createPeriodicAccrualsForm() { this.periodicAccrualsForm = this.formBuilder.group({ - 'tillDate': ['', Validators.required] + tillDate: [ + '', + Validators.required + ] }); } @@ -71,5 +75,4 @@ export class PeriodicAccrualsComponent implements OnInit { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.spec.ts b/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.spec.ts index 9465c2507..6096f7b79 100644 --- a/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.spec.ts +++ b/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateProvisioningEntryComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateProvisioningEntryComponent ] - }) - .compileComponents(); + declarations: [CreateProvisioningEntryComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.ts b/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.ts index c25580b12..9d2a669b8 100644 --- a/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.ts +++ b/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.ts @@ -16,7 +16,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-provisioning-entry.component.scss'] }) export class CreateProvisioningEntryComponent implements OnInit { - /** Minimum provisioning date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum provisioning date allowed. */ @@ -31,12 +30,14 @@ export class CreateProvisioningEntryComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private accountingService: AccountingService, private settingsService: SettingsService, private dateUtils: Dates, private route: ActivatedRoute, - private router: Router) { } + private router: Router + ) {} /** * Creates the provisioning entry form. @@ -51,8 +52,11 @@ export class CreateProvisioningEntryComponent implements OnInit { */ createProvisioningEntryForm() { this.provisioningEntryForm = this.formBuilder.group({ - 'date': ['', Validators.required], - 'createjournalentries': [false] + date: [ + '', + Validators.required + ], + createjournalentries: [false] }); } @@ -68,10 +72,14 @@ export class CreateProvisioningEntryComponent implements OnInit { if (provisioningEntry.date instanceof Date) { provisioningEntry.date = this.dateUtils.formatDate(provisioningEntry.date, this.settingsService.dateFormat); } - this.accountingService.createProvisioningEntry(provisioningEntry) - .subscribe((response: any) => { - this.router.navigate(['../view', response.resourceId], { relativeTo: this.route }); - }); + this.accountingService.createProvisioningEntry(provisioningEntry).subscribe((response: any) => { + this.router.navigate( + [ + '../view', + response.resourceId + ], + { relativeTo: this.route } + ); + }); } - } diff --git a/src/app/accounting/provisioning-entries/provisioning-entries.component.spec.ts b/src/app/accounting/provisioning-entries/provisioning-entries.component.spec.ts index 20194f436..67c7c641a 100644 --- a/src/app/accounting/provisioning-entries/provisioning-entries.component.spec.ts +++ b/src/app/accounting/provisioning-entries/provisioning-entries.component.spec.ts @@ -8,9 +8,8 @@ describe('ProvisioningEntriesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ProvisioningEntriesComponent ] - }) - .compileComponents(); + declarations: [ProvisioningEntriesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/provisioning-entries/provisioning-entries.component.ts b/src/app/accounting/provisioning-entries/provisioning-entries.component.ts index 285c4b888..2acfc8ffd 100644 --- a/src/app/accounting/provisioning-entries/provisioning-entries.component.ts +++ b/src/app/accounting/provisioning-entries/provisioning-entries.component.ts @@ -17,11 +17,17 @@ import { AccountingService } from '../accounting.service'; styleUrls: ['./provisioning-entries.component.scss'] }) export class ProvisioningEntriesComponent implements OnInit { - /** Provisioning entry data. */ provisioningEntryData: any; /** Columns to be displayed in provisioning entries table. */ - displayedColumns: string[] = ['createdUser', 'createdDate', 'journalEntry', 'viewReport', 'recreateProvisioning', 'viewJournalEntry']; + displayedColumns: string[] = [ + 'createdUser', + 'createdDate', + 'journalEntry', + 'viewReport', + 'recreateProvisioning', + 'viewJournalEntry' + ]; /** Data source for provisioning entries table. */ dataSource: MatTableDataSource; @@ -36,9 +42,11 @@ export class ProvisioningEntriesComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { provisioningEntries: any }) => { this.provisioningEntryData = data.provisioningEntries.pageItems; }); @@ -74,10 +82,15 @@ export class ProvisioningEntriesComponent implements OnInit { * @param {string} provisioningEntryId Provisioning entry id. */ recreateProvisioning($event: Event, provisioningEntryId: string) { - this.accountingService.recreateProvisioningEntries(provisioningEntryId) - .subscribe((response: any) => { - this.router.navigate(['view', response.resourceId], { relativeTo: this.route }); - }); + this.accountingService.recreateProvisioningEntries(provisioningEntryId).subscribe((response: any) => { + this.router.navigate( + [ + 'view', + response.resourceId + ], + { relativeTo: this.route } + ); + }); $event.stopPropagation(); } @@ -87,8 +100,13 @@ export class ProvisioningEntriesComponent implements OnInit { * @param {number} provisioningEntryId Provisioning entry id. */ viewJournalEntry($event: Event, provisioningEntryId: number) { - this.router.navigate(['journal-entries/view', provisioningEntryId], { relativeTo: this.route }); + this.router.navigate( + [ + 'journal-entries/view', + provisioningEntryId + ], + { relativeTo: this.route } + ); $event.stopPropagation(); } - } diff --git a/src/app/accounting/provisioning-entries/provisioning-entries.resolver.ts b/src/app/accounting/provisioning-entries/provisioning-entries.resolver.ts index 1bac26b49..048ecc808 100644 --- a/src/app/accounting/provisioning-entries/provisioning-entries.resolver.ts +++ b/src/app/accounting/provisioning-entries/provisioning-entries.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../accounting.service'; */ @Injectable() export class ProvisioningEntriesResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -26,5 +25,4 @@ export class ProvisioningEntriesResolver implements Resolve { resolve(): Observable { return this.accountingService.getProvisioningEntries(); } - } diff --git a/src/app/accounting/provisioning-entries/view-provisioning-entry/provisioning-entry-entries.resolver.ts b/src/app/accounting/provisioning-entries/view-provisioning-entry/provisioning-entry-entries.resolver.ts index 061cc2e8d..5242c85fc 100644 --- a/src/app/accounting/provisioning-entries/view-provisioning-entry/provisioning-entry-entries.resolver.ts +++ b/src/app/accounting/provisioning-entries/view-provisioning-entry/provisioning-entry-entries.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../../accounting.service'; */ @Injectable() export class ProvisioningEntryEntriesResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -27,5 +26,4 @@ export class ProvisioningEntryEntriesResolver implements Resolve { const provisioningEntryId = route.paramMap.get('id'); return this.accountingService.getProvisioningEntryEntries(provisioningEntryId); } - } diff --git a/src/app/accounting/provisioning-entries/view-provisioning-entry/provisioning-entry.resolver.ts b/src/app/accounting/provisioning-entries/view-provisioning-entry/provisioning-entry.resolver.ts index f0efdc047..6ac32a426 100644 --- a/src/app/accounting/provisioning-entries/view-provisioning-entry/provisioning-entry.resolver.ts +++ b/src/app/accounting/provisioning-entries/view-provisioning-entry/provisioning-entry.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../../accounting.service'; */ @Injectable() export class ProvisioningEntryResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -27,5 +26,4 @@ export class ProvisioningEntryResolver implements Resolve { const provisioningEntryId = route.paramMap.get('id'); return this.accountingService.getProvisioningEntry(provisioningEntryId); } - } diff --git a/src/app/accounting/provisioning-entries/view-provisioning-entry/view-provisioning-entry.component.spec.ts b/src/app/accounting/provisioning-entries/view-provisioning-entry/view-provisioning-entry.component.spec.ts index e66d437d7..1c4a06944 100644 --- a/src/app/accounting/provisioning-entries/view-provisioning-entry/view-provisioning-entry.component.spec.ts +++ b/src/app/accounting/provisioning-entries/view-provisioning-entry/view-provisioning-entry.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewProvisioningEntryComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewProvisioningEntryComponent ] - }) - .compileComponents(); + declarations: [ViewProvisioningEntryComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/provisioning-entries/view-provisioning-entry/view-provisioning-entry.component.ts b/src/app/accounting/provisioning-entries/view-provisioning-entry/view-provisioning-entry.component.ts index 57b0d7bd2..6185a163d 100644 --- a/src/app/accounting/provisioning-entries/view-provisioning-entry/view-provisioning-entry.component.ts +++ b/src/app/accounting/provisioning-entries/view-provisioning-entry/view-provisioning-entry.component.ts @@ -21,7 +21,6 @@ import { AccountingService } from '../../accounting.service'; styleUrls: ['./view-provisioning-entry.component.scss'] }) export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { - /** Provisioning entry id. */ provisioningEntryId: string; /** Provisioning entry. */ @@ -47,7 +46,15 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { /** Filtered provisioning category data for autocomplete. */ filteredProvisioningCategoryData: any; /** Columns to be displayed in provisioning entry entries table. */ - displayedColumns: string[] = ['officeName', 'productName', 'currencyCode', 'categoryName', 'amountreserved', 'liabilityAccountName', 'expenseAccountName']; + displayedColumns: string[] = [ + 'officeName', + 'productName', + 'currencyCode', + 'categoryName', + 'amountreserved', + 'liabilityAccountName', + 'expenseAccountName' + ]; /** Data source for provisioning entry entries table. */ dataSource: MatTableDataSource; /** Provisioning entry entries filter. */ @@ -69,15 +76,18 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router) { - this.route.data.subscribe((data: { - provisioningEntry: any, - provisioningEntryEntries: any, - offices: any, - loanProducts: any, - provisiningCategories: any + constructor( + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router + ) { + this.route.data.subscribe( + (data: { + provisioningEntry: any; + provisioningEntryEntries: any; + offices: any; + loanProducts: any; + provisiningCategories: any; }) => { this.provisioningEntryId = data.provisioningEntry.id; this.provisioningEntry = data.provisioningEntry; @@ -85,7 +95,8 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { this.officeData = data.offices; this.loanProductData = data.loanProducts; this.provisioningCategoryData = data.provisiningCategories; - }); + } + ); } /** @@ -106,7 +117,7 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { ngAfterViewInit() { this.officeName.valueChanges .pipe( - map(value => value.toLowerCase()), + map((value) => value.toLowerCase()), debounceTime(500), distinctUntilChanged(), tap((filterValue) => { @@ -117,7 +128,7 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { this.loanProduct.valueChanges .pipe( - map(value => value.toLowerCase()), + map((value) => value.toLowerCase()), debounceTime(500), distinctUntilChanged(), tap((filterValue) => { @@ -128,7 +139,7 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { this.provisioningCategory.valueChanges .pipe( - map(value => value.toLowerCase()), + map((value) => value.toLowerCase()), debounceTime(500), distinctUntilChanged(), tap((filterValue) => { @@ -144,9 +155,11 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { * @param {any} filterValue Values to filter data by. */ filterPredicate(data: any, filterValue: any) { - return data.officeName.toLowerCase().indexOf(filterValue['officeName']) !== -1 - && data.productName.toLowerCase().indexOf(filterValue['productName']) !== -1 - && data.categoryName.toLowerCase().indexOf(filterValue['categoryName']) !== -1; + return ( + data.officeName.toLowerCase().indexOf(filterValue['officeName']) !== -1 && + data.productName.toLowerCase().indexOf(filterValue['productName']) !== -1 && + data.categoryName.toLowerCase().indexOf(filterValue['categoryName']) !== -1 + ); } /** @@ -174,11 +187,10 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { * Sets filtered offices for autocomplete. */ setFilteredOffices() { - this.filteredOfficeData = this.officeName.valueChanges - .pipe( + this.filteredOfficeData = this.officeName.valueChanges.pipe( startWith(''), - map((office: any) => typeof office === 'string' ? office : office.name), - map((officeName: string) => officeName ? this.filterOfficeAutocompleteData(officeName) : this.officeData) + map((office: any) => (typeof office === 'string' ? office : office.name)), + map((officeName: string) => (officeName ? this.filterOfficeAutocompleteData(officeName) : this.officeData)) ); } @@ -186,11 +198,12 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { * Sets filtered loan products for autocomplete. */ setFilteredLoanProducts() { - this.filteredLoanProductData = this.loanProduct.valueChanges - .pipe( + this.filteredLoanProductData = this.loanProduct.valueChanges.pipe( startWith(''), - map((loanProduct: any) => typeof loanProduct === 'string' ? loanProduct : loanProduct.name), - map((loanProductName: string) => loanProductName ? this.filterLoanProductAutocompleteData(loanProductName) : this.loanProductData) + map((loanProduct: any) => (typeof loanProduct === 'string' ? loanProduct : loanProduct.name)), + map((loanProductName: string) => + loanProductName ? this.filterLoanProductAutocompleteData(loanProductName) : this.loanProductData + ) ); } @@ -198,11 +211,16 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { * Sets filtered provisioning categories for autocomplete. */ setFilteredProvisioningCategories() { - this.filteredProvisioningCategoryData = this.provisioningCategory.valueChanges - .pipe( + this.filteredProvisioningCategoryData = this.provisioningCategory.valueChanges.pipe( startWith(''), - map((provisioningCategory: any) => typeof provisioningCategory === 'string' ? provisioningCategory : provisioningCategory.categoryName), - map((provisioningCategoryName: string) => provisioningCategoryName ? this.filterProvisioningCategoryAutocompleteData(provisioningCategoryName) : this.provisioningCategoryData) + map((provisioningCategory: any) => + typeof provisioningCategory === 'string' ? provisioningCategory : provisioningCategory.categoryName + ), + map((provisioningCategoryName: string) => + provisioningCategoryName + ? this.filterProvisioningCategoryAutocompleteData(provisioningCategoryName) + : this.provisioningCategoryData + ) ); } @@ -221,7 +239,9 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { * @returns {any} Filtered loan products. */ private filterLoanProductAutocompleteData(loanProductName: string): any { - return this.loanProductData.filter((loanProduct: any) => loanProduct.name.toLowerCase().includes(loanProductName.toLocaleLowerCase())); + return this.loanProductData.filter((loanProduct: any) => + loanProduct.name.toLowerCase().includes(loanProductName.toLocaleLowerCase()) + ); } /** @@ -230,7 +250,9 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { * @returns {any} Filtered provisioning categories. */ private filterProvisioningCategoryAutocompleteData(provisioningCategoryName: string): any { - return this.provisioningCategoryData.filter((provisioningCategory: any) => provisioningCategory.categoryName.toLowerCase().includes(provisioningCategoryName.toLocaleLowerCase())); + return this.provisioningCategoryData.filter((provisioningCategory: any) => + provisioningCategory.categoryName.toLowerCase().includes(provisioningCategoryName.toLocaleLowerCase()) + ); } /** @@ -238,10 +260,14 @@ export class ViewProvisioningEntryComponent implements OnInit, AfterViewInit { * and redirects to created entries. */ createProvisioningJournalEntries() { - this.accountingService.createProvisioningJournalEntries(this.provisioningEntryId) - .subscribe((response: any) => { - this.router.navigate(['../../journal-entries/view', response.resourceId], { relativeTo: this.route }); - }); + this.accountingService.createProvisioningJournalEntries(this.provisioningEntryId).subscribe((response: any) => { + this.router.navigate( + [ + '../../journal-entries/view', + response.resourceId + ], + { relativeTo: this.route } + ); + }); } - } diff --git a/src/app/accounting/provisioning-entries/view-provisioning-journal-entries/provisioning-journal-entries.resolver.ts b/src/app/accounting/provisioning-entries/view-provisioning-journal-entries/provisioning-journal-entries.resolver.ts index 21e901fe8..51788444b 100644 --- a/src/app/accounting/provisioning-entries/view-provisioning-journal-entries/provisioning-journal-entries.resolver.ts +++ b/src/app/accounting/provisioning-entries/view-provisioning-journal-entries/provisioning-journal-entries.resolver.ts @@ -13,7 +13,6 @@ import { AccountingService } from '../../accounting.service'; */ @Injectable() export class ProvisioningJournalEntriesResolver implements Resolve { - /** * @param {AccountingService} accountingService Accounting service. */ @@ -27,5 +26,4 @@ export class ProvisioningJournalEntriesResolver implements Resolve { const id = route.paramMap.get('id'); return this.accountingService.getProvisioningJournalEntries(id); } - } diff --git a/src/app/accounting/provisioning-entries/view-provisioning-journal-entries/view-provisioning-journal-entries.component.spec.ts b/src/app/accounting/provisioning-entries/view-provisioning-journal-entries/view-provisioning-journal-entries.component.spec.ts index 649e634c6..f4d68446d 100644 --- a/src/app/accounting/provisioning-entries/view-provisioning-journal-entries/view-provisioning-journal-entries.component.spec.ts +++ b/src/app/accounting/provisioning-entries/view-provisioning-journal-entries/view-provisioning-journal-entries.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewProvisioningJournalEntriesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewProvisioningJournalEntriesComponent ] - }) - .compileComponents(); + declarations: [ViewProvisioningJournalEntriesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/provisioning-entries/view-provisioning-journal-entries/view-provisioning-journal-entries.component.ts b/src/app/accounting/provisioning-entries/view-provisioning-journal-entries/view-provisioning-journal-entries.component.ts index 4317907ee..0af473ec5 100644 --- a/src/app/accounting/provisioning-entries/view-provisioning-journal-entries/view-provisioning-journal-entries.component.ts +++ b/src/app/accounting/provisioning-entries/view-provisioning-journal-entries/view-provisioning-journal-entries.component.ts @@ -14,11 +14,21 @@ import { MatTableDataSource } from '@angular/material/table'; styleUrls: ['./view-provisioning-journal-entries.component.scss'] }) export class ViewProvisioningJournalEntriesComponent implements OnInit { - /** Provisioning journal entry data. */ provisioningJournalEntryData: any; /** Columns to be displayed in provisioning journal entries table. */ - displayedColumns: string[] = ['id', 'officeName', 'transactionDate', 'transactionId', 'glAccountType', 'createdByUserName', 'glAccountCode', 'glAccountName', 'debit', 'credit']; + displayedColumns: string[] = [ + 'id', + 'officeName', + 'transactionDate', + 'transactionId', + 'glAccountType', + 'createdByUserName', + 'glAccountCode', + 'glAccountName', + 'debit', + 'credit' + ]; /** Data source for provisioning journal entries table. */ dataSource: MatTableDataSource; @@ -52,10 +62,14 @@ export class ViewProvisioningJournalEntriesComponent implements OnInit { this.dataSource.paginator = this.paginator; this.dataSource.sortingDataAccessor = (transaction: any, property: any) => { switch (property) { - case 'glAccountType': return transaction.glAccountType.value; - case 'debit': return transaction.amount; - case 'credit': return transaction.amount; - default: return transaction[property]; + case 'glAccountType': + return transaction.glAccountType.value; + case 'debit': + return transaction.amount; + case 'credit': + return transaction.amount; + default: + return transaction[property]; } }; this.dataSource.sort = this.sort; @@ -68,5 +82,4 @@ export class ViewProvisioningJournalEntriesComponent implements OnInit { applyFilter(filterValue: string) { this.dataSource.filter = filterValue.trim().toLowerCase(); } - } diff --git a/src/app/accounting/revert-transaction/revert-transaction.component.spec.ts b/src/app/accounting/revert-transaction/revert-transaction.component.spec.ts index 342e3e465..f562f57b2 100644 --- a/src/app/accounting/revert-transaction/revert-transaction.component.spec.ts +++ b/src/app/accounting/revert-transaction/revert-transaction.component.spec.ts @@ -8,9 +8,8 @@ describe('RevertTransactionComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RevertTransactionComponent ] - }) - .compileComponents(); + declarations: [RevertTransactionComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/revert-transaction/revert-transaction.component.ts b/src/app/accounting/revert-transaction/revert-transaction.component.ts index 41f9abe60..e82a5a7e5 100644 --- a/src/app/accounting/revert-transaction/revert-transaction.component.ts +++ b/src/app/accounting/revert-transaction/revert-transaction.component.ts @@ -12,7 +12,6 @@ import { UntypedFormControl } from '@angular/forms'; styleUrls: ['./revert-transaction.component.scss'] }) export class RevertTransactionComponent { - /** Comments input form control. */ comments = new UntypedFormControl(''); @@ -20,7 +19,8 @@ export class RevertTransactionComponent { * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data Provides comments or reverted transaction ID. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/accounting/search-journal-entry/journal-entry.datasource.ts b/src/app/accounting/search-journal-entry/journal-entry.datasource.ts index 523a8c43b..8f6492a81 100644 --- a/src/app/accounting/search-journal-entry/journal-entry.datasource.ts +++ b/src/app/accounting/search-journal-entry/journal-entry.datasource.ts @@ -11,7 +11,6 @@ import { AccountingService } from '../accounting.service'; * Journal entries custom data source to implement server side filtering, pagination and sorting. */ export class JournalEntriesDataSource implements DataSource { - /** Journal entries behavior subject to represent loaded journal entries page. */ private journalEntriesSubject = new BehaviorSubject([]); /** Records subject to represent total number of filtered journal entry records. */ @@ -22,7 +21,7 @@ export class JournalEntriesDataSource implements DataSource { /** * @param {AccountingService} accountingService Accounting Service */ - constructor(private accountingService: AccountingService) { } + constructor(private accountingService: AccountingService) {} /** * Gets journal entries on the basis of provided parameters and emits the value. @@ -32,10 +31,17 @@ export class JournalEntriesDataSource implements DataSource { * @param {number} pageIndex Page number. * @param {number} limit Number of entries within the page. */ - getJournalEntries(filterBy: any, orderBy: string = '', sortOrder: string = '', pageIndex: number = 0, limit: number = 10) { + getJournalEntries( + filterBy: any, + orderBy: string = '', + sortOrder: string = '', + pageIndex: number = 0, + limit: number = 10 + ) { this.journalEntriesSubject.next([]); - orderBy = (orderBy === 'debit' || orderBy === 'credit') ? 'amount' : orderBy; - this.accountingService.getJournalEntries(filterBy, orderBy, sortOrder, pageIndex * limit, limit) + orderBy = orderBy === 'debit' || orderBy === 'credit' ? 'amount' : orderBy; + this.accountingService + .getJournalEntries(filterBy, orderBy, sortOrder, pageIndex * limit, limit) .subscribe((journalEntries: any) => { this.recordsSubject.next(journalEntries.totalFilteredRecords); this.journalEntriesSubject.next(journalEntries.pageItems); @@ -56,5 +62,4 @@ export class JournalEntriesDataSource implements DataSource { this.journalEntriesSubject.complete(); this.recordsSubject.complete(); } - } diff --git a/src/app/accounting/search-journal-entry/search-journal-entry.component.spec.ts b/src/app/accounting/search-journal-entry/search-journal-entry.component.spec.ts index 32ed3373f..53db55b83 100644 --- a/src/app/accounting/search-journal-entry/search-journal-entry.component.spec.ts +++ b/src/app/accounting/search-journal-entry/search-journal-entry.component.spec.ts @@ -8,9 +8,8 @@ describe('SearchJournalEntryComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SearchJournalEntryComponent ] - }) - .compileComponents(); + declarations: [SearchJournalEntryComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/accounting/search-journal-entry/search-journal-entry.component.ts b/src/app/accounting/search-journal-entry/search-journal-entry.component.ts index af77ef34f..b64dead08 100644 --- a/src/app/accounting/search-journal-entry/search-journal-entry.component.ts +++ b/src/app/accounting/search-journal-entry/search-journal-entry.component.ts @@ -7,7 +7,7 @@ import { ActivatedRoute } from '@angular/router'; /** rxjs Imports */ import { merge } from 'rxjs'; -import { tap, startWith, map, distinctUntilChanged, debounceTime} from 'rxjs/operators'; +import { tap, startWith, map, distinctUntilChanged, debounceTime } from 'rxjs/operators'; /** Custom Services */ import { AccountingService } from '../accounting.service'; @@ -25,7 +25,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./search-journal-entry.component.scss'] }) export class SearchJournalEntryComponent implements OnInit, AfterViewInit { - /** Minimum transaction date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum transaction date allowed. */ @@ -56,7 +55,7 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { }, { option: 'System Entries', - value: false // Bug: unable to implement from server side + value: false // Bug: unable to implement from server side } ]; /** Transaction date from form control. */ @@ -70,7 +69,20 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { /** Submitted on date to form control. */ submittedOnDateTo = new UntypedFormControl(); /** Columns to be displayed in journal entries table. */ - displayedColumns: string[] = ['id', 'officeName', 'transactionId', 'transactionDate', 'glAccountType', 'createdByUserName', 'submittedOnDate', 'glAccountCode', 'glAccountName', 'currency', 'debit', 'credit']; + displayedColumns: string[] = [ + 'id', + 'officeName', + 'transactionId', + 'transactionDate', + 'glAccountType', + 'createdByUserName', + 'submittedOnDate', + 'glAccountCode', + 'glAccountName', + 'currency', + 'debit', + 'credit' + ]; /** Data source for journal entries table. */ dataSource: JournalEntriesDataSource; /** Journal entries filter. */ @@ -93,7 +105,10 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { }, { type: 'fromDate', - value: this.dateUtils.formatDate(new Date(new Date().setMonth(new Date().getMonth() - 1)), this.settingsService.dateFormat) + value: this.dateUtils.formatDate( + new Date(new Date().setMonth(new Date().getMonth() - 1)), + this.settingsService.dateFormat + ) }, { type: 'toDate', @@ -128,17 +143,16 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { * @param {ActivatedRoute} route Activated Route. * @param {SettingsService} settingsService Settings Service. */ - constructor(private accountingService: AccountingService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute) { - this.route.data.subscribe((data: { - offices: any, - glAccounts: any - }) => { - this.officeData = data.offices; - this.glAccountData = data.glAccounts; - }); + constructor( + private accountingService: AccountingService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute + ) { + this.route.data.subscribe((data: { offices: any; glAccounts: any }) => { + this.officeData = data.offices; + this.glAccountData = data.glAccounts; + }); } /** @@ -159,7 +173,7 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { ngAfterViewInit() { this.officeName.valueChanges .pipe( - map(value => value.id ? value.id : ''), + map((value) => (value.id ? value.id : '')), debounceTime(500), distinctUntilChanged(), tap((filterValue) => { @@ -170,7 +184,7 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { this.glAccount.valueChanges .pipe( - map(value => value ? value : ''), + map((value) => (value ? value : '')), debounceTime(500), distinctUntilChanged(), tap((filterValue) => { @@ -209,12 +223,15 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { ) .subscribe(); - this.submittedOnDateFrom.valueChanges + this.submittedOnDateFrom.valueChanges .pipe( debounceTime(500), distinctUntilChanged(), tap((filterValue) => { - this.applyFilter(this.dateUtils.formatDate(filterValue, this.settingsService.dateFormat), 'submittedOnDateFrom'); + this.applyFilter( + this.dateUtils.formatDate(filterValue, this.settingsService.dateFormat), + 'submittedOnDateFrom' + ); }) ) .subscribe(); @@ -224,17 +241,18 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { debounceTime(500), distinctUntilChanged(), tap((filterValue) => { - this.applyFilter(this.dateUtils.formatDate(filterValue, this.settingsService.dateFormat), 'submittedOnDateTo'); + this.applyFilter( + this.dateUtils.formatDate(filterValue, this.settingsService.dateFormat), + 'submittedOnDateTo' + ); }) ) .subscribe(); - this.sort.sortChange.subscribe(() => this.paginator.pageIndex = 0); + this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0)); merge(this.sort.sortChange, this.paginator.page) - .pipe( - tap(() => this.loadJournalEntriesPage()) - ) + .pipe(tap(() => this.loadJournalEntriesPage())) .subscribe(); } @@ -245,7 +263,13 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { if (!this.sort.direction) { delete this.sort.active; } - this.dataSource.getJournalEntries(this.filterJournalEntriesBy, this.sort.active, this.sort.direction, this.paginator.pageIndex, this.paginator.pageSize); + this.dataSource.getJournalEntries( + this.filterJournalEntriesBy, + this.sort.active, + this.sort.direction, + this.paginator.pageIndex, + this.paginator.pageSize + ); } /** @@ -255,7 +279,7 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { */ applyFilter(filterValue: string, property: string) { this.paginator.pageIndex = 0; - const findIndex = this.filterJournalEntriesBy.findIndex(filter => filter.type === property); + const findIndex = this.filterJournalEntriesBy.findIndex((filter) => filter.type === property); this.filterJournalEntriesBy[findIndex].value = filterValue; this.loadJournalEntriesPage(); } @@ -273,24 +297,24 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { * Sets filtered offices for autocomplete. */ setFilteredOffices() { - this.filteredOfficeData = this.officeName.valueChanges - .pipe( - startWith(''), - map((office: any) => typeof office === 'string' ? office : office.name), - map((officeName: string) => officeName ? this.filterOfficeAutocompleteData(officeName) : this.officeData) - ); + this.filteredOfficeData = this.officeName.valueChanges.pipe( + startWith(''), + map((office: any) => (typeof office === 'string' ? office : office.name)), + map((officeName: string) => (officeName ? this.filterOfficeAutocompleteData(officeName) : this.officeData)) + ); } /** * Sets filtered gl accounts for autocomplete. */ setFilteredGlAccounts() { - this.filteredGLAccountData = this.glAccount.valueChanges - .pipe( - startWith(''), - map((glAccount: any) => typeof glAccount === 'string' ? glAccount : glAccount.name + ' (' + glAccount.glCode + ')'), - map((glAccount: string) => glAccount ? this.filterGLAccountAutocompleteData(glAccount) : this.glAccountData) - ); + this.filteredGLAccountData = this.glAccount.valueChanges.pipe( + startWith(''), + map((glAccount: any) => + typeof glAccount === 'string' ? glAccount : glAccount.name + ' (' + glAccount.glCode + ')' + ), + map((glAccount: string) => (glAccount ? this.filterGLAccountAutocompleteData(glAccount) : this.glAccountData)) + ); } /** @@ -308,7 +332,9 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { * @returns {any} Filtered gl accounts. */ private filterGLAccountAutocompleteData(glAccount: string): any { - return this.glAccountData.filter((option: any) => (option.name + ' (' + option.glCode + ')').toLowerCase().includes(glAccount.toLowerCase())); + return this.glAccountData.filter((option: any) => + (option.name + ' (' + option.glCode + ')').toLowerCase().includes(glAccount.toLowerCase()) + ); } /** @@ -316,6 +342,12 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit { */ getJournalEntries() { this.dataSource = new JournalEntriesDataSource(this.accountingService); - this.dataSource.getJournalEntries(this.filterJournalEntriesBy, this.sort.active, this.sort.direction, this.paginator.pageIndex, this.paginator.pageSize); + this.dataSource.getJournalEntries( + this.filterJournalEntriesBy, + this.sort.active, + this.sort.direction, + this.paginator.pageIndex, + this.paginator.pageSize + ); } } diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 6adf8bb44..8636091bb 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -3,7 +3,7 @@ import { NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; // Not Found Component -import {NotFoundComponent} from './not-found/not-found.component'; +import { NotFoundComponent } from './not-found/not-found.component'; /** * Fallback to this route when no prior route is matched. @@ -25,4 +25,4 @@ const routes: Routes = [ exports: [RouterModule], providers: [] }) -export class AppRoutingModule { } +export class AppRoutingModule {} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index ed97bdd49..d9734a9f9 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -35,7 +35,7 @@ import { CollectionsModule } from './collections/collections.module'; import { ProfileModule } from './profile/profile.module'; import { TasksModule } from './tasks/tasks.module'; import { ConfigurationWizardModule } from './configuration-wizard/configuration-wizard.module'; -import {PortalModule} from '@angular/cdk/portal'; +import { PortalModule } from '@angular/cdk/portal'; /** Main Routing Module */ import { AppRoutingModule } from './app-routing.module'; @@ -59,9 +59,16 @@ export function HttpLoaderFactory(http: HttpClient) { loader: { provide: TranslateLoader, useFactory: (http: HttpClient, locationStrategy: LocationStrategy) => { - return new TranslateHttpLoader(http, `${ window.location.protocol }//${ window.location.host }${locationStrategy.getBaseHref()}/assets/translations/`, '.json'); + return new TranslateHttpLoader( + http, + `${window.location.protocol}//${window.location.host}${locationStrategy.getBaseHref()}/assets/translations/`, + '.json' + ); }, - deps: [HttpClient, LocationStrategy] + deps: [ + HttpClient, + LocationStrategy + ] } }), BrowserModule, @@ -91,9 +98,13 @@ export function HttpLoaderFactory(http: HttpClient) { TasksModule, ConfigurationWizardModule, AppRoutingModule + + ], + declarations: [ + WebAppComponent, + NotFoundComponent ], - declarations: [WebAppComponent, NotFoundComponent], providers: [DatePipe], bootstrap: [WebAppComponent] }) -export class AppModule { } +export class AppModule {} diff --git a/src/app/centers/centers-routing.module.ts b/src/app/centers/centers-routing.module.ts index 1b18714c9..be4b357f6 100644 --- a/src/app/centers/centers-routing.module.ts +++ b/src/app/centers/centers-routing.module.ts @@ -28,7 +28,6 @@ import { CenterDataAndTemplateResolver } from './common-resolvers/center-data-an const routes: Routes = [ Route.withShell([ - { path: 'centers', data: { title: 'Centers', breadcrumb: 'Centers' }, @@ -42,14 +41,14 @@ const routes: Routes = [ component: CreateCenterComponent, data: { title: 'Create Center', breadcrumb: 'Create' }, resolve: { - offices: OfficesResolver, + offices: OfficesResolver } }, { path: ':centerId', data: { title: 'Centers View', routeParamBreadcrumb: 'centerId' }, resolve: { - centerViewData: CenterViewResolver, + centerViewData: CenterViewResolver }, children: [ { @@ -80,14 +79,16 @@ const routes: Routes = [ }, { path: 'datatables', - children: [{ - path: ':datatableName', - component: DatatableTabComponent, - data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, - resolve: { - centerDatatable: CenterDatatableResolver + children: [ + { + path: ':datatableName', + component: DatatableTabComponent, + data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, + resolve: { + centerDatatable: CenterDatatableResolver + } } - }] + ] } ] }, @@ -96,7 +97,7 @@ const routes: Routes = [ component: EditCenterComponent, data: { title: 'Edit Center', breadcrumb: 'Edit', routeParamBreadcrumb: 'Edit' }, resolve: { - centerData: CenterDataAndTemplateResolver, + centerData: CenterDataAndTemplateResolver } }, { @@ -109,13 +110,14 @@ const routes: Routes = [ }, { path: 'savings-accounts', - loadChildren: () => import('../savings/savings.module').then(m => m.SavingsModule) + loadChildren: () => import('../savings/savings.module').then((m) => m.SavingsModule) } ] } ] } ]) + ]; @NgModule({ @@ -134,4 +136,4 @@ const routes: Routes = [ CenterDataAndTemplateResolver ] }) -export class CentersRoutingModule { } +export class CentersRoutingModule {} diff --git a/src/app/centers/centers-view/center-actions/activate-center/activate-center.component.spec.ts b/src/app/centers/centers-view/center-actions/activate-center/activate-center.component.spec.ts index 411946f07..6674a7545 100644 --- a/src/app/centers/centers-view/center-actions/activate-center/activate-center.component.spec.ts +++ b/src/app/centers/centers-view/center-actions/activate-center/activate-center.component.spec.ts @@ -8,9 +8,8 @@ describe('ActivateCenterComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ActivateCenterComponent ] - }) - .compileComponents(); + declarations: [ActivateCenterComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/center-actions/activate-center/activate-center.component.ts b/src/app/centers/centers-view/center-actions/activate-center/activate-center.component.ts index e56b4ad12..b43dd8e9b 100644 --- a/src/app/centers/centers-view/center-actions/activate-center/activate-center.component.ts +++ b/src/app/centers/centers-view/center-actions/activate-center/activate-center.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./activate-center.component.scss'] }) export class ActivateCenterComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class ActivateCenterComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private centersService: CentersService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private centersService: CentersService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router + ) { this.centerId = this.route.parent.snapshot.params['centerId']; } @@ -57,7 +58,10 @@ export class ActivateCenterComponent implements OnInit { */ createActivateCenterForm() { this.activateCenterForm = this.formBuilder.group({ - 'activationDate': [new Date(), Validators.required] + activationDate: [ + new Date(), + Validators.required + ] }); } @@ -82,5 +86,4 @@ export class ActivateCenterComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/centers/centers-view/center-actions/attach-center-meeting/attach-center-meeting.component.spec.ts b/src/app/centers/centers-view/center-actions/attach-center-meeting/attach-center-meeting.component.spec.ts index fd7b295ec..36df0018b 100644 --- a/src/app/centers/centers-view/center-actions/attach-center-meeting/attach-center-meeting.component.spec.ts +++ b/src/app/centers/centers-view/center-actions/attach-center-meeting/attach-center-meeting.component.spec.ts @@ -8,9 +8,8 @@ describe('AttachCenterMeetingComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AttachCenterMeetingComponent ] - }) - .compileComponents(); + declarations: [AttachCenterMeetingComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/center-actions/attach-center-meeting/attach-center-meeting.component.ts b/src/app/centers/centers-view/center-actions/attach-center-meeting/attach-center-meeting.component.ts index 571732868..dd9ce3bfc 100644 --- a/src/app/centers/centers-view/center-actions/attach-center-meeting/attach-center-meeting.component.ts +++ b/src/app/centers/centers-view/center-actions/attach-center-meeting/attach-center-meeting.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./attach-center-meeting.component.scss'] }) export class AttachCenterMeetingComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -44,12 +43,14 @@ export class AttachCenterMeetingComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private centersService: CentersService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private centersService: CentersService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { centersActionData: any }) => { this.calendarTemplate = data.centersActionData; this.frequencyOptions = this.calendarTemplate.frequencyOptions; @@ -69,8 +70,11 @@ export class AttachCenterMeetingComponent implements OnInit { */ createCenterMeetingForm() { this.centerMeetingForm = this.formBuilder.group({ - 'startDate': ['', Validators.required], - 'repeating': [false] + startDate: [ + '', + Validators.required + ], + repeating: [false] }); } @@ -86,23 +90,49 @@ export class AttachCenterMeetingComponent implements OnInit { this.centerMeetingForm.removeControl('repeatsOnDay'); switch (frequency) { case 1: // Daily - this.repetitionIntervals = ['1', '2', '3']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3' + ]; + break; case 2: // Weekly - this.repetitionIntervals = ['1', '2', '3']; + this.repetitionIntervals = [ + '1', + '2', + '3' + ]; this.centerMeetingForm.addControl('repeatsOnDay', new UntypedFormControl('', Validators.required)); - break; + break; case 3: // Monthly - this.repetitionIntervals = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '10', + '11' + ]; + break; case 4: // Yearly - this.repetitionIntervals = ['1', '2', '3', '4', '5']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3', + '4', + '5' + ]; + break; } }); this.centerMeetingForm.patchValue({ - 'frequency': 1, - 'interval': '1' + frequency: 1, + interval: '1' }); } else { this.centerMeetingForm.removeControl('frequency'); @@ -135,5 +165,4 @@ export class AttachCenterMeetingComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/centers/centers-view/center-actions/center-actions.component.spec.ts b/src/app/centers/centers-view/center-actions/center-actions.component.spec.ts index 7ca3e739c..f4b638ff7 100644 --- a/src/app/centers/centers-view/center-actions/center-actions.component.spec.ts +++ b/src/app/centers/centers-view/center-actions/center-actions.component.spec.ts @@ -8,9 +8,8 @@ describe('CenterActionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CenterActionsComponent ] - }) - .compileComponents(); + declarations: [CenterActionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/center-actions/center-actions.component.ts b/src/app/centers/centers-view/center-actions/center-actions.component.ts index 68b2a2da9..5e53caa37 100644 --- a/src/app/centers/centers-view/center-actions/center-actions.component.ts +++ b/src/app/centers/centers-view/center-actions/center-actions.component.ts @@ -11,23 +11,22 @@ import { ActivatedRoute, Router } from '@angular/router'; styleUrls: ['./center-actions.component.scss'] }) export class CenterActionsComponent { - /** Flag object to store possible actions and render appropriate UI to the user */ actions: { - 'Activate': boolean, - 'Assign Staff': boolean, - 'Close': boolean, - 'Attendance': boolean, - 'Attach Meeting': boolean, - 'Edit Meeting': boolean, - 'Edit Meeting Schedule': boolean, - 'Manage Groups': boolean, - 'Staff Assignment History': boolean + Activate: boolean; + 'Assign Staff': boolean; + Close: boolean; + Attendance: boolean; + 'Attach Meeting': boolean; + 'Edit Meeting': boolean; + 'Edit Meeting Schedule': boolean; + 'Manage Groups': boolean; + 'Staff Assignment History': boolean; } = { - 'Activate': false, + Activate: false, 'Assign Staff': false, - 'Close': false, - 'Attendance': false, + Close: false, + Attendance: false, 'Attach Meeting': false, 'Edit Meeting': false, 'Edit Meeting Schedule': false, @@ -38,11 +37,12 @@ export class CenterActionsComponent { /** * @param {ActivatedRoute} route Activated Route */ - constructor(private route: ActivatedRoute, - private router: Router) { + constructor( + private route: ActivatedRoute, + private router: Router + ) { this.router.routeReuseStrategy.shouldReuseRoute = () => false; const name = this.route.snapshot.params['name']; this.actions[name] = true; } - } diff --git a/src/app/centers/centers-view/center-actions/center-assign-staff/center-assign-staff.component.spec.ts b/src/app/centers/centers-view/center-actions/center-assign-staff/center-assign-staff.component.spec.ts index 5b6ef4b5a..2f37697de 100644 --- a/src/app/centers/centers-view/center-actions/center-assign-staff/center-assign-staff.component.spec.ts +++ b/src/app/centers/centers-view/center-actions/center-assign-staff/center-assign-staff.component.spec.ts @@ -8,9 +8,8 @@ describe('CenterAssignStaffComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CenterAssignStaffComponent ] - }) - .compileComponents(); + declarations: [CenterAssignStaffComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/center-actions/center-assign-staff/center-assign-staff.component.ts b/src/app/centers/centers-view/center-actions/center-assign-staff/center-assign-staff.component.ts index dd33b322d..60853b099 100644 --- a/src/app/centers/centers-view/center-actions/center-assign-staff/center-assign-staff.component.ts +++ b/src/app/centers/centers-view/center-actions/center-assign-staff/center-assign-staff.component.ts @@ -15,7 +15,6 @@ import { CentersService } from 'app/centers/centers.service'; styleUrls: ['./center-assign-staff.component.scss'] }) export class CenterAssignStaffComponent implements OnInit { - /** Center Assign Staff form. */ centerAssignStaffForm: UntypedFormGroup; /** Field Officer Data */ @@ -30,10 +29,12 @@ export class CenterAssignStaffComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private centersService: CentersService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private centersService: CentersService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { centersActionData: any }) => { this.centerData = data.centersActionData; }); @@ -52,7 +53,7 @@ export class CenterAssignStaffComponent implements OnInit { */ createCenterAssignStaffForm() { this.centerAssignStaffForm = this.formBuilder.group({ - 'staffId': [''] + staffId: [''] }); } @@ -60,10 +61,10 @@ export class CenterAssignStaffComponent implements OnInit { * Submits the form and assigns staff for the center. */ submit() { - this.centersService.executeGroupActionCommand(this.centerData.id, 'assignStaff', this.centerAssignStaffForm.value) + this.centersService + .executeGroupActionCommand(this.centerData.id, 'assignStaff', this.centerAssignStaffForm.value) .subscribe(() => { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/centers/centers-view/center-actions/center-attendance/center-attendance.component.spec.ts b/src/app/centers/centers-view/center-actions/center-attendance/center-attendance.component.spec.ts index 9d8296171..c2943f30a 100644 --- a/src/app/centers/centers-view/center-actions/center-attendance/center-attendance.component.spec.ts +++ b/src/app/centers/centers-view/center-actions/center-attendance/center-attendance.component.spec.ts @@ -8,9 +8,8 @@ describe('CenterAttendanceComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CenterAttendanceComponent ] - }) - .compileComponents(); + declarations: [CenterAttendanceComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/center-actions/center-attendance/center-attendance.component.ts b/src/app/centers/centers-view/center-actions/center-attendance/center-attendance.component.ts index 928f8a5eb..8945edcb1 100644 --- a/src/app/centers/centers-view/center-actions/center-attendance/center-attendance.component.ts +++ b/src/app/centers/centers-view/center-actions/center-attendance/center-attendance.component.ts @@ -26,7 +26,6 @@ import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base'; styleUrls: ['./center-attendance.component.scss'] }) export class CenterAttendanceComponent implements OnInit { - /** Members data. */ membersData: any; /** Center Data */ @@ -34,7 +33,10 @@ export class CenterAttendanceComponent implements OnInit { /** Attendance Type Options */ attendanceTypeOptions: any; /** Columns to be displayed in member's attendance table. */ - displayedColumns: string[] = ['name', 'attendance']; + displayedColumns: string[] = [ + 'name', + 'attendance' + ]; /** Start Date Form Control */ meetingDate = new UntypedFormControl(); /** Meeting Dates Data */ @@ -55,14 +57,16 @@ export class CenterAttendanceComponent implements OnInit { * @param {SettingsService} settingsService Settings Service. * @param {MatDialog} dialog Mat Dialog */ - constructor(private route: ActivatedRoute, - private dateUtils: Dates, - private router: Router, - private centersService: CentersService, - private settingsService: SettingsService, - public dialog: MatDialog, - private translateService: TranslateService) { - this.route.data.subscribe(( data: { centersActionData: any }) => { + constructor( + private route: ActivatedRoute, + private dateUtils: Dates, + private router: Router, + private centersService: CentersService, + private settingsService: SettingsService, + public dialog: MatDialog, + private translateService: TranslateService + ) { + this.route.data.subscribe((data: { centersActionData: any }) => { this.centerData = data.centersActionData; this.membersData = data.centersActionData.clients; }); @@ -76,8 +80,9 @@ export class CenterAttendanceComponent implements OnInit { if (this.membersData !== undefined && this.membersData !== null) { this.dataSource = this.membersData.map((member: any) => ({ clientId: member.id, attendanceType: 1 })); } - this.meetingDates = this.centerData.collectionMeetingCalendar.recurringDates - .filter((date: any) => new Date(date).getTime() < new Date().getTime()); + this.meetingDates = this.centerData.collectionMeetingCalendar.recurringDates.filter( + (date: any) => new Date(date).getTime() < new Date().getTime() + ); this.getAttendanceOptions(); } @@ -85,7 +90,8 @@ export class CenterAttendanceComponent implements OnInit { * Gets attendance type options based on calendar id. */ getAttendanceOptions() { - this.centersService.getMeetingsTemplate(this.centerData.id, this.centerData.collectionMeetingCalendar.id) + this.centersService + .getMeetingsTemplate(this.centerData.id, this.centerData.collectionMeetingCalendar.id) .subscribe((response: any) => { this.attendanceTypeOptions = response.attendanceTypeOptions; }); @@ -103,10 +109,14 @@ export class CenterAttendanceComponent implements OnInit { value: member.attendanceType, options: { label: 'value', value: 'id', data: this.attendanceTypeOptions }, required: false - }), + }) + ]; const data = { - title: this.translateService.instant('labels.buttons.Assign Member') + ' ' + this.translateService.instant('labels.buttons.Attendance'), + title: + this.translateService.instant('labels.buttons.Assign Member') + + ' ' + + this.translateService.instant('labels.buttons.Attendance'), layout: { addButtonText: 'Confirm' }, formfields: formfields }; @@ -135,9 +145,10 @@ export class CenterAttendanceComponent implements OnInit { dateFormat, locale }; - this.centersService.assignCenterAttendance(this.centerData.id, this.centerData.collectionMeetingCalendar.id, data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.centersService + .assignCenterAttendance(this.centerData.id, this.centerData.collectionMeetingCalendar.id, data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/centers/centers-view/center-actions/close-center/close-center.component.spec.ts b/src/app/centers/centers-view/center-actions/close-center/close-center.component.spec.ts index 5ed013b77..1fb004d68 100644 --- a/src/app/centers/centers-view/center-actions/close-center/close-center.component.spec.ts +++ b/src/app/centers/centers-view/center-actions/close-center/close-center.component.spec.ts @@ -8,9 +8,8 @@ describe('CloseCenterComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CloseCenterComponent ] - }) - .compileComponents(); + declarations: [CloseCenterComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/center-actions/close-center/close-center.component.ts b/src/app/centers/centers-view/center-actions/close-center/close-center.component.ts index 97c4b5bdc..646b666d4 100644 --- a/src/app/centers/centers-view/center-actions/close-center/close-center.component.ts +++ b/src/app/centers/centers-view/center-actions/close-center/close-center.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./close-center.component.scss'] }) export class CloseCenterComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -37,12 +36,14 @@ export class CloseCenterComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private centersService: CentersService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private centersService: CentersService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { centeractionData: any }) => { this.closureData = data.centeractionData.closureReasons; }); @@ -59,8 +60,14 @@ export class CloseCenterComponent implements OnInit { */ createCloseCenterForm() { this.closeCenterForm = this.formBuilder.group({ - 'closureDate': ['', Validators.required], - 'closureReasonId': ['', Validators.required] + closureDate: [ + '', + Validators.required + ], + closureReasonId: [ + '', + Validators.required + ] }); } @@ -84,5 +91,4 @@ export class CloseCenterComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/centers/centers-view/center-actions/edit-center-meeting-schedule/edit-center-meeting-schedule.component.spec.ts b/src/app/centers/centers-view/center-actions/edit-center-meeting-schedule/edit-center-meeting-schedule.component.spec.ts index 7229175f8..f2b34a77a 100644 --- a/src/app/centers/centers-view/center-actions/edit-center-meeting-schedule/edit-center-meeting-schedule.component.spec.ts +++ b/src/app/centers/centers-view/center-actions/edit-center-meeting-schedule/edit-center-meeting-schedule.component.spec.ts @@ -8,9 +8,8 @@ describe('EditCenterMeetingScheduleComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditCenterMeetingScheduleComponent ] - }) - .compileComponents(); + declarations: [EditCenterMeetingScheduleComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/center-actions/edit-center-meeting-schedule/edit-center-meeting-schedule.component.ts b/src/app/centers/centers-view/center-actions/edit-center-meeting-schedule/edit-center-meeting-schedule.component.ts index 213779459..99162b8d6 100644 --- a/src/app/centers/centers-view/center-actions/edit-center-meeting-schedule/edit-center-meeting-schedule.component.ts +++ b/src/app/centers/centers-view/center-actions/edit-center-meeting-schedule/edit-center-meeting-schedule.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-center-meeting-schedule.component.scss'] }) export class EditCenterMeetingScheduleComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -42,12 +41,14 @@ export class EditCenterMeetingScheduleComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private centersService: CentersService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private centersService: CentersService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { centersActionData: any }) => { this.calendarTemplate = data.centersActionData; this.nextMeetingDates = this.calendarTemplate.nextTenRecurringDates; @@ -66,8 +67,14 @@ export class EditCenterMeetingScheduleComponent implements OnInit { */ createEditMeetingScheduleForm() { this.centerEditMeetingScheduleForm = this.formBuilder.group({ - 'presentMeetingDate': ['', Validators.required], - 'newMeetingDate': ['', Validators.required] + presentMeetingDate: [ + '', + Validators.required + ], + newMeetingDate: [ + '', + Validators.required + ] }); } @@ -97,5 +104,4 @@ export class EditCenterMeetingScheduleComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/centers/centers-view/center-actions/edit-center-meeting/edit-center-meeting.component.spec.ts b/src/app/centers/centers-view/center-actions/edit-center-meeting/edit-center-meeting.component.spec.ts index 1d6f35f02..100af2b43 100644 --- a/src/app/centers/centers-view/center-actions/edit-center-meeting/edit-center-meeting.component.spec.ts +++ b/src/app/centers/centers-view/center-actions/edit-center-meeting/edit-center-meeting.component.spec.ts @@ -8,9 +8,8 @@ describe('EditCenterMeetingComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditCenterMeetingComponent ] - }) - .compileComponents(); + declarations: [EditCenterMeetingComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/center-actions/edit-center-meeting/edit-center-meeting.component.ts b/src/app/centers/centers-view/center-actions/edit-center-meeting/edit-center-meeting.component.ts index 2483b75d0..91684c089 100644 --- a/src/app/centers/centers-view/center-actions/edit-center-meeting/edit-center-meeting.component.ts +++ b/src/app/centers/centers-view/center-actions/edit-center-meeting/edit-center-meeting.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-center-meeting.component.scss'] }) export class EditCenterMeetingComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -46,12 +45,14 @@ export class EditCenterMeetingComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private centersService: CentersService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private centersService: CentersService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { centersActionData: any }) => { this.calendarTemplate = data.centersActionData; this.frequencyOptions = this.calendarTemplate.frequencyOptions; @@ -72,9 +73,18 @@ export class EditCenterMeetingComponent implements OnInit { */ createEditCenterMeetingForm() { this.centerEditMeetingForm = this.formBuilder.group({ - 'startDate': ['', Validators.required], - 'frequency': ['', Validators.required], - 'interval': ['', Validators.required] + startDate: [ + '', + Validators.required + ], + frequency: [ + '', + Validators.required + ], + interval: [ + '', + Validators.required + ] }); } @@ -86,25 +96,51 @@ export class EditCenterMeetingComponent implements OnInit { this.centerEditMeetingForm.removeControl('repeatsOnDay'); switch (frequency) { case 1: // Daily - this.repetitionIntervals = ['1', '2', '3']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3' + ]; + break; case 2: // Weekly - this.repetitionIntervals = ['1', '2', '3']; + this.repetitionIntervals = [ + '1', + '2', + '3' + ]; this.centerEditMeetingForm.addControl('repeatsOnDay', new UntypedFormControl('', Validators.required)); this.centerEditMeetingForm.get('repeatsOnDay').patchValue(this.calendarTemplate.repeatsOnDay.id); - break; + break; case 3: // Monthly - this.repetitionIntervals = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '10', + '11' + ]; + break; case 4: // Yearly - this.repetitionIntervals = ['1', '2', '3', '4', '5']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3', + '4', + '5' + ]; + break; } }); this.centerEditMeetingForm.patchValue({ - 'startDate': this.calendarTemplate.startDate && new Date(this.calendarTemplate.startDate), - 'frequency': this.calendarTemplate.frequency.id, - 'interval': `${this.calendarTemplate.interval}` + startDate: this.calendarTemplate.startDate && new Date(this.calendarTemplate.startDate), + frequency: this.calendarTemplate.frequency.id, + interval: `${this.calendarTemplate.interval}` }); } @@ -141,5 +177,4 @@ export class EditCenterMeetingComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/centers/centers-view/center-actions/manage-groups/manage-groups.component.spec.ts b/src/app/centers/centers-view/center-actions/manage-groups/manage-groups.component.spec.ts index 1b5dbdf38..4dfb55862 100644 --- a/src/app/centers/centers-view/center-actions/manage-groups/manage-groups.component.spec.ts +++ b/src/app/centers/centers-view/center-actions/manage-groups/manage-groups.component.spec.ts @@ -8,9 +8,8 @@ describe('ManageGroupsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ManageGroupsComponent ] - }) - .compileComponents(); + declarations: [ManageGroupsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/center-actions/manage-groups/manage-groups.component.ts b/src/app/centers/centers-view/center-actions/manage-groups/manage-groups.component.ts index 254b8cd16..a02eeb639 100644 --- a/src/app/centers/centers-view/center-actions/manage-groups/manage-groups.component.ts +++ b/src/app/centers/centers-view/center-actions/manage-groups/manage-groups.component.ts @@ -11,14 +11,12 @@ import { CentersService } from 'app/centers/centers.service'; import { GroupsService } from 'app/groups/groups.service'; import { MatDialog } from '@angular/material/dialog'; - @Component({ selector: 'mifosx-manage-groups', templateUrl: './manage-groups.component.html', styleUrls: ['./manage-groups.component.scss'] }) export class ManageGroupsComponent implements AfterViewInit { - /** Center Data */ centerData: any; /** Group data. */ @@ -35,24 +33,26 @@ export class ManageGroupsComponent implements AfterViewInit { * @param {GroupsService} groupsService Groups Service * @param {MatDialog} dialog Mat Dialog */ - constructor(private route: ActivatedRoute, - private centersService: CentersService, - private groupsService: GroupsService, - public dialog: MatDialog) { + constructor( + private route: ActivatedRoute, + private centersService: CentersService, + private groupsService: GroupsService, + public dialog: MatDialog + ) { this.route.data.subscribe((data: { centersActionData: any }) => { this.centerData = data.centersActionData; this.groupMembers = data.centersActionData.groupMembers; }); } - /** * Subscribes to Groups search filter: */ ngAfterViewInit() { - this.groupChoice.valueChanges.subscribe( (value: string) => { + this.groupChoice.valueChanges.subscribe((value: string) => { if (value.length >= 2) { - this.groupsService.getFilteredGroups('name', 'ASC', value, this.centerData.officeId, 'true') + this.groupsService + .getFilteredGroups('name', 'ASC', value, this.centerData.officeId, 'true') .subscribe((data: any) => { this.groupsData = data; }); @@ -66,12 +66,22 @@ export class ManageGroupsComponent implements AfterViewInit { addGroup() { if (this.groupMembers !== null && this.groupMembers !== undefined) { if (!this.groupMembers.includes(this.groupChoice.value)) { - this.centersService.executeCenterActionCommand(this.centerData.id, 'associateGroups', {groupMembers: [this.groupChoice.value.id]}) - .subscribe(() => { this.groupMembers.push(this.groupChoice.value); }); + this.centersService + .executeCenterActionCommand(this.centerData.id, 'associateGroups', { + groupMembers: [this.groupChoice.value.id] + }) + .subscribe(() => { + this.groupMembers.push(this.groupChoice.value); + }); } } else { - this.centersService.executeCenterActionCommand(this.centerData.id, 'associateGroups', {groupMembers: [this.groupChoice.value.id]}) - .subscribe(() => { this.groupMembers.push(this.groupChoice.value); }); + this.centersService + .executeCenterActionCommand(this.centerData.id, 'associateGroups', { + groupMembers: [this.groupChoice.value.id] + }) + .subscribe(() => { + this.groupMembers.push(this.groupChoice.value); + }); } } @@ -85,8 +95,11 @@ export class ManageGroupsComponent implements AfterViewInit { }); removeMemberDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.centersService.executeCenterActionCommand(this.centerData.id, 'disassociateGroups', {groupMembers: [group.id]}) - .subscribe(() => { this.groupMembers.splice(index, 1); }); + this.centersService + .executeCenterActionCommand(this.centerData.id, 'disassociateGroups', { groupMembers: [group.id] }) + .subscribe(() => { + this.groupMembers.splice(index, 1); + }); } }); } @@ -99,5 +112,4 @@ export class ManageGroupsComponent implements AfterViewInit { displayGroup(group: any): string | undefined { return group ? group.name : undefined; } - } diff --git a/src/app/centers/centers-view/center-actions/staff-assignment-history/staff-assignment-history.component.spec.ts b/src/app/centers/centers-view/center-actions/staff-assignment-history/staff-assignment-history.component.spec.ts index e5e617604..0dd3bee99 100644 --- a/src/app/centers/centers-view/center-actions/staff-assignment-history/staff-assignment-history.component.spec.ts +++ b/src/app/centers/centers-view/center-actions/staff-assignment-history/staff-assignment-history.component.spec.ts @@ -8,9 +8,8 @@ describe('StaffAssignmentHistoryComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ StaffAssignmentHistoryComponent ] - }) - .compileComponents(); + declarations: [StaffAssignmentHistoryComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/center-actions/staff-assignment-history/staff-assignment-history.component.ts b/src/app/centers/centers-view/center-actions/staff-assignment-history/staff-assignment-history.component.ts index 4ed270d16..ba43d9a5a 100644 --- a/src/app/centers/centers-view/center-actions/staff-assignment-history/staff-assignment-history.component.ts +++ b/src/app/centers/centers-view/center-actions/staff-assignment-history/staff-assignment-history.component.ts @@ -15,7 +15,6 @@ import { CentersService } from '../../../centers.service'; styleUrls: ['./staff-assignment-history.component.scss'] }) export class StaffAssignmentHistoryComponent implements OnInit { - /** Staff Assignment History Data */ staffAssignmentHistoryData: any; /** trusted resource url for pentaho output */ @@ -24,8 +23,10 @@ export class StaffAssignmentHistoryComponent implements OnInit { /** * @param {DomSanitizer} sanitizer DOM Sanitizer */ - constructor(private sanitizer: DomSanitizer, - private route: ActivatedRoute) { + constructor( + private sanitizer: DomSanitizer, + private route: ActivatedRoute + ) { this.route.data.subscribe((data: { centersActionData: any }) => { this.staffAssignmentHistoryData = data.centersActionData; }); @@ -37,5 +38,4 @@ export class StaffAssignmentHistoryComponent implements OnInit { const filecontent = URL.createObjectURL(file); this.pentahoUrl = this.sanitizer.bypassSecurityTrustResourceUrl(filecontent); } - } diff --git a/src/app/centers/centers-view/centers-view.component.spec.ts b/src/app/centers/centers-view/centers-view.component.spec.ts index dad47f80c..d0d46083d 100644 --- a/src/app/centers/centers-view/centers-view.component.spec.ts +++ b/src/app/centers/centers-view/centers-view.component.spec.ts @@ -8,9 +8,8 @@ describe('CentersViewComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CentersViewComponent ] - }) - .compileComponents(); + declarations: [CentersViewComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/centers-view.component.ts b/src/app/centers/centers-view/centers-view.component.ts index 233aa8e59..ba7575907 100644 --- a/src/app/centers/centers-view/centers-view.component.ts +++ b/src/app/centers/centers-view/centers-view.component.ts @@ -19,7 +19,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./centers-view.component.scss'] }) export class CentersViewComponent implements OnInit { - /** Stores Center View Data */ centerViewData: any; /** Center datatable */ @@ -31,15 +30,14 @@ export class CentersViewComponent implements OnInit { * Retrieves the data for center * @param route route Activated Route. */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, public dialog: MatDialog, public centersService: CentersService, - private translateService: TranslateService) { - this.route.data.subscribe((data: { - centerViewData: any, - centerDatatables: any - }) => { + private translateService: TranslateService + ) { + this.route.data.subscribe((data: { centerViewData: any; centerDatatables: any }) => { this.centerViewData = data.centerViewData; this.centerDatatables = data.centerDatatables; }); @@ -48,7 +46,9 @@ export class CentersViewComponent implements OnInit { ngOnInit() { if (this.centerViewData.collectionMeetingCalendar) { this.meetingData = true; - } else { this.meetingData = false; } + } else { + this.meetingData = false; + } } /** @@ -99,11 +99,15 @@ export class CentersViewComponent implements OnInit { */ private centersUnassignStaff() { const unAssignStaffDialogRef = this.dialog.open(ConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Unassign Staff'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want Unassign Staff') } + data: { + heading: this.translateService.instant('labels.heading.Unassign Staff'), + dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want Unassign Staff') + } }); unAssignStaffDialogRef.afterClosed().subscribe((response: { confirm: any }) => { if (response.confirm) { - this.centersService.executeGroupActionCommand(this.centerViewData.id, 'unassignStaff', { staffId: this.centerViewData.staffId }) + this.centersService + .executeGroupActionCommand(this.centerViewData.id, 'unassignStaff', { staffId: this.centerViewData.staffId }) .subscribe(() => { this.reload(); }); @@ -133,8 +137,6 @@ export class CentersViewComponent implements OnInit { */ reload() { const url: string = this.router.url; - this.router.navigateByUrl(`/centers`, { skipLocationChange: true }) - .then(() => this.router.navigate([url])); + this.router.navigateByUrl(`/centers`, { skipLocationChange: true }).then(() => this.router.navigate([url])); } - } diff --git a/src/app/centers/centers-view/datatable-tab/datatable-tab.component.spec.ts b/src/app/centers/centers-view/datatable-tab/datatable-tab.component.spec.ts index 1f409cd4e..c2f4a85fd 100644 --- a/src/app/centers/centers-view/datatable-tab/datatable-tab.component.spec.ts +++ b/src/app/centers/centers-view/datatable-tab/datatable-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('DatatableTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DatatableTabComponent ] - }) - .compileComponents(); + declarations: [DatatableTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/datatable-tab/datatable-tab.component.ts b/src/app/centers/centers-view/datatable-tab/datatable-tab.component.ts index f7351080b..d995eb47b 100644 --- a/src/app/centers/centers-view/datatable-tab/datatable-tab.component.ts +++ b/src/app/centers/centers-view/datatable-tab/datatable-tab.component.ts @@ -25,5 +25,4 @@ export class DatatableTabComponent { this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); } - } diff --git a/src/app/centers/centers-view/general-tab/general-tab.component.spec.ts b/src/app/centers/centers-view/general-tab/general-tab.component.spec.ts index 68ff6503e..53d6cbc31 100644 --- a/src/app/centers/centers-view/general-tab/general-tab.component.spec.ts +++ b/src/app/centers/centers-view/general-tab/general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GeneralTabComponent ] - }) - .compileComponents(); + declarations: [GeneralTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/general-tab/general-tab.component.ts b/src/app/centers/centers-view/general-tab/general-tab.component.ts index 717602574..2135ae253 100644 --- a/src/app/centers/centers-view/general-tab/general-tab.component.ts +++ b/src/app/centers/centers-view/general-tab/general-tab.component.ts @@ -11,11 +11,20 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./general-tab.component.scss'] }) export class GeneralTabComponent { - /** Savings Account Table Columns */ - savingsAccountColumns: string[] = ['Account No', 'Products', 'Balance', 'Actions']; + savingsAccountColumns: string[] = [ + 'Account No', + 'Products', + 'Balance', + 'Actions' + ]; /** Groups Table Columns */ - groupsColumns: string[] = ['Account No', 'Group Name', 'Office Name', 'Submitted On']; + groupsColumns: string[] = [ + 'Account No', + 'Group Name', + 'Office Name', + 'Submitted On' + ]; /** Stores the summary of center */ centerSummaryData: any; /** Stores Center Data for particular center */ @@ -30,11 +39,7 @@ export class GeneralTabComponent { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe((data: { - centerSummaryData: any, - centerViewData: any, - savingsAccountData: any - }) => { + this.route.data.subscribe((data: { centerSummaryData: any; centerViewData: any; savingsAccountData: any }) => { this.centerSummaryData = data.centerSummaryData[0]; this.centerViewData = data.centerViewData; this.savingsAccountData = data.savingsAccountData.savingsAccounts; @@ -49,5 +54,4 @@ export class GeneralTabComponent { routeEdit($event: MouseEvent) { $event.stopPropagation(); } - } diff --git a/src/app/centers/centers-view/notes-tab/notes-tab.component.spec.ts b/src/app/centers/centers-view/notes-tab/notes-tab.component.spec.ts index add42af72..338a5d831 100644 --- a/src/app/centers/centers-view/notes-tab/notes-tab.component.spec.ts +++ b/src/app/centers/centers-view/notes-tab/notes-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('NotesTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ NotesTabComponent ] - }) - .compileComponents(); + declarations: [NotesTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/centers-view/notes-tab/notes-tab.component.ts b/src/app/centers/centers-view/notes-tab/notes-tab.component.ts index afe933037..1abec8532 100644 --- a/src/app/centers/centers-view/notes-tab/notes-tab.component.ts +++ b/src/app/centers/centers-view/notes-tab/notes-tab.component.ts @@ -24,13 +24,14 @@ export class NotesTabComponent implements OnInit { noteForm: UntypedFormGroup; @ViewChild('formRef', { static: true }) formRef: any; - - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private formBuilder: UntypedFormBuilder, private centersService: CentersService, private authenticationService: AuthenticationService, private dialog: MatDialog, - private translateService: TranslateService) { + private translateService: TranslateService + ) { const savedCredentials = this.authenticationService.getCredentials(); this.username = savedCredentials.username; this.centerId = this.route.parent.snapshot.params['centerId']; @@ -45,7 +46,10 @@ export class NotesTabComponent implements OnInit { createNoteForm() { this.noteForm = this.formBuilder.group({ - 'note': ['', Validators.required] + note: [ + '', + Validators.required + ] }); } @@ -63,19 +67,22 @@ export class NotesTabComponent implements OnInit { editNote(noteId: string, noteContent: string, index: number) { const editNoteDialogRef = this.dialog.open(FormDialogComponent, { - data: { formfields: [{ - controlName: 'note', - required: true, - value: noteContent, - controlType: 'input', - label: this.translateService.instant('labels.inputs.Note') - }], - layout: { - columns: 1, - addButtonText: 'Confirm' - }, - title: this.translateService.instant('labels.heading.Edit Note') - } + data: { + formfields: [ + { + controlName: 'note', + required: true, + value: noteContent, + controlType: 'input', + label: this.translateService.instant('labels.inputs.Note') + } + ], + layout: { + columns: 1, + addButtonText: 'Confirm' + }, + title: this.translateService.instant('labels.heading.Edit Note') + } }); editNoteDialogRef.afterClosed().subscribe((response: any) => { if (response.data) { @@ -88,14 +95,15 @@ export class NotesTabComponent implements OnInit { deleteNote(noteId: string, index: number) { const deleteNoteDialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: `${this.translateService.instant('labels.inputs.Note')} ${this.translateService.instant('labels.inputs.Id')}:${noteId}` } + data: { + deleteContext: `${this.translateService.instant('labels.inputs.Note')} ${this.translateService.instant('labels.inputs.Id')}:${noteId}` + } }); deleteNoteDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.centersService.deleteCenterNote(this.centerId, noteId) - .subscribe(() => { - this.centerNotes.splice(index, 1); - }); + this.centersService.deleteCenterNote(this.centerId, noteId).subscribe(() => { + this.centerNotes.splice(index, 1); + }); } }); } diff --git a/src/app/centers/centers.component.ts b/src/app/centers/centers.component.ts index 2e6b39885..204b48ccd 100644 --- a/src/app/centers/centers.component.ts +++ b/src/app/centers/centers.component.ts @@ -8,7 +8,7 @@ import { Router, ActivatedRoute } from '@angular/router'; /** rxjs Imports */ import { merge } from 'rxjs'; -import { tap, startWith, map, distinctUntilChanged, debounceTime} from 'rxjs/operators'; +import { tap, startWith, map, distinctUntilChanged, debounceTime } from 'rxjs/operators'; /** Custom Services */ import { CentersService } from './centers.service'; @@ -22,7 +22,7 @@ import { CentersDataSource } from './centers.datasource'; @Component({ selector: 'mifosx-app-centers', templateUrl: './centers.component.html', - styleUrls: ['./centers.component.scss'], + styleUrls: ['./centers.component.scss'] }) export class CentersComponent implements OnInit, AfterViewInit { @ViewChild('showClosedCenters', { static: true }) showClosedCenters: MatCheckbox; @@ -32,7 +32,13 @@ export class CentersComponent implements OnInit, AfterViewInit { /** ExternalId form control. */ externalId = new UntypedFormControl(); /** Columns to be displayed in centers table. */ - displayedColumns = ['name', 'accountNo', 'externalId', 'status', 'officeName']; + displayedColumns = [ + 'name', + 'accountNo', + 'externalId', + 'status', + 'officeName' + ]; /** Data source for centers table. */ dataSource: CentersDataSource; /** Centers filter. */ @@ -52,7 +58,7 @@ export class CentersComponent implements OnInit, AfterViewInit { /** Sorter for centers table. */ @ViewChild(MatSort, { static: true }) sort: MatSort; - constructor(private centersService: CentersService) { } + constructor(private centersService: CentersService) {} ngOnInit() { this.getCenters(); @@ -64,7 +70,6 @@ export class CentersComponent implements OnInit, AfterViewInit { * sort change and page change. */ ngAfterViewInit() { - this.name.valueChanges .pipe( debounceTime(500), @@ -76,21 +81,19 @@ export class CentersComponent implements OnInit, AfterViewInit { .subscribe(); this.externalId.valueChanges - .pipe( - debounceTime(500), - distinctUntilChanged(), - tap((filterValue) => { - this.applyFilter(filterValue, 'externalId'); - }) - ) - .subscribe(); + .pipe( + debounceTime(500), + distinctUntilChanged(), + tap((filterValue) => { + this.applyFilter(filterValue, 'externalId'); + }) + ) + .subscribe(); - this.sort.sortChange.subscribe(() => this.paginator.pageIndex = 0); + this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0)); merge(this.sort.sortChange, this.paginator.page) - .pipe( - tap(() => this.loadCentersPage()) - ) + .pipe(tap(() => this.loadCentersPage())) .subscribe(); } @@ -108,7 +111,14 @@ export class CentersComponent implements OnInit, AfterViewInit { if (!this.sort.direction) { delete this.sort.active; } - this.dataSource.getCenters(this.filterCentersBy, this.sort.active, this.sort.direction, this.paginator.pageIndex, this.paginator.pageSize, !this.showClosedCenters.checked); + this.dataSource.getCenters( + this.filterCentersBy, + this.sort.active, + this.sort.direction, + this.paginator.pageIndex, + this.paginator.pageSize, + !this.showClosedCenters.checked + ); } /** @@ -118,7 +128,7 @@ export class CentersComponent implements OnInit, AfterViewInit { */ applyFilter(filterValue: string, property: string) { this.paginator.pageIndex = 0; - const findIndex = this.filterCentersBy.findIndex(filter => filter.type === property); + const findIndex = this.filterCentersBy.findIndex((filter) => filter.type === property); this.filterCentersBy[findIndex].value = filterValue; this.loadCentersPage(); } @@ -128,7 +138,12 @@ export class CentersComponent implements OnInit, AfterViewInit { */ getCenters() { this.dataSource = new CentersDataSource(this.centersService); - this.dataSource.getCenters(this.filterCentersBy, this.sort.active, this.sort.direction, this.paginator.pageIndex, this.paginator.pageSize); + this.dataSource.getCenters( + this.filterCentersBy, + this.sort.active, + this.sort.direction, + this.paginator.pageIndex, + this.paginator.pageSize + ); } - } diff --git a/src/app/centers/centers.datasource.ts b/src/app/centers/centers.datasource.ts index 9e9304aed..42e19092f 100644 --- a/src/app/centers/centers.datasource.ts +++ b/src/app/centers/centers.datasource.ts @@ -11,7 +11,6 @@ import { CentersService } from './centers.service'; * Centers custom data source to implement server side filtering, pagination and sorting. */ export class CentersDataSource implements DataSource { - /** centers behavior subject to represent loaded centers page. */ private centersSubject = new BehaviorSubject([]); /** Records subject to represent total number of filtered centers records. */ @@ -22,7 +21,7 @@ export class CentersDataSource implements DataSource { /** * @param {CentersService} centersService Centers Service */ - constructor(private centersService: CentersService) { } + constructor(private centersService: CentersService) {} /** * Gets centers on the basis of provided parameters and emits the value. @@ -33,14 +32,20 @@ export class CentersDataSource implements DataSource { * @param {number} limit Number of entries within the page. * @param {boolean} centerActive Specify whether to only filter active centers. */ - getCenters(filterBy: any, orderBy: string = '', sortOrder: string = '', pageIndex: number = 0, limit: number = 10, centerActive: boolean = true) { + getCenters( + filterBy: any, + orderBy: string = '', + sortOrder: string = '', + pageIndex: number = 0, + limit: number = 10, + centerActive: boolean = true + ) { this.centersSubject.next([]); - this.centersService.getCenters(filterBy, orderBy, sortOrder, pageIndex * limit, limit) - .subscribe((centers: any) => { - centers.pageItems = (centerActive) ? (centers.pageItems.filter((center: any) => center.active)) : centers.pageItems; - this.recordsSubject.next(centers.totalFilteredRecords); - this.centersSubject.next(centers.pageItems); - }); + this.centersService.getCenters(filterBy, orderBy, sortOrder, pageIndex * limit, limit).subscribe((centers: any) => { + centers.pageItems = centerActive ? centers.pageItems.filter((center: any) => center.active) : centers.pageItems; + this.recordsSubject.next(centers.totalFilteredRecords); + this.centersSubject.next(centers.pageItems); + }); } /** @@ -57,5 +62,4 @@ export class CentersDataSource implements DataSource { this.centersSubject.complete(); this.recordsSubject.complete(); } - } diff --git a/src/app/centers/centers.module.ts b/src/app/centers/centers.module.ts index eb6a0089e..05ee46b3b 100644 --- a/src/app/centers/centers.module.ts +++ b/src/app/centers/centers.module.ts @@ -58,4 +58,4 @@ import { EditCenterComponent } from './edit-center/edit-center.component'; EditCenterComponent ] }) -export class CentersModule { } +export class CentersModule {} diff --git a/src/app/centers/centers.service.ts b/src/app/centers/centers.service.ts index ee895c509..563804226 100644 --- a/src/app/centers/centers.service.ts +++ b/src/app/centers/centers.service.ts @@ -9,14 +9,13 @@ import { Observable } from 'rxjs'; * Clients service. */ @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class CentersService { - /** * @param {HttpClient} http Http Client to send requests. */ - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * @param {any} filterBy Properties by which entries should be filtered. @@ -47,7 +46,7 @@ export class CentersService { * @returns {Observable} */ createCenter(center: any): Observable { - return this.http.post('/centers', center); + return this.http.post('/centers', center); } /** @@ -55,10 +54,8 @@ export class CentersService { * @returns {Observable} */ getStaff(officeId: number): Observable { - const httpParams = new HttpParams() - .set('officeId', officeId.toString()) - .set('staffInSelectedOfficeOnly', 'true'); - return this.http.get('/centers/template', { params: httpParams }); + const httpParams = new HttpParams().set('officeId', officeId.toString()).set('staffInSelectedOfficeOnly', 'true'); + return this.http.get('/centers/template', { params: httpParams }); } /** @@ -66,9 +63,8 @@ export class CentersService { * @returns {Observable} Group Data for Center */ getCenterData(centerId: string): Observable { - const httpParams = new HttpParams() - .set('associations', 'groupMembers,collectionMeetingCalendar'); - return this.http.get(`/centers/${centerId}`, { params: httpParams } ); + const httpParams = new HttpParams().set('associations', 'groupMembers,collectionMeetingCalendar'); + return this.http.get(`/centers/${centerId}`, { params: httpParams }); } /** @@ -76,8 +72,7 @@ export class CentersService { * @returns {Observable} Returns the entire details of the Center ID */ getCenterSummary(centerId: string): Observable { - const httpParams = new HttpParams().set('R_groupId', centerId) - .set('genericResultSet', 'false'); + const httpParams = new HttpParams().set('R_groupId', centerId).set('genericResultSet', 'false'); return this.http.get(`/runreports/GroupSummaryCounts`, { params: httpParams }); } @@ -131,7 +126,7 @@ export class CentersService { */ getcenterDatatables() { const httpParams = new HttpParams().set('apptable', 'm_center'); - return this.http.get(`/datatables`, { params: httpParams }); + return this.http.get(`/datatables`, { params: httpParams }); } /** @@ -203,9 +198,10 @@ export class CentersService { * @returns {Observable} Center data. */ getGroupStaffData(centerId: string): Observable { - const httpParams = new HttpParams().set('groupOrCenter', 'centers') - .set('staffInSelectedOfficeOnly', 'true') - .set('template', 'true'); + const httpParams = new HttpParams() + .set('groupOrCenter', 'centers') + .set('staffInSelectedOfficeOnly', 'true') + .set('template', 'true'); return this.http.get(`/groups/${centerId}`, { params: httpParams }); } @@ -216,7 +212,7 @@ export class CentersService { getCentersData(centerId: string, associations: string, template?: string) { let httpParams = new HttpParams().set('associations', associations); httpParams = template ? httpParams.set('template', template) : httpParams; - return this.http.get(`/centers/${centerId}`, {params: httpParams}); + return this.http.get(`/centers/${centerId}`, { params: httpParams }); } getMeetingsTemplate(centerId: any, calendarId: any): Observable { @@ -226,7 +222,7 @@ export class CentersService { assignCenterAttendance(centerId: any, calendarId: any, data: any): Observable { const httpParams = new HttpParams().set('calenderId', calendarId); - return this.http.post(`/centers/${centerId}/meetings`, data, {params: httpParams}); + return this.http.post(`/centers/${centerId}/meetings`, data, { params: httpParams }); } getCalendarTemplate(centerId: any): Observable { @@ -252,12 +248,21 @@ export class CentersService { * @param {object} centerId CenterId. * @returns {Observable} */ - getStaffAssignmentHistoryData(reportName: any, centerId: any, tenantIdentifier: string, locale: string): Observable { + getStaffAssignmentHistoryData( + reportName: any, + centerId: any, + tenantIdentifier: string, + locale: string + ): Observable { const httpParams = new HttpParams() .set('tenantIdentifier', tenantIdentifier) .set('locale', locale) .set('R_centerId', centerId); - return this.http.get(`/runreports/${reportName}`, { responseType: 'arraybuffer', observe: 'response', params: httpParams }); + return this.http.get(`/runreports/${reportName}`, { + responseType: 'arraybuffer', + observe: 'response', + params: httpParams + }); } /** @@ -265,8 +270,7 @@ export class CentersService { * @returns {Observable} Center data and template. */ getCenterAndTemplateData(centerId: string): Observable { - const httpParams = new HttpParams().set('staffInSelectedOfficeOnly', 'true') - .set('template', 'true'); + const httpParams = new HttpParams().set('staffInSelectedOfficeOnly', 'true').set('template', 'true'); return this.http.get(`/centers/${centerId}`, { params: httpParams }); } @@ -278,5 +282,4 @@ export class CentersService { executeEditCenter(centerId: string, data: any): Observable { return this.http.put(`/groups/${centerId}`, data); } - } diff --git a/src/app/centers/common-resolvers/center-actions.resolver.ts b/src/app/centers/common-resolvers/center-actions.resolver.ts index cb8255116..8b7f4bac6 100644 --- a/src/app/centers/common-resolvers/center-actions.resolver.ts +++ b/src/app/centers/common-resolvers/center-actions.resolver.ts @@ -13,11 +13,10 @@ import { CentersService } from '../centers.service'; */ @Injectable() export class CenterActionsResolver implements Resolve { - /** * @param {CentersService} centersService Savings service. */ - constructor(private centersService: CentersService) { } + constructor(private centersService: CentersService) {} /** * Returns the Centers account actions data. @@ -46,5 +45,4 @@ export class CenterActionsResolver implements Resolve { return undefined; } } - } diff --git a/src/app/centers/common-resolvers/center-data-and-template.resolver.ts b/src/app/centers/common-resolvers/center-data-and-template.resolver.ts index b482d791a..0f3243e73 100644 --- a/src/app/centers/common-resolvers/center-data-and-template.resolver.ts +++ b/src/app/centers/common-resolvers/center-data-and-template.resolver.ts @@ -13,19 +13,17 @@ import { CentersService } from '../centers.service'; */ @Injectable() export class CenterDataAndTemplateResolver implements Resolve { + /** + * @param {CentersService} CentersService Centers service. + */ + constructor(private centersService: CentersService) {} - /** - * @param {CentersService} CentersService Centers service. - */ - constructor(private centersService: CentersService) { } - - /** - * Returns the Centers and template data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const centerId = route.parent.paramMap.get('centerId'); - return this.centersService.getCenterAndTemplateData(centerId); - } - + /** + * Returns the Centers and template data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const centerId = route.parent.paramMap.get('centerId'); + return this.centersService.getCenterAndTemplateData(centerId); + } } diff --git a/src/app/centers/common-resolvers/center-datatable.resolver.ts b/src/app/centers/common-resolvers/center-datatable.resolver.ts index ee4e39920..9dea92455 100644 --- a/src/app/centers/common-resolvers/center-datatable.resolver.ts +++ b/src/app/centers/common-resolvers/center-datatable.resolver.ts @@ -13,20 +13,18 @@ import { CentersService } from '../centers.service'; */ @Injectable() export class CenterDatatableResolver implements Resolve { + /** + * @param {CentersService} CentersService Centers service. + */ + constructor(private centersService: CentersService) {} - /** - * @param {CentersService} CentersService Centers service. - */ - constructor(private centersService: CentersService) { } - - /** - * Returns the Centers Notes Data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const centerId = route.parent.parent.paramMap.get('centerId'); - const datatableName = route.paramMap.get('datatableName'); - return this.centersService.getCenterDatatable(centerId, datatableName); - } - + /** + * Returns the Centers Notes Data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const centerId = route.parent.parent.paramMap.get('centerId'); + const datatableName = route.paramMap.get('datatableName'); + return this.centersService.getCenterDatatable(centerId, datatableName); + } } diff --git a/src/app/centers/common-resolvers/center-datatables.resolver.ts b/src/app/centers/common-resolvers/center-datatables.resolver.ts index 7a95b7c4c..e09c5b98a 100644 --- a/src/app/centers/common-resolvers/center-datatables.resolver.ts +++ b/src/app/centers/common-resolvers/center-datatables.resolver.ts @@ -13,18 +13,16 @@ import { CentersService } from '../centers.service'; */ @Injectable() export class CenterDatatablesResolver implements Resolve { + /** + * @param {centersService} centersService centers service. + */ + constructor(private centersService: CentersService) {} - /** - * @param {centersService} centersService centers service. - */ - constructor(private centersService: CentersService) { } - - /** - * Returns the center datatables. - * @returns {Observable} - */ - resolve(): Observable { - return this.centersService.getcenterDatatables(); - } - + /** + * Returns the center datatables. + * @returns {Observable} + */ + resolve(): Observable { + return this.centersService.getcenterDatatables(); + } } diff --git a/src/app/centers/common-resolvers/center-notes.resolver.ts b/src/app/centers/common-resolvers/center-notes.resolver.ts index 215618b2a..772147a79 100644 --- a/src/app/centers/common-resolvers/center-notes.resolver.ts +++ b/src/app/centers/common-resolvers/center-notes.resolver.ts @@ -13,19 +13,17 @@ import { CentersService } from '../centers.service'; */ @Injectable() export class CenterNotesResolver implements Resolve { + /** + * @param {CentersService} CentersService Centers service. + */ + constructor(private centersService: CentersService) {} - /** - * @param {CentersService} CentersService Centers service. - */ - constructor(private centersService: CentersService) { } - - /** - * Returns the Centers Notes Data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const centerId = route.parent.paramMap.get('centerId'); - return this.centersService.getCenterNotes(centerId); - } - + /** + * Returns the Centers Notes Data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const centerId = route.parent.paramMap.get('centerId'); + return this.centersService.getCenterNotes(centerId); + } } diff --git a/src/app/centers/common-resolvers/center-resource.resolver.ts b/src/app/centers/common-resolvers/center-resource.resolver.ts index a8ccbf89d..2cf7995e3 100644 --- a/src/app/centers/common-resolvers/center-resource.resolver.ts +++ b/src/app/centers/common-resolvers/center-resource.resolver.ts @@ -13,19 +13,17 @@ import { CentersService } from '../centers.service'; */ @Injectable() export class CenterResourceResolver implements Resolve { + /** + * @param {CentersService} CentersService Centers service. + */ + constructor(private centersService: CentersService) {} - /** - * @param {CentersService} CentersService Centers service. - */ - constructor(private centersService: CentersService) { } - - /** - * Returns the Centers data for General Tab. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const centerId = route.parent.paramMap.get('centerId'); - return this.centersService.getCenterData(centerId); - } - + /** + * Returns the Centers data for General Tab. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const centerId = route.parent.paramMap.get('centerId'); + return this.centersService.getCenterData(centerId); + } } diff --git a/src/app/centers/common-resolvers/center-summary.resolver.ts b/src/app/centers/common-resolvers/center-summary.resolver.ts index accf32410..c765567c2 100644 --- a/src/app/centers/common-resolvers/center-summary.resolver.ts +++ b/src/app/centers/common-resolvers/center-summary.resolver.ts @@ -13,19 +13,17 @@ import { CentersService } from '../centers.service'; */ @Injectable() export class CenterSummaryResolver implements Resolve { + /** + * @param {CentersService} CentersService Centers service. + */ + constructor(private centersService: CentersService) {} - /** - * @param {CentersService} CentersService Centers service. - */ - constructor(private centersService: CentersService) { } - - /** - * Returns the Centers Summary Data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const centerId = route.parent.paramMap.get('centerId'); - return this.centersService.getCenterSummary(centerId); - } - + /** + * Returns the Centers Summary Data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const centerId = route.parent.paramMap.get('centerId'); + return this.centersService.getCenterSummary(centerId); + } } diff --git a/src/app/centers/common-resolvers/center-view.resolver.ts b/src/app/centers/common-resolvers/center-view.resolver.ts index 51acb9ca4..c7e3b5bdc 100644 --- a/src/app/centers/common-resolvers/center-view.resolver.ts +++ b/src/app/centers/common-resolvers/center-view.resolver.ts @@ -13,19 +13,17 @@ import { CentersService } from '../centers.service'; */ @Injectable() export class CenterViewResolver implements Resolve { + /** + * @param {CentersService} CentersService Centers service. + */ + constructor(private centersService: CentersService) {} - /** - * @param {CentersService} CentersService Centers service. - */ - constructor(private centersService: CentersService) { } - - /** - * Returns the Centers data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const centerId = route.paramMap.get('centerId'); - return this.centersService.getCenterData(centerId); - } - + /** + * Returns the Centers data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const centerId = route.paramMap.get('centerId'); + return this.centersService.getCenterData(centerId); + } } diff --git a/src/app/centers/common-resolvers/savings-account.resolver.ts b/src/app/centers/common-resolvers/savings-account.resolver.ts index ecf01865d..ffa2bac59 100644 --- a/src/app/centers/common-resolvers/savings-account.resolver.ts +++ b/src/app/centers/common-resolvers/savings-account.resolver.ts @@ -13,19 +13,17 @@ import { CentersService } from '../centers.service'; */ @Injectable() export class SavingsAccountResolver implements Resolve { + /** + * @param {CentersService} CentersService Centers service. + */ + constructor(private centersService: CentersService) {} - /** - * @param {CentersService} CentersService Centers service. - */ - constructor(private centersService: CentersService) { } - - /** - * Returns the Center Savings Account data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const centerId = route.parent.paramMap.get('centerId'); - return this.centersService.getSavingsAccountDetails(centerId); - } - + /** + * Returns the Center Savings Account data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const centerId = route.parent.paramMap.get('centerId'); + return this.centersService.getSavingsAccountDetails(centerId); + } } diff --git a/src/app/centers/create-center/create-center.component.spec.ts b/src/app/centers/create-center/create-center.component.spec.ts index a1a4f53ed..9d2bed55b 100644 --- a/src/app/centers/create-center/create-center.component.spec.ts +++ b/src/app/centers/create-center/create-center.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateCenterComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateCenterComponent ] - }) - .compileComponents(); + declarations: [CreateCenterComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/create-center/create-center.component.ts b/src/app/centers/create-center/create-center.component.ts index a8e1de177..bae5fd1f0 100644 --- a/src/app/centers/create-center/create-center.component.ts +++ b/src/app/centers/create-center/create-center.component.ts @@ -18,7 +18,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-center.component.scss'] }) export class CreateCenterComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -46,13 +45,15 @@ export class CreateCenterComponent implements OnInit { * @param {GroupsService} groupService GroupsService. * @param {Dates} dateUtils Date Utils to format date. */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private route: ActivatedRoute, private router: Router, private centerService: CentersService, private settingsService: SettingsService, private groupService: GroupsService, - private dateUtils: Dates) { + private dateUtils: Dates + ) { this.route.data.subscribe((data: { offices: any }) => { this.officeData = data.offices; }); @@ -71,12 +72,23 @@ export class CreateCenterComponent implements OnInit { */ createCenterForm() { this.centerForm = this.formBuilder.group({ - 'name': ['', [Validators.required, Validators.pattern('(^[A-z]).*')]], - 'officeId': ['', Validators.required], - 'submittedOnDate': ['', Validators.required], - 'staffId': [''], - 'externalId': [''], - 'active': [''], + name: [ + '', + [ + Validators.required, + Validators.pattern('(^[A-z]).*')] + ], + officeId: [ + '', + Validators.required + ], + submittedOnDate: [ + '', + Validators.required + ], + staffId: [''], + externalId: [''], + active: [''] }); this.buildDependencies(); } @@ -156,5 +168,4 @@ export class CreateCenterComponent implements OnInit { this.router.navigate(['../centers']); }); } - } diff --git a/src/app/centers/edit-center/edit-center.component.spec.ts b/src/app/centers/edit-center/edit-center.component.spec.ts index 8bb7f4a4a..f925ab803 100644 --- a/src/app/centers/edit-center/edit-center.component.spec.ts +++ b/src/app/centers/edit-center/edit-center.component.spec.ts @@ -8,9 +8,8 @@ describe('EditCenterComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditCenterComponent ] - }) - .compileComponents(); + declarations: [EditCenterComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/centers/edit-center/edit-center.component.ts b/src/app/centers/edit-center/edit-center.component.ts index 73b3f72ed..64786d417 100644 --- a/src/app/centers/edit-center/edit-center.component.ts +++ b/src/app/centers/edit-center/edit-center.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./edit-center.component.scss'] }) export class EditCenterComponent implements OnInit { - /** Center Data */ centerData: any; /** Staffs Data */ @@ -38,12 +37,14 @@ export class EditCenterComponent implements OnInit { * @param {GroupsService} groupService GroupsService. * @param {Dates} dateUtils Date Utils to format date. */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private route: ActivatedRoute, private router: Router, private centersService: CentersService, private settingsService: SettingsService, - private dateUtils: Dates) { + private dateUtils: Dates + ) { this.route.data.subscribe((data: { centerData: any }) => { this.centerData = data.centerData; this.staffs = this.centerData.staffOptions; @@ -64,12 +65,23 @@ export class EditCenterComponent implements OnInit { createEditCenterForm() { const dateFormat = this.settingsService.dateFormat; this.editCenterForm = this.formBuilder.group({ - 'name': [this.centerData.name, [Validators.required, Validators.pattern('(^[A-z]).*')]], - 'staffId': [this.centerData.staffId], - 'externalId': [this.centerData.externalId] + name: [ + this.centerData.name, + [ + Validators.required, + Validators.pattern('(^[A-z]).*')] + ], + staffId: [this.centerData.staffId], + externalId: [this.centerData.externalId] }); if (this.centerData.status.value === 'Pending') { - this.editCenterForm.addControl('activationDate', new UntypedFormControl(this.centerData.activationDate ? this.centerData.activationDate : new Date(), Validators.required)); + this.editCenterForm.addControl( + 'activationDate', + new UntypedFormControl( + this.centerData.activationDate ? this.centerData.activationDate : new Date(), + Validators.required + ) + ); } } @@ -97,5 +109,4 @@ export class EditCenterComponent implements OnInit { this.router.navigate(['../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/client-stepper/client-address-step/client-address-step.component.spec.ts b/src/app/clients/client-stepper/client-address-step/client-address-step.component.spec.ts index e6a0aa276..6498f44d7 100644 --- a/src/app/clients/client-stepper/client-address-step/client-address-step.component.spec.ts +++ b/src/app/clients/client-stepper/client-address-step/client-address-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientAddressStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClientAddressStepComponent ] - }) - .compileComponents(); + declarations: [ClientAddressStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/client-stepper/client-address-step/client-address-step.component.ts b/src/app/clients/client-stepper/client-address-step/client-address-step.component.ts index 755d2a04b..8481a45b7 100644 --- a/src/app/clients/client-stepper/client-address-step/client-address-step.component.ts +++ b/src/app/clients/client-stepper/client-address-step/client-address-step.component.ts @@ -21,7 +21,6 @@ import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.componen styleUrls: ['./client-address-step.component.scss'] }) export class ClientAddressStepComponent { - /** Client Address Field Config */ @Input() clientAddressFieldConfig: any; /** Client Template */ @@ -34,8 +33,10 @@ export class ClientAddressStepComponent { * @param {MatDialog} dialog Mat Dialog * @param {TranslateService} translateService Translate Service. */ - constructor(private dialog: MatDialog, - private translateService: TranslateService) { + constructor( + private dialog: MatDialog, + private translateService: TranslateService + ) { this.clientAddressData = []; } @@ -44,7 +45,12 @@ export class ClientAddressStepComponent { */ addAddress() { const data = { - title: this.translateService.instant('labels.buttons.Add') + ' ' + this.translateService.instant('labels.catalogs.Client') + ' ' + this.translateService.instant('labels.heading.Address'), + title: + this.translateService.instant('labels.buttons.Add') + + ' ' + + this.translateService.instant('labels.catalogs.Client') + + ' ' + + this.translateService.instant('labels.heading.Address'), formfields: this.getAddressFormFields() }; const addAddressDialogRef = this.dialog.open(FormDialogComponent, { data, width: '50rem' }); @@ -69,7 +75,12 @@ export class ClientAddressStepComponent { */ editAddress(address: any, index: number) { const data = { - title: this.translateService.instant('labels.buttons.Edit') + ' ' + this.translateService.instant('labels.catalogs.Client') + ' ' + this.translateService.instant('labels.heading.Address'), + title: + this.translateService.instant('labels.buttons.Edit') + + ' ' + + this.translateService.instant('labels.catalogs.Client') + + ' ' + + this.translateService.instant('labels.heading.Address'), formfields: this.getAddressFormFields(address), layout: { addButtonText: 'Edit' } }; @@ -94,7 +105,9 @@ export class ClientAddressStepComponent { */ deleteAddress(address: any, index: number) { const deleteAddressDialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: `${this.translateService.instant('labels.heading.Address')} ${this.translateService.instant('labels.inputs.Type')} : ${address.addressType} ${index}` } + data: { + deleteContext: `${this.translateService.instant('labels.heading.Address')} ${this.translateService.instant('labels.inputs.Type')} : ${address.addressType} ${index}` + } }); deleteAddressDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { @@ -116,7 +129,7 @@ export class ClientAddressStepComponent { * @param {any} address Address */ isFieldEnabled(fieldName: any) { - return (this.clientAddressFieldConfig.find((fieldObj: any) => fieldObj.field === fieldName))?.isEnabled; + return this.clientAddressFieldConfig.find((fieldObj: any) => fieldObj.field === fieldName)?.isEnabled; } /** @@ -125,7 +138,7 @@ export class ClientAddressStepComponent { * @param {any} address Address */ getSelectedValue(fieldName: any, fieldId: any) { - return (this.clientTemplate.address[0][fieldName].find((fieldObj: any) => fieldObj.id === fieldId)); + return this.clientTemplate.address[0][fieldName].find((fieldObj: any) => fieldObj.id === fieldId); } /** @@ -136,89 +149,135 @@ export class ClientAddressStepComponent { let formfields: FormfieldBase[] = []; for (let index = 0; index < this.clientTemplate.address[0].addressTypeIdOptions.length; index++) { - this.clientTemplate.address[0].addressTypeIdOptions[index].name = this.translateService.instant(`labels.catalogs.${this.clientTemplate.address[0].addressTypeIdOptions[index].name}`); + this.clientTemplate.address[0].addressTypeIdOptions[index].name = this.translateService.instant( + `labels.catalogs.${this.clientTemplate.address[0].addressTypeIdOptions[index].name}` + ); } - formfields.push(this.isFieldEnabled('addressType') ? new SelectBase({ - controlName: 'addressTypeId', - label: this.translateService.instant('labels.inputs.Address Type'), - value: address ? address.addressTypeId : '', - options: { label: 'name', value: 'id', data: this.clientTemplate.address[0].addressTypeIdOptions }, - order: 1, - required: true - }) : null); - formfields.push(this.isFieldEnabled('street') ? new InputBase({ - controlName: 'street', - label: this.translateService.instant('labels.inputs.Street'), - value: address ? address.street : '', - type: 'text', - required: true, - order: 2 - }) : null); - formfields.push(this.isFieldEnabled('addressLine1') ? new InputBase({ - controlName: 'addressLine1', - label: this.translateService.instant('labels.inputs.Address Line') + ' 1', - value: address ? address.addressLine1 : '', - type: 'text', - order: 3 - }) : null); - formfields.push(this.isFieldEnabled('addressLine2') ? new InputBase({ - controlName: 'addressLine2', - label: this.translateService.instant('labels.inputs.Address Line') + ' 2', - value: address ? address.addressLine2 : '', - type: 'text', - order: 4 - }) : null); - formfields.push(this.isFieldEnabled('addressLine3') ? new InputBase({ - controlName: 'addressLine3', - label: this.translateService.instant('labels.inputs.Address Line') + ' 3', - value: address ? address.addressLine3 : '', - type: 'text', - order: 5 - }) : null); - formfields.push(this.isFieldEnabled('townVillage') ? new InputBase({ - controlName: 'townVillage', - label: this.translateService.instant('labels.inputs.Town / Village'), - value: address ? address.townVillage : '', - type: 'text', - order: 6 - }) : null); - formfields.push(this.isFieldEnabled('city') ? new InputBase({ - controlName: 'city', - label: this.translateService.instant('labels.inputs.City'), - value: address ? address.city : '', - type: 'text', - order: 7 - }) : null); - formfields.push(this.isFieldEnabled('stateProvinceId') ? new SelectBase({ - controlName: 'stateProvinceId', - label: this.translateService.instant('labels.inputs.State / Province'), - value: address ? address.stateProvinceId : '', - options: { label: 'name', value: 'id', data: this.clientTemplate.address[0].stateProvinceIdOptions }, - order: 8 - }) : null); - formfields.push(this.isFieldEnabled('countyDistrict') ? new InputBase({ - controlName: 'countryDistrict', - label: this.translateService.instant('labels.inputs.Country District'), - value: address ? address.countyDistrict : '', - type: 'text', - order: 11 - }) : null); - formfields.push(this.isFieldEnabled('countryId') ? new SelectBase({ - controlName: 'countryId', - label: this.translateService.instant('labels.inputs.Country'), - value: address ? address.countryId : '', - options: { label: 'name', value: 'id', data: this.clientTemplate.address[0].countryIdOptions }, - order: 10 - }) : null); - formfields.push(this.isFieldEnabled('postalCode') ? new InputBase({ - controlName: 'postalCode', - label: this.translateService.instant('labels.inputs.Postal Code'), - value: address ? address.postalCode : '', - type: 'text', - order: 11 - }) : null); - formfields = formfields.filter(field => field !== null); + formfields.push( + this.isFieldEnabled('addressType') + ? new SelectBase({ + controlName: 'addressTypeId', + label: this.translateService.instant('labels.inputs.Address Type'), + value: address ? address.addressTypeId : '', + options: { label: 'name', value: 'id', data: this.clientTemplate.address[0].addressTypeIdOptions }, + order: 1, + required: true + }) + : null + ); + formfields.push( + this.isFieldEnabled('street') + ? new InputBase({ + controlName: 'street', + label: this.translateService.instant('labels.inputs.Street'), + value: address ? address.street : '', + type: 'text', + required: true, + order: 2 + }) + : null + ); + formfields.push( + this.isFieldEnabled('addressLine1') + ? new InputBase({ + controlName: 'addressLine1', + label: this.translateService.instant('labels.inputs.Address Line') + ' 1', + value: address ? address.addressLine1 : '', + type: 'text', + order: 3 + }) + : null + ); + formfields.push( + this.isFieldEnabled('addressLine2') + ? new InputBase({ + controlName: 'addressLine2', + label: this.translateService.instant('labels.inputs.Address Line') + ' 2', + value: address ? address.addressLine2 : '', + type: 'text', + order: 4 + }) + : null + ); + formfields.push( + this.isFieldEnabled('addressLine3') + ? new InputBase({ + controlName: 'addressLine3', + label: this.translateService.instant('labels.inputs.Address Line') + ' 3', + value: address ? address.addressLine3 : '', + type: 'text', + order: 5 + }) + : null + ); + formfields.push( + this.isFieldEnabled('townVillage') + ? new InputBase({ + controlName: 'townVillage', + label: this.translateService.instant('labels.inputs.Town / Village'), + value: address ? address.townVillage : '', + type: 'text', + order: 6 + }) + : null + ); + formfields.push( + this.isFieldEnabled('city') + ? new InputBase({ + controlName: 'city', + label: this.translateService.instant('labels.inputs.City'), + value: address ? address.city : '', + type: 'text', + order: 7 + }) + : null + ); + formfields.push( + this.isFieldEnabled('stateProvinceId') + ? new SelectBase({ + controlName: 'stateProvinceId', + label: this.translateService.instant('labels.inputs.State / Province'), + value: address ? address.stateProvinceId : '', + options: { label: 'name', value: 'id', data: this.clientTemplate.address[0].stateProvinceIdOptions }, + order: 8 + }) + : null + ); + formfields.push( + this.isFieldEnabled('countyDistrict') + ? new InputBase({ + controlName: 'countryDistrict', + label: this.translateService.instant('labels.inputs.Country District'), + value: address ? address.countyDistrict : '', + type: 'text', + order: 11 + }) + : null + ); + formfields.push( + this.isFieldEnabled('countryId') + ? new SelectBase({ + controlName: 'countryId', + label: this.translateService.instant('labels.inputs.Country'), + value: address ? address.countryId : '', + options: { label: 'name', value: 'id', data: this.clientTemplate.address[0].countryIdOptions }, + order: 10 + }) + : null + ); + formfields.push( + this.isFieldEnabled('postalCode') + ? new InputBase({ + controlName: 'postalCode', + label: this.translateService.instant('labels.inputs.Postal Code'), + value: address ? address.postalCode : '', + type: 'text', + order: 11 + }) + : null + ); + formfields = formfields.filter((field) => field !== null); return formfields; } @@ -228,5 +287,4 @@ export class ClientAddressStepComponent { get address() { return { address: this.clientAddressData ? this.clientAddressData : [] }; } - } diff --git a/src/app/clients/client-stepper/client-datatable-step/client-datatable-step.component.spec.ts b/src/app/clients/client-stepper/client-datatable-step/client-datatable-step.component.spec.ts index 3ab8e5631..42ee902bd 100644 --- a/src/app/clients/client-stepper/client-datatable-step/client-datatable-step.component.spec.ts +++ b/src/app/clients/client-stepper/client-datatable-step/client-datatable-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientDatatableStepComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ClientDatatableStepComponent ] - }) - .compileComponents(); + declarations: [ClientDatatableStepComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/clients/client-stepper/client-datatable-step/client-datatable-step.component.ts b/src/app/clients/client-stepper/client-datatable-step/client-datatable-step.component.ts index a7be5c3f1..6d3acba8f 100644 --- a/src/app/clients/client-stepper/client-datatable-step/client-datatable-step.component.ts +++ b/src/app/clients/client-stepper/client-datatable-step/client-datatable-step.component.ts @@ -16,9 +16,11 @@ export class ClientDatatableStepComponent implements OnInit { datatableInputs: any = []; - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private settingsService: SettingsService, - private datatableService: Datatables) { } + private datatableService: Datatables + ) {} ngOnInit(): void { this.datatableInputs = this.datatableService.filterSystemColumns(this.datatableData.columnHeaderData); @@ -70,13 +72,13 @@ export class ClientDatatableStepComponent implements OnInit { const dateFormat = this.settingsService.dateFormat; const datatableDataValues = this.datatableForm.value; - const data = this.datatableService.buildPayload(this.datatableInputs, datatableDataValues, dateFormat, - { locale: this.settingsService.language.code }); + const data = this.datatableService.buildPayload(this.datatableInputs, datatableDataValues, dateFormat, { + locale: this.settingsService.language.code + }); return { registeredTableName: this.datatableData.registeredTableName, data: data }; } - } diff --git a/src/app/clients/client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component.spec.ts b/src/app/clients/client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component.spec.ts index d2e5fd454..7beb4f3f1 100644 --- a/src/app/clients/client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component.spec.ts +++ b/src/app/clients/client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientFamilyMemberDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClientFamilyMemberDialogComponent ] - }) - .compileComponents(); + declarations: [ClientFamilyMemberDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component.ts b/src/app/clients/client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component.ts index ec9683f27..5421c32fe 100644 --- a/src/app/clients/client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component.ts +++ b/src/app/clients/client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component.ts @@ -16,7 +16,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./client-family-member-dialog.component.scss'] }) export class ClientFamilyMemberDialogComponent implements OnInit { - /** Maximum Due Date allowed. */ maxDate = new Date(); @@ -30,28 +29,30 @@ export class ClientFamilyMemberDialogComponent implements OnInit { * @param {any} data Dialog Data * @param {SettingsService} settingsService Setting service */ - constructor(public dialogRef: MatDialogRef, - private formBuilder: UntypedFormBuilder, - private dateUtils: Dates, - @Inject(MAT_DIALOG_DATA) public data: any, - private settingsService: SettingsService) { } + constructor( + public dialogRef: MatDialogRef, + private formBuilder: UntypedFormBuilder, + private dateUtils: Dates, + @Inject(MAT_DIALOG_DATA) public data: any, + private settingsService: SettingsService + ) {} ngOnInit() { this.maxDate = this.settingsService.businessDate; this.createFamilyMemberForm(); if (this.data.context === 'Edit') { this.familyMemberForm.patchValue({ - 'firstName': this.data.member.firstName, - 'middleName': this.data.member.middleName, - 'lastName': this.data.member.lastName, - 'qualification': this.data.member.qualification, - 'age': this.data.member.age, - 'isDependent': this.data.member.isDependent, - 'relationshipId': this.data.member.relationshipId, - 'genderId': this.data.member.genderId, - 'professionId': this.data.member.professionId, - 'maritalStatusId': this.data.member.maritalStatusId, - 'dateOfBirth': this.data.member.dateOfBirth && new Date(this.data.member.dateOfBirth) + firstName: this.data.member.firstName, + middleName: this.data.member.middleName, + lastName: this.data.member.lastName, + qualification: this.data.member.qualification, + age: this.data.member.age, + isDependent: this.data.member.isDependent, + relationshipId: this.data.member.relationshipId, + genderId: this.data.member.genderId, + professionId: this.data.member.professionId, + maritalStatusId: this.data.member.maritalStatusId, + dateOfBirth: this.data.member.dateOfBirth && new Date(this.data.member.dateOfBirth) }); } } @@ -61,17 +62,35 @@ export class ClientFamilyMemberDialogComponent implements OnInit { */ createFamilyMemberForm() { this.familyMemberForm = this.formBuilder.group({ - 'firstName': ['', Validators.required], - 'middleName': [''], - 'lastName': ['', Validators.required], - 'qualification': [''], - 'age': ['', Validators.required], - 'isDependent': [''], - 'relationshipId': ['', Validators.required], - 'genderId': ['', Validators.required], - 'professionId': [''], - 'maritalStatusId': [''], - 'dateOfBirth': ['', Validators.required] + firstName: [ + '', + Validators.required + ], + middleName: [''], + lastName: [ + '', + Validators.required + ], + qualification: [''], + age: [ + '', + Validators.required + ], + isDependent: [''], + relationshipId: [ + '', + Validators.required + ], + genderId: [ + '', + Validators.required + ], + professionId: [''], + maritalStatusId: [''], + dateOfBirth: [ + '', + Validators.required + ] }); } @@ -97,5 +116,4 @@ export class ClientFamilyMemberDialogComponent implements OnInit { } return familyMember; } - } diff --git a/src/app/clients/client-stepper/client-family-members-step/client-family-members-step.component.spec.ts b/src/app/clients/client-stepper/client-family-members-step/client-family-members-step.component.spec.ts index 46b67dd2b..7238057ff 100644 --- a/src/app/clients/client-stepper/client-family-members-step/client-family-members-step.component.spec.ts +++ b/src/app/clients/client-stepper/client-family-members-step/client-family-members-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientFamilyMembersStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClientFamilyMembersStepComponent ] - }) - .compileComponents(); + declarations: [ClientFamilyMembersStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/client-stepper/client-family-members-step/client-family-members-step.component.ts b/src/app/clients/client-stepper/client-family-members-step/client-family-members-step.component.ts index 4e91e76a2..7cf5a43c1 100644 --- a/src/app/clients/client-stepper/client-family-members-step/client-family-members-step.component.ts +++ b/src/app/clients/client-stepper/client-family-members-step/client-family-members-step.component.ts @@ -16,7 +16,6 @@ import { ClientFamilyMemberDialogComponent } from './client-family-member-dialog styleUrls: ['./client-family-members-step.component.scss'] }) export class ClientFamilyMembersStepComponent { - /** Cient Template */ @Input() clientTemplate: any; /** Client Family Members */ @@ -26,8 +25,10 @@ export class ClientFamilyMembersStepComponent { * @param {MatDialog} dialog Mat Dialog * @param {TranslateService} translateService Translate Service. */ - constructor(public dialog: MatDialog, - private translateService: TranslateService) { } + constructor( + public dialog: MatDialog, + private translateService: TranslateService + ) {} /** * Adds a family member. @@ -36,7 +37,7 @@ export class ClientFamilyMembersStepComponent { const addFamilyMemberDialogRef = this.dialog.open(ClientFamilyMemberDialogComponent, { data: { context: this.translateService.instant('labels.buttons.Add'), - options: this.clientTemplate.familyMemberOptions, + options: this.clientTemplate.familyMemberOptions }, width: '50rem' }); @@ -57,7 +58,7 @@ export class ClientFamilyMembersStepComponent { data: { context: 'Edit', member: member, - options: this.clientTemplate.familyMemberOptions, + options: this.clientTemplate.familyMemberOptions }, width: '50rem' }); @@ -88,5 +89,4 @@ export class ClientFamilyMembersStepComponent { get familyMembers() { return { familyMembers: this.clientFamilyMembers }; } - } diff --git a/src/app/clients/client-stepper/client-general-step/client-general-step.component.spec.ts b/src/app/clients/client-stepper/client-general-step/client-general-step.component.spec.ts index 39f8f7b5c..20e43885d 100644 --- a/src/app/clients/client-stepper/client-general-step/client-general-step.component.spec.ts +++ b/src/app/clients/client-stepper/client-general-step/client-general-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientGeneralStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClientGeneralStepComponent ] - }) - .compileComponents(); + declarations: [ClientGeneralStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/client-stepper/client-general-step/client-general-step.component.ts b/src/app/clients/client-stepper/client-general-step/client-general-step.component.ts index f83551244..30dcc09f0 100644 --- a/src/app/clients/client-stepper/client-general-step/client-general-step.component.ts +++ b/src/app/clients/client-stepper/client-general-step/client-general-step.component.ts @@ -16,7 +16,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./client-general-step.component.scss'] }) export class ClientGeneralStepComponent implements OnInit { - @Output() legalFormChangeEvent = new EventEmitter<{ legalForm: number }>(); /** Minimum date allowed. */ @@ -54,10 +53,12 @@ export class ClientGeneralStepComponent implements OnInit { * @param {SettingsService} settingsService Setting service * @param {ClientsService} clientService Client service */ - constructor(private formBuilder: UntypedFormBuilder, - private dateUtils: Dates, - private settingsService: SettingsService, - private clientService: ClientsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private dateUtils: Dates, + private settingsService: SettingsService, + private clientService: ClientsService + ) { this.setClientForm(); } @@ -72,21 +73,33 @@ export class ClientGeneralStepComponent implements OnInit { */ setClientForm() { this.createClientForm = this.formBuilder.group({ - 'officeId': ['', Validators.required], - 'staffId': [''], - 'legalFormId': ['', Validators.required], - 'isStaff': [false], - 'active': [false], - 'addSavings': [false], - 'accountNo': [''], - 'externalId': [''], - 'genderId': [''], - 'mobileNo': [''], - 'emailAddress': ['', Validators.email], - 'dateOfBirth': [''], - 'clientTypeId': [''], - 'clientClassificationId': [''], - 'submittedOnDate': [this.settingsService.businessDate, Validators.required] + officeId: [ + '', + Validators.required + ], + staffId: [''], + legalFormId: [ + '', + Validators.required + ], + isStaff: [false], + active: [false], + addSavings: [false], + accountNo: [''], + externalId: [''], + genderId: [''], + mobileNo: [''], + emailAddress: [ + '', + Validators.email + ], + dateOfBirth: [''], + clientTypeId: [''], + clientClassificationId: [''], + submittedOnDate: [ + this.settingsService.businessDate, + Validators.required + ] }); } @@ -114,21 +127,42 @@ export class ClientGeneralStepComponent implements OnInit { if (legalFormId === 1) { this.createClientForm.removeControl('fullname'); this.createClientForm.removeControl('clientNonPersonDetails'); - this.createClientForm.addControl('firstname', new UntypedFormControl('', [Validators.required, Validators.pattern('(^[A-z]).*')])); + this.createClientForm.addControl( + 'firstname', + new UntypedFormControl('', [ + Validators.required, + Validators.pattern('(^[A-z]).*')]) + ); this.createClientForm.addControl('middlename', new UntypedFormControl('', Validators.pattern('(^[A-z]).*'))); - this.createClientForm.addControl('lastname', new UntypedFormControl('', [Validators.required, Validators.pattern('(^[A-z]).*')])); + this.createClientForm.addControl( + 'lastname', + new UntypedFormControl('', [ + Validators.required, + Validators.pattern('(^[A-z]).*')]) + ); } else { this.createClientForm.removeControl('firstname'); this.createClientForm.removeControl('middlename'); this.createClientForm.removeControl('lastname'); - this.createClientForm.addControl('fullname', new UntypedFormControl('', [Validators.required, Validators.pattern('(^[A-z]).*')])); - this.createClientForm.addControl('clientNonPersonDetails', this.formBuilder.group({ - 'constitutionId': ['', Validators.required], - 'incorpValidityTillDate': [''], - 'incorpNumber': [''], - 'mainBusinessLineId': [''], - 'remarks': [''] - })); + this.createClientForm.addControl( + 'fullname', + new UntypedFormControl('', [ + Validators.required, + Validators.pattern('(^[A-z]).*')]) + ); + this.createClientForm.addControl( + 'clientNonPersonDetails', + this.formBuilder.group({ + constitutionId: [ + '', + Validators.required + ], + incorpValidityTillDate: [''], + incorpNumber: [''], + mainBusinessLineId: [''], + remarks: [''] + }) + ); } }); this.createClientForm.get('legalFormId').patchValue(1); @@ -189,5 +223,4 @@ export class ClientGeneralStepComponent implements OnInit { } return generalDetails; } - } diff --git a/src/app/clients/client-stepper/client-preview-step/client-preview-step.component.spec.ts b/src/app/clients/client-stepper/client-preview-step/client-preview-step.component.spec.ts index 657958194..e618e4ca3 100644 --- a/src/app/clients/client-stepper/client-preview-step/client-preview-step.component.spec.ts +++ b/src/app/clients/client-stepper/client-preview-step/client-preview-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientPreviewStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClientPreviewStepComponent ] - }) - .compileComponents(); + declarations: [ClientPreviewStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/client-stepper/client-preview-step/client-preview-step.component.ts b/src/app/clients/client-stepper/client-preview-step/client-preview-step.component.ts index d669c53e1..a24182689 100644 --- a/src/app/clients/client-stepper/client-preview-step/client-preview-step.component.ts +++ b/src/app/clients/client-stepper/client-preview-step/client-preview-step.component.ts @@ -10,7 +10,6 @@ import { Component, Output, EventEmitter, Input } from '@angular/core'; styleUrls: ['./client-preview-step.component.scss'] }) export class ClientPreviewStepComponent { - /** Client Address field configuration */ @Input() clientAddressFieldConfig: any; /** Client Template */ @@ -21,7 +20,7 @@ export class ClientPreviewStepComponent { /** Form submission event */ @Output() submitEvent = new EventEmitter(); - constructor() { } + constructor() {} /** * Utilized in address preview. @@ -30,7 +29,7 @@ export class ClientPreviewStepComponent { * @param {any} fieldId Field Id */ getSelectedValue(fieldName: any, fieldId: any) { - return (this.clientTemplate.address[0][fieldName].find((fieldObj: any) => fieldObj.id === fieldId)); + return this.clientTemplate.address[0][fieldName].find((fieldObj: any) => fieldObj.id === fieldId); } /** @@ -38,7 +37,6 @@ export class ClientPreviewStepComponent { * @param {any} fieldName Field Name */ isFieldEnabled(fieldName: any) { - return (this.clientAddressFieldConfig.find((fieldObj: any) => fieldObj.field === fieldName))?.isEnabled; + return this.clientAddressFieldConfig.find((fieldObj: any) => fieldObj.field === fieldName)?.isEnabled; } - } diff --git a/src/app/clients/clients-routing.module.ts b/src/app/clients/clients-routing.module.ts index bdafa0702..3a611f601 100644 --- a/src/app/clients/clients-routing.module.ts +++ b/src/app/clients/clients-routing.module.ts @@ -48,225 +48,236 @@ import { ClientDataAndTemplateResolver } from './common-resolvers/client-and-tem import { ClientCollateralResolver } from './common-resolvers/client-collateral.resolver'; const routes: Routes = [ - Route.withShell([{ - path: 'clients', - data: { title: 'Clients', breadcrumb: 'Clients', routeParamBreadcrumb: false }, - children: [ - { - path: '', - component: ClientsComponent - }, - { - path: 'create', - data: { title: 'Create Client', breadcrumb: 'Create Client', routeParamBreadcrumb: false }, - component: CreateClientComponent, - resolve: { - clientAddressFieldConfig: ClientAddressFieldConfigurationResolver, - clientTemplate: ClientTemplateResolver - } - }, - { - path: ':clientId', - component: ClientsViewComponent, - data: { title: 'Clients View', routeParamBreadcrumb: 'clientId' }, - resolve: { - clientViewData: ClientViewResolver, - clientTemplateData: ClientTemplateResolver, - clientDatatables: ClientDatatablesResolver + Route.withShell([ + { + path: 'clients', + data: { title: 'Clients', breadcrumb: 'Clients', routeParamBreadcrumb: false }, + children: [ + { + path: '', + component: ClientsComponent }, - children: [ - { - path: '', - redirectTo: 'general', - pathMatch: 'full' + { + path: 'create', + data: { title: 'Create Client', breadcrumb: 'Create Client', routeParamBreadcrumb: false }, + component: CreateClientComponent, + resolve: { + clientAddressFieldConfig: ClientAddressFieldConfigurationResolver, + clientTemplate: ClientTemplateResolver + } + }, + { + path: ':clientId', + component: ClientsViewComponent, + data: { title: 'Clients View', routeParamBreadcrumb: 'clientId' }, + resolve: { + clientViewData: ClientViewResolver, + clientTemplateData: ClientTemplateResolver, + clientDatatables: ClientDatatablesResolver }, - { - path: 'general', - component: GeneralTabComponent, - data: { title: 'General', breadcrumb: 'General', routeParamBreadcrumb: false }, - resolve: { - clientAccountsData: ClientAccountsResolver, - clientChargesData: ClientChargesResolver, - clientCollateralData: ClientCollateralResolver - } - }, - { - path: 'address', - component: AddressTabComponent, - data: { title: 'Address', breadcrumb: 'Address', routeParamBreadcrumb: false }, - resolve: { - clientAddressFieldConfig: ClientAddressFieldConfigurationResolver, - clientAddressTemplateData: ClientAddressTemplateResolver, - clientAddressData: ClientAddressResolver - } - }, - { - path: 'family-members', - data: { title: 'Family Members', breadcrumb: 'Family Members', routeParamBreadcrumb: false }, - children: [ - { - path: '', - component: FamilyMembersTabComponent, - resolve: { - clientFamilyMembers: ClientFamilyMembersResolver - } - }, - { - path: 'add', - component: AddFamilyMemberComponent, - data: { title: 'Add', breadcrumb: 'Add', routeParamBreadcrumb: false }, - resolve: { - clientTemplate: ClientTemplateResolver - } - }, - { - path: ':familyMemberId', - children: [{ - path: 'edit', - component: EditFamilyMemberComponent, - data: { title: 'Family Member View', routeParamBreadcrumb: 'familyMemberId' }, - resolve: { - clientTemplate: ClientTemplateResolver, - editFamilyMember: ClientFamilyMemberResolver - } - }] - } - ] - }, - { - path: 'identities', - component: IdentitiesTabComponent, - data: { title: 'Identities', breadcrumb: 'Identities', routeParamBreadcrumb: false }, - resolve: { - clientIdentities: ClientIdentitiesResolver, - clientIdentifierTemplate: ClientIdentifierTemplateResolver - } - }, - { - path: 'documents', - component: DocumentsTabComponent, - data: { title: 'Documents', breadcrumb: 'Documents', routeParamBreadcrumb: false }, - resolve: { - clientDocuments: ClientDocumentsResolver - } - }, - { - path: 'notes', - component: NotesTabComponent, - data: { title: 'Notes', breadcrumb: 'Notes', routeParamBreadcrumb: false }, - resolve: { - clientNotes: ClientNotesResolver - } - }, - { - path: 'datatables', - children: [{ - path: ':datatableName', - component: DatatableTabComponent, - data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, + children: [ + { + path: '', + redirectTo: 'general', + pathMatch: 'full' + }, + { + path: 'general', + component: GeneralTabComponent, + data: { title: 'General', breadcrumb: 'General', routeParamBreadcrumb: false }, resolve: { - clientDatatable: ClientDatatableResolver + clientAccountsData: ClientAccountsResolver, + clientChargesData: ClientChargesResolver, + clientCollateralData: ClientCollateralResolver } - }] - } - ] - }, - ] - }, - { - path: 'clients', - data: { title: 'Clients', breadcrumb: 'Clients', routeParamBreadcrumb: false }, - children: [ - { - path: ':clientId', - data: { title: 'Clients View', routeParamBreadcrumb: 'clientId' }, - resolve: { - clientViewData: ClientViewResolver - }, - children: [ - { - path: 'edit', - data: { title: 'Edit Client', breadcrumb: 'Edit', routeParamBreadcrumb: false }, - component: EditClientComponent, - resolve: { - clientDataAndTemplate: ClientDataAndTemplateResolver - } - }, - { - path: 'actions/:name', - data: { title: 'Client Actions', routeParamBreadcrumb: 'name' }, - component: ClientActionsComponent, - resolve: { - clientActionData: ClientActionsResolver - } - }, - { - path: 'charges', - children: [ - { - path: 'overview', - data: { title: 'Charges Overview', breadcrumb: 'Charges Overview' }, - component: ChargesOverviewComponent, - resolve: { - clientChargesData: ClientChargeOverviewResolver - } - }, - { - path: ':chargeId', - data: { title: 'Charges', routeParamBreadcrumb: 'chargeId' }, - children: [ - { - path: '', - component: ViewChargeComponent, - resolve: { - clientChargeData: ClientChargeViewResolver - } - }, - { - path: 'pay', - data: { title: 'Pay Charge', routeParamBreadcrumb: false }, - component: ClientPayChargesComponent, - resolve: { - transactionData: ClientTransactionPayResolver - } + }, + { + path: 'address', + component: AddressTabComponent, + data: { title: 'Address', breadcrumb: 'Address', routeParamBreadcrumb: false }, + resolve: { + clientAddressFieldConfig: ClientAddressFieldConfigurationResolver, + clientAddressTemplateData: ClientAddressTemplateResolver, + clientAddressData: ClientAddressResolver + } + }, + { + path: 'family-members', + data: { title: 'Family Members', breadcrumb: 'Family Members', routeParamBreadcrumb: false }, + children: [ + { + path: '', + component: FamilyMembersTabComponent, + resolve: { + clientFamilyMembers: ClientFamilyMembersResolver } - ] + }, + { + path: 'add', + component: AddFamilyMemberComponent, + data: { title: 'Add', breadcrumb: 'Add', routeParamBreadcrumb: false }, + resolve: { + clientTemplate: ClientTemplateResolver + } + }, + { + path: ':familyMemberId', + children: [ + { + path: 'edit', + component: EditFamilyMemberComponent, + data: { title: 'Family Member View', routeParamBreadcrumb: 'familyMemberId' }, + resolve: { + clientTemplate: ClientTemplateResolver, + editFamilyMember: ClientFamilyMemberResolver + } + } + ] + } + ] + }, + { + path: 'identities', + component: IdentitiesTabComponent, + data: { title: 'Identities', breadcrumb: 'Identities', routeParamBreadcrumb: false }, + resolve: { + clientIdentities: ClientIdentitiesResolver, + clientIdentifierTemplate: ClientIdentifierTemplateResolver } - ] + }, + { + path: 'documents', + component: DocumentsTabComponent, + data: { title: 'Documents', breadcrumb: 'Documents', routeParamBreadcrumb: false }, + resolve: { + clientDocuments: ClientDocumentsResolver + } + }, + { + path: 'notes', + component: NotesTabComponent, + data: { title: 'Notes', breadcrumb: 'Notes', routeParamBreadcrumb: false }, + resolve: { + clientNotes: ClientNotesResolver + } + }, + { + path: 'datatables', + children: [ + { + path: ':datatableName', + component: DatatableTabComponent, + data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, + resolve: { + clientDatatable: ClientDatatableResolver + } + } + ] + } + ] + } + ] + }, + { + path: 'clients', + data: { title: 'Clients', breadcrumb: 'Clients', routeParamBreadcrumb: false }, + children: [ + { + path: ':clientId', + data: { title: 'Clients View', routeParamBreadcrumb: 'clientId' }, + resolve: { + clientViewData: ClientViewResolver }, - { - path: 'loans-accounts', - loadChildren: () => import('../loans/loans.module').then(m => m.LoansModule) - }, - { - path: 'client-collateral', - loadChildren: () => import('../collaterals/collaterals.module').then(m => m.CollateralsModule) - }, - { - path: 'fixed-deposits-accounts', - loadChildren: () => import('../deposits/fixed-deposits/fixed-deposits.module').then(m => m.FixedDepositsModule) - }, - { - path: 'savings-accounts', - loadChildren: () => import('../savings/savings.module').then(m => m.SavingsModule) - }, - { - path: 'recurring-deposits-accounts', - loadChildren: () => import('../deposits/recurring-deposits/recurring-deposits.module').then(m => m.RecurringDepositsModule) - }, - { - path: 'shares-accounts', - loadChildren: () => import('../shares/shares.module').then(m => m.SharesModule) - }, - { - path: 'standing-instructions', - loadChildren: () => import('../account-transfers/account-transfers.module').then(m => m.AccountTransfersModule) - } - ] - } - ] - } + children: [ + { + path: 'edit', + data: { title: 'Edit Client', breadcrumb: 'Edit', routeParamBreadcrumb: false }, + component: EditClientComponent, + resolve: { + clientDataAndTemplate: ClientDataAndTemplateResolver + } + }, + { + path: 'actions/:name', + data: { title: 'Client Actions', routeParamBreadcrumb: 'name' }, + component: ClientActionsComponent, + resolve: { + clientActionData: ClientActionsResolver + } + }, + { + path: 'charges', + children: [ + { + path: 'overview', + data: { title: 'Charges Overview', breadcrumb: 'Charges Overview' }, + component: ChargesOverviewComponent, + resolve: { + clientChargesData: ClientChargeOverviewResolver + } + }, + { + path: ':chargeId', + data: { title: 'Charges', routeParamBreadcrumb: 'chargeId' }, + children: [ + { + path: '', + component: ViewChargeComponent, + resolve: { + clientChargeData: ClientChargeViewResolver + } + }, + { + path: 'pay', + data: { title: 'Pay Charge', routeParamBreadcrumb: false }, + component: ClientPayChargesComponent, + resolve: { + transactionData: ClientTransactionPayResolver + } + } + ] + } + ] + }, + { + path: 'loans-accounts', + loadChildren: () => import('../loans/loans.module').then((m) => m.LoansModule) + }, + { + path: 'client-collateral', + loadChildren: () => import('../collaterals/collaterals.module').then((m) => m.CollateralsModule) + }, + { + path: 'fixed-deposits-accounts', + loadChildren: () => + import('../deposits/fixed-deposits/fixed-deposits.module').then((m) => m.FixedDepositsModule) + }, + { + path: 'savings-accounts', + loadChildren: () => import('../savings/savings.module').then((m) => m.SavingsModule) + }, + { + path: 'recurring-deposits-accounts', + loadChildren: () => + import('../deposits/recurring-deposits/recurring-deposits.module').then( + (m) => m.RecurringDepositsModule + ) + }, + { + path: 'shares-accounts', + loadChildren: () => import('../shares/shares.module').then((m) => m.SharesModule) + }, + { + path: 'standing-instructions', + loadChildren: () => + import('../account-transfers/account-transfers.module').then((m) => m.AccountTransfersModule) + } + ] + } + ] + } ]) + ]; @NgModule({ @@ -297,4 +308,4 @@ const routes: Routes = [ ClientCollateralResolver ] }) -export class ClientsRoutingModule { } +export class ClientsRoutingModule {} diff --git a/src/app/clients/clients-view/address-tab/address-tab.component.spec.ts b/src/app/clients/clients-view/address-tab/address-tab.component.spec.ts index f7e326f61..deb8807dd 100644 --- a/src/app/clients/clients-view/address-tab/address-tab.component.spec.ts +++ b/src/app/clients/clients-view/address-tab/address-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('AddressTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AddressTabComponent ] - }) - .compileComponents(); + declarations: [AddressTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/address-tab/address-tab.component.ts b/src/app/clients/clients-view/address-tab/address-tab.component.ts index d7cef6600..a8ed42fa9 100644 --- a/src/app/clients/clients-view/address-tab/address-tab.component.ts +++ b/src/app/clients/clients-view/address-tab/address-tab.component.ts @@ -22,7 +22,6 @@ import { ClientsService } from '../../clients.service'; styleUrls: ['./address-tab.component.scss'] }) export class AddressTabComponent { - /** Client Address Data */ clientAddressData: any; /** Client Address Field Config */ @@ -38,20 +37,20 @@ export class AddressTabComponent { * @param {MatDialog} dialog Mat Dialog * @param {TranslateService} translateService Translate Service. */ - constructor(private route: ActivatedRoute, - private clientService: ClientsService, - private dialog: MatDialog, - private translateService: TranslateService) { - this.route.data.subscribe((data: { - clientAddressData: any, - clientAddressFieldConfig: any, - clientAddressTemplateData: any - }) => { - this.clientAddressData = data.clientAddressData; - this.clientAddressFieldConfig = data.clientAddressFieldConfig; - this.clientAddressTemplate = data.clientAddressTemplateData; - this.clientId = this.route.parent.snapshot.paramMap.get('clientId'); - }); + constructor( + private route: ActivatedRoute, + private clientService: ClientsService, + private dialog: MatDialog, + private translateService: TranslateService + ) { + this.route.data.subscribe( + (data: { clientAddressData: any; clientAddressFieldConfig: any; clientAddressTemplateData: any }) => { + this.clientAddressData = data.clientAddressData; + this.clientAddressFieldConfig = data.clientAddressFieldConfig; + this.clientAddressTemplate = data.clientAddressTemplateData; + this.clientId = this.route.parent.snapshot.paramMap.get('clientId'); + } + ); } /** @@ -59,20 +58,26 @@ export class AddressTabComponent { */ addAddress() { const data = { - title: this.translateService.instant('labels.buttons.Add') + ' ' + this.translateService.instant('labels.catalogs.Client') + ' ' + this.translateService.instant('labels.heading.Address'), + title: + this.translateService.instant('labels.buttons.Add') + + ' ' + + this.translateService.instant('labels.catalogs.Client') + + ' ' + + this.translateService.instant('labels.heading.Address'), formfields: this.getAddressFormFields('add') }; const addAddressDialogRef = this.dialog.open(FormDialogComponent, { data }); addAddressDialogRef.afterClosed().subscribe((response: any) => { if (response.data) { - this.clientService.createClientAddress(this.clientId, response.data.value.addressType, response.data.value).subscribe((res: any) => { - const addressData = response.data.value; - addressData.addressId = res.resourceId; - addressData.addressType = this.getSelectedValue('addressTypeIdOptions', addressData.addressType).name; - addressData.isActive = false; - this.clientAddressData.push(addressData); - }); - + this.clientService + .createClientAddress(this.clientId, response.data.value.addressType, response.data.value) + .subscribe((res: any) => { + const addressData = response.data.value; + addressData.addressId = res.resourceId; + addressData.addressType = this.getSelectedValue('addressTypeIdOptions', addressData.addressType).name; + addressData.isActive = false; + this.clientAddressData.push(addressData); + }); } }); } @@ -84,7 +89,12 @@ export class AddressTabComponent { */ editAddress(address: any, index: number) { const data = { - title: this.translateService.instant('labels.buttons.Edit') + ' ' + this.translateService.instant('labels.catalogs.Client') + ' ' + this.translateService.instant('labels.heading.Address'), + title: + this.translateService.instant('labels.buttons.Edit') + + ' ' + + this.translateService.instant('labels.catalogs.Client') + + ' ' + + this.translateService.instant('labels.heading.Address'), formfields: this.getAddressFormFields('edit', address), layout: { addButtonText: 'Edit' } }; @@ -94,11 +104,13 @@ export class AddressTabComponent { const addressData = response.data.value; addressData.addressId = address.addressId; addressData.isActive = address.isActive; - this.clientService.editClientAddress(this.clientId, address.addressTypeId, addressData).subscribe((res: any) => { - addressData.addressTypeId = address.addressTypeId; - addressData.addressType = address.addressType; - this.clientAddressData[index] = addressData; - }); + this.clientService + .editClientAddress(this.clientId, address.addressTypeId, addressData) + .subscribe((res: any) => { + addressData.addressTypeId = address.addressTypeId; + addressData.addressType = address.addressType; + this.clientAddressData[index] = addressData; + }); } }); } @@ -109,8 +121,8 @@ export class AddressTabComponent { */ toggleAddress(address: any) { const addressData = { - 'addressId': address.addressId, - 'isActive': address.isActive ? false : true + addressId: address.addressId, + isActive: address.isActive ? false : true }; this.clientService.editClientAddress(this.clientId, address.addressTypeId, addressData).subscribe(() => { address.isActive = address.isActive ? false : true; @@ -122,7 +134,7 @@ export class AddressTabComponent { * @param {any} fieldName Field Name */ isFieldEnabled(fieldName: any) { - return (this.clientAddressFieldConfig.find((fieldObj: any) => fieldObj.field === fieldName))?.isEnabled; + return this.clientAddressFieldConfig.find((fieldObj: any) => fieldObj.field === fieldName)?.isEnabled; } /** @@ -131,7 +143,7 @@ export class AddressTabComponent { * @param {any} fieldId Field Id */ getSelectedValue(fieldName: any, fieldId: any) { - return (this.clientAddressTemplate[fieldName].find((fieldObj: any) => fieldObj.id === fieldId)); + return this.clientAddressTemplate[fieldName].find((fieldObj: any) => fieldObj.id === fieldId); } /** @@ -143,91 +155,136 @@ export class AddressTabComponent { let formfields: FormfieldBase[] = []; for (let index = 0; index < this.clientAddressTemplate.addressTypeIdOptions.length; index++) { - this.clientAddressTemplate.addressTypeIdOptions[index].name = this.translateService.instant(`labels.catalogs.${this.clientAddressTemplate.addressTypeIdOptions[index].name}`); + this.clientAddressTemplate.addressTypeIdOptions[index].name = this.translateService.instant( + `labels.catalogs.${this.clientAddressTemplate.addressTypeIdOptions[index].name}` + ); } if (formType === 'add') { - formfields.push(this.isFieldEnabled('addressType') ? new SelectBase({ - controlName: 'addressType', - label: this.translateService.instant('labels.inputs.Address Type'), - value: address ? address.addressType : '', - options: { label: 'name', value: 'id', data: this.clientAddressTemplate.addressTypeIdOptions }, - order: 1 - }) : null); + formfields.push( + this.isFieldEnabled('addressType') + ? new SelectBase({ + controlName: 'addressType', + label: this.translateService.instant('labels.inputs.Address Type'), + value: address ? address.addressType : '', + options: { label: 'name', value: 'id', data: this.clientAddressTemplate.addressTypeIdOptions }, + order: 1 + }) + : null + ); } - formfields.push(this.isFieldEnabled('street') ? new InputBase({ - controlName: 'street', - label: this.translateService.instant('labels.inputs.Street'), - value: address ? address.street : '', - type: 'text', - required: false, - order: 2 - }) : null); - formfields.push(this.isFieldEnabled('addressLine1') ? new InputBase({ - controlName: 'addressLine1', - label: this.translateService.instant('labels.inputs.Address Line') + ' 1', - value: address ? address.addressLine1 : '', - type: 'text', - order: 3 - }) : null); - formfields.push(this.isFieldEnabled('addressLine2') ? new InputBase({ - controlName: 'addressLine2', - label: this.translateService.instant('labels.inputs.Address Line') + ' 2', - value: address ? address.addressLine2 : '', - type: 'text', - order: 4 - }) : null); - formfields.push(this.isFieldEnabled('addressLine3') ? new InputBase({ - controlName: 'addressLine3', - label: this.translateService.instant('labels.inputs.Address Line') + ' 3', - value: address ? address.addressLine3 : '', - type: 'text', - order: 5 - }) : null); - formfields.push(this.isFieldEnabled('townVillage') ? new InputBase({ - controlName: 'townVillage', - label: this.translateService.instant('labels.inputs.Town / Village'), - value: address ? address.townVillage : '', - type: 'text', - order: 6 - }) : null); - formfields.push(this.isFieldEnabled('city') ? new InputBase({ - controlName: 'city', - label: this.translateService.instant('labels.inputs.City'), - value: address ? address.city : '', - type: 'text', - order: 7 - }) : null); - formfields.push(this.isFieldEnabled('stateProvinceId') ? new SelectBase({ - controlName: 'stateProvinceId', - label: this.translateService.instant('labels.inputs.State / Province'), - value: address ? address.stateProvinceId : '', - options: { label: 'name', value: 'id', data: this.clientAddressTemplate.stateProvinceIdOptions }, - order: 8 - }) : null); - formfields.push(this.isFieldEnabled('countyDistrict') ? new InputBase({ - controlName: 'countryDistrict', - label: this.translateService.instant('labels.inputs.State / Province'), - value: address ? address.countyDistrict : '', - type: 'text', - order: 11 - }) : null); - formfields.push(this.isFieldEnabled('countryId') ? new SelectBase({ - controlName: 'countryId', - label: this.translateService.instant('labels.inputs.Country'), - value: address ? address.countryId : '', - options: { label: 'name', value: 'id', data: this.clientAddressTemplate.countryIdOptions }, - order: 10 - }) : null); - formfields.push(this.isFieldEnabled('postalCode') ? new InputBase({ - controlName: 'postalCode', - label: this.translateService.instant('labels.inputs.Postal Code'), - value: address ? address.postalCode : '', - type: 'text', - order: 11 - }) : null); - formfields = formfields.filter(field => field !== null); + formfields.push( + this.isFieldEnabled('street') + ? new InputBase({ + controlName: 'street', + label: this.translateService.instant('labels.inputs.Street'), + value: address ? address.street : '', + type: 'text', + required: false, + order: 2 + }) + : null + ); + formfields.push( + this.isFieldEnabled('addressLine1') + ? new InputBase({ + controlName: 'addressLine1', + label: this.translateService.instant('labels.inputs.Address Line') + ' 1', + value: address ? address.addressLine1 : '', + type: 'text', + order: 3 + }) + : null + ); + formfields.push( + this.isFieldEnabled('addressLine2') + ? new InputBase({ + controlName: 'addressLine2', + label: this.translateService.instant('labels.inputs.Address Line') + ' 2', + value: address ? address.addressLine2 : '', + type: 'text', + order: 4 + }) + : null + ); + formfields.push( + this.isFieldEnabled('addressLine3') + ? new InputBase({ + controlName: 'addressLine3', + label: this.translateService.instant('labels.inputs.Address Line') + ' 3', + value: address ? address.addressLine3 : '', + type: 'text', + order: 5 + }) + : null + ); + formfields.push( + this.isFieldEnabled('townVillage') + ? new InputBase({ + controlName: 'townVillage', + label: this.translateService.instant('labels.inputs.Town / Village'), + value: address ? address.townVillage : '', + type: 'text', + order: 6 + }) + : null + ); + formfields.push( + this.isFieldEnabled('city') + ? new InputBase({ + controlName: 'city', + label: this.translateService.instant('labels.inputs.City'), + value: address ? address.city : '', + type: 'text', + order: 7 + }) + : null + ); + formfields.push( + this.isFieldEnabled('stateProvinceId') + ? new SelectBase({ + controlName: 'stateProvinceId', + label: this.translateService.instant('labels.inputs.State / Province'), + value: address ? address.stateProvinceId : '', + options: { label: 'name', value: 'id', data: this.clientAddressTemplate.stateProvinceIdOptions }, + order: 8 + }) + : null + ); + formfields.push( + this.isFieldEnabled('countyDistrict') + ? new InputBase({ + controlName: 'countryDistrict', + label: this.translateService.instant('labels.inputs.State / Province'), + value: address ? address.countyDistrict : '', + type: 'text', + order: 11 + }) + : null + ); + formfields.push( + this.isFieldEnabled('countryId') + ? new SelectBase({ + controlName: 'countryId', + label: this.translateService.instant('labels.inputs.Country'), + value: address ? address.countryId : '', + options: { label: 'name', value: 'id', data: this.clientAddressTemplate.countryIdOptions }, + order: 10 + }) + : null + ); + formfields.push( + this.isFieldEnabled('postalCode') + ? new InputBase({ + controlName: 'postalCode', + label: this.translateService.instant('labels.inputs.Postal Code'), + value: address ? address.postalCode : '', + type: 'text', + order: 11 + }) + : null + ); + formfields = formfields.filter((field) => field !== null); return formfields; } - } diff --git a/src/app/clients/clients-view/charges/charges-overview/charge-overview.resolver.ts b/src/app/clients/clients-view/charges/charges-overview/charge-overview.resolver.ts index ba936c7a5..313b1e93b 100644 --- a/src/app/clients/clients-view/charges/charges-overview/charge-overview.resolver.ts +++ b/src/app/clients/clients-view/charges/charges-overview/charge-overview.resolver.ts @@ -13,19 +13,17 @@ import { ClientsService } from '../../../clients.service'; */ @Injectable() export class ClientChargeOverviewResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client Charge data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.params.clientId; - return this.clientsService.getAllClientCharges(clientId); - } - + /** + * Returns the Client Charge data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.params.clientId; + return this.clientsService.getAllClientCharges(clientId); + } } diff --git a/src/app/clients/clients-view/charges/charges-overview/charges-overview.component.spec.ts b/src/app/clients/clients-view/charges/charges-overview/charges-overview.component.spec.ts index dbe5ad1ea..029e3f077 100644 --- a/src/app/clients/clients-view/charges/charges-overview/charges-overview.component.spec.ts +++ b/src/app/clients/clients-view/charges/charges-overview/charges-overview.component.spec.ts @@ -8,9 +8,8 @@ describe('ChargesOverviewComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChargesOverviewComponent ] - }) - .compileComponents(); + declarations: [ChargesOverviewComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/charges/charges-overview/charges-overview.component.ts b/src/app/clients/clients-view/charges/charges-overview/charges-overview.component.ts index d18f15e01..d349b134d 100644 --- a/src/app/clients/clients-view/charges/charges-overview/charges-overview.component.ts +++ b/src/app/clients/clients-view/charges/charges-overview/charges-overview.component.ts @@ -14,9 +14,15 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./charges-overview.component.scss'] }) export class ChargesOverviewComponent implements OnInit { - /** Columns to be displayed in charge overview table. */ - displayedColumns: string[] = ['name', 'dueAsOf', 'due', 'paid', 'waived', 'outstanding']; + displayedColumns: string[] = [ + 'name', + 'dueAsOf', + 'due', + 'paid', + 'waived', + 'outstanding' + ]; /** Data source for charge overview table. */ dataSource: MatTableDataSource; /** Charge Overview data */ @@ -30,10 +36,12 @@ export class ChargesOverviewComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {MatDialog} dialog Dialog reference. */ - constructor(private route: ActivatedRoute, - public dialog: MatDialog) { - this.route.data.subscribe((data: { clientChargesData: any }) => { - this.chargeOverviewData = data.clientChargesData; + constructor( + private route: ActivatedRoute, + public dialog: MatDialog + ) { + this.route.data.subscribe((data: { clientChargesData: any }) => { + this.chargeOverviewData = data.clientChargesData; }); } @@ -48,5 +56,4 @@ export class ChargesOverviewComponent implements OnInit { this.dataSource = new MatTableDataSource(this.chargeOverviewData.pageItems); this.dataSource.paginator = this.paginator; } - } diff --git a/src/app/clients/clients-view/charges/client-pay-charges/client-pay-charges.component.spec.ts b/src/app/clients/clients-view/charges/client-pay-charges/client-pay-charges.component.spec.ts index 4d8f0cc64..24c326a91 100644 --- a/src/app/clients/clients-view/charges/client-pay-charges/client-pay-charges.component.spec.ts +++ b/src/app/clients/clients-view/charges/client-pay-charges/client-pay-charges.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientPayChargesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClientPayChargesComponent ] - }) - .compileComponents(); + declarations: [ClientPayChargesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/charges/client-pay-charges/client-pay-charges.component.ts b/src/app/clients/clients-view/charges/client-pay-charges/client-pay-charges.component.ts index 4b3fc68d0..d2483ccd1 100644 --- a/src/app/clients/clients-view/charges/client-pay-charges/client-pay-charges.component.ts +++ b/src/app/clients/clients-view/charges/client-pay-charges/client-pay-charges.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./client-pay-charges.component.scss'] }) export class ClientPayChargesComponent implements OnInit { - /** Transaction Form. */ transactionForm: any; /** Transaction Data. */ @@ -25,14 +24,14 @@ export class ClientPayChargesComponent implements OnInit { /** Minimum Date allowed. */ minDate = new Date(2000, 0, 1); - /** - * Retrieves the charge data from `resolve`. - * @param {ClientService} clientService Products Service. - * @param {FormBuilder} formBuilder Form Builder. - * @param {ActivatedRoute} route Activated Route. - * @param {Router} router Router for navigation. - * @param {SettingsService} settingsService Setting service - */ + /** + * Retrieves the charge data from `resolve`. + * @param {ClientService} clientService Products Service. + * @param {FormBuilder} formBuilder Form Builder. + * @param {ActivatedRoute} route Activated Route. + * @param {Router} router Router for navigation. + * @param {SettingsService} settingsService Setting service + */ constructor( private clientsService: ClientsService, private formBuilder: UntypedFormBuilder, @@ -55,8 +54,14 @@ export class ClientPayChargesComponent implements OnInit { */ setTransactionForm() { this.transactionForm = this.formBuilder.group({ - 'amount': [this.transactionData.amount, Validators.required], - 'transactionDate': [new Date(), Validators.required] + amount: [ + this.transactionData.amount, + Validators.required + ], + transactionDate: [ + new Date(), + Validators.required + ] }); } @@ -77,8 +82,13 @@ export class ClientPayChargesComponent implements OnInit { locale }; this.clientsService.payClientCharge(this.transactionData.clientId, this.transactionData.id, data).subscribe(() => { - this.router.navigate(['../../..', 'general'], { relativeTo: this.route }); + this.router.navigate( + [ + '../../..', + 'general' + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/clients/clients-view/charges/view-charge/view-charge.component.spec.ts b/src/app/clients/clients-view/charges/view-charge/view-charge.component.spec.ts index 6c6e3739c..d40f3ae62 100644 --- a/src/app/clients/clients-view/charges/view-charge/view-charge.component.spec.ts +++ b/src/app/clients/clients-view/charges/view-charge/view-charge.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewChargeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewChargeComponent ] - }) - .compileComponents(); + declarations: [ViewChargeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/charges/view-charge/view-charge.component.ts b/src/app/clients/clients-view/charges/view-charge/view-charge.component.ts index 77df9d934..3a60b6f83 100644 --- a/src/app/clients/clients-view/charges/view-charge/view-charge.component.ts +++ b/src/app/clients/clients-view/charges/view-charge/view-charge.component.ts @@ -12,30 +12,38 @@ import { ClientsService } from 'app/clients/clients.service'; styleUrls: ['./view-charge.component.scss'] }) export class ViewChargeComponent { - /** Charge Data. */ chargeData: any; /** Mat Table Column defs. */ - viewChargeTableColumns: string[] = ['id', 'officeName', 'type', 'transactionDate', 'amount', 'actions']; + viewChargeTableColumns: string[] = [ + 'id', + 'officeName', + 'type', + 'transactionDate', + 'amount', + 'actions' + ]; /** * Retrieves the selected job data from `resolve`. * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private route: ActivatedRoute, - private router: Router, - private clientService: ClientsService) { + constructor( + private route: ActivatedRoute, + private router: Router, + private clientService: ClientsService + ) { this.route.data.subscribe((data: { clientChargeData: any }) => { this.chargeData = data.clientChargeData; }); - } + } /** * Waive Charge. */ waiveCharge() { - const waiveChargeObj = { clientId: this.chargeData.clientId, resourceType: this.chargeData.id}; + const waiveChargeObj = { clientId: this.chargeData.clientId, resourceType: this.chargeData.id }; this.clientService.waiveClientCharge(waiveChargeObj).subscribe(() => { this.getChargeData(); }); @@ -45,7 +53,7 @@ export class ViewChargeComponent { * Undo Transaction. */ undoTransaction(transactionId: any) { - const transactionData = { clientId: this.chargeData.clientId.toString(), transactionId: transactionId}; + const transactionData = { clientId: this.chargeData.clientId.toString(), transactionId: transactionId }; this.clientService.undoTransaction(transactionData).subscribe(() => { this.getChargeData(); }); @@ -65,8 +73,11 @@ export class ViewChargeComponent { */ deleteCharge() { this.clientService.deleteCharge(this.chargeData.clientId, this.chargeData.id).subscribe(() => { - this.router.navigate(['../../clients', this.chargeData.clientId, 'general']); + this.router.navigate([ + '../../clients', + this.chargeData.clientId, + 'general' + ]); }); } - } diff --git a/src/app/clients/clients-view/client-actions/accept-client-transfer/accept-client-transfer.component.spec.ts b/src/app/clients/clients-view/client-actions/accept-client-transfer/accept-client-transfer.component.spec.ts index 77542648e..251c095eb 100644 --- a/src/app/clients/clients-view/client-actions/accept-client-transfer/accept-client-transfer.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/accept-client-transfer/accept-client-transfer.component.spec.ts @@ -8,9 +8,8 @@ describe('AcceptClientTransferComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AcceptClientTransferComponent ] - }) - .compileComponents(); + declarations: [AcceptClientTransferComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/accept-client-transfer/accept-client-transfer.component.ts b/src/app/clients/clients-view/client-actions/accept-client-transfer/accept-client-transfer.component.ts index f57ad288e..fd9d07880 100644 --- a/src/app/clients/clients-view/client-actions/accept-client-transfer/accept-client-transfer.component.ts +++ b/src/app/clients/clients-view/client-actions/accept-client-transfer/accept-client-transfer.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./accept-client-transfer.component.scss'] }) export class AcceptClientTransferComponent implements OnInit { - /** Accept Client Transfer form. */ acceptClientTransferForm: UntypedFormGroup; /** Client Id */ @@ -33,12 +32,14 @@ export class AcceptClientTransferComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { clientActionData: any }) => { this.transferDate = data.clientActionData; }); @@ -57,8 +58,8 @@ export class AcceptClientTransferComponent implements OnInit { */ createAcceptClientTransferForm() { this.acceptClientTransferForm = this.formBuilder.group({ - 'transferDate': {value: new Date(this.transferDate), disabled: true}, - 'note': [''] + transferDate: { value: new Date(this.transferDate), disabled: true }, + note: [''] }); } @@ -74,11 +75,10 @@ export class AcceptClientTransferComponent implements OnInit { acceptClientTransferFormData.transferDate = this.dateUtils.formatDate(prevTransferDate, dateFormat); } const data = { - ...acceptClientTransferFormData, + ...acceptClientTransferFormData }; this.clientsService.executeClientCommand(this.clientId, 'acceptTransfer', data).subscribe(() => { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/activate-client/activate-client.component.spec.ts b/src/app/clients/clients-view/client-actions/activate-client/activate-client.component.spec.ts index 5311d9022..6e9b6b4a7 100644 --- a/src/app/clients/clients-view/client-actions/activate-client/activate-client.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/activate-client/activate-client.component.spec.ts @@ -8,9 +8,8 @@ describe('ActivateClientComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ActivateClientComponent ] - }) - .compileComponents(); + declarations: [ActivateClientComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/activate-client/activate-client.component.ts b/src/app/clients/clients-view/client-actions/activate-client/activate-client.component.ts index edafe07a5..e73d930ff 100644 --- a/src/app/clients/clients-view/client-actions/activate-client/activate-client.component.ts +++ b/src/app/clients/clients-view/client-actions/activate-client/activate-client.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./activate-client.component.scss'] }) export class ActivateClientComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class ActivateClientComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.clientId = this.route.parent.snapshot.params['clientId']; } @@ -57,7 +58,10 @@ export class ActivateClientComponent implements OnInit { */ createActivateClientForm() { this.activateClientForm = this.formBuilder.group({ - 'activationDate': ['', Validators.required] + activationDate: [ + '', + Validators.required + ] }); } @@ -82,5 +86,4 @@ export class ActivateClientComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/add-client-charge/add-client-charge.component.spec.ts b/src/app/clients/clients-view/client-actions/add-client-charge/add-client-charge.component.spec.ts index 3cb62bca9..128a023af 100644 --- a/src/app/clients/clients-view/client-actions/add-client-charge/add-client-charge.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/add-client-charge/add-client-charge.component.spec.ts @@ -8,9 +8,8 @@ describe('AddClientChargeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AddClientChargeComponent ] - }) - .compileComponents(); + declarations: [AddClientChargeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/add-client-charge/add-client-charge.component.ts b/src/app/clients/clients-view/client-actions/add-client-charge/add-client-charge.component.ts index 40dabefa2..0f66d7ff3 100644 --- a/src/app/clients/clients-view/client-actions/add-client-charge/add-client-charge.component.ts +++ b/src/app/clients/clients-view/client-actions/add-client-charge/add-client-charge.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./add-client-charge.component.scss'] }) export class AddClientChargeComponent implements OnInit { - /** Minimum Due Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Due Date allowed. */ @@ -64,7 +63,7 @@ export class AddClientChargeComponent implements OnInit { * Subscribe to form controls value changes */ buildDependencies() { - this.clientChargeForm.controls.chargeId.valueChanges.subscribe(chargeId => { + this.clientChargeForm.controls.chargeId.valueChanges.subscribe((chargeId) => { this.clientsService.getChargeAndTemplate(chargeId).subscribe((data: any) => { this.chargeDetails = data; const chargeTimeType = data.chargeTimeType.id; @@ -85,14 +84,17 @@ export class AddClientChargeComponent implements OnInit { this.clientChargeForm.removeControl('feeOnMonthDay'); } if (chargeTimeType.value === 'Monthly Fee') { - this.clientChargeForm.addControl('feeInterval', new UntypedFormControl(data.feeInterval, Validators.required)); + this.clientChargeForm.addControl( + 'feeInterval', + new UntypedFormControl(data.feeInterval, Validators.required) + ); } else { this.clientChargeForm.removeControl('feeInterval'); } this.clientChargeForm.patchValue({ - 'amount': data.amount, - 'chargeCalculationType': data.chargeCalculationType.id, - 'chargeTimeType': data.chargeTimeType.id + amount: data.amount, + chargeCalculationType: data.chargeCalculationType.id, + chargeTimeType: data.chargeTimeType.id }); }); }); @@ -103,10 +105,16 @@ export class AddClientChargeComponent implements OnInit { */ createClientsChargeForm() { this.clientChargeForm = this.formBuilder.group({ - 'chargeId': ['', Validators.required], - 'amount': ['', Validators.required], - 'chargeCalculationType': [{ value: '', disabled: true }], - 'chargeTimeType': [{ value: '', disabled: true }] + chargeId: [ + '', + Validators.required + ], + amount: [ + '', + Validators.required + ], + chargeCalculationType: [{ value: '', disabled: true }], + chargeTimeType: [{ value: '', disabled: true }] }); } @@ -136,9 +144,8 @@ export class AddClientChargeComponent implements OnInit { } } } - this.clientsService.createClientCharge(this.clientId, clientCharge).subscribe( () => { + this.clientsService.createClientCharge(this.clientId, clientCharge).subscribe(() => { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/add-client-collateral/add-client-collateral.component.spec.ts b/src/app/clients/clients-view/client-actions/add-client-collateral/add-client-collateral.component.spec.ts index fc1e7075d..1ef93596c 100644 --- a/src/app/clients/clients-view/client-actions/add-client-collateral/add-client-collateral.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/add-client-collateral/add-client-collateral.component.spec.ts @@ -8,9 +8,8 @@ describe('AddClientCollateralComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ AddClientCollateralComponent ] - }) - .compileComponents(); + declarations: [AddClientCollateralComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/add-client-collateral/add-client-collateral.component.ts b/src/app/clients/clients-view/client-actions/add-client-collateral/add-client-collateral.component.ts index a51d699a3..5ea278c37 100644 --- a/src/app/clients/clients-view/client-actions/add-client-collateral/add-client-collateral.component.ts +++ b/src/app/clients/clients-view/client-actions/add-client-collateral/add-client-collateral.component.ts @@ -16,7 +16,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./add-client-collateral.component.scss'] }) export class AddClientCollateralComponent implements OnInit { - /** Client Collateral Form */ clientCollateralForm: UntypedFormGroup; /** Client Collateral Options */ @@ -39,13 +38,13 @@ export class AddClientCollateralComponent implements OnInit { private router: Router, private productsService: ProductsService, private clientsService: ClientsService, - private settingsService: SettingsService, - ) { - this.route.data.subscribe((data: { clientActionData: any }) => { - this.clientCollateralOptions = data.clientActionData; - }); - this.clientId = this.route.parent.snapshot.params['clientId']; - } + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { clientActionData: any }) => { + this.clientCollateralOptions = data.clientActionData; + }); + this.clientId = this.route.parent.snapshot.params['clientId']; + } ngOnInit(): void { this.createClientCollateralForm(); @@ -56,22 +55,22 @@ export class AddClientCollateralComponent implements OnInit { * Subscribe to Form controls value changes */ buildDependencies() { - this.clientCollateralForm.controls.collateralId.valueChanges.subscribe(collateralId => { + this.clientCollateralForm.controls.collateralId.valueChanges.subscribe((collateralId) => { this.productsService.getCollateral(collateralId).subscribe((data: any) => { this.collateralDetails = data; this.clientCollateralForm.patchValue({ - 'name': data.name, - 'quality': data.quality, - 'unitType': data.unitType, - 'basePrice': this.collateralDetails.basePrice, - 'pctToBase': this.collateralDetails.pctToBase, + name: data.name, + quality: data.quality, + unitType: data.unitType, + basePrice: this.collateralDetails.basePrice, + pctToBase: this.collateralDetails.pctToBase }); }); }); this.clientCollateralForm.controls.quantity.valueChanges.subscribe((quantity: any) => { this.clientCollateralForm.patchValue({ - 'totalValue': this.collateralDetails.basePrice * quantity, - 'totalCollateralValue': this.collateralDetails.basePrice * this.collateralDetails.pctToBase * quantity / 100 + totalValue: this.collateralDetails.basePrice * quantity, + totalCollateralValue: (this.collateralDetails.basePrice * this.collateralDetails.pctToBase * quantity) / 100 }); }); } @@ -81,15 +80,21 @@ export class AddClientCollateralComponent implements OnInit { */ createClientCollateralForm() { this.clientCollateralForm = this.formBuilder.group({ - 'collateralId': [ '', Validators.required ], - 'quantity': [ '', Validators.required ], - 'name': [{ value: '', disabled: true }], - 'quality': [{value: '', disabled: true}], - 'unitType': [{value: '', disabled: true}], - 'basePrice': [{value: '', disabled: true}], - 'pctToBase': [{value: '', disabled: true}], - 'totalValue': [{value: '', disabled: true}], - 'totalCollateralValue': [{value: '', disabled: true}], + collateralId: [ + '', + Validators.required + ], + quantity: [ + '', + Validators.required + ], + name: [{ value: '', disabled: true }], + quality: [{ value: '', disabled: true }], + unitType: [{ value: '', disabled: true }], + basePrice: [{ value: '', disabled: true }], + pctToBase: [{ value: '', disabled: true }], + totalValue: [{ value: '', disabled: true }], + totalCollateralValue: [{ value: '', disabled: true }] }); } @@ -106,8 +111,7 @@ export class AddClientCollateralComponent implements OnInit { locale }; this.clientsService.createClientCollateral(this.clientId, clientCollateral).subscribe(() => { - this.router.navigate(['../../'], {relativeTo: this.route}); + this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/client-actions.component.spec.ts b/src/app/clients/clients-view/client-actions/client-actions.component.spec.ts index ea21b79ac..54eb27107 100644 --- a/src/app/clients/clients-view/client-actions/client-actions.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/client-actions.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientActionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClientActionsComponent ] - }) - .compileComponents(); + declarations: [ClientActionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/client-actions.component.ts b/src/app/clients/clients-view/client-actions/client-actions.component.ts index 7be0762b4..e7b21915e 100644 --- a/src/app/clients/clients-view/client-actions/client-actions.component.ts +++ b/src/app/clients/clients-view/client-actions/client-actions.component.ts @@ -11,38 +11,37 @@ import { ActivatedRoute, Router } from '@angular/router'; styleUrls: ['./client-actions.component.scss'] }) export class ClientActionsComponent { - /** Flag object to store possible actions and render appropriate UI to the user */ actions: { - 'Assign Staff': boolean - 'Close': boolean - 'Reject': boolean - 'Survey': boolean - 'Withdraw': boolean - 'Update Default Savings': boolean - 'Transfer Client': boolean - 'Undo Transfer': boolean - 'Accept Transfer': boolean - 'Reject Transfer': boolean - 'Reactivate': boolean - 'Undo Rejection': boolean - 'Add Charge': boolean - 'Take Survey': boolean - 'Client Screen Reports': boolean, - 'Create Self Service User': boolean, - 'Create Collateral': boolean + 'Assign Staff': boolean; + Close: boolean; + Reject: boolean; + Survey: boolean; + Withdraw: boolean; + 'Update Default Savings': boolean; + 'Transfer Client': boolean; + 'Undo Transfer': boolean; + 'Accept Transfer': boolean; + 'Reject Transfer': boolean; + Reactivate: boolean; + 'Undo Rejection': boolean; + 'Add Charge': boolean; + 'Take Survey': boolean; + 'Client Screen Reports': boolean; + 'Create Self Service User': boolean; + 'Create Collateral': boolean; } = { 'Assign Staff': false, - 'Close': false, - 'Reject': false, - 'Survey': false, - 'Withdraw': false, + Close: false, + Reject: false, + Survey: false, + Withdraw: false, 'Update Default Savings': false, 'Transfer Client': false, 'Undo Transfer': false, 'Accept Transfer': false, 'Reject Transfer': false, - 'Reactivate': false, + Reactivate: false, 'Undo Rejection': false, 'Add Charge': false, 'Take Survey': false, @@ -55,11 +54,12 @@ export class ClientActionsComponent { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private route: ActivatedRoute, - private router: Router) { + constructor( + private route: ActivatedRoute, + private router: Router + ) { this.router.routeReuseStrategy.shouldReuseRoute = () => false; const name = this.route.snapshot.params['name']; this.actions[name] = true; } - } diff --git a/src/app/clients/clients-view/client-actions/client-assign-staff/client-assign-staff.component.spec.ts b/src/app/clients/clients-view/client-actions/client-assign-staff/client-assign-staff.component.spec.ts index 3d601e443..d9e759fc7 100644 --- a/src/app/clients/clients-view/client-actions/client-assign-staff/client-assign-staff.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/client-assign-staff/client-assign-staff.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientAssignStaffComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClientAssignStaffComponent ] - }) - .compileComponents(); + declarations: [ClientAssignStaffComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/client-assign-staff/client-assign-staff.component.ts b/src/app/clients/clients-view/client-actions/client-assign-staff/client-assign-staff.component.ts index 1d0cb3a55..40244cf0e 100644 --- a/src/app/clients/clients-view/client-actions/client-assign-staff/client-assign-staff.component.ts +++ b/src/app/clients/clients-view/client-actions/client-assign-staff/client-assign-staff.component.ts @@ -15,7 +15,6 @@ import { ClientsService } from 'app/clients/clients.service'; styleUrls: ['./client-assign-staff.component.scss'] }) export class ClientAssignStaffComponent implements OnInit { - /** Client Assign Staff form. */ clientAssignStaffForm: UntypedFormGroup; /** Staff Data */ @@ -30,10 +29,12 @@ export class ClientAssignStaffComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { clientActionData: any }) => { this.clientData = data.clientActionData; }); @@ -52,7 +53,7 @@ export class ClientAssignStaffComponent implements OnInit { */ createClientAssignStaffForm() { this.clientAssignStaffForm = this.formBuilder.group({ - 'staffId': [''] + staffId: [''] }); } @@ -60,10 +61,10 @@ export class ClientAssignStaffComponent implements OnInit { * Submits the form and assigns staff for the client. */ submit() { - this.clientsService.executeClientCommand(this.clientData.id, 'assignStaff', this.clientAssignStaffForm.value) + this.clientsService + .executeClientCommand(this.clientData.id, 'assignStaff', this.clientAssignStaffForm.value) .subscribe(() => { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/client-screen-reports/client-screen-reports.component.spec.ts b/src/app/clients/clients-view/client-actions/client-screen-reports/client-screen-reports.component.spec.ts index 59948cf1d..3f979d4ae 100644 --- a/src/app/clients/clients-view/client-actions/client-screen-reports/client-screen-reports.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/client-screen-reports/client-screen-reports.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientScreenReportsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClientScreenReportsComponent ] - }) - .compileComponents(); + declarations: [ClientScreenReportsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/client-screen-reports/client-screen-reports.component.ts b/src/app/clients/clients-view/client-actions/client-screen-reports/client-screen-reports.component.ts index c9976dc07..f6b329a04 100644 --- a/src/app/clients/clients-view/client-actions/client-screen-reports/client-screen-reports.component.ts +++ b/src/app/clients/clients-view/client-actions/client-screen-reports/client-screen-reports.component.ts @@ -16,7 +16,6 @@ import { DomSanitizer } from '@angular/platform-browser'; styleUrls: ['./client-screen-reports.component.scss'] }) export class ClientScreenReportsComponent implements OnInit { - /** Client Screen Reportform. */ clientScreenReportForm: UntypedFormGroup; /** Templates Data */ @@ -37,11 +36,13 @@ export class ClientScreenReportsComponent implements OnInit { * @param {DomSanitizer} sanitizer DOM Sanitizer * @param {Renderer2} renderer Renderer 2 */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private route: ActivatedRoute, - private sanitizer: DomSanitizer, - private renderer: Renderer2) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private route: ActivatedRoute, + private sanitizer: DomSanitizer, + private renderer: Renderer2 + ) { this.route.data.subscribe((data: { clientActionData: any }) => { this.templatesData = data.clientActionData; }); @@ -60,7 +61,7 @@ export class ClientScreenReportsComponent implements OnInit { */ createClientScreenReportForm() { this.clientScreenReportForm = this.formBuilder.group({ - 'templateId': [''] + templateId: [''] }); } @@ -87,5 +88,4 @@ export class ClientScreenReportsComponent implements OnInit { this.renderer.setProperty(this.screenReportRef.nativeElement, 'innerHTML', this.template); }); } - } diff --git a/src/app/clients/clients-view/client-actions/close-client/close-client.component.spec.ts b/src/app/clients/clients-view/client-actions/close-client/close-client.component.spec.ts index d2fa5088c..9cd1a581f 100644 --- a/src/app/clients/clients-view/client-actions/close-client/close-client.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/close-client/close-client.component.spec.ts @@ -8,9 +8,8 @@ describe('CloseClientComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CloseClientComponent ] - }) - .compileComponents(); + declarations: [CloseClientComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/close-client/close-client.component.ts b/src/app/clients/clients-view/client-actions/close-client/close-client.component.ts index c03352ab0..aa09d3f29 100644 --- a/src/app/clients/clients-view/client-actions/close-client/close-client.component.ts +++ b/src/app/clients/clients-view/client-actions/close-client/close-client.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./close-client.component.scss'] }) export class CloseClientComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -37,12 +36,14 @@ export class CloseClientComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { clientActionData: any }) => { this.closureData = data.clientActionData.narrations; }); @@ -59,8 +60,14 @@ export class CloseClientComponent implements OnInit { */ createCloseClientForm() { this.closeClientForm = this.formBuilder.group({ - 'closureDate': ['', Validators.required], - 'closureReasonId': ['', Validators.required] + closureDate: [ + '', + Validators.required + ], + closureReasonId: [ + '', + Validators.required + ] }); } @@ -84,5 +91,4 @@ export class CloseClientComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/create-self-service-user/create-self-service-user.component.spec.ts b/src/app/clients/clients-view/client-actions/create-self-service-user/create-self-service-user.component.spec.ts index 49b4dbb33..bcde143a1 100644 --- a/src/app/clients/clients-view/client-actions/create-self-service-user/create-self-service-user.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/create-self-service-user/create-self-service-user.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateSelfServiceUserComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateSelfServiceUserComponent ] - }) - .compileComponents(); + declarations: [CreateSelfServiceUserComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/create-self-service-user/create-self-service-user.component.ts b/src/app/clients/clients-view/client-actions/create-self-service-user/create-self-service-user.component.ts index 58d1c454d..74210432c 100644 --- a/src/app/clients/clients-view/client-actions/create-self-service-user/create-self-service-user.component.ts +++ b/src/app/clients/clients-view/client-actions/create-self-service-user/create-self-service-user.component.ts @@ -1,6 +1,14 @@ /** Angular Imports. */ import { Component, OnInit } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup, UntypedFormControl, Validators, AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms'; +import { + UntypedFormBuilder, + UntypedFormGroup, + UntypedFormControl, + Validators, + AbstractControl, + ValidationErrors, + ValidatorFn +} from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { Subscription } from 'rxjs'; @@ -14,17 +22,18 @@ import { PasswordsUtility } from 'app/core/utils/passwords-utility'; styleUrls: ['./create-self-service-user.component.scss'] }) export class CreateSelfServiceUserComponent implements OnInit { - createSelfServiceForm: UntypedFormGroup; clientData: any; hidePasswordField = true; - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private clientService: ClientsService, - private router: Router, - private passwordsUtility: PasswordsUtility) { - this.route.data.subscribe((data: { clientActionData: any}) => { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private clientService: ClientsService, + private router: Router, + private passwordsUtility: PasswordsUtility + ) { + this.route.data.subscribe((data: { clientActionData: any }) => { this.clientData = data.clientActionData; }); } @@ -45,8 +54,16 @@ export class CreateSelfServiceUserComponent implements OnInit { this.createSelfServiceForm.removeControl('repeatPassword'); } else { this.hidePasswordField = false; - this.createSelfServiceForm.addControl('password', new UntypedFormControl('', this.passwordsUtility.getPasswordValidators())); - this.createSelfServiceForm.addControl('repeatPassword', new UntypedFormControl('', [Validators.required, this.passwordsUtility.confirmPassword('password')])); + this.createSelfServiceForm.addControl( + 'password', + new UntypedFormControl('', this.passwordsUtility.getPasswordValidators()) + ); + this.createSelfServiceForm.addControl( + 'repeatPassword', + new UntypedFormControl('', [ + Validators.required, + this.passwordsUtility.confirmPassword('password')]) + ); } }); } @@ -56,13 +73,19 @@ export class CreateSelfServiceUserComponent implements OnInit { */ createSelfServiceUser() { this.createSelfServiceForm = this.formBuilder.group({ - 'username': new UntypedFormControl('', [Validators.required]), - 'firstname': new UntypedFormControl(this.clientData.firstname, [Validators.required]), - 'lastname': new UntypedFormControl(this.clientData.lastname, [Validators.required]), - 'email': new UntypedFormControl('', [Validators.required, Validators.email]), - 'sendPasswordToEmail': new UntypedFormControl(true), - 'passwordNeverExpires': new UntypedFormControl(false), - 'status': new UntypedFormControl({value: this.clientData.subStatus.active ? 'Active' : 'Inactive', disabled: true}) + username: new UntypedFormControl('', [Validators.required]), + firstname: new UntypedFormControl(this.clientData.firstname, [Validators.required]), + lastname: new UntypedFormControl(this.clientData.lastname, [Validators.required]), + email: new UntypedFormControl('', [ + Validators.required, + Validators.email + ]), + sendPasswordToEmail: new UntypedFormControl(true), + passwordNeverExpires: new UntypedFormControl(false), + status: new UntypedFormControl({ + value: this.clientData.subStatus.active ? 'Active' : 'Inactive', + disabled: true + }) }); } @@ -75,8 +98,7 @@ export class CreateSelfServiceUserComponent implements OnInit { } const clientId = this.clientData.id.toString(); const selfServiceForm = this.createSelfServiceForm.value; - selfServiceForm.roles = [2], - selfServiceForm.isSelfServiceUser = true; + (selfServiceForm.roles = [2]), (selfServiceForm.isSelfServiceUser = true); selfServiceForm.staffId = this.clientData.staffId; selfServiceForm.clients = [clientId]; selfServiceForm.officeId = this.clientData.officeId; @@ -84,5 +106,4 @@ export class CreateSelfServiceUserComponent implements OnInit { this.router.navigate(['../../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/reactivate-client/reactivate-client.component.spec.ts b/src/app/clients/clients-view/client-actions/reactivate-client/reactivate-client.component.spec.ts index e8b04db57..1d52d2b7e 100644 --- a/src/app/clients/clients-view/client-actions/reactivate-client/reactivate-client.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/reactivate-client/reactivate-client.component.spec.ts @@ -8,9 +8,8 @@ describe('ReactivateClientComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ReactivateClientComponent ] - }) - .compileComponents(); + declarations: [ReactivateClientComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/reactivate-client/reactivate-client.component.ts b/src/app/clients/clients-view/client-actions/reactivate-client/reactivate-client.component.ts index 3bfc00088..57f013a64 100644 --- a/src/app/clients/clients-view/client-actions/reactivate-client/reactivate-client.component.ts +++ b/src/app/clients/clients-view/client-actions/reactivate-client/reactivate-client.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./reactivate-client.component.scss'] }) export class ReactivateClientComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class ReactivateClientComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.clientId = this.route.parent.snapshot.params['clientId']; } @@ -57,7 +58,10 @@ export class ReactivateClientComponent implements OnInit { */ createReactivateClientForm() { this.reactivateClientForm = this.formBuilder.group({ - 'reactivationDate': ['', Validators.required] + reactivationDate: [ + '', + Validators.required + ] }); } @@ -82,5 +86,4 @@ export class ReactivateClientComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/reject-client-transfer/reject-client-transfer.component.spec.ts b/src/app/clients/clients-view/client-actions/reject-client-transfer/reject-client-transfer.component.spec.ts index f4a617023..f96201651 100644 --- a/src/app/clients/clients-view/client-actions/reject-client-transfer/reject-client-transfer.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/reject-client-transfer/reject-client-transfer.component.spec.ts @@ -8,9 +8,8 @@ describe('RejectClientTransferComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RejectClientTransferComponent ] - }) - .compileComponents(); + declarations: [RejectClientTransferComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/reject-client-transfer/reject-client-transfer.component.ts b/src/app/clients/clients-view/client-actions/reject-client-transfer/reject-client-transfer.component.ts index 0953c3ec4..409981ec6 100644 --- a/src/app/clients/clients-view/client-actions/reject-client-transfer/reject-client-transfer.component.ts +++ b/src/app/clients/clients-view/client-actions/reject-client-transfer/reject-client-transfer.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./reject-client-transfer.component.scss'] }) export class RejectClientTransferComponent implements OnInit { - /** Reject Client Transfer form. */ rejectClientTransferForm: UntypedFormGroup; /** Client Id */ @@ -31,12 +30,14 @@ export class RejectClientTransferComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { clientActionData: any }) => { this.transferDate = data.clientActionData; }); @@ -52,8 +53,8 @@ export class RejectClientTransferComponent implements OnInit { */ createRejectClientTransferForm() { this.rejectClientTransferForm = this.formBuilder.group({ - 'transferDate': {value: new Date(this.transferDate), disabled: true}, - 'note': [''] + transferDate: { value: new Date(this.transferDate), disabled: true }, + note: [''] }); } @@ -76,5 +77,4 @@ export class RejectClientTransferComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/reject-client/reject-client.component.spec.ts b/src/app/clients/clients-view/client-actions/reject-client/reject-client.component.spec.ts index 2a0798145..bf2302aed 100644 --- a/src/app/clients/clients-view/client-actions/reject-client/reject-client.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/reject-client/reject-client.component.spec.ts @@ -8,9 +8,8 @@ describe('RejectClientComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RejectClientComponent ] - }) - .compileComponents(); + declarations: [RejectClientComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/reject-client/reject-client.component.ts b/src/app/clients/clients-view/client-actions/reject-client/reject-client.component.ts index 46158f71d..c1a02cf3d 100644 --- a/src/app/clients/clients-view/client-actions/reject-client/reject-client.component.ts +++ b/src/app/clients/clients-view/client-actions/reject-client/reject-client.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./reject-client.component.scss'] }) export class RejectClientComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -37,12 +36,14 @@ export class RejectClientComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { clientActionData: any }) => { this.rejectionData = data.clientActionData.narrations; }); @@ -59,8 +60,14 @@ export class RejectClientComponent implements OnInit { */ createRejectClientForm() { this.rejectClientForm = this.formBuilder.group({ - 'rejectionDate': ['', Validators.required], - 'rejectionReasonId': ['', Validators.required] + rejectionDate: [ + '', + Validators.required + ], + rejectionReasonId: [ + '', + Validators.required + ] }); } @@ -84,5 +91,4 @@ export class RejectClientComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/take-survey/take-survey.component.spec.ts b/src/app/clients/clients-view/client-actions/take-survey/take-survey.component.spec.ts index f717f2ec5..4c48844f8 100644 --- a/src/app/clients/clients-view/client-actions/take-survey/take-survey.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/take-survey/take-survey.component.spec.ts @@ -8,9 +8,8 @@ describe('TakeSurveyComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ TakeSurveyComponent ] - }) - .compileComponents(); + declarations: [TakeSurveyComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/take-survey/take-survey.component.ts b/src/app/clients/clients-view/client-actions/take-survey/take-survey.component.ts index 75b1c888d..ede6afe6a 100644 --- a/src/app/clients/clients-view/client-actions/take-survey/take-survey.component.ts +++ b/src/app/clients/clients-view/client-actions/take-survey/take-survey.component.ts @@ -15,7 +15,6 @@ import { AuthenticationService } from '../../../../core/authentication/authentic styleUrls: ['./take-survey.component.scss'] }) export class TakeSurveyComponent { - /** List of all Survey Data */ allSurveyData: any; /** User Id */ @@ -28,13 +27,13 @@ export class TakeSurveyComponent { clientId: any; /** Stores the value to send to the API */ formData: { - userId: Number, - clientId: Number, - surveyId: Number, - scorecardValues: { questionId: Number, responseId: Number, value: String }[], - surveyName: String, - username: String, - id: Number + userId: Number; + clientId: Number; + surveyId: Number; + scorecardValues: { questionId: Number; responseId: Number; value: String }[]; + surveyName: String; + username: String; + id: Number; }; /** @@ -44,10 +43,12 @@ export class TakeSurveyComponent { * @param {Router} router Router * @param {AuthenticationService} authenticationService AuthenticationService */ - constructor(private route: ActivatedRoute, - private clientsService: ClientsService, - private router: Router, - private authenticationService: AuthenticationService) { + constructor( + private route: ActivatedRoute, + private clientsService: ClientsService, + private router: Router, + private authenticationService: AuthenticationService + ) { this.route.data.subscribe((data: { clientActionData: any }) => { this.allSurveyData = data.clientActionData; this.clientId = this.route.parent.snapshot.params['clientId']; @@ -82,7 +83,6 @@ export class TakeSurveyComponent { }); } - /** * Checks if there is any response or not from the user and enables the submit button accordingly */ @@ -127,5 +127,4 @@ export class TakeSurveyComponent { this.router.navigate(['../../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/transfer-client/transfer-client.component.spec.ts b/src/app/clients/clients-view/client-actions/transfer-client/transfer-client.component.spec.ts index 5ee013868..f78791da2 100644 --- a/src/app/clients/clients-view/client-actions/transfer-client/transfer-client.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/transfer-client/transfer-client.component.spec.ts @@ -8,9 +8,8 @@ describe('TransferClientComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ TransferClientComponent ] - }) - .compileComponents(); + declarations: [TransferClientComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/transfer-client/transfer-client.component.ts b/src/app/clients/clients-view/client-actions/transfer-client/transfer-client.component.ts index 5d47b785d..6e0b233ff 100644 --- a/src/app/clients/clients-view/client-actions/transfer-client/transfer-client.component.ts +++ b/src/app/clients/clients-view/client-actions/transfer-client/transfer-client.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./transfer-client.component.scss'] }) export class TransferClientComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -37,12 +36,14 @@ export class TransferClientComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { clientActionData: any }) => { this.officeData = data.clientActionData; }); @@ -59,9 +60,15 @@ export class TransferClientComponent implements OnInit { */ createTransferClientForm() { this.transferClientForm = this.formBuilder.group({ - 'destinationOfficeId': ['', Validators.required], - 'transferDate': ['', Validators.required], - 'note': [''] + destinationOfficeId: [ + '', + Validators.required + ], + transferDate: [ + '', + Validators.required + ], + note: [''] }); } @@ -85,5 +92,4 @@ export class TransferClientComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/undo-client-rejection/undo-client-rejection.component.spec.ts b/src/app/clients/clients-view/client-actions/undo-client-rejection/undo-client-rejection.component.spec.ts index a791b49fd..06e5d988c 100644 --- a/src/app/clients/clients-view/client-actions/undo-client-rejection/undo-client-rejection.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/undo-client-rejection/undo-client-rejection.component.spec.ts @@ -8,9 +8,8 @@ describe('UndoClientRejectionComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UndoClientRejectionComponent ] - }) - .compileComponents(); + declarations: [UndoClientRejectionComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/undo-client-rejection/undo-client-rejection.component.ts b/src/app/clients/clients-view/client-actions/undo-client-rejection/undo-client-rejection.component.ts index f9a6da40a..a12518a2d 100644 --- a/src/app/clients/clients-view/client-actions/undo-client-rejection/undo-client-rejection.component.ts +++ b/src/app/clients/clients-view/client-actions/undo-client-rejection/undo-client-rejection.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./undo-client-rejection.component.scss'] }) export class UndoClientRejectionComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -34,12 +33,14 @@ export class UndoClientRejectionComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.clientId = this.route.parent.snapshot.params['clientId']; } @@ -56,7 +57,10 @@ export class UndoClientRejectionComponent implements OnInit { */ createUndoClientRejectionForm() { this.undoClientRejectionForm = this.formBuilder.group({ - 'reopenedDate': ['', Validators.required] + reopenedDate: [ + '', + Validators.required + ] }); } @@ -81,5 +85,4 @@ export class UndoClientRejectionComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/undo-client-transfer/undo-client-transfer.component.spec.ts b/src/app/clients/clients-view/client-actions/undo-client-transfer/undo-client-transfer.component.spec.ts index 657b9f37f..3f274ccdf 100644 --- a/src/app/clients/clients-view/client-actions/undo-client-transfer/undo-client-transfer.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/undo-client-transfer/undo-client-transfer.component.spec.ts @@ -8,9 +8,8 @@ describe('UndoClientTransferComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UndoClientTransferComponent ] - }) - .compileComponents(); + declarations: [UndoClientTransferComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/undo-client-transfer/undo-client-transfer.component.ts b/src/app/clients/clients-view/client-actions/undo-client-transfer/undo-client-transfer.component.ts index 066c3d370..a09800e7d 100644 --- a/src/app/clients/clients-view/client-actions/undo-client-transfer/undo-client-transfer.component.ts +++ b/src/app/clients/clients-view/client-actions/undo-client-transfer/undo-client-transfer.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./undo-client-transfer.component.scss'] }) export class UndoClientTransferComponent implements OnInit { - /** Undo Client Transfer form. */ undoClientTransferForm: UntypedFormGroup; /** Client Id */ @@ -31,12 +30,14 @@ export class UndoClientTransferComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private settingsService: SettingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private settingsService: SettingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { clientActionData: any }) => { this.transferDate = data.clientActionData; }); @@ -55,8 +56,8 @@ export class UndoClientTransferComponent implements OnInit { */ createUndoClientTransferForm() { this.undoClientTransferForm = this.formBuilder.group({ - 'transferDate': {value: new Date(this.transferDate), disabled: true}, - 'note': [''] + transferDate: { value: new Date(this.transferDate), disabled: true }, + note: [''] }); } @@ -79,5 +80,4 @@ export class UndoClientTransferComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/update-client-savings-account/update-client-savings-account.component.spec.ts b/src/app/clients/clients-view/client-actions/update-client-savings-account/update-client-savings-account.component.spec.ts index 1c3ce77a5..e029db2f5 100644 --- a/src/app/clients/clients-view/client-actions/update-client-savings-account/update-client-savings-account.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/update-client-savings-account/update-client-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('UpdateClientSavingsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UpdateClientSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [UpdateClientSavingsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/update-client-savings-account/update-client-savings-account.component.ts b/src/app/clients/clients-view/client-actions/update-client-savings-account/update-client-savings-account.component.ts index 24de90cd8..2434c1add 100644 --- a/src/app/clients/clients-view/client-actions/update-client-savings-account/update-client-savings-account.component.ts +++ b/src/app/clients/clients-view/client-actions/update-client-savings-account/update-client-savings-account.component.ts @@ -15,7 +15,6 @@ import { ClientsService } from 'app/clients/clients.service'; styleUrls: ['./update-client-savings-account.component.scss'] }) export class UpdateClientSavingsAccountComponent implements OnInit { - /** Client Update Savings Account form. */ clientSavingsAccountForm: UntypedFormGroup; /** Savings Accounts Data */ @@ -30,10 +29,12 @@ export class UpdateClientSavingsAccountComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { clientActionData: any }) => { this.clientData = data.clientActionData; }); @@ -49,7 +50,7 @@ export class UpdateClientSavingsAccountComponent implements OnInit { */ createClientSavingsAccountForm() { this.clientSavingsAccountForm = this.formBuilder.group({ - 'savingsAccountId': [this.clientData.savingsAccountId] + savingsAccountId: [this.clientData.savingsAccountId] }); } @@ -57,10 +58,10 @@ export class UpdateClientSavingsAccountComponent implements OnInit { * Submits the form and update savings account for the client. */ submit() { - this.clientsService.executeClientCommand(this.clientData.id, 'updateSavingsAccount', this.clientSavingsAccountForm.value) + this.clientsService + .executeClientCommand(this.clientData.id, 'updateSavingsAccount', this.clientSavingsAccountForm.value) .subscribe(() => { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/client-actions/view-survey/view-survey.component.spec.ts b/src/app/clients/clients-view/client-actions/view-survey/view-survey.component.spec.ts index efd6b8094..45d04a068 100644 --- a/src/app/clients/clients-view/client-actions/view-survey/view-survey.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/view-survey/view-survey.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewSurveyComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewSurveyComponent ] - }) - .compileComponents(); + declarations: [ViewSurveyComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/view-survey/view-survey.component.ts b/src/app/clients/clients-view/client-actions/view-survey/view-survey.component.ts index 54d23fb4c..4fc73af69 100644 --- a/src/app/clients/clients-view/client-actions/view-survey/view-survey.component.ts +++ b/src/app/clients/clients-view/client-actions/view-survey/view-survey.component.ts @@ -14,20 +14,23 @@ import { MatTableDataSource } from '@angular/material/table'; styleUrls: ['./view-survey.component.scss'] }) export class ViewSurveyComponent implements OnInit { - /** Survey Data */ surveyData: any; /** Data source for view surveys table. */ dataSource: MatTableDataSource; /** Columns to be displayed in list of surveys table. */ - displayedColumns: string[] = ['surveyName', 'createdBy', 'date', 'score']; + displayedColumns: string[] = [ + 'surveyName', + 'createdBy', + 'date', + 'score' + ]; /** Paginator for list of surveys table. */ @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; /** Sorter for list of surveys table. */ @ViewChild(MatSort, { static: true }) sort: MatSort; - /** * Retrieves the survey data from `resolve`. * @param {ActivatedRoute} route Activated Route. @@ -71,5 +74,4 @@ export class ViewSurveyComponent implements OnInit { applyFilter(filterValue: string) { this.dataSource.filter = filterValue.trim().toLowerCase(); } - } diff --git a/src/app/clients/clients-view/client-actions/withdraw-client/withdraw-client.component.spec.ts b/src/app/clients/clients-view/client-actions/withdraw-client/withdraw-client.component.spec.ts index c0845456e..e1f5e9c45 100644 --- a/src/app/clients/clients-view/client-actions/withdraw-client/withdraw-client.component.spec.ts +++ b/src/app/clients/clients-view/client-actions/withdraw-client/withdraw-client.component.spec.ts @@ -8,9 +8,8 @@ describe('WithdrawClientComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WithdrawClientComponent ] - }) - .compileComponents(); + declarations: [WithdrawClientComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/client-actions/withdraw-client/withdraw-client.component.ts b/src/app/clients/clients-view/client-actions/withdraw-client/withdraw-client.component.ts index 485b98a93..62f500748 100644 --- a/src/app/clients/clients-view/client-actions/withdraw-client/withdraw-client.component.ts +++ b/src/app/clients/clients-view/client-actions/withdraw-client/withdraw-client.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./withdraw-client.component.scss'] }) export class WithdrawClientComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -37,12 +36,14 @@ export class WithdrawClientComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private clientsService: ClientsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private clientsService: ClientsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { clientActionData: any }) => { this.withdrawalData = data.clientActionData.narrations; }); @@ -59,8 +60,14 @@ export class WithdrawClientComponent implements OnInit { */ createWithdrawClientForm() { this.withdrawClientForm = this.formBuilder.group({ - 'withdrawalDate': ['', Validators.required], - 'withdrawalReasonId': ['', Validators.required] + withdrawalDate: [ + '', + Validators.required + ], + withdrawalReasonId: [ + '', + Validators.required + ] }); } @@ -84,5 +91,4 @@ export class WithdrawClientComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/clients-view.component.spec.ts b/src/app/clients/clients-view/clients-view.component.spec.ts index b9d1b0772..d29ac1d4a 100644 --- a/src/app/clients/clients-view/clients-view.component.spec.ts +++ b/src/app/clients/clients-view/clients-view.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientsViewComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClientsViewComponent ] - }) - .compileComponents(); + declarations: [ClientsViewComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/clients-view.component.ts b/src/app/clients/clients-view/clients-view.component.ts index f25228162..57570bcf8 100644 --- a/src/app/clients/clients-view/clients-view.component.ts +++ b/src/app/clients/clients-view/clients-view.component.ts @@ -22,22 +22,19 @@ import { ClientsService } from '../clients.service'; styleUrls: ['./clients-view.component.scss'] }) export class ClientsViewComponent implements OnInit { - clientViewData: any; clientDatatables: any; clientImage: any; clientTemplateData: any; - constructor(private route: ActivatedRoute, - private router: Router, - private clientsService: ClientsService, - private _sanitizer: DomSanitizer, - public dialog: MatDialog) { - this.route.data.subscribe((data: { - clientViewData: any, - clientTemplateData: any, - clientDatatables: any - }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private clientsService: ClientsService, + private _sanitizer: DomSanitizer, + public dialog: MatDialog + ) { + this.route.data.subscribe((data: { clientViewData: any; clientTemplateData: any; clientDatatables: any }) => { this.clientViewData = data.clientViewData; this.clientDatatables = data.clientDatatables; this.clientTemplateData = data.clientTemplateData; @@ -48,12 +45,13 @@ export class ClientsViewComponent implements OnInit { this.clientsService.getClientProfileImage(this.clientViewData.id).subscribe( (base64Image: any) => { this.clientImage = this._sanitizer.bypassSecurityTrustResourceUrl(base64Image); - }, (error: any) => {} + }, + (error: any) => {} ); } isActive(): boolean { - return (this.clientViewData.status.value === 'Active'); + return this.clientViewData.status.value === 'Active'; } /** @@ -81,7 +79,7 @@ export class ClientsViewComponent implements OnInit { case 'Client Screen Reports': this.router.navigate([`actions/${name}`], { relativeTo: this.route }); break; - case 'Unassign Staff': + case 'Unassign Staff': this.unassignStaff(); break; case 'Delete': @@ -106,12 +104,24 @@ export class ClientsViewComponent implements OnInit { this.deleteProfileImage(); break; case 'Create Standing Instructions': - const createStandingInstructionsQueryParams: any = { officeId: this.clientViewData.officeId, accountType: 'fromsavings' }; - this.router.navigate(['standing-instructions/create-standing-instructions'], { relativeTo: this.route, queryParams: createStandingInstructionsQueryParams }); + const createStandingInstructionsQueryParams: any = { + officeId: this.clientViewData.officeId, + accountType: 'fromsavings' + }; + this.router.navigate(['standing-instructions/create-standing-instructions'], { + relativeTo: this.route, + queryParams: createStandingInstructionsQueryParams + }); break; case 'View Standing Instructions': - const viewStandingInstructionsQueryParams: any = { officeId: this.clientViewData.officeId, accountType: 'fromsavings' }; - this.router.navigate(['standing-instructions/list-standing-instructions'], { relativeTo: this.route, queryParams: viewStandingInstructionsQueryParams }); + const viewStandingInstructionsQueryParams: any = { + officeId: this.clientViewData.officeId, + accountType: 'fromsavings' + }; + this.router.navigate(['standing-instructions/list-standing-instructions'], { + relativeTo: this.route, + queryParams: viewStandingInstructionsQueryParams + }); break; } } @@ -122,8 +132,7 @@ export class ClientsViewComponent implements OnInit { */ reload() { const url: string = this.router.url; - this.router.navigateByUrl(`/clients`, {skipLocationChange: true}) - .then(() => this.router.navigate([url])); + this.router.navigateByUrl(`/clients`, { skipLocationChange: true }).then(() => this.router.navigate([url])); } /** @@ -149,7 +158,8 @@ export class ClientsViewComponent implements OnInit { const unAssignStaffDialogRef = this.dialog.open(UnassignStaffDialogComponent); unAssignStaffDialogRef.afterClosed().subscribe((response: { confirm: any }) => { if (response.confirm) { - this.clientsService.executeClientCommand(this.clientViewData.id, 'unassignStaff', { staffId: this.clientViewData.staffId }) + this.clientsService + .executeClientCommand(this.clientViewData.id, 'unassignStaff', { staffId: this.clientViewData.staffId }) .subscribe(() => { this.reload(); }); @@ -185,10 +195,9 @@ export class ClientsViewComponent implements OnInit { const uploadSignatureDialogRef = this.dialog.open(UploadSignatureDialogComponent); uploadSignatureDialogRef.afterClosed().subscribe((signature: File) => { if (signature) { - this.clientsService.uploadClientSignatureImage(this.clientViewData.id, signature) - .subscribe(() => { - this.reload(); - }); + this.clientsService.uploadClientSignatureImage(this.clientViewData.id, signature).subscribe(() => { + this.reload(); + }); } }); } @@ -203,10 +212,9 @@ export class ClientsViewComponent implements OnInit { }); deleteSignatureDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.clientsService.deleteClientDocument(this.clientViewData.id, response.id) - .subscribe(() => { - this.reload(); - }); + this.clientsService.deleteClientDocument(this.clientViewData.id, response.id).subscribe(() => { + this.reload(); + }); } else if (response.upload) { this.uploadSignature(); } @@ -221,10 +229,9 @@ export class ClientsViewComponent implements OnInit { const captureImageDialogRef = this.dialog.open(CaptureImageDialogComponent); captureImageDialogRef.afterClosed().subscribe((imageURL: string) => { if (imageURL) { - this.clientsService.uploadCapturedClientProfileImage(this.clientViewData.id, imageURL) - .subscribe(() => { - this.reload(); - }); + this.clientsService.uploadCapturedClientProfileImage(this.clientViewData.id, imageURL).subscribe(() => { + this.reload(); + }); } }); } @@ -236,10 +243,9 @@ export class ClientsViewComponent implements OnInit { const uploadImageDialogRef = this.dialog.open(UploadImageDialogComponent); uploadImageDialogRef.afterClosed().subscribe((image: File) => { if (image) { - this.clientsService.uploadClientProfileImage(this.clientViewData.id, image) - .subscribe(() => { - this.reload(); - }); + this.clientsService.uploadClientProfileImage(this.clientViewData.id, image).subscribe(() => { + this.reload(); + }); } }); } @@ -253,12 +259,10 @@ export class ClientsViewComponent implements OnInit { }); deleteClientImageDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.clientsService.deleteClientProfileImage(this.clientViewData.id) - .subscribe(() => { - this.reload(); - }); + this.clientsService.deleteClientProfileImage(this.clientViewData.id).subscribe(() => { + this.reload(); + }); } }); } - } diff --git a/src/app/clients/clients-view/custom-dialogs/capture-image-dialog/capture-image-dialog.component.spec.ts b/src/app/clients/clients-view/custom-dialogs/capture-image-dialog/capture-image-dialog.component.spec.ts index e802e2671..0b4dd5ad1 100644 --- a/src/app/clients/clients-view/custom-dialogs/capture-image-dialog/capture-image-dialog.component.spec.ts +++ b/src/app/clients/clients-view/custom-dialogs/capture-image-dialog/capture-image-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('CaptureImageDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CaptureImageDialogComponent ] - }) - .compileComponents(); + declarations: [CaptureImageDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/custom-dialogs/capture-image-dialog/capture-image-dialog.component.ts b/src/app/clients/clients-view/custom-dialogs/capture-image-dialog/capture-image-dialog.component.ts index 695cfe94d..e88db0a0d 100644 --- a/src/app/clients/clients-view/custom-dialogs/capture-image-dialog/capture-image-dialog.component.ts +++ b/src/app/clients/clients-view/custom-dialogs/capture-image-dialog/capture-image-dialog.component.ts @@ -11,7 +11,6 @@ import { MatDialogRef } from '@angular/material/dialog'; styleUrls: ['./capture-image-dialog.component.scss'] }) export class CaptureImageDialogComponent implements AfterViewInit, OnDestroy { - /** Video element reference */ @ViewChild('video', { static: true }) video: ElementRef; /** Canvas element reference */ @@ -30,8 +29,10 @@ export class CaptureImageDialogComponent implements AfterViewInit, OnDestroy { * @param {MatDialogRef} dialogRef Mat Dialog Reference * @param {Renderer2} renderer Template Renderer */ - constructor(public dialogRef: MatDialogRef, - private renderer: Renderer2) {} + constructor( + public dialogRef: MatDialogRef, + private renderer: Renderer2 + ) {} ngAfterViewInit() { this.startCamera(); @@ -48,14 +49,15 @@ export class CaptureImageDialogComponent implements AfterViewInit, OnDestroy { */ startCamera() { if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { - navigator.mediaDevices.getUserMedia({ video: true }) - .then((stream: MediaStream) => { - this.renderer.setProperty(this.video.nativeElement, 'srcObject', stream); - this.video.nativeElement.play(); - }) - .catch((error: Error) => { - this.handleError(error); - }); + navigator.mediaDevices + .getUserMedia({ video: true }) + .then((stream: MediaStream) => { + this.renderer.setProperty(this.video.nativeElement, 'srcObject', stream); + this.video.nativeElement.play(); + }) + .catch((error: Error) => { + this.handleError(error); + }); } else { throw new Error('Cannot connect to camera'); } @@ -104,5 +106,4 @@ export class CaptureImageDialogComponent implements AfterViewInit, OnDestroy { this.isCaptured = false; this.video.nativeElement.play(); } - } diff --git a/src/app/clients/clients-view/custom-dialogs/delete-signature-dialog/delete-signature-dialog.component.spec.ts b/src/app/clients/clients-view/custom-dialogs/delete-signature-dialog/delete-signature-dialog.component.spec.ts index 7abb3390e..e2af04ee9 100644 --- a/src/app/clients/clients-view/custom-dialogs/delete-signature-dialog/delete-signature-dialog.component.spec.ts +++ b/src/app/clients/clients-view/custom-dialogs/delete-signature-dialog/delete-signature-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('DeleteSignatureDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DeleteSignatureDialogComponent ] - }) - .compileComponents(); + declarations: [DeleteSignatureDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/custom-dialogs/delete-signature-dialog/delete-signature-dialog.component.ts b/src/app/clients/clients-view/custom-dialogs/delete-signature-dialog/delete-signature-dialog.component.ts index 37ea5f5c9..6e9834c03 100644 --- a/src/app/clients/clients-view/custom-dialogs/delete-signature-dialog/delete-signature-dialog.component.ts +++ b/src/app/clients/clients-view/custom-dialogs/delete-signature-dialog/delete-signature-dialog.component.ts @@ -11,7 +11,6 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./delete-signature-dialog.component.scss'] }) export class DeleteSignatureDialogComponent { - /** Id of client signature in documents */ signatureId: any; @@ -19,10 +18,11 @@ export class DeleteSignatureDialogComponent { * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data Documents data */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any[]) { + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any[] + ) { const signature = this.data.find((document: any) => document.name === 'clientSignature') || {}; this.signatureId = signature.id; } - } diff --git a/src/app/clients/clients-view/custom-dialogs/edit-notes-dialog/edit-notes-dialog.component.spec.ts b/src/app/clients/clients-view/custom-dialogs/edit-notes-dialog/edit-notes-dialog.component.spec.ts index e88f1e5cd..9ec915435 100644 --- a/src/app/clients/clients-view/custom-dialogs/edit-notes-dialog/edit-notes-dialog.component.spec.ts +++ b/src/app/clients/clients-view/custom-dialogs/edit-notes-dialog/edit-notes-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('EditNotesDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditNotesDialogComponent ] - }) - .compileComponents(); + declarations: [EditNotesDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/custom-dialogs/edit-notes-dialog/edit-notes-dialog.component.ts b/src/app/clients/clients-view/custom-dialogs/edit-notes-dialog/edit-notes-dialog.component.ts index be77b87f9..efc672f65 100644 --- a/src/app/clients/clients-view/custom-dialogs/edit-notes-dialog/edit-notes-dialog.component.ts +++ b/src/app/clients/clients-view/custom-dialogs/edit-notes-dialog/edit-notes-dialog.component.ts @@ -11,9 +11,11 @@ import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms export class EditNotesDialogComponent implements OnInit { noteForm: UntypedFormGroup; - constructor(public dialogRef: MatDialogRef, + constructor( + public dialogRef: MatDialogRef, private formBuilder: UntypedFormBuilder, - @Inject(MAT_DIALOG_DATA) public data: any) { } + @Inject(MAT_DIALOG_DATA) public data: any + ) {} ngOnInit() { this.createNoteForm(); @@ -21,7 +23,10 @@ export class EditNotesDialogComponent implements OnInit { createNoteForm() { this.noteForm = this.formBuilder.group({ - 'note': [this.data.noteContent, Validators.required] + note: [ + this.data.noteContent, + Validators.required + ] }); } } diff --git a/src/app/clients/clients-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.spec.ts b/src/app/clients/clients-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.spec.ts index 1eaed45f3..bd5e9f305 100644 --- a/src/app/clients/clients-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.spec.ts +++ b/src/app/clients/clients-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('UnassignStaffDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UnassignStaffDialogComponent ] - }) - .compileComponents(); + declarations: [UnassignStaffDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.ts b/src/app/clients/clients-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.ts index e6197eba8..a1b0a7854 100644 --- a/src/app/clients/clients-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.ts +++ b/src/app/clients/clients-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.ts @@ -11,10 +11,8 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./unassign-staff-dialog.component.scss'] }) export class UnassignStaffDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. */ - constructor(public dialogRef: MatDialogRef) { } - + constructor(public dialogRef: MatDialogRef) {} } diff --git a/src/app/clients/clients-view/custom-dialogs/upload-document-dialog/upload-document-dialog.component.spec.ts b/src/app/clients/clients-view/custom-dialogs/upload-document-dialog/upload-document-dialog.component.spec.ts index 90c17e7ac..4414428bf 100644 --- a/src/app/clients/clients-view/custom-dialogs/upload-document-dialog/upload-document-dialog.component.spec.ts +++ b/src/app/clients/clients-view/custom-dialogs/upload-document-dialog/upload-document-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('UploadDocumentDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UploadDocumentDialogComponent ] - }) - .compileComponents(); + declarations: [UploadDocumentDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/custom-dialogs/upload-document-dialog/upload-document-dialog.component.ts b/src/app/clients/clients-view/custom-dialogs/upload-document-dialog/upload-document-dialog.component.ts index 1ace382c7..008de8c05 100644 --- a/src/app/clients/clients-view/custom-dialogs/upload-document-dialog/upload-document-dialog.component.ts +++ b/src/app/clients/clients-view/custom-dialogs/upload-document-dialog/upload-document-dialog.component.ts @@ -8,7 +8,6 @@ import { UntypedFormGroup, UntypedFormBuilder, Validators, FormControl } from '@ styleUrls: ['./upload-document-dialog.component.scss'] }) export class UploadDocumentDialogComponent implements OnInit { - /** Upload Document form. */ uploadDocumentForm: UntypedFormGroup; /** Upload Document Data */ @@ -23,9 +22,11 @@ export class UploadDocumentDialogComponent implements OnInit { * @param {FormBuilder} formBuilder Form Builder * @param {any} data Dialog Data */ - constructor(public dialogRef: MatDialogRef, - private formBuilder: UntypedFormBuilder, - @Inject(MAT_DIALOG_DATA) public data: any) { + constructor( + public dialogRef: MatDialogRef, + private formBuilder: UntypedFormBuilder, + @Inject(MAT_DIALOG_DATA) public data: any + ) { this.documentIdentifier = data.documentIdentifier; this.entityType = data.entityType; } @@ -39,9 +40,12 @@ export class UploadDocumentDialogComponent implements OnInit { */ createUploadDocumentForm() { this.uploadDocumentForm = this.formBuilder.group({ - 'fileName': ['', Validators.required], - 'description': [''], - 'file': [''] + fileName: [ + '', + Validators.required + ], + description: [''], + file: [''] }); } @@ -55,7 +59,4 @@ export class UploadDocumentDialogComponent implements OnInit { this.uploadDocumentForm.get('file').setValue(file); } } - } - - diff --git a/src/app/clients/clients-view/custom-dialogs/upload-image-dialog/upload-image-dialog.component.spec.ts b/src/app/clients/clients-view/custom-dialogs/upload-image-dialog/upload-image-dialog.component.spec.ts index c6c50df9f..447aed554 100644 --- a/src/app/clients/clients-view/custom-dialogs/upload-image-dialog/upload-image-dialog.component.spec.ts +++ b/src/app/clients/clients-view/custom-dialogs/upload-image-dialog/upload-image-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('UploadImageDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UploadImageDialogComponent ] - }) - .compileComponents(); + declarations: [UploadImageDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/custom-dialogs/upload-image-dialog/upload-image-dialog.component.ts b/src/app/clients/clients-view/custom-dialogs/upload-image-dialog/upload-image-dialog.component.ts index 610863723..4da8aa6f7 100644 --- a/src/app/clients/clients-view/custom-dialogs/upload-image-dialog/upload-image-dialog.component.ts +++ b/src/app/clients/clients-view/custom-dialogs/upload-image-dialog/upload-image-dialog.component.ts @@ -11,14 +11,13 @@ import { MatDialogRef } from '@angular/material/dialog'; styleUrls: ['./upload-image-dialog.component.scss'] }) export class UploadImageDialogComponent { - /** Client Image */ image: File; /** * @param {MatDialogRef} dialogRef Component reference to dialog. */ - constructor(public dialogRef: MatDialogRef) { } + constructor(public dialogRef: MatDialogRef) {} /** * Sets file form control value. @@ -29,5 +28,4 @@ export class UploadImageDialogComponent { this.image = $event.target.files[0]; } } - } diff --git a/src/app/clients/clients-view/custom-dialogs/upload-signature-dialog/upload-signature-dialog.component.spec.ts b/src/app/clients/clients-view/custom-dialogs/upload-signature-dialog/upload-signature-dialog.component.spec.ts index 8429cbbe1..76a3fc3c7 100644 --- a/src/app/clients/clients-view/custom-dialogs/upload-signature-dialog/upload-signature-dialog.component.spec.ts +++ b/src/app/clients/clients-view/custom-dialogs/upload-signature-dialog/upload-signature-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('UploadSignatureDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UploadSignatureDialogComponent ] - }) - .compileComponents(); + declarations: [UploadSignatureDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/custom-dialogs/upload-signature-dialog/upload-signature-dialog.component.ts b/src/app/clients/clients-view/custom-dialogs/upload-signature-dialog/upload-signature-dialog.component.ts index 1dc0cd4fe..5590f2e27 100644 --- a/src/app/clients/clients-view/custom-dialogs/upload-signature-dialog/upload-signature-dialog.component.ts +++ b/src/app/clients/clients-view/custom-dialogs/upload-signature-dialog/upload-signature-dialog.component.ts @@ -11,14 +11,13 @@ import { MatDialogRef } from '@angular/material/dialog'; styleUrls: ['./upload-signature-dialog.component.scss'] }) export class UploadSignatureDialogComponent { - /** Client Signature */ signature: File; /** * @param {MatDialogRef} dialogRef Component reference to dialog. */ - constructor(public dialogRef: MatDialogRef) { } + constructor(public dialogRef: MatDialogRef) {} /** * Sets file form control value. @@ -29,5 +28,4 @@ export class UploadSignatureDialogComponent { this.signature = $event.target.files[0]; } } - } diff --git a/src/app/clients/clients-view/custom-dialogs/view-signature-dialog/view-signature-dialog.component.spec.ts b/src/app/clients/clients-view/custom-dialogs/view-signature-dialog/view-signature-dialog.component.spec.ts index 0107f3d53..7d7ce54d2 100644 --- a/src/app/clients/clients-view/custom-dialogs/view-signature-dialog/view-signature-dialog.component.spec.ts +++ b/src/app/clients/clients-view/custom-dialogs/view-signature-dialog/view-signature-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewSignatureDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewSignatureDialogComponent ] - }) - .compileComponents(); + declarations: [ViewSignatureDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/custom-dialogs/view-signature-dialog/view-signature-dialog.component.ts b/src/app/clients/clients-view/custom-dialogs/view-signature-dialog/view-signature-dialog.component.ts index f021ec23c..74ed5bfca 100644 --- a/src/app/clients/clients-view/custom-dialogs/view-signature-dialog/view-signature-dialog.component.ts +++ b/src/app/clients/clients-view/custom-dialogs/view-signature-dialog/view-signature-dialog.component.ts @@ -18,7 +18,6 @@ import { Buffer } from 'buffer'; styleUrls: ['./view-signature-dialog.component.scss'] }) export class ViewSignatureDialogComponent implements OnInit { - /** Id of client signature in documents */ signatureId: any; /** Signature Image */ @@ -30,10 +29,12 @@ export class ViewSignatureDialogComponent implements OnInit { * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data Documents data */ - constructor(public dialogRef: MatDialogRef, - private clientsService: ClientsService, - private sanitizer: DomSanitizer, - @Inject(MAT_DIALOG_DATA) public data: { documents: any[], id: string }) { + constructor( + public dialogRef: MatDialogRef, + private clientsService: ClientsService, + private sanitizer: DomSanitizer, + @Inject(MAT_DIALOG_DATA) public data: { documents: any[]; id: string } + ) { const signature = this.data.documents.find((document: any) => document.name === 'clientSignature') || {}; this.signatureId = signature.id; this.clientId = this.data.id; @@ -43,11 +44,11 @@ export class ViewSignatureDialogComponent implements OnInit { if (this.signatureId) { this.clientsService.getClientSignatureImage(this.clientId, this.signatureId).subscribe( async (blob: any) => { - const buffer = Buffer.from(await blob.arrayBuffer()) + const buffer = Buffer.from(await blob.arrayBuffer()); this.signatureImage = 'data:' + blob.type + ';base64,' + buffer.toString('base64'); - }, (error: any) => {} + }, + (error: any) => {} ); } } - } diff --git a/src/app/clients/clients-view/datatable-tab/datatable-tab.component.spec.ts b/src/app/clients/clients-view/datatable-tab/datatable-tab.component.spec.ts index 1f409cd4e..c2f4a85fd 100644 --- a/src/app/clients/clients-view/datatable-tab/datatable-tab.component.spec.ts +++ b/src/app/clients/clients-view/datatable-tab/datatable-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('DatatableTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DatatableTabComponent ] - }) - .compileComponents(); + declarations: [DatatableTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/datatable-tab/datatable-tab.component.ts b/src/app/clients/clients-view/datatable-tab/datatable-tab.component.ts index 2664ee3ed..42b07bcd0 100644 --- a/src/app/clients/clients-view/datatable-tab/datatable-tab.component.ts +++ b/src/app/clients/clients-view/datatable-tab/datatable-tab.component.ts @@ -19,5 +19,4 @@ export class DatatableTabComponent { this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); } - } diff --git a/src/app/clients/clients-view/documents-tab/documents-tab.component.spec.ts b/src/app/clients/clients-view/documents-tab/documents-tab.component.spec.ts index bd6b2dd7a..92ff12dd2 100644 --- a/src/app/clients/clients-view/documents-tab/documents-tab.component.spec.ts +++ b/src/app/clients/clients-view/documents-tab/documents-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('DocumentsTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DocumentsTabComponent ] - }) - .compileComponents(); + declarations: [DocumentsTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/documents-tab/documents-tab.component.ts b/src/app/clients/clients-view/documents-tab/documents-tab.component.ts index bb6918558..ced14abbd 100644 --- a/src/app/clients/clients-view/documents-tab/documents-tab.component.ts +++ b/src/app/clients/clients-view/documents-tab/documents-tab.component.ts @@ -15,9 +15,11 @@ export class DocumentsTabComponent { entityId: string; entityType = 'clients'; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private clientsService: ClientsService, - public dialog: MatDialog) { + public dialog: MatDialog + ) { this.route.data.subscribe((data: { clientDocuments: any }) => { this.entityDocuments = data.clientDocuments; }); @@ -25,18 +27,17 @@ export class DocumentsTabComponent { } downloadDocument(documentId: string) { - this.clientsService.downloadClientDocument(this.entityId, documentId).subscribe(res => { + this.clientsService.downloadClientDocument(this.entityId, documentId).subscribe((res) => { const url = window.URL.createObjectURL(res); window.open(url); }); } deleteDocument(documentId: string) { - this.clientsService.deleteClientDocument(this.entityId, documentId).subscribe(res => {}); + this.clientsService.deleteClientDocument(this.entityId, documentId).subscribe((res) => {}); } uploadDocument(formData: FormData): any { return this.clientsService.uploadClientDocument(this.entityId, formData); } - } diff --git a/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.spec.ts b/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.spec.ts index 9a15bd49c..1adf99a43 100644 --- a/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.spec.ts +++ b/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.spec.ts @@ -8,9 +8,8 @@ describe('AddFamilyMemberComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AddFamilyMemberComponent ] - }) - .compileComponents(); + declarations: [AddFamilyMemberComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.ts b/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.ts index 6e069e2f2..95357585d 100644 --- a/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.ts +++ b/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./add-family-member.component.scss'] }) export class AddFamilyMemberComponent implements OnInit { - /** Maximum Due Date allowed. */ maxDate = new Date(); /** Minimum age allowed is 0. */ @@ -37,17 +36,18 @@ export class AddFamilyMemberComponent implements OnInit { * @param {ClientsService} clientsService Clients Service * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private dateUtils: Dates, - private router: Router, - private route: ActivatedRoute, - private clientsService: ClientsService, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private dateUtils: Dates, + private router: Router, + private route: ActivatedRoute, + private clientsService: ClientsService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { clientTemplate: any }) => { this.addFamilyMemberTemplate = data.clientTemplate.familyMemberOptions; }); this.clientId = this.route.parent.parent.snapshot.params['clientId']; - } ngOnInit() { @@ -60,17 +60,35 @@ export class AddFamilyMemberComponent implements OnInit { */ createAddFamilyMemberForm() { this.addFamilyMemberForm = this.formBuilder.group({ - 'firstName': ['', Validators.required], - 'middleName': [''], - 'lastName': ['', Validators.required], - 'qualification': [''], - 'age': ['', Validators.required], - 'isDependent': [''], - 'relationshipId': ['', Validators.required], - 'genderId': ['', Validators.required], - 'professionId': [''], - 'maritalStatusId': [''], - 'dateOfBirth': ['', Validators.required] + firstName: [ + '', + Validators.required + ], + middleName: [''], + lastName: [ + '', + Validators.required + ], + qualification: [''], + age: [ + '', + Validators.required + ], + isDependent: [''], + relationshipId: [ + '', + Validators.required + ], + genderId: [ + '', + Validators.required + ], + professionId: [''], + maritalStatusId: [''], + dateOfBirth: [ + '', + Validators.required + ] }); } @@ -90,9 +108,8 @@ export class AddFamilyMemberComponent implements OnInit { dateFormat, locale }; - this.clientsService.addFamilyMember(this.clientId, data).subscribe(res => { + this.clientsService.addFamilyMember(this.clientId, data).subscribe((res) => { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/clients/clients-view/family-members-tab/edit-family-member/edit-family-member.component.spec.ts b/src/app/clients/clients-view/family-members-tab/edit-family-member/edit-family-member.component.spec.ts index 1fdfb1889..530af10d7 100644 --- a/src/app/clients/clients-view/family-members-tab/edit-family-member/edit-family-member.component.spec.ts +++ b/src/app/clients/clients-view/family-members-tab/edit-family-member/edit-family-member.component.spec.ts @@ -8,9 +8,8 @@ describe('EditFamilyMemberComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditFamilyMemberComponent ] - }) - .compileComponents(); + declarations: [EditFamilyMemberComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/family-members-tab/edit-family-member/edit-family-member.component.ts b/src/app/clients/clients-view/family-members-tab/edit-family-member/edit-family-member.component.ts index 7fba488e4..030b5eece 100644 --- a/src/app/clients/clients-view/family-members-tab/edit-family-member/edit-family-member.component.ts +++ b/src/app/clients/clients-view/family-members-tab/edit-family-member/edit-family-member.component.ts @@ -17,8 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./edit-family-member.component.scss'] }) export class EditFamilyMemberComponent implements OnInit { - - /** Maximum Due Date allowed. */ maxDate = new Date(); /** Add family member form. */ @@ -36,13 +34,15 @@ export class EditFamilyMemberComponent implements OnInit { * @param {ClientsService} clientsService Clients Service * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private dateUtils: Dates, - private router: Router, - private route: ActivatedRoute, - private clientsService: ClientsService, - private settingsService: SettingsService) { - this.route.data.subscribe((data: { clientTemplate: any, editFamilyMember: any }) => { + constructor( + private formBuilder: UntypedFormBuilder, + private dateUtils: Dates, + private router: Router, + private route: ActivatedRoute, + private clientsService: ClientsService, + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { clientTemplate: any; editFamilyMember: any }) => { this.addFamilyMemberTemplate = data.clientTemplate.familyMemberOptions; this.familyMemberDetails = data.editFamilyMember; }); @@ -59,17 +59,35 @@ export class EditFamilyMemberComponent implements OnInit { */ createEditFamilyMemberForm(familyMember: any) { this.editFamilyMemberForm = this.formBuilder.group({ - 'firstName': [familyMember.firstName, Validators.required], - 'middleName': [familyMember.middleName], - 'lastName': [familyMember.lastName, Validators.required], - 'qualification': [familyMember.qualification], - 'age': [familyMember.age, Validators.required], - 'isDependent': [familyMember.isDependent], - 'relationshipId': [familyMember.relationshipId, Validators.required], - 'genderId': [familyMember.genderId, Validators.required], - 'professionId': [familyMember.professionId], - 'maritalStatusId': [familyMember.maritalStatusId], - 'dateOfBirth': [this.dateUtils.formatDate(familyMember.dateOfBirth, 'yyyy-MM-dd'), Validators.required] + firstName: [ + familyMember.firstName, + Validators.required + ], + middleName: [familyMember.middleName], + lastName: [ + familyMember.lastName, + Validators.required + ], + qualification: [familyMember.qualification], + age: [ + familyMember.age, + Validators.required + ], + isDependent: [familyMember.isDependent], + relationshipId: [ + familyMember.relationshipId, + Validators.required + ], + genderId: [ + familyMember.genderId, + Validators.required + ], + professionId: [familyMember.professionId], + maritalStatusId: [familyMember.maritalStatusId], + dateOfBirth: [ + this.dateUtils.formatDate(familyMember.dateOfBirth, 'yyyy-MM-dd'), + Validators.required + ] }); } @@ -89,9 +107,10 @@ export class EditFamilyMemberComponent implements OnInit { dateFormat, locale }; - this.clientsService.editFamilyMember(this.familyMemberDetails.clientId, this.familyMemberDetails.id, data).subscribe(res => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.clientsService + .editFamilyMember(this.familyMemberDetails.clientId, this.familyMemberDetails.id, data) + .subscribe((res) => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/clients/clients-view/family-members-tab/family-members-tab.component.spec.ts b/src/app/clients/clients-view/family-members-tab/family-members-tab.component.spec.ts index e11fb37fb..dec87b80a 100644 --- a/src/app/clients/clients-view/family-members-tab/family-members-tab.component.spec.ts +++ b/src/app/clients/clients-view/family-members-tab/family-members-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('FamilyMembersTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FamilyMembersTabComponent ] - }) - .compileComponents(); + declarations: [FamilyMembersTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/family-members-tab/family-members-tab.component.ts b/src/app/clients/clients-view/family-members-tab/family-members-tab.component.ts index dbb3370f9..1b03cb289 100644 --- a/src/app/clients/clients-view/family-members-tab/family-members-tab.component.ts +++ b/src/app/clients/clients-view/family-members-tab/family-members-tab.component.ts @@ -18,7 +18,6 @@ import { ClientsService } from '../../clients.service'; styleUrls: ['./family-members-tab.component.scss'] }) export class FamilyMembersTabComponent { - /** Client Family Members */ clientFamilyMembers: any; @@ -27,9 +26,11 @@ export class FamilyMembersTabComponent { * @param {ClientsService} clientsService Clients Service * @param {MatDialog }dialog Mat Dialog */ - constructor(private route: ActivatedRoute, - private clientsService: ClientsService, - public dialog: MatDialog) { + constructor( + private route: ActivatedRoute, + private clientsService: ClientsService, + public dialog: MatDialog + ) { this.route.data.subscribe((data: { clientFamilyMembers: any }) => { this.clientFamilyMembers = data.clientFamilyMembers; }); @@ -44,10 +45,9 @@ export class FamilyMembersTabComponent { }); deleteFamilyMemberDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.clientsService.deleteFamilyMember(clientId, id) - .subscribe(() => { - this.clientFamilyMembers.splice(index, 1); - }); + this.clientsService.deleteFamilyMember(clientId, id).subscribe(() => { + this.clientFamilyMembers.splice(index, 1); + }); } }); } @@ -62,5 +62,4 @@ export class FamilyMembersTabComponent { } return fullName; } - } diff --git a/src/app/clients/clients-view/general-tab/general-tab.component.spec.ts b/src/app/clients/clients-view/general-tab/general-tab.component.spec.ts index 68ff6503e..53d6cbc31 100644 --- a/src/app/clients/clients-view/general-tab/general-tab.component.spec.ts +++ b/src/app/clients/clients-view/general-tab/general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GeneralTabComponent ] - }) - .compileComponents(); + declarations: [GeneralTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/general-tab/general-tab.component.ts b/src/app/clients/clients-view/general-tab/general-tab.component.ts index ec8f428ae..e78253c58 100644 --- a/src/app/clients/clients-view/general-tab/general-tab.component.ts +++ b/src/app/clients/clients-view/general-tab/general-tab.component.ts @@ -14,23 +14,74 @@ import { ClientsService } from 'app/clients/clients.service'; styleUrls: ['./general-tab.component.scss'] }) export class GeneralTabComponent { - /** Open Loan Accounts Columns */ - openLoansColumns: string[] = ['Account No', 'Loan Account', 'Original Loan', 'Loan Balance', 'Amount Paid', 'Type', 'Actions']; + openLoansColumns: string[] = [ + 'Account No', + 'Loan Account', + 'Original Loan', + 'Loan Balance', + 'Amount Paid', + 'Type', + 'Actions' + ]; /** Closed Loan Accounts Columns */ - closedLoansColumns: string[] = ['Account No', 'Loan Account', 'Original Loan', 'Loan Balance', 'Amount Paid', 'Type', 'Closed Date']; + closedLoansColumns: string[] = [ + 'Account No', + 'Loan Account', + 'Original Loan', + 'Loan Balance', + 'Amount Paid', + 'Type', + 'Closed Date' + ]; /** Open Savings Accounts Columns */ - openSavingsColumns: string[] = ['Account No', 'Saving Account', 'Last Active', 'Balance', 'Actions']; + openSavingsColumns: string[] = [ + 'Account No', + 'Saving Account', + 'Last Active', + 'Balance', + 'Actions' + ]; /** Closed Savings Accounts Columns */ - closedSavingsColumns: string[] = ['Account No', 'Saving Account', 'Closed Date']; + closedSavingsColumns: string[] = [ + 'Account No', + 'Saving Account', + 'Closed Date' + ]; /** Open Shares Accounts Columns */ - openSharesColumns: string[] = ['Account No', 'Share Account', 'Approved Shares', 'Pending For Approval Shares', 'Actions']; + openSharesColumns: string[] = [ + 'Account No', + 'Share Account', + 'Approved Shares', + 'Pending For Approval Shares', + 'Actions' + ]; /** Closed Shares Accounts Columns */ - closedSharesColumns: string[] = ['Account No', 'Share Account', 'Approved Shares', 'Pending For Approval Shares', 'Closed Date']; + closedSharesColumns: string[] = [ + 'Account No', + 'Share Account', + 'Approved Shares', + 'Pending For Approval Shares', + 'Closed Date' + ]; /** Upcoming Charges Columns */ - upcomingChargesColumns: string[] = ['Name', 'Due as of', 'Due', 'Paid', 'Waived', 'Outstanding', 'Actions']; + upcomingChargesColumns: string[] = [ + 'Name', + 'Due as of', + 'Due', + 'Paid', + 'Waived', + 'Outstanding', + 'Actions' + ]; /** Collaterals Column */ - collateralsColumns: string[] = ['ID', 'Name', 'Quantity', 'Total Value', 'Total Collateral Value']; + collateralsColumns: string[] = [ + 'ID', + 'Name', + 'Quantity', + 'Total Value', + 'Total Collateral Value' + ]; /** Client Account Data */ clientAccountData: any; @@ -71,16 +122,18 @@ export class GeneralTabComponent { private clientService: ClientsService, private router: Router ) { - this.route.data.subscribe((data: { clientAccountsData: any, clientChargesData: any, clientSummary: any, clientCollateralData: any }) => { - this.clientAccountData = data.clientAccountsData; - this.savingAccounts = data.clientAccountsData.savingsAccounts; - this.loanAccounts = data.clientAccountsData.loanAccounts; - this.shareAccounts = data.clientAccountsData.shareAccounts; - this.upcomingCharges = data.clientChargesData.pageItems; - this.collaterals = data.clientCollateralData; - this.clientSummary = data.clientSummary ? data.clientSummary[0] : []; - this.clientid = this.route.parent.snapshot.params['clientId']; - }); + this.route.data.subscribe( + (data: { clientAccountsData: any; clientChargesData: any; clientSummary: any; clientCollateralData: any }) => { + this.clientAccountData = data.clientAccountsData; + this.savingAccounts = data.clientAccountsData.savingsAccounts; + this.loanAccounts = data.clientAccountsData.loanAccounts; + this.shareAccounts = data.clientAccountsData.shareAccounts; + this.upcomingCharges = data.clientChargesData.pageItems; + this.collaterals = data.clientCollateralData; + this.clientSummary = data.clientSummary ? data.clientSummary[0] : []; + this.clientid = this.route.parent.snapshot.params['clientId']; + } + ); } /** @@ -124,7 +177,7 @@ export class GeneralTabComponent { * @param clientId Selected Client Id. */ waiveCharge(chargeId: string, clientId: string) { - const charge = { clientId: clientId.toString(), resourceType: chargeId}; + const charge = { clientId: clientId.toString(), resourceType: chargeId }; this.clientService.waiveClientCharge(charge).subscribe(() => { this.getChargeData(clientId); }); @@ -153,7 +206,16 @@ export class GeneralTabComponent { */ routeTransferFund(loanId: any) { const queryParams: any = { loanId: loanId, accountType: 'fromloans' }; - this.router.navigate(['../', 'loans-accounts', loanId, 'transfer-funds', 'make-account-transfer'], { relativeTo: this.route, queryParams: queryParams }); + this.router.navigate( + [ + '../', + 'loans-accounts', + loanId, + 'transfer-funds', + 'make-account-transfer' + ], + { relativeTo: this.route, queryParams: queryParams } + ); } viewAccountsLabel(closed: boolean): string { @@ -163,5 +225,4 @@ export class GeneralTabComponent { return 'labels.buttons.View Closed Accounts'; } } - } diff --git a/src/app/clients/clients-view/identities-tab/identities-tab.component.spec.ts b/src/app/clients/clients-view/identities-tab/identities-tab.component.spec.ts index 2e8f3ce8b..6baa88a2d 100644 --- a/src/app/clients/clients-view/identities-tab/identities-tab.component.spec.ts +++ b/src/app/clients/clients-view/identities-tab/identities-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('IdentitiesTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ IdentitiesTabComponent ] - }) - .compileComponents(); + declarations: [IdentitiesTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/identities-tab/identities-tab.component.ts b/src/app/clients/clients-view/identities-tab/identities-tab.component.ts index cb25e3886..67358add8 100644 --- a/src/app/clients/clients-view/identities-tab/identities-tab.component.ts +++ b/src/app/clients/clients-view/identities-tab/identities-tab.component.ts @@ -27,7 +27,6 @@ import { ClientsService } from '../../clients.service'; styleUrls: ['./identities-tab.component.scss'] }) export class IdentitiesTabComponent { - /** Client Identities */ clientIdentities: any; /** Client Identifier Template */ @@ -35,7 +34,15 @@ export class IdentitiesTabComponent { /** Client Id */ clientId: string; /** Identities Columns */ - identitiesColumns: string[] = ['id', 'description', 'type', 'documentKey', 'documents', 'status', 'actions']; + identitiesColumns: string[] = [ + 'id', + 'description', + 'type', + 'documentKey', + 'documents', + 'status', + 'actions' + ]; /** Identifiers Table */ @ViewChild('identifiersTable', { static: true }) identifiersTable: MatTable; @@ -45,12 +52,14 @@ export class IdentitiesTabComponent { * @param {MatDialog} dialog Mat Dialog * @param {ClientsService} clientService Clients Service */ - constructor(private route: ActivatedRoute, - private dialog: MatDialog, - private clientService: ClientsService, - private translateService: TranslateService) { + constructor( + private route: ActivatedRoute, + private dialog: MatDialog, + private clientService: ClientsService, + private translateService: TranslateService + ) { this.clientId = this.route.parent.snapshot.paramMap.get('clientId'); - this.route.data.subscribe((data: { clientIdentities: any, clientIdentifierTemplate: any }) => { + this.route.data.subscribe((data: { clientIdentities: any; clientIdentifierTemplate: any }) => { this.clientIdentities = data.clientIdentities; this.clientIdentifierTemplate = data.clientIdentifierTemplate; }); @@ -62,7 +71,7 @@ export class IdentitiesTabComponent { * @param {string} documentId Document ID */ download(parentEntityId: string, documentId: string) { - this.clientService.downloadClientIdentificationDocument(parentEntityId, documentId).subscribe(res => { + this.clientService.downloadClientIdentificationDocument(parentEntityId, documentId).subscribe((res) => { const url = window.URL.createObjectURL(res); window.open(url); }); @@ -73,7 +82,9 @@ export class IdentitiesTabComponent { */ addIdentifier() { for (let index = 0; index < this.clientIdentifierTemplate.allowedDocumentTypes.length; index++) { - this.clientIdentifierTemplate.allowedDocumentTypes[index].name = this.translateService.instant(`labels.catalogs.${this.clientIdentifierTemplate.allowedDocumentTypes[index].name}`); + this.clientIdentifierTemplate.allowedDocumentTypes[index].name = this.translateService.instant( + `labels.catalogs.${this.clientIdentifierTemplate.allowedDocumentTypes[index].name}` + ); } const formfields: FormfieldBase[] = [ new SelectBase({ @@ -88,10 +99,14 @@ export class IdentitiesTabComponent { controlName: 'status', label: this.translateService.instant('labels.inputs.Status'), value: '2', - options: { label: 'label', value: 'value', data: [ - { label: this.translateService.instant('labels.catalogs.Active'), value: 'Active' }, - { label: this.translateService.instant('labels.catalogs.Inactive'), value: 'Inactive' } - ] }, + options: { + label: 'label', + value: 'value', + data: [ + { label: this.translateService.instant('labels.catalogs.Active'), value: 'Active' }, + { label: this.translateService.instant('labels.catalogs.Inactive'), value: 'Inactive' } + ] + }, required: true, order: 2 }), @@ -110,6 +125,7 @@ export class IdentitiesTabComponent { type: 'text', order: 4 }) + ]; const data = { title: this.translateService.instant('labels.heading.Add Client Identifier'), @@ -122,11 +138,16 @@ export class IdentitiesTabComponent { this.clientIdentities.push({ id: res.resourceId, description: response.data.value.description, - documentType: this.clientIdentifierTemplate.allowedDocumentTypes.filter((doc: any) => (doc.id === response.data.value.documentTypeId))[0], + documentType: this.clientIdentifierTemplate.allowedDocumentTypes.filter( + (doc: any) => doc.id === response.data.value.documentTypeId + )[0], documentKey: response.data.value.documentKey, documents: [], clientId: this.clientId, - status: (response.data.value.status === 'Active' ? 'clientIdentifierStatusType.active' : 'clientIdentifierStatusType.inactive') + status: + response.data.value.status === 'Active' + ? 'clientIdentifierStatusType.active' + : 'clientIdentifierStatusType.inactive' }); this.identifiersTable.renderRows(); }); @@ -146,7 +167,7 @@ export class IdentitiesTabComponent { }); deleteIdentifierDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.clientService.deleteClientIdentifier(clientId, identifierId).subscribe(res => { + this.clientService.deleteClientIdentifier(clientId, identifierId).subscribe((res) => { this.clientIdentities.splice(index, 1); this.identifiersTable.renderRows(); }); @@ -165,7 +186,7 @@ export class IdentitiesTabComponent { }); uploadDocumentDialogRef.afterClosed().subscribe((dialogResponse: any) => { if (dialogResponse) { - const formData: FormData = new FormData; + const formData: FormData = new FormData(); formData.append('name', dialogResponse.fileName); formData.append('file', dialogResponse.file); this.clientService.uploadClientIdentifierDocument(identifierId, formData).subscribe((res: any) => { @@ -181,5 +202,4 @@ export class IdentitiesTabComponent { } }); } - } diff --git a/src/app/clients/clients-view/notes-tab/notes-tab.component.spec.ts b/src/app/clients/clients-view/notes-tab/notes-tab.component.spec.ts index add42af72..338a5d831 100644 --- a/src/app/clients/clients-view/notes-tab/notes-tab.component.spec.ts +++ b/src/app/clients/clients-view/notes-tab/notes-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('NotesTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ NotesTabComponent ] - }) - .compileComponents(); + declarations: [NotesTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/clients-view/notes-tab/notes-tab.component.ts b/src/app/clients/clients-view/notes-tab/notes-tab.component.ts index ed53d0414..600cd356a 100644 --- a/src/app/clients/clients-view/notes-tab/notes-tab.component.ts +++ b/src/app/clients/clients-view/notes-tab/notes-tab.component.ts @@ -17,7 +17,6 @@ import { AuthenticationService } from 'app/core/authentication/authentication.se styleUrls: ['./notes-tab.component.scss'] }) export class NotesTabComponent { - /** Client ID */ entityId: string; /** Username */ @@ -30,9 +29,11 @@ export class NotesTabComponent { * @param {ClientsService} clientsService Clients Service * @param {AuthenticationService} authenticationService Authentication Service */ - constructor(private route: ActivatedRoute, - private clientsService: ClientsService, - private authenticationService: AuthenticationService) { + constructor( + private route: ActivatedRoute, + private clientsService: ClientsService, + private authenticationService: AuthenticationService + ) { const credentials = this.authenticationService.getCredentials(); this.username = credentials.username; this.entityId = this.route.parent.snapshot.params['clientId']; @@ -59,10 +60,9 @@ export class NotesTabComponent { * @param {number} index Index */ deleteNote(noteId: string, index: number) { - this.clientsService.deleteClientNote(this.entityId, noteId) - .subscribe(() => { - this.entityNotes.splice(index, 1); - }); + this.clientsService.deleteClientNote(this.entityId, noteId).subscribe(() => { + this.entityNotes.splice(index, 1); + }); } /** @@ -78,5 +78,4 @@ export class NotesTabComponent { }); }); } - } diff --git a/src/app/clients/clients.component.ts b/src/app/clients/clients.component.ts index e35622597..aa765a24e 100644 --- a/src/app/clients/clients.component.ts +++ b/src/app/clients/clients.component.ts @@ -12,12 +12,18 @@ import { ClientsService } from './clients.service'; @Component({ selector: 'mifosx-clients', templateUrl: './clients.component.html', - styleUrls: ['./clients.component.scss'], + styleUrls: ['./clients.component.scss'] }) export class ClientsComponent implements OnInit { @ViewChild('showClosedAccounts') showClosedAccounts: MatCheckbox; - displayedColumns = ['displayName', 'accountNumber', 'externalId', 'status', 'officeName']; + displayedColumns = [ + 'displayName', + 'accountNumber', + 'externalId', + 'status', + 'officeName' + ]; dataSource: MatTableDataSource = new MatTableDataSource(); existsClientsToFilter = false; @@ -36,7 +42,7 @@ export class ClientsComponent implements OnInit { @ViewChild(MatPaginator) paginator: MatPaginator; @ViewChild(MatSort) sort: MatSort; - constructor(private clientService: ClientsService) { } + constructor(private clientService: ClientsService) {} ngOnInit() { if (environment.preloadClients) { @@ -55,18 +61,22 @@ export class ClientsComponent implements OnInit { private getClients() { this.isLoading = true; - this.clientService.searchByText(this.filterText, this.currentPage, this.pageSize, this.sortAttribute, this.sortDirection) - .subscribe((data: any) => { - this.dataSource.data = data.content; + this.clientService + .searchByText(this.filterText, this.currentPage, this.pageSize, this.sortAttribute, this.sortDirection) + .subscribe( + (data: any) => { + this.dataSource.data = data.content; - this.totalRows = data.totalElements; + this.totalRows = data.totalElements; - this.existsClientsToFilter = (data.numberOfElements > 0); - this.notExistsClientsToFilter = !this.existsClientsToFilter; - this.isLoading = false; - }, (error: any) => { - this.isLoading = false; - }); + this.existsClientsToFilter = data.numberOfElements > 0; + this.notExistsClientsToFilter = !this.existsClientsToFilter; + this.isLoading = false; + }, + (error: any) => { + this.isLoading = false; + } + ); } pageChanged(event: PageEvent) { diff --git a/src/app/clients/clients.module.ts b/src/app/clients/clients.module.ts index 4ff9fa5ca..247b2d42d 100644 --- a/src/app/clients/clients.module.ts +++ b/src/app/clients/clients.module.ts @@ -58,7 +58,6 @@ import { CreateSelfServiceUserComponent } from './clients-view/client-actions/cr import { AddClientCollateralComponent } from './clients-view/client-actions/add-client-collateral/add-client-collateral.component'; import { ClientDatatableStepComponent } from './client-stepper/client-datatable-step/client-datatable-step.component'; - /** * Clients Module * @@ -122,7 +121,6 @@ import { ClientDatatableStepComponent } from './client-stepper/client-datatable- AddClientCollateralComponent, ClientDatatableStepComponent ], - providers: [ ] - + providers: [] }) -export class ClientsModule { } +export class ClientsModule {} diff --git a/src/app/clients/clients.service.ts b/src/app/clients/clients.service.ts index 2ff74d71b..86b503dd0 100644 --- a/src/app/clients/clients.service.ts +++ b/src/app/clients/clients.service.ts @@ -14,9 +14,15 @@ export class ClientsService { /** * @param {HttpClient} http Http Client to send requests. */ - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} - getFilteredClients(orderBy: string, sortOrder: string, orphansOnly: boolean, displayName: string, officeId?: any): Observable { + getFilteredClients( + orderBy: string, + sortOrder: string, + orphansOnly: boolean, + displayName: string, + officeId?: any + ): Observable { let httpParams = new HttpParams() .set('displayName', displayName) .set('orphansOnly', orphansOnly.toString()) @@ -62,9 +68,7 @@ export class ClientsService { } getClientDataAndTemplate(clientId: string) { - const httpParams = new HttpParams() - .set('template', 'true') - .set('staffInSelectedOfficeOnly', 'true'); + const httpParams = new HttpParams().set('template', 'true').set('staffInSelectedOfficeOnly', 'true'); return this.http.get(`/clients/${clientId}`, { params: httpParams }); } @@ -112,7 +116,9 @@ export class ClientsService { */ waiveClientCharge(chargeData: any) { const httpParams = new HttpParams().set('command', 'waive'); - return this.http.post(`/clients/${chargeData.clientId}/charges/${chargeData.resourceType}`, chargeData, { params: httpParams }); + return this.http.post(`/clients/${chargeData.clientId}/charges/${chargeData.resourceType}`, chargeData, { + params: httpParams + }); } getAllClientCharges(clientId: string) { @@ -123,7 +129,10 @@ export class ClientsService { * @param transactionData Transaction Data to be undone. */ undoTransaction(transactionData: any) { - return this.http.post(`/clients/${transactionData.clientId}/transactions/${transactionData.transactionId}?command=undo`, transactionData); + return this.http.post( + `/clients/${transactionData.clientId}/transactions/${transactionData.transactionId}?command=undo`, + transactionData + ); } /** @@ -149,18 +158,21 @@ export class ClientsService { */ payClientCharge(clientId: string, chargeId: string, payment: any) { const httpParams = new HttpParams().set('command', 'paycharge'); - return this.http.post(`/clients/${clientId}/charges/${chargeId}?command=paycharge`, payment, { params: httpParams }); + return this.http.post(`/clients/${clientId}/charges/${chargeId}?command=paycharge`, payment, { + params: httpParams + }); } getClientSummary(clientId: string) { - const httpParams = new HttpParams().set('R_clientId', clientId) - .set('genericResultSet', 'false'); + const httpParams = new HttpParams().set('R_clientId', clientId).set('genericResultSet', 'false'); return this.http.get(`/runreports/ClientSummary`, { params: httpParams }); } getClientProfileImage(clientId: string) { const httpParams = new HttpParams().set('maxHeight', '150'); - return this.http.skipErrorHandler().get(`/clients/${clientId}/images`, { params: httpParams, responseType: 'text' }); + return this.http + .skipErrorHandler() + .get(`/clients/${clientId}/images`, { params: httpParams, responseType: 'text' }); } uploadClientProfileImage(clientId: string, image: File) { @@ -231,7 +243,9 @@ export class ClientsService { } downloadClientIdentificationDocument(parentEntityId: string, documentId: string) { - return this.http.get(`/client_identifiers/${parentEntityId}/documents/${documentId}/attachment`, { responseType: 'blob' }); + return this.http.get(`/client_identifiers/${parentEntityId}/documents/${documentId}/attachment`, { + responseType: 'blob' + }); } uploadClientIdentifierDocument(identifierId: string, documentData: any) { @@ -318,9 +332,7 @@ export class ClientsService { } getClientReportTemplates() { - const httpParams = new HttpParams() - .set('entityId', '0') - .set('typeId', '0'); + const httpParams = new HttpParams().set('entityId', '0').set('typeId', '0'); return this.http.get('/templates', { params: httpParams }); } @@ -384,19 +396,19 @@ export class ClientsService { searchByText(text: string, page: number, pageSize: number, sortAttribute: string = '', sortDirection: string = '') { let request: any = { - request: { - text - }, - page, - size: pageSize + request: { + text + }, + page, + size: pageSize }; if (sortAttribute !== '' && sortDirection !== '') { request = { ...request, sorts: [ { - direction: sortDirection, - property: sortAttribute + direction: sortDirection, + property: sortAttribute } ] }; diff --git a/src/app/clients/common-resolvers/client-accounts.resolver.ts b/src/app/clients/common-resolvers/client-accounts.resolver.ts index 1ae7f08bb..c699451be 100644 --- a/src/app/clients/common-resolvers/client-accounts.resolver.ts +++ b/src/app/clients/common-resolvers/client-accounts.resolver.ts @@ -13,19 +13,17 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientAccountsResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client Account data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.paramMap.get('clientId'); - return this.clientsService.getClientAccountData(clientId); - } - + /** + * Returns the Client Account data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.paramMap.get('clientId'); + return this.clientsService.getClientAccountData(clientId); + } } diff --git a/src/app/clients/common-resolvers/client-actions.resolver.ts b/src/app/clients/common-resolvers/client-actions.resolver.ts index 671541a02..54d3032bd 100644 --- a/src/app/clients/common-resolvers/client-actions.resolver.ts +++ b/src/app/clients/common-resolvers/client-actions.resolver.ts @@ -14,13 +14,14 @@ import { ProductsService } from 'app/products/products.service'; */ @Injectable() export class ClientActionsResolver implements Resolve { - /** * @param {ClientsService} clientsService Clients service. * @param {ProductsService} productsService Products Service */ - constructor(private clientsService: ClientsService, - private productsService: ProductsService) { } + constructor( + private clientsService: ClientsService, + private productsService: ProductsService + ) {} /** * Returns the clients actions data. @@ -62,5 +63,4 @@ export class ClientActionsResolver implements Resolve { return undefined; } } - } diff --git a/src/app/clients/common-resolvers/client-address-fieldconfiguration.resolver.ts b/src/app/clients/common-resolvers/client-address-fieldconfiguration.resolver.ts index d93b311fc..3b2b29d04 100644 --- a/src/app/clients/common-resolvers/client-address-fieldconfiguration.resolver.ts +++ b/src/app/clients/common-resolvers/client-address-fieldconfiguration.resolver.ts @@ -13,18 +13,16 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientAddressFieldConfigurationResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client Address Field Configuration. - * @returns {Observable} - */ - resolve(): Observable { - return this.clientsService.getAddressFieldConfiguration(); - } - + /** + * Returns the Client Address Field Configuration. + * @returns {Observable} + */ + resolve(): Observable { + return this.clientsService.getAddressFieldConfiguration(); + } } diff --git a/src/app/clients/common-resolvers/client-address-template.resolver.ts b/src/app/clients/common-resolvers/client-address-template.resolver.ts index 495ce42a6..951d0a20e 100644 --- a/src/app/clients/common-resolvers/client-address-template.resolver.ts +++ b/src/app/clients/common-resolvers/client-address-template.resolver.ts @@ -13,18 +13,16 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientAddressTemplateResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client Address Field Configuration. - * @returns {Observable} - */ - resolve(): Observable { - return this.clientsService.getClientAddressTemplate(); - } - + /** + * Returns the Client Address Field Configuration. + * @returns {Observable} + */ + resolve(): Observable { + return this.clientsService.getClientAddressTemplate(); + } } diff --git a/src/app/clients/common-resolvers/client-address.resolver.ts b/src/app/clients/common-resolvers/client-address.resolver.ts index fd2822410..3af43b8c5 100644 --- a/src/app/clients/common-resolvers/client-address.resolver.ts +++ b/src/app/clients/common-resolvers/client-address.resolver.ts @@ -13,19 +13,17 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientAddressResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client Address data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.paramMap.get('clientId'); - return this.clientsService.getClientAddressData(clientId); - } - + /** + * Returns the Client Address data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.paramMap.get('clientId'); + return this.clientsService.getClientAddressData(clientId); + } } diff --git a/src/app/clients/common-resolvers/client-and-template.resolver.ts b/src/app/clients/common-resolvers/client-and-template.resolver.ts index 6216fed48..a05312746 100644 --- a/src/app/clients/common-resolvers/client-and-template.resolver.ts +++ b/src/app/clients/common-resolvers/client-and-template.resolver.ts @@ -13,11 +13,10 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientDataAndTemplateResolver implements Resolve { - /** * @param {ClientsService} ClientsService Clients service. */ - constructor(private clientsService: ClientsService) { } + constructor(private clientsService: ClientsService) {} /** * Returns the Clients data and template. @@ -27,5 +26,4 @@ export class ClientDataAndTemplateResolver implements Resolve { const clientId = route.paramMap.get('clientId'); return this.clientsService.getClientDataAndTemplate(clientId); } - } diff --git a/src/app/clients/common-resolvers/client-charge-view.resolver.ts b/src/app/clients/common-resolvers/client-charge-view.resolver.ts index 42ee23102..bf854e847 100644 --- a/src/app/clients/common-resolvers/client-charge-view.resolver.ts +++ b/src/app/clients/common-resolvers/client-charge-view.resolver.ts @@ -13,20 +13,18 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientChargeViewResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client Charge data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.parent.parent.paramMap.get('clientId'); - const chargeId = route.paramMap.get('chargeId'); - return this.clientsService.getSelectedChargeData(clientId, chargeId); - } - + /** + * Returns the Client Charge data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.parent.parent.paramMap.get('clientId'); + const chargeId = route.paramMap.get('chargeId'); + return this.clientsService.getSelectedChargeData(clientId, chargeId); + } } diff --git a/src/app/clients/common-resolvers/client-charges.resolver.ts b/src/app/clients/common-resolvers/client-charges.resolver.ts index 58fadfb83..ee620b243 100644 --- a/src/app/clients/common-resolvers/client-charges.resolver.ts +++ b/src/app/clients/common-resolvers/client-charges.resolver.ts @@ -13,19 +13,17 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientChargesResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client Charge data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.paramMap.get('clientId'); - return this.clientsService.getClientChargesData(clientId); - } - + /** + * Returns the Client Charge data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.paramMap.get('clientId'); + return this.clientsService.getClientChargesData(clientId); + } } diff --git a/src/app/clients/common-resolvers/client-collateral.resolver.ts b/src/app/clients/common-resolvers/client-collateral.resolver.ts index fbd97dd97..577a25cff 100644 --- a/src/app/clients/common-resolvers/client-collateral.resolver.ts +++ b/src/app/clients/common-resolvers/client-collateral.resolver.ts @@ -13,19 +13,17 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientCollateralResolver implements Resolve { + /** + * @param {ClientsService} clientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} clientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client Collateral data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.paramMap.get('clientId'); - return this.clientsService.getCollateralTemplate(clientId); - } - + /** + * Returns the Client Collateral data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.paramMap.get('clientId'); + return this.clientsService.getCollateralTemplate(clientId); + } } diff --git a/src/app/clients/common-resolvers/client-datatable.resolver.ts b/src/app/clients/common-resolvers/client-datatable.resolver.ts index f18167848..a232a77ec 100644 --- a/src/app/clients/common-resolvers/client-datatable.resolver.ts +++ b/src/app/clients/common-resolvers/client-datatable.resolver.ts @@ -13,20 +13,18 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientDatatableResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client datatables. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.parent.paramMap.get('clientId'); - const datatableName = route.paramMap.get('datatableName'); - return this.clientsService.getClientDatatable(clientId, datatableName); - } - + /** + * Returns the Client datatables. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.parent.paramMap.get('clientId'); + const datatableName = route.paramMap.get('datatableName'); + return this.clientsService.getClientDatatable(clientId, datatableName); + } } diff --git a/src/app/clients/common-resolvers/client-datatables.resolver.ts b/src/app/clients/common-resolvers/client-datatables.resolver.ts index 14d9d800d..e897322fc 100644 --- a/src/app/clients/common-resolvers/client-datatables.resolver.ts +++ b/src/app/clients/common-resolvers/client-datatables.resolver.ts @@ -13,18 +13,16 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientDatatablesResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client datatables. - * @returns {Observable} - */ - resolve(): Observable { - return this.clientsService.getClientDatatables(); - } - + /** + * Returns the Client datatables. + * @returns {Observable} + */ + resolve(): Observable { + return this.clientsService.getClientDatatables(); + } } diff --git a/src/app/clients/common-resolvers/client-document.resolver.ts b/src/app/clients/common-resolvers/client-document.resolver.ts index d79c1a525..12640b7d5 100644 --- a/src/app/clients/common-resolvers/client-document.resolver.ts +++ b/src/app/clients/common-resolvers/client-document.resolver.ts @@ -13,19 +13,17 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientDocumentsResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client's Documents data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.paramMap.get('clientId'); - return this.clientsService.getClientDocuments(clientId); - } - + /** + * Returns the Client's Documents data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.paramMap.get('clientId'); + return this.clientsService.getClientDocuments(clientId); + } } diff --git a/src/app/clients/common-resolvers/client-family-member.resolver.ts b/src/app/clients/common-resolvers/client-family-member.resolver.ts index d800a5c71..5efdda35c 100644 --- a/src/app/clients/common-resolvers/client-family-member.resolver.ts +++ b/src/app/clients/common-resolvers/client-family-member.resolver.ts @@ -13,20 +13,18 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientFamilyMemberResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Clients data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.parent.parent.paramMap.get('clientId'); - const familyMemberId = route.parent.paramMap.get('familyMemberId'); - return this.clientsService.getClientFamilyMember(clientId, familyMemberId); - } - + /** + * Returns the Clients data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.parent.parent.paramMap.get('clientId'); + const familyMemberId = route.parent.paramMap.get('familyMemberId'); + return this.clientsService.getClientFamilyMember(clientId, familyMemberId); + } } diff --git a/src/app/clients/common-resolvers/client-family-members.resolver.ts b/src/app/clients/common-resolvers/client-family-members.resolver.ts index e9a4a533f..5e40e3234 100644 --- a/src/app/clients/common-resolvers/client-family-members.resolver.ts +++ b/src/app/clients/common-resolvers/client-family-members.resolver.ts @@ -13,19 +13,17 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientFamilyMembersResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Clients data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.parent.paramMap.get('clientId'); - return this.clientsService.getClientFamilyMembers(clientId); - } - + /** + * Returns the Clients data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.parent.paramMap.get('clientId'); + return this.clientsService.getClientFamilyMembers(clientId); + } } diff --git a/src/app/clients/common-resolvers/client-identifier-template.resolver.ts b/src/app/clients/common-resolvers/client-identifier-template.resolver.ts index 28f38cfee..2afd4e1f9 100644 --- a/src/app/clients/common-resolvers/client-identifier-template.resolver.ts +++ b/src/app/clients/common-resolvers/client-identifier-template.resolver.ts @@ -5,7 +5,6 @@ import { Resolve, ActivatedRouteSnapshot } from '@angular/router'; /** rxjs Imports */ import { Observable } from 'rxjs'; - /** Custom Services */ import { ClientsService } from '../clients.service'; @@ -14,17 +13,16 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientIdentifierTemplateResolver implements Resolve { - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - /** - * Returns the Client Identities data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.paramMap.get('clientId'); - return this.clientsService.getClientIdentifierTemplate(clientId); - } + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} + /** + * Returns the Client Identities data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.paramMap.get('clientId'); + return this.clientsService.getClientIdentifierTemplate(clientId); + } } - diff --git a/src/app/clients/common-resolvers/client-identities.resolver.ts b/src/app/clients/common-resolvers/client-identities.resolver.ts index f83322f5c..574cb6b72 100644 --- a/src/app/clients/common-resolvers/client-identities.resolver.ts +++ b/src/app/clients/common-resolvers/client-identities.resolver.ts @@ -14,29 +14,31 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientIdentitiesResolver implements Resolve { - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - /** - * Returns the Client Identities data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.paramMap.get('clientId'); - let identitiesData: any; - return this.clientsService.getClientIdentifiers(clientId).pipe(map((identities: any) => { - identitiesData = identities; - const docObservable: Observable[] = []; - identities.forEach((identity: any) => { - docObservable.push(this.clientsService.getClientIdentificationDocuments(identity.id)); - }); - forkJoin(docObservable).subscribe(documents => { - documents.forEach((document, index) => { - identitiesData[index].documents = document; - }); - }); - return identitiesData; - })); - } + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} + /** + * Returns the Client Identities data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.paramMap.get('clientId'); + let identitiesData: any; + return this.clientsService.getClientIdentifiers(clientId).pipe( + map((identities: any) => { + identitiesData = identities; + const docObservable: Observable[] = []; + identities.forEach((identity: any) => { + docObservable.push(this.clientsService.getClientIdentificationDocuments(identity.id)); + }); + forkJoin(docObservable).subscribe((documents) => { + documents.forEach((document, index) => { + identitiesData[index].documents = document; + }); + }); + return identitiesData; + }) + ); + } } diff --git a/src/app/clients/common-resolvers/client-notes.resolver.ts b/src/app/clients/common-resolvers/client-notes.resolver.ts index 41592e9f1..cc2d14960 100644 --- a/src/app/clients/common-resolvers/client-notes.resolver.ts +++ b/src/app/clients/common-resolvers/client-notes.resolver.ts @@ -13,19 +13,17 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientNotesResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client's Notes. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.paramMap.get('clientId'); - return this.clientsService.getClientNotes(clientId); - } - + /** + * Returns the Client's Notes. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.paramMap.get('clientId'); + return this.clientsService.getClientNotes(clientId); + } } diff --git a/src/app/clients/common-resolvers/client-summary.resolver.ts b/src/app/clients/common-resolvers/client-summary.resolver.ts index 35c31492a..14dbc4d4c 100644 --- a/src/app/clients/common-resolvers/client-summary.resolver.ts +++ b/src/app/clients/common-resolvers/client-summary.resolver.ts @@ -13,19 +13,17 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientSummaryResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client Summary data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.paramMap.get('clientId'); - return this.clientsService.getClientSummary(clientId); - } - + /** + * Returns the Client Summary data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.paramMap.get('clientId'); + return this.clientsService.getClientSummary(clientId); + } } diff --git a/src/app/clients/common-resolvers/client-template.resolver.ts b/src/app/clients/common-resolvers/client-template.resolver.ts index 3c7718da6..9e31853d8 100644 --- a/src/app/clients/common-resolvers/client-template.resolver.ts +++ b/src/app/clients/common-resolvers/client-template.resolver.ts @@ -13,18 +13,16 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientTemplateResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client Template data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - return this.clientsService.getClientTemplate(); - } - + /** + * Returns the Client Template data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + return this.clientsService.getClientTemplate(); + } } diff --git a/src/app/clients/common-resolvers/client-transaction-pay.resolver.ts b/src/app/clients/common-resolvers/client-transaction-pay.resolver.ts index c33fa0822..5c2c2b12a 100644 --- a/src/app/clients/common-resolvers/client-transaction-pay.resolver.ts +++ b/src/app/clients/common-resolvers/client-transaction-pay.resolver.ts @@ -13,20 +13,18 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientTransactionPayResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Client Transaction data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.parent.parent.paramMap.get('clientId'); - const chargeId = route.paramMap.get('chargeId'); - return this.clientsService.getClientTransactionPay(clientId, chargeId); - } - + /** + * Returns the Client Transaction data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.parent.parent.paramMap.get('clientId'); + const chargeId = route.paramMap.get('chargeId'); + return this.clientsService.getClientTransactionPay(clientId, chargeId); + } } diff --git a/src/app/clients/common-resolvers/client-view.resolver.ts b/src/app/clients/common-resolvers/client-view.resolver.ts index 16f82f472..3764e869c 100644 --- a/src/app/clients/common-resolvers/client-view.resolver.ts +++ b/src/app/clients/common-resolvers/client-view.resolver.ts @@ -13,19 +13,17 @@ import { ClientsService } from '../clients.service'; */ @Injectable() export class ClientViewResolver implements Resolve { + /** + * @param {ClientsService} ClientsService Clients service. + */ + constructor(private clientsService: ClientsService) {} - /** - * @param {ClientsService} ClientsService Clients service. - */ - constructor(private clientsService: ClientsService) { } - - /** - * Returns the Clients data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.paramMap.get('clientId'); - return this.clientsService.getClientData(clientId); - } - + /** + * Returns the Clients data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.paramMap.get('clientId'); + return this.clientsService.getClientData(clientId); + } } diff --git a/src/app/clients/create-client/create-client.component.spec.ts b/src/app/clients/create-client/create-client.component.spec.ts index 9a8598793..b8674ecab 100644 --- a/src/app/clients/create-client/create-client.component.spec.ts +++ b/src/app/clients/create-client/create-client.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateClientComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateClientComponent ] - }) - .compileComponents(); + declarations: [CreateClientComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/create-client/create-client.component.ts b/src/app/clients/create-client/create-client.component.ts index 528064dd6..e72b9cbeb 100644 --- a/src/app/clients/create-client/create-client.component.ts +++ b/src/app/clients/create-client/create-client.component.ts @@ -23,7 +23,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./create-client.component.scss'] }) export class CreateClientComponent { - /** Client General Step */ @ViewChild(ClientGeneralStepComponent, { static: true }) clientGeneralStep: ClientGeneralStepComponent; /** Client Family Members Step */ @@ -48,11 +47,13 @@ export class CreateClientComponent { * @param {ClientsService} clientsService Clients Service * @param {SettingsService} settingsService Setting service */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private clientsService: ClientsService, - private settingsService: SettingsService) { - this.route.data.subscribe((data: { clientTemplate: any, clientAddressFieldConfig: any }) => { + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { clientTemplate: any; clientAddressFieldConfig: any }) => { this.clientTemplate = data.clientTemplate; this.clientAddressFieldConfig = data.clientAddressFieldConfig; this.setDatatables(); @@ -87,7 +88,7 @@ export class CreateClientComponent { areFormvalids(): boolean { let areValids = this.clientGeneralForm.valid; if (this.clientTemplate.isAddressEnabled) { - areValids = areValids && (this.clientAddressStep.address.address.length > 0); + areValids = areValids && this.clientAddressStep.address.address.length > 0; } if (this.clientTemplate.datatables && this.clientTemplate.datatables.length > 0 && this.clientDatatables) { this.clientDatatables.forEach((clientDatatable: ClientDatatableStepComponent) => { @@ -139,8 +140,13 @@ export class CreateClientComponent { } this.clientsService.createClient(clientData).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/clients/edit-client/edit-client.component.spec.ts b/src/app/clients/edit-client/edit-client.component.spec.ts index 2f57c925f..d58309314 100644 --- a/src/app/clients/edit-client/edit-client.component.spec.ts +++ b/src/app/clients/edit-client/edit-client.component.spec.ts @@ -8,9 +8,8 @@ describe('EditClientComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditClientComponent ] - }) - .compileComponents(); + declarations: [EditClientComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/clients/edit-client/edit-client.component.ts b/src/app/clients/edit-client/edit-client.component.ts index 7fef9914a..7eba92417 100644 --- a/src/app/clients/edit-client/edit-client.component.ts +++ b/src/app/clients/edit-client/edit-client.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./edit-client.component.scss'] }) export class EditClientComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -55,12 +54,14 @@ export class EditClientComponent implements OnInit { * @param {Dates} dateUtils Date Utils * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private clientsService: ClientsService, - private dateUtils: Dates, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private clientsService: ClientsService, + private dateUtils: Dates, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { clientDataAndTemplate: any }) => { this.clientDataAndTemplate = data.clientDataAndTemplate; }); @@ -73,21 +74,26 @@ export class EditClientComponent implements OnInit { this.buildDependencies(); this.legalFormId = 1; this.editClientForm.patchValue({ - 'officeId': this.clientDataAndTemplate.officeId, - 'staffId': this.clientDataAndTemplate.staffId, - 'legalFormId': this.clientDataAndTemplate.legalForm && this.clientDataAndTemplate.legalForm.id, - 'accountNo': this.clientDataAndTemplate.accountNo, - 'externalId': this.clientDataAndTemplate.externalId, - 'genderId': this.clientDataAndTemplate.gender && this.clientDataAndTemplate.gender.id, - 'isStaff': this.clientDataAndTemplate.isStaff, - 'active': this.clientDataAndTemplate.active, - 'mobileNo': this.clientDataAndTemplate.mobileNo, - 'emailAddress': this.clientDataAndTemplate.emailAddress, - 'dateOfBirth': this.clientDataAndTemplate.dateOfBirth && new Date(this.clientDataAndTemplate.dateOfBirth), - 'clientTypeId': this.clientDataAndTemplate.clientType && this.clientDataAndTemplate.clientType.id, - 'clientClassificationId': this.clientDataAndTemplate.clientClassification && this.clientDataAndTemplate.clientClassification.id, - 'submittedOnDate': this.clientDataAndTemplate.timeline.submittedOnDate && new Date(this.clientDataAndTemplate.timeline.submittedOnDate), - 'activationDate': this.clientDataAndTemplate.timeline.activatedOnDate && new Date(this.clientDataAndTemplate.timeline.activatedOnDate) + officeId: this.clientDataAndTemplate.officeId, + staffId: this.clientDataAndTemplate.staffId, + legalFormId: this.clientDataAndTemplate.legalForm && this.clientDataAndTemplate.legalForm.id, + accountNo: this.clientDataAndTemplate.accountNo, + externalId: this.clientDataAndTemplate.externalId, + genderId: this.clientDataAndTemplate.gender && this.clientDataAndTemplate.gender.id, + isStaff: this.clientDataAndTemplate.isStaff, + active: this.clientDataAndTemplate.active, + mobileNo: this.clientDataAndTemplate.mobileNo, + emailAddress: this.clientDataAndTemplate.emailAddress, + dateOfBirth: this.clientDataAndTemplate.dateOfBirth && new Date(this.clientDataAndTemplate.dateOfBirth), + clientTypeId: this.clientDataAndTemplate.clientType && this.clientDataAndTemplate.clientType.id, + clientClassificationId: + this.clientDataAndTemplate.clientClassification && this.clientDataAndTemplate.clientClassification.id, + submittedOnDate: + this.clientDataAndTemplate.timeline.submittedOnDate && + new Date(this.clientDataAndTemplate.timeline.submittedOnDate), + activationDate: + this.clientDataAndTemplate.timeline.activatedOnDate && + new Date(this.clientDataAndTemplate.timeline.activatedOnDate) }); if (this.clientDataAndTemplate.legalForm) { this.legalFormId = this.clientDataAndTemplate.legalForm.id; @@ -99,21 +105,27 @@ export class EditClientComponent implements OnInit { */ createEditClientForm() { this.editClientForm = this.formBuilder.group({ - 'officeId': [{ value: '', disabled: true }], - 'staffId': [''], - 'legalFormId': [{ value: '', disabled: true }], - 'isStaff': [false], - 'active': [false], - 'accountNo': [{ value: '', disabled: true }], - 'externalId': [''], - 'genderId': [''], - 'mobileNo': [''], - 'emailAddress': ['', Validators.email], - 'dateOfBirth': [''], - 'clientTypeId': [''], - 'clientClassificationId': [''], - 'submittedOnDate': ['', Validators.required], - 'activationDate': [''] + officeId: [{ value: '', disabled: true }], + staffId: [''], + legalFormId: [{ value: '', disabled: true }], + isStaff: [false], + active: [false], + accountNo: [{ value: '', disabled: true }], + externalId: [''], + genderId: [''], + mobileNo: [''], + emailAddress: [ + '', + Validators.email + ], + dateOfBirth: [''], + clientTypeId: [''], + clientClassificationId: [''], + submittedOnDate: [ + '', + Validators.required + ], + activationDate: [''] }); } @@ -139,21 +151,42 @@ export class EditClientComponent implements OnInit { if (legalFormId === 1) { this.editClientForm.removeControl('fullname'); this.editClientForm.removeControl('clientNonPersonDetails'); - this.editClientForm.addControl('firstname', new UntypedFormControl(this.clientDataAndTemplate.firstname, Validators.required)); + this.editClientForm.addControl( + 'firstname', + new UntypedFormControl(this.clientDataAndTemplate.firstname, Validators.required) + ); this.editClientForm.addControl('middlename', new UntypedFormControl(this.clientDataAndTemplate.middlename)); - this.editClientForm.addControl('lastname', new UntypedFormControl(this.clientDataAndTemplate.lastname, Validators.required)); + this.editClientForm.addControl( + 'lastname', + new UntypedFormControl(this.clientDataAndTemplate.lastname, Validators.required) + ); } else { this.editClientForm.removeControl('firstname'); this.editClientForm.removeControl('middlename'); this.editClientForm.removeControl('lastname'); - this.editClientForm.addControl('fullname', new UntypedFormControl(this.clientDataAndTemplate.fullname, Validators.required)); - this.editClientForm.addControl('clientNonPersonDetails', this.formBuilder.group({ - 'constitutionId': [this.clientDataAndTemplate.clientNonPersonDetails.constitution && this.clientDataAndTemplate.clientNonPersonDetails.constitution.id, Validators.required], - 'incorpValidityTillDate': [this.clientDataAndTemplate.clientNonPersonDetails.incorpValidityTillDate && new Date(this.clientDataAndTemplate.clientNonPersonDetails.incorpValidityTillDate)], - 'incorpNumber': [this.clientDataAndTemplate.clientNonPersonDetails.incorpNumber], - 'mainBusinessLineId': [this.clientDataAndTemplate.clientNonPersonDetails.mainBusinessLine && this.clientDataAndTemplate.clientNonPersonDetails.mainBusinessLine.id], - 'remarks': [this.clientDataAndTemplate.clientNonPersonDetails.remarks] - })); + this.editClientForm.addControl( + 'fullname', + new UntypedFormControl(this.clientDataAndTemplate.fullname, Validators.required) + ); + this.editClientForm.addControl( + 'clientNonPersonDetails', + this.formBuilder.group({ + constitutionId: [ + this.clientDataAndTemplate.clientNonPersonDetails.constitution && + this.clientDataAndTemplate.clientNonPersonDetails.constitution.id, + Validators.required + ], + incorpValidityTillDate: [ + this.clientDataAndTemplate.clientNonPersonDetails.incorpValidityTillDate && + new Date(this.clientDataAndTemplate.clientNonPersonDetails.incorpValidityTillDate)], + incorpNumber: [this.clientDataAndTemplate.clientNonPersonDetails.incorpNumber], + mainBusinessLineId: [ + this.clientDataAndTemplate.clientNonPersonDetails.mainBusinessLine && + this.clientDataAndTemplate.clientNonPersonDetails.mainBusinessLine.id + ], + remarks: [this.clientDataAndTemplate.clientNonPersonDetails.remarks] + }) + ); } }); } @@ -171,8 +204,11 @@ export class EditClientComponent implements OnInit { const editClientFormValue: any = this.editClientForm.getRawValue(); const clientData = { ...editClientFormValue, - dateOfBirth: editClientFormValue.dateOfBirth && this.dateUtils.formatDate(editClientFormValue.dateOfBirth, dateFormat), - submittedOnDate: editClientFormValue.submittedOnDate && this.dateUtils.formatDate(editClientFormValue.submittedOnDate, dateFormat), + dateOfBirth: + editClientFormValue.dateOfBirth && this.dateUtils.formatDate(editClientFormValue.dateOfBirth, dateFormat), + submittedOnDate: + editClientFormValue.submittedOnDate && + this.dateUtils.formatDate(editClientFormValue.submittedOnDate, dateFormat), activationDate: this.dateUtils.formatDate(editClientFormValue.activationDate, dateFormat), dateFormat, locale @@ -181,7 +217,9 @@ export class EditClientComponent implements OnInit { if (editClientFormValue.clientNonPersonDetails) { clientData.clientNonPersonDetails = { ...editClientFormValue.clientNonPersonDetails, - incorpValidityTillDate: editClientFormValue.clientNonPersonDetails.incorpValidityTillDate && this.dateUtils.formatDate(editClientFormValue.clientNonPersonDetails.incorpValidityTillDate, dateFormat), + incorpValidityTillDate: + editClientFormValue.clientNonPersonDetails.incorpValidityTillDate && + this.dateUtils.formatDate(editClientFormValue.clientNonPersonDetails.incorpValidityTillDate, dateFormat), dateFormat, locale }; @@ -192,5 +230,4 @@ export class EditClientComponent implements OnInit { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/collaterals/collaterals-routing.module.ts b/src/app/collaterals/collaterals-routing.module.ts index 604163019..562c08055 100644 --- a/src/app/collaterals/collaterals-routing.module.ts +++ b/src/app/collaterals/collaterals-routing.module.ts @@ -21,7 +21,7 @@ const routes: Routes = [ path: '', component: ViewCollateralComponent, resolve: { - clientCollateralData: ClientCollateralResolver, + clientCollateralData: ClientCollateralResolver } }, { @@ -29,7 +29,7 @@ const routes: Routes = [ data: { title: 'edit', routeParamBreadcrumb: 'edit' }, component: EditCollateralComponent, resolve: { - clientCollateralData: ClientCollateralResolver, + clientCollateralData: ClientCollateralResolver } } ] @@ -43,7 +43,7 @@ const routes: Routes = [ exports: [RouterModule], declarations: [], providers: [ - ClientCollateralResolver, + ClientCollateralResolver ] }) -export class CollateralsRoutingModule { } +export class CollateralsRoutingModule {} diff --git a/src/app/collaterals/collaterals.module.ts b/src/app/collaterals/collaterals.module.ts index 6eba6fe6b..811291a99 100644 --- a/src/app/collaterals/collaterals.module.ts +++ b/src/app/collaterals/collaterals.module.ts @@ -13,7 +13,6 @@ import { CollateralsRoutingModule } from './collaterals-routing.module'; import { ViewCollateralComponent } from './view-collateral/view-collateral.component'; import { EditCollateralComponent } from './edit-collateral/edit-collateral.component'; - @NgModule({ declarations: [ ViewCollateralComponent, @@ -27,4 +26,4 @@ import { EditCollateralComponent } from './edit-collateral/edit-collateral.compo PipesModule ] }) -export class CollateralsModule { } +export class CollateralsModule {} diff --git a/src/app/collaterals/collaterals.service.ts b/src/app/collaterals/collaterals.service.ts index adc5c3e0d..07674412e 100644 --- a/src/app/collaterals/collaterals.service.ts +++ b/src/app/collaterals/collaterals.service.ts @@ -14,9 +14,15 @@ export class CollateralsService { /** * @param {HttpClient} http Http Client to send requests. */ - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} - getFilteredClients(orderBy: string, sortOrder: string, orphansOnly: boolean, displayName: string, officeId?: any): Observable { + getFilteredClients( + orderBy: string, + sortOrder: string, + orphansOnly: boolean, + displayName: string, + officeId?: any + ): Observable { let httpParams = new HttpParams() .set('displayName', displayName) .set('orphansOnly', orphansOnly.toString()) @@ -31,21 +37,21 @@ export class CollateralsService { /** * @returns {Observable} Collaterals data */ - getClientCollateral(clientId: any, clientCollateralId: any): Observable { + getClientCollateral(clientId: any, clientCollateralId: any): Observable { return this.http.get(`/clients/${clientId}/collaterals/${clientCollateralId}`); } /** * @returns {Observable} Collaterals data */ - updateClientCollateral(clientId: any, clientCollateralId: any, clientCollateralData: any): Observable { + updateClientCollateral(clientId: any, clientCollateralId: any, clientCollateralData: any): Observable { return this.http.put(`/clients/${clientId}/collaterals/${clientCollateralId}`, clientCollateralData); } /** * @returns {Observable} Delete Collaterals data */ - deleteCollateral(clientId: any, clientCollateralId: any): Observable { + deleteCollateral(clientId: any, clientCollateralId: any): Observable { return this.http.delete(`/clients/${clientId}/collaterals/${clientCollateralId}`); } } diff --git a/src/app/collaterals/common-resolvers/client-collateral.resolver.ts b/src/app/collaterals/common-resolvers/client-collateral.resolver.ts index 973323600..f7b3c8d1b 100644 --- a/src/app/collaterals/common-resolvers/client-collateral.resolver.ts +++ b/src/app/collaterals/common-resolvers/client-collateral.resolver.ts @@ -13,20 +13,18 @@ import { CollateralsService } from '../collaterals.service'; */ @Injectable() export class ClientCollateralResolver implements Resolve { + /** + * @param {CollateralsService} collateralsService Collaterals service. + */ + constructor(private collateralsService: CollateralsService) {} - /** - * @param {CollateralsService} collateralsService Collaterals service. - */ - constructor(private collateralsService: CollateralsService) { } - - /** - * Returns the Client Collateral data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const clientId = route.parent.paramMap.get('clientId'); - const collateralId = route.parent.paramMap.get('collateralId'); - return this.collateralsService.getClientCollateral(clientId, collateralId); - } - + /** + * Returns the Client Collateral data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const clientId = route.parent.paramMap.get('clientId'); + const collateralId = route.parent.paramMap.get('collateralId'); + return this.collateralsService.getClientCollateral(clientId, collateralId); + } } diff --git a/src/app/collaterals/edit-collateral/edit-collateral.component.spec.ts b/src/app/collaterals/edit-collateral/edit-collateral.component.spec.ts index 66fbb5c31..47d972674 100644 --- a/src/app/collaterals/edit-collateral/edit-collateral.component.spec.ts +++ b/src/app/collaterals/edit-collateral/edit-collateral.component.spec.ts @@ -8,9 +8,8 @@ describe('EditCollateralComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ EditCollateralComponent ] - }) - .compileComponents(); + declarations: [EditCollateralComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/collaterals/edit-collateral/edit-collateral.component.ts b/src/app/collaterals/edit-collateral/edit-collateral.component.ts index 5349a402c..7be39c012 100644 --- a/src/app/collaterals/edit-collateral/edit-collateral.component.ts +++ b/src/app/collaterals/edit-collateral/edit-collateral.component.ts @@ -13,8 +13,6 @@ import { CollateralsService } from '../collaterals.service'; styleUrls: ['./edit-collateral.component.scss'] }) export class EditCollateralComponent implements OnInit { - - /** Client Collateral Form */ clientCollateralForm: UntypedFormGroup; /** Client Collateral Options */ @@ -38,12 +36,12 @@ export class EditCollateralComponent implements OnInit { private router: Router, private settingsService: SettingsService, private collateralService: CollateralsService - ) { - this.route.data.subscribe((data: { clientCollateralData: any }) => { - this.collateralDetails = data.clientCollateralData; - }); - this.clientId = this.route.parent.snapshot.params['clientId']; - } + ) { + this.route.data.subscribe((data: { clientCollateralData: any }) => { + this.collateralDetails = data.clientCollateralData; + }); + this.clientId = this.route.parent.snapshot.params['clientId']; + } ngOnInit(): void { this.createClientCollateralForm(); @@ -54,16 +52,19 @@ export class EditCollateralComponent implements OnInit { */ createClientCollateralForm() { this.clientCollateralForm = this.formBuilder.group({ - 'quantity': [ '', Validators.required ], - 'name': [{ value: '', disabled: true }], - 'total': [{value: '', disabled: true}], - 'totalCollateral': [{value: '', disabled: true}], + quantity: [ + '', + Validators.required + ], + name: [{ value: '', disabled: true }], + total: [{ value: '', disabled: true }], + totalCollateral: [{ value: '', disabled: true }] }); this.clientCollateralForm.patchValue({ - 'name': this.collateralDetails.name, - 'quantity': this.collateralDetails.quantity, - 'total': this.collateralDetails.total, - 'totalCollateral': this.collateralDetails.totalCollateral, + name: this.collateralDetails.name, + quantity: this.collateralDetails.quantity, + total: this.collateralDetails.total, + totalCollateral: this.collateralDetails.totalCollateral }); } @@ -79,8 +80,7 @@ export class EditCollateralComponent implements OnInit { locale }; this.collateralService.updateClientCollateral(this.clientId, collateralId, clientCollateralData).subscribe(() => { - this.router.navigate(['../'], {relativeTo: this.route}); + this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/collaterals/view-collateral/view-collateral.component.spec.ts b/src/app/collaterals/view-collateral/view-collateral.component.spec.ts index ac97d75c7..6abfd2f6e 100644 --- a/src/app/collaterals/view-collateral/view-collateral.component.spec.ts +++ b/src/app/collaterals/view-collateral/view-collateral.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewCollateralComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ViewCollateralComponent ] - }) - .compileComponents(); + declarations: [ViewCollateralComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/collaterals/view-collateral/view-collateral.component.ts b/src/app/collaterals/view-collateral/view-collateral.component.ts index e8ed8979a..94fc048ab 100644 --- a/src/app/collaterals/view-collateral/view-collateral.component.ts +++ b/src/app/collaterals/view-collateral/view-collateral.component.ts @@ -6,17 +6,20 @@ import { MatDialog } from '@angular/material/dialog'; /** Custom Components */ import { DeleteDialogComponent } from '../../shared/delete-dialog/delete-dialog.component'; - @Component({ selector: 'mifosx-view-collateral', templateUrl: './view-collateral.component.html', styleUrls: ['./view-collateral.component.scss'] }) export class ViewCollateralComponent { - clientCollateralData: any; - collateralColumns: string[] = ['ID', 'Last Repayment', 'Remaining Amount', 'Last Repayment Date']; + collateralColumns: string[] = [ + 'ID', + 'Last Repayment', + 'Remaining Amount', + 'Last Repayment Date' + ]; constructor( private route: ActivatedRoute, @@ -24,7 +27,7 @@ export class ViewCollateralComponent { private router: Router, private dialog: MatDialog ) { - this.route.data.subscribe((data: {clientCollateralData: any}) => { + this.route.data.subscribe((data: { clientCollateralData: any }) => { this.clientCollateralData = data.clientCollateralData; }); } @@ -32,18 +35,18 @@ export class ViewCollateralComponent { /** * Deletes the Collateral and redirects to CLients Page. */ - deleteCollateral() { + deleteCollateral() { const deleteCollateralDialogRef = this.dialog.open(DeleteDialogComponent, { data: { deleteContext: `collateral ${this.clientCollateralData.id}` } }); deleteCollateralDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.collateralsService.deleteCollateral(this.clientCollateralData.clientId, this.clientCollateralData.id) + this.collateralsService + .deleteCollateral(this.clientCollateralData.clientId, this.clientCollateralData.id) .subscribe(() => { this.router.navigate(['../../'], { relativeTo: this.route }); }); } }); } - } diff --git a/src/app/collections/collections-routing.module.ts b/src/app/collections/collections-routing.module.ts index a457833e0..93d1871c6 100644 --- a/src/app/collections/collections-routing.module.ts +++ b/src/app/collections/collections-routing.module.ts @@ -15,15 +15,20 @@ const routes: Routes = [ children: [ { path: 'individual-collection-sheet', - data: { title: 'Individual Collection Sheet', breadcrumb: 'Individual Collection Sheet', routeParamBreadcrumb: false }, + data: { + title: 'Individual Collection Sheet', + breadcrumb: 'Individual Collection Sheet', + routeParamBreadcrumb: false + }, component: IndividualCollectionSheetComponent, resolve: { officesData: OfficesResolver } - }, + } ] } ]) + ]; @NgModule({ @@ -31,4 +36,4 @@ const routes: Routes = [ providers: [], exports: [RouterModule] }) -export class CollectionsRoutingModule { } +export class CollectionsRoutingModule {} diff --git a/src/app/collections/collections.module.ts b/src/app/collections/collections.module.ts index 340932e66..a834a46a8 100644 --- a/src/app/collections/collections.module.ts +++ b/src/app/collections/collections.module.ts @@ -19,4 +19,4 @@ import { IndividualCollectionSheetComponent } from './individual-collection-shee IndividualCollectionSheetComponent ] }) -export class CollectionsModule { } +export class CollectionsModule {} diff --git a/src/app/collections/collections.service.ts b/src/app/collections/collections.service.ts index 642ca7990..5bdf76fdb 100644 --- a/src/app/collections/collections.service.ts +++ b/src/app/collections/collections.service.ts @@ -12,8 +12,7 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class CollectionsService { - - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * Returns all the offices @@ -27,9 +26,7 @@ export class CollectionsService { * @param {officeId} OfficeId any */ getStaffs(officeId: any): Observable { - const httpParams = new HttpParams() - .set('officeId', officeId) - .set('status', 'all'); + const httpParams = new HttpParams().set('officeId', officeId).set('status', 'all'); return this.http.get(`/staff`, { params: httpParams }); } @@ -50,5 +47,4 @@ export class CollectionsService { const httpParams = new HttpParams().set('command', 'saveCollectionSheet'); return this.http.post(`/collectionsheet`, data, { params: httpParams }); } - } diff --git a/src/app/collections/individual-collection-sheet/individual-collection-sheet.component.spec.ts b/src/app/collections/individual-collection-sheet/individual-collection-sheet.component.spec.ts index 0937bdb6a..6d6dfb735 100644 --- a/src/app/collections/individual-collection-sheet/individual-collection-sheet.component.spec.ts +++ b/src/app/collections/individual-collection-sheet/individual-collection-sheet.component.spec.ts @@ -8,9 +8,8 @@ describe('IndividualCollectionSheetComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ IndividualCollectionSheetComponent ] - }) - .compileComponents(); + declarations: [IndividualCollectionSheetComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/collections/individual-collection-sheet/individual-collection-sheet.component.ts b/src/app/collections/individual-collection-sheet/individual-collection-sheet.component.ts index 8ee852229..79dbdd250 100644 --- a/src/app/collections/individual-collection-sheet/individual-collection-sheet.component.ts +++ b/src/app/collections/individual-collection-sheet/individual-collection-sheet.component.ts @@ -31,7 +31,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./individual-collection-sheet.component.scss'] }) export class IndividualCollectionSheetComponent implements OnInit { - /** Offices Data */ officesData: any; /** Loan Officer Data */ @@ -62,16 +61,29 @@ export class IndividualCollectionSheetComponent implements OnInit { noData = false; /** Columns to be displayed in loans table. */ - loansDisplayedColumns: string[] = ['loanAccount', 'productName', 'clientName', 'totalDue', 'charges', 'actions']; + loansDisplayedColumns: string[] = [ + 'loanAccount', + 'productName', + 'clientName', + 'totalDue', + 'charges', + 'actions' + ]; /** Columns to be displayed in savings table. */ - savingsDisplayedColumns: string[] = ['depositAccount', 'savingsAccountNo', 'productName', 'clientName', 'totalDue', 'actions']; + savingsDisplayedColumns: string[] = [ + 'depositAccount', + 'savingsAccountNo', + 'productName', + 'clientName', + 'totalDue', + 'actions' + ]; /** Data source for loans table. */ loansDataSource: MatTableDataSource; /** Data source for savings table. */ savingsDataSource: MatTableDataSource; - /** Paginator for table. */ @ViewChild(MatPaginator, { read: true }) paginator: MatPaginator; /** Sorter for table. */ @@ -87,13 +99,15 @@ export class IndividualCollectionSheetComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private collectionsService: CollectionsService, - private route: ActivatedRoute, - private dateUtils: Dates, - public dialog: MatDialog, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private collectionsService: CollectionsService, + private route: ActivatedRoute, + private dateUtils: Dates, + public dialog: MatDialog, + private router: Router, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { officesData: any }) => { this.officesData = data.officesData; }); @@ -104,7 +118,9 @@ export class IndividualCollectionSheetComponent implements OnInit { if (localStorage.getItem('Success')) { localStorage.removeItem('Success'); this.Success = true; - setTimeout(() => { this.Success = false; }, 3000); + setTimeout(() => { + this.Success = false; + }, 3000); } this.createCollectionSheetForm(); this.buildDependencies(); @@ -115,9 +131,15 @@ export class IndividualCollectionSheetComponent implements OnInit { */ createCollectionSheetForm() { this.collectionSheetForm = this.formBuilder.group({ - 'officeId': ['', Validators.required], - 'transactionDate': [new Date(), Validators.required], - 'staffId': [''] + officeId: [ + '', + Validators.required + ], + transactionDate: [ + new Date(), + Validators.required + ], + staffId: [''] }); } @@ -174,7 +196,7 @@ export class IndividualCollectionSheetComponent implements OnInit { /** * Gets Loan Total Due Amount */ - getLoanTotalDueAmount (loan: any) { + getLoanTotalDueAmount(loan: any) { let principalInterestDue = loan.totalDue; let chargesDue = loan.chargesDue; if (isNaN(principalInterestDue)) { @@ -226,7 +248,8 @@ export class IndividualCollectionSheetComponent implements OnInit { label: 'Bank #', type: 'number', required: false - }), + }) + ]; const data = { title: `Payment for ${type === 'loans' ? 'Loan' : 'Saving'} Id ${type === 'loans' ? selectedData.loanId : selectedData.savingsId}`, @@ -259,7 +282,12 @@ export class IndividualCollectionSheetComponent implements OnInit { const savingsTransaction = { savingsId: selectedData.savingsId, transactionAmount: dueAmount, - depositAccountType: selectedData.depositAccountType === 'Saving Deposit' ? 100 : (selectedData.depositAccountType === 'Recurring Deposit' ? 300 : 400) + depositAccountType: + selectedData.depositAccountType === 'Saving Deposit' + ? 100 + : selectedData.depositAccountType === 'Recurring Deposit' + ? 300 + : 400 }; if (response.data.paymentTypeId !== '') { savingsTransaction['paymentTypeId'] = response.data.paymentTypeId; @@ -299,7 +327,9 @@ export class IndividualCollectionSheetComponent implements OnInit { this.isCollapsed = true; } else { this.noData = true; - setTimeout(() => { this.noData = false; }, 3000); + setTimeout(() => { + this.noData = false; + }, 3000); } }); } @@ -331,8 +361,6 @@ export class IndividualCollectionSheetComponent implements OnInit { */ reload() { const url: string = this.router.url; - this.router.navigateByUrl(`/collections`, { skipLocationChange: true }) - .then(() => this.router.navigate([url])); + this.router.navigateByUrl(`/collections`, { skipLocationChange: true }).then(() => this.router.navigate([url])); } - } diff --git a/src/app/configuration-wizard/completion-dialog/completion-dialog.component.spec.ts b/src/app/configuration-wizard/completion-dialog/completion-dialog.component.spec.ts index 4312060ef..040f415af 100644 --- a/src/app/configuration-wizard/completion-dialog/completion-dialog.component.spec.ts +++ b/src/app/configuration-wizard/completion-dialog/completion-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('CompletionDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CompletionDialogComponent ] - }) - .compileComponents(); + declarations: [CompletionDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/configuration-wizard/completion-dialog/completion-dialog.component.ts b/src/app/configuration-wizard/completion-dialog/completion-dialog.component.ts index bcbadca6d..e838c3cea 100644 --- a/src/app/configuration-wizard/completion-dialog/completion-dialog.component.ts +++ b/src/app/configuration-wizard/completion-dialog/completion-dialog.component.ts @@ -11,8 +11,8 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./completion-dialog.component.scss'] }) export class CompletionDialogComponent { - - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/configuration-wizard/configuration-wizard.component.spec.ts b/src/app/configuration-wizard/configuration-wizard.component.spec.ts index 02969eeb4..d7d3af1b2 100644 --- a/src/app/configuration-wizard/configuration-wizard.component.spec.ts +++ b/src/app/configuration-wizard/configuration-wizard.component.spec.ts @@ -8,9 +8,8 @@ describe('ConfigurationWizardComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ConfigurationWizardComponent ] - }) - .compileComponents(); + declarations: [ConfigurationWizardComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/configuration-wizard/configuration-wizard.component.ts b/src/app/configuration-wizard/configuration-wizard.component.ts index e9891b26d..a4938e437 100644 --- a/src/app/configuration-wizard/configuration-wizard.component.ts +++ b/src/app/configuration-wizard/configuration-wizard.component.ts @@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./configuration-wizard.component.scss'] }) export class ConfigurationWizardComponent { - show: number; /** * @param {MatDialogRef} dialogRef MatDialogRef. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/configuration-wizard/configuration-wizard.module.ts b/src/app/configuration-wizard/configuration-wizard.module.ts index d82747b43..e53e691bf 100644 --- a/src/app/configuration-wizard/configuration-wizard.module.ts +++ b/src/app/configuration-wizard/configuration-wizard.module.ts @@ -23,25 +23,24 @@ import { SharedModule } from '../shared/shared.module'; * Configuration Wizard Module */ @NgModule({ - declarations: [ - PopoverComponent, - PopoverCloseDirective, - PopoverArrowDirective, - ConfigurationWizardComponent, - ContinueSetupDialogComponent, - NextStepDialogComponent, - CompletionDialogComponent - ], - imports: [ - SharedModule, - CommonModule, - OverlayModule, - PortalModule, - MatDialogModule - ], - exports: [ - PopoverCloseDirective - ] + declarations: [ + PopoverComponent, + PopoverCloseDirective, + PopoverArrowDirective, + ConfigurationWizardComponent, + ContinueSetupDialogComponent, + NextStepDialogComponent, + CompletionDialogComponent + ], + imports: [ + SharedModule, + CommonModule, + OverlayModule, + PortalModule, + MatDialogModule + ], + exports: [ + PopoverCloseDirective + ] }) - -export class ConfigurationWizardModule { } +export class ConfigurationWizardModule {} diff --git a/src/app/configuration-wizard/configuration-wizard.service.ts b/src/app/configuration-wizard/configuration-wizard.service.ts index 1a6a778c7..44c0946f3 100644 --- a/src/app/configuration-wizard/configuration-wizard.service.ts +++ b/src/app/configuration-wizard/configuration-wizard.service.ts @@ -7,9 +7,7 @@ import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) - export class ConfigurationWizardService { - /** * Home Tour */ @@ -196,13 +194,12 @@ export class ConfigurationWizardService { /*To show popover on manage reports*/ showManageReports = false; - constructor() { } + constructor() {} /** * Set all variables to false. */ closeConfigWizard(): void { - this.showToolbar = false; this.showToolbarAdmin = false; this.showSideNav = false; diff --git a/src/app/configuration-wizard/continue-setup-dialog/continue-setup-dialog.component.spec.ts b/src/app/configuration-wizard/continue-setup-dialog/continue-setup-dialog.component.spec.ts index 096e0a897..2f85e8220 100644 --- a/src/app/configuration-wizard/continue-setup-dialog/continue-setup-dialog.component.spec.ts +++ b/src/app/configuration-wizard/continue-setup-dialog/continue-setup-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('ContinueSetupDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ContinueSetupDialogComponent ] - }) - .compileComponents(); + declarations: [ContinueSetupDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/configuration-wizard/continue-setup-dialog/continue-setup-dialog.component.ts b/src/app/configuration-wizard/continue-setup-dialog/continue-setup-dialog.component.ts index f056b6776..5ad220fb7 100644 --- a/src/app/configuration-wizard/continue-setup-dialog/continue-setup-dialog.component.ts +++ b/src/app/configuration-wizard/continue-setup-dialog/continue-setup-dialog.component.ts @@ -11,16 +11,16 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./continue-setup-dialog.component.scss'] }) export class ContinueSetupDialogComponent { - /* Current Step Name*/ stepName: number; /** * @param {MatDialogRef} dialogRef MatDialogRef. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) { this.stepName = data.stepName; } - } diff --git a/src/app/configuration-wizard/next-step-dialog/next-step-dialog.component.spec.ts b/src/app/configuration-wizard/next-step-dialog/next-step-dialog.component.spec.ts index 88842cf36..8bd3481f8 100644 --- a/src/app/configuration-wizard/next-step-dialog/next-step-dialog.component.spec.ts +++ b/src/app/configuration-wizard/next-step-dialog/next-step-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('NextStepDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ NextStepDialogComponent ] - }) - .compileComponents(); + declarations: [NextStepDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/configuration-wizard/next-step-dialog/next-step-dialog.component.ts b/src/app/configuration-wizard/next-step-dialog/next-step-dialog.component.ts index 22833fb9c..29f331491 100644 --- a/src/app/configuration-wizard/next-step-dialog/next-step-dialog.component.ts +++ b/src/app/configuration-wizard/next-step-dialog/next-step-dialog.component.ts @@ -11,7 +11,6 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./next-step-dialog.component.scss'] }) export class NextStepDialogComponent { - /* Step Percentage */ stepPercentage: number; /* Next Step Name */ @@ -22,11 +21,12 @@ export class NextStepDialogComponent { /** * @param {MatDialogRef} dialogRef MatDialogRef. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { - this.stepPercentage = data.stepPercentage; - this.nextStepName = data.nextStepName; - this.previousStepName = data.previousStepName; + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) { + this.stepPercentage = data.stepPercentage; + this.nextStepName = data.nextStepName; + this.previousStepName = data.previousStepName; } - } diff --git a/src/app/configuration-wizard/popover/popover-arrow.directive.ts b/src/app/configuration-wizard/popover/popover-arrow.directive.ts index 77e17fff6..2d6767d29 100644 --- a/src/app/configuration-wizard/popover/popover-arrow.directive.ts +++ b/src/app/configuration-wizard/popover/popover-arrow.directive.ts @@ -37,11 +37,13 @@ export class PopoverArrowDirective implements OnDestroy { * @param {PopoverRef} popoverRef PopoverRef. * @param {ChangeDetectorRef} cd ChangeDetectorRef */ - constructor(private popoverRef: PopoverRef, - private cd: ChangeDetectorRef) { + constructor( + private popoverRef: PopoverRef, + private cd: ChangeDetectorRef + ) { this.arrowSize = popoverRef.config.arrowSize; - this.subscription = popoverRef.positionChanges().subscribe(p => { + this.subscription = popoverRef.positionChanges().subscribe((p) => { const { offsetX, offsetY } = p.connectionPair; this.offsetTop = offsetY >= 0 ? offsetY * -1 : null; diff --git a/src/app/configuration-wizard/popover/popover-close.directive.ts b/src/app/configuration-wizard/popover/popover-close.directive.ts index 70ac8d1ef..6d157f2a2 100644 --- a/src/app/configuration-wizard/popover/popover-close.directive.ts +++ b/src/app/configuration-wizard/popover/popover-close.directive.ts @@ -16,9 +16,7 @@ export class PopoverCloseDirective { /** * @param {PopoverRef} popoverRef PopoverRef. */ - constructor( - @Optional() private popoverRef: PopoverRef - ) {} + constructor(@Optional() private popoverRef: PopoverRef) {} @HostListener('click') onClick(): void { if (!this.popoverRef) { diff --git a/src/app/configuration-wizard/popover/popover-ref.ts b/src/app/configuration-wizard/popover/popover-ref.ts index 92bc7d544..deb46fab4 100644 --- a/src/app/configuration-wizard/popover/popover-ref.ts +++ b/src/app/configuration-wizard/popover/popover-ref.ts @@ -19,25 +19,28 @@ export class PopoverRef { * @param {FlexibleConnectedPositionStrategy} positionStrategy FlexibleConnectedPositionStrategy. * @param {PopoverConfig} config PopoverConfig. */ - constructor(private overlayRef: OverlayRef, - private positionStrategy: FlexibleConnectedPositionStrategy, - public config: PopoverConfig) { + constructor( + private overlayRef: OverlayRef, + private positionStrategy: FlexibleConnectedPositionStrategy, + public config: PopoverConfig + ) { if (!config.disableClose) { this.overlayRef.backdropClick().subscribe(() => { // this.close(); }); - this.overlayRef.keydownEvents().pipe( - filter(event => event.key === 'Escape') - ).subscribe(() => { - // this.close(); - }); + this.overlayRef + .keydownEvents() + .pipe(filter((event) => event.key === 'Escape')) + .subscribe(() => { + // this.close(); + }); } } - /** - * Close popover - */ + /** + * Close popover + */ close(dialogResult?: T): void { this.afterClosedSubject.next(dialogResult); this.afterClosedSubject.complete(); @@ -45,9 +48,9 @@ export class PopoverRef { this.overlayRef.dispose(); } - /** - * @returns {Observable} - */ + /** + * @returns {Observable} + */ afterClosed(): Observable { return this.afterClosedSubject.asObservable(); } diff --git a/src/app/configuration-wizard/popover/popover.component.spec.ts b/src/app/configuration-wizard/popover/popover.component.spec.ts index c5392f6c2..398e03449 100644 --- a/src/app/configuration-wizard/popover/popover.component.spec.ts +++ b/src/app/configuration-wizard/popover/popover.component.spec.ts @@ -8,9 +8,8 @@ describe('PopoverComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PopoverComponent ] - }) - .compileComponents(); + declarations: [PopoverComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/configuration-wizard/popover/popover.service.ts b/src/app/configuration-wizard/popover/popover.service.ts index e1fb25678..1426a57d1 100644 --- a/src/app/configuration-wizard/popover/popover.service.ts +++ b/src/app/configuration-wizard/popover/popover.service.ts @@ -1,5 +1,11 @@ /* Angular Imports */ -import { ComponentType, Overlay, OriginConnectionPosition, OverlayConnectionPosition, ConnectionPositionPair } from '@angular/cdk/overlay'; +import { + ComponentType, + Overlay, + OriginConnectionPosition, + OverlayConnectionPosition, + ConnectionPositionPair +} from '@angular/cdk/overlay'; import { ComponentPortal, TemplatePortal } from '@angular/cdk/portal'; import { Injectable, InjectionToken, Injector, TemplateRef, ElementRef } from '@angular/core'; @@ -33,7 +39,10 @@ export class PopoverService { * @param {Injector} injector Injector. * @param {overlay} overlay Overlay. */ - constructor(private overlay: Overlay, private injector: Injector) { } + constructor( + private overlay: Overlay, + private injector: Injector + ) {} /** * Opens the popover at target element @@ -42,10 +51,13 @@ export class PopoverService { * @param {string} position String. * @param {Partial = {}} config Partial = {}. */ - open(componentOrTemplate: ComponentType | TemplateRef, - target: ElementRef | HTMLElement, position: string, - backdrop: boolean, - config: Partial = {}): PopoverRef { + open( + componentOrTemplate: ComponentType | TemplateRef, + target: ElementRef | HTMLElement, + position: string, + backdrop: boolean, + config: Partial = {} + ): PopoverRef { const popoverConfig: PopoverConfig = Object.assign({}, defaultConfig, config); const arrowSize = popoverConfig.arrowSize; @@ -55,14 +67,17 @@ export class PopoverService { let positions: ConnectionPositionPair[]; // preferred positions, in order of priority if (position === 'bottom') { - positions = [ + positions = [ // bottom center { overlayX: 'center', overlayY: 'top', originX: 'center', originY: 'bottom', - panelClass: ['top', 'center'], + panelClass: [ + 'top', + 'center' + ], offsetY: panelOffset }, // bottom left @@ -71,7 +86,10 @@ export class PopoverService { overlayY: 'top', originX: 'center', originY: 'bottom', - panelClass: ['top', 'left'], + panelClass: [ + 'top', + 'left' + ], offsetX: -1 * arrowOffset, offsetY: panelOffset }, @@ -81,7 +99,10 @@ export class PopoverService { overlayY: 'top', originX: 'center', originY: 'bottom', - panelClass: ['top', 'right'], + panelClass: [ + 'top', + 'right' + ], offsetX: arrowOffset, offsetY: panelOffset } @@ -94,7 +115,10 @@ export class PopoverService { overlayY: 'bottom', originX: 'center', originY: 'top', - panelClass: ['bottom', 'center'], + panelClass: [ + 'bottom', + 'center' + ], offsetY: -1 * panelOffset }, // top left @@ -103,7 +127,10 @@ export class PopoverService { overlayY: 'bottom', originX: 'center', originY: 'top', - panelClass: ['bottom', 'left'], + panelClass: [ + 'bottom', + 'left' + ], offsetX: -1 * arrowOffset, offsetY: -1 * panelOffset }, @@ -113,7 +140,10 @@ export class PopoverService { overlayY: 'bottom', originX: 'center', originY: 'top', - panelClass: ['bottom', 'right'], + panelClass: [ + 'bottom', + 'right' + ], offsetX: arrowOffset, offsetY: -1 * panelOffset } @@ -122,27 +152,33 @@ export class PopoverService { positions = [ // right { - originX : 'end', - originY : 'center', + originX: 'end', + originY: 'center', overlayX: 'start', overlayY: 'center', - panelClass: ['center', 'left'], + panelClass: [ + 'center', + 'left' + ], offsetX: 0.5 * arrowOffset, offsetY: -1 * panelOffset - }, + } ]; } else if (position === 'left') { positions = [ // left { - originX : 'start', - originY : 'center', + originX: 'start', + originY: 'center', overlayX: 'end', overlayY: 'center', - panelClass: ['center', 'right'], + panelClass: [ + 'center', + 'right' + ], offsetX: -0.5 * arrowOffset, offsetY: -1 * panelOffset - }, + } ]; } if (backdrop === true) { @@ -151,11 +187,11 @@ export class PopoverService { showbackdrop = false; } const positionStrategy = this.overlay - .position() - .flexibleConnectedTo(target) - .withPush(false) - .withFlexibleDimensions(false) - .withPositions(positions); + .position() + .flexibleConnectedTo(target) + .withPush(false) + .withFlexibleDimensions(false) + .withPositions(positions); const overlayRef = this.overlay.create({ hasBackdrop: showbackdrop, @@ -167,34 +203,31 @@ export class PopoverService { const popoverRef = new PopoverRef(overlayRef, positionStrategy, popoverConfig); - const popover = overlayRef.attach(new ComponentPortal( - PopoverComponent, - null, - Injector.create({ - parent: this.injector, - providers: [ - { provide: PopoverRef, useValue: popoverRef } - ] - }) - // new PortalInjector( - // this.injector, - // new WeakMap([ - // [PopoverRef, popoverRef] - // ]) - // ) - )).instance; + const popover = overlayRef.attach( + new ComponentPortal( + PopoverComponent, + null, + Injector.create({ + parent: this.injector, + providers: [ + { provide: PopoverRef, useValue: popoverRef }] + }) + // new PortalInjector( + // this.injector, + // new WeakMap([ + // [PopoverRef, popoverRef] + // ]) + // ) + ) + ).instance; if (componentOrTemplate instanceof TemplateRef) { // rendering a provided template dynamically popover.attachTemplatePortal( - new TemplatePortal( - componentOrTemplate, - null, - { - $implicit: config.data, - popover: popoverRef - } - ) + new TemplatePortal(componentOrTemplate, null, { + $implicit: config.data, + popover: popoverRef + }) ); } else { // rendering a provided component dynamically @@ -206,7 +239,7 @@ export class PopoverService { parent: this.injector, providers: [ { provide: POPOVER_DATA, useValue: config.data }, - { provide: PopoverRef, useValue: popoverRef }, + { provide: PopoverRef, useValue: popoverRef } ] }) // new PortalInjector( @@ -218,7 +251,6 @@ export class PopoverService { // ) ) ); - } return popoverRef; diff --git a/src/app/core/alert/alert.service.ts b/src/app/core/alert/alert.service.ts index 8ca77d18f..a1aa76cd1 100644 --- a/src/app/core/alert/alert.service.ts +++ b/src/app/core/alert/alert.service.ts @@ -11,7 +11,6 @@ import { Alert } from './alert.model'; providedIn: 'root' }) export class AlertService { - /** Alert event. */ public alertEvent: EventEmitter; @@ -29,5 +28,4 @@ export class AlertService { alert(alertEvent: Alert) { this.alertEvent.emit(alertEvent); } - } diff --git a/src/app/core/authentication/authentication.guard.ts b/src/app/core/authentication/authentication.guard.ts index fb7ade247..6e86576ec 100644 --- a/src/app/core/authentication/authentication.guard.ts +++ b/src/app/core/authentication/authentication.guard.ts @@ -14,13 +14,14 @@ const log = new Logger('AuthenticationGuard'); */ @Injectable() export class AuthenticationGuard implements CanActivate { - /** * @param {Router} router Router for navigation. * @param {AuthenticationService} authenticationService Authentication Service. */ - constructor(private router: Router, - private authenticationService: AuthenticationService) { } + constructor( + private router: Router, + private authenticationService: AuthenticationService + ) {} /** * Ensures route access is authorized only when user is authenticated, otherwise redirects to login. @@ -37,5 +38,4 @@ export class AuthenticationGuard implements CanActivate { this.router.navigate(['/login'], { replaceUrl: true }); return false; } - } diff --git a/src/app/core/authentication/authentication.interceptor.ts b/src/app/core/authentication/authentication.interceptor.ts index 2db6cf906..f931b311a 100644 --- a/src/app/core/authentication/authentication.interceptor.ts +++ b/src/app/core/authentication/authentication.interceptor.ts @@ -27,7 +27,6 @@ const twoFactorAccessTokenHeader = 'Fineract-Platform-TFA-Token'; */ @Injectable() export class AuthenticationInterceptor implements HttpInterceptor { - constructor(private settingsService: SettingsService) {} /** @@ -82,5 +81,4 @@ export class AuthenticationInterceptor implements HttpInterceptor { removeTwoFactorAuthorization() { delete httpOptions.headers[twoFactorAccessTokenHeader]; } - } diff --git a/src/app/core/authentication/authentication.service.ts b/src/app/core/authentication/authentication.service.ts index 07913e093..548604dcb 100644 --- a/src/app/core/authentication/authentication.service.ts +++ b/src/app/core/authentication/authentication.service.ts @@ -56,9 +56,11 @@ export class AuthenticationService { * @param {AlertService} alertService Alert Service. * @param {AuthenticationInterceptor} authenticationInterceptor Authentication Interceptor. */ - constructor(private http: HttpClient, - private alertService: AlertService, - private authenticationInterceptor: AuthenticationInterceptor) { + constructor( + private http: HttpClient, + private alertService: AlertService, + private authenticationInterceptor: AuthenticationInterceptor + ) { this.userLoggedIn = false; this.rememberMe = false; this.storage = sessionStorage; @@ -96,19 +98,22 @@ export class AuthenticationService { let httpParams = new HttpParams(); httpParams = httpParams.set('username', loginContext.username); httpParams = httpParams.set('password', loginContext.password); - httpParams = httpParams.set('client_id', `${environment.oauth.appId}`); + httpParams = httpParams.set('client_id', `${environment.oauth.appId}`); httpParams = httpParams.set('grant_type', 'password'); let headers = new HttpHeaders(); - headers = headers.set('Content-Type', 'application/x-www-form-urlencoded') - return this.http.disableApiPrefix().post(`${environment.oauth.serverUrl}/token`, httpParams.toString(), {headers: headers}) + headers = headers.set('Content-Type', 'application/x-www-form-urlencoded'); + return this.http + .disableApiPrefix() + .post(`${environment.oauth.serverUrl}/token`, httpParams.toString(), { headers: headers }) .pipe( - map((tokenResponse: OAuth2Token) => { + map((tokenResponse: OAuth2Token) => { this.getUserDetails(tokenResponse); return of(true); }) ); } else { - return this.http.post('/authentication', { username: loginContext.username, password: loginContext.password }) + return this.http + .post('/authentication', { username: loginContext.username, password: loginContext.password }) .pipe( map((credentials: Credentials) => { this.onLoginSuccess(credentials); @@ -124,11 +129,13 @@ export class AuthenticationService { * Sets the oauth2 token refresh time. * @param {OAuth2Token} tokenResponse OAuth2 Token details. */ - private getUserDetails(tokenResponse: OAuth2Token) { + private getUserDetails(tokenResponse: OAuth2Token) { this.refreshTokenOnExpiry(tokenResponse.expires_in); - let headers = new HttpHeaders(); - headers = headers.set('Authorization', 'bearer '+tokenResponse.access_token) - this.http.disableApiPrefix().get(`${environment.serverUrl}/userdetails`,{ headers: headers }) + let headers = new HttpHeaders(); + headers = headers.set('Authorization', 'bearer ' + tokenResponse.access_token); + this.http + .disableApiPrefix() + .get(`${environment.serverUrl}/userdetails`, { headers: headers }) .subscribe((credentials: Credentials) => { this.onLoginSuccess(credentials); if (!credentials.shouldRenewPassword) { @@ -141,7 +148,7 @@ export class AuthenticationService { * Sets the oauth2 token to refresh on expiry. * @param {number} expiresInTime OAuth2 token expiry time in seconds. */ - private refreshTokenOnExpiry(expiresInTime: number) { + private refreshTokenOnExpiry(expiresInTime: number) { setTimeout(() => this.refreshOAuthAccessToken(), expiresInTime * 1000); } @@ -153,17 +160,19 @@ export class AuthenticationService { if (oAuthRefreshToken == null) { return; } - oAuthRefreshToken = JSON.parse(this.storage.getItem(this.oAuthTokenDetailsStorageKey)).refresh_token; - this.authenticationInterceptor.removeAuthorization(); - const credentials = JSON.parse(this.storage.getItem(this.credentialsStorageKey)); - let httpParams = new HttpParams(); + oAuthRefreshToken = JSON.parse(this.storage.getItem(this.oAuthTokenDetailsStorageKey)).refresh_token; + this.authenticationInterceptor.removeAuthorization(); + const credentials = JSON.parse(this.storage.getItem(this.credentialsStorageKey)); + let httpParams = new HttpParams(); httpParams = httpParams.set('username', credentials.username); httpParams = httpParams.set('client_id', `${environment.oauth.appId}`); httpParams = httpParams.set('refresh_token', oAuthRefreshToken); httpParams = httpParams.set('grant_type', 'refresh_token'); let headers = new HttpHeaders(); - headers = headers.set('Content-Type', 'application/x-www-form-urlencoded') - return this.http.disableApiPrefix().post(`${environment.oauth.serverUrl}/token`, httpParams.toString(), {headers: headers}) + headers = headers.set('Content-Type', 'application/x-www-form-urlencoded'); + return this.http + .disableApiPrefix() + .post(`${environment.oauth.serverUrl}/token`, httpParams.toString(), { headers: headers }) .subscribe((tokenResponse: OAuth2Token) => { this.storage.setItem(this.oAuthTokenDetailsStorageKey, JSON.stringify(tokenResponse)); this.authenticationInterceptor.setAuthorizationToken(tokenResponse.access_token); @@ -173,7 +182,7 @@ export class AuthenticationService { this.storage.setItem(this.credentialsStorageKey, JSON.stringify(credentials)); }); } - + /** * Sets the authorization token followed by one of the following: * @@ -193,14 +202,23 @@ export class AuthenticationService { } if (credentials.isTwoFactorAuthenticationRequired) { this.credentials = credentials; - this.alertService.alert({ type: 'Two Factor Authentication Required', message: 'Two Factor Authentication Required' }); + this.alertService.alert({ + type: 'Two Factor Authentication Required', + message: 'Two Factor Authentication Required' + }); } else { if (credentials.shouldRenewPassword) { this.credentials = credentials; - this.alertService.alert({ type: 'Password Expired', message: 'Your password has expired, please reset your password!' }); + this.alertService.alert({ + type: 'Password Expired', + message: 'Your password has expired, please reset your password!' + }); } else { this.setCredentials(credentials); - this.alertService.alert({ type: 'Authentication Success', message: `${credentials.username} successfully logged in!` }); + this.alertService.alert({ + type: 'Authentication Success', + message: `${credentials.username} successfully logged in!` + }); delete this.credentials; } } @@ -211,15 +229,18 @@ export class AuthenticationService { */ private logoutAuthSession() { const oAuthRefreshToken = JSON.parse(this.storage.getItem(this.oAuthTokenDetailsStorageKey)).refresh_token; - const credentials = JSON.parse(this.storage.getItem(this.credentialsStorageKey)); - this.authenticationInterceptor.removeAuthorizationTenant(); - let httpParams = new HttpParams(); + const credentials = JSON.parse(this.storage.getItem(this.credentialsStorageKey)); + this.authenticationInterceptor.removeAuthorizationTenant(); + let httpParams = new HttpParams(); httpParams = httpParams.set('username', credentials.username); httpParams = httpParams.set('client_id', `${environment.oauth.appId}`); httpParams = httpParams.set('refresh_token', oAuthRefreshToken); let headers = new HttpHeaders(); - headers = headers.set('Content-Type', 'application/x-www-form-urlencoded') - return this.http.disableApiPrefix().post(`${environment.oauth.serverUrl}/logout`, httpParams.toString(), {headers: headers}).subscribe(); + headers = headers.set('Content-Type', 'application/x-www-form-urlencoded'); + return this.http + .disableApiPrefix() + .post(`${environment.oauth.serverUrl}/logout`, httpParams.toString(), { headers: headers }) + .subscribe(); } /** @@ -250,7 +271,7 @@ export class AuthenticationService { twoFactorAccessTokenIsValid(): boolean { const twoFactorAccessToken = JSON.parse(this.storage.getItem(this.twoFactorAuthenticationTokenStorageKey)); if (twoFactorAccessToken) { - return ((new Date()).getTime() < twoFactorAccessToken.validTo); + return new Date().getTime() < twoFactorAccessToken.validTo; } return true; } @@ -260,9 +281,11 @@ export class AuthenticationService { * @returns {boolean} True if the user is authenticated. */ isAuthenticated(): boolean { - return !!(JSON.parse( + return !!( + JSON.parse( sessionStorage.getItem(this.credentialsStorageKey) || localStorage.getItem(this.credentialsStorageKey) - ) && this.twoFactorAccessTokenIsValid()); + ) && this.twoFactorAccessTokenIsValid() + ); } /** @@ -333,12 +356,11 @@ export class AuthenticationService { */ validateOTP(otp: string) { const httpParams = new HttpParams().set('token', otp); - return this.http.post(`/twofactor/validate`, {}, { params: httpParams }) - .pipe( - map(response => { - this.onOTPValidateSuccess(response); - }) - ); + return this.http.post(`/twofactor/validate`, {}, { params: httpParams }).pipe( + map((response) => { + this.onOTPValidateSuccess(response); + }) + ); } /** @@ -352,10 +374,16 @@ export class AuthenticationService { private onOTPValidateSuccess(response: any) { this.authenticationInterceptor.setTwoFactorAccessToken(response.token); if (this.credentials.shouldRenewPassword) { - this.alertService.alert({ type: 'Password Expired', message: 'Your password has expired, please reset your password!' }); + this.alertService.alert({ + type: 'Password Expired', + message: 'Your password has expired, please reset your password!' + }); } else { this.setCredentials(this.credentials); - this.alertService.alert({ type: 'Authentication Success', message: `${this.credentials.username} successfully logged in!` }); + this.alertService.alert({ + type: 'Authentication Success', + message: `${this.credentials.username} successfully logged in!` + }); delete this.credentials; this.storage.setItem(this.twoFactorAuthenticationTokenStorageKey, JSON.stringify(response)); } @@ -366,8 +394,7 @@ export class AuthenticationService { * @param {any} passwordDetails New password. */ resetPassword(passwordDetails: any) { - return this.http.put(`/users/${this.credentials.userId}`, passwordDetails). - pipe( + return this.http.put(`/users/${this.credentials.userId}`, passwordDetails).pipe( map(() => { this.alertService.alert({ type: 'Password Reset Success', message: `Your password was sucessfully reset!` }); this.authenticationInterceptor.removeAuthorization(); @@ -388,5 +415,4 @@ export class AuthenticationService { getUserLoggedIn(): boolean { return this.userLoggedIn; } - } diff --git a/src/app/core/core.module.ts b/src/app/core/core.module.ts index 740031821..084c6c74f 100644 --- a/src/app/core/core.module.ts +++ b/src/app/core/core.module.ts @@ -35,7 +35,6 @@ import { ToolbarComponent } from './shell/toolbar/toolbar.component'; import { BreadcrumbComponent } from './shell/breadcrumb/breadcrumb.component'; import { ContentComponent } from './shell/content/content.component'; - /** * Core Module * @@ -57,6 +56,7 @@ import { ContentComponent } from './shell/content/content.component'; ], exports: [ SharedModule // TO BE REMOVED: Once all components have replaced the core module import by shared module. + ], providers: [ AuthenticationService, @@ -88,12 +88,10 @@ import { ContentComponent } from './shell/content/content.component'; ] }) export class CoreModule { - constructor(@Optional() @SkipSelf() parentModule: CoreModule) { // Import guard if (parentModule) { throw new Error(`${parentModule} has already been loaded. Import Core module in the AppModule only.`); } } - } diff --git a/src/app/core/dialogs/dialogs.ts b/src/app/core/dialogs/dialogs.ts index c532a21fa..05f890c2c 100644 --- a/src/app/core/dialogs/dialogs.ts +++ b/src/app/core/dialogs/dialogs.ts @@ -4,7 +4,7 @@ import { Injectable } from '@angular/core'; providedIn: 'root' }) export class Dialogs { - constructor() { } + constructor() {} public setColor(dataType: string): string { let color = 'primary'; @@ -23,5 +23,4 @@ export class Dialogs { } return color; } - } diff --git a/src/app/core/http/api-prefix.interceptor.ts b/src/app/core/http/api-prefix.interceptor.ts index 499dd8412..60ef891a8 100644 --- a/src/app/core/http/api-prefix.interceptor.ts +++ b/src/app/core/http/api-prefix.interceptor.ts @@ -16,7 +16,7 @@ export class ApiPrefixInterceptor implements HttpInterceptor { /** * @param {SettingsService} settingsService Settings Service */ - constructor(private settingsService: SettingsService) { } + constructor(private settingsService: SettingsService) {} /** * Intercepts a Http request and prefixes it with `serverUrl`. @@ -40,5 +40,4 @@ export class ApiPrefixInterceptor implements HttpInterceptor { } return next.handle(request); } - } diff --git a/src/app/core/http/cache.interceptor.ts b/src/app/core/http/cache.interceptor.ts index 9ed2a2b8f..e7f53f101 100644 --- a/src/app/core/http/cache.interceptor.ts +++ b/src/app/core/http/cache.interceptor.ts @@ -14,10 +14,9 @@ import { HttpCacheService } from './http-cache.service'; */ @Injectable() export class CacheInterceptor implements HttpInterceptor { - private forceUpdate = false; - constructor(private httpCacheService: HttpCacheService) { } + constructor(private httpCacheService: HttpCacheService) {} /** * Configures interceptor options @@ -44,19 +43,17 @@ export class CacheInterceptor implements HttpInterceptor { subscriber.next(new HttpResponse(cachedData as Object)); subscriber.complete(); } else { - next.handle(request) - .subscribe( - event => { - if (event instanceof HttpResponse) { - this.httpCacheService.setCacheData(request.urlWithParams, event); - } - subscriber.next(event); - }, - error => subscriber.error(error), - () => subscriber.complete() - ); + next.handle(request).subscribe( + (event) => { + if (event instanceof HttpResponse) { + this.httpCacheService.setCacheData(request.urlWithParams, event); + } + subscriber.next(event); + }, + (error) => subscriber.error(error), + () => subscriber.complete() + ); } }); } - } diff --git a/src/app/core/http/error-handler.interceptor.ts b/src/app/core/http/error-handler.interceptor.ts index c4f625c5a..49eb2bc6a 100644 --- a/src/app/core/http/error-handler.interceptor.ts +++ b/src/app/core/http/error-handler.interceptor.ts @@ -21,17 +21,16 @@ const log = new Logger('ErrorHandlerInterceptor'); */ @Injectable() export class ErrorHandlerInterceptor implements HttpInterceptor { - /** * @param {AlertService} alertService Alert Service. */ - constructor(private alertService: AlertService) { } + constructor(private alertService: AlertService) {} /** * Intercepts a Http request and adds a default error handler. */ intercept(request: HttpRequest, next: HttpHandler): Observable> { - return next.handle(request).pipe(catchError(error => this.handleError(error))); + return next.handle(request).pipe(catchError((error) => this.handleError(error))); } /** @@ -39,7 +38,7 @@ export class ErrorHandlerInterceptor implements HttpInterceptor { */ private handleError(response: HttpErrorResponse): Observable> { const status = response.status; - let errorMessage = (response.error.developerMessage || response.message); + let errorMessage = response.error.developerMessage || response.message; if (response.error.errors) { if (response.error.errors[0]) { errorMessage = response.error.errors[0].defaultUserMessage || response.error.errors[0].developerMessage; @@ -55,18 +54,26 @@ export class ErrorHandlerInterceptor implements HttpInterceptor { } else if (status === 403 && errorMessage === 'The provided one time token is invalid') { this.alertService.alert({ type: 'Invalid Token', message: 'Invalid Token. Please try again!' }); } else if (status === 400) { - this.alertService.alert({ type: 'Bad Request', message: errorMessage || 'Invalid parameters were passed in the request!' }); + this.alertService.alert({ + type: 'Bad Request', + message: errorMessage || 'Invalid parameters were passed in the request!' + }); } else if (status === 403) { - this.alertService.alert({ type: 'Unauthorized Request', message: errorMessage || 'You are not authorized for this request!' }); + this.alertService.alert({ + type: 'Unauthorized Request', + message: errorMessage || 'You are not authorized for this request!' + }); } else if (status === 404) { this.alertService.alert({ type: 'Resource does not exist', message: errorMessage || 'Resource does not exist!' }); - } else if (status === 500) { - this.alertService.alert({ type: 'Internal Server Error', message: 'Internal Server Error. Please try again later.' }); + } else if (status === 500) { + this.alertService.alert({ + type: 'Internal Server Error', + message: 'Internal Server Error. Please try again later.' + }); } else { this.alertService.alert({ type: 'Unknown Error', message: 'Unknown Error. Please try again later.' }); } throw response; } - } diff --git a/src/app/core/http/http-cache.service.ts b/src/app/core/http/http-cache.service.ts index bf30ce81e..9d6f76ff9 100644 --- a/src/app/core/http/http-cache.service.ts +++ b/src/app/core/http/http-cache.service.ts @@ -22,11 +22,10 @@ export interface HttpCacheEntry { */ @Injectable() export class HttpCacheService { - /** Key to cache Http Requests in storage. */ private cachePersistenceStorageKey = 'mifosXHttpCache'; - private cachedData: { [key: string]: HttpCacheEntry; } = {}; + private cachedData: { [key: string]: HttpCacheEntry } = {}; private storage: Storage | null = null; constructor() { @@ -122,5 +121,4 @@ export class HttpCacheService { const data = this.storage ? this.storage[this.cachePersistenceStorageKey] : null; this.cachedData = data ? JSON.parse(data) : {}; } - } diff --git a/src/app/core/http/http.service.ts b/src/app/core/http/http.service.ts index 1b59b3316..90f5001b7 100644 --- a/src/app/core/http/http.service.ts +++ b/src/app/core/http/http.service.ts @@ -15,13 +15,11 @@ import { ApiPrefixInterceptor } from './api-prefix.interceptor'; * (see https://github.com/Microsoft/TypeScript/issues/13897) */ declare module '@angular/common/http' { - /** * Augment HttpClient with the added configuration methods from HttpService, to allow in-place replacement of * HttpClient with HttpService using dependency injection. */ export interface HttpClient { - /** * Enables caching for this request. * @param {boolean} forceUpdate Forces request to be made and updates cache entry. @@ -40,22 +38,21 @@ declare module '@angular/common/http' { * @returns {HttpClient} The new instance. */ disableApiPrefix(): HttpClient; - } - } /** * From @angular/common/http/src/interceptor: allows to chain interceptors */ class HttpInterceptorHandler implements HttpHandler { - - constructor(private next: HttpHandler, private interceptor: HttpInterceptor) { } + constructor( + private next: HttpHandler, + private interceptor: HttpInterceptor + ) {} handle(request: HttpRequest): Observable> { return this.interceptor.intercept(request, this.next); } - } /** @@ -73,18 +70,18 @@ export const HTTP_DYNAMIC_INTERCEPTORS = new InjectionToken('HT */ @Injectable() export class HttpService extends HttpClient { - - constructor(private httpHandler: HttpHandler, - private injector: Injector, - @Optional() @Inject(HTTP_DYNAMIC_INTERCEPTORS) private interceptors: HttpInterceptor[] = []) { + constructor( + private httpHandler: HttpHandler, + private injector: Injector, + @Optional() @Inject(HTTP_DYNAMIC_INTERCEPTORS) private interceptors: HttpInterceptor[] = [] + ) { super(httpHandler); if (!this.interceptors) { // Configure default interceptors that can be disabled here this.interceptors = [ this.injector.get(ApiPrefixInterceptor), - this.injector.get(ErrorHandlerInterceptor) - ]; + this.injector.get(ErrorHandlerInterceptor)]; } } @@ -116,16 +113,11 @@ export class HttpService extends HttpClient { return new HttpService( this.httpHandler, this.injector, - this.interceptors.filter(i => !(i instanceof interceptorType)) + this.interceptors.filter((i) => !(i instanceof interceptorType)) ); } private addInterceptor(interceptor: HttpInterceptor): HttpService { - return new HttpService( - this.httpHandler, - this.injector, - this.interceptors.concat([interceptor]) - ); + return new HttpService(this.httpHandler, this.injector, this.interceptors.concat([interceptor])); } - } diff --git a/src/app/core/i18n/i18n.service.ts b/src/app/core/i18n/i18n.service.ts index ec112d3c7..1f784a3bb 100644 --- a/src/app/core/i18n/i18n.service.ts +++ b/src/app/core/i18n/i18n.service.ts @@ -7,11 +7,9 @@ import { Observable } from 'rxjs'; @Injectable() export class I18nService { - - constructor(private translateService: TranslateService) { } + constructor(private translateService: TranslateService) {} public translate(key: string): Observable { return this.translateService.get(key); } - } diff --git a/src/app/core/logger/logger.service.ts b/src/app/core/logger/logger.service.ts index c06e566cd..35b3dabaf 100644 --- a/src/app/core/logger/logger.service.ts +++ b/src/app/core/logger/logger.service.ts @@ -48,7 +48,6 @@ export enum LogLevel { export type LogOutput = (source: string, level: LogLevel, ...objects: any[]) => void; export class Logger { - /** * Current logging level. * Set it to LogLevel.Off to disable logs completely. @@ -68,7 +67,7 @@ export class Logger { Logger.level = LogLevel.Warning; } - constructor(private source?: string) { } + constructor(private source?: string) {} /** * Logs messages or objects with the debug level. @@ -106,8 +105,15 @@ export class Logger { if (level <= Logger.level) { const log = this.source ? ['[' + this.source + ']'].concat(objects) : objects; func.apply(console, log); - Logger.outputs.forEach((output) => output.apply(output, [this.source, level].concat(objects))); + Logger.outputs.forEach((output) => + output.apply( + output, + [ + this.source, + level + ].concat(objects) + ) + ); } } - } diff --git a/src/app/core/progress-bar/progress-bar.service.ts b/src/app/core/progress-bar/progress-bar.service.ts index 3e6049700..e680b43c6 100644 --- a/src/app/core/progress-bar/progress-bar.service.ts +++ b/src/app/core/progress-bar/progress-bar.service.ts @@ -6,7 +6,6 @@ import { Injectable, EventEmitter } from '@angular/core'; */ @Injectable() export class ProgressBarService { - /** Progress bar update event. */ public updateProgressBar: EventEmitter; /** Denotes the number of requests currently running. */ @@ -50,5 +49,4 @@ export class ProgressBarService { } } } - } diff --git a/src/app/core/progress-bar/progress.interceptor.ts b/src/app/core/progress-bar/progress.interceptor.ts index fb9782525..99bcebe3a 100644 --- a/src/app/core/progress-bar/progress.interceptor.ts +++ b/src/app/core/progress-bar/progress.interceptor.ts @@ -1,6 +1,6 @@ /** Angular Imports */ import { Injectable } from '@angular/core'; -import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse} from '@angular/common/http'; +import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http'; /** rxjs Imports */ import { Observable } from 'rxjs'; @@ -14,11 +14,10 @@ import { ProgressBarService } from './progress-bar.service'; */ @Injectable() export class ProgressInterceptor implements HttpInterceptor { - /** * @param {ProgressBarService} progressBarService Progress Bar Service. */ - constructor(private progressBarService: ProgressBarService) { } + constructor(private progressBarService: ProgressBarService) {} /** * Intercepts a Http request to start loading the progress bar for a pending request @@ -26,12 +25,10 @@ export class ProgressInterceptor implements HttpInterceptor { */ intercept(request: HttpRequest, next: HttpHandler): Observable> { this.progressBarService.increase(); - return next.handle(request) - .pipe( - finalize( - () => { this.progressBarService.decrease(); } - ) - ); + return next.handle(request).pipe( + finalize(() => { + this.progressBarService.decrease(); + }) + ); } - } diff --git a/src/app/core/route/route-reusable-strategy.ts b/src/app/core/route/route-reusable-strategy.ts index de871c22b..91318d4fa 100644 --- a/src/app/core/route/route-reusable-strategy.ts +++ b/src/app/core/route/route-reusable-strategy.ts @@ -9,12 +9,11 @@ import { Injectable } from '@angular/core'; */ @Injectable() export class RouteReusableStrategy extends RouteReuseStrategy { - public shouldDetach(route: ActivatedRouteSnapshot): boolean { return false; } - public store(route: ActivatedRouteSnapshot, detachedTree: DetachedRouteHandle | null): void { } + public store(route: ActivatedRouteSnapshot, detachedTree: DetachedRouteHandle | null): void {} public shouldAttach(route: ActivatedRouteSnapshot): boolean { return false; @@ -25,7 +24,6 @@ export class RouteReusableStrategy extends RouteReuseStrategy { } public shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean { - return (future.routeConfig === curr.routeConfig) || future.data.reuse; + return future.routeConfig === curr.routeConfig || future.data.reuse; } - } diff --git a/src/app/core/route/route.service.ts b/src/app/core/route/route.service.ts index 63e29158e..248790e2b 100644 --- a/src/app/core/route/route.service.ts +++ b/src/app/core/route/route.service.ts @@ -11,7 +11,6 @@ import { AuthenticationGuard } from '../authentication/authentication.guard'; * Provides helper methods to create routes. */ export class Route { - /** * Creates routes using the shell component and authentication. * @param routes The routes to add. @@ -22,10 +21,9 @@ export class Route { path: '', component: ShellComponent, children: routes, - canActivate: [AuthenticationGuard], + canActivate: [AuthenticationGuard] // Reuse ShellComponent instance when navigating between child views // data: { reuse: true } }; } - } diff --git a/src/app/core/shell/breadcrumb/breadcrumb.component.spec.ts b/src/app/core/shell/breadcrumb/breadcrumb.component.spec.ts index 1fddbf835..8b78fdeb1 100644 --- a/src/app/core/shell/breadcrumb/breadcrumb.component.spec.ts +++ b/src/app/core/shell/breadcrumb/breadcrumb.component.spec.ts @@ -8,9 +8,8 @@ describe('BreadcrumbComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ BreadcrumbComponent ] - }) - .compileComponents(); + declarations: [BreadcrumbComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/core/shell/breadcrumb/breadcrumb.component.ts b/src/app/core/shell/breadcrumb/breadcrumb.component.ts index 052ce4f3b..a3063e9e5 100644 --- a/src/app/core/shell/breadcrumb/breadcrumb.component.ts +++ b/src/app/core/shell/breadcrumb/breadcrumb.component.ts @@ -1,5 +1,5 @@ /** Angular Imports */ -import { Component, TemplateRef, ElementRef , ViewChild, AfterViewInit} from '@angular/core'; +import { Component, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core'; import { ActivatedRoute, Router, NavigationEnd, Data } from '@angular/router'; /** rxjs Imports */ @@ -51,7 +51,6 @@ const routeAddBreadcrumbLink = 'addBreadcrumbLink'; styleUrls: ['./breadcrumb.component.scss'] }) export class BreadcrumbComponent implements AfterViewInit { - /** Array of breadcrumbs. */ breadcrumbs: Breadcrumb[]; /* Reference of breadcrumb */ @@ -66,11 +65,13 @@ export class BreadcrumbComponent implements AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private activatedRoute: ActivatedRoute, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService, - private translateService: TranslateService) { + constructor( + private activatedRoute: ActivatedRoute, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService, + private translateService: TranslateService + ) { this.generateBreadcrumbs(); } @@ -78,7 +79,7 @@ export class BreadcrumbComponent implements AfterViewInit { * Generates the array of breadcrumbs for the visited route. */ generateBreadcrumbs() { - const onNavigationEnd = this.router.events.pipe(filter(event => event instanceof NavigationEnd)); + const onNavigationEnd = this.router.events.pipe(filter((event) => event instanceof NavigationEnd)); onNavigationEnd.subscribe(() => { this.breadcrumbs = []; @@ -90,7 +91,7 @@ export class BreadcrumbComponent implements AfterViewInit { let breadcrumbLabel: any; let url: any; - childrenRoutes.forEach(route => { + childrenRoutes.forEach((route) => { currentRoute = route; breadcrumbLabel = false; @@ -98,22 +99,28 @@ export class BreadcrumbComponent implements AfterViewInit { return; } - const routeURL = route.snapshot.url.map(segment => segment.path).join('/'); + const routeURL = route.snapshot.url.map((segment) => segment.path).join('/'); currentUrl += `/${routeURL}`; if (currentUrl === '/') { breadcrumbLabel = 'Home'; } - const hasData = (route.routeConfig && route.routeConfig.data); + const hasData = route.routeConfig && route.routeConfig.data; if (hasData) { - if (route.snapshot.data.hasOwnProperty(routeResolveBreadcrumb) && route.snapshot.data[routeResolveBreadcrumb]) { + if ( + route.snapshot.data.hasOwnProperty(routeResolveBreadcrumb) && + route.snapshot.data[routeResolveBreadcrumb] + ) { breadcrumbLabel = route.snapshot.data; route.snapshot.data[routeResolveBreadcrumb].forEach((property: any) => { breadcrumbLabel = breadcrumbLabel[property]; }); - } else if (route.snapshot.data.hasOwnProperty(routeParamBreadcrumb) && route.snapshot.paramMap.get(route.snapshot.data[routeParamBreadcrumb])) { + } else if ( + route.snapshot.data.hasOwnProperty(routeParamBreadcrumb) && + route.snapshot.paramMap.get(route.snapshot.data[routeParamBreadcrumb]) + ) { breadcrumbLabel = route.snapshot.paramMap.get(route.snapshot.data[routeParamBreadcrumb]); const routeData: Data = route.snapshot.data; if (routeData.breadcrumb === 'Clients') { @@ -124,11 +131,23 @@ export class BreadcrumbComponent implements AfterViewInit { } else if (routeData.breadcrumb === 'Centers') { breadcrumbLabel = routeData.centerViewData.name; } else if (routeData.breadcrumb === 'Loans') { - breadcrumbLabel = this.printableValue(routeData.loanDetailsData.loanProductName) + ' (' + routeData.loanDetailsData.accountNo + ')'; + breadcrumbLabel = + this.printableValue(routeData.loanDetailsData.loanProductName) + + ' (' + + routeData.loanDetailsData.accountNo + + ')'; } else if (routeData.breadcrumb === 'Savings') { - breadcrumbLabel = this.printableValue(routeData.savingsAccountData.savingsProductName) + ' (' + routeData.savingsAccountData.accountNo + ')'; + breadcrumbLabel = + this.printableValue(routeData.savingsAccountData.savingsProductName) + + ' (' + + routeData.savingsAccountData.accountNo + + ')'; } else if (routeData.breadcrumb === 'Fixed Deposits') { - breadcrumbLabel = this.printableValue(routeData.fixedDepositsAccountData.depositProductName) + ' (' + routeData.fixedDepositsAccountData.accountNo + ')'; + breadcrumbLabel = + this.printableValue(routeData.fixedDepositsAccountData.depositProductName) + + ' (' + + routeData.fixedDepositsAccountData.accountNo + + ')'; } else if (routeData.breadcrumb === 'Loan Products') { breadcrumbLabel = this.printableValue(routeData.loanProduct.name); } else if (routeData.breadcrumb === 'Charges') { @@ -159,7 +178,7 @@ export class BreadcrumbComponent implements AfterViewInit { } } if (url !== undefined) { - if (url.length > 8 && url.search(`/clients/`) > 0 ) { + if (url.length > 8 && url.search(`/clients/`) > 0) { const replaceGeneral = `/general/`; let currentUrlTemp = url.replace(replaceGeneral, `/`); currentUrlTemp = currentUrlTemp.replace(`//`, `/`); @@ -197,7 +216,12 @@ export class BreadcrumbComponent implements AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -206,7 +230,7 @@ export class BreadcrumbComponent implements AfterViewInit { */ ngAfterViewInit() { if (this.configurationWizardService.showBreadcrumbs === true) { - setTimeout(() => { + setTimeout(() => { this.showPopover(this.templateBreadcrumb, this.breadcrumb.nativeElement, 'bottom', true); }); } @@ -237,8 +261,7 @@ export class BreadcrumbComponent implements AfterViewInit { getTranslate(text: string): any { const key: string = 'labels.text.' + text; const translation = this.translateService.instant(key); - const result = (translation !== key) ? translation : text; + const result = translation !== key ? translation : text; return result; } - } diff --git a/src/app/core/shell/content/content.component.spec.ts b/src/app/core/shell/content/content.component.spec.ts index 7ad6c91ba..ecadc88ad 100644 --- a/src/app/core/shell/content/content.component.spec.ts +++ b/src/app/core/shell/content/content.component.spec.ts @@ -8,9 +8,8 @@ describe('ContentComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ContentComponent ] - }) - .compileComponents(); + declarations: [ContentComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/core/shell/content/content.component.ts b/src/app/core/shell/content/content.component.ts index fc08db518..f3eb105b5 100644 --- a/src/app/core/shell/content/content.component.ts +++ b/src/app/core/shell/content/content.component.ts @@ -10,7 +10,5 @@ import { Component } from '@angular/core'; styleUrls: ['./content.component.scss'] }) export class ContentComponent { - - constructor() { } - + constructor() {} } diff --git a/src/app/core/shell/shell.component.spec.ts b/src/app/core/shell/shell.component.spec.ts index 504006a89..2cee0ba22 100644 --- a/src/app/core/shell/shell.component.spec.ts +++ b/src/app/core/shell/shell.component.spec.ts @@ -8,9 +8,8 @@ describe('ShellComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ShellComponent ] - }) - .compileComponents(); + declarations: [ShellComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/core/shell/shell.component.ts b/src/app/core/shell/shell.component.ts index 5787f55ea..0889fca40 100644 --- a/src/app/core/shell/shell.component.ts +++ b/src/app/core/shell/shell.component.ts @@ -18,12 +18,10 @@ import { ProgressBarService } from '../progress-bar/progress-bar.service'; styleUrls: ['./shell.component.scss'] }) export class ShellComponent implements OnInit, OnDestroy { - /** Subscription to breakpoint observer for handset. */ - isHandset$: Observable = this.breakpointObserver.observe(Breakpoints.Handset) - .pipe( - map(result => result.matches) - ); + isHandset$: Observable = this.breakpointObserver + .observe(Breakpoints.Handset) + .pipe(map((result) => result.matches)); /** Sets the initial state of sidenav as collapsed. Not collapsed if false. */ sidenavCollapsed = true; /** Progress bar mode. */ @@ -36,9 +34,11 @@ export class ShellComponent implements OnInit, OnDestroy { * @param {ProgressBarService} progressBarService Progress Bar Service. * @param {ChangeDetectorRef} cdr Change Detector Ref. */ - constructor(private breakpointObserver: BreakpointObserver, - private progressBarService: ProgressBarService, - private cdr: ChangeDetectorRef) { } + constructor( + private breakpointObserver: BreakpointObserver, + private progressBarService: ProgressBarService, + private cdr: ChangeDetectorRef + ) {} /** * Subscribes to progress bar to update its mode. @@ -67,5 +67,4 @@ export class ShellComponent implements OnInit, OnDestroy { this.progressBar$.unsubscribe(); } } - } diff --git a/src/app/core/shell/sidenav/frequent-activities.ts b/src/app/core/shell/sidenav/frequent-activities.ts index 164c5f25f..c207572ed 100644 --- a/src/app/core/shell/sidenav/frequent-activities.ts +++ b/src/app/core/shell/sidenav/frequent-activities.ts @@ -53,5 +53,5 @@ export const frequentActivities: any[] = [ path: '/self-service', icon: 'laptop', toolTip: 'Self Service' - }, + } ]; diff --git a/src/app/core/shell/sidenav/sidenav.component.spec.ts b/src/app/core/shell/sidenav/sidenav.component.spec.ts index df79e17ae..201373bde 100644 --- a/src/app/core/shell/sidenav/sidenav.component.spec.ts +++ b/src/app/core/shell/sidenav/sidenav.component.spec.ts @@ -8,9 +8,8 @@ describe('SidenavComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SidenavComponent ] - }) - .compileComponents(); + declarations: [SidenavComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/core/shell/sidenav/sidenav.component.ts b/src/app/core/shell/sidenav/sidenav.component.ts index 8abcb16f8..6bc24ed27 100644 --- a/src/app/core/shell/sidenav/sidenav.component.ts +++ b/src/app/core/shell/sidenav/sidenav.component.ts @@ -1,6 +1,5 @@ /** Angular Imports */ -import { Component, OnInit, Input, TemplateRef, ElementRef , ViewChild, - AfterViewInit } from '@angular/core'; +import { Component, OnInit, Input, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; @@ -25,7 +24,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./sidenav.component.scss'] }) export class SidenavComponent implements OnInit, AfterViewInit { - /** True if sidenav is in collapsed state. */ @Input() sidenavCollapsed: boolean; /** Tooltip position */ @@ -48,7 +46,6 @@ export class SidenavComponent implements OnInit, AfterViewInit { /* Template for popover on chart of accounts */ @ViewChild('templateChartOfAccounts') templateChartOfAccounts: TemplateRef; - /** * @param {Router} router Router for navigation. * @param {MatDialog} dialog Mat Dialog @@ -57,12 +54,14 @@ export class SidenavComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private router: Router, - public dialog: MatDialog, - private authenticationService: AuthenticationService, - private settingsService: SettingsService, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { + constructor( + private router: Router, + public dialog: MatDialog, + private authenticationService: AuthenticationService, + private settingsService: SettingsService, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { this.userActivity = JSON.parse(localStorage.getItem('mifosXLocation')); } @@ -79,8 +78,7 @@ export class SidenavComponent implements OnInit, AfterViewInit { * Logs out the authenticated user and redirects to login page. */ logout() { - this.authenticationService.logout() - .subscribe(() => this.router.navigate(['/login'], { replaceUrl: true })); + this.authenticationService.logout().subscribe(() => this.router.navigate(['/login'], { replaceUrl: true })); } /** @@ -102,18 +100,24 @@ export class SidenavComponent implements OnInit, AfterViewInit { * Returns top three frequent activities. */ getFrequentActivities() { - const frequencyCounts: any = {}; - let index = this.userActivity.length; + const frequencyCounts: any = {}; + let index = this.userActivity.length; while (index) { frequencyCounts[this.userActivity[--index]] = (frequencyCounts[this.userActivity[index]] || 0) + 1; } const frequencyCountsArray = Object.entries(frequencyCounts); - const topThreeFrequentActivities = - frequencyCountsArray - .sort((a: any, b: any) => b[1] - a[1]) - .map((entry: any[]) => entry[0]) - .filter((activity: string) => !['/', '/login', '/home', '/dashboard'].includes(activity)) - .slice(0, 3); + const topThreeFrequentActivities = frequencyCountsArray + .sort((a: any, b: any) => b[1] - a[1]) + .map((entry: any[]) => entry[0]) + .filter( + (activity: string) => ![ + '/', + '/login', + '/home', + '/dashboard' + ].includes(activity) + ) + .slice(0, 3); return topThreeFrequentActivities; } @@ -168,7 +172,12 @@ export class SidenavComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -178,12 +187,12 @@ export class SidenavComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showSideNav === true) { setTimeout(() => { - this.showPopover(this.templateLogo, this.logo.nativeElement, 'bottom', true); + this.showPopover(this.templateLogo, this.logo.nativeElement, 'bottom', true); }); } if (this.configurationWizardService.showSideNavChartofAccounts === true) { setTimeout(() => { - this.showPopover(this.templateChartOfAccounts, this.chartOfAccounts.nativeElement, 'top', true); + this.showPopover(this.templateChartOfAccounts, this.chartOfAccounts.nativeElement, 'top', true); }); } } @@ -218,5 +227,4 @@ export class SidenavComponent implements OnInit, AfterViewInit { } return this.settingsService.tenantIdentifier; } - } diff --git a/src/app/core/shell/toolbar/toolbar.component.spec.ts b/src/app/core/shell/toolbar/toolbar.component.spec.ts index e01f9a83d..4a778ffe6 100644 --- a/src/app/core/shell/toolbar/toolbar.component.spec.ts +++ b/src/app/core/shell/toolbar/toolbar.component.spec.ts @@ -8,9 +8,8 @@ describe('ToolbarComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ToolbarComponent ] - }) - .compileComponents(); + declarations: [ToolbarComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/core/shell/toolbar/toolbar.component.ts b/src/app/core/shell/toolbar/toolbar.component.ts index 428a29440..11e56f931 100644 --- a/src/app/core/shell/toolbar/toolbar.component.ts +++ b/src/app/core/shell/toolbar/toolbar.component.ts @@ -1,5 +1,17 @@ /** Angular Imports */ -import { Component, OnInit, Input, EventEmitter, Output, ViewChild, AfterViewInit, ElementRef, TemplateRef, AfterContentChecked, ChangeDetectorRef } from '@angular/core'; +import { + Component, + OnInit, + Input, + EventEmitter, + Output, + ViewChild, + AfterViewInit, + ElementRef, + TemplateRef, + AfterContentChecked, + ChangeDetectorRef +} from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatSidenav } from '@angular/material/sidenav'; import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; @@ -26,7 +38,6 @@ import { ConfigurationWizardComponent } from '../../../configuration-wizard/conf styleUrls: ['./toolbar.component.scss'] }) export class ToolbarComponent implements OnInit, AfterViewInit, AfterContentChecked { - /* Reference of institution */ @ViewChild('institution') institution: ElementRef; /* Template for popover on institution */ @@ -36,12 +47,10 @@ export class ToolbarComponent implements OnInit, AfterViewInit, AfterContentChec /* Template for popover on appMenu */ @ViewChild('templateAppMenu') templateAppMenu: TemplateRef; - /** Subscription to breakpoint observer for handset. */ - isHandset$: Observable = this.breakpointObserver.observe(Breakpoints.Handset) - .pipe( - map(result => result.matches) - ); + isHandset$: Observable = this.breakpointObserver + .observe(Breakpoints.Handset) + .pipe(map((result) => result.matches)); /** Sets the initial state of sidenav as collapsed. Not collapsed if false. */ sidenavCollapsed = true; @@ -59,19 +68,21 @@ export class ToolbarComponent implements OnInit, AfterViewInit, AfterContentChec * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private breakpointObserver: BreakpointObserver, - private router: Router, - private authenticationService: AuthenticationService, - private popoverService: PopoverService, - private configurationWizardService: ConfigurationWizardService, - private dialog: MatDialog, - private changeDetector: ChangeDetectorRef) { } + constructor( + private breakpointObserver: BreakpointObserver, + private router: Router, + private authenticationService: AuthenticationService, + private popoverService: PopoverService, + private configurationWizardService: ConfigurationWizardService, + private dialog: MatDialog, + private changeDetector: ChangeDetectorRef + ) {} /** * Subscribes to breakpoint for handset. */ ngOnInit() { - this.isHandset$.subscribe(isHandset => { + this.isHandset$.subscribe((isHandset) => { if (isHandset && this.sidenavCollapsed) { this.toggleSidenavCollapse(false); } @@ -101,8 +112,7 @@ export class ToolbarComponent implements OnInit, AfterViewInit, AfterContentChec * Logs out the authenticated user and redirects to login page. */ logout() { - this.authenticationService.logout() - .subscribe(() => this.router.navigate(['/login'], { replaceUrl: true })); + this.authenticationService.logout().subscribe(() => this.router.navigate(['/login'], { replaceUrl: true })); } /** @@ -167,7 +177,6 @@ export class ToolbarComponent implements OnInit, AfterViewInit, AfterContentChec this.router.navigate(['/organization']); } if (response.show === 0) { - } }); } @@ -182,8 +191,11 @@ export class ToolbarComponent implements OnInit, AfterViewInit, AfterContentChec }); } - if (this.configurationWizardService.showSideNav === true || this.configurationWizardService.showSideNavChartofAccounts === true) { - this.toggleSidenavCollapse(); + if ( + this.configurationWizardService.showSideNav === true || + this.configurationWizardService.showSideNavChartofAccounts === true + ) { + this.toggleSidenavCollapse(); } if (this.configurationWizardService.showToolbarAdmin === true) { @@ -196,5 +208,4 @@ export class ToolbarComponent implements OnInit, AfterViewInit, AfterContentChec navigateMenu(routePath: string): void { this.router.navigate([routePath]); } - } diff --git a/src/app/core/utils/accounting.ts b/src/app/core/utils/accounting.ts index 65f923fac..0ae38c357 100644 --- a/src/app/core/utils/accounting.ts +++ b/src/app/core/utils/accounting.ts @@ -2,84 +2,99 @@ import { Injectable } from '@angular/core'; import { AccountingMapping, GLAccount } from 'app/shared/models/general.model'; import { OptionData } from 'app/shared/models/option-data.model'; - @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class Accounting { + public getAccountingRulesForShares(): string[] { + return [ + 'NONE', + 'Cash' + ]; + } - public getAccountingRulesForShares(): string[] { - return ['NONE', 'Cash']; + public getAccountingRulesForSavings(): string[] { + return [ + 'NONE', + 'Cash', + 'Accrual (periodic)' + ]; + } + + public getAccountingRulesForLoans(): string[] { + return [ + 'NONE', + 'Cash', + 'Accrual (periodic)', + 'Accrual (upfront)' + ]; + } + + public getAccountRuleName(value: string): string { + if ([ + 'ACCRUAL PERIODIC', + 'ACCRUAL (PERIODIC)' + ].includes(value)) { + return 'Accrual (periodic)'; + } else if ([ + 'ACCRUAL UPFRONT', + 'ACCRUAL (UPFRONT)' + ].includes(value)) { + return 'Accrual (upfront)'; + } else if (value === 'CASH BASED') { + return 'Cash'; + } else if (value === 'NONE') { + return 'NONE'; } + return ''; + } - public getAccountingRulesForSavings(): string[] { - return ['NONE', 'Cash', 'Accrual (periodic)']; + public isNoneAccounting(accountingRule: OptionData): boolean { + return accountingRule.id === 1; + } + + public isNoneAccountingRuleId(accountingRuleId: number): boolean { + return accountingRuleId === 1; + } + + public isCashOrAccrualAccounting(accountingRule: OptionData): boolean { + return accountingRule.id === 2 || accountingRule.id === 3; + } + + public isCashOrAccrualAccountingRuleId(accountingRuleId: number): boolean { + return accountingRuleId === 2 || accountingRuleId === 3; + } + + public isAccrualAccounting(accountingRule: OptionData): boolean { + return accountingRule.id === 3; + } + + public isAccrualAccountingRuleId(accountingRuleId: number): boolean { + return accountingRuleId === 3; + } + + public getAccountingRuleFrom(accountingRuleId: number): OptionData { + if (accountingRuleId === 1) { + return { code: 'NONE', id: accountingRuleId, value: 'None' }; + } else if (accountingRuleId === 2) { + return { code: 'CASH', id: accountingRuleId, value: 'Cash' }; + } else if (accountingRuleId === 3) { + return { code: 'ACCRUAL_PERIODIC', id: accountingRuleId, value: 'Accural (periodic)' }; + } else if (accountingRuleId === 4) { + return { code: 'ACCRUAL_UPFRONT', id: accountingRuleId, value: 'Accural (upfront)' }; } + return { code: 'INVALID', id: accountingRuleId, value: 'Invalid' }; + } - public getAccountingRulesForLoans(): string[] { - return ['NONE', 'Cash', 'Accrual (periodic)', 'Accrual (upfront)']; - } - - public getAccountRuleName(value: string): string { - if (['ACCRUAL PERIODIC', 'ACCRUAL (PERIODIC)'].includes(value)) { - return 'Accrual (periodic)'; - } else if (['ACCRUAL UPFRONT', 'ACCRUAL (UPFRONT)'].includes(value)) { - return 'Accrual (upfront)'; - } else if (value === 'CASH BASED') { - return 'Cash'; - } else if (value === 'NONE') { - return 'NONE'; + public glAccountLookUp(glAccountId: number, glAccounts: GLAccount[]): AccountingMapping { + let accountMapping: AccountingMapping | null = null; + if (glAccountId) { + glAccounts.some((glAccount: GLAccount) => { + if (glAccount.id === glAccountId) { + accountMapping = { id: glAccount.id, name: glAccount.name, glCode: glAccount.glCode }; } - return ''; + }); } - - public isNoneAccounting(accountingRule: OptionData): boolean { - return (accountingRule.id === 1); - } - - public isNoneAccountingRuleId(accountingRuleId: number): boolean { - return (accountingRuleId === 1); - } - - public isCashOrAccrualAccounting(accountingRule: OptionData): boolean { - return ((accountingRule.id === 2) || (accountingRule.id === 3)); - } - - public isCashOrAccrualAccountingRuleId(accountingRuleId: number): boolean { - return ((accountingRuleId === 2) || (accountingRuleId === 3)); - } - - public isAccrualAccounting(accountingRule: OptionData): boolean { - return (accountingRule.id === 3); - } - - public isAccrualAccountingRuleId(accountingRuleId: number): boolean { - return (accountingRuleId === 3); - } - - public getAccountingRuleFrom(accountingRuleId: number): OptionData { - if (accountingRuleId === 1) { - return {code: 'NONE', id: accountingRuleId, value: 'None'}; - } else if (accountingRuleId === 2) { - return {code: 'CASH', id: accountingRuleId, value: 'Cash'}; - } else if (accountingRuleId === 3) { - return {code: 'ACCRUAL_PERIODIC', id: accountingRuleId, value: 'Accural (periodic)'}; - } else if (accountingRuleId === 4) { - return {code: 'ACCRUAL_UPFRONT', id: accountingRuleId, value: 'Accural (upfront)'}; - } - return {code: 'INVALID', id: accountingRuleId, value: 'Invalid'}; - } - - public glAccountLookUp(glAccountId: number, glAccounts: GLAccount[]): AccountingMapping { - let accountMapping: AccountingMapping | null = null; - if (glAccountId) { - glAccounts.some((glAccount: GLAccount) => { - if (glAccount.id === glAccountId) { - accountMapping = { id: glAccount.id, name: glAccount.name, glCode: glAccount.glCode }; - } - }); - } - return accountMapping; - } - + return accountMapping; + } } diff --git a/src/app/core/utils/charges.ts b/src/app/core/utils/charges.ts index d61b76e26..0c20098e1 100644 --- a/src/app/core/utils/charges.ts +++ b/src/app/core/utils/charges.ts @@ -1,19 +1,16 @@ import { Injectable } from '@angular/core'; import { OptionData } from 'app/shared/models/option-data.model'; - @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class Charges { - - public getChargeAppliesToOptions(): OptionData[] { - return [ - { 'id': 1, 'code': 'chargeAppliesTo.loan', 'value': 'Loan' }, - { 'id': 2, 'code': 'chargeAppliesTo.savings', 'value': 'Savings' }, - { 'id': 3, 'code': 'chargeAppliesTo.client', 'value': 'Client' }, - { 'id': 4, 'code': 'chargeAppliesTo.shares', 'value': 'Shares' } - ]; - } - + public getChargeAppliesToOptions(): OptionData[] { + return [ + { id: 1, code: 'chargeAppliesTo.loan', value: 'Loan' }, + { id: 2, code: 'chargeAppliesTo.savings', value: 'Savings' }, + { id: 3, code: 'chargeAppliesTo.client', value: 'Client' }, + { id: 4, code: 'chargeAppliesTo.shares', value: 'Shares' } + ]; + } } diff --git a/src/app/core/utils/commons.ts b/src/app/core/utils/commons.ts index f10c4fb5f..5d2c49225 100644 --- a/src/app/core/utils/commons.ts +++ b/src/app/core/utils/commons.ts @@ -4,18 +4,17 @@ import { Injectable } from '@angular/core'; providedIn: 'root' }) export class Commons { - constructor() {} public dynamicSort(property: string) { let sortOrder = 1; if (property[0] === '-') { - sortOrder = -1; - property = property.substr(1); + sortOrder = -1; + property = property.substr(1); } return (a: any, b: any) => { - const result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0; - return result * sortOrder; + const result = a[property] < b[property] ? -1 : a[property] > b[property] ? 1 : 0; + return result * sortOrder; }; -} + } } diff --git a/src/app/core/utils/datatables.ts b/src/app/core/utils/datatables.ts index 4e13db704..5c17c95fb 100644 --- a/src/app/core/utils/datatables.ts +++ b/src/app/core/utils/datatables.ts @@ -11,14 +11,29 @@ import { Dates } from './dates'; providedIn: 'root' }) export class Datatables { + systemFields: string[] = [ + 'id', + 'created_at', + 'updated_at' + ]; - systemFields: string[] = ['id', 'created_at', 'updated_at']; + entitiesIdFields: string[] = [ + 'client_id', + 'savings_account_id', + 'savings_transaction_id', + 'loan_id', + 'group_id', + 'center_id', + 'office_id', + 'product_loan_id', + 'savings_product_id', + 'share_product_id' + ]; - entitiesIdFields: string[] = ['client_id', 'savings_account_id', 'savings_transaction_id', - 'loan_id', 'group_id', 'center_id', 'office_id', 'product_loan_id', 'savings_product_id', 'share_product_id']; - - constructor(private dateUtils: Dates, - private settingsService: SettingsService) { } + constructor( + private dateUtils: Dates, + private settingsService: SettingsService + ) {} public getFormfields(columns: any, dateTransformColumns: string[], dataTableEntryObject: any) { return columns.map((column: any) => { @@ -26,27 +41,30 @@ export class Datatables { case 'INTEGER': case 'STRING': case 'DECIMAL': - case 'TEXT': return new InputBase({ - controlName: column.columnName, - label: column.columnName, - value: '', - type: (column.columnDisplayType === 'INTEGER' || column.columnDisplayType === 'DECIMAL') ? 'number' : 'text', - required: (column.isColumnNullable) ? false : true - }); - case 'BOOLEAN': return new CheckboxBase({ - controlName: column.columnName, - label: column.columnName, - value: '', - type: 'checkbox', - required: (column.isColumnNullable) ? false : true - }); - case 'CODELOOKUP': return new SelectBase({ - controlName: column.columnName, - label: column.columnName, - value: '', - options: { label: 'value', value: 'id', data: column.columnValues }, - required: (column.isColumnNullable) ? false : true - }); + case 'TEXT': + return new InputBase({ + controlName: column.columnName, + label: column.columnName, + value: '', + type: column.columnDisplayType === 'INTEGER' || column.columnDisplayType === 'DECIMAL' ? 'number' : 'text', + required: column.isColumnNullable ? false : true + }); + case 'BOOLEAN': + return new CheckboxBase({ + controlName: column.columnName, + label: column.columnName, + value: '', + type: 'checkbox', + required: column.isColumnNullable ? false : true + }); + case 'CODELOOKUP': + return new SelectBase({ + controlName: column.columnName, + label: column.columnName, + value: '', + options: { label: 'value', value: 'id', data: column.columnValues }, + required: column.isColumnNullable ? false : true + }); case 'DATE': { dateTransformColumns.push(column.columnName); if (!dataTableEntryObject.dateFormat) { @@ -57,7 +75,7 @@ export class Datatables { label: column.columnName, value: '', maxDate: this.settingsService.maxAllowedDate, - required: (column.isColumnNullable) ? false : true + required: column.isColumnNullable ? false : true }); } case 'DATETIME': { @@ -68,7 +86,7 @@ export class Datatables { label: column.columnName, value: '', maxDate: this.settingsService.maxAllowedDate, - required: (column.isColumnNullable) ? false : true + required: column.isColumnNullable ? false : true }); } } @@ -76,11 +94,11 @@ export class Datatables { } public isEntityId(columnName: string): boolean { - return (this.entitiesIdFields.includes(columnName)); + return this.entitiesIdFields.includes(columnName); } public isSystemColumn(columnName: string): boolean { - return (this.systemFields.includes(columnName) || this.entitiesIdFields.includes(columnName)); + return this.systemFields.includes(columnName) || this.entitiesIdFields.includes(columnName); } public filterSystemColumns(columnHeaders: any): any { @@ -124,7 +142,7 @@ export class Datatables { } public isColumnType(columnType: string, expectedType: string): boolean { - return (columnType === expectedType); + return columnType === expectedType; } public buildPayload(datatableInputs: any, datatableDataValues: any, dateFormat: string, output: any): any { @@ -159,12 +177,11 @@ export class Datatables { } public isValidUrl(urlString: string): boolean { - try { - const url = new URL(urlString); - return url.protocol.startsWith('http') || url.protocol.startsWith('https'); - } catch (e) { - return false; - } + try { + const url = new URL(urlString); + return url.protocol.startsWith('http') || url.protocol.startsWith('https'); + } catch (e) { + return false; + } } - } diff --git a/src/app/core/utils/dates.ts b/src/app/core/utils/dates.ts index 7180653b6..97b5d3f3f 100644 --- a/src/app/core/utils/dates.ts +++ b/src/app/core/utils/dates.ts @@ -6,7 +6,6 @@ import * as moment from 'moment'; providedIn: 'root' }) export class Dates { - public static DEFAULT_DATEFORMAT = 'yyyy-MM-dd'; public static DEFAULT_DATETIMEFORMAT = 'yyyy-MM-dd HH:mm'; @@ -48,8 +47,11 @@ export class Dates { return JSON.parse(localStorage.getItem('mifosXLanguage')); } - calculateDiff(date1: Date, date2: Date){ - return Math.floor((Date.UTC(date2.getFullYear(), date2.getMonth(), date2.getDate()) - Date.UTC(date1.getFullYear(), date1.getMonth(), date1.getDate()) ) /(1000 * 60 * 60 * 24)); + calculateDiff(date1: Date, date2: Date) { + return Math.floor( + (Date.UTC(date2.getFullYear(), date2.getMonth(), date2.getDate()) - + Date.UTC(date1.getFullYear(), date1.getMonth(), date1.getDate())) / + (1000 * 60 * 60 * 24) + ); } - } diff --git a/src/app/core/utils/dropdownOptions.ts b/src/app/core/utils/dropdownOptions.ts index 096902091..049aa3f81 100644 --- a/src/app/core/utils/dropdownOptions.ts +++ b/src/app/core/utils/dropdownOptions.ts @@ -2,27 +2,26 @@ import { Injectable } from '@angular/core'; import { OptionData } from 'app/shared/models/option-data.model'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class DropdownOptions { - - public retrievePeriodFrequencyTypeOptions(includeAll: boolean): OptionData[] { - if (includeAll) { - return [ - { id: 0, code: 'DAYS', value: 'Days' }, - { id: 1, code: 'WEEKS', value: 'Weeks' }, - { id: 2, code: 'MONTHS', value: 'Months' }, - { id: 3, code: 'YEARS', value: 'Years' }, - { id: 4, code: 'WHOLE_TERM', value: 'Whole Term' }, - { id: 5, code: 'INVALID', value: 'Invalid' }, - ]; - } else { - return [ - { id: 0, code: 'DAYS', value: 'Days' }, - { id: 1, code: 'WEEKS', value: 'Weeks' }, - { id: 2, code: 'MONTHS', value: 'Months' }, - { id: 3, code: 'YEARS', value: 'Years' } - ]; - } + public retrievePeriodFrequencyTypeOptions(includeAll: boolean): OptionData[] { + if (includeAll) { + return [ + { id: 0, code: 'DAYS', value: 'Days' }, + { id: 1, code: 'WEEKS', value: 'Weeks' }, + { id: 2, code: 'MONTHS', value: 'Months' }, + { id: 3, code: 'YEARS', value: 'Years' }, + { id: 4, code: 'WHOLE_TERM', value: 'Whole Term' }, + { id: 5, code: 'INVALID', value: 'Invalid' } + ]; + } else { + return [ + { id: 0, code: 'DAYS', value: 'Days' }, + { id: 1, code: 'WEEKS', value: 'Weeks' }, + { id: 2, code: 'MONTHS', value: 'Months' }, + { id: 3, code: 'YEARS', value: 'Years' } + ]; } + } } diff --git a/src/app/core/utils/passwords-utility.ts b/src/app/core/utils/passwords-utility.ts index fab3a1657..89105be43 100644 --- a/src/app/core/utils/passwords-utility.ts +++ b/src/app/core/utils/passwords-utility.ts @@ -2,36 +2,38 @@ import { Injectable } from '@angular/core'; import { AbstractControl, ValidationErrors, ValidatorFn, Validators } from '@angular/forms'; import { Subscription } from 'rxjs'; - @Injectable({ - providedIn: 'root' + providedIn: 'root' }) - export class PasswordsUtility { - // password regex pattern - public static PASSWORD_REGEX = '^(?!.*(.)\\1)(?!.*\\s)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^\\w\\s]).{12,50}$'; + // password regex pattern + public static PASSWORD_REGEX = '^(?!.*(.)\\1)(?!.*\\s)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^\\w\\s]).{12,50}$'; - public getPasswordValidators(): ValidatorFn[] { - return [Validators.required, Validators.pattern(PasswordsUtility.PASSWORD_REGEX), Validators.maxLength(50), Validators.minLength(8)]; - } + public getPasswordValidators(): ValidatorFn[] { + return [ + Validators.required, + Validators.pattern(PasswordsUtility.PASSWORD_REGEX), + Validators.maxLength(50), + Validators.minLength(8)]; + } - /** - * Confirm Change Password of Users - * @param controlNameToCompare Form Control Name to be compared. - */ - public confirmPassword(controlNameToCompare: string): ValidatorFn { - return (c: AbstractControl): ValidationErrors|null => { - if (c.value == null || c.value.length === 0) { - return null; - } - const controlToCompare = c.root.get(controlNameToCompare); - if (controlToCompare) { - const subscription: Subscription = controlToCompare.valueChanges.subscribe(() => { - c.updateValueAndValidity(); - subscription.unsubscribe(); - }); - } - return controlToCompare && controlToCompare.value !== c.value ? {'notequal': true} : null; - }; - } + /** + * Confirm Change Password of Users + * @param controlNameToCompare Form Control Name to be compared. + */ + public confirmPassword(controlNameToCompare: string): ValidatorFn { + return (c: AbstractControl): ValidationErrors | null => { + if (c.value == null || c.value.length === 0) { + return null; + } + const controlToCompare = c.root.get(controlNameToCompare); + if (controlToCompare) { + const subscription: Subscription = controlToCompare.valueChanges.subscribe(() => { + c.updateValueAndValidity(); + subscription.unsubscribe(); + }); + } + return controlToCompare && controlToCompare.value !== c.value ? { notequal: true } : null; + }; + } } diff --git a/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-actions.resolver.ts b/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-actions.resolver.ts index 71e537970..1a69b8c84 100644 --- a/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-actions.resolver.ts +++ b/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-actions.resolver.ts @@ -14,13 +14,14 @@ import { FixedDepositsService } from '../fixed-deposits.service'; */ @Injectable() export class FixedDepositsAccountActionsResolver implements Resolve { - /** * @param {SavingsService} SavingsService Savings service. * @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service. */ - constructor(private savingsService: SavingsService, - private fixedDepositsService: FixedDepositsService) { } + constructor( + private savingsService: SavingsService, + private fixedDepositsService: FixedDepositsService + ) {} /** * Returns the Fixed deposits account actions data. @@ -29,7 +30,8 @@ export class FixedDepositsAccountActionsResolver implements Resolve { */ resolve(route: ActivatedRouteSnapshot): Observable { const actionName = route.paramMap.get('name'); - const fixedDepositAccountId = route.paramMap.get('fixedDepositAccountId') || route.parent.parent.paramMap.get('fixedDepositAccountId'); + const fixedDepositAccountId = + route.paramMap.get('fixedDepositAccountId') || route.parent.parent.paramMap.get('fixedDepositAccountId'); switch (actionName) { case 'Add Charge': return this.savingsService.getSavingsChargeTemplateResource(fixedDepositAccountId); @@ -41,5 +43,4 @@ export class FixedDepositsAccountActionsResolver implements Resolve { return undefined; } } - } diff --git a/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-and-template.resolver.ts b/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-and-template.resolver.ts index c39803d4d..0e8c6d03b 100644 --- a/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-and-template.resolver.ts +++ b/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-and-template.resolver.ts @@ -13,11 +13,10 @@ import { FixedDepositsService } from '../fixed-deposits.service'; */ @Injectable() export class FixedDepositsAccountAndTemplateResolver implements Resolve { - /** * @param {FixedDepositsService} fixedDepositsService Fixed Deposits service. */ - constructor(private fixedDepositsService: FixedDepositsService) { } + constructor(private fixedDepositsService: FixedDepositsService) {} /** * Returns the Fixed Deposits Account Template. @@ -28,5 +27,4 @@ export class FixedDepositsAccountAndTemplateResolver implements Resolve const fixedDepositAccountId = route.paramMap.get('fixedDepositAccountId'); return this.fixedDepositsService.getFixedDepositsAccountAndTemplate(fixedDepositAccountId); } - } diff --git a/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-template.resolver.ts b/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-template.resolver.ts index 3bde4df0a..0ed98c165 100644 --- a/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-template.resolver.ts +++ b/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-template.resolver.ts @@ -13,11 +13,10 @@ import { FixedDepositsService } from '../fixed-deposits.service'; */ @Injectable() export class FixedDepositsAccountTemplateResolver implements Resolve { - /** * @param {FixedDepositsService} fixedDepositsService Fixed Deposits service. */ - constructor(private fixedDepositsService: FixedDepositsService) { } + constructor(private fixedDepositsService: FixedDepositsService) {} /** * Returns the Fixed Deposits Account Template. @@ -28,5 +27,4 @@ export class FixedDepositsAccountTemplateResolver implements Resolve { const clientId = route.parent.parent.paramMap.get('clientId'); return this.fixedDepositsService.getFixedDepositsAccountTemplate(clientId); } - } diff --git a/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-transaction.resolver.ts b/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-transaction.resolver.ts index 7ad489b1c..e2e9bf399 100644 --- a/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-transaction.resolver.ts +++ b/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-transaction.resolver.ts @@ -13,11 +13,10 @@ import { FixedDepositsService } from '../fixed-deposits.service'; */ @Injectable() export class FixedDepositsAccountTransactionResolver implements Resolve { - /** * @param {FixedDepositsService} fixedDepositsService Savings service. */ - constructor(private fixedDepositsService: FixedDepositsService) { } + constructor(private fixedDepositsService: FixedDepositsService) {} /** * Returns the Fixed Deposits Account Transaction data. @@ -29,5 +28,4 @@ export class FixedDepositsAccountTransactionResolver implements Resolve const transactionId = route.paramMap.get('id'); return this.fixedDepositsService.getFixedDepositsAccountTransaction(fixedDepositAccountId, transactionId); } - } diff --git a/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-view.resolver.ts b/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-view.resolver.ts index 09f5d82c8..239abeefe 100644 --- a/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-view.resolver.ts +++ b/src/app/deposits/fixed-deposits/common-resolvers/fixed-deposit-account-view.resolver.ts @@ -13,11 +13,10 @@ import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits */ @Injectable() export class FixedDepositsAccountViewResolver implements Resolve { - /** * @param {FixedDepositsService} fixedDepositsService Fixed Deposits service. */ - constructor(private fixedDepositsService: FixedDepositsService) { } + constructor(private fixedDepositsService: FixedDepositsService) {} /** * Returns the Fixed Deposits Account data. @@ -28,5 +27,4 @@ export class FixedDepositsAccountViewResolver implements Resolve { const fixedDepositAccountId = route.paramMap.get('fixedDepositAccountId'); return this.fixedDepositsService.getFixedDepositsAccountData(fixedDepositAccountId); } - } diff --git a/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.spec.ts b/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.spec.ts index 9be45a29e..6e6bc58fb 100644 --- a/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.spec.ts +++ b/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateFixedDepositAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateFixedDepositAccountComponent ] - }) - .compileComponents(); + declarations: [CreateFixedDepositAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.ts b/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.ts index 2173a92ea..542bb05ae 100644 --- a/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.ts +++ b/src/app/deposits/fixed-deposits/create-fixed-deposit-account/create-fixed-deposit-account.component.ts @@ -22,15 +22,18 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-fixed-deposit-account.component.scss'] }) export class CreateFixedDepositAccountComponent { - /** Fixed Deposits Account Details Step */ - @ViewChild(FixedDepositAccountDetailsStepComponent, { static: true }) fixedDepositsAccountDetailsStep: FixedDepositAccountDetailsStepComponent; + @ViewChild(FixedDepositAccountDetailsStepComponent, { static: true }) + fixedDepositsAccountDetailsStep: FixedDepositAccountDetailsStepComponent; /** Fixed Deposits Account Terms Step */ - @ViewChild(FixedDepositAccountTermsStepComponent, { static: true }) fixedDepositAccountTermsStep: FixedDepositAccountTermsStepComponent; + @ViewChild(FixedDepositAccountTermsStepComponent, { static: true }) + fixedDepositAccountTermsStep: FixedDepositAccountTermsStepComponent; /** Fixed Deposits Account Settings Step */ - @ViewChild(FixedDepositAccountSettingsStepComponent, { static: true }) fixedDepositAccountSettingsStep: FixedDepositAccountSettingsStepComponent; + @ViewChild(FixedDepositAccountSettingsStepComponent, { static: true }) + fixedDepositAccountSettingsStep: FixedDepositAccountSettingsStepComponent; /** Fixed Deposits Account Charges Step */ - @ViewChild(FixedDepositAccountChargesStepComponent, { static: true }) fixedDepositAccountChargesStep: FixedDepositAccountChargesStepComponent; + @ViewChild(FixedDepositAccountChargesStepComponent, { static: true }) + fixedDepositAccountChargesStep: FixedDepositAccountChargesStepComponent; /** Fixed Deposits Account Template */ fixedDepositsAccountTemplate: any; @@ -45,11 +48,13 @@ export class CreateFixedDepositAccountComponent { * @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service * @param {SettingsService} settingsService Settings Service */ - constructor(private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private fixedDepositsService: FixedDepositsService, - private settingsService: SettingsService) { + constructor( + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private fixedDepositsService: FixedDepositsService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { fixedDepositsAccountTemplate: any }) => { this.fixedDepositsAccountTemplate = data.fixedDepositsAccountTemplate; }); @@ -103,7 +108,7 @@ export class CreateFixedDepositAccountComponent { ...this.fixedDepositsAccountDetailsStep.fixedDepositAccountDetails, ...this.fixedDepositAccountTermsStep.fixedDepositAccountTerms, ...this.fixedDepositAccountSettingsStep.fixedDepositAccountSettings, - ...this.fixedDepositAccountChargesStep.fixedDepositAccountCharges, + ...this.fixedDepositAccountChargesStep.fixedDepositAccountCharges }; } @@ -121,18 +126,24 @@ export class CreateFixedDepositAccountComponent { chargeId: charge.id, amount: charge.amount, dueDate: charge.dueDate && this.dateUtils.formatDate(charge.dueDate, dateFormat), - feeOnMonthDay: charge.feeOnMonthDay && this.dateUtils.formatDate([2000].concat(charge.feeOnMonthDay), monthDayFormat), + feeOnMonthDay: + charge.feeOnMonthDay && this.dateUtils.formatDate([2000].concat(charge.feeOnMonthDay), monthDayFormat), feeInterval: charge.feeInterval })), submittedOnDate: this.dateUtils.formatDate(this.fixedDepositAccount.submittedOnDate, dateFormat), - charts: [{chartSlabs: this.fixedDepositsAccountProductTemplate.accountChart.chartSlabs}], + charts: [{ chartSlabs: this.fixedDepositsAccountProductTemplate.accountChart.chartSlabs }], dateFormat, monthDayFormat, locale }; this.fixedDepositsService.createFixedDepositAccount(fixedDepositAccount).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/deposits/fixed-deposits/edit-fixed-deposit-account/edit-fixed-deposit-account.component.spec.ts b/src/app/deposits/fixed-deposits/edit-fixed-deposit-account/edit-fixed-deposit-account.component.spec.ts index 187d9f19a..f8e70d953 100644 --- a/src/app/deposits/fixed-deposits/edit-fixed-deposit-account/edit-fixed-deposit-account.component.spec.ts +++ b/src/app/deposits/fixed-deposits/edit-fixed-deposit-account/edit-fixed-deposit-account.component.spec.ts @@ -8,9 +8,8 @@ describe('EditFixedDepositAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditFixedDepositAccountComponent ] - }) - .compileComponents(); + declarations: [EditFixedDepositAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/edit-fixed-deposit-account/edit-fixed-deposit-account.component.ts b/src/app/deposits/fixed-deposits/edit-fixed-deposit-account/edit-fixed-deposit-account.component.ts index bb120a57e..522d08a1d 100644 --- a/src/app/deposits/fixed-deposits/edit-fixed-deposit-account/edit-fixed-deposit-account.component.ts +++ b/src/app/deposits/fixed-deposits/edit-fixed-deposit-account/edit-fixed-deposit-account.component.ts @@ -23,15 +23,18 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./edit-fixed-deposit-account.component.scss'] }) export class EditFixedDepositAccountComponent { - /** Fixed Deposits Account Details Step */ - @ViewChild(FixedDepositAccountDetailsStepComponent, { static: true }) fixedDepositsAccountDetailsStep: FixedDepositAccountDetailsStepComponent; + @ViewChild(FixedDepositAccountDetailsStepComponent, { static: true }) + fixedDepositsAccountDetailsStep: FixedDepositAccountDetailsStepComponent; /** Fixed Deposits Account Terms Step */ - @ViewChild(FixedDepositAccountTermsStepComponent, { static: true }) fixedDepositAccountTermsStep: FixedDepositAccountTermsStepComponent; + @ViewChild(FixedDepositAccountTermsStepComponent, { static: true }) + fixedDepositAccountTermsStep: FixedDepositAccountTermsStepComponent; /** Fixed Deposits Account Settings Step */ - @ViewChild(FixedDepositAccountSettingsStepComponent, { static: true }) fixedDepositAccountSettingsStep: FixedDepositAccountSettingsStepComponent; + @ViewChild(FixedDepositAccountSettingsStepComponent, { static: true }) + fixedDepositAccountSettingsStep: FixedDepositAccountSettingsStepComponent; /** Fixed Deposits Account Charges Step */ - @ViewChild(FixedDepositAccountChargesStepComponent, { static: true }) fixedDepositAccountChargesStep: FixedDepositAccountChargesStepComponent; + @ViewChild(FixedDepositAccountChargesStepComponent, { static: true }) + fixedDepositAccountChargesStep: FixedDepositAccountChargesStepComponent; /** Fixed Deposits Account Template */ fixedDepositsAccountAndTemplate: any; @@ -48,11 +51,13 @@ export class EditFixedDepositAccountComponent { * @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service * @param {SettingsService} settingsService Settings Service */ - constructor(private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private fixedDepositsService: FixedDepositsService, - private settingsService: SettingsService) { + constructor( + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private fixedDepositsService: FixedDepositsService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { fixedDepositsAccountAndTemplate: any }) => { this.fixedDepositsAccountAndTemplate = data.fixedDepositsAccountAndTemplate; }); @@ -96,12 +101,10 @@ export class EditFixedDepositAccountComponent { this.fixedDepositAccountDetailsForm.valid && this.fixedDepositAccountTermsForm.valid && this.fixedDepositAccountSettingsForm.valid && - ( - !this.fixedDepositAccountDetailsForm.pristine || + (!this.fixedDepositAccountDetailsForm.pristine || !this.fixedDepositAccountTermsForm.pristine || !this.fixedDepositAccountSettingsForm.pristine || - !this.fixedDepositAccountChargesStep.pristine - ) + !this.fixedDepositAccountChargesStep.pristine) ); } @@ -131,18 +134,20 @@ export class EditFixedDepositAccountComponent { chargeId: charge.id, amount: charge.amount, dueDate: charge.dueDate && this.dateUtils.formatDate(charge.dueDate, dateFormat), - feeOnMonthDay: charge.feeOnMonthDay && this.dateUtils.formatDate([2000].concat(charge.feeOnMonthDay), monthDayFormat), + feeOnMonthDay: + charge.feeOnMonthDay && this.dateUtils.formatDate([2000].concat(charge.feeOnMonthDay), monthDayFormat), feeInterval: charge.feeInterval })), submittedOnDate: this.dateUtils.formatDate(this.fixedDepositAccount.submittedOnDate, dateFormat), - charts: [{chartSlabs: this.fixedDepositsAccountProductTemplate.accountChart.chartSlabs}], + charts: [{ chartSlabs: this.fixedDepositsAccountProductTemplate.accountChart.chartSlabs }], dateFormat, monthDayFormat, locale }; - this.fixedDepositsService.updateFixedDepositAccount(this.fixedDepositsAccountAndTemplate.id, fixedDepositAccount).subscribe((response: any) => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.fixedDepositsService + .updateFixedDepositAccount(this.fixedDepositsAccountAndTemplate.id, fixedDepositAccount) + .subscribe((response: any) => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-charges-step/fixed-deposit-account-charges-step.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-charges-step/fixed-deposit-account-charges-step.component.spec.ts index c62e3f599..7725e399b 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-charges-step/fixed-deposit-account-charges-step.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-charges-step/fixed-deposit-account-charges-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositAccountChargesStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositAccountChargesStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositAccountChargesStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-charges-step/fixed-deposit-account-charges-step.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-charges-step/fixed-deposit-account-charges-step.component.ts index 4f3e8ee72..92662e6f0 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-charges-step/fixed-deposit-account-charges-step.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-charges-step/fixed-deposit-account-charges-step.component.ts @@ -23,7 +23,6 @@ import { Charge, Currency } from 'app/shared/models/general.model'; styleUrls: ['./fixed-deposit-account-charges-step.component.scss'] }) export class FixedDepositAccountChargesStepComponent implements OnInit, OnChanges { - /** Fixed deposits account template */ @Input() fixedDepositsAccountTemplate: any; /** Fixed deposits account and product template */ @@ -38,7 +37,15 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange /** Charges Data Source */ chargesDataSource: {}[] = []; /** Charges table columns */ - displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'repaymentsEvery', 'action']; + displayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'date', + 'repaymentsEvery', + 'action' + ]; /** For Edit Fixed Deposits Account Form */ isChargesPatched = false; /** Component is pristine if there has been no changes by user interaction */ @@ -49,14 +56,17 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange * @param {Dates} dateUtils Date Utils * @param {SettingsService} settingsService Settings Service */ - constructor(public dialog: MatDialog, - private dateUtils: Dates, - private settingsService: SettingsService) { } + constructor( + public dialog: MatDialog, + private dateUtils: Dates, + private settingsService: SettingsService + ) {} ngOnInit() { this.chargesDataSource = []; if (this.fixedDepositsAccountTemplate.id && this.fixedDepositsAccountTemplate.charges) { - this.chargesDataSource = this.fixedDepositsAccountTemplate.charges.map((charge: any) => ({...charge, id: charge.chargeId})) || []; + this.chargesDataSource = + this.fixedDepositsAccountTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || []; } } @@ -69,8 +79,9 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange } } if (this.fixedDepositsAccountProductTemplate) { - this.chargeData = this.fixedDepositsAccountProductTemplate.chargeOptions - .filter((c: Charge) => c.currency.code === this.currency.code); + this.chargeData = this.fixedDepositsAccountProductTemplate.chargeOptions.filter( + (c: Charge) => c.currency.code === this.currency.code + ); } } @@ -95,7 +106,8 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange value: charge.amount, type: 'number', required: false - }), + }) + ]; const data = { title: 'Edit Charge Amount', @@ -125,7 +137,8 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange value: charge.dueDate || charge.feeOnMonthDay || '', type: 'datetime-local', required: false - }), + }) + ]; const data = { title: 'Edit Charge Date', @@ -166,7 +179,8 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange value: charge.feeInterval, type: 'text', required: false - }), + }) + ]; const data = { title: 'Edit Charge Fee Interval', @@ -200,5 +214,4 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange get fixedDepositAccountCharges() { return { charges: this.chargesDataSource }; } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.spec.ts index 169dda7ba..c8df5fb0b 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositAccountDetailsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositAccountDetailsStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositAccountDetailsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.ts index 99f48361f..21b4b9534 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.ts @@ -15,7 +15,6 @@ import { FixedDepositsService } from '../../fixed-deposits.service'; styleUrls: ['./fixed-deposit-account-details-step.component.scss'] }) export class FixedDepositAccountDetailsStepComponent implements OnInit { - /** Fixed Deposits Account Template */ @Input() fixedDepositsAccountTemplate: any; @@ -43,9 +42,11 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit { * @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private fixedDepositsService: FixedDepositsService, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private fixedDepositsService: FixedDepositsService, + private settingsService: SettingsService + ) { this.createFixedDepositsAccountDetailsForm(); } @@ -56,10 +57,11 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit { this.productData = this.fixedDepositsAccountTemplate.productOptions; if (this.fixedDepositsAccountTemplate.depositProductId) { this.fixedDepositAccountDetailsForm.patchValue({ - 'productId': this.fixedDepositsAccountTemplate.depositProductId, - 'submittedOnDate': this.fixedDepositsAccountTemplate.timeline.submittedOnDate - && new Date(this.fixedDepositsAccountTemplate.timeline.submittedOnDate), - 'externalId': this.fixedDepositsAccountTemplate.externalId || '', + productId: this.fixedDepositsAccountTemplate.depositProductId, + submittedOnDate: + this.fixedDepositsAccountTemplate.timeline.submittedOnDate && + new Date(this.fixedDepositsAccountTemplate.timeline.submittedOnDate), + externalId: this.fixedDepositsAccountTemplate.externalId || '' }); } } @@ -70,10 +72,16 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit { */ createFixedDepositsAccountDetailsForm() { this.fixedDepositAccountDetailsForm = this.formBuilder.group({ - 'productId': ['', Validators.required], - 'submittedOnDate': ['', Validators.required], - 'fieldOfficerId': [''], - 'externalId': [''] + productId: [ + '', + Validators.required + ], + submittedOnDate: [ + '', + Validators.required + ], + fieldOfficerId: [''], + externalId: [''] }); } @@ -88,7 +96,9 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit { this.isProductSelected = true; this.fieldOfficerData = response.fieldOfficerOptions; if (!this.isFieldOfficerPatched && this.fixedDepositsAccountTemplate.fieldOfficerId) { - this.fixedDepositAccountDetailsForm.get('fieldOfficerId').patchValue(this.fixedDepositsAccountTemplate.fieldOfficerId); + this.fixedDepositAccountDetailsForm + .get('fieldOfficerId') + .patchValue(this.fixedDepositsAccountTemplate.fieldOfficerId); this.isFieldOfficerPatched = true; } else { this.fixedDepositAccountDetailsForm.get('fieldOfficerId').patchValue(''); @@ -109,5 +119,4 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit { } return fixedDepositAccountDetails; } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component.spec.ts index 66e46ce3f..68b6dd01c 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositAccountInterestRateChartStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositAccountInterestRateChartStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositAccountInterestRateChartStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component.ts index 4fdcfa615..524f016f9 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-interest-rate-chart-step/fixed-deposit-account-interest-rate-chart-step.component.ts @@ -14,12 +14,11 @@ import { animate, state, style, transition, trigger } from '@angular/animations' trigger('expandChartSlab', [ state('collapsed', style({ height: '0px', minHeight: '0' })), state('expanded', style({ height: '*' })), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')) - ]) + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + ] }) export class FixedDepositAccountInterestRateChartStepComponent implements OnChanges { - /** Fixed deposits account template */ @Input() fixedDepositsAccountTemplate: any; /** Fixed deposits account and product template */ @@ -28,9 +27,22 @@ export class FixedDepositAccountInterestRateChartStepComponent implements OnChan /** Interest Rate Chart Data */ interestRateChartData: any = []; /** Columns to be displayed in interest rate chart table. */ - chartSlabsDisplayedColumns: any[] = ['period', 'amountRange', 'interest', 'description', 'actions']; + chartSlabsDisplayedColumns: any[] = [ + 'period', + 'amountRange', + 'interest', + 'description', + 'actions' + ]; /** Columns to be displayed in incentives sub-table. */ - incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount']; + incentivesDisplayedColumns: string[] = [ + 'entityType', + 'attributeName', + 'conditionType', + 'attributeValue', + 'incentiveType', + 'amount' + ]; /** Additional Column to disblac incentives table */ chartSlabsIncentivesDisplayedColumns: string[] = ['incentives']; /** Expand Chart Slab Index used in the view */ @@ -39,7 +51,7 @@ export class FixedDepositAccountInterestRateChartStepComponent implements OnChan /** Interest Rate charts table reference */ @ViewChild('chartsTable', { static: true }) chartsTableRef: MatTable; - constructor() { } + constructor() {} ngOnChanges() { if (this.fixedDepositsAccountProductTemplate) { @@ -47,5 +59,4 @@ export class FixedDepositAccountInterestRateChartStepComponent implements OnChan this.chartsTableRef.renderRows(); } } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-preview-step/fixed-deposit-account-preview-step.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-preview-step/fixed-deposit-account-preview-step.component.spec.ts index 183debb51..5bd79946a 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-preview-step/fixed-deposit-account-preview-step.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-preview-step/fixed-deposit-account-preview-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositAccountPreviewStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositAccountPreviewStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositAccountPreviewStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-preview-step/fixed-deposit-account-preview-step.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-preview-step/fixed-deposit-account-preview-step.component.ts index ba4f4a54e..bc679ecd4 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-preview-step/fixed-deposit-account-preview-step.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-preview-step/fixed-deposit-account-preview-step.component.ts @@ -13,12 +13,11 @@ import { animate, state, style, transition, trigger } from '@angular/animations' trigger('expandChartSlab', [ state('collapsed', style({ height: '0px', minHeight: '0' })), state('expanded', style({ height: '*' })), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')) - ]) + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + ] }) export class FixedDepositAccountPreviewStepComponent implements OnChanges { - /** Fixed Deposits Account Template */ @Input() fixedDepositsAccountTemplate: any; /** Fixed Deposits Account Product Template */ @@ -27,13 +26,33 @@ export class FixedDepositAccountPreviewStepComponent implements OnChanges { @Input() fixedDepositAccountData: any; /** Charges Displayed Columns */ - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'repaymentsEvery']; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'date', + 'repaymentsEvery' + ]; /** Interest Rate Chart Data */ interestRateChartData: any = []; /** Columns to be displayed in interest rate chart table. */ - chartSlabsDisplayedColumns: any[] = ['period', 'amountRange', 'interest', 'description', 'actions']; + chartSlabsDisplayedColumns: any[] = [ + 'period', + 'amountRange', + 'interest', + 'description', + 'actions' + ]; /** Columns to be displayed in incentives sub-table. */ - incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount']; + incentivesDisplayedColumns: string[] = [ + 'entityType', + 'attributeName', + 'conditionType', + 'attributeValue', + 'incentiveType', + 'amount' + ]; /** Additional Column to disblac incentives table */ chartSlabsIncentivesDisplayedColumns: string[] = ['incentives']; /** Expand Chart Slab Index used in the view */ @@ -42,12 +61,11 @@ export class FixedDepositAccountPreviewStepComponent implements OnChanges { /** Form submission event */ @Output() submitEvent = new EventEmitter(); - constructor() { } + constructor() {} ngOnChanges() { if (this.fixedDepositsAccountProductTemplate) { this.interestRateChartData = this.fixedDepositsAccountProductTemplate.accountChart.chartSlabs; } } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component.spec.ts index 2d928b0bf..15e0fdad3 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositAccountSettingsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositAccountSettingsStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositAccountSettingsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component.ts index 7f68b0407..a24e638ca 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component.ts @@ -13,7 +13,6 @@ import { OptionData } from 'app/shared/models/option-data.model'; styleUrls: ['./fixed-deposit-account-settings-step.component.scss'] }) export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChanges { - /** Fixed deposits account template */ @Input() fixedDepositsAccountTemplate: any; /** Fixed deposits account and product template */ @@ -40,8 +39,10 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang * @param {FormBuilder} formBuilder Form Builder * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private settingsService: SettingsService + ) { this.createFixedDepositAccountSettingsForm(); this.buildDependencies(); } @@ -49,28 +50,46 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang ngOnChanges() { if (this.fixedDepositsAccountProductTemplate) { this.fixedDepositAccountSettingsForm.patchValue({ - 'minDepositTerm': this.fixedDepositsAccountProductTemplate.minDepositTerm, - 'minDepositTermTypeId': this.fixedDepositsAccountProductTemplate.minDepositTermType ? this.fixedDepositsAccountProductTemplate.minDepositTermType.id : '', - 'inMultiplesOfDepositTerm': this.fixedDepositsAccountProductTemplate.inMultiplesOfDepositTerm, - 'inMultiplesOfDepositTermTypeId': this.fixedDepositsAccountProductTemplate.inMultiplesOfDepositTermType ? this.fixedDepositsAccountProductTemplate.inMultiplesOfDepositTermType.id : '', - 'maxDepositTerm': this.fixedDepositsAccountProductTemplate.maxDepositTerm, - 'maxDepositTermTypeId': this.fixedDepositsAccountProductTemplate.maxDepositTermType ? this.fixedDepositsAccountProductTemplate.maxDepositTermType.id : '', - 'preClosurePenalApplicable': this.fixedDepositsAccountProductTemplate.preClosurePenalApplicable, - 'preClosurePenalInterest': this.fixedDepositsAccountProductTemplate.preClosurePenalInterest, - 'preClosurePenalInterestOnTypeId': this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnType ? this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnType.id : '', - 'maturityInstructionId': this.fixedDepositsAccountProductTemplate.maturityInstructionId + minDepositTerm: this.fixedDepositsAccountProductTemplate.minDepositTerm, + minDepositTermTypeId: this.fixedDepositsAccountProductTemplate.minDepositTermType + ? this.fixedDepositsAccountProductTemplate.minDepositTermType.id + : '', + inMultiplesOfDepositTerm: this.fixedDepositsAccountProductTemplate.inMultiplesOfDepositTerm, + inMultiplesOfDepositTermTypeId: this.fixedDepositsAccountProductTemplate.inMultiplesOfDepositTermType + ? this.fixedDepositsAccountProductTemplate.inMultiplesOfDepositTermType.id + : '', + maxDepositTerm: this.fixedDepositsAccountProductTemplate.maxDepositTerm, + maxDepositTermTypeId: this.fixedDepositsAccountProductTemplate.maxDepositTermType + ? this.fixedDepositsAccountProductTemplate.maxDepositTermType.id + : '', + preClosurePenalApplicable: this.fixedDepositsAccountProductTemplate.preClosurePenalApplicable, + preClosurePenalInterest: this.fixedDepositsAccountProductTemplate.preClosurePenalInterest, + preClosurePenalInterestOnTypeId: this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnType + ? this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnType.id + : '', + maturityInstructionId: this.fixedDepositsAccountProductTemplate.maturityInstructionId }); if (this.fixedDepositsAccountProductTemplate.withHoldTax) { this.fixedDepositAccountSettingsForm.addControl('withHoldTax', new UntypedFormControl(false)); this.fixedDepositAccountSettingsForm.get('withHoldTax').valueChanges.subscribe((value: boolean) => { if (value) { - this.fixedDepositAccountSettingsForm.addControl('taxGroupId', new UntypedFormControl({ value: '', disabled: true })); - this.fixedDepositAccountSettingsForm.get('taxGroupId').patchValue(this.fixedDepositsAccountProductTemplate.taxGroup && this.fixedDepositsAccountProductTemplate.taxGroup.name); + this.fixedDepositAccountSettingsForm.addControl( + 'taxGroupId', + new UntypedFormControl({ value: '', disabled: true }) + ); + this.fixedDepositAccountSettingsForm + .get('taxGroupId') + .patchValue( + this.fixedDepositsAccountProductTemplate.taxGroup && + this.fixedDepositsAccountProductTemplate.taxGroup.name + ); } else { this.fixedDepositAccountSettingsForm.removeControl('taxGroupId'); } }); - this.fixedDepositAccountSettingsForm.get('withHoldTax').patchValue(this.fixedDepositsAccountTemplate.withHoldTax); + this.fixedDepositAccountSettingsForm + .get('withHoldTax') + .patchValue(this.fixedDepositsAccountTemplate.withHoldTax); } else { this.fixedDepositAccountSettingsForm.removeControl('withHoldTax'); } @@ -82,9 +101,11 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang this.maxDate = this.settingsService.businessDate; if (this.fixedDepositsAccountTemplate) { this.fixedDepositAccountSettingsForm.patchValue({ - 'lockinPeriodFrequency': this.fixedDepositsAccountTemplate.lockinPeriodFrequency, - 'lockinPeriodFrequencyType': this.fixedDepositsAccountTemplate.lockinPeriodFrequencyType && this.fixedDepositsAccountTemplate.lockinPeriodFrequencyType.id, - 'transferInterestToSavings': this.fixedDepositsAccountTemplate.transferInterestToSavings + lockinPeriodFrequency: this.fixedDepositsAccountTemplate.lockinPeriodFrequency, + lockinPeriodFrequencyType: + this.fixedDepositsAccountTemplate.lockinPeriodFrequencyType && + this.fixedDepositsAccountTemplate.lockinPeriodFrequencyType.id, + transferInterestToSavings: this.fixedDepositsAccountTemplate.transferInterestToSavings }); } } @@ -94,19 +115,19 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang */ createFixedDepositAccountSettingsForm() { this.fixedDepositAccountSettingsForm = this.formBuilder.group({ - 'lockinPeriodFrequency': [''], - 'lockinPeriodFrequencyType': [''], - 'minDepositTerm': [{value: '', disabled: true}], - 'minDepositTermTypeId': [{ value: '', disabled: true }], - 'inMultiplesOfDepositTerm': [{ value: '', disabled: true }], - 'inMultiplesOfDepositTermTypeId': [{ value: '', disabled: true }], - 'maxDepositTerm': [{ value: '', disabled: true }], - 'maxDepositTermTypeId': [{ value: '', disabled: true }], - 'transferInterestToSavings': [false], - 'preClosurePenalApplicable': [{ value: '', disabled: true }], - 'preClosurePenalInterest': [{ value: '', disabled: true }], - 'preClosurePenalInterestOnTypeId': [{ value: '', disabled: true }], - 'maturityInstructionId': [''] + lockinPeriodFrequency: [''], + lockinPeriodFrequencyType: [''], + minDepositTerm: [{ value: '', disabled: true }], + minDepositTermTypeId: [{ value: '', disabled: true }], + inMultiplesOfDepositTerm: [{ value: '', disabled: true }], + inMultiplesOfDepositTermTypeId: [{ value: '', disabled: true }], + maxDepositTerm: [{ value: '', disabled: true }], + maxDepositTermTypeId: [{ value: '', disabled: true }], + transferInterestToSavings: [false], + preClosurePenalApplicable: [{ value: '', disabled: true }], + preClosurePenalInterest: [{ value: '', disabled: true }], + preClosurePenalInterestOnTypeId: [{ value: '', disabled: true }], + maturityInstructionId: [''] }); } @@ -116,16 +137,31 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang buildDependencies() { this.fixedDepositAccountSettingsForm.get('transferInterestToSavings').valueChanges.subscribe((value: boolean) => { if (value) { - this.fixedDepositAccountSettingsForm.addControl('linkAccountId', new UntypedFormControl('', Validators.required)); - this.fixedDepositAccountSettingsForm.get('linkAccountId').patchValue(this.fixedDepositsAccountTemplate.linkedAccount && this.fixedDepositsAccountTemplate.linkedAccount.id); + this.fixedDepositAccountSettingsForm.addControl( + 'linkAccountId', + new UntypedFormControl('', Validators.required) + ); + this.fixedDepositAccountSettingsForm + .get('linkAccountId') + .patchValue( + this.fixedDepositsAccountTemplate.linkedAccount && this.fixedDepositsAccountTemplate.linkedAccount.id + ); } else { this.fixedDepositAccountSettingsForm.removeControl('linkAccountId'); } }); this.fixedDepositAccountSettingsForm.get('maturityInstructionId').valueChanges.subscribe((value: number) => { if (value > 100) { - this.fixedDepositAccountSettingsForm.addControl('transferToSavingsId', new UntypedFormControl('', Validators.required)); - this.fixedDepositAccountSettingsForm.get('transferToSavingsId').patchValue(this.fixedDepositsAccountTemplate.transferToSavingsId && this.fixedDepositsAccountTemplate.transferToSavingsId.id); + this.fixedDepositAccountSettingsForm.addControl( + 'transferToSavingsId', + new UntypedFormControl('', Validators.required) + ); + this.fixedDepositAccountSettingsForm + .get('transferToSavingsId') + .patchValue( + this.fixedDepositsAccountTemplate.transferToSavingsId && + this.fixedDepositsAccountTemplate.transferToSavingsId.id + ); } else { this.fixedDepositAccountSettingsForm.removeControl('transferToSavingsId'); } @@ -139,7 +175,8 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang this.lockinPeriodFrequencyTypeData = this.fixedDepositsAccountProductTemplate.lockinPeriodFrequencyTypeOptions; this.periodFrequencyTypeData = this.fixedDepositsAccountProductTemplate.periodFrequencyTypeOptions; this.savingsAccountsData = this.fixedDepositsAccountProductTemplate.savingsAccounts; - this.preClosurePenalInterestOnTypeData = this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnTypeOptions; + this.preClosurePenalInterestOnTypeData = + this.fixedDepositsAccountProductTemplate.preClosurePenalInterestOnTypeOptions; this.maturityInstructionOptions = this.fixedDepositsAccountProductTemplate.maturityInstructionOptions; } @@ -155,5 +192,4 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang } return fixedDepositAccountSettings; } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component.spec.ts index 6f795f584..8700204aa 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositAccountTermsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositAccountTermsStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositAccountTermsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component.ts index 0bbb2e2b7..3c1e9a73c 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component.ts @@ -1,6 +1,6 @@ /** Angular Imports */ import { Component, OnInit, Input, OnChanges } from '@angular/core'; -import { UntypedFormGroup, UntypedFormBuilder, Validators} from '@angular/forms'; +import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms'; import { SettingsService } from 'app/settings/settings.service'; import { Currency } from 'app/shared/models/general.model'; @@ -13,7 +13,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./fixed-deposit-account-terms-step.component.scss'] }) export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges { - /** Fixed deposits account template */ @Input() fixedDepositsAccountTemplate: any; /** Fixed deposits account and product template */ @@ -33,7 +32,7 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges interestCalculationTypeData: any; /** Interest Calculation Days in Year Data */ interestCalculationDaysInYearTypeData: any; - /** Period Frequency Type Data */ + /** Period Frequency Type Data */ periodFrequencyTypeData: any; currency: Currency | null = null; @@ -41,8 +40,10 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges * @param {FormBuilder} formBuilder Form Builder * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private settingsService: SettingsService + ) { this.createFixedDepositsAccountTermsForm(); } @@ -57,13 +58,15 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges this.maxDate = this.settingsService.businessDate; if (this.fixedDepositsAccountTemplate.id) { this.fixedDepositAccountTermsForm.patchValue({ - 'interestCompoundingPeriodType': this.fixedDepositsAccountTemplate.interestCompoundingPeriodType.id, - 'interestPostingPeriodType': this.fixedDepositsAccountTemplate.interestPostingPeriodType.id, - 'interestCalculationType': this.fixedDepositsAccountTemplate.interestCalculationType.id, - 'interestCalculationDaysInYearType': this.fixedDepositsAccountTemplate.interestCalculationDaysInYearType.id, - 'depositAmount': this.fixedDepositsAccountTemplate.depositAmount ? this.fixedDepositsAccountTemplate.depositAmount : 0, - 'depositPeriod': this.fixedDepositsAccountTemplate.depositPeriod, - 'depositPeriodFrequencyId': this.fixedDepositsAccountTemplate.depositPeriodFrequency.id, + interestCompoundingPeriodType: this.fixedDepositsAccountTemplate.interestCompoundingPeriodType.id, + interestPostingPeriodType: this.fixedDepositsAccountTemplate.interestPostingPeriodType.id, + interestCalculationType: this.fixedDepositsAccountTemplate.interestCalculationType.id, + interestCalculationDaysInYearType: this.fixedDepositsAccountTemplate.interestCalculationDaysInYearType.id, + depositAmount: this.fixedDepositsAccountTemplate.depositAmount + ? this.fixedDepositsAccountTemplate.depositAmount + : 0, + depositPeriod: this.fixedDepositsAccountTemplate.depositPeriod, + depositPeriodFrequencyId: this.fixedDepositsAccountTemplate.depositPeriodFrequency.id }); console.log(this.fixedDepositAccountTermsForm.value); } @@ -74,13 +77,34 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges */ createFixedDepositsAccountTermsForm() { this.fixedDepositAccountTermsForm = this.formBuilder.group({ - 'interestCompoundingPeriodType': ['', Validators.required], - 'interestPostingPeriodType': ['', Validators.required], - 'interestCalculationType': ['', Validators.required], - 'interestCalculationDaysInYearType': ['', Validators.required], - 'depositAmount': [0, Validators.required], - 'depositPeriod': ['', Validators.required], - 'depositPeriodFrequencyId': ['', Validators.required] + interestCompoundingPeriodType: [ + '', + Validators.required + ], + interestPostingPeriodType: [ + '', + Validators.required + ], + interestCalculationType: [ + '', + Validators.required + ], + interestCalculationDaysInYearType: [ + '', + Validators.required + ], + depositAmount: [ + 0, + Validators.required + ], + depositPeriod: [ + '', + Validators.required + ], + depositPeriodFrequencyId: [ + '', + Validators.required + ] }); } @@ -88,20 +112,23 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges * Sets all select dropdown options. */ setOptions() { - this.interestCompoundingPeriodTypeData = this.fixedDepositsAccountProductTemplate.interestCompoundingPeriodTypeOptions; + this.interestCompoundingPeriodTypeData = + this.fixedDepositsAccountProductTemplate.interestCompoundingPeriodTypeOptions; this.interestPostingPeriodTypeData = this.fixedDepositsAccountProductTemplate.interestPostingPeriodTypeOptions; this.interestCalculationTypeData = this.fixedDepositsAccountProductTemplate.interestCalculationTypeOptions; - this.interestCalculationDaysInYearTypeData = this.fixedDepositsAccountProductTemplate.interestCalculationDaysInYearTypeOptions; + this.interestCalculationDaysInYearTypeData = + this.fixedDepositsAccountProductTemplate.interestCalculationDaysInYearTypeOptions; this.periodFrequencyTypeData = this.fixedDepositsAccountProductTemplate.periodFrequencyTypeOptions; if (!this.fixedDepositsAccountTemplate.id) { this.fixedDepositAccountTermsForm.patchValue({ - 'interestCompoundingPeriodType': this.fixedDepositsAccountProductTemplate.interestCompoundingPeriodType.id, - 'interestPostingPeriodType': this.fixedDepositsAccountProductTemplate.interestPostingPeriodType.id, - 'interestCalculationType': this.fixedDepositsAccountProductTemplate.interestCalculationType.id, - 'interestCalculationDaysInYearType': this.fixedDepositsAccountProductTemplate.interestCalculationDaysInYearType.id, - 'depositAmount': this.fixedDepositsAccountProductTemplate.depositAmount, - 'depositPeriod': this.fixedDepositsAccountProductTemplate.minDepositTerm, - 'depositPeriodFrequencyId': this.fixedDepositsAccountProductTemplate.minDepositTermType.id, + interestCompoundingPeriodType: this.fixedDepositsAccountProductTemplate.interestCompoundingPeriodType.id, + interestPostingPeriodType: this.fixedDepositsAccountProductTemplate.interestPostingPeriodType.id, + interestCalculationType: this.fixedDepositsAccountProductTemplate.interestCalculationType.id, + interestCalculationDaysInYearType: + this.fixedDepositsAccountProductTemplate.interestCalculationDaysInYearType.id, + depositAmount: this.fixedDepositsAccountProductTemplate.depositAmount, + depositPeriod: this.fixedDepositsAccountProductTemplate.minDepositTerm, + depositPeriodFrequencyId: this.fixedDepositsAccountProductTemplate.minDepositTermType.id }); } } @@ -118,5 +145,4 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges } return fixedDepositAccountTerms; } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.spec.ts index 1ef118215..0733958ac 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('ChargesTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChargesTabComponent ] - }) - .compileComponents(); + declarations: [ChargesTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.ts index 5be8761c5..52a70bf06 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.ts @@ -30,7 +30,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./charges-tab.component.scss'] }) export class ChargesTabComponent implements OnInit { - /** Fixed Deposits Account Data */ fixedDepositsAccountData: any; /** Charges Data */ @@ -66,12 +65,14 @@ export class ChargesTabComponent implements OnInit { * @param {Dates} dateUtils Date Utils. * @param {SettingsService} settingsService Settings Service. */ - constructor(private savingsService: SavingsService, - private route: ActivatedRoute, - private dateUtils: Dates, - private router: Router, - public dialog: MatDialog, - private settingsService: SettingsService) { + constructor( + private savingsService: SavingsService, + private route: ActivatedRoute, + private dateUtils: Dates, + private router: Router, + public dialog: MatDialog, + private settingsService: SettingsService + ) { this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => { this.fixedDepositsAccountData = data.fixedDepositsAccountData; this.chargesData = this.fixedDepositsAccountData.charges; @@ -79,7 +80,7 @@ export class ChargesTabComponent implements OnInit { } ngOnInit() { - const activeCharges = this.chargesData ? this.chargesData.filter(charge => charge.isActive) : []; + const activeCharges = this.chargesData ? this.chargesData.filter((charge) => charge.isActive) : []; this.dataSource = new MatTableDataSource(activeCharges); } @@ -89,10 +90,10 @@ export class ChargesTabComponent implements OnInit { toggleCharges() { this.showInactiveCharges = !this.showInactiveCharges; if (!this.showInactiveCharges) { - const activeCharges = this.chargesData.filter(charge => charge.isActive); + const activeCharges = this.chargesData.filter((charge) => charge.isActive); this.dataSource.data = activeCharges; } else { - const inActiveCharges = this.chargesData.filter(charge => !charge.isActive); + const inActiveCharges = this.chargesData.filter((charge) => !charge.isActive); this.dataSource.data = inActiveCharges; } this.chargesTableRef.renderRows(); @@ -118,6 +119,7 @@ export class ChargesTabComponent implements OnInit { type: 'date', required: true }) + ]; const data = { title: `Pay Charge ${chargeId}`, @@ -135,7 +137,8 @@ export class ChargesTabComponent implements OnInit { dateFormat, locale }; - this.savingsService.executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'paycharge', dataObject, chargeId) + this.savingsService + .executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'paycharge', dataObject, chargeId) .subscribe(() => { this.reload(); }); @@ -151,7 +154,8 @@ export class ChargesTabComponent implements OnInit { const waiveChargeDialogRef = this.dialog.open(WaiveChargeDialogComponent, { data: { id: chargeId } }); waiveChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'waive', {}, chargeId) + this.savingsService + .executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'waive', {}, chargeId) .subscribe(() => { this.reload(); }); @@ -167,7 +171,8 @@ export class ChargesTabComponent implements OnInit { const inactivateChargeDialogRef = this.dialog.open(InactivateChargeDialogComponent, { data: { id: chargeId } }); inactivateChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'inactivate', {}, chargeId) + this.savingsService + .executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'inactivate', {}, chargeId) .subscribe(() => { this.reload(); }); @@ -188,6 +193,7 @@ export class ChargesTabComponent implements OnInit { type: 'number', required: true }) + ]; const data = { title: `Edit Charge ${charge.id}`, @@ -204,7 +210,8 @@ export class ChargesTabComponent implements OnInit { dateFormat, locale }; - this.savingsService.editSavingsAccountCharge(this.fixedDepositsAccountData.id, dataObject, charge.id) + this.savingsService + .editSavingsAccountCharge(this.fixedDepositsAccountData.id, dataObject, charge.id) .subscribe(() => { this.reload(); }); @@ -222,10 +229,9 @@ export class ChargesTabComponent implements OnInit { }); deleteChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.savingsService.deleteSavingsAccountCharge(this.fixedDepositsAccountData.id, chargeId) - .subscribe(() => { - this.reload(); - }); + this.savingsService.deleteSavingsAccountCharge(this.fixedDepositsAccountData.id, chargeId).subscribe(() => { + this.reload(); + }); } }); } @@ -235,7 +241,11 @@ export class ChargesTabComponent implements OnInit { * @param {any} charge Charge */ isRecurringCharge(charge: any) { - return charge.chargeTimeType.value === 'Monthly Fee' || charge.chargeTimeType.value === 'Annual Fee' || charge.chargeTimeType.value === 'Weekly Fee'; + return ( + charge.chargeTimeType.value === 'Monthly Fee' || + charge.chargeTimeType.value === 'Annual Fee' || + charge.chargeTimeType.value === 'Weekly Fee' + ); } /** @@ -253,8 +263,8 @@ export class ChargesTabComponent implements OnInit { private reload() { const clientId = this.fixedDepositsAccountData.clientId; const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${clientId}/fixed-deposits-accounts`, {skipLocationChange: true}) + this.router + .navigateByUrl(`/clients/${clientId}/fixed-deposits-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.spec.ts index 56e05d8a5..ea1d30a51 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('CalculateInterestDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CalculateInterestDialogComponent ] - }) - .compileComponents(); + declarations: [CalculateInterestDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.ts index 8dbf9b28a..228b51f6f 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.ts @@ -11,10 +11,8 @@ import { MatDialogRef } from '@angular/material/dialog'; styleUrls: ['./calculate-interest-dialog.component.scss'] }) export class CalculateInterestDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. */ - constructor(public dialogRef: MatDialogRef) { } - + constructor(public dialogRef: MatDialogRef) {} } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.spec.ts index 6bf5313f2..a81ed7183 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('InactivateChargeDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ InactivateChargeDialogComponent ] - }) - .compileComponents(); + declarations: [InactivateChargeDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.ts index f5ca64d80..e1eeebca7 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.ts @@ -11,11 +11,11 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./inactivate-charge-dialog.component.scss'] }) export class InactivateChargeDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.spec.ts index f8acdff28..d764a3da8 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('PostInterestDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PostInterestDialogComponent ] - }) - .compileComponents(); + declarations: [PostInterestDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.ts index 530ba8f5b..4cf7d3c3a 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.ts @@ -11,10 +11,8 @@ import { MatDialogRef } from '@angular/material/dialog'; styleUrls: ['./post-interest-dialog.component.scss'] }) export class PostInterestDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. */ - constructor(public dialogRef: MatDialogRef) { } - + constructor(public dialogRef: MatDialogRef) {} } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.spec.ts index f0214dca7..4ddd92200 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('ToggleWithholdTaxDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ToggleWithholdTaxDialogComponent ] - }) - .compileComponents(); + declarations: [ToggleWithholdTaxDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.ts index 5979f2946..7ad9b6505 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.ts @@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./toggle-withhold-tax-dialog.component.scss'] }) export class ToggleWithholdTaxDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.spec.ts index 7d9bbd5ae..a9dfd1dcd 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('WaiveChargeDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WaiveChargeDialogComponent ] - }) - .compileComponents(); + declarations: [WaiveChargeDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.ts index 460d71874..2d7577ba7 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.ts @@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./waive-charge-dialog.component.scss'] }) export class WaiveChargeDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/datatable-tabs/datatable-tabs.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/datatable-tabs/datatable-tabs.component.spec.ts index 0f1dfa604..571f3ae93 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/datatable-tabs/datatable-tabs.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/datatable-tabs/datatable-tabs.component.spec.ts @@ -8,9 +8,8 @@ describe('DatatableTabsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DatatableTabsComponent ] - }) - .compileComponents(); + declarations: [DatatableTabsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/datatable-tabs/datatable-tabs.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/datatable-tabs/datatable-tabs.component.ts index 47a9cde11..10016b326 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/datatable-tabs/datatable-tabs.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/datatable-tabs/datatable-tabs.component.ts @@ -29,5 +29,4 @@ export class DatatableTabsComponent { this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposit-account-view.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposit-account-view.component.spec.ts index 699b6b14c..5484c0b18 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposit-account-view.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposit-account-view.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositAccountViewComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositAccountViewComponent ] - }) - .compileComponents(); + declarations: [FixedDepositAccountViewComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposit-account-view.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposit-account-view.component.ts index eb744a0aa..268f872d0 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposit-account-view.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposit-account-view.component.ts @@ -26,7 +26,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./fixed-deposit-account-view.component.scss'] }) export class FixedDepositAccountViewComponent implements OnInit { - /** Fixed Deposits Account Data */ fixedDepositsAccountData: any; /** Savings Data Tables */ @@ -46,17 +45,19 @@ export class FixedDepositAccountViewComponent implements OnInit { * @param {SavingsService} savingsService Savings Service * @param {MatDialog} dialog Mat Dialog */ - constructor(private route: ActivatedRoute, - private router: Router, - private fixedDepositsService: FixedDepositsService, - private savingsService: SavingsService, - public dialog: MatDialog) { - this.route.data.subscribe((data: { fixedDepositsAccountData: any, savingsDatatables: any }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private fixedDepositsService: FixedDepositsService, + private savingsService: SavingsService, + public dialog: MatDialog + ) { + this.route.data.subscribe((data: { fixedDepositsAccountData: any; savingsDatatables: any }) => { this.fixedDepositsAccountData = data.fixedDepositsAccountData; this.savingsDatatables = data.savingsDatatables; this.currency = this.fixedDepositsAccountData.currency; const status: any = data.fixedDepositsAccountData.status; - this.showTransactions = (status.id >= 300); + this.showTransactions = status.id >= 300; }); if (this.router.url.includes('clients')) { this.entityType = 'Client'; @@ -97,7 +98,8 @@ export class FixedDepositAccountViewComponent implements OnInit { reload() { const clientId = this.fixedDepositsAccountData.clientId; const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${clientId}/fixed-deposits-accounts`, {skipLocationChange: true}) + this.router + .navigateByUrl(`/clients/${clientId}/fixed-deposits-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } @@ -162,9 +164,11 @@ export class FixedDepositAccountViewComponent implements OnInit { const calculateInterestAccountDialogRef = this.dialog.open(CalculateInterestDialogComponent); calculateInterestAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.fixedDepositsService.executeFixedDepositsAccountCommand(this.fixedDepositsAccountData.id, 'calculateInterest', {}).subscribe(() => { - this.reload(); - }); + this.fixedDepositsService + .executeFixedDepositsAccountCommand(this.fixedDepositsAccountData.id, 'calculateInterest', {}) + .subscribe(() => { + this.reload(); + }); } }); } @@ -176,14 +180,15 @@ export class FixedDepositAccountViewComponent implements OnInit { const postInterestAccountDialogRef = this.dialog.open(PostInterestDialogComponent); postInterestAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.fixedDepositsService.executeFixedDepositsAccountCommand(this.fixedDepositsAccountData.id, 'postInterest', {}).subscribe(() => { - this.reload(); - }); + this.fixedDepositsService + .executeFixedDepositsAccountCommand(this.fixedDepositsAccountData.id, 'postInterest', {}) + .subscribe(() => { + this.reload(); + }); } }); } - /** * Enables withhold tax for fixed deposits account. * Fixed deposits endpoint is not supported so using Savings endpoint. @@ -194,7 +199,10 @@ export class FixedDepositAccountViewComponent implements OnInit { }); deleteSavingsAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountUpdateCommand(this.fixedDepositsAccountData.id, 'updateWithHoldTax', { withHoldTax: true}) + this.savingsService + .executeSavingsAccountUpdateCommand(this.fixedDepositsAccountData.id, 'updateWithHoldTax', { + withHoldTax: true + }) .subscribe(() => { this.reload(); }); @@ -212,12 +220,14 @@ export class FixedDepositAccountViewComponent implements OnInit { }); disableWithHoldTaxDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountUpdateCommand(this.fixedDepositsAccountData.id, 'updateWithHoldTax', { withHoldTax: false}) + this.savingsService + .executeSavingsAccountUpdateCommand(this.fixedDepositsAccountData.id, 'updateWithHoldTax', { + withHoldTax: false + }) .subscribe(() => { this.reload(); }); } }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposits-buttons.config.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposits-buttons.config.ts index 14898dc0a..6d86532b3 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposits-buttons.config.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposits-buttons.config.ts @@ -1,13 +1,12 @@ /** Fixed Deposits Account Buttons Configuration */ export class FixedDepositsButtonsConfiguration { - optionArray: { - name: string + name: string; }[]; buttonsArray: { - name: string, - icon: string, + name: string; + icon: string; }[]; constructor(status: string) { @@ -52,7 +51,7 @@ export class FixedDepositsButtonsConfiguration { icon: 'fa fa-table' } ]; - break; + break; case 'Submitted and pending approval': this.buttonsArray = [ { @@ -76,7 +75,7 @@ export class FixedDepositsButtonsConfiguration { icon: 'fa fa-check' } ]; - break; + break; default: this.buttonsArray = []; } @@ -117,8 +116,7 @@ export class FixedDepositsButtonsConfiguration { } } - addOption(option: {name: string}) { + addOption(option: { name: string }) { this.optionArray.push(option); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/general-tab/general-tab.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/general-tab/general-tab.component.spec.ts index 23d4dfb2b..c0c1ba0aa 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/general-tab/general-tab.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/general-tab/general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GeneralTabComponent ] - }) - .compileComponents(); + declarations: [GeneralTabComponent] + }).compileComponents(); fixture = TestBed.createComponent(GeneralTabComponent); component = fixture.componentInstance; diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/general-tab/general-tab.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/general-tab/general-tab.component.ts index 1c21e7950..c07fea0f3 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/general-tab/general-tab.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/general-tab/general-tab.component.ts @@ -8,13 +8,14 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./general-tab.component.scss'] }) export class GeneralTabComponent { - fixedDepositsAccountData: any; entityType: string; currency: Currency; - constructor(private route: ActivatedRoute, - private router: Router) { + constructor( + private route: ActivatedRoute, + private router: Router + ) { this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => { this.fixedDepositsAccountData = data.fixedDepositsAccountData; this.currency = this.fixedDepositsAccountData.currency; @@ -27,5 +28,4 @@ export class GeneralTabComponent { this.entityType = 'Center'; } } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.spec.ts index 26675582a..fd6e9869a 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('InterestRateChartTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ InterestRateChartTabComponent ] - }) - .compileComponents(); + declarations: [InterestRateChartTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.ts index 7aa3a2b2d..967cc47b4 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.ts @@ -14,20 +14,32 @@ import { animate, state, style, transition, trigger } from '@angular/animations' trigger('expandChartSlab', [ state('collapsed', style({ height: '0px', minHeight: '0' })), state('expanded', style({ height: '*' })), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')) - ]) + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + ] }) export class InterestRateChartTabComponent { - /** Fixed Deposits Account Status */ status: any; /** Interest Rate Chart Data */ interestRateChartData: any = []; /** Columns to be displayed in interest rate chart table. */ - chartSlabsDisplayedColumns: any[] = ['period', 'amountRange', 'interest', 'description', 'actions']; + chartSlabsDisplayedColumns: any[] = [ + 'period', + 'amountRange', + 'interest', + 'description', + 'actions' + ]; /** Columns to be displayed in incentives sub-table. */ - incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount']; + incentivesDisplayedColumns: string[] = [ + 'entityType', + 'attributeName', + 'conditionType', + 'attributeValue', + 'incentiveType', + 'amount' + ]; /** Additional Column to display in incentives table */ chartSlabsIncentivesDisplayedColumns: string[] = ['incentives']; /** Expand Chart Slab Index used in the view */ @@ -42,5 +54,4 @@ export class InterestRateChartTabComponent { this.interestRateChartData = data.fixedDepositsAccountData.accountChart.chartSlabs; }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts index f3997e094..5a482658c 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('StandingInstructionsTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ StandingInstructionsTabComponent ] - }) - .compileComponents(); + declarations: [StandingInstructionsTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/standing-instructions-tab/standing-instructions-tab.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/standing-instructions-tab/standing-instructions-tab.component.ts index e791785c3..abdb5815e 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/standing-instructions-tab/standing-instructions-tab.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/standing-instructions-tab/standing-instructions-tab.component.ts @@ -21,7 +21,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./standing-instructions-tab.component.scss'] }) export class StandingInstructionsTabComponent implements OnInit { - /** Fixed Deposits Data */ fixedDepositsData: any; /** Instructions Data */ @@ -50,11 +49,13 @@ export class StandingInstructionsTabComponent implements OnInit { * @param {AccountTransfersService} accountTransfersService Accounts Transfer Service * @param {SettingsService} settingsService Settings Service */ - constructor(private route: ActivatedRoute, - private fixedDepositsService: FixedDepositsService, - private dialog: MatDialog, - private accountTransfersService: AccountTransfersService, - private settingsService: SettingsService) { + constructor( + private route: ActivatedRoute, + private fixedDepositsService: FixedDepositsService, + private dialog: MatDialog, + private accountTransfersService: AccountTransfersService, + private settingsService: SettingsService + ) { this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => { this.fixedDepositsData = data.fixedDepositsAccountData; }); @@ -73,11 +74,13 @@ export class StandingInstructionsTabComponent implements OnInit { const accountId = this.fixedDepositsData.id; const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; - this.fixedDepositsService.getStandingInstructions(clientId, clientName, accountId, locale, dateFormat).subscribe((response: any) => { - this.instructionsData = response.pageItems; - this.dataSource.data = this.instructionsData; - this.instructionTableRef.renderRows(); - }); + this.fixedDepositsService + .getStandingInstructions(clientId, clientName, accountId, locale, dateFormat) + .subscribe((response: any) => { + this.instructionsData = response.pageItems; + this.dataSource.data = this.instructionsData; + this.instructionTableRef.renderRows(); + }); } /** @@ -90,10 +93,8 @@ export class StandingInstructionsTabComponent implements OnInit { }); deleteStandingInstructionDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.accountTransfersService.deleteStandingInstrucions(instructionId) - .subscribe(() => { }); + this.accountTransfersService.deleteStandingInstrucions(instructionId).subscribe(() => {}); } }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.spec.ts index a67fc2279..0175d84c6 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('TransactionsTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ TransactionsTabComponent ] - }) - .compileComponents(); + declarations: [TransactionsTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.ts index 9d245ec02..4a8d0b3c4 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.ts @@ -25,7 +25,16 @@ export class TransactionsTabComponent implements OnInit { hideAccrualsParam: UntypedFormControl; hideReversedParam: UntypedFormControl; /** Columns to be displayed in transactions table. */ - displayedColumns: string[] = ['row', 'id', 'transactionDate', 'transactionType', 'debit', 'credit', 'balance', 'actions']; + displayedColumns: string[] = [ + 'row', + 'id', + 'transactionDate', + 'transactionType', + 'debit', + 'credit', + 'balance', + 'actions' + ]; /** Data source for transactions table. */ dataSource: MatTableDataSource; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @@ -36,9 +45,11 @@ export class TransactionsTabComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, - public dialog: MatDialog) { + public dialog: MatDialog + ) { this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => { this.transactionsData = data.fixedDepositsAccountData.transactions; this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId']; @@ -56,8 +67,14 @@ export class TransactionsTabComponent implements OnInit { * Checks transaction status. */ checkStatus() { - if (this.status === 'Active' || this.status === 'Closed' || this.status === 'Transfer in progress' || - this.status === 'Transfer on hold' || this.status === 'Premature Closed' || this.status === 'Matured') { + if ( + this.status === 'Active' || + this.status === 'Closed' || + this.status === 'Transfer in progress' || + this.status === 'Transfer on hold' || + this.status === 'Premature Closed' || + this.status === 'Matured' + ) { return true; } return false; @@ -68,8 +85,12 @@ export class TransactionsTabComponent implements OnInit { * @param {any} transactionType Transaction Type */ isDebit(transactionType: any) { - return transactionType.withdrawal === true || transactionType.feeDeduction === true - || transactionType.overdraftInterest === true || transactionType.withholdTax === true; + return ( + transactionType.withdrawal === true || + transactionType.feeDeduction === true || + transactionType.overdraftInterest === true || + transactionType.withholdTax === true + ); } /** @@ -78,7 +99,9 @@ export class TransactionsTabComponent implements OnInit { */ showTransactions(transactionsData: any) { if (transactionsData.transfer) { - this.router.navigate([`account-transfers/account-transfers/${transactionsData.transfer.id}`], { relativeTo: this.route }); + this.router.navigate([`account-transfers/account-transfers/${transactionsData.transfer.id}`], { + relativeTo: this.route + }); } else { this.router.navigate([transactionsData.id], { relativeTo: this.route }); } @@ -97,7 +120,7 @@ export class TransactionsTabComponent implements OnInit { if (hideAccrual || hideReversed) { transactions = this.transactionsData.filter((t: SavingsAccountTransaction) => { - return (!(hideReversed && t.reversed) && !(hideAccrual && t.transactionType.accrual)); + return !(hideReversed && t.reversed) && !(hideAccrual && t.transactionType.accrual); }); } this.dataSource = new MatTableDataSource(transactions); @@ -125,7 +148,5 @@ export class TransactionsTabComponent implements OnInit { $event.stopPropagation(); } - undoTransaction(transactionData: SavingsAccountTransaction): void { - - } + undoTransaction(transactionData: SavingsAccountTransaction): void {} } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.spec.ts index bbff0d11b..bed3c6ae6 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewTransactionComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewTransactionComponent ] - }) - .compileComponents(); + declarations: [ViewTransactionComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.ts index 9caf5712a..932445b8f 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.ts @@ -23,12 +23,14 @@ export class ViewTransactionComponent { /** */ - constructor(private savingsService: SavingsService, - private route: ActivatedRoute, - private dateUtils: Dates, - private router: Router, - public dialog: MatDialog, - private settingsService: SettingsService) { + constructor( + private savingsService: SavingsService, + private route: ActivatedRoute, + private dateUtils: Dates, + private router: Router, + public dialog: MatDialog, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { fixedDepositsAccountTransaction: any }) => { this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId']; this.transactionData = data.fixedDepositsAccountTransaction; @@ -53,16 +55,20 @@ export class ViewTransactionComponent { const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; const data = { - transactionDate: this.dateUtils.formatDate(this.transactionData.date && new Date(this.transactionData.date), dateFormat), + transactionDate: this.dateUtils.formatDate( + this.transactionData.date && new Date(this.transactionData.date), + dateFormat + ), transactionAmount: 0, dateFormat, locale }; - this.savingsService.executeSavingsAccountTransactionsCommand(this.accountId, 'undo', data, this.transactionData.id).subscribe(() => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.savingsService + .executeSavingsAccountTransactionsCommand(this.accountId, 'undo', data, this.transactionData.id) + .subscribe(() => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component.spec.ts index 876091140..d4c2aaf3f 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('ActivateFixedDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ActivateFixedDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [ActivateFixedDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component.ts index 44644fc16..565f549d7 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./activate-fixed-deposits-account.component.scss'] }) export class ActivateFixedDepositsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -36,12 +35,14 @@ export class ActivateFixedDepositsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId']; } @@ -58,7 +59,10 @@ export class ActivateFixedDepositsAccountComponent implements OnInit { */ createActivateFixedDepositsAccountForm() { this.activateFixedDepositsAccountForm = this.formBuilder.group({ - 'activatedOnDate': ['', Validators.required] + activatedOnDate: [ + '', + Validators.required + ] }); } @@ -83,5 +87,4 @@ export class ActivateFixedDepositsAccountComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/add-charge-fixed-deposits-account/add-charge-fixed-deposits-account.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/add-charge-fixed-deposits-account/add-charge-fixed-deposits-account.component.spec.ts index cc354984a..e768d0ecc 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/add-charge-fixed-deposits-account/add-charge-fixed-deposits-account.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/add-charge-fixed-deposits-account/add-charge-fixed-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('AddChargeFixedDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AddChargeFixedDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [AddChargeFixedDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/add-charge-fixed-deposits-account/add-charge-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/add-charge-fixed-deposits-account/add-charge-fixed-deposits-account.component.ts index f3b6d9934..4b720139e 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/add-charge-fixed-deposits-account/add-charge-fixed-deposits-account.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/add-charge-fixed-deposits-account/add-charge-fixed-deposits-account.component.ts @@ -18,7 +18,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./add-charge-fixed-deposits-account.component.scss'] }) export class AddChargeFixedDepositsAccountComponent implements OnInit { - /** Minimum Due Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Due Date allowed. */ @@ -65,7 +64,7 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit { } buildDependencies() { - this.fixedDepositsChargeForm.controls.chargeId.valueChanges.subscribe(chargeId => { + this.fixedDepositsChargeForm.controls.chargeId.valueChanges.subscribe((chargeId) => { this.savingsService.getChargeTemplate(chargeId).subscribe((data: any) => { this.chargeDetails = data; const chargeTimeType = data.chargeTimeType.id; @@ -86,14 +85,17 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit { this.fixedDepositsChargeForm.removeControl('feeOnMonthDay'); } if (chargeTimeType.value === 'Monthly Fee') { - this.fixedDepositsChargeForm.addControl('feeInterval', new UntypedFormControl(data.feeInterval, Validators.required)); + this.fixedDepositsChargeForm.addControl( + 'feeInterval', + new UntypedFormControl(data.feeInterval, Validators.required) + ); } else { this.fixedDepositsChargeForm.removeControl('feeInterval'); } this.fixedDepositsChargeForm.patchValue({ - 'amount': data.amount, - 'chargeCalculationType': data.chargeCalculationType.id, - 'chargeTimeType': data.chargeTimeType.id + amount: data.amount, + chargeCalculationType: data.chargeCalculationType.id, + chargeTimeType: data.chargeTimeType.id }); }); }); @@ -104,10 +106,16 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit { */ createFixedDepositsChargeForm() { this.fixedDepositsChargeForm = this.formBuilder.group({ - 'chargeId': ['', Validators.required], - 'amount': ['', Validators.required], - 'chargeCalculationType': [{ value: '', disabled: true }], - 'chargeTimeType': [{ value: '', disabled: true }] + chargeId: [ + '', + Validators.required + ], + amount: [ + '', + Validators.required + ], + chargeCalculationType: [{ value: '', disabled: true }], + chargeTimeType: [{ value: '', disabled: true }] }); } @@ -137,9 +145,8 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit { } } } - this.savingsService.createSavingsCharge(this.fixedDepositAccountId, 'charges', savingsCharge).subscribe( () => { + this.savingsService.createSavingsCharge(this.fixedDepositAccountId, 'charges', savingsCharge).subscribe(() => { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.spec.ts index 392e41dbb..77a6b3223 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('ApproveFixedDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ApproveFixedDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [ApproveFixedDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.ts index 5eb82299c..e8c7a30b6 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./approve-fixed-deposits-account.component.scss'] }) export class ApproveFixedDepositsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class ApproveFixedDepositsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private fixedDepositsService: FixedDepositsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private fixedDepositsService: FixedDepositsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId']; } @@ -57,8 +58,11 @@ export class ApproveFixedDepositsAccountComponent implements OnInit { */ createApproveFixedDepositsAccountForm() { this.approveFixedDepositsAccountForm = this.formBuilder.group({ - 'approvedOnDate': ['', Validators.required], - 'note': [''] + approvedOnDate: [ + '', + Validators.required + ], + note: [''] }); } @@ -83,5 +87,4 @@ export class ApproveFixedDepositsAccountComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/close-fixed-deposits-account/close-fixed-deposits-account.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/close-fixed-deposits-account/close-fixed-deposits-account.component.spec.ts index 85534634c..cf3cf92d8 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/close-fixed-deposits-account/close-fixed-deposits-account.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/close-fixed-deposits-account/close-fixed-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('CloseFixedDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CloseFixedDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [CloseFixedDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/close-fixed-deposits-account/close-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/close-fixed-deposits-account/close-fixed-deposits-account.component.ts index 5e50191cc..76227b2b4 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/close-fixed-deposits-account/close-fixed-deposits-account.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/close-fixed-deposits-account/close-fixed-deposits-account.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./close-fixed-deposits-account.component.scss'] }) export class CloseFixedDepositsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -42,12 +41,14 @@ export class CloseFixedDepositsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private fixedDepositsService: FixedDepositsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private fixedDepositsService: FixedDepositsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { fixedDepositsAccountActionData: any }) => { this.savingsAccountsData = data.fixedDepositsAccountActionData.savingsAccounts; this.onAccountClosureOptions = data.fixedDepositsAccountActionData.onAccountClosureOptions; @@ -70,10 +71,16 @@ export class CloseFixedDepositsAccountComponent implements OnInit { */ createCloseOnMaturityAccountForm() { this.closeOnMaturityAccountForm = this.formBuilder.group({ - 'closedOnDate': ['', Validators.required], - 'maturityAmount': [{value: this.maturityAmount, disabled: true}], - 'onAccountClosureId': ['', Validators.required], - 'note': [''] + closedOnDate: [ + '', + Validators.required + ], + maturityAmount: [{ value: this.maturityAmount, disabled: true }], + onAccountClosureId: [ + '', + Validators.required + ], + note: [''] }); } @@ -83,7 +90,10 @@ export class CloseFixedDepositsAccountComponent implements OnInit { addTransferDetails() { this.closeOnMaturityAccountForm.get('onAccountClosureId').valueChanges.subscribe((id: any) => { if (id === 200) { - this.closeOnMaturityAccountForm.addControl('toSavingsAccountId', new UntypedFormControl('', Validators.required)); + this.closeOnMaturityAccountForm.addControl( + 'toSavingsAccountId', + new UntypedFormControl('', Validators.required) + ); this.closeOnMaturityAccountForm.addControl('transferDescription', new UntypedFormControl('')); } else { this.closeOnMaturityAccountForm.removeControl('toSavingsAccountId'); @@ -113,5 +123,4 @@ export class CloseFixedDepositsAccountComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-account-actions.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-account-actions.component.spec.ts index 0f403eb59..85be10e36 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-account-actions.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-account-actions.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositsAccountActionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositsAccountActionsComponent ] - }) - .compileComponents(); + declarations: [FixedDepositsAccountActionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-account-actions.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-account-actions.component.ts index 01d912ee4..014d81b6b 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-account-actions.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-account-actions.component.ts @@ -11,30 +11,29 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./fixed-deposits-account-actions.component.scss'] }) export class FixedDepositsAccountActionsComponent { - /** Flag object to store possible actions and render appropriate UI to the user */ actions: { - 'Approve': boolean - 'Reject': boolean - 'Activate': boolean - 'Close': boolean - 'Undo Approval': boolean - 'Undo Activation': boolean - 'Add Charge': boolean - 'Premature Close': boolean - 'Withdrawn by Client': boolean - 'Withdrawal': boolean + Approve: boolean; + Reject: boolean; + Activate: boolean; + Close: boolean; + 'Undo Approval': boolean; + 'Undo Activation': boolean; + 'Add Charge': boolean; + 'Premature Close': boolean; + 'Withdrawn by Client': boolean; + Withdrawal: boolean; } = { - 'Approve': false, - 'Reject': false, - 'Activate': false, - 'Close': false, + Approve: false, + Reject: false, + Activate: false, + Close: false, 'Undo Approval': false, 'Undo Activation': false, 'Add Charge': false, 'Premature Close': false, 'Withdrawn by Client': false, - 'Withdrawal': false + Withdrawal: false }; /** @@ -44,5 +43,4 @@ export class FixedDepositsAccountActionsComponent { const name = this.route.snapshot.params['name']; this.actions[name] = true; } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-cash-transaction/fixed-deposits-cash-transaction.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-cash-transaction/fixed-deposits-cash-transaction.component.spec.ts index 4c5627a87..78cb97289 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-cash-transaction/fixed-deposits-cash-transaction.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-cash-transaction/fixed-deposits-cash-transaction.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositsCashTransactionComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ FixedDepositsCashTransactionComponent ] - }) - .compileComponents(); + declarations: [FixedDepositsCashTransactionComponent] + }).compileComponents(); fixture = TestBed.createComponent(FixedDepositsCashTransactionComponent); component = fixture.componentInstance; diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-cash-transaction/fixed-deposits-cash-transaction.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-cash-transaction/fixed-deposits-cash-transaction.component.ts index 74d0c00d0..09c031ca7 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-cash-transaction/fixed-deposits-cash-transaction.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/fixed-deposits-cash-transaction/fixed-deposits-cash-transaction.component.ts @@ -12,7 +12,6 @@ import { Currency, PaymentType } from 'app/shared/models/general.model'; styleUrls: ['./fixed-deposits-cash-transaction.component.scss'] }) export class FixedDepositsCashTransactionComponent implements OnInit { - /** Minimum Due Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Due Date allowed. */ @@ -24,7 +23,7 @@ export class FixedDepositsCashTransactionComponent implements OnInit { /** Flag to enable payment details fields. */ addPaymentDetailsFlag: Boolean = false; /** transaction type flag to render required UI */ - transactionType: { deposit: boolean, withdrawal: boolean } = { deposit: false, withdrawal: false }; + transactionType: { deposit: boolean; withdrawal: boolean } = { deposit: false, withdrawal: false }; /** transaction command for submit request */ transactionCommand: string; actionName: string; @@ -41,12 +40,14 @@ export class FixedDepositsCashTransactionComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private fixedDepositsService: FixedDepositsService, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private fixedDepositsService: FixedDepositsService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { fixedDepositsAccountActionData: any }) => { this.currency = data.fixedDepositsAccountActionData.currency; this.paymentTypeOptions = data.fixedDepositsAccountActionData.paymentTypeOptions; @@ -70,10 +71,16 @@ export class FixedDepositsCashTransactionComponent implements OnInit { */ createSavingAccountTransactionForm() { this.accountTransactionForm = this.formBuilder.group({ - 'transactionDate': [this.settingsService.businessDate, Validators.required], - 'transactionAmount': [0, Validators.required], - 'paymentTypeId': [''], - 'note': [''] + transactionDate: [ + this.settingsService.businessDate, + Validators.required + ], + transactionAmount: [ + 0, + Validators.required + ], + paymentTypeId: [''], + note: [''] }); } @@ -115,9 +122,10 @@ export class FixedDepositsCashTransactionComponent implements OnInit { }; delete data.note; data['transactionAmount'] = data['transactionAmount'] * 1; - this.fixedDepositsService.executeFixedDepositsAccountTransactionsCommand(this.accountId, this.transactionCommand, data).subscribe(res => { - this.router.navigate(['../../transactions'], { relativeTo: this.route }); - }); + this.fixedDepositsService + .executeFixedDepositsAccountTransactionsCommand(this.accountId, this.transactionCommand, data) + .subscribe((res) => { + this.router.navigate(['../../transactions'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/premature-close-fixed-deposits-account/premature-close-fixed-deposits-account.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/premature-close-fixed-deposits-account/premature-close-fixed-deposits-account.component.spec.ts index b7e8c1d62..a299618be 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/premature-close-fixed-deposits-account/premature-close-fixed-deposits-account.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/premature-close-fixed-deposits-account/premature-close-fixed-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('PrematureCloseFixedDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PrematureCloseFixedDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [PrematureCloseFixedDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/premature-close-fixed-deposits-account/premature-close-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/premature-close-fixed-deposits-account/premature-close-fixed-deposits-account.component.ts index cedfc0d0a..88ea068b9 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/premature-close-fixed-deposits-account/premature-close-fixed-deposits-account.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/premature-close-fixed-deposits-account/premature-close-fixed-deposits-account.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./premature-close-fixed-deposits-account.component.scss'] }) export class PrematureCloseFixedDepositsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -33,7 +32,6 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit { /** Form submission event */ isSubmitted = false; - /** * @param {FormBuilder} formBuilder Form Builder * @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service @@ -42,12 +40,14 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private fixedDepositsService: FixedDepositsService, private dateUtils: Dates, private route: ActivatedRoute, private router: Router, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId']; } @@ -65,7 +65,10 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit { */ createPrematureCloseAccountForm() { this.prematureCloseAccountForm = this.formBuilder.group({ - 'closedOnDate': ['', Validators.required] + closedOnDate: [ + '', + Validators.required + ] }); } @@ -92,17 +95,23 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit { dateFormat, locale }; - this.fixedDepositsService.executeFixedDepositsAccountCommand(this.accountId, 'calculatePrematureAmount', data) + this.fixedDepositsService + .executeFixedDepositsAccountCommand(this.accountId, 'calculatePrematureAmount', data) .subscribe((response: any) => { this.savingsAccountsData = response.savingsAccounts; this.onAccountClosureOptions = response.onAccountClosureOptions; - this.prematureCloseAccountForm.addControl('maturityAmount', new UntypedFormControl({ value: '', disabled: true })); - this.prematureCloseAccountForm.addControl('onAccountClosureId', new UntypedFormControl('', Validators.required)); + this.prematureCloseAccountForm.addControl( + 'maturityAmount', + new UntypedFormControl({ value: '', disabled: true }) + ); + this.prematureCloseAccountForm.addControl( + 'onAccountClosureId', + new UntypedFormControl('', Validators.required) + ); this.prematureCloseAccountForm.addControl('note', new UntypedFormControl('')); this.prematureCloseAccountForm.get('maturityAmount').patchValue(response.maturityAmount); this.addTransferDetails(); }); - } /** @@ -111,7 +120,10 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit { addTransferDetails() { this.prematureCloseAccountForm.get('onAccountClosureId').valueChanges.subscribe((id: any) => { if (id === 200) { - this.prematureCloseAccountForm.addControl('toSavingsAccountId', new UntypedFormControl('', Validators.required)); + this.prematureCloseAccountForm.addControl( + 'toSavingsAccountId', + new UntypedFormControl('', Validators.required) + ); this.prematureCloseAccountForm.addControl('transferDescription', new UntypedFormControl('')); } else { this.prematureCloseAccountForm.removeControl('toSavingsAccountId'); @@ -138,9 +150,10 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit { dateFormat, locale }; - this.fixedDepositsService.executeFixedDepositsAccountCommand(this.accountId, 'prematureClose', data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.fixedDepositsService + .executeFixedDepositsAccountCommand(this.accountId, 'prematureClose', data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/reject-fixed-deposits-account/reject-fixed-deposits-account.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/reject-fixed-deposits-account/reject-fixed-deposits-account.component.spec.ts index 2f207004c..9d4c027d0 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/reject-fixed-deposits-account/reject-fixed-deposits-account.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/reject-fixed-deposits-account/reject-fixed-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('RejectFixedDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RejectFixedDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [RejectFixedDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/reject-fixed-deposits-account/reject-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/reject-fixed-deposits-account/reject-fixed-deposits-account.component.ts index 12050200e..5ac1ff28a 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/reject-fixed-deposits-account/reject-fixed-deposits-account.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/reject-fixed-deposits-account/reject-fixed-deposits-account.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./reject-fixed-deposits-account.component.scss'] }) export class RejectFixedDepositsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class RejectFixedDepositsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private fixedDepositsService: FixedDepositsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private fixedDepositsService: FixedDepositsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId']; } @@ -57,8 +58,11 @@ export class RejectFixedDepositsAccountComponent implements OnInit { */ createRejectFixedDepositsAccountForm() { this.rejectFixedDepositsAccountForm = this.formBuilder.group({ - 'rejectedOnDate': ['', Validators.required], - 'note': [''] + rejectedOnDate: [ + '', + Validators.required + ], + note: [''] }); } @@ -83,5 +87,4 @@ export class RejectFixedDepositsAccountComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/undo-approval-fixed-deposits-account/undo-approval-fixed-deposits-account.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/undo-approval-fixed-deposits-account/undo-approval-fixed-deposits-account.component.spec.ts index d250797cb..936affb8a 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/undo-approval-fixed-deposits-account/undo-approval-fixed-deposits-account.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/undo-approval-fixed-deposits-account/undo-approval-fixed-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('UndoApprovalFixedDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UndoApprovalFixedDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [UndoApprovalFixedDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/undo-approval-fixed-deposits-account/undo-approval-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/undo-approval-fixed-deposits-account/undo-approval-fixed-deposits-account.component.ts index a70885b80..07ab23f0f 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/undo-approval-fixed-deposits-account/undo-approval-fixed-deposits-account.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/undo-approval-fixed-deposits-account/undo-approval-fixed-deposits-account.component.ts @@ -16,7 +16,6 @@ import { FixedDepositsService } from '../../fixed-deposits.service'; styleUrls: ['./undo-approval-fixed-deposits-account.component.scss'] }) export class UndoApprovalFixedDepositsAccountComponent implements OnInit { - /** Undo Approval Fixed Deposits Account form. */ undoApprovalFixedDepositsAccountForm: UntypedFormGroup; /** Fixed Deposits Account Id */ @@ -32,11 +31,13 @@ export class UndoApprovalFixedDepositsAccountComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private fixedDepositsService: FixedDepositsService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private fixedDepositsService: FixedDepositsService, + private route: ActivatedRoute, + private router: Router + ) { this.undoCommand = 'undoapproval'; // Default command this.undoAction = this.route.snapshot.params['name']; if (this.undoAction === 'Undo Activation') { @@ -57,7 +58,7 @@ export class UndoApprovalFixedDepositsAccountComponent implements OnInit { */ createUndoApprovalFixedDepositsAccountForm() { this.undoApprovalFixedDepositsAccountForm = this.formBuilder.group({ - 'note': [''] + note: [''] }); } @@ -67,17 +68,18 @@ export class UndoApprovalFixedDepositsAccountComponent implements OnInit { */ submit() { const data = { - ...this.undoApprovalFixedDepositsAccountForm.value, + ...this.undoApprovalFixedDepositsAccountForm.value }; if (this.undoAction === 'Undo Activation') { - this.fixedDepositsService.executeFixedDepositsAccountCommand(this.accountId, this.undoCommand, data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.fixedDepositsService + .executeFixedDepositsAccountCommand(this.accountId, this.undoCommand, data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } else { this.savingsService.executeSavingsAccountCommand(this.accountId, this.undoCommand, data).subscribe(() => { this.router.navigate(['../../'], { relativeTo: this.route }); }); } } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component.spec.ts index a244f6299..8457c309a 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component.spec.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('WithdrawByClientFixedDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WithdrawByClientFixedDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [WithdrawByClientFixedDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component.ts index 82b9d2de1..2a9395cba 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./withdraw-by-client-fixed-deposits-account.component.scss'] }) export class WithdrawByClientFixedDepositsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class WithdrawByClientFixedDepositsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private fixedDepositsService: FixedDepositsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private fixedDepositsService: FixedDepositsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId']; } @@ -57,8 +58,11 @@ export class WithdrawByClientFixedDepositsAccountComponent implements OnInit { */ createWithdrawFixedDepositsAccountForm() { this.withdrawFixedDepositsAccountForm = this.formBuilder.group({ - 'withdrawnOnDate': ['', Validators.required], - 'note': [''] + withdrawnOnDate: [ + '', + Validators.required + ], + note: [''] }); } @@ -79,9 +83,10 @@ export class WithdrawByClientFixedDepositsAccountComponent implements OnInit { dateFormat, locale }; - this.fixedDepositsService.executeFixedDepositsAccountCommand(this.accountId, 'withdrawnByApplicant', data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.fixedDepositsService + .executeFixedDepositsAccountCommand(this.accountId, 'withdrawnByApplicant', data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-routing.module.ts b/src/app/deposits/fixed-deposits/fixed-deposits-routing.module.ts index e306a8cc8..830db4968 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-routing.module.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-routing.module.ts @@ -41,7 +41,7 @@ const routes: Routes = [ path: ':fixedDepositAccountId', data: { title: 'Fixed Deposit Account View', routeParamBreadcrumb: 'fixedDepositAccountId' }, resolve: { - fixedDepositsAccountData: FixedDepositsAccountViewResolver, + fixedDepositsAccountData: FixedDepositsAccountViewResolver }, children: [ { @@ -60,17 +60,25 @@ const routes: Routes = [ { path: 'general', component: GeneralTabComponent, - data: { title: 'Fixed Deposit Account Details', breadcrumb: 'General', routeParamBreadcrumb: false }, + data: { title: 'Fixed Deposit Account Details', breadcrumb: 'General', routeParamBreadcrumb: false } }, { path: 'interest-rate-chart', component: InterestRateChartTabComponent, - data: { title: 'Fixed Deposit Account Interest Rate Chart', breadcrumb: 'Interest Rate Chart', routeParamBreadcrumb: false }, + data: { + title: 'Fixed Deposit Account Interest Rate Chart', + breadcrumb: 'Interest Rate Chart', + routeParamBreadcrumb: false + } }, { path: 'transactions', component: TransactionsTabComponent, - data: { title: 'Fixed Deposit Account Transactions', breadcrumb: 'Transactions', routeParamBreadcrumb: false }, + data: { + title: 'Fixed Deposit Account Transactions', + breadcrumb: 'Transactions', + routeParamBreadcrumb: false + } }, { path: 'charges', @@ -80,7 +88,11 @@ const routes: Routes = [ { path: 'standing-instructions', component: StandingInstructionsTabComponent, - data: { title: 'Fixed Deposit Account Standing Instructions', breadcrumb: 'Standing Instructions', routeParamBreadcrumb: false } + data: { + title: 'Fixed Deposit Account Standing Instructions', + breadcrumb: 'Standing Instructions', + routeParamBreadcrumb: false + } }, { path: 'datatables', @@ -107,15 +119,21 @@ const routes: Routes = [ }, { path: 'transactions', - data: { title: 'Fixed Deposits Account Transactions', breadcrumb: 'Transactions', routeParamBreadcrumb: false }, + data: { + title: 'Fixed Deposits Account Transactions', + breadcrumb: 'Transactions', + routeParamBreadcrumb: false + }, children: [ { path: '', - redirectTo: '../transactions', pathMatch: 'prefix' + redirectTo: '../transactions', + pathMatch: 'prefix' }, { path: 'account-transfers', - loadChildren: () => import('../../account-transfers/account-transfers.module').then(m => m.AccountTransfersModule) + loadChildren: () => + import('../../account-transfers/account-transfers.module').then((m) => m.AccountTransfersModule) }, { path: ':id', @@ -159,4 +177,4 @@ const routes: Routes = [ FixedDepositsAccountAndTemplateResolver ] }) -export class FixedDepositsRoutingModule { } +export class FixedDepositsRoutingModule {} diff --git a/src/app/deposits/fixed-deposits/fixed-deposits.module.ts b/src/app/deposits/fixed-deposits/fixed-deposits.module.ts index e443a442f..1ab9ffbce 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits.module.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits.module.ts @@ -85,6 +85,6 @@ import { FixedDepositsCashTransactionComponent } from './fixed-deposits-account- DirectivesModule, FixedDepositsRoutingModule ], - providers: [ ] + providers: [] }) -export class FixedDepositsModule { } +export class FixedDepositsModule {} diff --git a/src/app/deposits/fixed-deposits/fixed-deposits.service.ts b/src/app/deposits/fixed-deposits/fixed-deposits.service.ts index d2edd1680..54dfe24ed 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits.service.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits.service.ts @@ -12,7 +12,6 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class FixedDepositsService { - /** * @param {HttpClient} http HttpClient */ @@ -62,9 +61,16 @@ export class FixedDepositsService { * @param {string} transactionId Transaction Id * @returns {Observable} */ - executeFixedDepositsAccountTransactionsCommand(accountId: string, command: string, data: any, transactionId?: any): Observable { + executeFixedDepositsAccountTransactionsCommand( + accountId: string, + command: string, + data: any, + transactionId?: any + ): Observable { const httpParams = new HttpParams().set('command', command); - return this.http.post(`/fixeddepositaccounts/${accountId}/transactions/${transactionId}`, data, { params: httpParams }); + return this.http.post(`/fixeddepositaccounts/${accountId}/transactions/${transactionId}`, data, { + params: httpParams + }); } /** @@ -99,8 +105,7 @@ export class FixedDepositsService { * @returns {Observable} */ getFixedDepositsAccountAndTemplate(accountId: any) { - const httpParams = new HttpParams().set('associations', 'charges,+linkedAccount') - .set('template', 'true'); + const httpParams = new HttpParams().set('associations', 'charges,+linkedAccount').set('template', 'true'); return this.http.get(`/fixeddepositaccounts/${accountId}`, { params: httpParams }); } @@ -130,8 +135,12 @@ export class FixedDepositsService { * @returns {Observable} Standing Instructions */ getStandingInstructions( - clientId: string, clientName: string, fromAccountId: string, - locale: string, dateFormat: string): Observable { + clientId: string, + clientName: string, + fromAccountId: string, + locale: string, + dateFormat: string + ): Observable { const httpParams = new HttpParams() .set('clientId', clientId) .set('clientName', clientName) @@ -141,5 +150,4 @@ export class FixedDepositsService { .set('dateFormat', dateFormat); return this.http.get(`/standinginstructions`, { params: httpParams }); } - } diff --git a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-actions.resolver.ts b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-actions.resolver.ts index 4b4db8e82..32a59d0c3 100644 --- a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-actions.resolver.ts +++ b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-actions.resolver.ts @@ -14,13 +14,14 @@ import { RecurringDepositsService } from '../recurring-deposits.service'; */ @Injectable() export class RecurringDepositsAccountActionsResolver implements Resolve { - /** * @param {SavingsService} SavingsService Savings service. * @param {RecurringDepositsService} recurringDepositsService Recurring Deposits Service. */ - constructor(private savingsService: SavingsService, - private recurringDepositsService: RecurringDepositsService) { } + constructor( + private savingsService: SavingsService, + private recurringDepositsService: RecurringDepositsService + ) {} /** * Returns the Recurring deposits account actions data. @@ -29,18 +30,24 @@ export class RecurringDepositsAccountActionsResolver implements Resolve */ resolve(route: ActivatedRouteSnapshot): Observable { const actionName: string = route.paramMap.get('name'); - const recurringDepositAccountId = route.paramMap.get('recurringDepositAccountId') || route.parent.parent.paramMap.get('recurringDepositAccountId'); + const recurringDepositAccountId = + route.paramMap.get('recurringDepositAccountId') || route.parent.parent.paramMap.get('recurringDepositAccountId'); switch (actionName) { case 'Add Charge': return this.savingsService.getSavingsChargeTemplateResource(recurringDepositAccountId); case 'Close': - return this.recurringDepositsService.getRecurringDepositAccountActionResource(recurringDepositAccountId, 'close'); + return this.recurringDepositsService.getRecurringDepositAccountActionResource( + recurringDepositAccountId, + 'close' + ); case 'Deposit': case 'Withdrawal': - return this.recurringDepositsService.getRecurringDepositAccountTransactionTemplateResource(recurringDepositAccountId, actionName.toLocaleLowerCase()); + return this.recurringDepositsService.getRecurringDepositAccountTransactionTemplateResource( + recurringDepositAccountId, + actionName.toLocaleLowerCase() + ); default: return undefined; } } - } diff --git a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-and-template.resolver.ts b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-and-template.resolver.ts index 6e42f6895..4411929d8 100644 --- a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-and-template.resolver.ts +++ b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-and-template.resolver.ts @@ -13,20 +13,18 @@ import { RecurringDepositsService } from '../recurring-deposits.service'; */ @Injectable() export class RecurringDepositsAccountAndTemplateResolver implements Resolve { + /** + * @param {RecurringDepositsService} recurringDepositsService Recurring Deposits service. + */ + constructor(private recurringDepositsService: RecurringDepositsService) {} - /** - * @param {RecurringDepositsService} recurringDepositsService Recurring Deposits service. - */ - constructor(private recurringDepositsService: RecurringDepositsService) { } - - /** - * Returns the Recurring Deposits Account Template. - * @param {ActivatedRouteSnapshot} route Route Snapshot - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const recurringDepositAccountId = route.paramMap.get('recurringDepositAccountId'); - return this.recurringDepositsService.getRecurringDepositsAccountAndTemplate(recurringDepositAccountId); - } - + /** + * Returns the Recurring Deposits Account Template. + * @param {ActivatedRouteSnapshot} route Route Snapshot + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const recurringDepositAccountId = route.paramMap.get('recurringDepositAccountId'); + return this.recurringDepositsService.getRecurringDepositsAccountAndTemplate(recurringDepositAccountId); + } } diff --git a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-transaction-template.resolver.ts b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-transaction-template.resolver.ts index 4edd8434e..a28b8a1da 100644 --- a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-transaction-template.resolver.ts +++ b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-transaction-template.resolver.ts @@ -13,21 +13,22 @@ import { RecurringDepositsService } from '../recurring-deposits.service'; */ @Injectable() export class RecurringDepositsAccountTransactionTemplateResolver implements Resolve { + /** + * @param {RecurringDepositsService} recurringDepositsService Recurring Deposits service. + */ + constructor(private recurringDepositsService: RecurringDepositsService) {} - /** - * @param {RecurringDepositsService} recurringDepositsService Recurring Deposits service. - */ - constructor(private recurringDepositsService: RecurringDepositsService) { } - - /** - * Returns the Recurring Deposits Account Transaction data. - * @param {ActivatedRouteSnapshot} route Route Snapshot - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const recurringDepositAccountId = route.parent.paramMap.get('recurringDepositAccountId'); - const transactionId = route.paramMap.get('id'); - return this.recurringDepositsService.getRecurringDepositsAccountTransactionTemplate(recurringDepositAccountId, transactionId); - } - + /** + * Returns the Recurring Deposits Account Transaction data. + * @param {ActivatedRouteSnapshot} route Route Snapshot + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const recurringDepositAccountId = route.parent.paramMap.get('recurringDepositAccountId'); + const transactionId = route.paramMap.get('id'); + return this.recurringDepositsService.getRecurringDepositsAccountTransactionTemplate( + recurringDepositAccountId, + transactionId + ); + } } diff --git a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-transaction.resolver.ts b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-transaction.resolver.ts index d96337c8b..10855ecfc 100644 --- a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-transaction.resolver.ts +++ b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposit-account-transaction.resolver.ts @@ -13,21 +13,22 @@ import { RecurringDepositsService } from '../recurring-deposits.service'; */ @Injectable() export class RecurringDepositsAccountTransactionResolver implements Resolve { + /** + * @param {RecurringDepositsService} recurringDepositsService Recurring Deposits service. + */ + constructor(private recurringDepositsService: RecurringDepositsService) {} - /** - * @param {RecurringDepositsService} recurringDepositsService Recurring Deposits service. - */ - constructor(private recurringDepositsService: RecurringDepositsService) { } - - /** - * Returns the Recurring Deposits Account Transaction data. - * @param {ActivatedRouteSnapshot} route Route Snapshot - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const recurringDepositAccountId = route.parent.paramMap.get('recurringDepositAccountId'); - const transactionId = route.paramMap.get('id'); - return this.recurringDepositsService.getRecurringDepositsAccountTransaction(recurringDepositAccountId, transactionId); - } - + /** + * Returns the Recurring Deposits Account Transaction data. + * @param {ActivatedRouteSnapshot} route Route Snapshot + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const recurringDepositAccountId = route.parent.paramMap.get('recurringDepositAccountId'); + const transactionId = route.paramMap.get('id'); + return this.recurringDepositsService.getRecurringDepositsAccountTransaction( + recurringDepositAccountId, + transactionId + ); + } } diff --git a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposits-account-data.resolver.ts b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposits-account-data.resolver.ts index 95d3290fc..8a288b126 100644 --- a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposits-account-data.resolver.ts +++ b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposits-account-data.resolver.ts @@ -13,11 +13,10 @@ import { RecurringDepositsService } from '../recurring-deposits.service'; */ @Injectable() export class RecurringDepositsAccountDataResolver implements Resolve { - /** * @param {RecurringDepositsService} RecurringDepositsService RecurringDeposits service. */ - constructor(private recurringDepositsService: RecurringDepositsService) { } + constructor(private recurringDepositsService: RecurringDepositsService) {} /** * Returns the RecurringDeposits Account data. @@ -28,5 +27,4 @@ export class RecurringDepositsAccountDataResolver implements Resolve { const recurringDepositAccountId = route.parent.paramMap.get('recurringDepositAccountId'); return this.recurringDepositsService.getRecurringDepositsAccountData(recurringDepositAccountId); } - } diff --git a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposits-account-template.resolver.ts b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposits-account-template.resolver.ts index 93d64ccb4..9c8666e78 100644 --- a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposits-account-template.resolver.ts +++ b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposits-account-template.resolver.ts @@ -13,11 +13,10 @@ import { RecurringDepositsService } from '../recurring-deposits.service'; */ @Injectable() export class RecurringDepositsAccountTemplateResolver implements Resolve { - /** * @param {recurringDepositsService} RecurringDepositsService Savings service. */ - constructor(private recurringDepositsService: RecurringDepositsService) { } + constructor(private recurringDepositsService: RecurringDepositsService) {} /** * Returns the Shares Account Template. @@ -28,5 +27,4 @@ export class RecurringDepositsAccountTemplateResolver implements Resolve const clientId = route.parent.parent.paramMap.get('clientId'); return this.recurringDepositsService.getRecurringDepositsAccountTemplate(clientId); } - } diff --git a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposits-account-view.resolver.ts b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposits-account-view.resolver.ts index b564eb244..b34ba2aac 100644 --- a/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposits-account-view.resolver.ts +++ b/src/app/deposits/recurring-deposits/common-resolvers/recurring-deposits-account-view.resolver.ts @@ -13,11 +13,10 @@ import { RecurringDepositsService } from '../recurring-deposits.service'; */ @Injectable() export class RecurringDepositsAccountViewResolver implements Resolve { - /** * @param {RecurringDepositsService} RecurringDepositsService RecurringDeposits service. */ - constructor(private recurringDepositsService: RecurringDepositsService) { } + constructor(private recurringDepositsService: RecurringDepositsService) {} /** * Returns the RecurringDeposits Account data. @@ -28,5 +27,4 @@ export class RecurringDepositsAccountViewResolver implements Resolve { const recurringDepositAccountId = route.paramMap.get('recurringDepositAccountId'); return this.recurringDepositsService.getRecurringDepositsAccountData(recurringDepositAccountId); } - } diff --git a/src/app/deposits/recurring-deposits/create-recurring-deposits-account/create-recurring-deposits-account.component.spec.ts b/src/app/deposits/recurring-deposits/create-recurring-deposits-account/create-recurring-deposits-account.component.spec.ts index 7a0ffc60f..f3919761f 100644 --- a/src/app/deposits/recurring-deposits/create-recurring-deposits-account/create-recurring-deposits-account.component.spec.ts +++ b/src/app/deposits/recurring-deposits/create-recurring-deposits-account/create-recurring-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateRecurringDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateRecurringDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [CreateRecurringDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/create-recurring-deposits-account/create-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/create-recurring-deposits-account/create-recurring-deposits-account.component.ts index b1f5f043e..142f090c1 100644 --- a/src/app/deposits/recurring-deposits/create-recurring-deposits-account/create-recurring-deposits-account.component.ts +++ b/src/app/deposits/recurring-deposits/create-recurring-deposits-account/create-recurring-deposits-account.component.ts @@ -22,23 +22,27 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-recurring-deposits-account.component.scss'] }) export class CreateRecurringDepositsAccountComponent { - /** Imports all the step component */ - @ViewChild(RecurringDepositsAccountDetailsStepComponent, { static: true }) recurringDepositsAccountDetailsStep: RecurringDepositsAccountDetailsStepComponent; - @ViewChild(RecurringDepositsAccountTermsStepComponent, { static: true }) recurringDepositAccountTermsStep: RecurringDepositsAccountTermsStepComponent; - @ViewChild(RecurringDepositsAccountSettingsStepComponent, { static: true }) recurringDepositAccountSettingsStep: RecurringDepositsAccountSettingsStepComponent; - @ViewChild(RecurringDepositsAccountChargesStepComponent, { static: true }) recurringDepositAccountChargesStep: RecurringDepositsAccountChargesStepComponent; + @ViewChild(RecurringDepositsAccountDetailsStepComponent, { static: true }) + recurringDepositsAccountDetailsStep: RecurringDepositsAccountDetailsStepComponent; + @ViewChild(RecurringDepositsAccountTermsStepComponent, { static: true }) + recurringDepositAccountTermsStep: RecurringDepositsAccountTermsStepComponent; + @ViewChild(RecurringDepositsAccountSettingsStepComponent, { static: true }) + recurringDepositAccountSettingsStep: RecurringDepositsAccountSettingsStepComponent; + @ViewChild(RecurringDepositsAccountChargesStepComponent, { static: true }) + recurringDepositAccountChargesStep: RecurringDepositsAccountChargesStepComponent; /** Recurring Deposits Account Template */ recurringDepositsAccountTemplate: any; /** Recurring Deposit Account Product Template */ recurringDepositsAccountProductTemplate: any; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private dateUtils: Dates, private recurringDepositsService: RecurringDepositsService, - private settingsService: SettingsService, + private settingsService: SettingsService ) { this.route.data.subscribe((data: { recurringDepositsAccountTemplate: any }) => { this.recurringDepositsAccountTemplate = data.recurringDepositsAccountTemplate; @@ -83,18 +87,17 @@ export class CreateRecurringDepositsAccountComponent { ...this.recurringDepositsAccountDetailsStep.recurringDepositAccountDetails, ...this.recurringDepositAccountTermsStep.recurringDepositAccountTerms, ...this.recurringDepositAccountSettingsStep.recurringDepositAccountSettings, - ...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges, + ...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges }; } - /** Retrieves Data of all forms except Currency to submit the data */ get recurringDepositAccount() { return { ...this.recurringDepositsAccountDetailsStep.recurringDepositAccountDetails, ...this.recurringDepositAccountTermsStep.recurringDepositAccountTerms, ...this.recurringDepositAccountSettingsStep.recurringDepositAccountSettings, - ...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges, + ...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges }; } @@ -115,16 +118,27 @@ export class CreateRecurringDepositsAccountComponent { feeOnMonthDay: charge.feeOnMonthDay, feeInterval: charge.feeInterval })), - isCalendarInherited: this.recurringDepositAccount.recurringDepositAccount ? this.recurringDepositAccount.recurringDepositAccount : false, + isCalendarInherited: this.recurringDepositAccount.recurringDepositAccount + ? this.recurringDepositAccount.recurringDepositAccount + : false, submittedOnDate: this.dateUtils.formatDate(this.recurringDepositAccount.submittedOnDate, dateFormat), - expectedFirstDepositOnDate: this.dateUtils.formatDate(this.recurringDepositAccount.expectedFirstDepositOnDate, dateFormat), + expectedFirstDepositOnDate: this.dateUtils.formatDate( + this.recurringDepositAccount.expectedFirstDepositOnDate, + dateFormat + ), dateFormat, monthDayFormat, locale }; this.recurringDepositsService.createRecurringDepositAccount(recurringDepositAccount).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } } diff --git a/src/app/deposits/recurring-deposits/edit-recurring-deposit-account/edit-recurring-deposit-account.component.spec.ts b/src/app/deposits/recurring-deposits/edit-recurring-deposit-account/edit-recurring-deposit-account.component.spec.ts index 459a54b3c..8ae241d43 100644 --- a/src/app/deposits/recurring-deposits/edit-recurring-deposit-account/edit-recurring-deposit-account.component.spec.ts +++ b/src/app/deposits/recurring-deposits/edit-recurring-deposit-account/edit-recurring-deposit-account.component.spec.ts @@ -8,9 +8,8 @@ describe('EditRecurringDepositAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditRecurringDepositAccountComponent ] - }) - .compileComponents(); + declarations: [EditRecurringDepositAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/edit-recurring-deposit-account/edit-recurring-deposit-account.component.ts b/src/app/deposits/recurring-deposits/edit-recurring-deposit-account/edit-recurring-deposit-account.component.ts index b66660d49..8be4803b7 100644 --- a/src/app/deposits/recurring-deposits/edit-recurring-deposit-account/edit-recurring-deposit-account.component.ts +++ b/src/app/deposits/recurring-deposits/edit-recurring-deposit-account/edit-recurring-deposit-account.component.ts @@ -22,23 +22,27 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./edit-recurring-deposit-account.component.scss'] }) export class EditRecurringDepositAccountComponent { - /** Imports all the step component */ - @ViewChild(RecurringDepositsAccountDetailsStepComponent, { static: true }) recurringDepositsAccountDetailsStep: RecurringDepositsAccountDetailsStepComponent; - @ViewChild(RecurringDepositsAccountTermsStepComponent, { static: true }) recurringDepositAccountTermsStep: RecurringDepositsAccountTermsStepComponent; - @ViewChild(RecurringDepositsAccountSettingsStepComponent, { static: true }) recurringDepositAccountSettingsStep: RecurringDepositsAccountSettingsStepComponent; - @ViewChild(RecurringDepositsAccountChargesStepComponent, { static: true }) recurringDepositAccountChargesStep: RecurringDepositsAccountChargesStepComponent; + @ViewChild(RecurringDepositsAccountDetailsStepComponent, { static: true }) + recurringDepositsAccountDetailsStep: RecurringDepositsAccountDetailsStepComponent; + @ViewChild(RecurringDepositsAccountTermsStepComponent, { static: true }) + recurringDepositAccountTermsStep: RecurringDepositsAccountTermsStepComponent; + @ViewChild(RecurringDepositsAccountSettingsStepComponent, { static: true }) + recurringDepositAccountSettingsStep: RecurringDepositsAccountSettingsStepComponent; + @ViewChild(RecurringDepositsAccountChargesStepComponent, { static: true }) + recurringDepositAccountChargesStep: RecurringDepositsAccountChargesStepComponent; /** Recurring Deposits Account And Template */ recurringDepositsAccountAndTemplate: any; /** Recurring Deposit Account Product Template */ recurringDepositsAccountProductTemplate: any; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private dateUtils: Dates, private recurringDepositsService: RecurringDepositsService, - private settingsService: SettingsService, + private settingsService: SettingsService ) { this.route.data.subscribe((data: { recurringDepositsAccountAndTemplate: any }) => { this.recurringDepositsAccountAndTemplate = data.recurringDepositsAccountAndTemplate; @@ -74,12 +78,10 @@ export class EditRecurringDepositAccountComponent { this.recurringDepositAccountDetailsForm.valid && this.recurringDepositAccountTermsForm.valid && this.recurringDepositAccountSettingsForm.valid && - ( - !this.recurringDepositAccountDetailsForm.pristine || + (!this.recurringDepositAccountDetailsForm.pristine || !this.recurringDepositAccountTermsForm.pristine || !this.recurringDepositAccountSettingsForm.pristine || - !this.recurringDepositAccountChargesStep.pristine - ) + !this.recurringDepositAccountChargesStep.pristine) ); } @@ -89,18 +91,17 @@ export class EditRecurringDepositAccountComponent { ...this.recurringDepositsAccountDetailsStep.recurringDepositAccountDetails, ...this.recurringDepositAccountTermsStep.recurringDepositAccountTerms, ...this.recurringDepositAccountSettingsStep.recurringDepositAccountSettings, - ...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges, + ...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges }; } - /** Retrieves Data of all forms except Currency to submit the data */ get recurringDepositAccount() { return { ...this.recurringDepositsAccountDetailsStep.recurringDepositAccountDetails, ...this.recurringDepositAccountTermsStep.recurringDepositAccountTerms, ...this.recurringDepositAccountSettingsStep.recurringDepositAccountSettings, - ...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges, + ...this.recurringDepositAccountChargesStep.recurringDepositAccountCharges }; } @@ -121,17 +122,23 @@ export class EditRecurringDepositAccountComponent { feeOnMonthDay: charge.feeOnMonthDay, feeInterval: charge.feeInterval })), - isCalendarInherited: this.recurringDepositAccount.recurringDepositAccount ? this.recurringDepositAccount.recurringDepositAccount : false, + isCalendarInherited: this.recurringDepositAccount.recurringDepositAccount + ? this.recurringDepositAccount.recurringDepositAccount + : false, submittedOnDate: this.dateUtils.formatDate(this.recurringDepositAccount.submittedOnDate, dateFormat), - expectedFirstDepositOnDate: this.dateUtils.formatDate(this.recurringDepositAccount.expectedFirstDepositOnDate, dateFormat), + expectedFirstDepositOnDate: this.dateUtils.formatDate( + this.recurringDepositAccount.expectedFirstDepositOnDate, + dateFormat + ), dateFormat, monthDayFormat, locale }; - this.recurringDepositsService.updateRecurringDepositAccount(this.recurringDepositsAccountAndTemplate.id, recurringDepositAccount).subscribe((response: any) => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.recurringDepositsService + .updateRecurringDepositAccount(this.recurringDepositsAccountAndTemplate.id, recurringDepositAccount) + .subscribe((response: any) => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/activate-recurring-deposits-account/activate-recurring-deposits-account.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/activate-recurring-deposits-account/activate-recurring-deposits-account.component.spec.ts index ce0149bb0..da8b13093 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/activate-recurring-deposits-account/activate-recurring-deposits-account.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/activate-recurring-deposits-account/activate-recurring-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('ActivateRecurringDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ActivateRecurringDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [ActivateRecurringDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/activate-recurring-deposits-account/activate-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/activate-recurring-deposits-account/activate-recurring-deposits-account.component.ts index ed8336e5a..7c0369fe6 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/activate-recurring-deposits-account/activate-recurring-deposits-account.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/activate-recurring-deposits-account/activate-recurring-deposits-account.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./activate-recurring-deposits-account.component.scss'] }) export class ActivateRecurringDepositsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class ActivateRecurringDepositsAccountComponent implements OnInit { * @param {Router} router Router * @param {SavingsService} savingsService Savings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private recurringDepositsService: RecurringDepositsService, private dateUtils: Dates, private route: ActivatedRoute, private router: Router, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.accountId = this.route.parent.snapshot.params['recurringDepositAccountId']; } @@ -57,7 +58,10 @@ export class ActivateRecurringDepositsAccountComponent implements OnInit { */ createActivateRecurringDepositsAccountForm() { this.activateRecurringDepositsAccountForm = this.formBuilder.group({ - 'activatedOnDate': ['', Validators.required] + activatedOnDate: [ + '', + Validators.required + ] }); } @@ -71,15 +75,20 @@ export class ActivateRecurringDepositsAccountComponent implements OnInit { const dateFormat = this.settingsService.dateFormat; const prevActivatedOnDate: Date = this.activateRecurringDepositsAccountForm.value.activatedOnDate; if (activateRecurringDepositsAccountFormData.activatedOnDate instanceof Date) { - activateRecurringDepositsAccountFormData.activatedOnDate = this.dateUtils.formatDate(prevActivatedOnDate, dateFormat); + activateRecurringDepositsAccountFormData.activatedOnDate = this.dateUtils.formatDate( + prevActivatedOnDate, + dateFormat + ); } const data = { ...activateRecurringDepositsAccountFormData, dateFormat, locale }; - this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'activate', data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.recurringDepositsService + .executeRecurringDepositsAccountCommand(this.accountId, 'activate', data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/add-charge-recurring-deposits-account/add-charge-recurring-deposits-account.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/add-charge-recurring-deposits-account/add-charge-recurring-deposits-account.component.spec.ts index 610b8f2c1..8aab61b65 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/add-charge-recurring-deposits-account/add-charge-recurring-deposits-account.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/add-charge-recurring-deposits-account/add-charge-recurring-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('AddChargeRecurringDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AddChargeRecurringDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [AddChargeRecurringDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/add-charge-recurring-deposits-account/add-charge-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/add-charge-recurring-deposits-account/add-charge-recurring-deposits-account.component.ts index 1e2f2e979..e705eae42 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/add-charge-recurring-deposits-account/add-charge-recurring-deposits-account.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/add-charge-recurring-deposits-account/add-charge-recurring-deposits-account.component.ts @@ -18,7 +18,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./add-charge-recurring-deposits-account.component.scss'] }) export class AddChargeRecurringDepositsAccountComponent implements OnInit { - /** Minimum Due Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Due Date allowed. */ @@ -64,7 +63,7 @@ export class AddChargeRecurringDepositsAccountComponent implements OnInit { } buildDependencies() { - this.recurringDepositsChargeForm.controls.chargeId.valueChanges.subscribe(chargeId => { + this.recurringDepositsChargeForm.controls.chargeId.valueChanges.subscribe((chargeId) => { this.savingsService.getChargeTemplate(chargeId).subscribe((data: any) => { this.chargeDetails = data; const chargeTimeType = data.chargeTimeType.id; @@ -85,14 +84,17 @@ export class AddChargeRecurringDepositsAccountComponent implements OnInit { this.recurringDepositsChargeForm.removeControl('feeOnMonthDay'); } if (chargeTimeType.value === 'Monthly Fee') { - this.recurringDepositsChargeForm.addControl('feeInterval', new UntypedFormControl(data.feeInterval, Validators.required)); + this.recurringDepositsChargeForm.addControl( + 'feeInterval', + new UntypedFormControl(data.feeInterval, Validators.required) + ); } else { this.recurringDepositsChargeForm.removeControl('feeInterval'); } this.recurringDepositsChargeForm.patchValue({ - 'amount': data.amount, - 'chargeCalculationType': data.chargeCalculationType.id, - 'chargeTimeType': data.chargeTimeType.id + amount: data.amount, + chargeCalculationType: data.chargeCalculationType.id, + chargeTimeType: data.chargeTimeType.id }); }); }); @@ -103,10 +105,16 @@ export class AddChargeRecurringDepositsAccountComponent implements OnInit { */ createRecurringDepositsChargeForm() { this.recurringDepositsChargeForm = this.formBuilder.group({ - 'chargeId': ['', Validators.required], - 'amount': ['', Validators.required], - 'chargeCalculationType': [{ value: '', disabled: true }], - 'chargeTimeType': [{ value: '', disabled: true }] + chargeId: [ + '', + Validators.required + ], + amount: [ + '', + Validators.required + ], + chargeCalculationType: [{ value: '', disabled: true }], + chargeTimeType: [{ value: '', disabled: true }] }); } @@ -140,5 +148,4 @@ export class AddChargeRecurringDepositsAccountComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.spec.ts index 7dd81b82d..26d8744a7 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('ApproveRecurringDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ApproveRecurringDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [ApproveRecurringDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.ts index fd035ac96..3647a5bbd 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./approve-recurring-deposits-account.component.scss'] }) export class ApproveRecurringDepositsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class ApproveRecurringDepositsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private recurringDepositsService: RecurringDepositsService, private dateUtils: Dates, private route: ActivatedRoute, private router: Router, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.accountId = this.route.parent.snapshot.params['recurringDepositAccountId']; } @@ -57,8 +58,11 @@ export class ApproveRecurringDepositsAccountComponent implements OnInit { */ createApproveRecurringDepositsAccountForm() { this.approveRecurringDepositsAccountForm = this.formBuilder.group({ - 'approvedOnDate': ['', Validators.required], - 'note': [''] + approvedOnDate: [ + '', + Validators.required + ], + note: [''] }); } @@ -72,16 +76,20 @@ export class ApproveRecurringDepositsAccountComponent implements OnInit { const dateFormat = this.settingsService.dateFormat; const prevApprovedOnDate: Date = this.approveRecurringDepositsAccountForm.value.approvedOnDate; if (approveRecurringDepositsAccountFormData.approvedOnDate instanceof Date) { - approveRecurringDepositsAccountFormData.approvedOnDate = this.dateUtils.formatDate(prevApprovedOnDate, dateFormat); + approveRecurringDepositsAccountFormData.approvedOnDate = this.dateUtils.formatDate( + prevApprovedOnDate, + dateFormat + ); } const data = { ...approveRecurringDepositsAccountFormData, dateFormat, locale }; - this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'approve', data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.recurringDepositsService + .executeRecurringDepositsAccountCommand(this.accountId, 'approve', data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/close-recurring-deposits-account/close-recurring-deposits-account.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/close-recurring-deposits-account/close-recurring-deposits-account.component.spec.ts index f66183da7..a001ca23e 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/close-recurring-deposits-account/close-recurring-deposits-account.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/close-recurring-deposits-account/close-recurring-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('CloseRecurringDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CloseRecurringDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [CloseRecurringDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/close-recurring-deposits-account/close-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/close-recurring-deposits-account/close-recurring-deposits-account.component.ts index c5974b0fc..bc0b95d9b 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/close-recurring-deposits-account/close-recurring-deposits-account.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/close-recurring-deposits-account/close-recurring-deposits-account.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./close-recurring-deposits-account.component.scss'] }) export class CloseRecurringDepositsAccountComponent implements OnInit { - /** Maturity Amount */ maturityAmount: any; /** On Account Closure Options */ @@ -76,16 +75,25 @@ export class CloseRecurringDepositsAccountComponent implements OnInit { */ createcloseRecurringDepositForm() { this.closeRecurringDepositForm = this.formBuilder.group({ - 'closedOnDate': [new Date(), Validators.required], - 'maturityAmount': [{ value: this.maturityAmount, disabled: true}], - 'onAccountClosureId': ['', Validators.required], - 'paymentTypeId': ['', Validators.required], - 'accountNumber': '', - 'chequeNumber': '', - 'routingCode': '', - 'receiptNumber': '', - 'bankNumber': '', - 'note': '' + closedOnDate: [ + new Date(), + Validators.required + ], + maturityAmount: [{ value: this.maturityAmount, disabled: true }], + onAccountClosureId: [ + '', + Validators.required + ], + paymentTypeId: [ + '', + Validators.required + ], + accountNumber: '', + chequeNumber: '', + routingCode: '', + receiptNumber: '', + bankNumber: '', + note: '' }); } @@ -93,7 +101,7 @@ export class CloseRecurringDepositsAccountComponent implements OnInit { * Toggles the display of payment details */ toggleDisplay() { - this.showPaymentDetails = !(this.showPaymentDetails); + this.showPaymentDetails = !this.showPaymentDetails; } /** @@ -112,9 +120,10 @@ export class CloseRecurringDepositsAccountComponent implements OnInit { dateFormat, locale }; - this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'close', data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.recurringDepositsService + .executeRecurringDepositsAccountCommand(this.accountId, 'close', data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/deposit-recurring-deposits-account/deposit-recurring-deposits-account.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/deposit-recurring-deposits-account/deposit-recurring-deposits-account.component.spec.ts index f9ce37f41..378f6f41f 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/deposit-recurring-deposits-account/deposit-recurring-deposits-account.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/deposit-recurring-deposits-account/deposit-recurring-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('DepositRecurringDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DepositRecurringDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [DepositRecurringDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/deposit-recurring-deposits-account/deposit-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/deposit-recurring-deposits-account/deposit-recurring-deposits-account.component.ts index 151c0aa93..a075f655c 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/deposit-recurring-deposits-account/deposit-recurring-deposits-account.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/deposit-recurring-deposits-account/deposit-recurring-deposits-account.component.ts @@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./deposit-recurring-deposits-account.component.scss'] }) export class DepositRecurringDepositsAccountComponent implements OnInit { - @Input() currency: Currency; /** Transactions Amount */ @@ -41,7 +40,7 @@ export class DepositRecurringDepositsAccountComponent implements OnInit { action: string; actionName: string; transactionCommand: string; - transactionType: { deposit: boolean, withdrawal: boolean } = { deposit: false, withdrawal: false }; + transactionType: { deposit: boolean; withdrawal: boolean } = { deposit: false, withdrawal: false }; /** * Retrieves action details transactions template data from `resolve` @@ -62,7 +61,10 @@ export class DepositRecurringDepositsAccountComponent implements OnInit { this.route.data.subscribe((data: { recurringDepositsAccountActionData: any }) => { this.transactionAmount = data.recurringDepositsAccountActionData.amount; this.paymentTypes = data.recurringDepositsAccountActionData.paymentTypeOptions; - if (data.recurringDepositsAccountActionData.outstandingChargeAmount && data.recurringDepositsAccountActionData.outstandingChargeAmount > 0) { + if ( + data.recurringDepositsAccountActionData.outstandingChargeAmount && + data.recurringDepositsAccountActionData.outstandingChargeAmount > 0 + ) { this.outstandingChargeAmount = data.recurringDepositsAccountActionData.outstandingChargeAmount; this.transactionAmount = this.transactionAmount + this.outstandingChargeAmount; } @@ -84,10 +86,19 @@ export class DepositRecurringDepositsAccountComponent implements OnInit { */ createdepositRecurringDepositForm() { this.depositRecurringDepositForm = this.formBuilder.group({ - 'transactionDate': [new Date(), Validators.required], - 'transactionAmount': [0.0, Validators.required], - 'paymentTypeId': ['', Validators.required], - 'note': '' + transactionDate: [ + new Date(), + Validators.required + ], + transactionAmount: [ + 0.0, + Validators.required + ], + paymentTypeId: [ + '', + Validators.required + ], + note: '' }); } @@ -115,7 +126,7 @@ export class DepositRecurringDepositsAccountComponent implements OnInit { * Toggles the display of payment details */ toggleDisplay() { - this.showPaymentDetails = !(this.showPaymentDetails); + this.showPaymentDetails = !this.showPaymentDetails; } /** @@ -137,9 +148,10 @@ export class DepositRecurringDepositsAccountComponent implements OnInit { delete data['note']; data['transactionAmount'] = data['transactionAmount'] * 1; - this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, this.action, data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.recurringDepositsService + .executeRecurringDepositsAccountCommand(this.accountId, this.action, data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/premature-close-recurring-deposit-account/premature-close-recurring-deposit-account.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/premature-close-recurring-deposit-account/premature-close-recurring-deposit-account.component.spec.ts index 956370a47..eeda816ea 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/premature-close-recurring-deposit-account/premature-close-recurring-deposit-account.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/premature-close-recurring-deposit-account/premature-close-recurring-deposit-account.component.spec.ts @@ -8,9 +8,8 @@ describe('PrematureCloseRecurringDepositAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PrematureCloseRecurringDepositAccountComponent ] - }) - .compileComponents(); + declarations: [PrematureCloseRecurringDepositAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/premature-close-recurring-deposit-account/premature-close-recurring-deposit-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/premature-close-recurring-deposit-account/premature-close-recurring-deposit-account.component.ts index d389f8aad..1cef0040c 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/premature-close-recurring-deposit-account/premature-close-recurring-deposit-account.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/premature-close-recurring-deposit-account/premature-close-recurring-deposit-account.component.ts @@ -18,7 +18,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./premature-close-recurring-deposit-account.component.scss'] }) export class PrematureCloseRecurringDepositAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -36,12 +35,14 @@ export class PrematureCloseRecurringDepositAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private recurringDepositsService: RecurringDepositsService, private dateUtils: Dates, private route: ActivatedRoute, private router: Router, - private settingsService: SettingsService, ) { + private settingsService: SettingsService + ) { this.accountId = this.route.parent.snapshot.params['recurringDepositAccountId']; } @@ -58,7 +59,10 @@ export class PrematureCloseRecurringDepositAccountComponent implements OnInit { */ createprematureCloseRecurringDepositsAccountForm() { this.prematureCloseRecurringDepositsAccountForm = this.formBuilder.group({ - 'closedOnDate': ['', Validators.required] + closedOnDate: [ + '', + Validators.required + ] }); } @@ -72,16 +76,20 @@ export class PrematureCloseRecurringDepositAccountComponent implements OnInit { const dateFormat = this.settingsService.dateFormat; const prevClosedOnDate: Date = this.prematureCloseRecurringDepositsAccountForm.value.closedOnDate; if (prematureCloseRecurringDepositsAccountFormData.closedOnDate instanceof Date) { - prematureCloseRecurringDepositsAccountFormData.closedOnDate = this.dateUtils.formatDate(prevClosedOnDate, dateFormat); + prematureCloseRecurringDepositsAccountFormData.closedOnDate = this.dateUtils.formatDate( + prevClosedOnDate, + dateFormat + ); } const data = { ...prematureCloseRecurringDepositsAccountFormData, dateFormat, locale }; - this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'prematureClose', data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.recurringDepositsService + .executeRecurringDepositsAccountCommand(this.accountId, 'prematureClose', data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/recurring-deposits-account-actions.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/recurring-deposits-account-actions.component.spec.ts index c70c1ee50..7e18b0c36 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/recurring-deposits-account-actions.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/recurring-deposits-account-actions.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositsAccountActionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositsAccountActionsComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositsAccountActionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/recurring-deposits-account-actions.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/recurring-deposits-account-actions.component.ts index 1816e38f1..4042e7788 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/recurring-deposits-account-actions.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/recurring-deposits-account-actions.component.ts @@ -8,35 +8,34 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./recurring-deposits-account-actions.component.scss'] }) export class RecurringDepositsAccountActionsComponent { - /** Flag object to store possible actions and render appropriate UI to the user */ actions: { - 'Activate': boolean - 'Undo Activation': boolean - 'Undo Approval': boolean - 'Approve': boolean - 'Reject': boolean - 'Withdrawn by Client': boolean - 'Add Charge': boolean - 'Premature Close': boolean - 'Close': boolean - 'Deposit': boolean - 'Withdrawal': boolean + Activate: boolean; + 'Undo Activation': boolean; + 'Undo Approval': boolean; + Approve: boolean; + Reject: boolean; + 'Withdrawn by Client': boolean; + 'Add Charge': boolean; + 'Premature Close': boolean; + Close: boolean; + Deposit: boolean; + Withdrawal: boolean; } = { - 'Activate': false, - 'Undo Activation': false, - 'Undo Approval': false, - 'Approve': false, - 'Reject': false, - 'Withdrawn by Client': false, - 'Add Charge': false, - 'Premature Close': false, - 'Close': false, - 'Deposit': false, - 'Withdrawal': false - }; + Activate: false, + 'Undo Activation': false, + 'Undo Approval': false, + Approve: false, + Reject: false, + 'Withdrawn by Client': false, + 'Add Charge': false, + 'Premature Close': false, + Close: false, + Deposit: false, + Withdrawal: false + }; - currency: Currency; + currency: Currency; /** * @param {ActivatedRoute} route Activated Route @@ -50,5 +49,4 @@ export class RecurringDepositsAccountActionsComponent { const name = this.route.snapshot.params['name']; this.actions[name] = true; } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/reject-recurring-deposits-account/reject-recurring-deposits-account.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/reject-recurring-deposits-account/reject-recurring-deposits-account.component.spec.ts index 2993edc2c..d260fe842 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/reject-recurring-deposits-account/reject-recurring-deposits-account.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/reject-recurring-deposits-account/reject-recurring-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('RejectRecurringDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RejectRecurringDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [RejectRecurringDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/reject-recurring-deposits-account/reject-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/reject-recurring-deposits-account/reject-recurring-deposits-account.component.ts index e0bf9f44a..226221aeb 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/reject-recurring-deposits-account/reject-recurring-deposits-account.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/reject-recurring-deposits-account/reject-recurring-deposits-account.component.ts @@ -8,7 +8,6 @@ import { RecurringDepositsService } from '../../recurring-deposits.service'; import { SettingsService } from 'app/settings/settings.service'; import { Dates } from 'app/core/utils/dates'; - /** * Reject Recurring Deposits Account Component */ @@ -18,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./reject-recurring-deposits-account.component.scss'] }) export class RejectRecurringDepositsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -36,12 +34,14 @@ export class RejectRecurringDepositsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private recurringDepositsService: RecurringDepositsService, private dateUtils: Dates, private route: ActivatedRoute, private router: Router, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.accountId = this.route.parent.snapshot.params['recurringDepositAccountId']; } @@ -58,8 +58,11 @@ export class RejectRecurringDepositsAccountComponent implements OnInit { */ createRejectRecurringDepositsAccountForm() { this.rejectRecurringDepositsAccountForm = this.formBuilder.group({ - 'rejectedOnDate': ['', Validators.required], - 'note': [''] + rejectedOnDate: [ + '', + Validators.required + ], + note: [''] }); } @@ -80,9 +83,10 @@ export class RejectRecurringDepositsAccountComponent implements OnInit { dateFormat, locale }; - this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'reject', data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.recurringDepositsService + .executeRecurringDepositsAccountCommand(this.accountId, 'reject', data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/undo-approval-recurring-deposits-account/undo-approval-recurring-deposits-account.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/undo-approval-recurring-deposits-account/undo-approval-recurring-deposits-account.component.spec.ts index ce48d0b39..11e859211 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/undo-approval-recurring-deposits-account/undo-approval-recurring-deposits-account.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/undo-approval-recurring-deposits-account/undo-approval-recurring-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('UndoApprovalRecurringDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UndoApprovalRecurringDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [UndoApprovalRecurringDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/undo-approval-recurring-deposits-account/undo-approval-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/undo-approval-recurring-deposits-account/undo-approval-recurring-deposits-account.component.ts index b4b9af3c5..6fe7eba48 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/undo-approval-recurring-deposits-account/undo-approval-recurring-deposits-account.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/undo-approval-recurring-deposits-account/undo-approval-recurring-deposits-account.component.ts @@ -15,7 +15,6 @@ import { RecurringDepositsService } from '../../recurring-deposits.service'; styleUrls: ['./undo-approval-recurring-deposits-account.component.scss'] }) export class UndoApprovalRecurringDepositsAccountComponent implements OnInit { - /** Undo Approval Recurring Deposits Account form. */ undoApprovalRecurringDepositsAccountForm: UntypedFormGroup; /** Recurring Deposits Account Id */ @@ -30,10 +29,12 @@ export class UndoApprovalRecurringDepositsAccountComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private recurringDepositsService: RecurringDepositsService, private route: ActivatedRoute, - private router: Router) { + private router: Router + ) { this.undoCommand = 'undoapproval'; // Default command this.undoAction = this.route.snapshot.params['name']; if (this.undoAction === 'Undo Activation') { @@ -54,7 +55,7 @@ export class UndoApprovalRecurringDepositsAccountComponent implements OnInit { */ createUndoApprovalRecurringDepositsAccountForm() { this.undoApprovalRecurringDepositsAccountForm = this.formBuilder.group({ - 'note': [''] + note: [''] }); } @@ -64,17 +65,20 @@ export class UndoApprovalRecurringDepositsAccountComponent implements OnInit { */ submit() { const data = { - ...this.undoApprovalRecurringDepositsAccountForm.value, + ...this.undoApprovalRecurringDepositsAccountForm.value }; if (this.undoAction === 'Undo Activation') { - this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, this.undoCommand, data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.recurringDepositsService + .executeRecurringDepositsAccountCommand(this.accountId, this.undoCommand, data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } else { - this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'undoapproval', data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.recurringDepositsService + .executeRecurringDepositsAccountCommand(this.accountId, 'undoapproval', data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/withdraw-by-client-recurring-deposits-account/withdraw-by-client-recurring-deposits-account.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/withdraw-by-client-recurring-deposits-account/withdraw-by-client-recurring-deposits-account.component.spec.ts index c87ace164..30db6b05a 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/withdraw-by-client-recurring-deposits-account/withdraw-by-client-recurring-deposits-account.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/withdraw-by-client-recurring-deposits-account/withdraw-by-client-recurring-deposits-account.component.spec.ts @@ -8,9 +8,8 @@ describe('WithdrawByClientRecurringDepositsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WithdrawByClientRecurringDepositsAccountComponent ] - }) - .compileComponents(); + declarations: [WithdrawByClientRecurringDepositsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/withdraw-by-client-recurring-deposits-account/withdraw-by-client-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/withdraw-by-client-recurring-deposits-account/withdraw-by-client-recurring-deposits-account.component.ts index a45051fa7..479422f0c 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/withdraw-by-client-recurring-deposits-account/withdraw-by-client-recurring-deposits-account.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/withdraw-by-client-recurring-deposits-account/withdraw-by-client-recurring-deposits-account.component.ts @@ -16,7 +16,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./withdraw-by-client-recurring-deposits-account.component.scss'] }) export class WithdrawByClientRecurringDepositsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -34,12 +33,14 @@ export class WithdrawByClientRecurringDepositsAccountComponent implements OnInit * @param {Router} router Router * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private recurringDepositsService: RecurringDepositsService, private dateUtils: Dates, private route: ActivatedRoute, private router: Router, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.accountId = this.route.parent.snapshot.params['recurringDepositAccountId']; } @@ -56,8 +57,11 @@ export class WithdrawByClientRecurringDepositsAccountComponent implements OnInit */ createWithdrawRecurringDepositsAccountForm() { this.withdrawRecurringDepositsAccountForm = this.formBuilder.group({ - 'withdrawnOnDate': ['', Validators.required], - 'note': [''] + withdrawnOnDate: [ + '', + Validators.required + ], + note: [''] }); } @@ -71,16 +75,20 @@ export class WithdrawByClientRecurringDepositsAccountComponent implements OnInit const dateFormat = this.settingsService.dateFormat; const prevWithdrawnOnDate: Date = this.withdrawRecurringDepositsAccountForm.value.withdrawnOnDate; if (withdrawRecurringDepositsAccountFormData.withdrawnOnDate instanceof Date) { - withdrawRecurringDepositsAccountFormData.withdrawnOnDate = this.dateUtils.formatDate(prevWithdrawnOnDate, dateFormat); + withdrawRecurringDepositsAccountFormData.withdrawnOnDate = this.dateUtils.formatDate( + prevWithdrawnOnDate, + dateFormat + ); } const data = { ...withdrawRecurringDepositsAccountFormData, dateFormat, locale }; - this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'withdrawnByApplicant', data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.recurringDepositsService + .executeRecurringDepositsAccountCommand(this.accountId, 'withdrawnByApplicant', data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-charges-step/recurring-deposits-account-charges-step.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-charges-step/recurring-deposits-account-charges-step.component.spec.ts index 0fd68d31a..509fb1550 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-charges-step/recurring-deposits-account-charges-step.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-charges-step/recurring-deposits-account-charges-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositsAccountChargesStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositsAccountChargesStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositsAccountChargesStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-charges-step/recurring-deposits-account-charges-step.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-charges-step/recurring-deposits-account-charges-step.component.ts index fbf26a75b..c0ade416b 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-charges-step/recurring-deposits-account-charges-step.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-charges-step/recurring-deposits-account-charges-step.component.ts @@ -24,7 +24,6 @@ import { Charge, Currency } from 'app/shared/models/general.model'; styleUrls: ['./recurring-deposits-account-charges-step.component.scss'] }) export class RecurringDepositsAccountChargesStepComponent implements OnInit, OnChanges { - @Input() recurringDepositsAccountTemplate: any; @Input() recurringDepositsAccountProductTemplate: any; @Input() currencyCode: UntypedFormControl; @@ -35,7 +34,15 @@ export class RecurringDepositsAccountChargesStepComponent implements OnInit, OnC /** Charges Data Source */ chargesDataSource: {}[] = []; /** Charges table columns */ - displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'repaymentsEvery', 'action']; + displayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'date', + 'repaymentsEvery', + 'action' + ]; /** Component is pristine if there has been no changes by user interaction */ pristine = true; /** For Edit Recurring Deposits Account Form */ @@ -43,15 +50,17 @@ export class RecurringDepositsAccountChargesStepComponent implements OnInit, OnC /** Currency Code */ currency: Currency | null = null; - constructor(public dialog: MatDialog, + constructor( + public dialog: MatDialog, private dateUtils: Dates, - private settingsService: SettingsService, ) { - } + private settingsService: SettingsService + ) {} ngOnInit() { this.chargesDataSource = []; if (this.recurringDepositsAccountTemplate.id && this.recurringDepositsAccountTemplate.charges) { - this.chargesDataSource = this.recurringDepositsAccountTemplate.charges.map((charge: any) => ({...charge, id: charge.chargeId})) || []; + this.chargesDataSource = + this.recurringDepositsAccountTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || []; } } @@ -59,17 +68,20 @@ export class RecurringDepositsAccountChargesStepComponent implements OnInit, OnC if (this.currency == null) { if (this.recurringDepositsAccountTemplate.currency) { this.currency = this.recurringDepositsAccountTemplate.currency; - } else if (this.recurringDepositsAccountProductTemplate && this.recurringDepositsAccountProductTemplate.currency) { + } else if ( + this.recurringDepositsAccountProductTemplate && + this.recurringDepositsAccountProductTemplate.currency + ) { this.currency = this.recurringDepositsAccountProductTemplate.currency; } } if (this.recurringDepositsAccountProductTemplate) { - this.chargeData = this.recurringDepositsAccountProductTemplate.chargeOptions - .filter((c: Charge) => c.currency.code === this.currency.code); + this.chargeData = this.recurringDepositsAccountProductTemplate.chargeOptions.filter( + (c: Charge) => c.currency.code === this.currency.code + ); } } - /** * Add a charge */ @@ -91,7 +103,8 @@ export class RecurringDepositsAccountChargesStepComponent implements OnInit, OnC value: charge.amount, type: 'number', required: false - }), + }) + ]; const data = { title: 'Edit Charge Amount', @@ -121,7 +134,8 @@ export class RecurringDepositsAccountChargesStepComponent implements OnInit, OnC value: charge.dueDate || charge.feeOnMonthDay || '', type: 'datetime-local', required: false - }), + }) + ]; const data = { title: 'Edit Charge Date', @@ -162,7 +176,8 @@ export class RecurringDepositsAccountChargesStepComponent implements OnInit, OnC value: charge.feeInterval, type: 'text', required: false - }), + }) + ]; const data = { title: 'Edit Charge Fee Interval', @@ -205,5 +220,4 @@ export class RecurringDepositsAccountChargesStepComponent implements OnInit, OnC charges: this.chargesDataSource }; } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.spec.ts index f2875de8c..629df3ab1 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositsAccountDetailsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositsAccountDetailsStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositsAccountDetailsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.ts index d6b2fea2e..1dcbed431 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.ts @@ -15,7 +15,6 @@ import { RecurringDepositsService } from '../../recurring-deposits.service'; styleUrls: ['./recurring-deposits-account-details-step.component.scss'] }) export class RecurringDepositsAccountDetailsStepComponent implements OnInit { - /** Recurring Deposits Account Template */ @Input() recurringDepositsAccountTemplate: any; @@ -43,9 +42,11 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit { * @param {RecurringDepositsService} recurringDepositsService Recurring Deposits Service. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private recurringDepositsService: RecurringDepositsService, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.createRecurringDepositsAccountDetailsForm(); } @@ -56,9 +57,11 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit { this.productData = this.recurringDepositsAccountTemplate.productOptions; if (this.recurringDepositsAccountTemplate.depositProductId) { this.recurringDepositAccountDetailsForm.patchValue({ - 'productId': this.recurringDepositsAccountTemplate.depositProductId, - 'submittedOnDate': this.recurringDepositsAccountTemplate.timeline.submittedOnDate && new Date(this.recurringDepositsAccountTemplate.timeline.submittedOnDate), - 'externalId': this.recurringDepositsAccountTemplate.externalId + productId: this.recurringDepositsAccountTemplate.depositProductId, + submittedOnDate: + this.recurringDepositsAccountTemplate.timeline.submittedOnDate && + new Date(this.recurringDepositsAccountTemplate.timeline.submittedOnDate), + externalId: this.recurringDepositsAccountTemplate.externalId }); } } @@ -69,10 +72,16 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit { */ createRecurringDepositsAccountDetailsForm() { this.recurringDepositAccountDetailsForm = this.formBuilder.group({ - 'productId': ['', Validators.required], - 'submittedOnDate': ['', Validators.required], - 'fieldOfficerId': [''], - 'externalId': [''] + productId: [ + '', + Validators.required + ], + submittedOnDate: [ + '', + Validators.required + ], + fieldOfficerId: [''], + externalId: [''] }); } @@ -82,17 +91,21 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit { buildDependencies() { const clientId = this.recurringDepositsAccountTemplate.clientId; this.recurringDepositAccountDetailsForm.get('productId').valueChanges.subscribe((productId: string) => { - this.recurringDepositsService.getRecurringDepositsAccountTemplate(clientId, productId).subscribe((response: any) => { - this.recurringDepositsAccountProductTemplate.emit(response); - this.fieldOfficerData = response.fieldOfficerOptions; - this.isProductSelected = true; - if (!this.isFieldOfficerPatched && this.recurringDepositsAccountTemplate.fieldOfficerId) { - this.recurringDepositAccountDetailsForm.get('fieldOfficerId').patchValue(this.recurringDepositsAccountTemplate.fieldOfficerId); - this.isFieldOfficerPatched = true; - } else { - this.recurringDepositAccountDetailsForm.get('fieldOfficerId').patchValue(''); - } - }); + this.recurringDepositsService + .getRecurringDepositsAccountTemplate(clientId, productId) + .subscribe((response: any) => { + this.recurringDepositsAccountProductTemplate.emit(response); + this.fieldOfficerData = response.fieldOfficerOptions; + this.isProductSelected = true; + if (!this.isFieldOfficerPatched && this.recurringDepositsAccountTemplate.fieldOfficerId) { + this.recurringDepositAccountDetailsForm + .get('fieldOfficerId') + .patchValue(this.recurringDepositsAccountTemplate.fieldOfficerId); + this.isFieldOfficerPatched = true; + } else { + this.recurringDepositAccountDetailsForm.get('fieldOfficerId').patchValue(''); + } + }); }); } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-interest-rate-chart-step/recurring-deposits-account-interest-rate-chart-step.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-interest-rate-chart-step/recurring-deposits-account-interest-rate-chart-step.component.spec.ts index 09d4dbe43..bf9a02a13 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-interest-rate-chart-step/recurring-deposits-account-interest-rate-chart-step.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-interest-rate-chart-step/recurring-deposits-account-interest-rate-chart-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositsAccountInterestRateChartStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositsAccountInterestRateChartStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositsAccountInterestRateChartStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-interest-rate-chart-step/recurring-deposits-account-interest-rate-chart-step.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-interest-rate-chart-step/recurring-deposits-account-interest-rate-chart-step.component.ts index 6106544b4..e83d969a2 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-interest-rate-chart-step/recurring-deposits-account-interest-rate-chart-step.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-interest-rate-chart-step/recurring-deposits-account-interest-rate-chart-step.component.ts @@ -14,21 +14,33 @@ import { trigger, state, style, transition, animate } from '@angular/animations' trigger('expandChartSlab', [ state('collapsed', style({ height: '0px', minHeight: '0' })), state('expanded', style({ height: '*' })), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')) - ]) + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + ] }) export class RecurringDepositsAccountInterestRateChartStepComponent implements OnInit, OnChanges { - @Input() recurringDepositsAccountTemplate: any; @Input() recurringDepositsAccountProductTemplate: any; /** Interest Rate Chart Data */ interestRateChartData: any = []; /** Columns to be displayed in interest rate chart table. */ - chartSlabsDisplayedColumns: any[] = ['period', 'amountRange', 'interest', 'description', 'actions']; + chartSlabsDisplayedColumns: any[] = [ + 'period', + 'amountRange', + 'interest', + 'description', + 'actions' + ]; /** Columns to be displayed in incentives sub-table. */ - incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount']; + incentivesDisplayedColumns: string[] = [ + 'entityType', + 'attributeName', + 'conditionType', + 'attributeValue', + 'incentiveType', + 'amount' + ]; /** Additional Column to disblac incentives table */ chartSlabsIncentivesDisplayedColumns: string[] = ['incentives']; /** Expand Chart Slab Index used in the view */ @@ -36,8 +48,7 @@ export class RecurringDepositsAccountInterestRateChartStepComponent implements O @ViewChild('chartsTable', { static: true }) chartsTableRef: MatTable; - constructor() { - } + constructor() {} ngOnChanges() { if (this.recurringDepositsAccountProductTemplate) { @@ -48,5 +59,4 @@ export class RecurringDepositsAccountInterestRateChartStepComponent implements O ngOnInit() { this.interestRateChartData = []; } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-preview-step/recurring-deposits-account-preview-step.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-preview-step/recurring-deposits-account-preview-step.component.spec.ts index a328bf4a4..835d75c00 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-preview-step/recurring-deposits-account-preview-step.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-preview-step/recurring-deposits-account-preview-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositsAccountPreviewStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositsAccountPreviewStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositsAccountPreviewStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-preview-step/recurring-deposits-account-preview-step.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-preview-step/recurring-deposits-account-preview-step.component.ts index 81aaa4d31..af4bc0363 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-preview-step/recurring-deposits-account-preview-step.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-preview-step/recurring-deposits-account-preview-step.component.ts @@ -13,12 +13,11 @@ import { animate, state, style, transition, trigger } from '@angular/animations' trigger('expandChartSlab', [ state('collapsed', style({ height: '0px', minHeight: '0' })), state('expanded', style({ height: '*' })), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')) - ]) + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + ] }) export class RecurringDepositsAccountPreviewStepComponent implements OnChanges { - /** Input Data */ @Input() recurringDepositsAccountTemplate: any; @Input() recurringDepositsAccountProductTemplate: any; @@ -27,24 +26,43 @@ export class RecurringDepositsAccountPreviewStepComponent implements OnChanges { @Output() submitEvent = new EventEmitter(); /** Charges Displayed Columns */ - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'repaymentsEvery']; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'date', + 'repaymentsEvery' + ]; /** Interest Rate Chart Data */ interestRateChartData: any = []; /** Columns to be displayed in interest rate chart table. */ - chartSlabsDisplayedColumns: any[] = ['period', 'amountRange', 'interest', 'description', 'actions']; + chartSlabsDisplayedColumns: any[] = [ + 'period', + 'amountRange', + 'interest', + 'description', + 'actions' + ]; /** Columns to be displayed in incentives sub-table. */ - incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount']; + incentivesDisplayedColumns: string[] = [ + 'entityType', + 'attributeName', + 'conditionType', + 'attributeValue', + 'incentiveType', + 'amount' + ]; /** Additional Column to disblac incentives table */ chartSlabsIncentivesDisplayedColumns: string[] = ['incentives']; /** Expand Chart Slab Index used in the view */ expandChartSlabIndex: number; - constructor() { } + constructor() {} ngOnChanges() { if (this.recurringDepositsAccountProductTemplate) { this.interestRateChartData = this.recurringDepositsAccountProductTemplate.accountChart.chartSlabs; } } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-settings-step/recurring-deposits-account-settings-step.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-settings-step/recurring-deposits-account-settings-step.component.spec.ts index aff8b32f4..e34f0b43a 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-settings-step/recurring-deposits-account-settings-step.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-settings-step/recurring-deposits-account-settings-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositsAccountSettingsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositsAccountSettingsStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositsAccountSettingsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-settings-step/recurring-deposits-account-settings-step.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-settings-step/recurring-deposits-account-settings-step.component.ts index 6a0dc0339..239a54c36 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-settings-step/recurring-deposits-account-settings-step.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-settings-step/recurring-deposits-account-settings-step.component.ts @@ -14,7 +14,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./recurring-deposits-account-settings-step.component.scss'] }) export class RecurringDepositsAccountSettingsStepComponent implements OnInit, OnChanges { - @Input() isNew = true; @Input() recurringDepositsAccountTemplate: any; @Input() recurringDepositsAccountProductTemplate: any; @@ -38,48 +37,73 @@ export class RecurringDepositsAccountSettingsStepComponent implements OnInit, On * @param {FormBuilder} formBuilder Form Builder * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private settingsService: SettingsService + ) { this.createRecurringDepositAccountSettingsForm(); this.buildDependencies(); } ngOnChanges() { - const recurringDepositsAccount: any = this.isNew ? this.recurringDepositsAccountProductTemplate : this.recurringDepositsAccountTemplate; + const recurringDepositsAccount: any = this.isNew + ? this.recurringDepositsAccountProductTemplate + : this.recurringDepositsAccountTemplate; if (recurringDepositsAccount) { this.recurringDepositAccountSettingsForm.patchValue({ - 'isMandatoryDeposit': recurringDepositsAccount.isMandatoryDeposit, - 'adjustAdvanceTowardsFuturePayments': recurringDepositsAccount.adjustAdvanceTowardsFuturePayments, - 'allowWithdrawal': recurringDepositsAccount.allowWithdrawal, - 'lockinPeriodFrequency': recurringDepositsAccount.lockinPeriodFrequency, - 'lockinPeriodFrequencyType': recurringDepositsAccount.lockinPeriodFrequencyType ? recurringDepositsAccount.lockinPeriodFrequencyType.id : '', - 'minDepositTerm': recurringDepositsAccount.minDepositTerm, - 'minDepositTermTypeId': recurringDepositsAccount.minDepositTermType ? recurringDepositsAccount.minDepositTermType.id : '', - 'inMultiplesOfDepositTerm': recurringDepositsAccount.inMultiplesOfDepositTerm, - 'inMultiplesOfDepositTermTypeId': recurringDepositsAccount.inMultiplesOfDepositTermType ? recurringDepositsAccount.inMultiplesOfDepositTermType.id : '', - 'maxDepositTerm': recurringDepositsAccount.maxDepositTerm, - 'maxDepositTermTypeId': recurringDepositsAccount.maxDepositTermType ? recurringDepositsAccount.maxDepositTermType.id : '', - 'preClosurePenalApplicable': recurringDepositsAccount.preClosurePenalApplicable, - 'preClosurePenalInterest': recurringDepositsAccount.preClosurePenalInterest, - 'preClosurePenalInterestOnTypeId': recurringDepositsAccount.preClosurePenalInterestOnType ? recurringDepositsAccount.preClosurePenalInterestOnType.id : '', - 'minBalanceForInterestCalculation': recurringDepositsAccount.minBalanceForInterestCalculation, - 'depositPeriod': recurringDepositsAccount.minDepositTerm, - 'depositPeriodFrequencyId': recurringDepositsAccount.minDepositTermType.id, - 'expectedFirstDepositOnDate': recurringDepositsAccount.expectedFirstDepositOnDate && new Date(recurringDepositsAccount.expectedFirstDepositOnDate), - 'recurringFrequency': recurringDepositsAccount.recurringFrequency, - 'recurringFrequencyType': recurringDepositsAccount.recurringFrequencyType ? recurringDepositsAccount.recurringFrequencyType.id : '' + isMandatoryDeposit: recurringDepositsAccount.isMandatoryDeposit, + adjustAdvanceTowardsFuturePayments: recurringDepositsAccount.adjustAdvanceTowardsFuturePayments, + allowWithdrawal: recurringDepositsAccount.allowWithdrawal, + lockinPeriodFrequency: recurringDepositsAccount.lockinPeriodFrequency, + lockinPeriodFrequencyType: recurringDepositsAccount.lockinPeriodFrequencyType + ? recurringDepositsAccount.lockinPeriodFrequencyType.id + : '', + minDepositTerm: recurringDepositsAccount.minDepositTerm, + minDepositTermTypeId: recurringDepositsAccount.minDepositTermType + ? recurringDepositsAccount.minDepositTermType.id + : '', + inMultiplesOfDepositTerm: recurringDepositsAccount.inMultiplesOfDepositTerm, + inMultiplesOfDepositTermTypeId: recurringDepositsAccount.inMultiplesOfDepositTermType + ? recurringDepositsAccount.inMultiplesOfDepositTermType.id + : '', + maxDepositTerm: recurringDepositsAccount.maxDepositTerm, + maxDepositTermTypeId: recurringDepositsAccount.maxDepositTermType + ? recurringDepositsAccount.maxDepositTermType.id + : '', + preClosurePenalApplicable: recurringDepositsAccount.preClosurePenalApplicable, + preClosurePenalInterest: recurringDepositsAccount.preClosurePenalInterest, + preClosurePenalInterestOnTypeId: recurringDepositsAccount.preClosurePenalInterestOnType + ? recurringDepositsAccount.preClosurePenalInterestOnType.id + : '', + minBalanceForInterestCalculation: recurringDepositsAccount.minBalanceForInterestCalculation, + depositPeriod: recurringDepositsAccount.minDepositTerm, + depositPeriodFrequencyId: recurringDepositsAccount.minDepositTermType.id, + expectedFirstDepositOnDate: + recurringDepositsAccount.expectedFirstDepositOnDate && + new Date(recurringDepositsAccount.expectedFirstDepositOnDate), + recurringFrequency: recurringDepositsAccount.recurringFrequency, + recurringFrequencyType: recurringDepositsAccount.recurringFrequencyType + ? recurringDepositsAccount.recurringFrequencyType.id + : '' }); if (recurringDepositsAccount.withHoldTax) { this.recurringDepositAccountSettingsForm.addControl('withHoldTax', new UntypedFormControl(false)); this.recurringDepositAccountSettingsForm.get('withHoldTax').valueChanges.subscribe((value: boolean) => { if (value) { - this.recurringDepositAccountSettingsForm.addControl('taxGroupId', new UntypedFormControl({ value: '', disabled: true })); - this.recurringDepositAccountSettingsForm.get('taxGroupId').patchValue(recurringDepositsAccount.taxGroup && recurringDepositsAccount.taxGroup.name); + this.recurringDepositAccountSettingsForm.addControl( + 'taxGroupId', + new UntypedFormControl({ value: '', disabled: true }) + ); + this.recurringDepositAccountSettingsForm + .get('taxGroupId') + .patchValue(recurringDepositsAccount.taxGroup && recurringDepositsAccount.taxGroup.name); } else { this.recurringDepositAccountSettingsForm.removeControl('taxGroupId'); } }); - this.recurringDepositAccountSettingsForm.get('withHoldTax').patchValue(this.recurringDepositsAccountTemplate.withHoldTax); + this.recurringDepositAccountSettingsForm + .get('withHoldTax') + .patchValue(this.recurringDepositsAccountTemplate.withHoldTax); } else { this.recurringDepositAccountSettingsForm.removeControl('withHoldTax'); } @@ -92,9 +116,11 @@ export class RecurringDepositsAccountSettingsStepComponent implements OnInit, On this.maxDate = this.settingsService.businessDate; if (this.recurringDepositsAccountTemplate) { this.recurringDepositAccountSettingsForm.patchValue({ - 'lockinPeriodFrequency': this.recurringDepositsAccountTemplate.lockinPeriodFrequency, - 'lockinPeriodFrequencyType': this.recurringDepositsAccountTemplate.lockinPeriodFrequencyType && this.recurringDepositsAccountTemplate.lockinPeriodFrequencyType.id, - 'mandatoryRecommendedDepositAmount': this.recurringDepositsAccountTemplate.mandatoryRecommendedDepositAmount, + lockinPeriodFrequency: this.recurringDepositsAccountTemplate.lockinPeriodFrequency, + lockinPeriodFrequencyType: + this.recurringDepositsAccountTemplate.lockinPeriodFrequencyType && + this.recurringDepositsAccountTemplate.lockinPeriodFrequencyType.id, + mandatoryRecommendedDepositAmount: this.recurringDepositsAccountTemplate.mandatoryRecommendedDepositAmount }); } } @@ -104,28 +130,43 @@ export class RecurringDepositsAccountSettingsStepComponent implements OnInit, On */ createRecurringDepositAccountSettingsForm() { this.recurringDepositAccountSettingsForm = this.formBuilder.group({ - 'isMandatoryDeposit': [''], - 'adjustAdvanceTowardsFuturePayments': [''], - 'allowWithdrawal': [''], - 'lockinPeriodFrequency': [''], - 'lockinPeriodFrequencyType': [''], - 'mandatoryRecommendedDepositAmount': ['', Validators.required], - 'depositPeriod': ['', Validators.required], - 'depositPeriodFrequencyId': ['', Validators.required], - 'isCalendarInherited': [''], - 'expectedFirstDepositOnDate': [''], - 'recurringFrequency': ['', Validators.required], - 'recurringFrequencyType': ['', Validators.required], - 'minDepositTerm': [{value: '', disabled: true}], - 'minDepositTermTypeId': [{ value: '', disabled: true }], - 'inMultiplesOfDepositTerm': [{ value: '', disabled: true }], - 'inMultiplesOfDepositTermTypeId': [{ value: '', disabled: true }], - 'maxDepositTerm': [{ value: '', disabled: true }], - 'maxDepositTermTypeId': [{ value: '', disabled: true }], - 'preClosurePenalApplicable': [{ value: '', disabled: true }], - 'preClosurePenalInterest': [{ value: '', disabled: true }], - 'preClosurePenalInterestOnTypeId': [{ value: '', disabled: true }], - 'minBalanceForInterestCalculation': [{ value: '', disabled: true }] + isMandatoryDeposit: [''], + adjustAdvanceTowardsFuturePayments: [''], + allowWithdrawal: [''], + lockinPeriodFrequency: [''], + lockinPeriodFrequencyType: [''], + mandatoryRecommendedDepositAmount: [ + '', + Validators.required + ], + depositPeriod: [ + '', + Validators.required + ], + depositPeriodFrequencyId: [ + '', + Validators.required + ], + isCalendarInherited: [''], + expectedFirstDepositOnDate: [''], + recurringFrequency: [ + '', + Validators.required + ], + recurringFrequencyType: [ + '', + Validators.required + ], + minDepositTerm: [{ value: '', disabled: true }], + minDepositTermTypeId: [{ value: '', disabled: true }], + inMultiplesOfDepositTerm: [{ value: '', disabled: true }], + inMultiplesOfDepositTermTypeId: [{ value: '', disabled: true }], + maxDepositTerm: [{ value: '', disabled: true }], + maxDepositTermTypeId: [{ value: '', disabled: true }], + preClosurePenalApplicable: [{ value: '', disabled: true }], + preClosurePenalInterest: [{ value: '', disabled: true }], + preClosurePenalInterestOnTypeId: [{ value: '', disabled: true }], + minBalanceForInterestCalculation: [{ value: '', disabled: true }] }); } @@ -142,17 +183,19 @@ export class RecurringDepositsAccountSettingsStepComponent implements OnInit, On * Subscribes to value changes and sets new form controls accordingly. */ buildDependencies() { - this.recurringDepositAccountSettingsForm.get('isCalendarInherited').valueChanges.subscribe((isCalendarInherited: any) => { - if (isCalendarInherited) { - this.recurringDepositAccountSettingsForm.removeControl('expectedFirstDepositOnDate'); - this.recurringDepositAccountSettingsForm.removeControl('recurringFrequency'); - this.recurringDepositAccountSettingsForm.removeControl('recurringFrequencyType'); - } else { - this.recurringDepositAccountSettingsForm.addControl('expectedFirstDepositOnDate', new UntypedFormControl()); - this.recurringDepositAccountSettingsForm.addControl('recurringFrequency', new UntypedFormControl('')); - this.recurringDepositAccountSettingsForm.addControl('recurringFrequencyType', new UntypedFormControl('')); - } - }); + this.recurringDepositAccountSettingsForm + .get('isCalendarInherited') + .valueChanges.subscribe((isCalendarInherited: any) => { + if (isCalendarInherited) { + this.recurringDepositAccountSettingsForm.removeControl('expectedFirstDepositOnDate'); + this.recurringDepositAccountSettingsForm.removeControl('recurringFrequency'); + this.recurringDepositAccountSettingsForm.removeControl('recurringFrequencyType'); + } else { + this.recurringDepositAccountSettingsForm.addControl('expectedFirstDepositOnDate', new UntypedFormControl()); + this.recurringDepositAccountSettingsForm.addControl('recurringFrequency', new UntypedFormControl('')); + this.recurringDepositAccountSettingsForm.addControl('recurringFrequencyType', new UntypedFormControl('')); + } + }); } /** @@ -161,5 +204,4 @@ export class RecurringDepositsAccountSettingsStepComponent implements OnInit, On get recurringDepositAccountSettings() { return this.recurringDepositAccountSettingsForm.value; } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-terms-step/recurring-deposits-account-terms-step.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-terms-step/recurring-deposits-account-terms-step.component.spec.ts index a9b35ab98..b5d1ae688 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-terms-step/recurring-deposits-account-terms-step.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-terms-step/recurring-deposits-account-terms-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositsAccountTermsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositsAccountTermsStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositsAccountTermsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-terms-step/recurring-deposits-account-terms-step.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-terms-step/recurring-deposits-account-terms-step.component.ts index 7f385ff5c..3c51b6172 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-terms-step/recurring-deposits-account-terms-step.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-terms-step/recurring-deposits-account-terms-step.component.ts @@ -12,7 +12,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./recurring-deposits-account-terms-step.component.scss'] }) export class RecurringDepositsAccountTermsStepComponent implements OnInit, OnChanges { - @Input() recurringDepositsAccountTemplate: any; @Input() recurringDepositsAccountProductTemplate: any; @@ -35,8 +34,10 @@ export class RecurringDepositsAccountTermsStepComponent implements OnInit, OnCha * @param {FormBuilder} formBuilder Form Builder * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private settingsService: SettingsService + ) { this.createRecurringDepositsAccountTermsForm(); } @@ -50,10 +51,10 @@ export class RecurringDepositsAccountTermsStepComponent implements OnInit, OnCha this.maxDate = this.settingsService.businessDate; if (this.recurringDepositsAccountTemplate.id) { this.recurringDepositAccountTermsForm.patchValue({ - 'interestCompoundingPeriodType': this.recurringDepositsAccountTemplate.interestCompoundingPeriodType.id, - 'interestPostingPeriodType': this.recurringDepositsAccountTemplate.interestPostingPeriodType.id, - 'interestCalculationType': this.recurringDepositsAccountTemplate.interestCalculationType.id, - 'interestCalculationDaysInYearType': this.recurringDepositsAccountTemplate.interestCalculationDaysInYearType.id, + interestCompoundingPeriodType: this.recurringDepositsAccountTemplate.interestCompoundingPeriodType.id, + interestPostingPeriodType: this.recurringDepositsAccountTemplate.interestPostingPeriodType.id, + interestCalculationType: this.recurringDepositsAccountTemplate.interestCalculationType.id, + interestCalculationDaysInYearType: this.recurringDepositsAccountTemplate.interestCalculationDaysInYearType.id }); } } @@ -63,10 +64,22 @@ export class RecurringDepositsAccountTermsStepComponent implements OnInit, OnCha */ createRecurringDepositsAccountTermsForm() { this.recurringDepositAccountTermsForm = this.formBuilder.group({ - 'interestCompoundingPeriodType': ['', Validators.required], - 'interestPostingPeriodType': ['', Validators.required], - 'interestCalculationType': ['', Validators.required], - 'interestCalculationDaysInYearType': ['', Validators.required], + interestCompoundingPeriodType: [ + '', + Validators.required + ], + interestPostingPeriodType: [ + '', + Validators.required + ], + interestCalculationType: [ + '', + Validators.required + ], + interestCalculationDaysInYearType: [ + '', + Validators.required + ] }); } @@ -74,16 +87,19 @@ export class RecurringDepositsAccountTermsStepComponent implements OnInit, OnCha * Sets all select dropdown options. */ setOptions() { - this.interestCompoundingPeriodTypeData = this.recurringDepositsAccountProductTemplate.interestCompoundingPeriodTypeOptions; + this.interestCompoundingPeriodTypeData = + this.recurringDepositsAccountProductTemplate.interestCompoundingPeriodTypeOptions; this.interestPostingPeriodTypeData = this.recurringDepositsAccountProductTemplate.interestPostingPeriodTypeOptions; this.interestCalculationTypeData = this.recurringDepositsAccountProductTemplate.interestCalculationTypeOptions; - this.interestCalculationDaysInYearTypeData = this.recurringDepositsAccountProductTemplate.interestCalculationDaysInYearTypeOptions; + this.interestCalculationDaysInYearTypeData = + this.recurringDepositsAccountProductTemplate.interestCalculationDaysInYearTypeOptions; if (!this.recurringDepositsAccountTemplate.id) { this.recurringDepositAccountTermsForm.patchValue({ - 'interestCompoundingPeriodType': this.recurringDepositsAccountProductTemplate.interestCompoundingPeriodType.id, - 'interestPostingPeriodType': this.recurringDepositsAccountProductTemplate.interestPostingPeriodType.id, - 'interestCalculationType': this.recurringDepositsAccountProductTemplate.interestCalculationType.id, - 'interestCalculationDaysInYearType': this.recurringDepositsAccountProductTemplate.interestCalculationDaysInYearType.id, + interestCompoundingPeriodType: this.recurringDepositsAccountProductTemplate.interestCompoundingPeriodType.id, + interestPostingPeriodType: this.recurringDepositsAccountProductTemplate.interestPostingPeriodType.id, + interestCalculationType: this.recurringDepositsAccountProductTemplate.interestCalculationType.id, + interestCalculationDaysInYearType: + this.recurringDepositsAccountProductTemplate.interestCalculationDaysInYearType.id }); } } @@ -94,5 +110,4 @@ export class RecurringDepositsAccountTermsStepComponent implements OnInit, OnCha get recurringDepositAccountTerms() { return this.recurringDepositAccountTermsForm.value; } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.spec.ts index 1ef118215..0733958ac 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('ChargesTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChargesTabComponent ] - }) - .compileComponents(); + declarations: [ChargesTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts index 0b30a8b21..0fa052760 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/charges-tab/charges-tab.component.ts @@ -29,7 +29,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./charges-tab.component.scss'] }) export class ChargesTabComponent implements OnInit { - /** Recurring Deposits Account Data */ recurringDepositsAccountData: any; /** Charges Data */ @@ -60,13 +59,15 @@ export class ChargesTabComponent implements OnInit { * Retrieves Recurring Deposits Account Data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private savingsService: SavingsService, private dateUtils: Dates, private router: Router, public dialog: MatDialog, private translateService: TranslateService, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.route.parent.data.subscribe((data: { recurringDepositsAccountData: any }) => { this.recurringDepositsAccountData = data.recurringDepositsAccountData; this.chargesData = this.recurringDepositsAccountData.charges; @@ -74,7 +75,7 @@ export class ChargesTabComponent implements OnInit { } ngOnInit() { - const activeCharges = this.chargesData ? this.chargesData.filter(charge => charge.isActive) : []; + const activeCharges = this.chargesData ? this.chargesData.filter((charge) => charge.isActive) : []; this.dataSource = new MatTableDataSource(activeCharges); } @@ -98,6 +99,7 @@ export class ChargesTabComponent implements OnInit { type: 'date', required: true }) + ]; const data = { title: `Pay Charge ${chargeId}`, @@ -115,7 +117,8 @@ export class ChargesTabComponent implements OnInit { dateFormat, locale }; - this.savingsService.executeSavingsAccountChargesCommand(this.recurringDepositsAccountData.id, 'paycharge', dataObject, chargeId) + this.savingsService + .executeSavingsAccountChargesCommand(this.recurringDepositsAccountData.id, 'paycharge', dataObject, chargeId) .subscribe(() => { this.reload(); }); @@ -128,12 +131,18 @@ export class ChargesTabComponent implements OnInit { * @param {any} chargeId Charge Id */ waiveCharge(chargeId: any) { - const waiveChargeDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, - { data: { heading: this.translateService.instant('labels.heading.Waive Charge'), - dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id: ') + `${chargeId} ?` } }); + const waiveChargeDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { + data: { + heading: this.translateService.instant('labels.heading.Waive Charge'), + dialogContext: + this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id: ') + + `${chargeId} ?` + } + }); waiveChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountChargesCommand(this.recurringDepositsAccountData.id, 'waive', {}, chargeId) + this.savingsService + .executeSavingsAccountChargesCommand(this.recurringDepositsAccountData.id, 'waive', {}, chargeId) .subscribe(() => { this.reload(); }); @@ -154,6 +163,7 @@ export class ChargesTabComponent implements OnInit { type: 'number', required: true }) + ]; const data = { title: `Edit Charge ${charge.id}`, @@ -170,7 +180,8 @@ export class ChargesTabComponent implements OnInit { dateFormat, locale }; - this.savingsService.editSavingsAccountCharge(this.recurringDepositsAccountData.id, dataObject, charge.id) + this.savingsService + .editSavingsAccountCharge(this.recurringDepositsAccountData.id, dataObject, charge.id) .subscribe(() => { this.reload(); }); @@ -188,10 +199,9 @@ export class ChargesTabComponent implements OnInit { }); deleteChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.savingsService.deleteSavingsAccountCharge(this.recurringDepositsAccountData.id, chargeId) - .subscribe(() => { - this.reload(); - }); + this.savingsService.deleteSavingsAccountCharge(this.recurringDepositsAccountData.id, chargeId).subscribe(() => { + this.reload(); + }); } }); } @@ -211,8 +221,8 @@ export class ChargesTabComponent implements OnInit { private reload() { const clientId = this.recurringDepositsAccountData.clientId; const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${clientId}/recurring-deposits-accounts`, { skipLocationChange: true }) + this.router + .navigateByUrl(`/clients/${clientId}/recurring-deposits-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/custom-dialogs/recurring-deposit-confirmation-dialog/recurring-deposit-confirmation-dialog.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/custom-dialogs/recurring-deposit-confirmation-dialog/recurring-deposit-confirmation-dialog.component.spec.ts index 2005f43bf..0dabf94c5 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/custom-dialogs/recurring-deposit-confirmation-dialog/recurring-deposit-confirmation-dialog.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/custom-dialogs/recurring-deposit-confirmation-dialog/recurring-deposit-confirmation-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositConfirmationDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositConfirmationDialogComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositConfirmationDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/custom-dialogs/recurring-deposit-confirmation-dialog/recurring-deposit-confirmation-dialog.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/custom-dialogs/recurring-deposit-confirmation-dialog/recurring-deposit-confirmation-dialog.component.ts index 5cabecebb..4e22742f0 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/custom-dialogs/recurring-deposit-confirmation-dialog/recurring-deposit-confirmation-dialog.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/custom-dialogs/recurring-deposit-confirmation-dialog/recurring-deposit-confirmation-dialog.component.ts @@ -7,12 +7,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./recurring-deposit-confirmation-dialog.component.scss'] }) export class RecurringDepositConfirmationDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data Provides a confirmation for all the recurring deposit actions. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/datatable-tabs/datatable-tabs.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/datatable-tabs/datatable-tabs.component.spec.ts index 0f1dfa604..571f3ae93 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/datatable-tabs/datatable-tabs.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/datatable-tabs/datatable-tabs.component.spec.ts @@ -8,9 +8,8 @@ describe('DatatableTabsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DatatableTabsComponent ] - }) - .compileComponents(); + declarations: [DatatableTabsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/datatable-tabs/datatable-tabs.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/datatable-tabs/datatable-tabs.component.ts index deba9410e..107680e52 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/datatable-tabs/datatable-tabs.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/datatable-tabs/datatable-tabs.component.ts @@ -29,5 +29,4 @@ export class DatatableTabsComponent { this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.spec.ts index 23d4dfb2b..c0c1ba0aa 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GeneralTabComponent ] - }) - .compileComponents(); + declarations: [GeneralTabComponent] + }).compileComponents(); fixture = TestBed.createComponent(GeneralTabComponent); component = fixture.componentInstance; diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.ts index 14a028004..37d23d669 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/general-tab/general-tab.component.ts @@ -8,14 +8,15 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./general-tab.component.scss'] }) export class GeneralTabComponent { - recurringDepositsAccountData: any; isprematureAllowed = false; entityType: string; currency: Currency; - constructor(private route: ActivatedRoute, - private router: Router) { + constructor( + private route: ActivatedRoute, + private router: Router + ) { this.route.parent.data.subscribe((data: { recurringDepositsAccountData: any }) => { this.recurringDepositsAccountData = data.recurringDepositsAccountData; this.currency = this.recurringDepositsAccountData.currency; @@ -29,5 +30,4 @@ export class GeneralTabComponent { } }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.spec.ts index 26675582a..fd6e9869a 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('InterestRateChartTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ InterestRateChartTabComponent ] - }) - .compileComponents(); + declarations: [InterestRateChartTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.ts index b096ce3c8..f914699cd 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.ts @@ -14,24 +14,35 @@ import { animate, state, style, transition, trigger } from '@angular/animations' trigger('expandChartSlab', [ state('collapsed', style({ height: '0px', minHeight: '0' })), state('expanded', style({ height: '*' })), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')) - ]) + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + ] }) export class InterestRateChartTabComponent { - /** Interest Rate Chart Data */ interestRateChartData: any = []; /** Columns to be displayed in interest rate chart table. */ - chartSlabsDisplayedColumns: any[] = ['period', 'amountRange', 'interest', 'description', 'actions']; + chartSlabsDisplayedColumns: any[] = [ + 'period', + 'amountRange', + 'interest', + 'description', + 'actions' + ]; /** Columns to be displayed in incentives sub-table. */ - incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount']; + incentivesDisplayedColumns: string[] = [ + 'entityType', + 'attributeName', + 'conditionType', + 'attributeValue', + 'incentiveType', + 'amount' + ]; /** Additional Column to display in incentives table */ chartSlabsIncentivesDisplayedColumns: string[] = ['incentives']; /** Expand Chart Slab Index used in the view */ expandChartSlabIndex: number; - /** * Retrieves recurring deposits account data from `resolve`. * @param {ActivatedRoute} route Activated Route. @@ -41,5 +52,4 @@ export class InterestRateChartTabComponent { this.interestRateChartData = data.recurringDepositsAccountData.accountChart.chartSlabs; }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.spec.ts index eaa6cacfe..a0d34288c 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositsAccountViewComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositsAccountViewComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositsAccountViewComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts index c66846f67..546904d27 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-account-view.component.ts @@ -16,7 +16,6 @@ import { RecurringDepositConfirmationDialogComponent } from './custom-dialogs/re import { Currency } from 'app/shared/models/general.model'; import { TranslateService } from '@ngx-translate/core'; - /** * RecurringDeposits Account View Component */ @@ -26,7 +25,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./recurring-deposits-account-view.component.scss'] }) export class RecurringDepositsAccountViewComponent implements OnInit { - /** RecurringDeposits Account Data */ recurringDepositsAccountData: any; /** Button Configuration */ @@ -46,13 +44,15 @@ export class RecurringDepositsAccountViewComponent implements OnInit { * @param {Router} router Router * @param {RecurringDepositsService} recurringDepositsService RecurringDeposits Service */ - constructor(private route: ActivatedRoute, - private router: Router, - private recurringDepositsService: RecurringDepositsService, - private savingsService: SavingsService, - public dialog: MatDialog, - private translateService: TranslateService) { - this.route.data.subscribe((data: { recurringDepositsAccountData: any, savingsDatatables: any }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private recurringDepositsService: RecurringDepositsService, + private savingsService: SavingsService, + public dialog: MatDialog, + private translateService: TranslateService + ) { + this.route.data.subscribe((data: { recurringDepositsAccountData: any; savingsDatatables: any }) => { this.recurringDepositsAccountData = data.recurringDepositsAccountData; this.charges = this.recurringDepositsAccountData.charges; this.savingsDatatables = data.savingsDatatables; @@ -66,7 +66,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit { this.entityType = 'Center'; } const status: any = data.recurringDepositsAccountData.status; - this.showTransactions = (status.id >= 300); + this.showTransactions = status.id >= 300; }); } @@ -138,7 +138,6 @@ export class RecurringDepositsAccountViewComponent implements OnInit { } } } - } /** @@ -148,7 +147,8 @@ export class RecurringDepositsAccountViewComponent implements OnInit { reload() { const clientId = this.recurringDepositsAccountData.clientId; const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${clientId}/recurring-deposits-accounts`, { skipLocationChange: true }) + this.router + .navigateByUrl(`/clients/${clientId}/recurring-deposits-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } @@ -201,9 +201,11 @@ export class RecurringDepositsAccountViewComponent implements OnInit { }); deleteRecurringDepositsAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.recurringDepositsService.deleteRecurringDepositsAccount(this.recurringDepositsAccountData.id).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.recurringDepositsService + .deleteRecurringDepositsAccount(this.recurringDepositsAccountData.id) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } }); } @@ -213,13 +215,20 @@ export class RecurringDepositsAccountViewComponent implements OnInit { */ private calculateInterest() { const calculateInterestAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Calculate Interest'), dialogContext: this.translateService.instant(`labels.dialogContext.Are you sure you want to calculate interest ?`) } + data: { + heading: this.translateService.instant('labels.heading.Calculate Interest'), + dialogContext: this.translateService.instant( + `labels.dialogContext.Are you sure you want to calculate interest ?` + ) + } }); calculateInterestAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.recurringDepositsAccountData.id, 'calculateInterest', {}).subscribe(() => { - this.reload(); - }); + this.recurringDepositsService + .executeRecurringDepositsAccountCommand(this.recurringDepositsAccountData.id, 'calculateInterest', {}) + .subscribe(() => { + this.reload(); + }); } }); } @@ -229,31 +238,39 @@ export class RecurringDepositsAccountViewComponent implements OnInit { */ private postInterest() { const postInterestAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Post Interest'), + data: { + heading: this.translateService.instant('labels.heading.Post Interest'), dialogContext: this.translateService.instant('labels.text.Are you sure you want to post interest') + ' ?' } }); postInterestAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.recurringDepositsAccountData.id, 'postInterest', {}).subscribe(() => { - this.reload(); - }); + this.recurringDepositsService + .executeRecurringDepositsAccountCommand(this.recurringDepositsAccountData.id, 'postInterest', {}) + .subscribe(() => { + this.reload(); + }); } }); } - /** * Enables withhold tax for recurring deposits account. * Recurring deposits endpoint is not supported so using Savings endpoint. */ private enableWithHoldTax() { const deleteSavingsAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Enable Withhold Tax'), dialogContext: this.translateService.instant('labels.dialogContext.Enable withhold tax for this account ?') } + data: { + heading: this.translateService.instant('labels.heading.Enable Withhold Tax'), + dialogContext: this.translateService.instant('labels.dialogContext.Enable withhold tax for this account ?') + } }); deleteSavingsAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountUpdateCommand(this.recurringDepositsAccountData.id, 'updateWithHoldTax', { withHoldTax: true }) + this.savingsService + .executeSavingsAccountUpdateCommand(this.recurringDepositsAccountData.id, 'updateWithHoldTax', { + withHoldTax: true + }) .subscribe(() => { this.reload(); }); @@ -267,16 +284,21 @@ export class RecurringDepositsAccountViewComponent implements OnInit { */ private disableWithHoldTax() { const disableWithHoldTaxDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Disable Withhold Tax'), dialogContext: this.translateService.instant('labels.dialogContext.Disable withhold tax for this account ?') } + data: { + heading: this.translateService.instant('labels.heading.Disable Withhold Tax'), + dialogContext: this.translateService.instant('labels.dialogContext.Disable withhold tax for this account ?') + } }); disableWithHoldTaxDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountUpdateCommand(this.recurringDepositsAccountData.id, 'updateWithHoldTax', { withHoldTax: false }) + this.savingsService + .executeSavingsAccountUpdateCommand(this.recurringDepositsAccountData.id, 'updateWithHoldTax', { + withHoldTax: false + }) .subscribe(() => { this.reload(); }); } }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-buttons.config.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-buttons.config.ts index 6715cdf0f..4fd91448c 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-buttons.config.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/recurring-deposits-buttons.config.ts @@ -1,16 +1,15 @@ /** Recurring Deposits Account Buttons Configuration */ export class RecurringDepositsButtonsConfiguration { - optionArray: { - name: string, - icon?: string, - taskPermissionName: string, + name: string; + icon?: string; + taskPermissionName: string; }[]; buttonsArray: { - name: string, - icon: string, - taskPermissionName: string, + name: string; + icon: string; + taskPermissionName: string; }[]; constructor(status: string) { @@ -84,7 +83,7 @@ export class RecurringDepositsButtonsConfiguration { taskPermissionName: 'ACTIVATE_RECURRINGDEPOSITACCOUNT' } ]; - break; + break; case 'Matured': this.buttonsArray = [ { @@ -103,7 +102,7 @@ export class RecurringDepositsButtonsConfiguration { taskPermissionName: 'POSTINTEREST_RECURRINGDEPOSITACCOUNT' } ]; - break; + break; default: this.buttonsArray = []; } @@ -164,12 +163,11 @@ export class RecurringDepositsButtonsConfiguration { } } - addOption(option: {name: string, icon?: string, taskPermissionName: string}) { + addOption(option: { name: string; icon?: string; taskPermissionName: string }) { this.optionArray.push(option); } - addButton(option: { name: string, icon: string, taskPermissionName: string }) { + addButton(option: { name: string; icon: string; taskPermissionName: string }) { this.buttonsArray.push(option); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts index f3997e094..5a482658c 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('StandingInstructionsTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ StandingInstructionsTabComponent ] - }) - .compileComponents(); + declarations: [StandingInstructionsTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/standing-instructions-tab/standing-instructions-tab.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/standing-instructions-tab/standing-instructions-tab.component.ts index 4a4904eac..1d1bb39ef 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/standing-instructions-tab/standing-instructions-tab.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/standing-instructions-tab/standing-instructions-tab.component.ts @@ -21,7 +21,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./standing-instructions-tab.component.scss'] }) export class StandingInstructionsTabComponent implements OnInit { - /** Recurring Deposits Data */ recurringDepositsData: any; /** Instructions Data */ @@ -29,7 +28,15 @@ export class StandingInstructionsTabComponent implements OnInit { /** Data source for instructions table. */ dataSource = new MatTableDataSource(); /** Columns to be displayed in instructions table. */ - displayedColumns: string[] = ['client', 'fromAccount', 'beneficiary', 'toAccount', 'amount', 'validity', 'actions']; + displayedColumns: string[] = [ + 'client', + 'fromAccount', + 'beneficiary', + 'toAccount', + 'amount', + 'validity', + 'actions' + ]; /** Instruction Table Reference */ @ViewChild('instructionsTable', { static: true }) instructionTableRef: MatTable; @@ -38,11 +45,13 @@ export class StandingInstructionsTabComponent implements OnInit { * Retrieves Recurring Deposits Account Data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private recurringDepositsService: RecurringDepositsService, private dialog: MatDialog, private accountTransfersService: AccountTransfersService, - private settingsService: SettingsService, ) { + private settingsService: SettingsService + ) { this.route.parent.data.subscribe((data: { recurringDepositsAccountData: any }) => { this.recurringDepositsData = data.recurringDepositsAccountData; }); @@ -61,11 +70,13 @@ export class StandingInstructionsTabComponent implements OnInit { const accountId = this.recurringDepositsData.id; const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; - this.recurringDepositsService.getStandingInstructions(clientId, clientName, accountId, locale, dateFormat).subscribe((response: any) => { - this.instructionsData = response.pageItems; - this.dataSource.data = this.instructionsData; - this.instructionTableRef.renderRows(); - }); + this.recurringDepositsService + .getStandingInstructions(clientId, clientName, accountId, locale, dateFormat) + .subscribe((response: any) => { + this.instructionsData = response.pageItems; + this.dataSource.data = this.instructionsData; + this.instructionTableRef.renderRows(); + }); } deleteStandingInstruction(instructionId: any) { @@ -74,10 +85,8 @@ export class StandingInstructionsTabComponent implements OnInit { }); deleteStandingInstructionDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.accountTransfersService.deleteStandingInstrucions(instructionId) - .subscribe(() => { }); + this.accountTransfersService.deleteStandingInstrucions(instructionId).subscribe(() => {}); } }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/edit-transaction/edit-transaction.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/edit-transaction/edit-transaction.component.spec.ts index abea649f7..7e486c2ea 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/edit-transaction/edit-transaction.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/edit-transaction/edit-transaction.component.spec.ts @@ -8,9 +8,8 @@ describe('EditTransactionComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditTransactionComponent ] - }) - .compileComponents(); + declarations: [EditTransactionComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/edit-transaction/edit-transaction.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/edit-transaction/edit-transaction.component.ts index 61df731f0..d67a96c02 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/edit-transaction/edit-transaction.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/edit-transaction/edit-transaction.component.ts @@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./edit-transaction.component.scss'] }) export class EditTransactionComponent implements OnInit { - /** Minimum Due Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Due Date allowed. */ @@ -27,11 +26,11 @@ export class EditTransactionComponent implements OnInit { editTransactionForm: UntypedFormGroup; /** Recurring Deposits transaction payment options. */ paymentTypeOptions: { - id: number, - name: string, - description: string, - isCashPayment: boolean, - position: number + id: number; + name: string; + description: string; + isCashPayment: boolean; + position: number; }[]; /** Flag to enable payment details fields. */ addPaymentDetailsFlag: Boolean = false; @@ -50,12 +49,14 @@ export class EditTransactionComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, private recurringDepositsService: RecurringDepositsService, - private settingsService: SettingsService, ) { + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { recurringDepositsAccountTransactionTemplate: any }) => { this.transactionTemplateData = data.recurringDepositsAccountTransactionTemplate; if (this.transactionTemplateData.currency) { @@ -73,9 +74,9 @@ export class EditTransactionComponent implements OnInit { this.maxDate = this.settingsService.businessDate; this.createEditTransactionForm(); this.editTransactionForm.patchValue({ - 'transactionDate': this.transactionTemplateData.date && new Date(this.transactionTemplateData.date), - 'transactionAmount': this.transactionTemplateData.amount, - 'paymentTypeId': this.transactionTemplateData.paymentTypeId + transactionDate: this.transactionTemplateData.date && new Date(this.transactionTemplateData.date), + transactionAmount: this.transactionTemplateData.amount, + paymentTypeId: this.transactionTemplateData.paymentTypeId }); } @@ -84,9 +85,15 @@ export class EditTransactionComponent implements OnInit { */ createEditTransactionForm() { this.editTransactionForm = this.formBuilder.group({ - 'transactionDate': ['', Validators.required], - 'transactionAmount': ['', Validators.required], - 'paymentTypeId': [''], + transactionDate: [ + '', + Validators.required + ], + transactionAmount: [ + '', + Validators.required + ], + paymentTypeId: [''] }); } @@ -127,10 +134,15 @@ export class EditTransactionComponent implements OnInit { locale }; data['transactionAmount'] = data['transactionAmount'] * 1; - this.recurringDepositsService.executeRecurringDepositsAccountTransactionsCommand(this.recurringDepositAccountId, 'modify', data, this.transactionTemplateData.id) - .subscribe(res => { + this.recurringDepositsService + .executeRecurringDepositsAccountTransactionsCommand( + this.recurringDepositAccountId, + 'modify', + data, + this.transactionTemplateData.id + ) + .subscribe((res) => { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/transactions-tab.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/transactions-tab.component.spec.ts index a67fc2279..0175d84c6 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/transactions-tab.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/transactions-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('TransactionsTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ TransactionsTabComponent ] - }) - .compileComponents(); + declarations: [TransactionsTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/transactions-tab.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/transactions-tab.component.ts index 99af53f20..002ca2788 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/transactions-tab.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/transactions-tab.component.ts @@ -16,7 +16,6 @@ import { SavingsAccountTransaction } from 'app/savings/models/savings-account-tr styleUrls: ['./transactions-tab.component.scss'] }) export class TransactionsTabComponent implements OnInit { - /** Recurring Deposits Account Status */ status: any; /** Transactions Data */ @@ -25,7 +24,16 @@ export class TransactionsTabComponent implements OnInit { hideAccrualsParam: UntypedFormControl; hideReversedParam: UntypedFormControl; /** Columns to be displayed in transactions table. */ - displayedColumns: string[] = ['row', 'id', 'transactionDate', 'transactionType', 'debit', 'credit', 'balance', 'actions']; + displayedColumns: string[] = [ + 'row', + 'id', + 'transactionDate', + 'transactionType', + 'debit', + 'credit', + 'balance', + 'actions' + ]; /** Data source for transactions table. */ dataSource: MatTableDataSource; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @@ -35,8 +43,10 @@ export class TransactionsTabComponent implements OnInit { * Retrieves recurring deposits account data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ - constructor(private route: ActivatedRoute, - private router: Router) { + constructor( + private route: ActivatedRoute, + private router: Router + ) { this.route.parent.data.subscribe((data: { recurringDepositsAccountData: any }) => { this.transactionsData = data.recurringDepositsAccountData.transactions; this.status = data.recurringDepositsAccountData.status.value; @@ -54,8 +64,12 @@ export class TransactionsTabComponent implements OnInit { * @param {any} transactionType Transaction Type */ isDebit(transactionType: any) { - return transactionType.withdrawal === true || transactionType.feeDeduction === true - || transactionType.overdraftInterest === true || transactionType.withholdTax === true; + return ( + transactionType.withdrawal === true || + transactionType.feeDeduction === true || + transactionType.overdraftInterest === true || + transactionType.withholdTax === true + ); } hideAccruals() { @@ -71,7 +85,7 @@ export class TransactionsTabComponent implements OnInit { if (hideAccrual || hideReversed) { transactions = this.transactionsData.filter((t: SavingsAccountTransaction) => { - return (!(hideReversed && t.reversed) && !(hideAccrual && t.transactionType.accrual)); + return !(hideReversed && t.reversed) && !(hideAccrual && t.transactionType.accrual); }); } this.dataSource = new MatTableDataSource(transactions); @@ -95,8 +109,14 @@ export class TransactionsTabComponent implements OnInit { * Checks transaction status. */ checkStatus() { - if (this.status === 'Active' || this.status === 'Closed' || this.status === 'Transfer in progress' || - this.status === 'Transfer on hold' || this.status === 'Premature Closed' || this.status === 'Matured') { + if ( + this.status === 'Active' || + this.status === 'Closed' || + this.status === 'Transfer in progress' || + this.status === 'Transfer on hold' || + this.status === 'Premature Closed' || + this.status === 'Matured' + ) { return true; } return false; @@ -108,10 +128,11 @@ export class TransactionsTabComponent implements OnInit { */ showTransactions(transactionsData: SavingsAccountTransaction) { if (transactionsData.transfer) { - this.router.navigate([`../transfer-funds/account-transfers/${transactionsData.transfer.id}`], { relativeTo: this.route }); + this.router.navigate([`../transfer-funds/account-transfers/${transactionsData.transfer.id}`], { + relativeTo: this.route + }); } else { this.router.navigate([transactionsData.id], { relativeTo: this.route }); } } - } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.spec.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.spec.ts index bbff0d11b..bed3c6ae6 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.spec.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewTransactionComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewTransactionComponent ] - }) - .compileComponents(); + declarations: [ViewTransactionComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.ts index 4ddba20a6..b03bc20d3 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/view-transaction/view-transaction.component.ts @@ -23,7 +23,6 @@ import { Location } from '@angular/common'; styleUrls: ['./view-transaction.component.scss'] }) export class ViewTransactionComponent { - /** Transaction data. */ transactionData: any; @@ -36,14 +35,16 @@ export class ViewTransactionComponent { * @param {Dates} dateUtils Date Utils. * @param {SettingsService} settingsService Settings Service */ - constructor(private recurringDepositsService: RecurringDepositsService, + constructor( + private recurringDepositsService: RecurringDepositsService, private route: ActivatedRoute, private location: Location, private dateUtils: Dates, private router: Router, public dialog: MatDialog, private translateService: TranslateService, - private settingsService: SettingsService, ) { + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { recurringDepositsAccountTransaction: any }) => { this.transactionData = data.recurringDepositsAccountTransaction; }); @@ -54,20 +55,32 @@ export class ViewTransactionComponent { */ undoTransaction() { const accountId = this.route.parent.snapshot.params['recurringDepositAccountId']; - const undoTransactionAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { data: { heading: this.translateService.instant('labels.heading.Undo Transaction'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to undo this transaction ?') } }); + const undoTransactionAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { + data: { + heading: this.translateService.instant('labels.heading.Undo Transaction'), + dialogContext: this.translateService.instant( + 'labels.dialogContext.Are you sure you want to undo this transaction ?' + ) + } + }); undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; const data = { - transactionDate: this.dateUtils.formatDate(this.transactionData.date && new Date(this.transactionData.date), dateFormat), + transactionDate: this.dateUtils.formatDate( + this.transactionData.date && new Date(this.transactionData.date), + dateFormat + ), transactionAmount: 0, dateFormat, locale }; - this.recurringDepositsService.executeRecurringDepositsAccountTransactionsCommand(accountId, 'undo', data, this.transactionData.id).subscribe(() => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.recurringDepositsService + .executeRecurringDepositsAccountTransactionsCommand(accountId, 'undo', data, this.transactionData.id) + .subscribe(() => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } }); } diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-routing.module.ts b/src/app/deposits/recurring-deposits/recurring-deposits-routing.module.ts index 5fb2ba171..42f57e597 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-routing.module.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-routing.module.ts @@ -60,17 +60,25 @@ const routes: Routes = [ { path: 'general', component: GeneralTabComponent, - data: { title: 'Recurring Deposit Account Details', breadcrumb: 'General', routeParamBreadcrumb: false }, + data: { title: 'Recurring Deposit Account Details', breadcrumb: 'General', routeParamBreadcrumb: false } }, { path: 'interest-rate-chart', component: InterestRateChartTabComponent, - data: { title: 'Recurring Deposit Account Interest Rate Chart', breadcrumb: 'Interest Rate Chart', routeParamBreadcrumb: false }, + data: { + title: 'Recurring Deposit Account Interest Rate Chart', + breadcrumb: 'Interest Rate Chart', + routeParamBreadcrumb: false + } }, { path: 'transactions', component: TransactionsTabComponent, - data: { title: 'Recurring Deposit Account Transactions', breadcrumb: 'Transactions', routeParamBreadcrumb: false }, + data: { + title: 'Recurring Deposit Account Transactions', + breadcrumb: 'Transactions', + routeParamBreadcrumb: false + } }, { path: 'charges', @@ -80,7 +88,11 @@ const routes: Routes = [ { path: 'standing-instructions-tab', component: StandingInstructionsTabComponent, - data: { title: 'Recurring Deposit Account Standing Instructions', breadcrumb: 'Standing Instructions', routeParamBreadcrumb: false }, + data: { + title: 'Recurring Deposit Account Standing Instructions', + breadcrumb: 'Standing Instructions', + routeParamBreadcrumb: false + } }, { path: 'datatables', @@ -94,7 +106,7 @@ const routes: Routes = [ } } ] - }, + } ] }, { @@ -107,11 +119,16 @@ const routes: Routes = [ }, { path: 'transactions', - data: { title: 'Recurring Deposits Account Transactions', breadcrumb: 'Transactions', routeParamBreadcrumb: false }, + data: { + title: 'Recurring Deposits Account Transactions', + breadcrumb: 'Transactions', + routeParamBreadcrumb: false + }, children: [ { path: '', - redirectTo: '../transactions', pathMatch: 'prefix' + redirectTo: '../transactions', + pathMatch: 'prefix' }, { path: ':id', @@ -147,7 +164,8 @@ const routes: Routes = [ }, { path: ':recurringDepositAccountId/transfer-funds', - loadChildren: () => import('../../account-transfers/account-transfers.module').then(m => m.AccountTransfersModule) + loadChildren: () => + import('../../account-transfers/account-transfers.module').then((m) => m.AccountTransfersModule) } ] }, @@ -161,8 +179,9 @@ const routes: Routes = [ children: [ { path: 'standing-instructions', - loadChildren: () => import('../../account-transfers/account-transfers.module').then(m => m.AccountTransfersModule) - }, + loadChildren: () => + import('../../account-transfers/account-transfers.module').then((m) => m.AccountTransfersModule) + } ] } ] diff --git a/src/app/deposits/recurring-deposits/recurring-deposits.module.ts b/src/app/deposits/recurring-deposits/recurring-deposits.module.ts index 768b60a3b..f2d8ee674 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits.module.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits.module.ts @@ -81,6 +81,6 @@ import { GeneralTabComponent } from './recurring-deposits-account-view/general-t EditTransactionComponent, GeneralTabComponent ], - providers: [ ] + providers: [] }) export class RecurringDepositsModule {} diff --git a/src/app/deposits/recurring-deposits/recurring-deposits.service.ts b/src/app/deposits/recurring-deposits/recurring-deposits.service.ts index f4d5dc109..1ba7fa0bd 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits.service.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits.service.ts @@ -12,16 +12,14 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class RecurringDepositsService { - - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * @params recurringDepositAccountId * Returns the details of a particular Recurring Deposit Account */ getRecurringDepositsAccountData(recurringDepositAccountId: any): Observable { - const httpParams = new HttpParams() - .set('associations', 'all'); + const httpParams = new HttpParams().set('associations', 'all'); return this.http.get(`/recurringdepositaccounts/${recurringDepositAccountId}`, { params: httpParams }); } @@ -34,8 +32,12 @@ export class RecurringDepositsService { * @returns {Observable} Standing Instructions */ getStandingInstructions( - clientId: string, clientName: string, fromAccountId: string, - locale: string, dateFormat: string): Observable { + clientId: string, + clientName: string, + fromAccountId: string, + locale: string, + dateFormat: string + ): Observable { const httpParams = new HttpParams() .set('clientId', clientId) .set('clientName', clientName) @@ -92,8 +94,7 @@ export class RecurringDepositsService { * @param accountId Account ID */ getRecurringDepositsAccountAndTemplate(accountId: any) { - const httpParams = new HttpParams().set('associations', 'charges') - .set('template', 'true'); + const httpParams = new HttpParams().set('associations', 'charges').set('template', 'true'); return this.http.get(`/recurringdepositaccounts/${accountId}`, { params: httpParams }); } @@ -141,7 +142,9 @@ export class RecurringDepositsService { */ getRecurringDepositsAccountTransactionTemplate(accountId: string, transactionId: string): Observable { const httpParams = new HttpParams().set('template', 'true'); - return this.http.get(`/recurringdepositaccounts/${accountId}/transactions/${transactionId}`, { params: httpParams }); + return this.http.get(`/recurringdepositaccounts/${accountId}/transactions/${transactionId}`, { + params: httpParams + }); } /** @@ -151,9 +154,15 @@ export class RecurringDepositsService { * @param {string} transactionId Transaction Id * @returns {Observable} */ - executeRecurringDepositsAccountTransactionsCommand(accountId: string, command: string, data: any, transactionId?: any): Observable { + executeRecurringDepositsAccountTransactionsCommand( + accountId: string, + command: string, + data: any, + transactionId?: any + ): Observable { const httpParams = new HttpParams().set('command', command); - return this.http.post(`/recurringdepositaccounts/${accountId}/transactions/${transactionId}`, data, { params: httpParams }); + return this.http.post(`/recurringdepositaccounts/${accountId}/transactions/${transactionId}`, data, { + params: httpParams + }); } - } diff --git a/src/app/directives/directives.module.ts b/src/app/directives/directives.module.ts index b92c18f0c..968e837fb 100644 --- a/src/app/directives/directives.module.ts +++ b/src/app/directives/directives.module.ts @@ -15,7 +15,13 @@ import { FormatAmountDirective } from './format-amount.directive'; imports: [ CommonModule ], - declarations: [HasPermissionDirective, FormatAmountDirective], - exports: [HasPermissionDirective, FormatAmountDirective] + declarations: [ + HasPermissionDirective, + FormatAmountDirective + ], + exports: [ + HasPermissionDirective, + FormatAmountDirective + ] }) -export class DirectivesModule { } +export class DirectivesModule {} diff --git a/src/app/directives/format-amount.directive.ts b/src/app/directives/format-amount.directive.ts index adba25708..f61549e1f 100644 --- a/src/app/directives/format-amount.directive.ts +++ b/src/app/directives/format-amount.directive.ts @@ -4,47 +4,46 @@ import { NgControl } from '@angular/forms'; import { LOCALE_ID } from '@angular/core'; @Directive({ - selector: '[mifosxFormatAmount]', + selector: '[mifosxFormatAmount]' }) export class FormatAmountDirective implements OnInit { - format = 'N0'; - digitsInfo = '1.0-0'; - currencyCode: string; - displaySymbol: string; - @Input() sufix = ''; + format = 'N0'; + digitsInfo = '1.0-0'; + currencyCode: string; + displaySymbol: string; + @Input() sufix = ''; - @Input('mifosxFormatAmount') set _(values: string) { - const parts: string[] = values.split(':'); - this.currencyCode = parts[0]; - this.displaySymbol = (parts.length > 1) ? parts[1] : '$'; - this.digitsInfo = (parts.length > 2) ? parts[2] : '1.2-2'; + @Input('mifosxFormatAmount') set _(values: string) { + const parts: string[] = values.split(':'); + this.currencyCode = parts[0]; + this.displaySymbol = parts.length > 1 ? parts[1] : '$'; + this.digitsInfo = parts.length > 2 ? parts[2] : '1.2-2'; + } + + @HostListener('blur', ['$event.target']) blur(target: any) { + target.value = this.parse(target.value); + } + @HostListener('focus', ['$event.target']) focus(target: any) { + if (typeof this.control.value === 'undefined') { + target.value = ''; + } else { + target.value = this.control.value; } + } - @HostListener('blur', ['$event.target']) blur(target: any) { - target.value = this.parse(target.value); - } - @HostListener('focus', ['$event.target']) focus(target: any) { - if (typeof this.control.value === 'undefined') { - target.value = ''; - } else { - target.value = this.control.value; - } - } + ngOnInit() { + setTimeout(() => { + this.el.nativeElement.value = this.parse(this.el.nativeElement.value); + }); + } - ngOnInit() { - setTimeout(() => { - this.el.nativeElement.value = this.parse(this.el.nativeElement.value); - }); - } - - constructor( - @Inject(LOCALE_ID) private locale: string, - private el: ElementRef, - private control: NgControl - ) { } - - parse(value: any) { - return formatCurrency(value, this.locale, this.displaySymbol, this.currencyCode, this.digitsInfo) + this.sufix; - } + constructor( + @Inject(LOCALE_ID) private locale: string, + private el: ElementRef, + private control: NgControl + ) {} + parse(value: any) { + return formatCurrency(value, this.locale, this.displaySymbol, this.currencyCode, this.digitsInfo) + this.sufix; + } } diff --git a/src/app/directives/has-permission/has-permission.directive.ts b/src/app/directives/has-permission/has-permission.directive.ts index 145ff7e0b..65f97610e 100644 --- a/src/app/directives/has-permission/has-permission.directive.ts +++ b/src/app/directives/has-permission/has-permission.directive.ts @@ -11,7 +11,6 @@ import { AuthenticationService } from '../../core/authentication/authentication. selector: '[mifosxHasPermission]' }) export class HasPermissionDirective { - /** User Permissions */ private userPermissions: any[]; @@ -21,9 +20,11 @@ export class HasPermissionDirective { * @param {ViewContainerRef} viewContainer View Container Reference * @param {AuthenticationService} authenticationService AuthenticationService */ - constructor(private templateRef: TemplateRef, - private viewContainer: ViewContainerRef, - private authenticationService: AuthenticationService) { + constructor( + private templateRef: TemplateRef, + private viewContainer: ViewContainerRef, + private authenticationService: AuthenticationService + ) { const savedCredentials = this.authenticationService.getCredentials(); this.userPermissions = savedCredentials.permissions; } @@ -60,16 +61,15 @@ export class HasPermissionDirective { if (this.userPermissions.includes('ALL_FUNCTIONS')) { return true; } else if (permission !== '') { - if (permission.substring(0, 5) === 'READ_' && this.userPermissions.includes('ALL_FUNCTIONS_READ')) { - return true; - } else if (this.userPermissions.includes(permission)) { - return true; - } else { - return false; - } + if (permission.substring(0, 5) === 'READ_' && this.userPermissions.includes('ALL_FUNCTIONS_READ')) { + return true; + } else if (this.userPermissions.includes(permission)) { + return true; + } else { + return false; + } } else { return false; } } - } diff --git a/src/app/groups/common-resolvers/glim-account-resolver.ts b/src/app/groups/common-resolvers/glim-account-resolver.ts index d287cadfc..99699ca8c 100644 --- a/src/app/groups/common-resolvers/glim-account-resolver.ts +++ b/src/app/groups/common-resolvers/glim-account-resolver.ts @@ -13,11 +13,10 @@ import { GroupsService } from '../groups.service'; */ @Injectable() export class GLIMAccountsResolver implements Resolve { - /** * @param {GroupsService} groupsService Groups service. */ - constructor(private groupsService: GroupsService) { } + constructor(private groupsService: GroupsService) {} /** * Returns the Group's GLIM Loans Acccounts data. @@ -28,5 +27,4 @@ export class GLIMAccountsResolver implements Resolve { const groupId = route.parent.paramMap.get('groupId'); return this.groupsService.getGLIMAccountsData(groupId); } - } diff --git a/src/app/groups/common-resolvers/group-account.resolver.ts b/src/app/groups/common-resolvers/group-account.resolver.ts index d7951bf2a..3ca15809d 100644 --- a/src/app/groups/common-resolvers/group-account.resolver.ts +++ b/src/app/groups/common-resolvers/group-account.resolver.ts @@ -13,11 +13,10 @@ import { GroupsService } from '../groups.service'; */ @Injectable() export class GroupAccountsResolver implements Resolve { - /** * @param {GroupsService} GroupsService Groups service. */ - constructor(private groupsService: GroupsService) { } + constructor(private groupsService: GroupsService) {} /** * Returns the Group's Acccounts data. @@ -28,5 +27,4 @@ export class GroupAccountsResolver implements Resolve { const groupId = route.parent.paramMap.get('groupId'); return this.groupsService.getGroupAccountsData(groupId); } - } diff --git a/src/app/groups/common-resolvers/group-actions.resolver.ts b/src/app/groups/common-resolvers/group-actions.resolver.ts index d13e24fb8..02c76902e 100644 --- a/src/app/groups/common-resolvers/group-actions.resolver.ts +++ b/src/app/groups/common-resolvers/group-actions.resolver.ts @@ -13,11 +13,10 @@ import { GroupsService } from '../groups.service'; */ @Injectable() export class GroupActionsResolver implements Resolve { - /** * @param {GroupsService} groupsService Groups service. */ - constructor(private groupsService: GroupsService) { } + constructor(private groupsService: GroupsService) {} /** * Returns the group actions data. @@ -46,5 +45,4 @@ export class GroupActionsResolver implements Resolve { return undefined; } } - } diff --git a/src/app/groups/common-resolvers/group-data-and-template.resolver.ts b/src/app/groups/common-resolvers/group-data-and-template.resolver.ts index d54266aad..05c856217 100644 --- a/src/app/groups/common-resolvers/group-data-and-template.resolver.ts +++ b/src/app/groups/common-resolvers/group-data-and-template.resolver.ts @@ -13,11 +13,10 @@ import { GroupsService } from '../groups.service'; */ @Injectable() export class GroupDataAndTemplateResolver implements Resolve { - /** * @param {GroupsService} GroupsService Groups service. */ - constructor(private groupsService: GroupsService) { } + constructor(private groupsService: GroupsService) {} /** * Returns the Groups data and template. @@ -28,5 +27,4 @@ export class GroupDataAndTemplateResolver implements Resolve { const groupId = route.paramMap.get('groupId'); return this.groupsService.getGroupData(groupId, 'true'); } - } diff --git a/src/app/groups/common-resolvers/group-datatable.resolver.ts b/src/app/groups/common-resolvers/group-datatable.resolver.ts index 53f83a165..a3efad354 100644 --- a/src/app/groups/common-resolvers/group-datatable.resolver.ts +++ b/src/app/groups/common-resolvers/group-datatable.resolver.ts @@ -13,11 +13,10 @@ import { GroupsService } from '../groups.service'; */ @Injectable() export class GroupDatatableResolver implements Resolve { - /** * @param {GroupsService} GroupsService Groups service. */ - constructor(private groupsService: GroupsService) { } + constructor(private groupsService: GroupsService) {} /** * Returns the Group's Datatable data. @@ -28,5 +27,4 @@ export class GroupDatatableResolver implements Resolve { const datatableName = route.paramMap.get('datatableName'); return this.groupsService.getGroupDatatable(groupId, datatableName); } - } diff --git a/src/app/groups/common-resolvers/group-datatables.resolver.ts b/src/app/groups/common-resolvers/group-datatables.resolver.ts index a0187932f..7f4930d4d 100644 --- a/src/app/groups/common-resolvers/group-datatables.resolver.ts +++ b/src/app/groups/common-resolvers/group-datatables.resolver.ts @@ -13,11 +13,10 @@ import { GroupsService } from '../groups.service'; */ @Injectable() export class GroupDatatablesResolver implements Resolve { - /** * @param {GroupsService} GroupsService Groups service. */ - constructor(private groupsService: GroupsService) { } + constructor(private groupsService: GroupsService) {} /** * Returns the Group's Datatables data. @@ -26,5 +25,4 @@ export class GroupDatatablesResolver implements Resolve { resolve(): Observable { return this.groupsService.getGroupDatatables(); } - } diff --git a/src/app/groups/common-resolvers/group-notes.resolver.ts b/src/app/groups/common-resolvers/group-notes.resolver.ts index 9b02c1b79..df2630b76 100644 --- a/src/app/groups/common-resolvers/group-notes.resolver.ts +++ b/src/app/groups/common-resolvers/group-notes.resolver.ts @@ -13,11 +13,10 @@ import { GroupsService } from '../groups.service'; */ @Injectable() export class GroupNotesResolver implements Resolve { - /** * @param {GroupsService} GroupsService Groups service. */ - constructor(private groupsService: GroupsService) { } + constructor(private groupsService: GroupsService) {} /** * Returns the Group's Notes data. @@ -28,5 +27,4 @@ export class GroupNotesResolver implements Resolve { const groupId = route.parent.paramMap.get('groupId'); return this.groupsService.getGroupNotes(groupId); } - } diff --git a/src/app/groups/common-resolvers/group-summary.resolver.ts b/src/app/groups/common-resolvers/group-summary.resolver.ts index fd58f5516..e2be20918 100644 --- a/src/app/groups/common-resolvers/group-summary.resolver.ts +++ b/src/app/groups/common-resolvers/group-summary.resolver.ts @@ -13,11 +13,10 @@ import { GroupsService } from '../groups.service'; */ @Injectable() export class GroupSummaryResolver implements Resolve { - /** * @param {GroupsService} GroupsService Groups service. */ - constructor(private groupsService: GroupsService) { } + constructor(private groupsService: GroupsService) {} /** * Returns the Group Summary data. @@ -28,5 +27,4 @@ export class GroupSummaryResolver implements Resolve { const groupId = route.parent.paramMap.get('groupId'); return this.groupsService.getGroupSummary(groupId); } - } diff --git a/src/app/groups/common-resolvers/group-view.resolver.ts b/src/app/groups/common-resolvers/group-view.resolver.ts index cc2a049ad..b5dbb3ce8 100644 --- a/src/app/groups/common-resolvers/group-view.resolver.ts +++ b/src/app/groups/common-resolvers/group-view.resolver.ts @@ -13,11 +13,10 @@ import { GroupsService } from '../groups.service'; */ @Injectable() export class GroupViewResolver implements Resolve { - /** * @param {GroupsService} GroupsService Groups service. */ - constructor(private groupsService: GroupsService) { } + constructor(private groupsService: GroupsService) {} /** * Returns the Groups data. @@ -28,5 +27,4 @@ export class GroupViewResolver implements Resolve { const groupId = route.paramMap.get('groupId'); return this.groupsService.getGroupData(groupId); } - } diff --git a/src/app/groups/common-resolvers/gsim-account-resolver.ts b/src/app/groups/common-resolvers/gsim-account-resolver.ts index 055736b19..229a15202 100644 --- a/src/app/groups/common-resolvers/gsim-account-resolver.ts +++ b/src/app/groups/common-resolvers/gsim-account-resolver.ts @@ -13,11 +13,10 @@ import { GroupsService } from '../groups.service'; */ @Injectable() export class GSIMAccountsResolver implements Resolve { - /** * @param {GroupsService} groupsService Groups service. */ - constructor(private groupsService: GroupsService) { } + constructor(private groupsService: GroupsService) {} /** * Returns the Group's GSIM Acccounts data. @@ -28,5 +27,4 @@ export class GSIMAccountsResolver implements Resolve { const groupId = route.parent.paramMap.get('groupId'); return this.groupsService.getGSIMAccountsData(groupId); } - } diff --git a/src/app/groups/create-group/create-group.component.spec.ts b/src/app/groups/create-group/create-group.component.spec.ts index 40c206cbe..a3cc71cd5 100644 --- a/src/app/groups/create-group/create-group.component.spec.ts +++ b/src/app/groups/create-group/create-group.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateGroupComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateGroupComponent ] - }) - .compileComponents(); + declarations: [CreateGroupComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/create-group/create-group.component.ts b/src/app/groups/create-group/create-group.component.ts index 691227e5e..fa87b5c1f 100644 --- a/src/app/groups/create-group/create-group.component.ts +++ b/src/app/groups/create-group/create-group.component.ts @@ -18,7 +18,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-group.component.scss'] }) export class CreateGroupComponent implements OnInit, AfterViewInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -46,14 +45,16 @@ export class CreateGroupComponent implements OnInit, AfterViewInit { * @param {Dates} dateUtils Date Utils to format date. * @param {SettingsService} settingsService SettingsService */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private clientsService: ClientsService, - private groupService: GroupsService, - private dateUtils: Dates, - private settingsService: SettingsService) { - this.route.data.subscribe( (data: {offices: any} ) => { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private clientsService: ClientsService, + private groupService: GroupsService, + private dateUtils: Dates, + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { offices: any }) => { this.officeData = data.offices; }); } @@ -70,12 +71,13 @@ export class CreateGroupComponent implements OnInit, AfterViewInit { * Subscribes to Clients search filter: */ ngAfterViewInit() { - this.clientChoice.valueChanges.subscribe( (value: string) => { + this.clientChoice.valueChanges.subscribe((value: string) => { if (value.length >= 2) { - this.clientsService.getFilteredClients('displayName', 'ASC', true, value, this.groupForm.get('officeId').value) - .subscribe( (data: any) => { - this.clientsData = data.pageItems; - }); + this.clientsService + .getFilteredClients('displayName', 'ASC', true, value, this.groupForm.get('officeId').value) + .subscribe((data: any) => { + this.clientsData = data.pageItems; + }); } }); } @@ -85,12 +87,23 @@ export class CreateGroupComponent implements OnInit, AfterViewInit { */ createGroupForm() { this.groupForm = this.formBuilder.group({ - 'name': ['', [Validators.required, Validators.pattern('(^[A-z]).*')]], - 'officeId': ['', Validators.required], - 'submittedOnDate': [this.settingsService.businessDate, Validators.required], - 'staffId': [''], - 'externalId': [''], - 'active': [false], + name: [ + '', + [ + Validators.required, + Validators.pattern('(^[A-z]).*')] + ], + officeId: [ + '', + Validators.required + ], + submittedOnDate: [ + this.settingsService.businessDate, + Validators.required + ], + staffId: [''], + externalId: [''], + active: [false] }); this.buildDependencies(); } @@ -101,7 +114,7 @@ export class CreateGroupComponent implements OnInit, AfterViewInit { */ buildDependencies() { this.groupForm.get('officeId').valueChanges.subscribe((option: any) => { - this.groupService.getStaff(option).subscribe(data => { + this.groupService.getStaff(option).subscribe((data) => { this.staffData = data['staffOptions']; if (this.staffData === undefined) { this.groupForm.controls['staffId'].disable(); @@ -169,8 +182,11 @@ export class CreateGroupComponent implements OnInit, AfterViewInit { data.clientMembers = []; this.clientMembers.forEach((client: any) => data.clientMembers.push(client.id)); this.groupService.createGroup(data).subscribe((response: any) => { - this.router.navigate(['../groups', response.resourceId, 'general']); + this.router.navigate([ + '../groups', + response.resourceId, + 'general' + ]); }); } - } diff --git a/src/app/groups/edit-group/edit-group.component.spec.ts b/src/app/groups/edit-group/edit-group.component.spec.ts index 229c9b1f9..b9b273ad4 100644 --- a/src/app/groups/edit-group/edit-group.component.spec.ts +++ b/src/app/groups/edit-group/edit-group.component.spec.ts @@ -8,9 +8,8 @@ describe('EditGroupComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditGroupComponent ] - }) - .compileComponents(); + declarations: [EditGroupComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/edit-group/edit-group.component.ts b/src/app/groups/edit-group/edit-group.component.ts index 0af001307..1f50b30af 100644 --- a/src/app/groups/edit-group/edit-group.component.ts +++ b/src/app/groups/edit-group/edit-group.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./edit-group.component.scss'] }) export class EditGroupComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -40,16 +39,19 @@ export class EditGroupComponent implements OnInit { * @param {Dates} dateUtils Date Utils to format date. * @param {SettingsService} settingsService SettingsService */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private groupService: GroupsService, - private dateUtils: Dates, - private settingsService: SettingsService) { - this.route.data.subscribe( (data: { groupAndTemplateData: any, groupViewData: any } ) => { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private groupService: GroupsService, + private dateUtils: Dates, + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { groupAndTemplateData: any; groupViewData: any }) => { this.staffData = data.groupAndTemplateData.staffOptions; this.groupData = data.groupAndTemplateData; - this.submittedOnDate = data.groupViewData.timeline.submittedOnDate && new Date(data.groupViewData.timeline.submittedOnDate); + this.submittedOnDate = + data.groupViewData.timeline.submittedOnDate && new Date(data.groupViewData.timeline.submittedOnDate); }); } @@ -60,10 +62,10 @@ export class EditGroupComponent implements OnInit { this.maxDate = this.settingsService.businessDate; this.createEditGroupForm(); this.editGroupForm.patchValue({ - 'name': this.groupData.name, - 'submittedOnDate': this.submittedOnDate, - 'staffId': this.groupData.staffId, - 'externalId': this.groupData.externalId + name: this.groupData.name, + submittedOnDate: this.submittedOnDate, + staffId: this.groupData.staffId, + externalId: this.groupData.externalId }); } @@ -72,10 +74,18 @@ export class EditGroupComponent implements OnInit { */ createEditGroupForm() { this.editGroupForm = this.formBuilder.group({ - 'name': ['', [Validators.required, Validators.pattern('(^[A-z]).*')]], - 'submittedOnDate': ['', Validators.required], - 'staffId': [''], - 'externalId': [''] + name: [ + '', + [ + Validators.required, + Validators.pattern('(^[A-z]).*')] + ], + submittedOnDate: [ + '', + Validators.required + ], + staffId: [''], + externalId: [''] }); this.buildDependencies(); } @@ -86,7 +96,9 @@ export class EditGroupComponent implements OnInit { buildDependencies() { if (this.groupData.active) { this.editGroupForm.addControl('activationDate', new UntypedFormControl('', Validators.required)); - this.editGroupForm.get('activationDate').patchValue(this.groupData.activationDate && new Date(this.groupData.activationDate)); + this.editGroupForm + .get('activationDate') + .patchValue(this.groupData.activationDate && new Date(this.groupData.activationDate)); } else { this.editGroupForm.removeControl('activationDate'); } @@ -117,5 +129,4 @@ export class EditGroupComponent implements OnInit { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/groups/groups-routing.module.ts b/src/app/groups/groups-routing.module.ts index 33aec6412..9f219716d 100644 --- a/src/app/groups/groups-routing.module.ts +++ b/src/app/groups/groups-routing.module.ts @@ -39,7 +39,7 @@ const routes: Routes = [ children: [ { path: '', - component: GroupsComponent, + component: GroupsComponent }, { path: 'create', @@ -122,7 +122,8 @@ const routes: Routes = [ children: [ { path: '', - redirectTo: '../committee', pathMatch: 'prefix' + redirectTo: '../committee', + pathMatch: 'prefix' }, { path: 'add-role', @@ -131,7 +132,7 @@ const routes: Routes = [ resolve: { groupAndTemplateData: GroupDataAndTemplateResolver } - }, + } ] }, { @@ -144,17 +145,18 @@ const routes: Routes = [ }, { path: 'loans-accounts', - loadChildren: () => import('../loans/loans.module').then(m => m.LoansModule) + loadChildren: () => import('../loans/loans.module').then((m) => m.LoansModule) }, { path: 'savings-accounts', - loadChildren: () => import('../savings/savings.module').then(m => m.SavingsModule) + loadChildren: () => import('../savings/savings.module').then((m) => m.SavingsModule) } ] } ] } ]) + ]; /** @@ -165,15 +167,17 @@ const routes: Routes = [ @NgModule({ imports: [RouterModule.forChild(routes)], exports: [RouterModule], - providers: [GroupViewResolver, - GroupAccountsResolver, - GroupSummaryResolver, - GroupNotesResolver, - GroupDatatablesResolver, - GroupDatatableResolver, - GroupDataAndTemplateResolver, - GroupActionsResolver, - GSIMAccountsResolver, - GLIMAccountsResolver] + providers: [ + GroupViewResolver, + GroupAccountsResolver, + GroupSummaryResolver, + GroupNotesResolver, + GroupDatatablesResolver, + GroupDatatableResolver, + GroupDataAndTemplateResolver, + GroupActionsResolver, + GSIMAccountsResolver, + GLIMAccountsResolver + ] }) -export class GroupsRoutingModule { } +export class GroupsRoutingModule {} diff --git a/src/app/groups/groups-view/add-role/add-role.component.spec.ts b/src/app/groups/groups-view/add-role/add-role.component.spec.ts index 3efbbf4bf..c57d273e2 100644 --- a/src/app/groups/groups-view/add-role/add-role.component.spec.ts +++ b/src/app/groups/groups-view/add-role/add-role.component.spec.ts @@ -8,9 +8,8 @@ describe('AddRoleComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AddRoleComponent ] - }) - .compileComponents(); + declarations: [AddRoleComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/add-role/add-role.component.ts b/src/app/groups/groups-view/add-role/add-role.component.ts index 51da1fca8..1124e80d4 100644 --- a/src/app/groups/groups-view/add-role/add-role.component.ts +++ b/src/app/groups/groups-view/add-role/add-role.component.ts @@ -15,7 +15,6 @@ import { GroupsService } from '../../groups.service'; styleUrls: ['./add-role.component.scss'] }) export class AddRoleComponent implements OnInit { - /** Groups Add Role Form */ groupsAddRoleForm: UntypedFormGroup; /** Client Member Data */ @@ -31,10 +30,12 @@ export class AddRoleComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private groupsService: GroupsService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private groupsService: GroupsService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { groupAndTemplateData: any }) => { this.groupAndTemplateData = data.groupAndTemplateData; }); @@ -51,8 +52,14 @@ export class AddRoleComponent implements OnInit { */ createGroupsAddRoleForm() { this.groupsAddRoleForm = this.formBuilder.group({ - 'clientId': ['', Validators.required], - 'role': ['', Validators.required] + clientId: [ + '', + Validators.required + ], + role: [ + '', + Validators.required + ] }); } @@ -60,9 +67,10 @@ export class AddRoleComponent implements OnInit { * Submits the form and assigns the group role. */ submit() { - this.groupsService.executeGroupCommand(this.groupAndTemplateData.id, 'assignRole', this.groupsAddRoleForm.value).subscribe(() => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.groupsService + .executeGroupCommand(this.groupAndTemplateData.id, 'assignRole', this.groupsAddRoleForm.value) + .subscribe(() => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/groups/groups-view/committee-tab/committee-tab.component.spec.ts b/src/app/groups/groups-view/committee-tab/committee-tab.component.spec.ts index 6c150a36b..440f1cfb6 100644 --- a/src/app/groups/groups-view/committee-tab/committee-tab.component.spec.ts +++ b/src/app/groups/groups-view/committee-tab/committee-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('CommitteeTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CommitteeTabComponent ] - }) - .compileComponents(); + declarations: [CommitteeTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/committee-tab/committee-tab.component.ts b/src/app/groups/groups-view/committee-tab/committee-tab.component.ts index 499d416d8..7f76ebd65 100644 --- a/src/app/groups/groups-view/committee-tab/committee-tab.component.ts +++ b/src/app/groups/groups-view/committee-tab/committee-tab.component.ts @@ -19,7 +19,6 @@ import { GroupsService } from 'app/groups/groups.service'; styleUrls: ['./committee-tab.component.scss'] }) export class CommitteeTabComponent { - /** Group Status */ groupStatus: any; /** Group Roles Data */ @@ -27,7 +26,12 @@ export class CommitteeTabComponent { /** Groups View Data */ groupViewData: any; /** Columns to be Displayed for client members table */ - groupRolesColumns: string[] = ['Name', 'Role', 'Client Id', 'Actions']; + groupRolesColumns: string[] = [ + 'Name', + 'Role', + 'Client Id', + 'Actions' + ]; /** Roles Table */ @ViewChild('rolesTable') rolesTableRef: MatTable; @@ -38,9 +42,11 @@ export class CommitteeTabComponent { * @param {GroupsService} groupsService Groups Service * @param {MatDialog} dialog Mat Dialog */ - constructor(private route: ActivatedRoute, - private groupsService: GroupsService, - public dialog: MatDialog) { + constructor( + private route: ActivatedRoute, + private groupsService: GroupsService, + public dialog: MatDialog + ) { this.route.parent.data.subscribe((data: { groupViewData: any }) => { this.groupViewData = data.groupViewData; this.groupRolesData = this.groupViewData.groupRoles; @@ -65,5 +71,4 @@ export class CommitteeTabComponent { } }); } - } diff --git a/src/app/groups/groups-view/custom-dialogs/unassign-role-dialog/unassign-role-dialog.component.spec.ts b/src/app/groups/groups-view/custom-dialogs/unassign-role-dialog/unassign-role-dialog.component.spec.ts index 4b5605021..79cd70d60 100644 --- a/src/app/groups/groups-view/custom-dialogs/unassign-role-dialog/unassign-role-dialog.component.spec.ts +++ b/src/app/groups/groups-view/custom-dialogs/unassign-role-dialog/unassign-role-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('UnassignRoleDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UnassignRoleDialogComponent ] - }) - .compileComponents(); + declarations: [UnassignRoleDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/custom-dialogs/unassign-role-dialog/unassign-role-dialog.component.ts b/src/app/groups/groups-view/custom-dialogs/unassign-role-dialog/unassign-role-dialog.component.ts index 6ff199ecb..11e6e59a4 100644 --- a/src/app/groups/groups-view/custom-dialogs/unassign-role-dialog/unassign-role-dialog.component.ts +++ b/src/app/groups/groups-view/custom-dialogs/unassign-role-dialog/unassign-role-dialog.component.ts @@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./unassign-role-dialog.component.scss'] }) export class UnassignRoleDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/groups/groups-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.spec.ts b/src/app/groups/groups-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.spec.ts index 1eaed45f3..bd5e9f305 100644 --- a/src/app/groups/groups-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.spec.ts +++ b/src/app/groups/groups-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('UnassignStaffDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UnassignStaffDialogComponent ] - }) - .compileComponents(); + declarations: [UnassignStaffDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.ts b/src/app/groups/groups-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.ts index e6197eba8..a1b0a7854 100644 --- a/src/app/groups/groups-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.ts +++ b/src/app/groups/groups-view/custom-dialogs/unassign-staff-dialog/unassign-staff-dialog.component.ts @@ -11,10 +11,8 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./unassign-staff-dialog.component.scss'] }) export class UnassignStaffDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. */ - constructor(public dialogRef: MatDialogRef) { } - + constructor(public dialogRef: MatDialogRef) {} } diff --git a/src/app/groups/groups-view/datatable-tabs/datatable-tabs.component.spec.ts b/src/app/groups/groups-view/datatable-tabs/datatable-tabs.component.spec.ts index 0f1dfa604..571f3ae93 100644 --- a/src/app/groups/groups-view/datatable-tabs/datatable-tabs.component.spec.ts +++ b/src/app/groups/groups-view/datatable-tabs/datatable-tabs.component.spec.ts @@ -8,9 +8,8 @@ describe('DatatableTabsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DatatableTabsComponent ] - }) - .compileComponents(); + declarations: [DatatableTabsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/datatable-tabs/datatable-tabs.component.ts b/src/app/groups/groups-view/datatable-tabs/datatable-tabs.component.ts index 6353836cb..89b5e95d6 100644 --- a/src/app/groups/groups-view/datatable-tabs/datatable-tabs.component.ts +++ b/src/app/groups/groups-view/datatable-tabs/datatable-tabs.component.ts @@ -11,7 +11,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./datatable-tabs.component.scss'] }) export class DatatableTabsComponent { - entityId: string; /** Group Datatable */ entityDatatable: any; @@ -30,5 +29,4 @@ export class DatatableTabsComponent { this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); } - } diff --git a/src/app/groups/groups-view/general-tab/general-tab.component.spec.ts b/src/app/groups/groups-view/general-tab/general-tab.component.spec.ts index 68ff6503e..53d6cbc31 100644 --- a/src/app/groups/groups-view/general-tab/general-tab.component.spec.ts +++ b/src/app/groups/groups-view/general-tab/general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GeneralTabComponent ] - }) - .compileComponents(); + declarations: [GeneralTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/general-tab/general-tab.component.ts b/src/app/groups/groups-view/general-tab/general-tab.component.ts index d4f5a38ac..2ca4dd0c1 100644 --- a/src/app/groups/groups-view/general-tab/general-tab.component.ts +++ b/src/app/groups/groups-view/general-tab/general-tab.component.ts @@ -11,7 +11,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./general-tab.component.scss'] }) export class GeneralTabComponent { - /** Group's all accounts data */ groupAccountData: any; /** Group's loan accounts data */ @@ -27,19 +26,62 @@ export class GeneralTabComponent { /** Group's Client Members */ groupClientMembers: any; /** Columns to be Displayed for client members table */ - clientMemberColumns: string[] = ['Name', 'Account No', 'Office', 'JLG Loan Application']; + clientMemberColumns: string[] = [ + 'Name', + 'Account No', + 'Office', + 'JLG Loan Application' + ]; /** Columns to be displayed for open loan accounts table */ - openLoansColumns: string[] = ['Account No', 'Loan Account', 'Original Loan', 'Loan Balance', 'Amount Paid', 'Type', 'Actions']; + openLoansColumns: string[] = [ + 'Account No', + 'Loan Account', + 'Original Loan', + 'Loan Balance', + 'Amount Paid', + 'Type', + 'Actions' + ]; /** Columns to be displayed for closed loan accounts table */ - closedLoansColumns: string[] = ['Account No', 'Loan Account', 'Original Loan', 'Loan Balance', 'Amount Paid', 'Type', 'Closed Date']; + closedLoansColumns: string[] = [ + 'Account No', + 'Loan Account', + 'Original Loan', + 'Loan Balance', + 'Amount Paid', + 'Type', + 'Closed Date' + ]; /** Columns to be displayed for open savings accounts table */ - openSavingsColumns: string[] = ['Account No', 'Saving Account', 'Last Active', 'Balance', 'Actions']; + openSavingsColumns: string[] = [ + 'Account No', + 'Saving Account', + 'Last Active', + 'Balance', + 'Actions' + ]; /** Columns to be displayed for closed accounts table */ - closedSavingsColumns: string[] = ['Account No', 'Saving Account', 'Closed Date']; + closedSavingsColumns: string[] = [ + 'Account No', + 'Saving Account', + 'Closed Date' + ]; /** Columns to be displayed for GSIM Accounts Table */ - gsimAccountsColumns: string[] = ['GSIM Id', 'Account Number', 'Product', 'Balance', 'Status']; + gsimAccountsColumns: string[] = [ + 'GSIM Id', + 'Account Number', + 'Product', + 'Balance', + 'Status' + ]; /** Columns to be displayed for GLIM Accounts Table */ - glimAccountsColumns: string[] = ['GLIM Id', 'Account Number', 'Product', 'Original Loan', 'Status']; + glimAccountsColumns: string[] = [ + 'GLIM Id', + 'Account Number', + 'Product', + 'Original Loan', + 'Status' + ]; /** Boolean for toggling loan accounts table */ showClosedLoanAccounts = false; /** Boolean for toggling savings accounts table */ @@ -50,14 +92,16 @@ export class GeneralTabComponent { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe((data: { groupAccountsData: any, groupClientMembers: any, groupSummary: any, glimData: any, gsimData: any }) => { - this.glimAccounts = data.glimData; - this.gsimAccounts = data.gsimData; - this.groupAccountData = data.groupAccountsData; - this.savingAccounts = data.groupAccountsData.savingsAccounts; - this.loanAccounts = data.groupAccountsData.loanAccounts; - this.groupSummary = data.groupSummary[0]; - }); + this.route.data.subscribe( + (data: { groupAccountsData: any; groupClientMembers: any; groupSummary: any; glimData: any; gsimData: any }) => { + this.glimAccounts = data.glimData; + this.gsimAccounts = data.gsimData; + this.groupAccountData = data.groupAccountsData; + this.savingAccounts = data.groupAccountsData.savingsAccounts; + this.loanAccounts = data.groupAccountsData.loanAccounts; + this.groupSummary = data.groupSummary[0]; + } + ); this.route.parent.data.subscribe((data: { groupViewData: any }) => { this.groupClientMembers = data.groupViewData.clientMembers; }); @@ -84,5 +128,4 @@ export class GeneralTabComponent { routeEdit($event: MouseEvent) { $event.stopPropagation(); } - } diff --git a/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.spec.ts b/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.spec.ts index aeced6bba..4d0122776 100644 --- a/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.spec.ts +++ b/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.spec.ts @@ -8,9 +8,8 @@ describe('ActivateGroupComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ActivateGroupComponent ] - }) - .compileComponents(); + declarations: [ActivateGroupComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.ts b/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.ts index 1bf5431af..c96524c24 100644 --- a/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.ts +++ b/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./activate-group.component.scss'] }) export class ActivateGroupComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class ActivateGroupComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService SettingsService */ - constructor(private formBuilder: UntypedFormBuilder, - private groupsService: GroupsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private groupsService: GroupsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.groupId = this.route.parent.snapshot.params['groupId']; } @@ -54,7 +55,10 @@ export class ActivateGroupComponent implements OnInit { */ createActivateGroupForm() { this.activateGroupForm = this.formBuilder.group({ - 'activationDate': ['', Validators.required] + activationDate: [ + '', + Validators.required + ] }); } @@ -79,5 +83,4 @@ export class ActivateGroupComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.spec.ts b/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.spec.ts index 78ea9ef05..3b9938eb1 100644 --- a/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.spec.ts +++ b/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.spec.ts @@ -8,9 +8,8 @@ describe('AttachGroupMeetingComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AttachGroupMeetingComponent ] - }) - .compileComponents(); + declarations: [AttachGroupMeetingComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.ts b/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.ts index 5f9ceacf6..aa0ac61df 100644 --- a/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.ts +++ b/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./attach-group-meeting.component.scss'] }) export class AttachGroupMeetingComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -44,12 +43,14 @@ export class AttachGroupMeetingComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService SettingsService */ - constructor(private formBuilder: UntypedFormBuilder, - private groupsService: GroupsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private groupsService: GroupsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { groupActionData: any }) => { this.calendarTemplate = data.groupActionData; this.frequencyOptions = this.calendarTemplate.frequencyOptions; @@ -69,8 +70,11 @@ export class AttachGroupMeetingComponent implements OnInit { */ createGroupMeetingForm() { this.groupMeetingForm = this.formBuilder.group({ - 'startDate': ['', Validators.required], - 'repeating': [false] + startDate: [ + '', + Validators.required + ], + repeating: [false] }); } @@ -86,23 +90,49 @@ export class AttachGroupMeetingComponent implements OnInit { this.groupMeetingForm.removeControl('repeatsOnDay'); switch (frequency) { case 1: // Daily - this.repetitionIntervals = ['1', '2', '3']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3' + ]; + break; case 2: // Weekly - this.repetitionIntervals = ['1', '2', '3']; + this.repetitionIntervals = [ + '1', + '2', + '3' + ]; this.groupMeetingForm.addControl('repeatsOnDay', new UntypedFormControl('', Validators.required)); - break; + break; case 3: // Monthly - this.repetitionIntervals = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '10', + '11' + ]; + break; case 4: // Yearly - this.repetitionIntervals = ['1', '2', '3', '4', '5']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3', + '4', + '5' + ]; + break; } }); this.groupMeetingForm.patchValue({ - 'frequency': 1, - 'interval': '1' + frequency: 1, + interval: '1' }); } else { this.groupMeetingForm.removeControl('frequency'); @@ -119,7 +149,7 @@ export class AttachGroupMeetingComponent implements OnInit { const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; const title = `groups_${this.groupId}_CollectionMeeting`; - const typeId = groupMeetingFormData.repeating ? '1' : '4' ; + const typeId = groupMeetingFormData.repeating ? '1' : '4'; const prevStartDate: Date = this.groupMeetingForm.value.startDate; if (groupMeetingFormData.startDate instanceof Date) { groupMeetingFormData.startDate = this.dateUtils.formatDate(prevStartDate, dateFormat); @@ -135,5 +165,4 @@ export class AttachGroupMeetingComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/groups/groups-view/group-actions/close-group/close-group.component.spec.ts b/src/app/groups/groups-view/group-actions/close-group/close-group.component.spec.ts index dccb1e93d..1384e0db1 100644 --- a/src/app/groups/groups-view/group-actions/close-group/close-group.component.spec.ts +++ b/src/app/groups/groups-view/group-actions/close-group/close-group.component.spec.ts @@ -8,9 +8,8 @@ describe('CloseGroupComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CloseGroupComponent ] - }) - .compileComponents(); + declarations: [CloseGroupComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/group-actions/close-group/close-group.component.ts b/src/app/groups/groups-view/group-actions/close-group/close-group.component.ts index e88a3c960..c656429e0 100644 --- a/src/app/groups/groups-view/group-actions/close-group/close-group.component.ts +++ b/src/app/groups/groups-view/group-actions/close-group/close-group.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./close-group.component.scss'] }) export class CloseGroupComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -37,12 +36,14 @@ export class CloseGroupComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService SettingsService */ - constructor(private formBuilder: UntypedFormBuilder, - private groupsService: GroupsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private groupsService: GroupsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { groupActionData: any }) => { this.closureData = data.groupActionData.closureReasons; }); @@ -59,8 +60,14 @@ export class CloseGroupComponent implements OnInit { */ createCloseGroupForm() { this.closeGroupForm = this.formBuilder.group({ - 'closureDate': ['', Validators.required], - 'closureReasonId': ['', Validators.required] + closureDate: [ + '', + Validators.required + ], + closureReasonId: [ + '', + Validators.required + ] }); } @@ -84,5 +91,4 @@ export class CloseGroupComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.spec.ts b/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.spec.ts index 44f8fa7b0..cfcb2fc40 100644 --- a/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.spec.ts +++ b/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.spec.ts @@ -8,9 +8,8 @@ describe('EditGroupMeetingScheduleComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditGroupMeetingScheduleComponent ] - }) - .compileComponents(); + declarations: [EditGroupMeetingScheduleComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.ts b/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.ts index c5654eefa..8b1fdf60b 100644 --- a/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.ts +++ b/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-group-meeting-schedule.component.scss'] }) export class EditGroupMeetingScheduleComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -42,12 +41,14 @@ export class EditGroupMeetingScheduleComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService SettingsService */ - constructor(private formBuilder: UntypedFormBuilder, - private groupsService: GroupsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private groupsService: GroupsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { groupActionData: any }) => { this.calendarTemplate = data.groupActionData; this.nextMeetingDates = this.calendarTemplate.nextTenRecurringDates; @@ -66,8 +67,14 @@ export class EditGroupMeetingScheduleComponent implements OnInit { */ createEditMeetingScheduleForm() { this.groupEditMeetingScheduleForm = this.formBuilder.group({ - 'presentMeetingDate': ['', Validators.required], - 'newMeetingDate': ['', Validators.required] + presentMeetingDate: [ + '', + Validators.required + ], + newMeetingDate: [ + '', + Validators.required + ] }); } @@ -97,5 +104,4 @@ export class EditGroupMeetingScheduleComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.spec.ts b/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.spec.ts index 8bc2fdb0a..155324757 100644 --- a/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.spec.ts +++ b/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.spec.ts @@ -8,9 +8,8 @@ describe('EditGroupMeetingComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditGroupMeetingComponent ] - }) - .compileComponents(); + declarations: [EditGroupMeetingComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.ts b/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.ts index b40410396..5ffb8c2cf 100644 --- a/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.ts +++ b/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-group-meeting.component.scss'] }) export class EditGroupMeetingComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -46,12 +45,14 @@ export class EditGroupMeetingComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService SettingsService */ - constructor(private formBuilder: UntypedFormBuilder, - private groupsService: GroupsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private groupsService: GroupsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { groupActionData: any }) => { this.calendarTemplate = data.groupActionData; this.frequencyOptions = this.calendarTemplate.frequencyOptions; @@ -72,9 +73,18 @@ export class EditGroupMeetingComponent implements OnInit { */ createEditGroupMeetingForm() { this.groupEditMeetingForm = this.formBuilder.group({ - 'startDate': ['', Validators.required], - 'frequency': ['', Validators.required], - 'interval': ['', Validators.required] + startDate: [ + '', + Validators.required + ], + frequency: [ + '', + Validators.required + ], + interval: [ + '', + Validators.required + ] }); } @@ -86,25 +96,51 @@ export class EditGroupMeetingComponent implements OnInit { this.groupEditMeetingForm.removeControl('repeatsOnDay'); switch (frequency) { case 1: // Daily - this.repetitionIntervals = ['1', '2', '3']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3' + ]; + break; case 2: // Weekly - this.repetitionIntervals = ['1', '2', '3']; + this.repetitionIntervals = [ + '1', + '2', + '3' + ]; this.groupEditMeetingForm.addControl('repeatsOnDay', new UntypedFormControl('', Validators.required)); this.groupEditMeetingForm.get('repeatsOnDay').patchValue(this.calendarTemplate.repeatsOnDay.id); - break; + break; case 3: // Monthly - this.repetitionIntervals = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '10', + '11' + ]; + break; case 4: // Yearly - this.repetitionIntervals = ['1', '2', '3', '4', '5']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3', + '4', + '5' + ]; + break; } }); this.groupEditMeetingForm.patchValue({ - 'startDate': this.calendarTemplate.startDate && new Date(this.calendarTemplate.startDate), - 'frequency': this.calendarTemplate.frequency.id, - 'interval': `${this.calendarTemplate.interval}` + startDate: this.calendarTemplate.startDate && new Date(this.calendarTemplate.startDate), + frequency: this.calendarTemplate.frequency.id, + interval: `${this.calendarTemplate.interval}` }); } @@ -141,5 +177,4 @@ export class EditGroupMeetingComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/groups/groups-view/group-actions/group-actions.component.spec.ts b/src/app/groups/groups-view/group-actions/group-actions.component.spec.ts index bb65cca10..9d3b511cf 100644 --- a/src/app/groups/groups-view/group-actions/group-actions.component.spec.ts +++ b/src/app/groups/groups-view/group-actions/group-actions.component.spec.ts @@ -8,9 +8,8 @@ describe('GroupActionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GroupActionsComponent ] - }) - .compileComponents(); + declarations: [GroupActionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/group-actions/group-actions.component.ts b/src/app/groups/groups-view/group-actions/group-actions.component.ts index 0c1c06f45..673630050 100644 --- a/src/app/groups/groups-view/group-actions/group-actions.component.ts +++ b/src/app/groups/groups-view/group-actions/group-actions.component.ts @@ -11,24 +11,23 @@ import { ActivatedRoute, Router } from '@angular/router'; styleUrls: ['./group-actions.component.scss'] }) export class GroupActionsComponent { - /** Flag object to store possible actions and render appropriate UI to the user */ actions: { - 'Assign Staff': boolean - 'Close': boolean - 'Activate': boolean - 'Attach Meeting': boolean - 'Attendance': boolean - 'Manage Members': boolean - 'Edit Meeting': boolean - 'Edit Meeting Schedule': boolean - 'Transfer Clients': boolean + 'Assign Staff': boolean; + Close: boolean; + Activate: boolean; + 'Attach Meeting': boolean; + Attendance: boolean; + 'Manage Members': boolean; + 'Edit Meeting': boolean; + 'Edit Meeting Schedule': boolean; + 'Transfer Clients': boolean; } = { 'Assign Staff': false, - 'Close': false, - 'Activate': false, + Close: false, + Activate: false, 'Attach Meeting': false, - 'Attendance': false, + Attendance: false, 'Manage Members': false, 'Edit Meeting': false, 'Edit Meeting Schedule': false, @@ -39,11 +38,12 @@ export class GroupActionsComponent { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private route: ActivatedRoute, - private router: Router) { + constructor( + private route: ActivatedRoute, + private router: Router + ) { this.router.routeReuseStrategy.shouldReuseRoute = () => false; const action = this.route.snapshot.params['action']; this.actions[action] = true; } - } diff --git a/src/app/groups/groups-view/group-actions/group-assign-staff/group-assign-staff.component.spec.ts b/src/app/groups/groups-view/group-actions/group-assign-staff/group-assign-staff.component.spec.ts index 05ae8c3ab..5a19d0789 100644 --- a/src/app/groups/groups-view/group-actions/group-assign-staff/group-assign-staff.component.spec.ts +++ b/src/app/groups/groups-view/group-actions/group-assign-staff/group-assign-staff.component.spec.ts @@ -8,9 +8,8 @@ describe('GroupAssignStaffComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GroupAssignStaffComponent ] - }) - .compileComponents(); + declarations: [GroupAssignStaffComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/group-actions/group-assign-staff/group-assign-staff.component.ts b/src/app/groups/groups-view/group-actions/group-assign-staff/group-assign-staff.component.ts index 6ee3329a0..69af39956 100644 --- a/src/app/groups/groups-view/group-actions/group-assign-staff/group-assign-staff.component.ts +++ b/src/app/groups/groups-view/group-actions/group-assign-staff/group-assign-staff.component.ts @@ -15,7 +15,6 @@ import { GroupsService } from 'app/groups/groups.service'; styleUrls: ['./group-assign-staff.component.scss'] }) export class GroupAssignStaffComponent implements OnInit { - /** Group Assign Staff form. */ groupAssignStaffForm: UntypedFormGroup; /** Staff Data */ @@ -30,10 +29,12 @@ export class GroupAssignStaffComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private groupsService: GroupsService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private groupsService: GroupsService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { groupActionData: any }) => { this.groupData = data.groupActionData; }); @@ -49,7 +50,7 @@ export class GroupAssignStaffComponent implements OnInit { */ createGroupAssignStaffForm() { this.groupAssignStaffForm = this.formBuilder.group({ - 'staffId': [''] + staffId: [''] }); } @@ -57,10 +58,10 @@ export class GroupAssignStaffComponent implements OnInit { * Submits the form and assigns staff for the group. */ submit() { - this.groupsService.executeGroupCommand(this.groupData.id, 'assignStaff', this.groupAssignStaffForm.value) + this.groupsService + .executeGroupCommand(this.groupData.id, 'assignStaff', this.groupAssignStaffForm.value) .subscribe(() => { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/groups/groups-view/group-actions/group-attendance/group-attendance.component.spec.ts b/src/app/groups/groups-view/group-actions/group-attendance/group-attendance.component.spec.ts index 6898d6898..8d20554dc 100644 --- a/src/app/groups/groups-view/group-actions/group-attendance/group-attendance.component.spec.ts +++ b/src/app/groups/groups-view/group-actions/group-attendance/group-attendance.component.spec.ts @@ -8,9 +8,8 @@ describe('GroupAttendanceComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GroupAttendanceComponent ] - }) - .compileComponents(); + declarations: [GroupAttendanceComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/group-actions/group-attendance/group-attendance.component.ts b/src/app/groups/groups-view/group-actions/group-attendance/group-attendance.component.ts index 7f796e12d..567e3a6ff 100644 --- a/src/app/groups/groups-view/group-actions/group-attendance/group-attendance.component.ts +++ b/src/app/groups/groups-view/group-actions/group-attendance/group-attendance.component.ts @@ -25,7 +25,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./group-attendance.component.scss'] }) export class GroupAttendanceComponent implements OnInit { - /** Members data. */ membersData: any; /** Group Data */ @@ -33,7 +32,10 @@ export class GroupAttendanceComponent implements OnInit { /** Attendance Type Options */ attendanceTypeOptions: any; /** Columns to be displayed in member's attendance table. */ - displayedColumns: string[] = ['name', 'attendance']; + displayedColumns: string[] = [ + 'name', + 'attendance' + ]; /** Start Date Form Control */ meetingDate = new UntypedFormControl(); /** Meeting Dates Data */ @@ -50,13 +52,15 @@ export class GroupAttendanceComponent implements OnInit { * @param {MatDialog} dialog Mat Dialog * @param {SettingsService} settingsService SettingsService */ - constructor(private route: ActivatedRoute, - private dateUtils: Dates, - private router: Router, - private groupsService: GroupsService, - public dialog: MatDialog, - private settingsService: SettingsService) { - this.route.data.subscribe(( data: { groupActionData: any }) => { + constructor( + private route: ActivatedRoute, + private dateUtils: Dates, + private router: Router, + private groupsService: GroupsService, + public dialog: MatDialog, + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { groupActionData: any }) => { this.groupData = data.groupActionData; this.membersData = data.groupActionData.clientMembers; }); @@ -67,8 +71,9 @@ export class GroupAttendanceComponent implements OnInit { */ ngOnInit() { this.dataSource = this.membersData.map((member: any) => ({ clientId: member.id, attendanceType: 1 })); - this.meetingDates = this.groupData.collectionMeetingCalendar.recurringDates - .filter((date: any) => new Date(date).getTime() < new Date().getTime()); + this.meetingDates = this.groupData.collectionMeetingCalendar.recurringDates.filter( + (date: any) => new Date(date).getTime() < new Date().getTime() + ); this.getAttendanceOptions(); } @@ -76,7 +81,8 @@ export class GroupAttendanceComponent implements OnInit { * Gets attendance type options based on calendar id. */ getAttendanceOptions() { - this.groupsService.getMeetingsTemplate(this.groupData.id, this.groupData.collectionMeetingCalendar.id) + this.groupsService + .getMeetingsTemplate(this.groupData.id, this.groupData.collectionMeetingCalendar.id) .subscribe((response: any) => { this.attendanceTypeOptions = response.attendanceTypeOptions; }); @@ -94,7 +100,8 @@ export class GroupAttendanceComponent implements OnInit { value: member.attendanceType, options: { label: 'value', value: 'id', data: this.attendanceTypeOptions }, required: false - }), + }) + ]; const data = { title: 'Assign Member Attendance', @@ -126,9 +133,10 @@ export class GroupAttendanceComponent implements OnInit { dateFormat, locale }; - this.groupsService.assignGroupAttendance(this.groupData.id, this.groupData.collectionMeetingCalendar.id, data).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.groupsService + .assignGroupAttendance(this.groupData.id, this.groupData.collectionMeetingCalendar.id, data) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.spec.ts b/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.spec.ts index 7fee6bb40..667c356c2 100644 --- a/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.spec.ts +++ b/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.spec.ts @@ -8,9 +8,8 @@ describe('GroupTransferClientsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GroupTransferClientsComponent ] - }) - .compileComponents(); + declarations: [GroupTransferClientsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.ts b/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.ts index ada3ac2f1..962cb2aa8 100644 --- a/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.ts +++ b/src/app/groups/groups-view/group-actions/group-transfer-clients/group-transfer-clients.component.ts @@ -16,7 +16,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./group-transfer-clients.component.scss'] }) export class GroupTransferClientsComponent implements OnInit, AfterViewInit { - /** Transfer Clients form. */ transferClientsForm: UntypedFormGroup; /** Group Data */ @@ -36,11 +35,13 @@ export class GroupTransferClientsComponent implements OnInit, AfterViewInit { * @param {GroupsService} groupsService GroupsService. * @param {SettingsService} settingsService SettingsService */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private groupsService: GroupsService, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private groupsService: GroupsService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { groupActionData: any }) => { this.groupData = data.groupActionData; this.clientMembers = this.groupData.clientMembers; @@ -55,12 +56,11 @@ export class GroupTransferClientsComponent implements OnInit, AfterViewInit { * Subscribes to Groups search filter: */ ngAfterViewInit() { - this.transferClientsForm.get('destinationGroupId').valueChanges.subscribe( (value: string) => { + this.transferClientsForm.get('destinationGroupId').valueChanges.subscribe((value: string) => { if (value.length >= 2) { - this.groupsService.getFilteredGroups('name', 'ASC', value, this.groupData.officeId) - .subscribe( (data: any) => { - this.groupsData = data; - }); + this.groupsService.getFilteredGroups('name', 'ASC', value, this.groupData.officeId).subscribe((data: any) => { + this.groupsData = data; + }); } }); } @@ -70,9 +70,15 @@ export class GroupTransferClientsComponent implements OnInit, AfterViewInit { */ createTransferClientsForm() { this.transferClientsForm = this.formBuilder.group({ - 'clients': ['', Validators.required], - 'inheritDestinationGroupLoanOfficer': [false], - 'destinationGroupId': ['', Validators.required] + clients: [ + '', + Validators.required + ], + inheritDestinationGroupLoanOfficer: [false], + destinationGroupId: [ + '', + Validators.required + ] }); } @@ -100,5 +106,4 @@ export class GroupTransferClientsComponent implements OnInit, AfterViewInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/groups/groups-view/group-actions/manage-group-members/manage-group-members.component.spec.ts b/src/app/groups/groups-view/group-actions/manage-group-members/manage-group-members.component.spec.ts index d79a2182f..fb4644cf1 100644 --- a/src/app/groups/groups-view/group-actions/manage-group-members/manage-group-members.component.spec.ts +++ b/src/app/groups/groups-view/group-actions/manage-group-members/manage-group-members.component.spec.ts @@ -8,9 +8,8 @@ describe('ManageGroupMembersComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ManageGroupMembersComponent ] - }) - .compileComponents(); + declarations: [ManageGroupMembersComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/group-actions/manage-group-members/manage-group-members.component.ts b/src/app/groups/groups-view/group-actions/manage-group-members/manage-group-members.component.ts index be44d8397..4aeaf41a1 100644 --- a/src/app/groups/groups-view/group-actions/manage-group-members/manage-group-members.component.ts +++ b/src/app/groups/groups-view/group-actions/manage-group-members/manage-group-members.component.ts @@ -20,7 +20,6 @@ import { MatDialog } from '@angular/material/dialog'; styleUrls: ['./manage-group-members.component.scss'] }) export class ManageGroupMembersComponent implements AfterViewInit { - /** Group Data */ groupData: any; /** Client data. */ @@ -37,24 +36,26 @@ export class ManageGroupMembersComponent implements AfterViewInit { * @param {ClientsService} clientsService Clients Service * @param {MatDialog} dialog Mat Dialog */ - constructor(private route: ActivatedRoute, - private groupsService: GroupsService, - private clientsService: ClientsService, - public dialog: MatDialog) { + constructor( + private route: ActivatedRoute, + private groupsService: GroupsService, + private clientsService: ClientsService, + public dialog: MatDialog + ) { this.route.data.subscribe((data: { groupActionData: any }) => { this.groupData = data.groupActionData; this.clientMembers = data.groupActionData.clientMembers || []; }); } - /** * Subscribes to Clients search filter: */ ngAfterViewInit() { - this.clientChoice.valueChanges.subscribe( (value: string) => { + this.clientChoice.valueChanges.subscribe((value: string) => { if (value.length >= 2) { - this.clientsService.getFilteredClients('displayName', 'ASC', true, value, this.groupData.officeId) + this.clientsService + .getFilteredClients('displayName', 'ASC', true, value, this.groupData.officeId) .subscribe((data: any) => { this.clientsData = data.pageItems; }); @@ -67,8 +68,11 @@ export class ManageGroupMembersComponent implements AfterViewInit { */ addClient() { if (!this.clientMembers.includes(this.clientChoice.value)) { - this.groupsService.executeGroupCommand(this.groupData.id, 'associateClients', {clientMembers: [this.clientChoice.value.id]}) - .subscribe(() => { this.clientMembers.push(this.clientChoice.value); }); + this.groupsService + .executeGroupCommand(this.groupData.id, 'associateClients', { clientMembers: [this.clientChoice.value.id] }) + .subscribe(() => { + this.clientMembers.push(this.clientChoice.value); + }); } } @@ -83,8 +87,11 @@ export class ManageGroupMembersComponent implements AfterViewInit { }); removeMemberDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.groupsService.executeGroupCommand(this.groupData.id, 'disassociateClients', {clientMembers: [client.id]}) - .subscribe(() => { this.clientMembers.splice(index, 1); }); + this.groupsService + .executeGroupCommand(this.groupData.id, 'disassociateClients', { clientMembers: [client.id] }) + .subscribe(() => { + this.clientMembers.splice(index, 1); + }); } }); } @@ -97,5 +104,4 @@ export class ManageGroupMembersComponent implements AfterViewInit { displayClient(client: any): string | undefined { return client ? client.displayName : undefined; } - } diff --git a/src/app/groups/groups-view/groups-view.component.spec.ts b/src/app/groups/groups-view/groups-view.component.spec.ts index 9d47bb4b8..183b2de34 100644 --- a/src/app/groups/groups-view/groups-view.component.spec.ts +++ b/src/app/groups/groups-view/groups-view.component.spec.ts @@ -8,9 +8,8 @@ describe('GroupsViewComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GroupsViewComponent ] - }) - .compileComponents(); + declarations: [GroupsViewComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/groups-view.component.ts b/src/app/groups/groups-view/groups-view.component.ts index 8e1c9ac35..1440760cd 100644 --- a/src/app/groups/groups-view/groups-view.component.ts +++ b/src/app/groups/groups-view/groups-view.component.ts @@ -19,7 +19,6 @@ import { GroupsService } from '../groups.service'; styleUrls: ['./groups-view.component.scss'] }) export class GroupsViewComponent { - /** Group view data */ groupViewData: any; /** Group datatables data */ @@ -32,11 +31,13 @@ export class GroupsViewComponent { * @param {Router} router Router * @param {MatDialog} dialog Dialog */ - constructor(private route: ActivatedRoute, - private groupsService: GroupsService, - private router: Router, - public dialog: MatDialog) { - this.route.data.subscribe((data: { groupViewData: any, groupDatatables: any }) => { + constructor( + private route: ActivatedRoute, + private groupsService: GroupsService, + private router: Router, + public dialog: MatDialog + ) { + this.route.data.subscribe((data: { groupViewData: any; groupDatatables: any }) => { this.groupViewData = data.groupViewData; this.groupDatatables = data.groupDatatables; }); @@ -79,7 +80,7 @@ export class GroupsViewComponent { get editMeeting() { if (this.groupViewData.collectionMeetingCalendar) { const entityType = this.groupViewData.collectionMeetingCalendar.entityType.value; - if (entityType === 'GROUPS' && this.groupViewData.hierarchy === '.' + this.groupViewData.id + '.' ) { + if (entityType === 'GROUPS' && this.groupViewData.hierarchy === '.' + this.groupViewData.id + '.') { return true; } } @@ -92,8 +93,7 @@ export class GroupsViewComponent { */ reload() { const url: string = this.router.url; - this.router.navigateByUrl(`/groups`, {skipLocationChange: true}) - .then(() => this.router.navigate([url])); + this.router.navigateByUrl(`/groups`, { skipLocationChange: true }).then(() => this.router.navigate([url])); } /** @@ -103,7 +103,8 @@ export class GroupsViewComponent { const unAssignStaffDialogRef = this.dialog.open(UnassignStaffDialogComponent); unAssignStaffDialogRef.afterClosed().subscribe((response: { confirm: any }) => { if (response.confirm) { - this.groupsService.executeGroupCommand(this.groupViewData.id, 'unassignStaff', { staffId: this.groupViewData.staffId }) + this.groupsService + .executeGroupCommand(this.groupViewData.id, 'unassignStaff', { staffId: this.groupViewData.staffId }) .subscribe(() => { this.reload(); }); @@ -126,5 +127,4 @@ export class GroupsViewComponent { } }); } - } diff --git a/src/app/groups/groups-view/notes-tab/notes-tab.component.spec.ts b/src/app/groups/groups-view/notes-tab/notes-tab.component.spec.ts index add42af72..338a5d831 100644 --- a/src/app/groups/groups-view/notes-tab/notes-tab.component.spec.ts +++ b/src/app/groups/groups-view/notes-tab/notes-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('NotesTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ NotesTabComponent ] - }) - .compileComponents(); + declarations: [NotesTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/groups/groups-view/notes-tab/notes-tab.component.ts b/src/app/groups/groups-view/notes-tab/notes-tab.component.ts index 8e6b126ed..c35a28431 100644 --- a/src/app/groups/groups-view/notes-tab/notes-tab.component.ts +++ b/src/app/groups/groups-view/notes-tab/notes-tab.component.ts @@ -17,7 +17,6 @@ import { GroupsService } from '../../groups.service'; styleUrls: ['./notes-tab.component.scss'] }) export class NotesTabComponent { - /** Group ID */ entityId: string; /** Username */ @@ -31,9 +30,11 @@ export class NotesTabComponent { * @param {GroupsService} groupsService Groups Service * @param {AuthenticationService} authenticationService Authentication Service. */ - constructor(private route: ActivatedRoute, - private authenticationService: AuthenticationService, - private groupsService: GroupsService) { + constructor( + private route: ActivatedRoute, + private authenticationService: AuthenticationService, + private groupsService: GroupsService + ) { const savedCredentials = this.authenticationService.getCredentials(); this.username = savedCredentials.username; this.entityId = this.route.parent.snapshot.params['groupId']; @@ -72,10 +73,8 @@ export class NotesTabComponent { * @param {string} noteId Note Id. */ deleteNote(noteId: string, index: number) { - this.groupsService.deleteGroupNote(this.entityId, noteId) - .subscribe(() => { + this.groupsService.deleteGroupNote(this.entityId, noteId).subscribe(() => { this.entityNotes.splice(index, 1); }); } - } diff --git a/src/app/groups/groups.component.ts b/src/app/groups/groups.component.ts index 911e9ee1e..a7bf098b2 100644 --- a/src/app/groups/groups.component.ts +++ b/src/app/groups/groups.component.ts @@ -7,7 +7,7 @@ import { UntypedFormControl } from '@angular/forms'; /** rxjs Imports */ import { merge } from 'rxjs'; -import { tap, startWith, map, distinctUntilChanged, debounceTime} from 'rxjs/operators'; +import { tap, startWith, map, distinctUntilChanged, debounceTime } from 'rxjs/operators'; /** Custom Services */ import { GroupsService } from './groups.service'; @@ -29,7 +29,13 @@ export class GroupsComponent implements OnInit, AfterViewInit { /** Name form control. */ name = new UntypedFormControl(); /** Columns to be displayed in groups table. */ - displayedColumns = ['name', 'accountNo', 'externalId', 'status', 'officeName']; + displayedColumns = [ + 'name', + 'accountNo', + 'externalId', + 'status', + 'officeName' + ]; /** Data source for groups table. */ dataSource: GroupsDataSource; /** Groups filter. */ @@ -48,7 +54,7 @@ export class GroupsComponent implements OnInit, AfterViewInit { /** * @param {GroupsService} groupsService Groups Service */ - constructor(private groupsService: GroupsService) { } + constructor(private groupsService: GroupsService) {} ngOnInit() { this.getGroups(); @@ -60,7 +66,6 @@ export class GroupsComponent implements OnInit, AfterViewInit { * sort change and page change. */ ngAfterViewInit() { - this.name.valueChanges .pipe( debounceTime(500), @@ -71,12 +76,10 @@ export class GroupsComponent implements OnInit, AfterViewInit { ) .subscribe(); - this.sort.sortChange.subscribe(() => this.paginator.pageIndex = 0); + this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0)); merge(this.sort.sortChange, this.paginator.page) - .pipe( - tap(() => this.loadGroupsPage()) - ) + .pipe(tap(() => this.loadGroupsPage())) .subscribe(); } @@ -91,7 +94,14 @@ export class GroupsComponent implements OnInit, AfterViewInit { if (!this.sort.direction) { delete this.sort.active; } - this.dataSource.getGroups(this.filterGroupsBy, this.sort.active, this.sort.direction, this.paginator.pageIndex, this.paginator.pageSize, !this.showClosedGroups.checked); + this.dataSource.getGroups( + this.filterGroupsBy, + this.sort.active, + this.sort.direction, + this.paginator.pageIndex, + this.paginator.pageSize, + !this.showClosedGroups.checked + ); } /** @@ -101,7 +111,7 @@ export class GroupsComponent implements OnInit, AfterViewInit { */ applyFilter(filterValue: string, property: string) { this.paginator.pageIndex = 0; - const findIndex = this.filterGroupsBy.findIndex(filter => filter.type === property); + const findIndex = this.filterGroupsBy.findIndex((filter) => filter.type === property); this.filterGroupsBy[findIndex].value = filterValue; this.loadGroupsPage(); } @@ -111,7 +121,12 @@ export class GroupsComponent implements OnInit, AfterViewInit { */ getGroups() { this.dataSource = new GroupsDataSource(this.groupsService); - this.dataSource.getGroups(this.filterGroupsBy, this.sort.active, this.sort.direction, this.paginator.pageIndex, this.paginator.pageSize); + this.dataSource.getGroups( + this.filterGroupsBy, + this.sort.active, + this.sort.direction, + this.paginator.pageIndex, + this.paginator.pageSize + ); } - } diff --git a/src/app/groups/groups.datasource.ts b/src/app/groups/groups.datasource.ts index 16e06d455..8650eee43 100644 --- a/src/app/groups/groups.datasource.ts +++ b/src/app/groups/groups.datasource.ts @@ -11,7 +11,6 @@ import { GroupsService } from './groups.service'; * Groups custom data source to implement server side filtering, pagination and sorting. */ export class GroupsDataSource implements DataSource { - /** groups behavior subject to represent loaded groups page. */ private groupsSubject = new BehaviorSubject([]); /** Records subject to represent total number of filtered groups records. */ @@ -22,7 +21,7 @@ export class GroupsDataSource implements DataSource { /** * @param {GroupsService} groupsService Groups Service */ - constructor(private groupsService: GroupsService) { } + constructor(private groupsService: GroupsService) {} /** * Gets groups on the basis of provided parameters and emits the value. @@ -33,14 +32,20 @@ export class GroupsDataSource implements DataSource { * @param {number} limit Number of entries within the page. * @param {boolean} groupActive Specify whether to only filter active groups. */ - getGroups(filterBy: any, orderBy: string = '', sortOrder: string = '', pageIndex: number = 0, limit: number = 10, groupActive: boolean = true) { + getGroups( + filterBy: any, + orderBy: string = '', + sortOrder: string = '', + pageIndex: number = 0, + limit: number = 10, + groupActive: boolean = true + ) { this.groupsSubject.next([]); - this.groupsService.getGroups(filterBy, orderBy, sortOrder, pageIndex * limit, limit) - .subscribe((groups: any) => { - groups.pageItems = (groupActive) ? (groups.pageItems.filter((group: any) => group.active)) : groups.pageItems; - this.recordsSubject.next(groups.totalFilteredRecords); - this.groupsSubject.next(groups.pageItems); - }); + this.groupsService.getGroups(filterBy, orderBy, sortOrder, pageIndex * limit, limit).subscribe((groups: any) => { + groups.pageItems = groupActive ? groups.pageItems.filter((group: any) => group.active) : groups.pageItems; + this.recordsSubject.next(groups.totalFilteredRecords); + this.groupsSubject.next(groups.pageItems); + }); } /** @@ -57,5 +62,4 @@ export class GroupsDataSource implements DataSource { this.groupsSubject.complete(); this.recordsSubject.complete(); } - } diff --git a/src/app/groups/groups.module.ts b/src/app/groups/groups.module.ts index eb568ff84..29e041f09 100644 --- a/src/app/groups/groups.module.ts +++ b/src/app/groups/groups.module.ts @@ -65,6 +65,6 @@ import { GroupTransferClientsComponent } from './groups-view/group-actions/group EditGroupMeetingScheduleComponent, GroupTransferClientsComponent ], - providers: [ ] + providers: [] }) -export class GroupsModule { } +export class GroupsModule {} diff --git a/src/app/groups/groups.service.ts b/src/app/groups/groups.service.ts index 67d6908f4..07ab6f148 100644 --- a/src/app/groups/groups.service.ts +++ b/src/app/groups/groups.service.ts @@ -9,14 +9,13 @@ import { Observable } from 'rxjs'; * Groups service. */ @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class GroupsService { - /** * @param {HttpClient} http Http Client to send requests. */ - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * @param {any} filterBy Properties by which entries should be filtered. @@ -50,11 +49,14 @@ export class GroupsService { * @param {any} orphansOnly? Orphans Only. * @returns {Observable} Groups. */ - getFilteredGroups(orderBy: string, sortOrder: string, name: string, officeId?: any, orphansOnly?: any): Observable { - let httpParams = new HttpParams() - .set('name', name) - .set('sortOrder', sortOrder) - .set('orderBy', orderBy); + getFilteredGroups( + orderBy: string, + sortOrder: string, + name: string, + officeId?: any, + orphansOnly?: any + ): Observable { + let httpParams = new HttpParams().set('name', name).set('sortOrder', sortOrder).set('orderBy', orderBy); if (officeId) { httpParams = httpParams.set('officeId', officeId); } @@ -68,7 +70,7 @@ export class GroupsService { */ getGroupsByOfficeId(officeId: number): Observable { const httpParams = new HttpParams().set('officeId', officeId.toString()); - return this.http.get('/groups', { params: httpParams } ); + return this.http.get('/groups', { params: httpParams }); } /** @@ -87,8 +89,7 @@ export class GroupsService { * @returns {Observable} Group Summary data. */ getGroupSummary(groupId: string): Observable { - const httpParams = new HttpParams().set('R_groupId', groupId) - .set('genericResultSet', 'false'); + const httpParams = new HttpParams().set('R_groupId', groupId).set('genericResultSet', 'false'); return this.http.get(`/runreports/GroupSummaryCounts`, { params: httpParams }); } @@ -212,9 +213,7 @@ export class GroupsService { * @returns {Observable} */ unAssignRoleCommand(groupId: string, roleId: any): Observable { - const httpParams = new HttpParams() - .set('command', 'unassignRole') - .set('roleId', roleId); + const httpParams = new HttpParams().set('command', 'unassignRole').set('roleId', roleId); return this.http.post(`/groups/${groupId}`, {}, { params: httpParams }); } @@ -306,9 +305,7 @@ export class GroupsService { * @returns {Observable} Staff Data for group. */ getStaff(id: number): Observable { - const httpParams = new HttpParams() - .set('officeId', id.toString()) - .set('staffInSelectedOfficeOnly', 'true'); + const httpParams = new HttpParams().set('officeId', id.toString()).set('staffInSelectedOfficeOnly', 'true'); return this.http.get('/groups/template', { params: httpParams }); } @@ -316,7 +313,7 @@ export class GroupsService { * @param groupId Group Id of group to get data for. * @returns {Observable} Group GLIM Accounts data. */ - getGLIMAccountsData(groupId: string): Observable { + getGLIMAccountsData(groupId: string): Observable { return this.http.get(`/groups/${groupId}/glimaccounts`); } @@ -324,8 +321,7 @@ export class GroupsService { * @param groupId Group Id of group to get data for. * @returns {Observable} Group GSIM Accounts data. */ - getGSIMAccountsData(groupId: string): Observable { + getGSIMAccountsData(groupId: string): Observable { return this.http.get(`/groups/${groupId}/gsimaccounts`); } - } diff --git a/src/app/home/activities.ts b/src/app/home/activities.ts index a3ba8d81a..8956e29d4 100644 --- a/src/app/home/activities.ts +++ b/src/app/home/activities.ts @@ -1,62 +1,62 @@ const activities: any[] = [ - { activity: 'client', path: '/clients'}, - { activity: 'groups', path: '/groups'}, - { activity: 'centers', path: '/centers'}, - { activity: 'accounting', path: '/accounting'}, - { activity: 'users', path: '/users'}, - { activity: 'organization', path: '/organization'}, - { activity: 'system', path: '/system'}, - { activity: 'templates', path: '/templates'}, - { activity: 'self-service users', path: '/self-service/users'}, - { activity: 'self-service app-configuration', path: '/self-service/app-configuration'}, - { activity: 'task management', path: '/self-service/task-management'}, - { activity: 'create group', path: ''}, - { activity: 'create center', path: '/centers/create'}, - { activity: 'configuration', path: '/system/global-configurations'}, - { activity: 'tasks', path: '/self-service/task-management'}, - { activity: 'create template', path: '/self-service/task-management'}, - { activity: 'create loan product', path: '/products/loan-products/create'}, - { activity: 'create saving product', path: '/products/saving-products/create'}, - { activity: 'roles', path: '/system/roles-and-permissions'}, - { activity: 'add role', path: '/system/roles-and-permissions/add'}, - { activity: 'configure maker checker tasks', path: ''}, - { activity: 'loan products', path: '/products/loan-products'}, - { activity: 'charges', path: '/products/charges'}, - { activity: 'saving products', path: '/products/saving-products'}, - { activity: 'offices', path: '/organization/offices'}, - { activity: 'create office', path: '/organization/offices/create'}, - { activity: 'currency configurations', path: '/organization/currencies'}, - { activity: 'user settings', path: ''}, - { activity: 'employees', path: '/organization/employees'}, - { activity: 'create employee', path: '/organization/employees/create'}, - { activity: 'manage funds', path: ''}, - { activity: 'chart of accounts', path: '/accounting/chart-of-accounts'}, - { activity: 'frequent postings', path: '/accounting/frequent-postings'}, - { activity: 'journal entry', path: '/accounting/journal-entries'}, - { activity: 'search transaction', path: ''}, - { activity: 'account closure', path: '/accounting/closing-entries'}, - { activity: 'accounting rules', path: '/accounting/accounting-rules'}, - { activity: 'add accounting rule', path: '/accounting/accounting-rules/create'}, - { activity: 'data tables', path: '/system/data-tables'}, - { activity: 'create data table', path: '/system/data-tables/create'}, - { activity: 'add code', path: '/system/codes/create'}, - { activity: 'jobs', path: '/system/scheduler-jobs'}, - { activity: 'codes', path: '/system/codes'}, - { activity: 'reports', path: '/reports'}, - { activity: 'create report', path: ''}, - { activity: 'holidays', path: '/organization/holidays'}, - { activity: 'create holiday', path: ''}, - { activity: 'add member', path: '/clients/:clientId/family-members/add'}, - { activity: 'create charge', path: ''}, - { activity: 'enter collection sheet', path: ''}, - { activity: 'product mix', path: '/products/products-mix'}, - { activity: 'add product mix', path: ''}, - { activity: 'bulk loan reassignment', path: '/accounting/closing-entries/create'}, - { activity: 'audit', path: '/products/audit-trails'}, - { activity: 'create accounting closure', path: ''}, - { activity: 'navigation', path: '/navigation'}, - { activity: 'system users', path: '/self-service/users'}, - { activity: '', path: 'home'} + { activity: 'client', path: '/clients' }, + { activity: 'groups', path: '/groups' }, + { activity: 'centers', path: '/centers' }, + { activity: 'accounting', path: '/accounting' }, + { activity: 'users', path: '/users' }, + { activity: 'organization', path: '/organization' }, + { activity: 'system', path: '/system' }, + { activity: 'templates', path: '/templates' }, + { activity: 'self-service users', path: '/self-service/users' }, + { activity: 'self-service app-configuration', path: '/self-service/app-configuration' }, + { activity: 'task management', path: '/self-service/task-management' }, + { activity: 'create group', path: '' }, + { activity: 'create center', path: '/centers/create' }, + { activity: 'configuration', path: '/system/global-configurations' }, + { activity: 'tasks', path: '/self-service/task-management' }, + { activity: 'create template', path: '/self-service/task-management' }, + { activity: 'create loan product', path: '/products/loan-products/create' }, + { activity: 'create saving product', path: '/products/saving-products/create' }, + { activity: 'roles', path: '/system/roles-and-permissions' }, + { activity: 'add role', path: '/system/roles-and-permissions/add' }, + { activity: 'configure maker checker tasks', path: '' }, + { activity: 'loan products', path: '/products/loan-products' }, + { activity: 'charges', path: '/products/charges' }, + { activity: 'saving products', path: '/products/saving-products' }, + { activity: 'offices', path: '/organization/offices' }, + { activity: 'create office', path: '/organization/offices/create' }, + { activity: 'currency configurations', path: '/organization/currencies' }, + { activity: 'user settings', path: '' }, + { activity: 'employees', path: '/organization/employees' }, + { activity: 'create employee', path: '/organization/employees/create' }, + { activity: 'manage funds', path: '' }, + { activity: 'chart of accounts', path: '/accounting/chart-of-accounts' }, + { activity: 'frequent postings', path: '/accounting/frequent-postings' }, + { activity: 'journal entry', path: '/accounting/journal-entries' }, + { activity: 'search transaction', path: '' }, + { activity: 'account closure', path: '/accounting/closing-entries' }, + { activity: 'accounting rules', path: '/accounting/accounting-rules' }, + { activity: 'add accounting rule', path: '/accounting/accounting-rules/create' }, + { activity: 'data tables', path: '/system/data-tables' }, + { activity: 'create data table', path: '/system/data-tables/create' }, + { activity: 'add code', path: '/system/codes/create' }, + { activity: 'jobs', path: '/system/scheduler-jobs' }, + { activity: 'codes', path: '/system/codes' }, + { activity: 'reports', path: '/reports' }, + { activity: 'create report', path: '' }, + { activity: 'holidays', path: '/organization/holidays' }, + { activity: 'create holiday', path: '' }, + { activity: 'add member', path: '/clients/:clientId/family-members/add' }, + { activity: 'create charge', path: '' }, + { activity: 'enter collection sheet', path: '' }, + { activity: 'product mix', path: '/products/products-mix' }, + { activity: 'add product mix', path: '' }, + { activity: 'bulk loan reassignment', path: '/accounting/closing-entries/create' }, + { activity: 'audit', path: '/products/audit-trails' }, + { activity: 'create accounting closure', path: '' }, + { activity: 'navigation', path: '/navigation' }, + { activity: 'system users', path: '/self-service/users' }, + { activity: '', path: 'home' } ]; export { activities }; diff --git a/src/app/home/dashboard/amount-collected-pie/amount-collected-pie.component.spec.ts b/src/app/home/dashboard/amount-collected-pie/amount-collected-pie.component.spec.ts index 04f576807..054c3834c 100644 --- a/src/app/home/dashboard/amount-collected-pie/amount-collected-pie.component.spec.ts +++ b/src/app/home/dashboard/amount-collected-pie/amount-collected-pie.component.spec.ts @@ -8,9 +8,8 @@ describe('AmountCollectedPieComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AmountCollectedPieComponent ] - }) - .compileComponents(); + declarations: [AmountCollectedPieComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/home/dashboard/amount-collected-pie/amount-collected-pie.component.ts b/src/app/home/dashboard/amount-collected-pie/amount-collected-pie.component.ts index 7ecc4e1ec..af94f9ef1 100644 --- a/src/app/home/dashboard/amount-collected-pie/amount-collected-pie.component.ts +++ b/src/app/home/dashboard/amount-collected-pie/amount-collected-pie.component.ts @@ -18,7 +18,6 @@ import Chart from 'chart.js'; styleUrls: ['./amount-collected-pie.component.scss'] }) export class AmountCollectedPieComponent implements OnInit { - /** Static Form control for office Id */ officeId = new UntypedFormControl(); /** Office Data */ @@ -35,9 +34,11 @@ export class AmountCollectedPieComponent implements OnInit { * @param {HomeService} homeService Home Service. * @param {ActivatedRoute} route Activated Route. */ - constructor(private homeService: HomeService, - private route: ActivatedRoute) { - this.route.data.subscribe( (data: { offices: any }) => { + constructor( + private homeService: HomeService, + private route: ActivatedRoute + ) { + this.route.data.subscribe((data: { offices: any }) => { this.officeData = data.offices; }); } @@ -57,7 +58,7 @@ export class AmountCollectedPieComponent implements OnInit { getChartData() { this.officeId.valueChanges.subscribe((value: number) => { this.homeService.getCollectedAmount(value).subscribe((response: any) => { - const data = Object.entries(response[0]).map(entry => entry[1]); + const data = Object.entries(response[0]).map((entry) => entry[1]); if (!(data[0] === 0 && data[1] === 0)) { this.setChart(data); this.hideOutput = false; @@ -80,11 +81,19 @@ export class AmountCollectedPieComponent implements OnInit { this.chart = new Chart('collection-pie', { type: 'doughnut', data: { - labels: ['Pending', 'Collected'], - datasets: [{ - backgroundColor: ['dodgerblue', 'red'], - data: data - }] + labels: [ + 'Pending', + 'Collected' + ], + datasets: [ + { + backgroundColor: [ + 'dodgerblue', + 'red' + ], + data: data + } + ] }, options: { layout: { @@ -100,5 +109,4 @@ export class AmountCollectedPieComponent implements OnInit { this.chart.update(); } } - } diff --git a/src/app/home/dashboard/amount-disbursed-pie/amount-disbursed-pie.component.spec.ts b/src/app/home/dashboard/amount-disbursed-pie/amount-disbursed-pie.component.spec.ts index 2921cde16..8923d30a7 100644 --- a/src/app/home/dashboard/amount-disbursed-pie/amount-disbursed-pie.component.spec.ts +++ b/src/app/home/dashboard/amount-disbursed-pie/amount-disbursed-pie.component.spec.ts @@ -8,9 +8,8 @@ describe('AmountDisbursedPieComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AmountDisbursedPieComponent ] - }) - .compileComponents(); + declarations: [AmountDisbursedPieComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/home/dashboard/amount-disbursed-pie/amount-disbursed-pie.component.ts b/src/app/home/dashboard/amount-disbursed-pie/amount-disbursed-pie.component.ts index d0a7e1195..25a2443e3 100644 --- a/src/app/home/dashboard/amount-disbursed-pie/amount-disbursed-pie.component.ts +++ b/src/app/home/dashboard/amount-disbursed-pie/amount-disbursed-pie.component.ts @@ -18,26 +18,27 @@ import Chart from 'chart.js'; styleUrls: ['./amount-disbursed-pie.component.scss'] }) export class AmountDisbursedPieComponent implements OnInit { - - /** Static Form control for office Id */ - officeId = new UntypedFormControl(); - /** Office Data */ - officeData: any; - /** Chart.js chart */ - chart: any; - /** Substitute for resolver */ - hideOutput = true; - /** Shows fallback element */ - showFallback = true; + /** Static Form control for office Id */ + officeId = new UntypedFormControl(); + /** Office Data */ + officeData: any; + /** Chart.js chart */ + chart: any; + /** Substitute for resolver */ + hideOutput = true; + /** Shows fallback element */ + showFallback = true; /** * Fetches offices data from `resolve`. * @param {HomeService} homeService Home Service. * @param {ActivatedRoute} route Activated Route. */ - constructor(private homeService: HomeService, - private route: ActivatedRoute) { - this.route.data.subscribe( (data: { offices: any }) => { + constructor( + private homeService: HomeService, + private route: ActivatedRoute + ) { + this.route.data.subscribe((data: { offices: any }) => { this.officeData = data.offices; }); } @@ -57,7 +58,7 @@ export class AmountDisbursedPieComponent implements OnInit { getChartData() { this.officeId.valueChanges.subscribe((value: number) => { this.homeService.getDisbursedAmount(value).subscribe((response: any) => { - const data = Object.entries(response[0]).map(entry => entry[1]); + const data = Object.entries(response[0]).map((entry) => entry[1]); if (!(data[0] === 0 && data[1] === 0)) { this.setChart(data); this.showFallback = false; @@ -80,11 +81,19 @@ export class AmountDisbursedPieComponent implements OnInit { this.chart = new Chart('disbursement-pie', { type: 'doughnut', data: { - labels: ['Pending', 'Disbursed'], - datasets: [{ - backgroundColor: ['dodgerblue', 'red'], - data: data - }] + labels: [ + 'Pending', + 'Disbursed' + ], + datasets: [ + { + backgroundColor: [ + 'dodgerblue', + 'red' + ], + data: data + } + ] }, options: { layout: { @@ -100,5 +109,4 @@ export class AmountDisbursedPieComponent implements OnInit { this.chart.update(); } } - } diff --git a/src/app/home/dashboard/client-trends-bar/client-trends-bar.component.spec.ts b/src/app/home/dashboard/client-trends-bar/client-trends-bar.component.spec.ts index ad6f0639e..c62c8b690 100644 --- a/src/app/home/dashboard/client-trends-bar/client-trends-bar.component.spec.ts +++ b/src/app/home/dashboard/client-trends-bar/client-trends-bar.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientTrendsBarComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClientTrendsBarComponent ] - }) - .compileComponents(); + declarations: [ClientTrendsBarComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/home/dashboard/client-trends-bar/client-trends-bar.component.ts b/src/app/home/dashboard/client-trends-bar/client-trends-bar.component.ts index 7cb5aded8..c1a7a5bfe 100644 --- a/src/app/home/dashboard/client-trends-bar/client-trends-bar.component.ts +++ b/src/app/home/dashboard/client-trends-bar/client-trends-bar.component.ts @@ -23,7 +23,6 @@ import Chart from 'chart.js'; styleUrls: ['./client-trends-bar.component.scss'] }) export class ClientTrendsBarComponent implements OnInit { - /** Static Form control for office Id */ officeId = new UntypedFormControl(); /** Static Form control for time scale */ @@ -41,10 +40,12 @@ export class ClientTrendsBarComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Dates} dateUtils Date Utils */ - constructor(private homeService: HomeService, - private route: ActivatedRoute, - private dateUtils: Dates) { - this.route.data.subscribe( (data: { offices: any }) => { + constructor( + private homeService: HomeService, + private route: ActivatedRoute, + private dateUtils: Dates + ) { + this.route.data.subscribe((data: { offices: any }) => { this.officeData = data.offices; }); } @@ -67,7 +68,8 @@ export class ClientTrendsBarComponent implements OnInit { * Fetches data accordingly and sets charts based on fetched data. */ getChartData() { - merge(this.officeId.valueChanges, this.timescale.valueChanges).pipe(skip(1)) + merge(this.officeId.valueChanges, this.timescale.valueChanges) + .pipe(skip(1)) .subscribe(() => { const officeId = this.officeId.value; const timescale = this.timescale.value; @@ -75,7 +77,10 @@ export class ClientTrendsBarComponent implements OnInit { case 'Day': const clientsByDay = this.homeService.getClientTrendsByDay(officeId); const loansByDay = this.homeService.getLoanTrendsByDay(officeId); - forkJoin([clientsByDay, loansByDay]).subscribe((data: any[]) => { + forkJoin([ + clientsByDay, + loansByDay + ]).subscribe((data: any[]) => { const dayLabels = this.getLabels(timescale); const clientCounts = this.getCounts(data[0], dayLabels, timescale, 'client'); const loanCounts = this.getCounts(data[1], dayLabels, timescale, 'loan'); @@ -86,7 +91,10 @@ export class ClientTrendsBarComponent implements OnInit { case 'Week': const clientsByWeek = this.homeService.getClientTrendsByWeek(officeId); const loansByWeek = this.homeService.getLoanTrendsByWeek(officeId); - forkJoin([clientsByWeek, loansByWeek]).subscribe((data: any[]) => { + forkJoin([ + clientsByWeek, + loansByWeek + ]).subscribe((data: any[]) => { const weekLabels = this.getLabels(timescale); const clientCounts = this.getCounts(data[0], weekLabels, timescale, 'client'); const loanCounts = this.getCounts(data[1], weekLabels, timescale, 'loan'); @@ -97,7 +105,10 @@ export class ClientTrendsBarComponent implements OnInit { case 'Month': const clientsByMonth = this.homeService.getClientTrendsByMonth(officeId); const loansByMonth = this.homeService.getLoanTrendsByMonth(officeId); - forkJoin([clientsByMonth, loansByMonth]).subscribe((data: any[]) => { + forkJoin([ + clientsByMonth, + loansByMonth + ]).subscribe((data: any[]) => { const monthLabels = this.getLabels(timescale); const clientCounts = this.getCounts(data[0], monthLabels, timescale, 'client'); const loanCounts = this.getCounts(data[1], monthLabels, timescale, 'loan'); @@ -106,7 +117,7 @@ export class ClientTrendsBarComponent implements OnInit { }); break; } - }); + }); } /** @@ -130,9 +141,7 @@ export class ClientTrendsBarComponent implements OnInit { while (labelsArray.length < 12) { date.setDate(date.getDate() - 7); /** Gets current week number */ - const weekNumber = Math.ceil( - (((date.getTime() - onejan.getTime()) / 86400000) + onejan.getDay() + 1) / 7 - ); + const weekNumber = Math.ceil(((date.getTime() - onejan.getTime()) / 86400000 + onejan.getDay() + 1) / 7); labelsArray.push(weekNumber); } break; @@ -155,7 +164,7 @@ export class ClientTrendsBarComponent implements OnInit { * @param {string} type 'client' or 'loan'. */ getCounts(response: any[], labels: any[], timescale: string, type: string) { - let counts: number[] = []; + let counts: number[] = []; switch (timescale) { case 'Day': labels.forEach((label: any) => { @@ -197,10 +206,10 @@ export class ClientTrendsBarComponent implements OnInit { switch (type) { case 'client': counts.push(span.count); - break; + break; case 'loan': counts.push(span.lcount); - break; + break; } } else { counts.push(0); @@ -236,22 +245,22 @@ export class ClientTrendsBarComponent implements OnInit { backgroundColor: 'red', borderColor: 'red', borderWidth: 2, - fill: false, + fill: false } ] }, options: { responsive: true, - scales: { - y: { - beginAtZero: true, - scaleLabel: { - display: true, - labelString: 'Values', - fontColor: '#1074B9' - } - }, - } + scales: { + y: { + beginAtZero: true, + scaleLabel: { + display: true, + labelString: 'Values', + fontColor: '#1074B9' + } + } + } } }); } else { @@ -261,5 +270,4 @@ export class ClientTrendsBarComponent implements OnInit { this.chart.update(); } } - } diff --git a/src/app/home/dashboard/dashboard.component.spec.ts b/src/app/home/dashboard/dashboard.component.spec.ts index 9c996c371..c83d821a0 100644 --- a/src/app/home/dashboard/dashboard.component.spec.ts +++ b/src/app/home/dashboard/dashboard.component.spec.ts @@ -8,9 +8,8 @@ describe('DashboardComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DashboardComponent ] - }) - .compileComponents(); + declarations: [DashboardComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/home/dashboard/dashboard.component.ts b/src/app/home/dashboard/dashboard.component.ts index 869ef401e..0a8e471d6 100644 --- a/src/app/home/dashboard/dashboard.component.ts +++ b/src/app/home/dashboard/dashboard.component.ts @@ -14,7 +14,6 @@ import { activities } from '../activities'; styleUrls: ['./dashboard.component.scss'] }) export class DashboardComponent implements OnInit { - /** Array of all user activities */ userActivity: string[]; /** Array of most recent user activities */ @@ -52,10 +51,16 @@ export class DashboardComponent implements OnInit { uniqueActivities.push(activity); } }); - const topEightRecentActivities = - uniqueActivities - .filter((activity: string) => !['/', '/login', '/home', '/dashboard'].includes(activity)) - .slice(0, 8); + const topEightRecentActivities = uniqueActivities + .filter( + (activity: string) => ![ + '/', + '/login', + '/home', + '/dashboard' + ].includes(activity) + ) + .slice(0, 8); return topEightRecentActivities; } @@ -63,18 +68,24 @@ export class DashboardComponent implements OnInit { * Returns top eight frequent activities. */ getFrequentActivities() { - const frequencyCounts: any = {}; - let index = this.userActivity.length; + const frequencyCounts: any = {}; + let index = this.userActivity.length; while (index) { frequencyCounts[this.userActivity[--index]] = (frequencyCounts[this.userActivity[index]] || 0) + 1; } const frequencyCountsArray = Object.entries(frequencyCounts); - const topEigthFrequentActivities = - frequencyCountsArray - .sort((a: any, b: any) => b[1] - a[1]) - .map((entry: any[]) => entry[0]) - .filter((activity: string) => !['/', '/login', '/home', '/dashboard'].includes(activity)) - .slice(0, 8); + const topEigthFrequentActivities = frequencyCountsArray + .sort((a: any, b: any) => b[1] - a[1]) + .map((entry: any[]) => entry[0]) + .filter( + (activity: string) => ![ + '/', + '/login', + '/home', + '/dashboard' + ].includes(activity) + ) + .slice(0, 8); return topEigthFrequentActivities; } @@ -89,10 +100,10 @@ export class DashboardComponent implements OnInit { * Sets filtered activities for autocomplete. */ setFilteredActivities() { - this.filteredActivities = this.searchText.valueChanges - .pipe( - map((activity: any) => typeof activity === 'string' ? activity : activity.activity), - map((activityName: string) => activityName ? this.filterActivity(activityName) : this.allActivities)); + this.filteredActivities = this.searchText.valueChanges.pipe( + map((activity: any) => (typeof activity === 'string' ? activity : activity.activity)), + map((activityName: string) => (activityName ? this.filterActivity(activityName) : this.allActivities)) + ); } /** @@ -102,8 +113,6 @@ export class DashboardComponent implements OnInit { */ private filterActivity(activityName: string): any { const filterValue = activityName.toLowerCase(); - return this.allActivities.filter(activity => activity.activity.toLowerCase().indexOf(filterValue) === 0); + return this.allActivities.filter((activity) => activity.activity.toLowerCase().indexOf(filterValue) === 0); } - } - diff --git a/src/app/home/home-routing.module.ts b/src/app/home/home-routing.module.ts index 94fa54744..ccf5a3028 100644 --- a/src/app/home/home-routing.module.ts +++ b/src/app/home/home-routing.module.ts @@ -34,6 +34,7 @@ const routes: Routes = [ } } ]) + ]; /** @@ -46,4 +47,4 @@ const routes: Routes = [ exports: [RouterModule], providers: [OfficesResolver] }) -export class HomeRoutingModule { } +export class HomeRoutingModule {} diff --git a/src/app/home/home.component.spec.ts b/src/app/home/home.component.spec.ts index 490e81bdf..7e1d513de 100644 --- a/src/app/home/home.component.spec.ts +++ b/src/app/home/home.component.spec.ts @@ -8,9 +8,8 @@ describe('HomeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ HomeComponent ] - }) - .compileComponents(); + declarations: [HomeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 6e3010c5e..af2335a46 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -1,5 +1,5 @@ /** Angular Imports */ -import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit} from '@angular/core'; +import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core'; import { ActivatedRoute, Router, NavigationEnd } from '@angular/router'; import { UntypedFormControl } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; @@ -29,7 +29,6 @@ import { NextStepDialogComponent } from '../configuration-wizard/next-step-dialo styleUrls: ['./home.component.scss'] }) export class HomeComponent implements OnInit, AfterViewInit { - /** Username of authenticated user. */ username: string; /** Activity Form. */ @@ -42,13 +41,13 @@ export class HomeComponent implements OnInit, AfterViewInit { allActivities: any[] = activities; /* Reference of dashboard button */ - @ViewChild('buttonDashboard', {static: false}) buttonDashboard: ElementRef; + @ViewChild('buttonDashboard', { static: false }) buttonDashboard: ElementRef; /* Template for popover on dashboard button */ - @ViewChild('templateButtonDashboard', {static: false}) templateButtonDashboard: TemplateRef; + @ViewChild('templateButtonDashboard', { static: false }) templateButtonDashboard: TemplateRef; /* Reference of search activity */ - @ViewChild('searchActivity', {static: false}) searchActivity: ElementRef; + @ViewChild('searchActivity', { static: false }) searchActivity: ElementRef; /* Template for popover on search activity */ - @ViewChild('templateSearchActivity', {static: false}) templateSearchActivity: TemplateRef; + @ViewChild('templateSearchActivity', { static: false }) templateSearchActivity: TemplateRef; /** * @param {AuthenticationService} authenticationService Authentication Service. @@ -58,12 +57,14 @@ export class HomeComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private authenticationService: AuthenticationService, - private activatedRoute: ActivatedRoute, - private router: Router, - private dialog: MatDialog, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { } + constructor( + private authenticationService: AuthenticationService, + private activatedRoute: ActivatedRoute, + private router: Router, + private dialog: MatDialog, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) {} /** * Sets the username of the authenticated user. @@ -83,10 +84,10 @@ export class HomeComponent implements OnInit, AfterViewInit { * Sets filtered activities for autocomplete. */ setFilteredActivities() { - this.filteredActivities = this.searchText.valueChanges - .pipe( - map((activity: any) => typeof activity === 'string' ? activity : activity.activity), - map((activityName: string) => activityName ? this.filterActivity(activityName) : this.allActivities)); + this.filteredActivities = this.searchText.valueChanges.pipe( + map((activity: any) => (typeof activity === 'string' ? activity : activity.activity)), + map((activityName: string) => (activityName ? this.filterActivity(activityName) : this.allActivities)) + ); } /** @@ -96,7 +97,7 @@ export class HomeComponent implements OnInit, AfterViewInit { */ private filterActivity(activityName: string): any { const filterValue = activityName.toLowerCase(); - return this.allActivities.filter(activity => activity.activity.toLowerCase().indexOf(filterValue) === 0); + return this.allActivities.filter((activity) => activity.activity.toLowerCase().indexOf(filterValue) === 0); } /** @@ -106,7 +107,12 @@ export class HomeComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -140,23 +146,23 @@ export class HomeComponent implements OnInit, AfterViewInit { * Next Step (Organization) Dialog Configuration Wizard. */ openNextStepDialog() { - const nextStepDialogRef = this.dialog.open( NextStepDialogComponent, { + const nextStepDialogRef = this.dialog.open(NextStepDialogComponent, { data: { nextStepName: 'Setup Organization', previousStepName: 'Home Tour', stepPercentage: 10 - }, + } }); nextStepDialogRef.afterClosed().subscribe((response: { nextStep: boolean }) => { - if (response.nextStep) { - this.configurationWizardService.showHome = false; - this.configurationWizardService.showHomeSearchActivity = false; - this.configurationWizardService.showCreateOffice = true; - this.router.navigate(['/organization']); + if (response.nextStep) { + this.configurationWizardService.showHome = false; + this.configurationWizardService.showHomeSearchActivity = false; + this.configurationWizardService.showCreateOffice = true; + this.router.navigate(['/organization']); } else { - this.configurationWizardService.showHome = false; - this.configurationWizardService.showHomeSearchActivity = false; - this.router.navigate(['/home']); + this.configurationWizardService.showHome = false; + this.configurationWizardService.showHomeSearchActivity = false; + this.router.navigate(['/home']); } }); } diff --git a/src/app/home/home.module.ts b/src/app/home/home.module.ts index a839a7616..da9feb29a 100644 --- a/src/app/home/home.module.ts +++ b/src/app/home/home.module.ts @@ -28,7 +28,7 @@ import { SessionTimeoutDialogComponent } from './timeout-dialog/session-timeout- SharedModule, PipesModule, HomeRoutingModule, - TranslateModule, + TranslateModule ], declarations: [ HomeComponent, @@ -39,6 +39,6 @@ import { SessionTimeoutDialogComponent } from './timeout-dialog/session-timeout- WarningDialogComponent, SessionTimeoutDialogComponent ], - providers: [ ] + providers: [] }) -export class HomeModule { } +export class HomeModule {} diff --git a/src/app/home/home.service.ts b/src/app/home/home.service.ts index 18c265c1c..6c76862d7 100644 --- a/src/app/home/home.service.ts +++ b/src/app/home/home.service.ts @@ -12,20 +12,17 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class HomeService { - /** * @param {HttpClient} http Http Client to send requests. */ - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * @param {number} officeId Office Id. * @returns {Observable} */ getCollectedAmount(officeId: number): Observable { - const httpParams = new HttpParams() - .set('R_officeId', officeId.toString()) - .set('genericResultSet', 'false'); + const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false'); return this.http.get('/runreports/Demand Vs Collection', { params: httpParams }); } @@ -34,9 +31,7 @@ export class HomeService { * @returns {Observable} */ getDisbursedAmount(officeId: number): Observable { - const httpParams = new HttpParams() - .set('R_officeId', officeId.toString()) - .set('genericResultSet', 'false'); + const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false'); return this.http.get('/runreports/Disbursal Vs Awaitingdisbursal', { params: httpParams }); } @@ -45,9 +40,7 @@ export class HomeService { * @returns {Observable} */ getClientTrendsByDay(officeId: number): Observable { - const httpParams = new HttpParams() - .set('R_officeId', officeId.toString()) - .set('genericResultSet', 'false'); + const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false'); return this.http.get('/runreports/ClientTrendsByDay', { params: httpParams }); } @@ -56,9 +49,7 @@ export class HomeService { * @returns {Observable} */ getClientTrendsByWeek(officeId: number): Observable { - const httpParams = new HttpParams() - .set('R_officeId', officeId.toString()) - .set('genericResultSet', 'false'); + const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false'); return this.http.get('/runreports/ClientTrendsByWeek', { params: httpParams }); } @@ -67,9 +58,7 @@ export class HomeService { * @returns {Observable} */ getClientTrendsByMonth(officeId: number): Observable { - const httpParams = new HttpParams() - .set('R_officeId', officeId.toString()) - .set('genericResultSet', 'false'); + const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false'); return this.http.get('/runreports/ClientTrendsByMonth', { params: httpParams }); } @@ -78,9 +67,7 @@ export class HomeService { * @returns {Observable} */ getLoanTrendsByDay(officeId: number): Observable { - const httpParams = new HttpParams() - .set('R_officeId', officeId.toString()) - .set('genericResultSet', 'false'); + const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false'); return this.http.get('/runreports/LoanTrendsByDay', { params: httpParams }); } @@ -89,9 +76,7 @@ export class HomeService { * @returns {Observable} */ getLoanTrendsByWeek(officeId: number): Observable { - const httpParams = new HttpParams() - .set('R_officeId', officeId.toString()) - .set('genericResultSet', 'false'); + const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false'); return this.http.get('/runreports/LoanTrendsByWeek', { params: httpParams }); } @@ -100,10 +85,7 @@ export class HomeService { * @returns {Observable} */ getLoanTrendsByMonth(officeId: number): Observable { - const httpParams = new HttpParams() - .set('R_officeId', officeId.toString()) - .set('genericResultSet', 'false'); + const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false'); return this.http.get('/runreports/LoanTrendsByMonth', { params: httpParams }); } - } diff --git a/src/app/home/timeout-dialog/idle-timeout.service.ts b/src/app/home/timeout-dialog/idle-timeout.service.ts index 9cc1fdbf4..3590ca201 100644 --- a/src/app/home/timeout-dialog/idle-timeout.service.ts +++ b/src/app/home/timeout-dialog/idle-timeout.service.ts @@ -1,29 +1,34 @@ import { Injectable } from '@angular/core'; import { environment } from 'environments/environment'; -import { interval, merge, fromEvent, Observable} from 'rxjs'; -import { takeUntil, repeat, map} from 'rxjs/operators'; +import { interval, merge, fromEvent, Observable } from 'rxjs'; +import { takeUntil, repeat, map } from 'rxjs/operators'; /** * Idle timeout service used to track idle user */ @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class IdleTimeoutService { + // max timeout for an idle user + readonly timeoutDelay = environment.session.timeout.idleTimeout || 300000; // 5 minutes - // max timeout for an idle user - readonly timeoutDelay = environment.session.timeout.idleTimeout || 300000; // 5 minutes + // observable timeout + readonly $onSessionTimeout: Observable; - // observable timeout - readonly $onSessionTimeout: Observable; - - constructor() { - const events = ['mousemove', 'keydown', 'wheel', 'mousedown', 'scroll']; - const $signal = merge(...events.map(eventName => fromEvent(document, eventName))); - this.$onSessionTimeout = interval(this.timeoutDelay).pipe( - takeUntil($signal), - map(() => undefined), - repeat() - ); - } + constructor() { + const events = [ + 'mousemove', + 'keydown', + 'wheel', + 'mousedown', + 'scroll' + ]; + const $signal = merge(...events.map((eventName) => fromEvent(document, eventName))); + this.$onSessionTimeout = interval(this.timeoutDelay).pipe( + takeUntil($signal), + map(() => undefined), + repeat() + ); + } } diff --git a/src/app/home/timeout-dialog/session-timeout-dialog.component.spec.ts b/src/app/home/timeout-dialog/session-timeout-dialog.component.spec.ts index ac2c419c0..a15b8184c 100644 --- a/src/app/home/timeout-dialog/session-timeout-dialog.component.spec.ts +++ b/src/app/home/timeout-dialog/session-timeout-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('SessionTimeoutDialogComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ SessionTimeoutDialogComponent ] - }) - .compileComponents(); + declarations: [SessionTimeoutDialogComponent] + }).compileComponents(); fixture = TestBed.createComponent(SessionTimeoutDialogComponent); component = fixture.componentInstance; diff --git a/src/app/home/timeout-dialog/session-timeout-dialog.component.ts b/src/app/home/timeout-dialog/session-timeout-dialog.component.ts index 92f810af9..c537eb367 100644 --- a/src/app/home/timeout-dialog/session-timeout-dialog.component.ts +++ b/src/app/home/timeout-dialog/session-timeout-dialog.component.ts @@ -7,8 +7,5 @@ import { MatDialogRef } from '@angular/material/dialog'; styleUrls: ['./session-timeout-dialog.component.scss'] }) export class SessionTimeoutDialogComponent { - - constructor(public dialogRef: MatDialogRef) { - } - + constructor(public dialogRef: MatDialogRef) {} } diff --git a/src/app/home/warning-dialog/warning-dialog.component.ts b/src/app/home/warning-dialog/warning-dialog.component.ts index fc9b67086..5e2992909 100644 --- a/src/app/home/warning-dialog/warning-dialog.component.ts +++ b/src/app/home/warning-dialog/warning-dialog.component.ts @@ -8,7 +8,6 @@ import { environment } from '../../../environments/environment'; styleUrls: ['./warning-dialog.component.scss'] }) export class WarningDialogComponent { - title: string; content: string; buttonText: string; @@ -18,5 +17,4 @@ export class WarningDialogComponent { this.content = environment.warningDialog.content; this.buttonText = environment.warningDialog.buttonText; } - } diff --git a/src/app/keyboards-shortcut-config.ts b/src/app/keyboards-shortcut-config.ts index b57b9e1b9..914dac266 100644 --- a/src/app/keyboards-shortcut-config.ts +++ b/src/app/keyboards-shortcut-config.ts @@ -1,194 +1,192 @@ /** Keyboard Shortcuts Button Configuration */ export class KeyboardShortcutsConfiguration { + buttonsArray: { + title: string; + ctrlKey: boolean; + shiftKey: boolean; + altKey: boolean; + key: string; + route: string; + id?: string; + }[]; - buttonsArray: { - title: string, - ctrlKey: boolean, - shiftKey: boolean, - altKey: boolean, - key: string, - route: string, - id?: string - }[]; + constructor() { + this.makeCombination(); + } - constructor() { - this.makeCombination(); - } - - makeCombination() { - this.buttonsArray = [ - // Navigation Page - ctrl + n - { - title: 'Navigation Page', - ctrlKey: true, - shiftKey: false, - altKey: false, - key: 'n', - route: 'navigation' - }, - // Run Report - ctrl + t - { - title: 'Run Report', - ctrlKey: true, - shiftKey: false, - altKey: false, - key: 't', - route: '', - id: 'runReport' - }, - // Checker Inbox & Pending Tasks - ctrl + i - { - title: 'Checker Inbox & Pending Tasks', - ctrlKey: true, - shiftKey: false, - altKey: false, - key: 'i', - route: 'checker-inbox-and-tasks/checker-inbox' - }, - // Collection Sheet- ctrl + alt + o - // { - // title: 'Collection Sheet', - // ctrlKey: true, - // shiftKey: false, - // altKey: true, - // key: 'o', - // route: '' - // }, - // Create Client - ctrl + c - { - title: 'Create Client', - ctrlKey: false, - shiftKey: false, - altKey: true, - key: 'c', - route: 'clients/create' - }, - // Create Group - ctrl + g - { - title: 'Create Group', - ctrlKey: true, - shiftKey: false, - altKey: false, - key: 'g', - route: 'groups/create' - }, - // Create Center - ctrl + q - { - title: 'Create Center', - ctrlKey: true, - shiftKey: false, - altKey: false, - key: 'q', - route: 'centers/create' - }, - // Frequent Posting - ctrl + f - { - title: 'Frequent Posting', - ctrlKey: true, - shiftKey: false, - altKey: false, - key: 'f', - route: 'accounting/journal-entries/frequent-postings' - }, - // Closure Entries - ctrl + e - { - title: 'Closure Entries', - ctrlKey: true, - shiftKey: false, - altKey: false, - key: 'e', - route: 'accounting/closing-entries' - }, - // Journal Entry - ctrl + j - { - title: 'Journal Entry', - ctrlKey: true, - shiftKey: false, - altKey: false, - key: 'j', - route: 'accounting/journal-entries/create' - }, - // Reports - ctrl + r - { - title: 'Reports', - ctrlKey: true, - shiftKey: false, - altKey: false, - key: 'r', - route: 'reports' - }, - // Accounting - ctrl + a - { - title: 'Accounting', - ctrlKey: false, - shiftKey: false, - altKey: true, - key: 'a', - route: 'accounting' - }, - // Save/Submit Forms - ctrl + s - { - title: 'Save/Submit Forms', - ctrlKey: false, - shiftKey: false, - altKey: true, - key: 's', - route: '', - id: 'submit' - }, - // Cancel - ctrl + x - { - title: 'Cancel', - ctrlKey: false, - shiftKey: false, - altKey: true, - key: 'x', - route: '', - id: 'cancel' - }, - // Help - ctrl + h - { - title: 'Help', - ctrlKey: false, - shiftKey: false, - altKey: true, - key: 'h', - route: '', - id: 'help' - }, - // Pagination: Next - ctrl + n - // { - // title: 'Pagination: Next' - // ctrlKey: true, - // shiftKey: false, - // altKey: true, - // key: 'n, - // route: '' - // }, - // Pagination: Previous - ctrl + p - // { - // title: 'Pagination: Previous' - // ctrlKey: true, - // shiftKey: false, - // altKey: true, - // key: 'p, - // route: '' - // }, - // Logout - ctrl + l - { - title: 'Logout', - ctrlKey: true, - shiftKey: false, - altKey: false, - key: 'l', - route: '', - id: 'logout' - } - ]; - } - - get buttonCombinations() { - return this.buttonsArray; - } + makeCombination() { + this.buttonsArray = [ + // Navigation Page - ctrl + n + { + title: 'Navigation Page', + ctrlKey: true, + shiftKey: false, + altKey: false, + key: 'n', + route: 'navigation' + }, + // Run Report - ctrl + t + { + title: 'Run Report', + ctrlKey: true, + shiftKey: false, + altKey: false, + key: 't', + route: '', + id: 'runReport' + }, + // Checker Inbox & Pending Tasks - ctrl + i + { + title: 'Checker Inbox & Pending Tasks', + ctrlKey: true, + shiftKey: false, + altKey: false, + key: 'i', + route: 'checker-inbox-and-tasks/checker-inbox' + }, + // Collection Sheet- ctrl + alt + o + // { + // title: 'Collection Sheet', + // ctrlKey: true, + // shiftKey: false, + // altKey: true, + // key: 'o', + // route: '' + // }, + // Create Client - ctrl + c + { + title: 'Create Client', + ctrlKey: false, + shiftKey: false, + altKey: true, + key: 'c', + route: 'clients/create' + }, + // Create Group - ctrl + g + { + title: 'Create Group', + ctrlKey: true, + shiftKey: false, + altKey: false, + key: 'g', + route: 'groups/create' + }, + // Create Center - ctrl + q + { + title: 'Create Center', + ctrlKey: true, + shiftKey: false, + altKey: false, + key: 'q', + route: 'centers/create' + }, + // Frequent Posting - ctrl + f + { + title: 'Frequent Posting', + ctrlKey: true, + shiftKey: false, + altKey: false, + key: 'f', + route: 'accounting/journal-entries/frequent-postings' + }, + // Closure Entries - ctrl + e + { + title: 'Closure Entries', + ctrlKey: true, + shiftKey: false, + altKey: false, + key: 'e', + route: 'accounting/closing-entries' + }, + // Journal Entry - ctrl + j + { + title: 'Journal Entry', + ctrlKey: true, + shiftKey: false, + altKey: false, + key: 'j', + route: 'accounting/journal-entries/create' + }, + // Reports - ctrl + r + { + title: 'Reports', + ctrlKey: true, + shiftKey: false, + altKey: false, + key: 'r', + route: 'reports' + }, + // Accounting - ctrl + a + { + title: 'Accounting', + ctrlKey: false, + shiftKey: false, + altKey: true, + key: 'a', + route: 'accounting' + }, + // Save/Submit Forms - ctrl + s + { + title: 'Save/Submit Forms', + ctrlKey: false, + shiftKey: false, + altKey: true, + key: 's', + route: '', + id: 'submit' + }, + // Cancel - ctrl + x + { + title: 'Cancel', + ctrlKey: false, + shiftKey: false, + altKey: true, + key: 'x', + route: '', + id: 'cancel' + }, + // Help - ctrl + h + { + title: 'Help', + ctrlKey: false, + shiftKey: false, + altKey: true, + key: 'h', + route: '', + id: 'help' + }, + // Pagination: Next - ctrl + n + // { + // title: 'Pagination: Next' + // ctrlKey: true, + // shiftKey: false, + // altKey: true, + // key: 'n, + // route: '' + // }, + // Pagination: Previous - ctrl + p + // { + // title: 'Pagination: Previous' + // ctrlKey: true, + // shiftKey: false, + // altKey: true, + // key: 'p, + // route: '' + // }, + // Logout - ctrl + l + { + title: 'Logout', + ctrlKey: true, + shiftKey: false, + altKey: false, + key: 'l', + route: '', + id: 'logout' + } + ]; + } + get buttonCombinations() { + return this.buttonsArray; + } } diff --git a/src/app/loans/common-resolvers/external-asset-owner-active-transfer.resolver.ts b/src/app/loans/common-resolvers/external-asset-owner-active-transfer.resolver.ts index 15bb8d7f2..2872f6e3f 100644 --- a/src/app/loans/common-resolvers/external-asset-owner-active-transfer.resolver.ts +++ b/src/app/loans/common-resolvers/external-asset-owner-active-transfer.resolver.ts @@ -7,19 +7,17 @@ import { ExternalAssetOwnerService } from '../services/external-asset-owner.serv providedIn: 'root' }) export class ExternalAssetOwnerActiveTransferResolver implements Resolve { + /** + * @param {ExternalAssetOwnerService} externalAssetOwnerService External Asset Owner service. + */ + constructor(private externalAssetOwnerService: ExternalAssetOwnerService) {} - /** - * @param {ExternalAssetOwnerService} externalAssetOwnerService External Asset Owner service. - */ - constructor(private externalAssetOwnerService: ExternalAssetOwnerService) { } - - /** - * Returns the Loans with Association data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); - return this.externalAssetOwnerService.retrieveExternalAssetOwnerActiveTransfer(loanId); - } - + /** + * Returns the Loans with Association data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); + return this.externalAssetOwnerService.retrieveExternalAssetOwnerActiveTransfer(loanId); + } } diff --git a/src/app/loans/common-resolvers/external-asset-owner-journal-entry.resolver.ts b/src/app/loans/common-resolvers/external-asset-owner-journal-entry.resolver.ts index 75eeb5ae1..8328300c7 100644 --- a/src/app/loans/common-resolvers/external-asset-owner-journal-entry.resolver.ts +++ b/src/app/loans/common-resolvers/external-asset-owner-journal-entry.resolver.ts @@ -7,19 +7,17 @@ import { ExternalAssetOwnerService } from '../services/external-asset-owner.serv providedIn: 'root' }) export class ExternalAssetOwnerJournalEntryResolver implements Resolve { + /** + * @param {ExternalAssetOwnerService} externalAssetOwnerService External Asset Owner service. + */ + constructor(private externalAssetOwnerService: ExternalAssetOwnerService) {} - /** - * @param {ExternalAssetOwnerService} externalAssetOwnerService External Asset Owner service. - */ - constructor(private externalAssetOwnerService: ExternalAssetOwnerService) { } - - /** - * Returns the Loans with Association data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const transferId = route.paramMap.get('transferId') || route.parent.paramMap.get('transferId'); - return this.externalAssetOwnerService.retrieveExternalAssetOwnerTransferJournalEntries(transferId); - } - + /** + * Returns the Loans with Association data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const transferId = route.paramMap.get('transferId') || route.parent.paramMap.get('transferId'); + return this.externalAssetOwnerService.retrieveExternalAssetOwnerTransferJournalEntries(transferId); + } } diff --git a/src/app/loans/common-resolvers/external-asset-owner.resolver.ts b/src/app/loans/common-resolvers/external-asset-owner.resolver.ts index e4f89cfdf..00ba8b399 100644 --- a/src/app/loans/common-resolvers/external-asset-owner.resolver.ts +++ b/src/app/loans/common-resolvers/external-asset-owner.resolver.ts @@ -7,19 +7,17 @@ import { ExternalAssetOwnerService } from '../services/external-asset-owner.serv providedIn: 'root' }) export class ExternalAssetOwnerResolver implements Resolve { + /** + * @param {ExternalAssetOwnerService} externalAssetOwnerService External Asset Owner service. + */ + constructor(private externalAssetOwnerService: ExternalAssetOwnerService) {} - /** - * @param {ExternalAssetOwnerService} externalAssetOwnerService External Asset Owner service. - */ - constructor(private externalAssetOwnerService: ExternalAssetOwnerService) { } - - /** - * Returns the Loans with Association data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); - return this.externalAssetOwnerService.retrieveExternalAssetOwnerTransfers(loanId); - } - + /** + * Returns the Loans with Association data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); + return this.externalAssetOwnerService.retrieveExternalAssetOwnerTransfers(loanId); + } } diff --git a/src/app/loans/common-resolvers/glim-loan-template.resolver.ts b/src/app/loans/common-resolvers/glim-loan-template.resolver.ts index 3a24f4c03..065ab12d0 100644 --- a/src/app/loans/common-resolvers/glim-loan-template.resolver.ts +++ b/src/app/loans/common-resolvers/glim-loan-template.resolver.ts @@ -13,17 +13,17 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class GLIMLoanTemplateResolver implements Resolve { - /** - * @param {ProductsService} loansService Loan service. - */ - constructor(private loansService: LoansService) { } + /** + * @param {ProductsService} loansService Loan service. + */ + constructor(private loansService: LoansService) {} - /** - * Returns the loan account template data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const groupId = route.paramMap.get('groupId'); - return this.loansService.getGLIMLoanAccountTemplate(groupId); - } + /** + * Returns the loan account template data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const groupId = route.paramMap.get('groupId'); + return this.loansService.getGLIMLoanAccountTemplate(groupId); + } } diff --git a/src/app/loans/common-resolvers/loan-action-button.resolver.ts b/src/app/loans/common-resolvers/loan-action-button.resolver.ts index 9db6ed577..ee9db2a35 100644 --- a/src/app/loans/common-resolvers/loan-action-button.resolver.ts +++ b/src/app/loans/common-resolvers/loan-action-button.resolver.ts @@ -13,11 +13,10 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoanActionButtonResolver implements Resolve { - /** * @param {LoansService} LoansService Loans service. */ - constructor(private loansService: LoansService) { } + constructor(private loansService: LoansService) {} /** * Returns the Loans Notes Data. @@ -32,7 +31,8 @@ export class LoanActionButtonResolver implements Resolve { return this.loansService.getLoanActionTemplate(loanId, 'repayment'); } else if (loanActionButton === 'Goodwill Credit') { return this.loansService.getLoanActionTemplate(loanId, 'goodwillCredit'); - } if (loanActionButton === 'Interest Payment Waiver') { + } + if (loanActionButton === 'Interest Payment Waiver') { return this.loansService.getLoanActionTemplate(loanId, 'interestPaymentWaiver'); } else if (loanActionButton === 'Payout Refund') { return this.loansService.getLoanActionTemplate(loanId, 'payoutRefund'); @@ -78,5 +78,4 @@ export class LoanActionButtonResolver implements Resolve { return undefined; } } - } diff --git a/src/app/loans/common-resolvers/loan-arrear-delinquency.resolver.ts b/src/app/loans/common-resolvers/loan-arrear-delinquency.resolver.ts index 85981c568..aeb2cf1f1 100644 --- a/src/app/loans/common-resolvers/loan-arrear-delinquency.resolver.ts +++ b/src/app/loans/common-resolvers/loan-arrear-delinquency.resolver.ts @@ -7,17 +7,16 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class LoanArrearDelinquencyResolver implements Resolve { + /** + * @param {SystemService} systemService System service. + */ + constructor(private systemService: SystemService) {} - /** - * @param {SystemService} systemService System service. - */ - constructor(private systemService: SystemService) { } - - /** - * Returns the loan-arrears-delinquency-display-data configuration data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - return this.systemService.getConfigurationByName('loan-arrears-delinquency-display-data'); - } + /** + * Returns the loan-arrears-delinquency-display-data configuration data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + return this.systemService.getConfigurationByName('loan-arrears-delinquency-display-data'); + } } diff --git a/src/app/loans/common-resolvers/loan-collaterals.resolver.ts b/src/app/loans/common-resolvers/loan-collaterals.resolver.ts index 4830a9a10..424eea640 100644 --- a/src/app/loans/common-resolvers/loan-collaterals.resolver.ts +++ b/src/app/loans/common-resolvers/loan-collaterals.resolver.ts @@ -1,8 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Resolve, - ActivatedRouteSnapshot -} from '@angular/router'; +import { Resolve, ActivatedRouteSnapshot } from '@angular/router'; import { Observable } from 'rxjs'; import { LoansService } from '../loans.service'; @@ -10,11 +7,10 @@ import { LoansService } from '../loans.service'; providedIn: 'root' }) export class LoanCollateralsResolver implements Resolve { - /** * @param {LoansService} LoansService Loans service. */ - constructor(private loansService: LoansService) { } + constructor(private loansService: LoansService) {} /** * Returns the Loans data. diff --git a/src/app/loans/common-resolvers/loan-datatable.resolver.ts b/src/app/loans/common-resolvers/loan-datatable.resolver.ts index 5a57bbe06..61e4674a8 100644 --- a/src/app/loans/common-resolvers/loan-datatable.resolver.ts +++ b/src/app/loans/common-resolvers/loan-datatable.resolver.ts @@ -13,20 +13,18 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoanDatatableResolver implements Resolve { + /** + * @param {LoansService} LoansService Loans service. + */ + constructor(private loansService: LoansService) {} - /** - * @param {LoansService} LoansService Loans service. - */ - constructor(private loansService: LoansService) { } - - /** - * Returns the Loans Notes Data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId') || route.parent.parent.paramMap.get('loanId'); - const datatableName = route.paramMap.get('datatableName'); - return this.loansService.getLoanDatatable(loanId, datatableName); - } - + /** + * Returns the Loans Notes Data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.parent.paramMap.get('loanId'); + const datatableName = route.paramMap.get('datatableName'); + return this.loansService.getLoanDatatable(loanId, datatableName); + } } diff --git a/src/app/loans/common-resolvers/loan-datatables.resolver.ts b/src/app/loans/common-resolvers/loan-datatables.resolver.ts index 82733b718..8f9c640c5 100644 --- a/src/app/loans/common-resolvers/loan-datatables.resolver.ts +++ b/src/app/loans/common-resolvers/loan-datatables.resolver.ts @@ -13,18 +13,16 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoanDatatablesResolver implements Resolve { + /** + * @param {loansService} loansService loans service. + */ + constructor(private loansService: LoansService) {} - /** - * @param {loansService} loansService loans service. - */ - constructor(private loansService: LoansService) { } - - /** - * Returns the loan datatables. - * @returns {Observable} - */ - resolve(): Observable { - return this.loansService.getLoanDataTables(); - } - + /** + * Returns the loan datatables. + * @returns {Observable} + */ + resolve(): Observable { + return this.loansService.getLoanDataTables(); + } } diff --git a/src/app/loans/common-resolvers/loan-delinquency-actions.resolver.ts b/src/app/loans/common-resolvers/loan-delinquency-actions.resolver.ts index 11a307654..00d58476c 100644 --- a/src/app/loans/common-resolvers/loan-delinquency-actions.resolver.ts +++ b/src/app/loans/common-resolvers/loan-delinquency-actions.resolver.ts @@ -7,19 +7,17 @@ import { LoansService } from '../loans.service'; providedIn: 'root' }) export class LoanDelinquencyActionsResolver implements Resolve { + /** + * @param {LoansService} LoansService Loans service. + */ + constructor(private loansService: LoansService) {} - /** - * @param {LoansService} LoansService Loans service. - */ - constructor(private loansService: LoansService) { } - - /** - * Returns the Loans with Association data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); - return this.loansService.getDelinquencyActions(loanId); - } - + /** + * Returns the Loans with Association data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); + return this.loansService.getDelinquencyActions(loanId); + } } diff --git a/src/app/loans/common-resolvers/loan-delinquency-data.resolver.ts b/src/app/loans/common-resolvers/loan-delinquency-data.resolver.ts index 6f39c9f2f..75c2e9966 100644 --- a/src/app/loans/common-resolvers/loan-delinquency-data.resolver.ts +++ b/src/app/loans/common-resolvers/loan-delinquency-data.resolver.ts @@ -13,19 +13,17 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoanDelinquencyDataResolver implements Resolve { + /** + * @param {LoansService} LoansService Loans service. + */ + constructor(private loansService: LoansService) {} - /** - * @param {LoansService} LoansService Loans service. - */ - constructor(private loansService: LoansService) { } - - /** - * Returns the Loans with Association data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); - return this.loansService.getDelinquencyData(loanId); - } - + /** + * Returns the Loans with Association data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); + return this.loansService.getDelinquencyData(loanId); + } } diff --git a/src/app/loans/common-resolvers/loan-delinquency-tags.resolver.ts b/src/app/loans/common-resolvers/loan-delinquency-tags.resolver.ts index 788dd070d..995862543 100644 --- a/src/app/loans/common-resolvers/loan-delinquency-tags.resolver.ts +++ b/src/app/loans/common-resolvers/loan-delinquency-tags.resolver.ts @@ -13,19 +13,17 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoanDelinquencyTagsResolver implements Resolve { + /** + * @param {LoansService} LoansService Loans service. + */ + constructor(private loansService: LoansService) {} - /** - * @param {LoansService} LoansService Loans service. - */ - constructor(private loansService: LoansService) { } - - /** - * Returns the Loans with Association data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); - return this.loansService.getDelinquencyTags(loanId); - } - + /** + * Returns the Loans with Association data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); + return this.loansService.getDelinquencyTags(loanId); + } } diff --git a/src/app/loans/common-resolvers/loan-details-charges.resolver.ts b/src/app/loans/common-resolvers/loan-details-charges.resolver.ts index bf83f328a..be4dae88c 100644 --- a/src/app/loans/common-resolvers/loan-details-charges.resolver.ts +++ b/src/app/loans/common-resolvers/loan-details-charges.resolver.ts @@ -13,19 +13,17 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoanDetailsChargesResolver implements Resolve { + /** + * @param {LoansService} LoansService Loans service. + */ + constructor(private loansService: LoansService) {} - /** - * @param {LoansService} LoansService Loans service. - */ - constructor(private loansService: LoansService) { } - - /** - * Returns the Loans with Association data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId'); - return this.loansService.getLoanAccountAssociationDetails(loanId); - } - + /** + * Returns the Loans with Association data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId'); + return this.loansService.getLoanAccountAssociationDetails(loanId); + } } diff --git a/src/app/loans/common-resolvers/loan-details.resolver.ts b/src/app/loans/common-resolvers/loan-details.resolver.ts index 2cd9542c1..cf5ed0c25 100644 --- a/src/app/loans/common-resolvers/loan-details.resolver.ts +++ b/src/app/loans/common-resolvers/loan-details.resolver.ts @@ -13,21 +13,19 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoanDetailsResolver implements Resolve { + /** + * @param {LoansService} LoansService Loans service. + */ + constructor(private loansService: LoansService) {} - /** - * @param {LoansService} LoansService Loans service. - */ - constructor(private loansService: LoansService) { } - - /** - * Returns the Loans with Association data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); - if (!isNaN(+loanId)) { - return this.loansService.getLoanAccountAssociationDetails(loanId); - } + /** + * Returns the Loans with Association data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); + if (!isNaN(+loanId)) { + return this.loansService.getLoanAccountAssociationDetails(loanId); } - + } } diff --git a/src/app/loans/common-resolvers/loan-documents.resolver.ts b/src/app/loans/common-resolvers/loan-documents.resolver.ts index 67c741862..f6d219f82 100644 --- a/src/app/loans/common-resolvers/loan-documents.resolver.ts +++ b/src/app/loans/common-resolvers/loan-documents.resolver.ts @@ -13,19 +13,17 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoanDocumentsResolver implements Resolve { + /** + * @param {LoansService} LoansService Loans service. + */ + constructor(private loansService: LoansService) {} - /** - * @param {LoansService} LoansService Loans service. - */ - constructor(private loansService: LoansService) { } - - /** - * Returns the Loans data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); - return this.loansService.getLoanDocuments(loanId); - } - + /** + * Returns the Loans data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); + return this.loansService.getLoanDocuments(loanId); + } } diff --git a/src/app/loans/common-resolvers/loan-notes.resolver.ts b/src/app/loans/common-resolvers/loan-notes.resolver.ts index 3f4c85af2..52bebcb1a 100644 --- a/src/app/loans/common-resolvers/loan-notes.resolver.ts +++ b/src/app/loans/common-resolvers/loan-notes.resolver.ts @@ -13,19 +13,17 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoanNotesResolver implements Resolve { + /** + * @param {LoansService} LoansService Loans service. + */ + constructor(private loansService: LoansService) {} - /** - * @param {LoansService} LoansService Loans service. - */ - constructor(private loansService: LoansService) { } - - /** - * Returns the Loans data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); - return this.loansService.getLoanNotes(loanId); - } - + /** + * Returns the Loans data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); + return this.loansService.getLoanNotes(loanId); + } } diff --git a/src/app/loans/common-resolvers/loan-reschedules.resolver.ts b/src/app/loans/common-resolvers/loan-reschedules.resolver.ts index fc4b6530a..b91d102e1 100644 --- a/src/app/loans/common-resolvers/loan-reschedules.resolver.ts +++ b/src/app/loans/common-resolvers/loan-reschedules.resolver.ts @@ -1,9 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Router, Resolve, - RouterStateSnapshot, - ActivatedRouteSnapshot -} from '@angular/router'; +import { Router, Resolve, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router'; import { Observable, of } from 'rxjs'; import { LoansService } from '../loans.service'; @@ -11,19 +7,17 @@ import { LoansService } from '../loans.service'; providedIn: 'root' }) export class LoanReschedulesResolver implements Resolve { + /** + * @param {LoansService} LoansService Loans service. + */ + constructor(private loansService: LoansService) {} - /** - * @param {LoansService} LoansService Loans service. - */ - constructor(private loansService: LoansService) { } - - /** - * Returns the Loans data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); - return this.loansService.loanRescheduleRequests(loanId); - } - + /** + * Returns the Loans data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); + return this.loansService.loanRescheduleRequests(loanId); + } } diff --git a/src/app/loans/common-resolvers/loan-term-variations.resolver.ts b/src/app/loans/common-resolvers/loan-term-variations.resolver.ts index b0c153493..1f732f61b 100644 --- a/src/app/loans/common-resolvers/loan-term-variations.resolver.ts +++ b/src/app/loans/common-resolvers/loan-term-variations.resolver.ts @@ -13,21 +13,19 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoanTermVariationsResolver implements Resolve { + /** + * @param {LoansService} LoansService Loans service. + */ + constructor(private loansService: LoansService) {} - /** - * @param {LoansService} LoansService Loans service. - */ - constructor(private loansService: LoansService) { } - - /** - * Returns the Loans with Association data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); - if (!isNaN(+loanId)) { - return this.loansService.getInterestPausesOfLoan(loanId); - } + /** + * Returns the Loans with Association data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); + if (!isNaN(+loanId)) { + return this.loansService.getInterestPausesOfLoan(loanId); } - + } } diff --git a/src/app/loans/common-resolvers/loans-account-and-template.resolver.ts b/src/app/loans/common-resolvers/loans-account-and-template.resolver.ts index 92ca16567..b2febe7b6 100644 --- a/src/app/loans/common-resolvers/loans-account-and-template.resolver.ts +++ b/src/app/loans/common-resolvers/loans-account-and-template.resolver.ts @@ -13,17 +13,17 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoansAccountAndTemplateResolver implements Resolve { - /** - * @param {ProductsService} productsService Products service. - */ - constructor(private loansService: LoansService) { } + /** + * @param {ProductsService} productsService Products service. + */ + constructor(private loansService: LoansService) {} - /** - * Returns the loan account template data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); - return this.loansService.getLoansAccountAndTemplateResource(loanId); - } + /** + * Returns the loan account template data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId'); + return this.loansService.getLoansAccountAndTemplateResource(loanId); + } } diff --git a/src/app/loans/common-resolvers/loans-account-charge.resolver.ts b/src/app/loans/common-resolvers/loans-account-charge.resolver.ts index d67642895..9fd2e548a 100644 --- a/src/app/loans/common-resolvers/loans-account-charge.resolver.ts +++ b/src/app/loans/common-resolvers/loans-account-charge.resolver.ts @@ -13,21 +13,19 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoansAccountChargeResolver implements Resolve { + /** + * @param {LoansService} LoansService Loans service. + */ + constructor(private loansService: LoansService) {} - /** - * @param {LoansService} LoansService Loans service. - */ - constructor(private loansService: LoansService) { } - - /** - * Returns the Loans Account Charge data. - * @param {ActivatedRouteSnapshot} route Route Snapshot - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const loanId = route.paramMap.get('loanId'); - const chargeId = route.paramMap.get('id'); - return this.loansService.getLoansAccountCharge(loanId, chargeId); - } - + /** + * Returns the Loans Account Charge data. + * @param {ActivatedRouteSnapshot} route Route Snapshot + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const loanId = route.paramMap.get('loanId'); + const chargeId = route.paramMap.get('id'); + return this.loansService.getLoansAccountCharge(loanId, chargeId); + } } diff --git a/src/app/loans/common-resolvers/loans-account-template.resolver.ts b/src/app/loans/common-resolvers/loans-account-template.resolver.ts index 7577f8a8a..d7831b86b 100644 --- a/src/app/loans/common-resolvers/loans-account-template.resolver.ts +++ b/src/app/loans/common-resolvers/loans-account-template.resolver.ts @@ -13,18 +13,18 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoansAccountTemplateResolver implements Resolve { - /** - * @param {ProductsService} productsService Products service. - */ - constructor(private loansService: LoansService) { } + /** + * @param {ProductsService} productsService Products service. + */ + constructor(private loansService: LoansService) {} - /** - * Returns the loan account template data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const entityId = route.parent.parent.paramMap.get('clientId') || route.parent.parent.paramMap.get('groupId'); - const isGroup = (route.parent.parent.paramMap.get('groupId')) ? true : false; - return this.loansService.getLoansAccountTemplateResource(entityId, isGroup); - } + /** + * Returns the loan account template data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const entityId = route.parent.parent.paramMap.get('clientId') || route.parent.parent.paramMap.get('groupId'); + const isGroup = route.parent.parent.paramMap.get('groupId') ? true : false; + return this.loansService.getLoansAccountTemplateResource(entityId, isGroup); + } } diff --git a/src/app/loans/common-resolvers/loans-account-transaction-template.resolver.ts b/src/app/loans/common-resolvers/loans-account-transaction-template.resolver.ts index de19ba17b..27417a397 100644 --- a/src/app/loans/common-resolvers/loans-account-transaction-template.resolver.ts +++ b/src/app/loans/common-resolvers/loans-account-transaction-template.resolver.ts @@ -13,11 +13,10 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoansAccountTransactionTemplateResolver implements Resolve { - /** * @param {LoansService} LoansService Loans service. */ - constructor(private loansService: LoansService) { } + constructor(private loansService: LoansService) {} /** * Returns the Loans Account Transaction Template data. @@ -29,5 +28,4 @@ export class LoansAccountTransactionTemplateResolver implements Resolve const transactionId = route.paramMap.get('id'); return this.loansService.getLoansAccountTransactionTemplate(loanId, transactionId); } - } diff --git a/src/app/loans/common-resolvers/loans-account-transaction.resolver.ts b/src/app/loans/common-resolvers/loans-account-transaction.resolver.ts index e61ad98e5..0cb323378 100644 --- a/src/app/loans/common-resolvers/loans-account-transaction.resolver.ts +++ b/src/app/loans/common-resolvers/loans-account-transaction.resolver.ts @@ -13,11 +13,10 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class LoansAccountTransactionResolver implements Resolve { - /** * @param {LoansService} LoansService Loans service. */ - constructor(private loansService: LoansService) { } + constructor(private loansService: LoansService) {} /** * Returns the Loans Account Transaction data. @@ -29,5 +28,4 @@ export class LoansAccountTransactionResolver implements Resolve { const transactionId = route.paramMap.get('id'); return this.loansService.getLoansAccountTransaction(loanId, transactionId); } - } diff --git a/src/app/loans/common-resolvers/loans-transaction-reciept.resolver.ts b/src/app/loans/common-resolvers/loans-transaction-reciept.resolver.ts index 550970566..95822d5b1 100644 --- a/src/app/loans/common-resolvers/loans-transaction-reciept.resolver.ts +++ b/src/app/loans/common-resolvers/loans-transaction-reciept.resolver.ts @@ -13,11 +13,10 @@ import { ReportsService } from 'app/reports/reports.service'; */ @Injectable() export class LoansTransactionRecieptResolver implements Resolve { - /** * @param {ReportsService} reportsService Reports service. */ - constructor(private reportsService: ReportsService) { } + constructor(private reportsService: ReportsService) {} /** * Returns the Loans Transaction Reciept @@ -27,10 +26,15 @@ export class LoansTransactionRecieptResolver implements Resolve { resolve(route: ActivatedRouteSnapshot): Observable { const transactionId = route.paramMap.get('id'); const data = { - 'output-type': 'PDF', - R_transactionId: transactionId + 'output-type': 'PDF', + R_transactionId: transactionId }; - return this.reportsService.getPentahoRunReportData('Loan Transaction Receipt', data, 'default', 'en', 'dd MMMM yyyy'); + return this.reportsService.getPentahoRunReportData( + 'Loan Transaction Receipt', + data, + 'default', + 'en', + 'dd MMMM yyyy' + ); } - } diff --git a/src/app/loans/create-loans-account/create-loans-account.component.spec.ts b/src/app/loans/create-loans-account/create-loans-account.component.spec.ts index 1ae7571ee..d34a559bc 100644 --- a/src/app/loans/create-loans-account/create-loans-account.component.spec.ts +++ b/src/app/loans/create-loans-account/create-loans-account.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateLoansAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateLoansAccountComponent ] - }) - .compileComponents(); + declarations: [CreateLoansAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/create-loans-account/create-loans-account.component.ts b/src/app/loans/create-loans-account/create-loans-account.component.ts index c9c2d06d6..a222f181d 100644 --- a/src/app/loans/create-loans-account/create-loans-account.component.ts +++ b/src/app/loans/create-loans-account/create-loans-account.component.ts @@ -22,11 +22,12 @@ import { LoansAccountDatatableStepComponent } from '../loans-account-stepper/loa styleUrls: ['./create-loans-account.component.scss'] }) export class CreateLoansAccountComponent { - /** Imports all the step component */ - @ViewChild(LoansAccountDetailsStepComponent, { static: true }) loansAccountDetailsStep: LoansAccountDetailsStepComponent; + @ViewChild(LoansAccountDetailsStepComponent, { static: true }) + loansAccountDetailsStep: LoansAccountDetailsStepComponent; @ViewChild(LoansAccountTermsStepComponent, { static: true }) loansAccountTermsStep: LoansAccountTermsStepComponent; - @ViewChild(LoansAccountChargesStepComponent, { static: true }) loansAccountChargesStep: LoansAccountChargesStepComponent; + @ViewChild(LoansAccountChargesStepComponent, { static: true }) + loansAccountChargesStep: LoansAccountChargesStepComponent; /** Get handle on dtloan tags in the template */ @ViewChildren('dtloan') loanDatatables: QueryList; @@ -52,7 +53,8 @@ export class CreateLoansAccountComponent { * @param {SettingsService} settingsService Settings Service * @param {ClientsService} clientService Client Service */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private loansService: LoansService, private settingsService: SettingsService, @@ -74,8 +76,10 @@ export class CreateLoansAccountComponent { this.clientService.getCollateralTemplate(clientId).subscribe((response: any) => { this.collateralOptions = response; }); - const entityId = (this.loansAccountTemplate.clientId) ? this.loansAccountTemplate.clientId : this.loansAccountTemplate.group.id; - const isGroup = (this.loansAccountTemplate.clientId) ? false : true; + const entityId = this.loansAccountTemplate.clientId + ? this.loansAccountTemplate.clientId + : this.loansAccountTemplate.group.id; + const isGroup = this.loansAccountTemplate.clientId ? false : true; const productId = this.loansAccountProductTemplate.loanProductId; this.loansService.getLoansAccountTemplateResource(entityId, isGroup, productId).subscribe((response: any) => { this.multiDisburseLoan = response.multiDisburseLoan; @@ -105,10 +109,7 @@ export class CreateLoansAccountComponent { /** Checks wheter all the forms in different steps are valid or not */ get loansAccountFormValid() { - return ( - this.loansAccountDetailsForm.valid && - this.loansAccountTermsForm.valid - ); + return this.loansAccountDetailsForm.valid && this.loansAccountTermsForm.valid; } /** Gets principal Amount */ @@ -133,8 +134,13 @@ export class CreateLoansAccountComponent { submit() { const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; - const payload = this.loansService.buildLoanRequestPayload(this.loansAccount, this.loansAccountTemplate, - this.loansAccountProductTemplate.calendarOptions, locale, dateFormat); + const payload = this.loansService.buildLoanRequestPayload( + this.loansAccount, + this.loansAccountTemplate, + this.loansAccountProductTemplate.calendarOptions, + locale, + dateFormat + ); if (this.loansAccountProductTemplate.datatables && this.loansAccountProductTemplate.datatables.length > 0) { const datatables: any[] = []; @@ -145,8 +151,14 @@ export class CreateLoansAccountComponent { } this.loansService.createLoansAccount(payload).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId, 'general'], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId, + 'general' + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/loans/custom-dialog/loan-delinquency-action-dialog/loan-delinquency-action-dialog.component.spec.ts b/src/app/loans/custom-dialog/loan-delinquency-action-dialog/loan-delinquency-action-dialog.component.spec.ts index bb452285e..fc9e4ad4d 100644 --- a/src/app/loans/custom-dialog/loan-delinquency-action-dialog/loan-delinquency-action-dialog.component.spec.ts +++ b/src/app/loans/custom-dialog/loan-delinquency-action-dialog/loan-delinquency-action-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanDelinquencyActionDialogComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ LoanDelinquencyActionDialogComponent ] - }) - .compileComponents(); + declarations: [LoanDelinquencyActionDialogComponent] + }).compileComponents(); fixture = TestBed.createComponent(LoanDelinquencyActionDialogComponent); component = fixture.componentInstance; diff --git a/src/app/loans/custom-dialog/loan-delinquency-action-dialog/loan-delinquency-action-dialog.component.ts b/src/app/loans/custom-dialog/loan-delinquency-action-dialog/loan-delinquency-action-dialog.component.ts index 46f82b49d..02eff2552 100644 --- a/src/app/loans/custom-dialog/loan-delinquency-action-dialog/loan-delinquency-action-dialog.component.ts +++ b/src/app/loans/custom-dialog/loan-delinquency-action-dialog/loan-delinquency-action-dialog.component.ts @@ -8,24 +8,30 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; styleUrls: ['./loan-delinquency-action-dialog.component.scss'] }) export class LoanDelinquencyActionDialogComponent { - delinquencyActionForm: UntypedFormGroup; /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ maxDate = new Date(2100, 0, 1); - constructor(public dialogRef: MatDialogRef, + constructor( + public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any, - private formBuilder: UntypedFormBuilder) { - this.createDelinquencyActionForm(); + private formBuilder: UntypedFormBuilder + ) { + this.createDelinquencyActionForm(); } createDelinquencyActionForm() { this.delinquencyActionForm = this.formBuilder.group({ - 'startDate': [new Date(), Validators.required], - 'endDate': ['', Validators.required], + startDate: [ + new Date(), + Validators.required + ], + endDate: [ + '', + Validators.required + ] }); } - } diff --git a/src/app/loans/custom-dialog/loans-account-add-collateral-dialog/loans-account-add-collateral-dialog.component.spec.ts b/src/app/loans/custom-dialog/loans-account-add-collateral-dialog/loans-account-add-collateral-dialog.component.spec.ts index a8f964a62..14eb847ff 100644 --- a/src/app/loans/custom-dialog/loans-account-add-collateral-dialog/loans-account-add-collateral-dialog.component.spec.ts +++ b/src/app/loans/custom-dialog/loans-account-add-collateral-dialog/loans-account-add-collateral-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('LoansAccountAddCollateralDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoansAccountAddCollateralDialogComponent ] - }) - .compileComponents(); + declarations: [LoansAccountAddCollateralDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/custom-dialog/loans-account-add-collateral-dialog/loans-account-add-collateral-dialog.component.ts b/src/app/loans/custom-dialog/loans-account-add-collateral-dialog/loans-account-add-collateral-dialog.component.ts index fa72ba24a..624872c92 100644 --- a/src/app/loans/custom-dialog/loans-account-add-collateral-dialog/loans-account-add-collateral-dialog.component.ts +++ b/src/app/loans/custom-dialog/loans-account-add-collateral-dialog/loans-account-add-collateral-dialog.component.ts @@ -8,12 +8,11 @@ import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms styleUrls: ['./loans-account-add-collateral-dialog.component.scss'] }) export class LoansAccountAddCollateralDialogComponent implements OnInit { - layout: { - addButtonText?: string + addButtonText?: string; } = { - addButtonText: 'Add' - }; + addButtonText: 'Add' + }; addCollateralForm: UntypedFormGroup; /** All Collateral Options */ @@ -23,9 +22,11 @@ export class LoansAccountAddCollateralDialogComponent implements OnInit { /** Maximum ALlowed Quantity of selected collateral */ maxQuantity: any = 0; - constructor(public dialogRef: MatDialogRef, + constructor( + public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any, - private formBuilder: UntypedFormBuilder) { + private formBuilder: UntypedFormBuilder + ) { this.createAddCollateralForm(); } @@ -37,17 +38,23 @@ export class LoansAccountAddCollateralDialogComponent implements OnInit { createAddCollateralForm() { this.addCollateralForm = this.formBuilder.group({ - 'collateral': ['', Validators.required], - 'quantity': ['', Validators.required], - 'totalValue': [{value: '', disabled: true}], - 'totalCollateralValue': [{value: '', disabled: true}], + collateral: [ + '', + Validators.required + ], + quantity: [ + '', + Validators.required + ], + totalValue: [{ value: '', disabled: true }], + totalCollateralValue: [{ value: '', disabled: true }] }); } /** * Subscribe to Form controls value changes */ - buildDependencies() { + buildDependencies() { this.addCollateralForm.controls.collateral.valueChanges.subscribe((collateral: any) => { this.collateralData = collateral; this.maxQuantity = collateral.quantity; @@ -55,10 +62,9 @@ export class LoansAccountAddCollateralDialogComponent implements OnInit { this.addCollateralForm.controls.quantity.valueChanges.subscribe((quantity: any) => { this.addCollateralForm.patchValue({ - 'totalValue': this.collateralData.basePrice * quantity, - 'totalCollateralValue': this.collateralData.basePrice * this.collateralData.pctToBase * quantity / 100 + totalValue: this.collateralData.basePrice * quantity, + totalCollateralValue: (this.collateralData.basePrice * this.collateralData.pctToBase * quantity) / 100 }); }); } - } diff --git a/src/app/loans/custom-dialog/loans-account-view-guarantor-details-dialog/loans-account-view-guarantor-details-dialog.component.spec.ts b/src/app/loans/custom-dialog/loans-account-view-guarantor-details-dialog/loans-account-view-guarantor-details-dialog.component.spec.ts index 1722e597b..74123f4e9 100644 --- a/src/app/loans/custom-dialog/loans-account-view-guarantor-details-dialog/loans-account-view-guarantor-details-dialog.component.spec.ts +++ b/src/app/loans/custom-dialog/loans-account-view-guarantor-details-dialog/loans-account-view-guarantor-details-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('LoansAccountViewGuarantorDetailsDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoansAccountViewGuarantorDetailsDialogComponent ] - }) - .compileComponents(); + declarations: [LoansAccountViewGuarantorDetailsDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/custom-dialog/loans-account-view-guarantor-details-dialog/loans-account-view-guarantor-details-dialog.component.ts b/src/app/loans/custom-dialog/loans-account-view-guarantor-details-dialog/loans-account-view-guarantor-details-dialog.component.ts index c6324e313..980777c3d 100644 --- a/src/app/loans/custom-dialog/loans-account-view-guarantor-details-dialog/loans-account-view-guarantor-details-dialog.component.ts +++ b/src/app/loans/custom-dialog/loans-account-view-guarantor-details-dialog/loans-account-view-guarantor-details-dialog.component.ts @@ -7,13 +7,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./loans-account-view-guarantor-details-dialog.component.scss'] }) export class LoansAccountViewGuarantorDetailsDialogComponent implements OnInit { - - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { - } + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} ngOnInit() { this.dialogRef.updateSize('400px'); } - } diff --git a/src/app/loans/edit-loans-account/edit-loans-account.component.spec.ts b/src/app/loans/edit-loans-account/edit-loans-account.component.spec.ts index a7d321e85..ad52d7845 100644 --- a/src/app/loans/edit-loans-account/edit-loans-account.component.spec.ts +++ b/src/app/loans/edit-loans-account/edit-loans-account.component.spec.ts @@ -8,9 +8,8 @@ describe('EditLoansAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditLoansAccountComponent ] - }) - .compileComponents(); + declarations: [EditLoansAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/edit-loans-account/edit-loans-account.component.ts b/src/app/loans/edit-loans-account/edit-loans-account.component.ts index 119884f1e..bea4835d6 100644 --- a/src/app/loans/edit-loans-account/edit-loans-account.component.ts +++ b/src/app/loans/edit-loans-account/edit-loans-account.component.ts @@ -18,10 +18,11 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./edit-loans-account.component.scss'] }) export class EditLoansAccountComponent { - - @ViewChild(LoansAccountDetailsStepComponent, { static: true }) loansAccountDetailsStep: LoansAccountDetailsStepComponent; + @ViewChild(LoansAccountDetailsStepComponent, { static: true }) + loansAccountDetailsStep: LoansAccountDetailsStepComponent; @ViewChild(LoansAccountTermsStepComponent, { static: true }) loansAccountTermsStep: LoansAccountTermsStepComponent; - @ViewChild(LoansAccountChargesStepComponent, { static: true }) loansAccountChargesStep: LoansAccountChargesStepComponent; + @ViewChild(LoansAccountChargesStepComponent, { static: true }) + loansAccountChargesStep: LoansAccountChargesStepComponent; loansAccountAndTemplate: any; /** Loans Account Product Template */ @@ -41,7 +42,8 @@ export class EditLoansAccountComponent { * @param {loansService} LoansService Loans Service * @param {SettingsService} settingsService Settings Service */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private dateUtils: Dates, private loansService: LoansService, @@ -61,9 +63,11 @@ export class EditLoansAccountComponent { this.loansAccountProductTemplate = $event; this.currencyCode = this.loansAccountProductTemplate.currency.code; if (this.loansAccountProductTemplate.loanProductId) { - this.loansService.getLoansCollateralTemplateResource(this.loansAccountProductTemplate.loanProductId).subscribe((response: any) => { - this.collateralOptions = response.loanCollateralOptions; - }); + this.loansService + .getLoansCollateralTemplateResource(this.loansAccountProductTemplate.loanProductId) + .subscribe((response: any) => { + this.collateralOptions = response.loanCollateralOptions; + }); } } @@ -80,14 +84,12 @@ export class EditLoansAccountComponent { /** Checks wheter all the forms in different steps are valid and not pristine */ get loansAccountFormValidAndNotPristine() { return ( - (this.loansAccountDetailsForm.valid && - this.loansAccountTermsForm.valid) && - ( - !this.loansAccountDetailsForm.pristine || + this.loansAccountDetailsForm.valid && + this.loansAccountTermsForm.valid && + (!this.loansAccountDetailsForm.pristine || !this.loansAccountTermsForm.pristine || !this.loansAccountTermsStep.pristine || - !this.loansAccountChargesStep.pristine - ) + !this.loansAccountChargesStep.pristine) ); } @@ -115,7 +117,7 @@ export class EditLoansAccountComponent { charges: this.loansAccount.charges.map((charge: any) => ({ chargeId: charge.id, amount: charge.amount, - dueDate: charge.dueDate && this.dateUtils.formatDate(charge.dueDate, dateFormat), + dueDate: charge.dueDate && this.dateUtils.formatDate(charge.dueDate, dateFormat) })), collateral: this.loansAccount.collateral.map((collateralEle: any) => ({ type: collateralEle.type, @@ -141,13 +143,19 @@ export class EditLoansAccountComponent { } if (loansAccountData.recalculationRestFrequencyDate) { - loansAccountData.recalculationRestFrequencyDate = this.dateUtils.formatDate(this.loansAccount.recalculationRestFrequencyDate, dateFormat); + loansAccountData.recalculationRestFrequencyDate = this.dateUtils.formatDate( + this.loansAccount.recalculationRestFrequencyDate, + dateFormat + ); } if (loansAccountData.interestCalculationPeriodType === 0) { loansAccountData.allowPartialPeriodInterestCalcualtion = false; } - if (!loansAccountData.isLoanProductLinkedToFloatingRate || loansAccountData.isLoanProductLinkedToFloatingRate === false) { + if ( + !loansAccountData.isLoanProductLinkedToFloatingRate || + loansAccountData.isLoanProductLinkedToFloatingRate === false + ) { delete loansAccountData.isFloatingInterestRate; } loansAccountData.principal = loansAccountData.principalAmount; @@ -157,5 +165,4 @@ export class EditLoansAccountComponent { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/glim-account/create-glim-account/create-glim-account.component.spec.ts b/src/app/loans/glim-account/create-glim-account/create-glim-account.component.spec.ts index e34f6e9df..1eb07ecf3 100644 --- a/src/app/loans/glim-account/create-glim-account/create-glim-account.component.spec.ts +++ b/src/app/loans/glim-account/create-glim-account/create-glim-account.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateGlimAccountComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ CreateGlimAccountComponent ] - }) - .compileComponents(); + declarations: [CreateGlimAccountComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/glim-account/create-glim-account/create-glim-account.component.ts b/src/app/loans/glim-account/create-glim-account/create-glim-account.component.ts index 41db30a4d..02a856642 100644 --- a/src/app/loans/glim-account/create-glim-account/create-glim-account.component.ts +++ b/src/app/loans/glim-account/create-glim-account/create-glim-account.component.ts @@ -14,7 +14,6 @@ import { GlimTermsStepComponent } from './glim-account-stepper/glim-terms-step/g styleUrls: ['./create-glim-account.component.scss'] }) export class CreateGlimAccountComponent { - /** Imports all the step component */ @ViewChild(GlimDetailsStepComponent, { static: true }) loansAccountDetailsStep: GlimDetailsStepComponent; @ViewChild(GlimTermsStepComponent, { static: true }) loansAccountTermsStep: GlimTermsStepComponent; @@ -48,24 +47,26 @@ export class CreateGlimAccountComponent { * @param {LoansService} loansService Loans Service. * @param {SettingsService} settingsService SettingsService */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private loansService: LoansService, private settingsService: SettingsService, public dialog: MatDialog, - private dateUtils: Dates) { - this.route.data.subscribe((data: {loansAccountTemplate: any, gsimData: any, groupsData: any}) => { + private dateUtils: Dates + ) { + this.route.data.subscribe((data: { loansAccountTemplate: any; gsimData: any; groupsData: any }) => { this.loansAccountTemplate = data.loansAccountTemplate; this.activeClientMembers = data.groupsData.activeClientMembers; this.gsimData = data.gsimData; }); - } + } /** * Sets loans account product template and collateral template * @param {any} $event API response */ - setTemplate($event: any) { + setTemplate($event: any) { this.loansAccountProductTemplate = $event; } @@ -81,10 +82,7 @@ export class CreateGlimAccountComponent { /** Checks wheter all the forms in different steps are valid or not */ get loansAccountFormValid() { - return ( - this.loansAccountDetailsForm.valid && - this.loansAccountTermsForm.valid - ); + return this.loansAccountDetailsForm.valid && this.loansAccountTermsForm.valid; } /** Gets principal Amount */ @@ -98,7 +96,7 @@ export class CreateGlimAccountComponent { return { ...this.loansAccountDetailsStep.loansAccountDetails, ...this.loansAccountTermsStep.loansAccountTerms, - ...this.loansAccountChargesStep.loansAccountCharges, + ...this.loansAccountChargesStep.loansAccountCharges }; } @@ -110,12 +108,12 @@ export class CreateGlimAccountComponent { ...this.loansAccount, charges: this.loansAccount.charges.map((charge: any) => ({ chargeId: charge.id, - amount: charge.amount, + amount: charge.amount })), clientId: client.id, totalLoan: this.totalLoan, loanType: 'glim', - amortizationType: 1, + amortizationType: 1, isParentAccount: true, principal: client.principal, syncDisbursementWithMeeting: false, @@ -138,11 +136,10 @@ export class CreateGlimAccountComponent { for (let index = 0; index < memberSelected.length; index++) { requestData.push({ requestId: index.toString(), - method : 'POST', + method: 'POST', relativeUrl: 'loans', - body : this.setData( memberSelected[ index ] ) - } - ); + body: this.setData(memberSelected[index]) + }); } return requestData; } @@ -165,5 +162,4 @@ export class CreateGlimAccountComponent { this.router.navigate(['../../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-charges-step/glim-charges-step.component.spec.ts b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-charges-step/glim-charges-step.component.spec.ts index 0cc2e5fad..3a945da82 100644 --- a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-charges-step/glim-charges-step.component.spec.ts +++ b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-charges-step/glim-charges-step.component.spec.ts @@ -8,9 +8,8 @@ describe('GlimChargesStepComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GlimChargesStepComponent ] - }) - .compileComponents(); + declarations: [GlimChargesStepComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-charges-step/glim-charges-step.component.ts b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-charges-step/glim-charges-step.component.ts index 16a579927..eba57fe25 100644 --- a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-charges-step/glim-charges-step.component.ts +++ b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-charges-step/glim-charges-step.component.ts @@ -14,7 +14,6 @@ import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base'; styleUrls: ['./glim-charges-step.component.scss'] }) export class GlimChargesStepComponent implements OnInit, OnChanges { - /** Savings Account Product Template */ @Input() loansAccountProductTemplate: any; /** Savings Account Template */ @@ -33,7 +32,15 @@ export class GlimChargesStepComponent implements OnInit, OnChanges { /** For Edit Savings Account Form */ isChargesPatched = false; /** Display columns for charges table */ - displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'repaymentsEvery', 'action']; + displayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'date', + 'repaymentsEvery', + 'action' + ]; /** Table Data Source */ dataSource: any; /** Check for select all the Clients List */ @@ -41,23 +48,31 @@ export class GlimChargesStepComponent implements OnInit, OnChanges { /** Loan Purpose Options */ loanPurposeOptions: string[] = []; /** Table Displayed Columns */ - displayedColumn: string[] = ['check', 'id', 'name', 'purpose', 'amount']; + displayedColumn: string[] = [ + 'check', + 'id', + 'name', + 'purpose', + 'amount' + ]; /** * @param {MatDialog} dialog Mat Dialog */ - constructor(public dialog: MatDialog, - private dateUtils: Dates) {} + constructor( + public dialog: MatDialog, + private dateUtils: Dates + ) {} - ngOnInit() { + ngOnInit() { this.dataSource = new MatTableDataSource(this.activeClientMembers); - } + } - ngOnChanges() { + ngOnChanges() { if (this.loansAccountProductTemplate) { this.chargeData = this.loansAccountProductTemplate.chargeOptions; } - } + } /** * Adds the charge to charges table @@ -81,7 +96,8 @@ export class GlimChargesStepComponent implements OnInit, OnChanges { value: charge.amount, type: 'number', required: false - }), + }) + ]; const data = { title: 'Edit Charge Amount', @@ -111,7 +127,8 @@ export class GlimChargesStepComponent implements OnInit, OnChanges { value: charge.dueDate || charge.feeOnMonthDay || '', type: 'datetime-local', required: false - }), + }) + ]; const data = { title: 'Edit Charge Date', @@ -127,11 +144,11 @@ export class GlimChargesStepComponent implements OnInit, OnChanges { switch (charge.chargeTimeType.value) { case 'Specified due date': case 'Weekly Fee': - newCharge = { ...charge, dueDate: date }; - break; + newCharge = { ...charge, dueDate: date }; + break; case 'Annual Fee': - newCharge = { ...charge, feeOnMonthDay: date }; - break; + newCharge = { ...charge, feeOnMonthDay: date }; + break; } this.chargesDataSource.splice(this.chargesDataSource.indexOf(charge), 1, newCharge); this.chargesDataSource = this.chargesDataSource.concat([]); @@ -152,7 +169,8 @@ export class GlimChargesStepComponent implements OnInit, OnChanges { value: charge.feeInterval, type: 'text', required: false - }), + }) + ]; const data = { title: 'Edit Charge Fee Interval', @@ -188,7 +206,7 @@ export class GlimChargesStepComponent implements OnInit, OnChanges { } get selectedClientMembers() { - return { selectedMembers: this.activeClientMembers.filter( (item: any) => item.selected ) }; + return { selectedMembers: this.activeClientMembers.filter((item: any) => item.selected) }; } /** Toggle all checks */ @@ -201,7 +219,7 @@ export class GlimChargesStepComponent implements OnInit, OnChanges { /** Check if all the checks are selected */ toggleSelect() { const len = this.activeClientMembers.length; - this.selectAllItems = len === 0 ? false : this.activeClientMembers.filter( (item: any) => item.selected ).length === len; + this.selectAllItems = + len === 0 ? false : this.activeClientMembers.filter((item: any) => item.selected).length === len; } - } diff --git a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-details-step/glim-details-step.component.spec.ts b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-details-step/glim-details-step.component.spec.ts index c486517e4..932fce58f 100644 --- a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-details-step/glim-details-step.component.spec.ts +++ b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-details-step/glim-details-step.component.spec.ts @@ -8,9 +8,8 @@ describe('GlimDetailsStepComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GlimDetailsStepComponent ] - }) - .compileComponents(); + declarations: [GlimDetailsStepComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-details-step/glim-details-step.component.ts b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-details-step/glim-details-step.component.ts index 55ef4dd7d..39398ff59 100644 --- a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-details-step/glim-details-step.component.ts +++ b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-details-step/glim-details-step.component.ts @@ -39,9 +39,11 @@ export class GlimDetailsStepComponent implements OnInit { * @param {LoansService} loansService Loans Service. * @param {SettingsService} settingsService SettingsService */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loansService: LoansService, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.createLoansAccountDetailsForm(); } @@ -52,13 +54,17 @@ export class GlimDetailsStepComponent implements OnInit { this.productData = this.loansAccountTemplate.productOptions; if (this.loansAccountTemplate.loanProductId) { this.loansAccountDetailsForm.patchValue({ - 'productId': this.loansAccountTemplate.loanProductId, - 'submittedOnDate': this.loansAccountTemplate.timeline.submittedOnDate && new Date(this.loansAccountTemplate.timeline.submittedOnDate), - 'loanOfficerId': this.loansAccountTemplate.loanOfficerId, - 'loanPurposeId': this.loansAccountTemplate.loanPurposeId, - 'fundId': this.loansAccountTemplate.fundId, - 'expectedDisbursementDate': this.loansAccountTemplate.timeline.expectedDisbursementDate && new Date(this.loansAccountTemplate.timeline.expectedDisbursementDate), - 'externalId': this.loansAccountTemplate.externalId + productId: this.loansAccountTemplate.loanProductId, + submittedOnDate: + this.loansAccountTemplate.timeline.submittedOnDate && + new Date(this.loansAccountTemplate.timeline.submittedOnDate), + loanOfficerId: this.loansAccountTemplate.loanOfficerId, + loanPurposeId: this.loansAccountTemplate.loanPurposeId, + fundId: this.loansAccountTemplate.fundId, + expectedDisbursementDate: + this.loansAccountTemplate.timeline.expectedDisbursementDate && + new Date(this.loansAccountTemplate.timeline.expectedDisbursementDate), + externalId: this.loansAccountTemplate.externalId }); } } @@ -67,21 +73,30 @@ export class GlimDetailsStepComponent implements OnInit { /** * Creates glim account details form. */ - createLoansAccountDetailsForm() { + createLoansAccountDetailsForm() { this.loansAccountDetailsForm = this.formBuilder.group({ - 'productId': ['', Validators.required], - 'loanOfficerId': [''], - 'fundId': [''], - 'submittedOnDate': [new Date(), Validators.required], - 'expectedDisbursementDate': ['', Validators.required], - 'linkAccountId': [''], + productId: [ + '', + Validators.required + ], + loanOfficerId: [''], + fundId: [''], + submittedOnDate: [ + new Date(), + Validators.required + ], + expectedDisbursementDate: [ + '', + Validators.required + ], + linkAccountId: [''] }); } /** * Fetches loans account product template on productId value changes */ - buildDependencies() { + buildDependencies() { const groupId = this.loansAccountTemplate.group.id; this.loansAccountDetailsForm.get('productId').valueChanges.subscribe((productId: string) => { this.loansService.getLoansAccountTemplateResource(groupId, true, productId).subscribe((response: any) => { @@ -100,5 +115,4 @@ export class GlimDetailsStepComponent implements OnInit { get loansAccountDetails() { return this.loansAccountDetailsForm.value; } - } diff --git a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-preview-step/glim-preview-step.component.spec.ts b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-preview-step/glim-preview-step.component.spec.ts index c052ee2c0..2421f3fea 100644 --- a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-preview-step/glim-preview-step.component.spec.ts +++ b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-preview-step/glim-preview-step.component.spec.ts @@ -8,9 +8,8 @@ describe('GlimPreviewStepComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GlimPreviewStepComponent ] - }) - .compileComponents(); + declarations: [GlimPreviewStepComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-preview-step/glim-preview-step.component.ts b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-preview-step/glim-preview-step.component.ts index 3c0d17ebb..6eb58456f 100644 --- a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-preview-step/glim-preview-step.component.ts +++ b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-preview-step/glim-preview-step.component.ts @@ -6,8 +6,6 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; styleUrls: ['./glim-preview-step.component.scss'] }) export class GlimPreviewStepComponent { - - /** Loans Account Template */ @Input() loansAccountTemplate: any; /** Loans Account Product Template */ @@ -18,10 +16,20 @@ export class GlimPreviewStepComponent { @Output() submitEvent = new EventEmitter(); /** Charges Displayed Columns */ - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date']; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'date' + ]; /** Overdue Charges Displayed Columns */ - overdueChargesDisplayedColumns: string[] = ['name', 'type', 'amount', 'collectedon']; - - constructor() { } + overdueChargesDisplayedColumns: string[] = [ + 'name', + 'type', + 'amount', + 'collectedon' + ]; + constructor() {} } diff --git a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-terms-step/glim-terms-step.component.spec.ts b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-terms-step/glim-terms-step.component.spec.ts index b9829eb90..be94e1cae 100644 --- a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-terms-step/glim-terms-step.component.spec.ts +++ b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-terms-step/glim-terms-step.component.spec.ts @@ -8,9 +8,8 @@ describe('GlimTermsStepComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GlimTermsStepComponent ] - }) - .compileComponents(); + declarations: [GlimTermsStepComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-terms-step/glim-terms-step.component.ts b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-terms-step/glim-terms-step.component.ts index 23a09d9e8..6e5cfac16 100644 --- a/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-terms-step/glim-terms-step.component.ts +++ b/src/app/loans/glim-account/create-glim-account/glim-account-stepper/glim-terms-step/glim-terms-step.component.ts @@ -8,7 +8,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./glim-terms-step.component.scss'] }) export class GlimTermsStepComponent implements OnInit, OnChanges { - /** Loans Account Product Template */ @Input() loansAccountProductTemplate: any; /** Loans Account Template */ @@ -42,8 +41,10 @@ export class GlimTermsStepComponent implements OnInit, OnChanges { * @param formBuilder FormBuilder * @param {SettingsService} settingsService SettingsService */ - constructor(private formBuilder: UntypedFormBuilder, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private settingsService: SettingsService + ) { this.createloansAccountTermsForm(); } /** @@ -52,16 +53,16 @@ export class GlimTermsStepComponent implements OnInit, OnChanges { ngOnChanges() { if (this.loansAccountProductTemplate) { this.loansAccountTermsForm.patchValue({ - 'principal': this.loansAccountProductTemplate.principal, - 'loanTermFrequency': this.loansAccountProductTemplate.termFrequency, - 'loanTermFrequencyType': this.loansAccountProductTemplate.termPeriodFrequencyType.id, - 'numberOfRepayments': this.loansAccountProductTemplate.numberOfRepayments, - 'repaymentEvery': this.loansAccountProductTemplate.repaymentEvery, - 'repaymentFrequencyType': this.loansAccountProductTemplate.repaymentFrequencyType.id, - 'interestRatePerPeriod': this.loansAccountProductTemplate.interestRatePerPeriod, - 'interestType': this.loansAccountProductTemplate.interestType.id, - 'interestCalculationPeriodType': this.loansAccountProductTemplate.interestCalculationPeriodType.id, - 'transactionProcessingStrategyCode': this.loansAccountProductTemplate.transactionProcessingStrategyCode, + principal: this.loansAccountProductTemplate.principal, + loanTermFrequency: this.loansAccountProductTemplate.termFrequency, + loanTermFrequencyType: this.loansAccountProductTemplate.termPeriodFrequencyType.id, + numberOfRepayments: this.loansAccountProductTemplate.numberOfRepayments, + repaymentEvery: this.loansAccountProductTemplate.repaymentEvery, + repaymentFrequencyType: this.loansAccountProductTemplate.repaymentFrequencyType.id, + interestRatePerPeriod: this.loansAccountProductTemplate.interestRatePerPeriod, + interestType: this.loansAccountProductTemplate.interestType.id, + interestCalculationPeriodType: this.loansAccountProductTemplate.interestCalculationPeriodType.id, + transactionProcessingStrategyCode: this.loansAccountProductTemplate.transactionProcessingStrategyCode }); this.setOptions(); } @@ -72,7 +73,9 @@ export class GlimTermsStepComponent implements OnInit, OnChanges { if (this.loansAccountTemplate) { if (this.loansAccountTemplate.loanProductId) { this.loansAccountTermsForm.patchValue({ - 'repaymentsStartingFromDate': this.loansAccountTemplate.expectedFirstRepaymentOnDate && new Date(this.loansAccountTemplate.expectedFirstRepaymentOnDate) + repaymentsStartingFromDate: + this.loansAccountTemplate.expectedFirstRepaymentOnDate && + new Date(this.loansAccountTemplate.expectedFirstRepaymentOnDate) }); } } @@ -85,39 +88,55 @@ export class GlimTermsStepComponent implements OnInit, OnChanges { const repaymentFrequencyNthDayType = this.loansAccountTermsForm.get('repaymentFrequencyNthDayType'); const repaymentFrequencyDayOfWeekType = this.loansAccountTermsForm.get('repaymentFrequencyDayOfWeekType'); - this.loansAccountTermsForm.get('repaymentFrequencyType').valueChanges - .subscribe(repaymentFrequencyType => { + this.loansAccountTermsForm.get('repaymentFrequencyType').valueChanges.subscribe((repaymentFrequencyType) => { + if (repaymentFrequencyType === 2) { + repaymentFrequencyNthDayType.setValidators([Validators.required]); + repaymentFrequencyDayOfWeekType.setValidators([Validators.required]); + } else { + repaymentFrequencyNthDayType.setValidators(null); + repaymentFrequencyDayOfWeekType.setValidators(null); + } - if (repaymentFrequencyType === 2) { - repaymentFrequencyNthDayType.setValidators([Validators.required]); - repaymentFrequencyDayOfWeekType.setValidators([Validators.required]); - } else { - repaymentFrequencyNthDayType.setValidators(null); - repaymentFrequencyDayOfWeekType.setValidators(null); - } - - repaymentFrequencyNthDayType.updateValueAndValidity(); - repaymentFrequencyDayOfWeekType.updateValueAndValidity(); - }); + repaymentFrequencyNthDayType.updateValueAndValidity(); + repaymentFrequencyDayOfWeekType.updateValueAndValidity(); + }); } /** Create Loans Account Terms Form */ createloansAccountTermsForm() { this.loansAccountTermsForm = this.formBuilder.group({ - 'principal': ['', Validators.required], - 'loanTermFrequency': ['', Validators.required], - 'loanTermFrequencyType': ['', Validators.required], - 'numberOfRepayments': ['', Validators.required], - 'repaymentEvery': ['', Validators.required], - 'repaymentFrequencyType': ['', Validators.required], - 'repaymentFrequencyNthDayType': [''], - 'repaymentFrequencyDayOfWeekType': [''], - 'repaymentsStartingFromDate': [''], - 'interestChargedFromDate': [''], - 'interestRatePerPeriod': [''], - 'interestType': [''], - 'interestCalculationPeriodType': [''], - 'transactionProcessingStrategyCode': [''] + principal: [ + '', + Validators.required + ], + loanTermFrequency: [ + '', + Validators.required + ], + loanTermFrequencyType: [ + '', + Validators.required + ], + numberOfRepayments: [ + '', + Validators.required + ], + repaymentEvery: [ + '', + Validators.required + ], + repaymentFrequencyType: [ + '', + Validators.required + ], + repaymentFrequencyNthDayType: [''], + repaymentFrequencyDayOfWeekType: [''], + repaymentsStartingFromDate: [''], + interestChargedFromDate: [''], + interestRatePerPeriod: [''], + interestType: [''], + interestCalculationPeriodType: [''], + transactionProcessingStrategyCode: [''] }); } @@ -127,7 +146,8 @@ export class GlimTermsStepComponent implements OnInit, OnChanges { setOptions() { this.termFrequencyTypeData = this.loansAccountProductTemplate.termFrequencyTypeOptions; this.repaymentFrequencyNthDayTypeData = this.loansAccountProductTemplate.repaymentFrequencyNthDayTypeOptions; - this.repaymentFrequencyDaysOfWeekTypeData = this.loansAccountProductTemplate.repaymentFrequencyDaysOfWeekTypeOptions; + this.repaymentFrequencyDaysOfWeekTypeData = + this.loansAccountProductTemplate.repaymentFrequencyDaysOfWeekTypeOptions; this.interestTypeData = this.loansAccountProductTemplate.interestTypeOptions; this.amortizationTypeData = this.loansAccountProductTemplate.amortizationTypeOptions; this.interestCalculationPeriodTypeData = this.loansAccountProductTemplate.interestCalculationPeriodTypeOptions; @@ -141,5 +161,4 @@ export class GlimTermsStepComponent implements OnInit, OnChanges { get loansAccountTerms() { return this.loansAccountTermsForm.value; } - } diff --git a/src/app/loans/glim-account/glim-account-view.resolver.ts b/src/app/loans/glim-account/glim-account-view.resolver.ts index 10268e56a..422c86913 100644 --- a/src/app/loans/glim-account/glim-account-view.resolver.ts +++ b/src/app/loans/glim-account/glim-account-view.resolver.ts @@ -13,11 +13,10 @@ import { LoansService } from '../loans.service'; */ @Injectable() export class GLIMViewResolver implements Resolve { - /** * @param {LoansService} loansService Loans service. */ - constructor(private loansService: LoansService) { } + constructor(private loansService: LoansService) {} /** * Returns the Savings Account data. @@ -29,5 +28,4 @@ export class GLIMViewResolver implements Resolve { const glimId = route.paramMap.get('glimId'); return this.loansService.getGLIMAccountData(glimId, groupId); } - } diff --git a/src/app/loans/glim-account/glim-account.component.spec.ts b/src/app/loans/glim-account/glim-account.component.spec.ts index 584889228..026270bdf 100644 --- a/src/app/loans/glim-account/glim-account.component.spec.ts +++ b/src/app/loans/glim-account/glim-account.component.spec.ts @@ -8,9 +8,8 @@ describe('GlimAccountComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GlimAccountComponent ] - }) - .compileComponents(); + declarations: [GlimAccountComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/glim-account/glim-account.component.ts b/src/app/loans/glim-account/glim-account.component.ts index b82af0583..f14711031 100644 --- a/src/app/loans/glim-account/glim-account.component.ts +++ b/src/app/loans/glim-account/glim-account.component.ts @@ -13,9 +13,15 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./glim-account.component.scss'] }) export class GlimAccountComponent implements OnInit { - /** Columns to be displayed in GLIM overview table. */ - displayedColumns: string[] = ['loanId', 'clientId', 'clientName', 'loanAccountNumber', 'clientPrincipalLoan', 'groupPrincipalLoan']; + displayedColumns: string[] = [ + 'loanId', + 'clientId', + 'clientName', + 'loanAccountNumber', + 'clientPrincipalLoan', + 'groupPrincipalLoan' + ]; /** Data source for charge overview table. */ dataSource: MatTableDataSource; /** Charge Overview data */ @@ -29,9 +35,11 @@ export class GlimAccountComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {MatDialog} dialog Dialog reference. */ - constructor(private route: ActivatedRoute, - public dialog: MatDialog) { - this.route.data.subscribe((data: { glimData: any }) => { + constructor( + private route: ActivatedRoute, + public dialog: MatDialog + ) { + this.route.data.subscribe((data: { glimData: any }) => { this.glimOverviewData = data.glimData; }); } @@ -43,7 +51,7 @@ export class GlimAccountComponent implements OnInit { /** * Set GLIM Overview. */ - setLoanClientChargeOverview() { + setLoanClientChargeOverview() { this.dataSource = new MatTableDataSource(this.glimOverviewData); } } diff --git a/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.spec.ts b/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.spec.ts index 774bbabc8..cdf22bc5e 100644 --- a/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.spec.ts +++ b/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoansAccountChargesStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoansAccountChargesStepComponent ] - }) - .compileComponents(); + declarations: [LoansAccountChargesStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.ts index 994408ceb..2e84abdb4 100644 --- a/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.ts +++ b/src/app/loans/loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component.ts @@ -25,7 +25,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./loans-account-charges-step.component.scss'] }) export class LoansAccountChargesStepComponent implements OnInit, OnChanges { - // @Input loansAccountProductTemplate: LoansAccountProductTemplate @Input() loansAccountProductTemplate: any; // @Imput loansAccountTemplate: LoansAccountTemplate @@ -42,9 +41,21 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges { /** Collateral Data Source */ collateralDataSource: {}[] = []; /** Charges table columns */ - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'action']; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'date', + 'action' + ]; /** Columns to be displayed in overdue charges table. */ - overdueChargesDisplayedColumns: string[] = ['name', 'type', 'amount', 'collectedon']; + overdueChargesDisplayedColumns: string[] = [ + 'name', + 'type', + 'amount', + 'collectedon' + ]; /** Component is pristine if there has been no changes by user interaction */ pristine = true; /** Check if value of collateral added is more than principal amount */ @@ -59,16 +70,19 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges { * @param {Dates} dateUtils Date Utils * @param {SettingsService} settingsService Settings Service */ - constructor(public dialog: MatDialog, + constructor( + public dialog: MatDialog, private dateUtils: Dates, private route: ActivatedRoute, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.loanId = this.route.snapshot.params['loanId']; } ngOnInit() { if (this.loansAccountTemplate && this.loansAccountTemplate.charges) { - this.chargesDataSource = this.loansAccountTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || []; + this.chargesDataSource = + this.loansAccountTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || []; } } @@ -81,8 +95,13 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges { if (this.loansAccountProductTemplate.overdueCharges) { this.overDueChargesDataSource = this.loansAccountProductTemplate.overdueCharges; } - if (this.loansAccountProductTemplate.charges && this.loansAccountProductTemplate.charges.length > 0 && this.chargesDataSource.length === 0) { - this.chargesDataSource = this.loansAccountProductTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || []; + if ( + this.loansAccountProductTemplate.charges && + this.loansAccountProductTemplate.charges.length > 0 && + this.chargesDataSource.length === 0 + ) { + this.chargesDataSource = + this.loansAccountProductTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || []; } } } @@ -108,7 +127,8 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges { value: charge.amount, type: 'number', required: false - }), + }) + ]; const data = { title: 'Edit Charge Amount', @@ -138,7 +158,8 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges { value: charge.dueDate || charge.feeOnMonthDay || '', type: 'datetime-local', required: false - }), + }) + ]; const data = { title: 'Edit Charge Date', @@ -179,7 +200,8 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges { value: charge.feeInterval, type: 'text', required: false - }), + }) + ]; const data = { title: 'Edit Charge Fee Interval', @@ -214,14 +236,12 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges { }); } - /** * Returns Loans Account Charges and Collateral Form */ get loansAccountCharges() { return { - charges: this.chargesDataSource, + charges: this.chargesDataSource }; } - } diff --git a/src/app/loans/loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component.spec.ts b/src/app/loans/loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component.spec.ts index d826e3fef..87ffe5f3e 100644 --- a/src/app/loans/loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component.spec.ts +++ b/src/app/loans/loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoansAccountDatatableStepComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ LoansAccountDatatableStepComponent ] - }) - .compileComponents(); + declarations: [LoansAccountDatatableStepComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component.ts index dac6c1eba..e25da19c3 100644 --- a/src/app/loans/loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component.ts +++ b/src/app/loans/loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component.ts @@ -16,13 +16,20 @@ export class LoansAccountDatatableStepComponent implements OnInit { datatableInputs: any = []; - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private settingsService: SettingsService, - private dateUtils: Dates) { } + private dateUtils: Dates + ) {} ngOnInit(): void { this.datatableInputs = this.datatableData.columnHeaderData.filter((column: any) => { - return ((column.columnName !== 'id') && (column.columnName !== 'loan_id') && (column.columnName !== 'created_at') && (column.columnName !== 'updated_at')); + return ( + column.columnName !== 'id' && + column.columnName !== 'loan_id' && + column.columnName !== 'created_at' && + column.columnName !== 'updated_at' + ); }); const inputItems: any = {}; this.datatableInputs.forEach((input: any) => { @@ -72,7 +79,7 @@ export class LoansAccountDatatableStepComponent implements OnInit { } isColumnType(columnType: string, expectedType: string) { - return (columnType === expectedType); + return columnType === expectedType; } get payload(): any { @@ -104,5 +111,4 @@ export class LoansAccountDatatableStepComponent implements OnInit { }; return payload; } - } diff --git a/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.spec.ts b/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.spec.ts index 3f978a3c6..4913eb6be 100644 --- a/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.spec.ts +++ b/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoansAccountDetailsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoansAccountDetailsStepComponent ] - }) - .compileComponents(); + declarations: [LoansAccountDetailsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.ts index 18db04517..21d2e6ab5 100644 --- a/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.ts +++ b/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.ts @@ -19,7 +19,6 @@ import { ReplaySubject, Subject } from 'rxjs'; styleUrls: ['./loans-account-details-step.component.scss'] }) export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy { - /** Loans Account Template */ @Input() loansAccountTemplate: any; @@ -60,11 +59,13 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy { * @param {LoansService} loansService Loans Service. * @param {SettingsService} settingsService SettingsService */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loansService: LoansService, private route: ActivatedRoute, private settingsService: SettingsService, - private commons: Commons) { + private commons: Commons + ) { this.loanId = this.route.snapshot.params['loanId']; } @@ -76,19 +77,21 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy { this.productList = this.loansAccountTemplate.productOptions.sort(this.commons.dynamicSort('name')); if (this.loansAccountTemplate.loanProductId) { this.loansAccountDetailsForm.patchValue({ - 'productId': this.loansAccountTemplate.loanProductId, - 'submittedOnDate': this.loansAccountTemplate.timeline.submittedOnDate && new Date(this.loansAccountTemplate.timeline.submittedOnDate), - 'loanOfficerId': this.loansAccountTemplate.loanOfficerId, - 'loanPurposeId': this.loansAccountTemplate.loanPurposeId, - 'fundId': this.loansAccountTemplate.fundId, - 'expectedDisbursementDate': this.loansAccountTemplate.timeline.expectedDisbursementDate && new Date(this.loansAccountTemplate.timeline.expectedDisbursementDate), - 'externalId': this.loansAccountTemplate.externalId + productId: this.loansAccountTemplate.loanProductId, + submittedOnDate: + this.loansAccountTemplate.timeline.submittedOnDate && + new Date(this.loansAccountTemplate.timeline.submittedOnDate), + loanOfficerId: this.loansAccountTemplate.loanOfficerId, + loanPurposeId: this.loansAccountTemplate.loanPurposeId, + fundId: this.loansAccountTemplate.fundId, + expectedDisbursementDate: + this.loansAccountTemplate.timeline.expectedDisbursementDate && + new Date(this.loansAccountTemplate.timeline.expectedDisbursementDate), + externalId: this.loansAccountTemplate.externalId }); } } - this.filterFormCtrl.valueChanges - .pipe(takeUntil(this._onDestroy)) - .subscribe(() => { + this.filterFormCtrl.valueChanges.pipe(takeUntil(this._onDestroy)).subscribe(() => { this.searchItem(); }); this.productData.next(this.productList.slice()); @@ -104,11 +107,13 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy { const search: string = this.filterFormCtrl.value.toLowerCase(); if (!search) { - this.productData.next(this.productList.slice()); + this.productData.next(this.productList.slice()); } else { - this.productData.next(this.productList.filter((option: any) => { - return option['name'].toLowerCase().indexOf(search) >= 0; - })); + this.productData.next( + this.productList.filter((option: any) => { + return option['name'].toLowerCase().indexOf(search) >= 0; + }) + ); } } } @@ -118,15 +123,24 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy { */ createLoansAccountDetailsForm() { this.loansAccountDetailsForm = this.formBuilder.group({ - 'productId': ['', Validators.required], - 'loanOfficerId': [''], - 'loanPurposeId': [''], - 'fundId': [''], - 'submittedOnDate': [this.settingsService.businessDate, Validators.required], - 'expectedDisbursementDate': ['', Validators.required], - 'externalId': [''], - 'linkAccountId': [''], - 'createStandingInstructionAtDisbursement': [''] + productId: [ + '', + Validators.required + ], + loanOfficerId: [''], + loanPurposeId: [''], + fundId: [''], + submittedOnDate: [ + this.settingsService.businessDate, + Validators.required + ], + expectedDisbursementDate: [ + '', + Validators.required + ], + externalId: [''], + linkAccountId: [''], + createStandingInstructionAtDisbursement: [''] }); } @@ -134,8 +148,10 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy { * Fetches loans account product template on productId value changes */ buildDependencies() { - const entityId = (this.loansAccountTemplate.clientId) ? this.loansAccountTemplate.clientId : this.loansAccountTemplate.group.id; - const isGroup = (this.loansAccountTemplate.clientId) ? false : true; + const entityId = this.loansAccountTemplate.clientId + ? this.loansAccountTemplate.clientId + : this.loansAccountTemplate.group.id; + const isGroup = this.loansAccountTemplate.clientId ? false : true; this.loansAccountDetailsForm.get('productId').valueChanges.subscribe((productId: string) => { this.loansService.getLoansAccountTemplateResource(entityId, isGroup, productId).subscribe((response: any) => { this.loansAccountProductTemplate.emit(response); @@ -145,7 +161,9 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy { this.accountLinkingOptions = response.accountLinkingOptions; this.loanProductSelected = true; if (response.createStandingInstructionAtDisbursement) { - this.loansAccountDetailsForm.get('createStandingInstructionAtDisbursement').patchValue(response.createStandingInstructionAtDisbursement); + this.loansAccountDetailsForm + .get('createStandingInstructionAtDisbursement') + .patchValue(response.createStandingInstructionAtDisbursement); } }); }); @@ -157,5 +175,4 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy { get loansAccountDetails() { return this.loansAccountDetailsForm.getRawValue(); } - } diff --git a/src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.spec.ts b/src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.spec.ts index be0f2bc28..255ec90ba 100644 --- a/src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.spec.ts +++ b/src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoansAccountPreviewStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoansAccountPreviewStepComponent ] - }) - .compileComponents(); + declarations: [LoansAccountPreviewStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.ts index 74f2218b7..2e23129de 100644 --- a/src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.ts +++ b/src/app/loans/loans-account-stepper/loans-account-preview-step/loans-account-preview-step.component.ts @@ -10,7 +10,6 @@ import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges } from styleUrls: ['./loans-account-preview-step.component.scss'] }) export class LoansAccountPreviewStepComponent implements OnChanges { - /** Loans Account Template */ @Input() loansAccountTemplate: any = []; /** Loans Account Product Template */ @@ -21,16 +20,26 @@ export class LoansAccountPreviewStepComponent implements OnChanges { @Output() submitEvent = new EventEmitter(); /** Charges Displayed Columns */ - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date']; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'date' + ]; /** Overdue Charges Displayed Columns */ - overdueChargesDisplayedColumns: string[] = ['name', 'type', 'amount', 'collectedon']; + overdueChargesDisplayedColumns: string[] = [ + 'name', + 'type', + 'amount', + 'collectedon' + ]; productEnableDownPayment = false; - constructor() { } + constructor() {} ngOnChanges(changes: SimpleChanges): void { this.productEnableDownPayment = this.loansAccountProductTemplate.product.enableDownPayment; } - } diff --git a/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.spec.ts b/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.spec.ts index d7761273a..aad1e9231 100644 --- a/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.spec.ts +++ b/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoansAccountScheduleStepComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ LoansAccountScheduleStepComponent ] - }) - .compileComponents(); + declarations: [LoansAccountScheduleStepComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.ts index 045e25880..466c58524 100644 --- a/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.ts +++ b/src/app/loans/loans-account-stepper/loans-account-schedule-step/loans-account-schedule-step.component.ts @@ -9,7 +9,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./loans-account-schedule-step.component.scss'] }) export class LoansAccountScheduleStepComponent { - /** Currency Code */ @Input() currencyCode: string; /** Loans Account Template */ @@ -19,22 +18,29 @@ export class LoansAccountScheduleStepComponent { /** Loans Account Data */ @Input() loansAccount: any; - repaymentScheduleDetails: any = {periods: []}; + repaymentScheduleDetails: any = { periods: [] }; loanId: any = null; - constructor(private loansService: LoansService, + constructor( + private loansService: LoansService, private settingsService: SettingsService, - private route: ActivatedRoute) { - this.loanId = this.route.snapshot.params['loanId']; + private route: ActivatedRoute + ) { + this.loanId = this.route.snapshot.params['loanId']; } showRepaymentInfo(): void { - this.repaymentScheduleDetails = {periods: []}; + this.repaymentScheduleDetails = { periods: [] }; const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; - const payload = this.loansService.buildLoanRequestPayload(this.loansAccount, this.loansAccountTemplate, - this.loansAccountProductTemplate.calendarOptions, locale, dateFormat); + const payload = this.loansService.buildLoanRequestPayload( + this.loansAccount, + this.loansAccountTemplate, + this.loansAccountProductTemplate.calendarOptions, + locale, + dateFormat + ); delete payload['enableInstallmentLevelDelinquency']; this.loansService.calculateLoanSchedule(payload).subscribe((response: any) => { diff --git a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.spec.ts b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.spec.ts index 8bbbb2bb6..3c482d31b 100644 --- a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.spec.ts +++ b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoansAccountTermsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoansAccountTermsStepComponent ] - }) - .compileComponents(); + declarations: [LoansAccountTermsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts index 7ddbaf257..c73b2d64c 100644 --- a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts +++ b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts @@ -24,7 +24,6 @@ import { CodeName, OptionData } from 'app/shared/models/option-data.model'; styleUrls: ['./loans-account-terms-step.component.scss'] }) export class LoansAccountTermsStepComponent implements OnInit, OnChanges { - /** Loans Product Options */ @Input() loansProductOptions: any; /** Loans Account Product Template */ @@ -74,9 +73,19 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { /** Collateral Data Source */ collateralDataSource: {}[] = []; /** Columns to be displayed in collateral table. */ - loanCollateralDisplayedColumns: string[] = ['type', 'value', 'totalValue', 'totalCollateralValue', 'action']; + loanCollateralDisplayedColumns: string[] = [ + 'type', + 'value', + 'totalValue', + 'totalCollateralValue', + 'action' + ]; /** Disbursement Data Displayed Columns */ - disbursementDisplayedColumns: string[] = ['expectedDisbursementDate', 'principal', 'actions']; + disbursementDisplayedColumns: string[] = [ + 'expectedDisbursementDate', + 'principal', + 'actions' + ]; /** Multi Disbursement Control */ totalMultiDisbursed: any = 0; isMultiDisbursedCompleted = false; @@ -97,12 +106,14 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { * @param formBuilder FormBuilder * @param {SettingsService} settingsService SettingsService */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private settingsService: SettingsService, private route: ActivatedRoute, - public dialog: MatDialog) { - this.loanId = this.route.snapshot.params['loanId']; - this.createloansAccountTermsForm(); + public dialog: MatDialog + ) { + this.loanId = this.route.snapshot.params['loanId']; + this.createloansAccountTermsForm(); } /** * Executes on change of input values @@ -124,30 +135,30 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { this.interestRateFrequencyTypeData = this.loansAccountTermsData.interestRateFrequencyTypeOptions; this.loansAccountTermsForm.patchValue({ - 'principalAmount': this.loansAccountTermsData.principal, - 'loanTermFrequency': this.loansAccountTermsData.termFrequency, - 'loanTermFrequencyType': this.loansAccountTermsData.termPeriodFrequencyType.id, - 'numberOfRepayments': this.loansAccountTermsData.numberOfRepayments, - 'repaymentEvery': this.loansAccountTermsData.repaymentEvery, - 'repaymentFrequencyType': this.loansAccountTermsData.repaymentFrequencyType.id, - 'amortizationType': this.loansAccountTermsData.amortizationType.id, - 'isEqualAmortization': this.loansAccountTermsData.isEqualAmortization, - 'interestType': this.loansAccountTermsData.interestType.id, - 'isFloatingInterestRate': this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : '', - 'interestCalculationPeriodType': this.loansAccountTermsData.interestCalculationPeriodType.id, - 'allowPartialPeriodInterestCalcualtion': this.loansAccountTermsData.allowPartialPeriodInterestCalcualtion, - 'inArrearsTolerance': this.loansAccountTermsData.inArrearsTolerance, - 'graceOnPrincipalPayment': this.loansAccountTermsData.graceOnPrincipalPayment, - 'graceOnInterestPayment': this.loansAccountTermsData.graceOnInterestPayment, - 'graceOnArrearsAgeing': this.loansAccountTermsData.graceOnArrearsAgeing, - 'graceOnInterestCharged': this.loansAccountTermsData.graceOnInterestCharged, - 'fixedEmiAmount': this.loansAccountTermsData.fixedEmiAmount, - 'maxOutstandingLoanBalance': this.loansAccountTermsData.maxOutstandingLoanBalance, - 'transactionProcessingStrategyCode': this.loansAccountTermsData.transactionProcessingStrategyCode, - 'interestRateDifferential': this.loansAccountTermsData.interestRateDifferential, - 'multiDisburseLoan': this.loansAccountTermsData.multiDisburseLoan, - 'interestRateFrequencyType': this.loansAccountTermsData.interestRateFrequencyType.id, - 'balloonRepaymentAmount': this.loansAccountTermsData.balloonRepaymentAmount, + principalAmount: this.loansAccountTermsData.principal, + loanTermFrequency: this.loansAccountTermsData.termFrequency, + loanTermFrequencyType: this.loansAccountTermsData.termPeriodFrequencyType.id, + numberOfRepayments: this.loansAccountTermsData.numberOfRepayments, + repaymentEvery: this.loansAccountTermsData.repaymentEvery, + repaymentFrequencyType: this.loansAccountTermsData.repaymentFrequencyType.id, + amortizationType: this.loansAccountTermsData.amortizationType.id, + isEqualAmortization: this.loansAccountTermsData.isEqualAmortization, + interestType: this.loansAccountTermsData.interestType.id, + isFloatingInterestRate: this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : '', + interestCalculationPeriodType: this.loansAccountTermsData.interestCalculationPeriodType.id, + allowPartialPeriodInterestCalcualtion: this.loansAccountTermsData.allowPartialPeriodInterestCalcualtion, + inArrearsTolerance: this.loansAccountTermsData.inArrearsTolerance, + graceOnPrincipalPayment: this.loansAccountTermsData.graceOnPrincipalPayment, + graceOnInterestPayment: this.loansAccountTermsData.graceOnInterestPayment, + graceOnArrearsAgeing: this.loansAccountTermsData.graceOnArrearsAgeing, + graceOnInterestCharged: this.loansAccountTermsData.graceOnInterestCharged, + fixedEmiAmount: this.loansAccountTermsData.fixedEmiAmount, + maxOutstandingLoanBalance: this.loansAccountTermsData.maxOutstandingLoanBalance, + transactionProcessingStrategyCode: this.loansAccountTermsData.transactionProcessingStrategyCode, + interestRateDifferential: this.loansAccountTermsData.interestRateDifferential, + multiDisburseLoan: this.loansAccountTermsData.multiDisburseLoan, + interestRateFrequencyType: this.loansAccountTermsData.interestRateFrequencyType.id, + balloonRepaymentAmount: this.loansAccountTermsData.balloonRepaymentAmount }); this.setAdvancedPaymentStrategyControls(); @@ -165,11 +176,17 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { }); } if (this.isDelinquencyEnabled()) { - this.loansAccountTermsForm.addControl('enableInstallmentLevelDelinquency', new UntypedFormControl(this.loansAccountTermsData.enableInstallmentLevelDelinquency || this.loanProduct.enableInstallmentLevelDelinquency)); + this.loansAccountTermsForm.addControl( + 'enableInstallmentLevelDelinquency', + new UntypedFormControl( + this.loansAccountTermsData.enableInstallmentLevelDelinquency || + this.loanProduct.enableInstallmentLevelDelinquency + ) + ); } this.collateralDataSource = this.loansAccountTermsData.collateral || []; if (this.productEnableDownPayment) { - const enableDownPayment = (this.loansAccountTermsData['enableDownPayment'] === false) ? false : true; + const enableDownPayment = this.loansAccountTermsData['enableDownPayment'] === false ? false : true; this.loansAccountTermsForm.addControl('enableDownPayment', new UntypedFormControl(enableDownPayment)); } @@ -217,34 +234,36 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { if (this.loansAccountTermsData) { if (this.loansAccountTermsData.loanProductId) { this.loansAccountTermsForm.patchValue({ - 'repaymentsStartingFromDate': this.loansAccountTermsData.expectedFirstRepaymentOnDate && new Date(this.loansAccountTermsData.expectedFirstRepaymentOnDate) + repaymentsStartingFromDate: + this.loansAccountTermsData.expectedFirstRepaymentOnDate && + new Date(this.loansAccountTermsData.expectedFirstRepaymentOnDate) }); } this.loansAccountTermsForm.patchValue({ - 'principalAmount': this.loansAccountTermsData.principal, - 'loanTermFrequency': this.loansAccountTermsData.termFrequency, - 'loanTermFrequencyType': this.loansAccountTermsData.termPeriodFrequencyType.id, - 'numberOfRepayments': this.loansAccountTermsData.numberOfRepayments, - 'repaymentEvery': this.loansAccountTermsData.repaymentEvery, - 'repaymentFrequencyType': this.loansAccountTermsData.repaymentFrequencyType.id, - 'amortizationType': this.loansAccountTermsData.amortizationType.id, - 'isEqualAmortization': this.loansAccountTermsData.isEqualAmortization, - 'interestType': this.loansAccountTermsData.interestType.id, - 'isFloatingInterestRate': this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : '', - 'interestCalculationPeriodType': this.loansAccountTermsData.interestCalculationPeriodType.id, - 'allowPartialPeriodInterestCalcualtion': this.loansAccountTermsData.allowPartialPeriodInterestCalcualtion, - 'inArrearsTolerance': this.loansAccountTermsData.inArrearsTolerance, - 'graceOnPrincipalPayment': this.loansAccountTermsData.graceOnPrincipalPayment, - 'graceOnInterestPayment': this.loansAccountTermsData.graceOnInterestPayment, - 'graceOnArrearsAgeing': this.loansAccountTermsData.graceOnArrearsAgeing, - 'graceOnInterestCharged': this.loansAccountTermsData.graceOnInterestCharged, - 'fixedEmiAmount': this.loansAccountTermsData.fixedEmiAmount, - 'maxOutstandingLoanBalance': this.loansAccountTermsData.maxOutstandingLoanBalance, - 'transactionProcessingStrategyCode': this.loansAccountTermsData.transactionProcessingStrategyCode, - 'interestRateDifferential': this.loansAccountTermsData.interestRateDifferential, - 'multiDisburseLoan': this.loansAccountTermsData.multiDisburseLoan, - 'interestRateFrequencyType': this.loansAccountTermsData.interestRateFrequencyType.id, - 'balloonRepaymentAmount': this.loansAccountTermsData.balloonRepaymentAmount + principalAmount: this.loansAccountTermsData.principal, + loanTermFrequency: this.loansAccountTermsData.termFrequency, + loanTermFrequencyType: this.loansAccountTermsData.termPeriodFrequencyType.id, + numberOfRepayments: this.loansAccountTermsData.numberOfRepayments, + repaymentEvery: this.loansAccountTermsData.repaymentEvery, + repaymentFrequencyType: this.loansAccountTermsData.repaymentFrequencyType.id, + amortizationType: this.loansAccountTermsData.amortizationType.id, + isEqualAmortization: this.loansAccountTermsData.isEqualAmortization, + interestType: this.loansAccountTermsData.interestType.id, + isFloatingInterestRate: this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : '', + interestCalculationPeriodType: this.loansAccountTermsData.interestCalculationPeriodType.id, + allowPartialPeriodInterestCalcualtion: this.loansAccountTermsData.allowPartialPeriodInterestCalcualtion, + inArrearsTolerance: this.loansAccountTermsData.inArrearsTolerance, + graceOnPrincipalPayment: this.loansAccountTermsData.graceOnPrincipalPayment, + graceOnInterestPayment: this.loansAccountTermsData.graceOnInterestPayment, + graceOnArrearsAgeing: this.loansAccountTermsData.graceOnArrearsAgeing, + graceOnInterestCharged: this.loansAccountTermsData.graceOnInterestCharged, + fixedEmiAmount: this.loansAccountTermsData.fixedEmiAmount, + maxOutstandingLoanBalance: this.loansAccountTermsData.maxOutstandingLoanBalance, + transactionProcessingStrategyCode: this.loansAccountTermsData.transactionProcessingStrategyCode, + interestRateDifferential: this.loansAccountTermsData.interestRateDifferential, + multiDisburseLoan: this.loansAccountTermsData.multiDisburseLoan, + interestRateFrequencyType: this.loansAccountTermsData.interestRateFrequencyType.id, + balloonRepaymentAmount: this.loansAccountTermsData.balloonRepaymentAmount }); } this.createloansAccountTermsForm(); @@ -254,7 +273,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { } allowAddDisbursementDetails() { - return (this.multiDisburseLoan && !this.loansAccountTermsData.disallowExpectedDisbursements); + return this.multiDisburseLoan && !this.loansAccountTermsData.disallowExpectedDisbursements; } /** Custom Validators for the form */ @@ -262,63 +281,68 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { const repaymentFrequencyNthDayType = this.loansAccountTermsForm.get('repaymentFrequencyNthDayType'); const repaymentFrequencyDayOfWeekType = this.loansAccountTermsForm.get('repaymentFrequencyDayOfWeekType'); - this.loansAccountTermsForm.get('repaymentFrequencyType').valueChanges - .subscribe(repaymentFrequencyType => { + this.loansAccountTermsForm.get('repaymentFrequencyType').valueChanges.subscribe((repaymentFrequencyType) => { + if (repaymentFrequencyType === 2) { + repaymentFrequencyNthDayType.setValidators([Validators.required]); + repaymentFrequencyDayOfWeekType.setValidators([Validators.required]); + } else { + repaymentFrequencyNthDayType.setValidators(null); + repaymentFrequencyDayOfWeekType.setValidators(null); + } - if (repaymentFrequencyType === 2) { - repaymentFrequencyNthDayType.setValidators([Validators.required]); - repaymentFrequencyDayOfWeekType.setValidators([Validators.required]); - } else { - repaymentFrequencyNthDayType.setValidators(null); - repaymentFrequencyDayOfWeekType.setValidators(null); - } - - repaymentFrequencyNthDayType.updateValueAndValidity(); - repaymentFrequencyDayOfWeekType.updateValueAndValidity(); - }); + repaymentFrequencyNthDayType.updateValueAndValidity(); + repaymentFrequencyDayOfWeekType.updateValueAndValidity(); + }); } /** Custom Listeners for the form to calculate Loan Term */ setLoanTermListener() { - this.loansAccountTermsForm.get('numberOfRepayments').valueChanges - .subscribe(numberOfRepayments => { - const repaymentEvery: number = this.loansAccountTermsForm.value.repaymentEvery; - this.calculateLoanTerm(numberOfRepayments, repaymentEvery); - }); + this.loansAccountTermsForm.get('numberOfRepayments').valueChanges.subscribe((numberOfRepayments) => { + const repaymentEvery: number = this.loansAccountTermsForm.value.repaymentEvery; + this.calculateLoanTerm(numberOfRepayments, repaymentEvery); + }); - this.loansAccountTermsForm.get('repaymentEvery').valueChanges - .subscribe(repaymentEvery => { - const numberOfRepayments: number = this.loansAccountTermsForm.value.numberOfRepayments; - this.calculateLoanTerm(numberOfRepayments, repaymentEvery); - }); + this.loansAccountTermsForm.get('repaymentEvery').valueChanges.subscribe((repaymentEvery) => { + const numberOfRepayments: number = this.loansAccountTermsForm.value.numberOfRepayments; + this.calculateLoanTerm(numberOfRepayments, repaymentEvery); + }); - this.loansAccountTermsForm.get('loanTermFrequencyType').valueChanges - .subscribe(loanTermFrequencyType => { - this.loansAccountTermsForm.patchValue({'repaymentFrequencyType': loanTermFrequencyType}); - }); + this.loansAccountTermsForm.get('loanTermFrequencyType').valueChanges.subscribe((loanTermFrequencyType) => { + this.loansAccountTermsForm.patchValue({ repaymentFrequencyType: loanTermFrequencyType }); + }); - this.loansAccountTermsForm.get('amortizationType').valueChanges - .subscribe(amortizationType => { - if (amortizationType === 0) { // Equal Principal Payments - this.loansAccountTermsForm.addControl('fixedPrincipalPercentagePerInstallment', new UntypedFormControl('')); - } else { // Equal Installments - this.loansAccountTermsForm.removeControl('fixedPrincipalPercentagePerInstallment'); - } + this.loansAccountTermsForm.get('amortizationType').valueChanges.subscribe((amortizationType) => { + if (amortizationType === 0) { + // Equal Principal Payments + this.loansAccountTermsForm.addControl('fixedPrincipalPercentagePerInstallment', new UntypedFormControl('')); + } else { + // Equal Installments + this.loansAccountTermsForm.removeControl('fixedPrincipalPercentagePerInstallment'); + } }); } setAdvancedPaymentStrategyControls(): void { - // Fixed Length validation - if (this.loansAccountTermsData) { - this.loansAccountTermsForm.removeControl('interestRatePerPeriod'); - this.loansAccountTermsForm.removeControl('fixedLength'); - if (this.loansAccountTermsData.product.fixedLength) { - this.loansAccountTermsForm.addControl('interestRatePerPeriod', new UntypedFormControl({value: 0, disabled: true}, Validators.required)); - this.loansAccountTermsForm.addControl('fixedLength', new UntypedFormControl(this.loansAccountTermsData.product.fixedLength)); - } else { - this.loansAccountTermsForm.addControl('interestRatePerPeriod', new UntypedFormControl(this.loansAccountTermsData.interestRatePerPeriod, Validators.required)); - } + // Fixed Length validation + if (this.loansAccountTermsData) { + this.loansAccountTermsForm.removeControl('interestRatePerPeriod'); + this.loansAccountTermsForm.removeControl('fixedLength'); + if (this.loansAccountTermsData.product.fixedLength) { + this.loansAccountTermsForm.addControl( + 'interestRatePerPeriod', + new UntypedFormControl({ value: 0, disabled: true }, Validators.required) + ); + this.loansAccountTermsForm.addControl( + 'fixedLength', + new UntypedFormControl(this.loansAccountTermsData.product.fixedLength) + ); + } else { + this.loansAccountTermsForm.addControl( + 'interestRatePerPeriod', + new UntypedFormControl(this.loansAccountTermsData.interestRatePerPeriod, Validators.required) + ); } + } } hasFixedLength(): boolean { @@ -329,49 +353,73 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { } isEqualPrincipalPayments(): boolean { - return (this.loansAccountTermsForm.value.amortizationType === 0); + return this.loansAccountTermsForm.value.amortizationType === 0; } /** Create Loans Account Terms Form */ createloansAccountTermsForm() { this.loansAccountTermsForm = this.formBuilder.group({ - 'principalAmount': ['', Validators.required], - 'loanTermFrequency': [{ value: '', disabled: true }, Validators.required], - 'loanTermFrequencyType': ['', Validators.required], - 'numberOfRepayments': ['', Validators.required], - 'repaymentEvery': ['', Validators.required], - 'repaymentFrequencyType': [{ value: '', disabled: true }, Validators.required], - 'repaymentFrequencyNthDayType': [''], - 'repaymentFrequencyDayOfWeekType': [''], - 'repaymentsStartingFromDate': [''], - 'interestChargedFromDate': [''], - 'interestRatePerPeriod': [''], - 'interestType': [''], - 'isFloatingInterestRate': [''], - 'isEqualAmortization': [''], - 'amortizationType': ['', Validators.required], - 'interestCalculationPeriodType': [''], - 'allowPartialPeriodInterestCalcualtion': [''], - 'inArrearsTolerance': [''], - 'graceOnInterestCharged': [''], - 'graceOnPrincipalPayment': [''], - 'graceOnInterestPayment': [''], - 'graceOnArrearsAgeing': [''], - 'loanIdToClose': [''], - 'fixedEmiAmount': [''], - 'isTopup': [''], - 'maxOutstandingLoanBalance': [''], - 'interestRateDifferential': [''], - 'transactionProcessingStrategyCode': ['', Validators.required], - 'multiDisburseLoan': [false], - 'interestRateFrequencyType': [''], - 'balloonRepaymentAmount': [''] + principalAmount: [ + '', + Validators.required + ], + loanTermFrequency: [ + { value: '', disabled: true }, + Validators.required + ], + loanTermFrequencyType: [ + '', + Validators.required + ], + numberOfRepayments: [ + '', + Validators.required + ], + repaymentEvery: [ + '', + Validators.required + ], + repaymentFrequencyType: [ + { value: '', disabled: true }, + Validators.required + ], + repaymentFrequencyNthDayType: [''], + repaymentFrequencyDayOfWeekType: [''], + repaymentsStartingFromDate: [''], + interestChargedFromDate: [''], + interestRatePerPeriod: [''], + interestType: [''], + isFloatingInterestRate: [''], + isEqualAmortization: [''], + amortizationType: [ + '', + Validators.required + ], + interestCalculationPeriodType: [''], + allowPartialPeriodInterestCalcualtion: [''], + inArrearsTolerance: [''], + graceOnInterestCharged: [''], + graceOnPrincipalPayment: [''], + graceOnInterestPayment: [''], + graceOnArrearsAgeing: [''], + loanIdToClose: [''], + fixedEmiAmount: [''], + isTopup: [''], + maxOutstandingLoanBalance: [''], + interestRateDifferential: [''], + transactionProcessingStrategyCode: [ + '', + Validators.required + ], + multiDisburseLoan: [false], + interestRateFrequencyType: [''], + balloonRepaymentAmount: [''] }); } calculateLoanTerm(numberOfRepayments: number, repaymentEvery: number): void { const loanTerm = numberOfRepayments * repaymentEvery; - this.loansAccountTermsForm.patchValue({'loanTermFrequency': loanTerm}); + this.loansAccountTermsForm.patchValue({ loanTermFrequency: loanTerm }); } /** @@ -408,6 +456,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { required: true, order: 2 }) + ]; const data = { title: 'Add Disbursement Details', @@ -418,10 +467,10 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { disbursementDialogRef.afterClosed().subscribe((response: any) => { if (response.data) { const principal = response.data.value.principal * 1; - if ((this.totalMultiDisbursed + principal) <= currentPrincipalAmount) { + if (this.totalMultiDisbursed + principal <= currentPrincipalAmount) { this.disbursementDataSource = this.disbursementDataSource.concat(response.data.value); this.totalMultiDisbursed += principal; - this.isMultiDisbursedCompleted = (this.totalMultiDisbursed === currentPrincipalAmount); + this.isMultiDisbursedCompleted = this.totalMultiDisbursed === currentPrincipalAmount; this.pristine = false; } } @@ -443,7 +492,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { this.disbursementDataSource.splice(index, 1); this.disbursementDataSource = this.disbursementDataSource.concat([]); this.totalMultiDisbursed -= principal; - this.isMultiDisbursedCompleted = (this.totalMultiDisbursed === currentPrincipalAmount); + this.isMultiDisbursedCompleted = this.totalMultiDisbursed === currentPrincipalAmount; } }); } @@ -459,11 +508,14 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { if (response.data) { const collateralData = { type: response.data.value.collateral, - value: response.data.value.quantity, + value: response.data.value.quantity }; - this.totalCollateralValue += collateralData.type.pctToBase * collateralData.type.basePrice * collateralData.value / 100; + this.totalCollateralValue += + (collateralData.type.pctToBase * collateralData.type.basePrice * collateralData.value) / 100; this.collateralDataSource = this.collateralDataSource.concat(collateralData); - this.collateralOptions = this.collateralOptions.filter((user: any) => user.collateralId !== response.data.value.collateral.collateralId); + this.collateralOptions = this.collateralOptions.filter( + (user: any) => user.collateralId !== response.data.value.collateral.collateralId + ); if (this.loanPrincipal < this.totalCollateralValue) { this.isCollateralSufficient = true; } else { @@ -484,7 +536,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { if (response.delete) { const removed: any = this.collateralDataSource.splice(id, 1); this.collateralOptions = this.collateralOptions.concat(removed[0].type); - this.totalCollateralValue -= removed[0].type.pctToBase * removed[0].type.basePrice * removed[0].value / 100; + this.totalCollateralValue -= (removed[0].type.pctToBase * removed[0].type.basePrice * removed[0].value) / 100; this.collateralDataSource = this.collateralDataSource.concat([]); this.pristine = false; if (this.loanPrincipal < this.totalCollateralValue) { @@ -502,7 +554,8 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { setOptions() { this.termFrequencyTypeData = this.loansAccountProductTemplate.termFrequencyTypeOptions; this.repaymentFrequencyNthDayTypeData = this.loansAccountProductTemplate.repaymentFrequencyNthDayTypeOptions; - this.repaymentFrequencyDaysOfWeekTypeData = this.loansAccountProductTemplate.repaymentFrequencyDaysOfWeekTypeOptions; + this.repaymentFrequencyDaysOfWeekTypeData = + this.loansAccountProductTemplate.repaymentFrequencyDaysOfWeekTypeOptions; this.interestTypeData = this.loansAccountProductTemplate.interestTypeOptions; this.amortizationTypeData = this.loansAccountProductTemplate.amortizationTypeOptions; this.interestCalculationPeriodTypeData = this.loansAccountProductTemplate.interestCalculationPeriodTypeOptions; @@ -511,14 +564,14 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { this.transactionProcessingStrategyOptions = []; if (this.loanScheduleType.code === LoanProducts.LOAN_SCHEDULE_TYPE_CUMULATIVE) { // Filter Advanced Payment Allocation Strategy - this.transactionProcessingStrategyOptions = this.loansAccountProductTemplate.transactionProcessingStrategyOptions.filter( - (cn: CodeName) => !LoanProducts.isAdvancedPaymentAllocationStrategy(cn.code) - ); + this.transactionProcessingStrategyOptions = + this.loansAccountProductTemplate.transactionProcessingStrategyOptions.filter( + (cn: CodeName) => !LoanProducts.isAdvancedPaymentAllocationStrategy(cn.code) + ); this.repaymentStrategyDisabled = false; } else { // Only Advanced Payment Allocation Strategy - this.loansAccountProductTemplate.transactionProcessingStrategyOptions.some( - (cn: CodeName) => { + this.loansAccountProductTemplate.transactionProcessingStrategyOptions.some((cn: CodeName) => { if (LoanProducts.isAdvancedPaymentAllocationStrategy(cn.code)) { this.transactionProcessingStrategyOptions.push(cn); } @@ -554,5 +607,4 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges { collateral: this.collateralDataSource }; } - } diff --git a/src/app/loans/loans-routing.module.ts b/src/app/loans/loans-routing.module.ts index f9b8dd60c..e74f6d9c6 100644 --- a/src/app/loans/loans-routing.module.ts +++ b/src/app/loans/loans-routing.module.ts @@ -99,7 +99,7 @@ const routes: Routes = [ resolve: { loanDetailsData: LoanDetailsResolver, loanDatatables: LoanDatatablesResolver - }, + } }, { path: 'accountdetail', @@ -109,12 +109,12 @@ const routes: Routes = [ { path: 'original-schedule', component: OriginalScheduleTabComponent, - data: { title: 'Original Schedule', breadcrumb: 'Original Schedule', routeParamBreadcrumb: false }, + data: { title: 'Original Schedule', breadcrumb: 'Original Schedule', routeParamBreadcrumb: false } }, { path: 'repayment-schedule', component: RepaymentScheduleTabComponent, - data: { title: 'Repayment Schedule', breadcrumb: 'Repayment Schedule', routeParamBreadcrumb: false }, + data: { title: 'Repayment Schedule', breadcrumb: 'Repayment Schedule', routeParamBreadcrumb: false } }, { path: 'transactions', @@ -123,7 +123,6 @@ const routes: Routes = [ { path: '', component: TransactionsTabComponent - }, { path: 'export', @@ -143,7 +142,7 @@ const routes: Routes = [ { path: '', component: LoanDelinquencyTagsTabComponent - }, + } ] }, { @@ -162,7 +161,11 @@ const routes: Routes = [ { path: 'loan-collateral', component: LoanCollateralTabComponent, - data: { title: 'Loan Collateral Details', breadcrumb: 'Loan Collateral Details', routeParamBreadcrumb: false }, + data: { + title: 'Loan Collateral Details', + breadcrumb: 'Loan Collateral Details', + routeParamBreadcrumb: false + }, resolve: { loanCollaterals: LoanCollateralsResolver } @@ -174,12 +177,12 @@ const routes: Routes = [ resolve: { loanDetailsData: LoanDetailsResolver, interestPausesData: LoanTermVariationsResolver - }, + } }, { path: 'loan-tranche-details', component: LoanTrancheDetailsComponent, - data: { title: 'Loan Tranche Details', breadcrumb: 'Loan Tranche Details', routeParamBreadcrumb: false }, + data: { title: 'Loan Tranche Details', breadcrumb: 'Loan Tranche Details', routeParamBreadcrumb: false } }, { path: 'overdue-charges', @@ -189,12 +192,16 @@ const routes: Routes = [ { path: 'floating-interest-rates', component: FloatingInterestRatesComponent, - data: { title: 'Floating Interest Rates', breadcrumb: 'Floating Interest Rates', routeParamBreadcrumb: false }, + data: { + title: 'Floating Interest Rates', + breadcrumb: 'Floating Interest Rates', + routeParamBreadcrumb: false + } }, { path: 'charges', data: { title: 'Loans Account Charges', breadcrumb: 'Charges', routeParamBreadcrumb: false }, - component: ChargesTabComponent, + component: ChargesTabComponent }, { path: 'loan-documents', @@ -202,7 +209,7 @@ const routes: Routes = [ data: { title: 'Loan Documents', breadcrumb: 'Loan Documents', routeParamBreadcrumb: false }, resolve: { loanDocuments: LoanDocumentsResolver - }, + } }, { path: 'notes', @@ -210,7 +217,7 @@ const routes: Routes = [ data: { title: 'Notes', breadcrumb: 'Notes', routeParamBreadcrumb: false }, resolve: { loanNotes: LoanNotesResolver - }, + } }, { path: 'standing-instruction', @@ -228,16 +235,18 @@ const routes: Routes = [ }, { path: 'datatables', - children: [{ - path: ':datatableName', - component: DatatableTabComponent, - data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, - resolve: { - loanDatatable: LoanDatatableResolver + children: [ + { + path: ':datatableName', + component: DatatableTabComponent, + data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, + resolve: { + loanDatatable: LoanDatatableResolver + } } - }] - }, - ], + ] + } + ] }, { path: ':loanId/transactions/:id', @@ -286,7 +295,8 @@ const routes: Routes = [ children: [ { path: '', - redirectTo: '../charges', pathMatch: 'prefix' + redirectTo: '../charges', + pathMatch: 'prefix' }, { path: ':id', @@ -318,7 +328,8 @@ const routes: Routes = [ }, { path: ':loanId/transfer-funds', - loadChildren: () => import('../account-transfers/account-transfers.module').then(m => m.AccountTransfersModule) + loadChildren: () => + import('../account-transfers/account-transfers.module').then((m) => m.AccountTransfersModule) }, { path: 'edit-loans-account', @@ -327,7 +338,7 @@ const routes: Routes = [ resolve: { loansAccountAndTemplate: LoansAccountAndTemplateResolver } - }, + } ] }, { @@ -340,8 +351,8 @@ const routes: Routes = [ resolve: { loansAccountTemplate: GLIMLoanTemplateResolver, gsimData: GSIMAccountsResolver, - groupsData: GroupViewResolver, - }, + groupsData: GroupViewResolver + } }, { path: ':glimId', @@ -350,7 +361,7 @@ const routes: Routes = [ resolve: { glimData: GLIMViewResolver, groupsData: GroupAccountsResolver - }, + } } ] } @@ -383,5 +394,4 @@ const routes: Routes = [ LoanTermVariationsResolver ] }) - -export class LoansRoutingModule { } +export class LoansRoutingModule {} diff --git a/src/app/loans/loans-view/account-details/account-details.component.spec.ts b/src/app/loans/loans-view/account-details/account-details.component.spec.ts index ab7581370..d4b9db68c 100644 --- a/src/app/loans/loans-view/account-details/account-details.component.spec.ts +++ b/src/app/loans/loans-view/account-details/account-details.component.spec.ts @@ -8,9 +8,8 @@ describe('AccountDetailsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AccountDetailsComponent ] - }) - .compileComponents(); + declarations: [AccountDetailsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/account-details/account-details.component.ts b/src/app/loans/loans-view/account-details/account-details.component.ts index 4f7f0cc13..5a537cfa6 100644 --- a/src/app/loans/loans-view/account-details/account-details.component.ts +++ b/src/app/loans/loans-view/account-details/account-details.component.ts @@ -7,17 +7,15 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./account-details.component.scss'] }) export class AccountDetailsComponent { - loanDetails: any; dataObject: { - property: string, - value: string + property: string; + value: string; }[]; constructor(private route: ActivatedRoute) { - this.route.parent.data.subscribe((data: { loanDetailsData: any, }) => { + this.route.parent.data.subscribe((data: { loanDetailsData: any }) => { this.loanDetails = data.loanDetailsData; }); } - } diff --git a/src/app/loans/loans-view/charges-tab/charges-tab.component.spec.ts b/src/app/loans/loans-view/charges-tab/charges-tab.component.spec.ts index 1ef118215..0733958ac 100644 --- a/src/app/loans/loans-view/charges-tab/charges-tab.component.spec.ts +++ b/src/app/loans/loans-view/charges-tab/charges-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('ChargesTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChargesTabComponent ] - }) - .compileComponents(); + declarations: [ChargesTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/charges-tab/charges-tab.component.ts b/src/app/loans/loans-view/charges-tab/charges-tab.component.ts index ad15294d4..6a4fa3e5d 100644 --- a/src/app/loans/loans-view/charges-tab/charges-tab.component.ts +++ b/src/app/loans/loans-view/charges-tab/charges-tab.component.ts @@ -30,7 +30,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./charges-tab.component.scss'] }) export class ChargesTabComponent implements OnInit { - /** Loan Details Data */ loanDetails: any; /** Charges Data */ @@ -38,7 +37,18 @@ export class ChargesTabComponent implements OnInit { /** Status */ status: any; /** Columns to be displayed in charges table. */ - displayedColumns: string[] = ['name', 'feepenalty', 'paymentdueat', 'dueDate', 'calculationtype', 'due', 'paid', 'waived', 'outstanding', 'actions']; + displayedColumns: string[] = [ + 'name', + 'feepenalty', + 'paymentdueat', + 'dueDate', + 'calculationtype', + 'due', + 'paid', + 'waived', + 'outstanding', + 'actions' + ]; /** Data source for charges table. */ dataSource: MatTableDataSource; @@ -54,14 +64,16 @@ export class ChargesTabComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {SettingsService} settingsService Settings Service */ - constructor(private loansService: LoansService, + constructor( + private loansService: LoansService, private route: ActivatedRoute, private dateUtils: Dates, private router: Router, private translateService: TranslateService, public dialog: MatDialog, private settingsService: SettingsService, - private systemService: SystemService) { + private systemService: SystemService + ) { this.route.parent.data.subscribe((data: { loanDetailsData: any }) => { this.loanDetails = data.loanDetailsData; }); @@ -69,21 +81,28 @@ export class ChargesTabComponent implements OnInit { ngOnInit() { this.systemService.getConfigurationByName('charge-accrual-date').subscribe((config: GlobalConfiguration) => { - this.useDueDate = (config.stringValue === 'due-date'); + this.useDueDate = config.stringValue === 'due-date'; }); this.chargesData = this.loanDetails.charges; this.status = this.loanDetails.status.value; let actionFlag; this.chargesData.forEach((element: any) => { element.dueDate = this.dateUtils.parseDate(element.dueDate); - if (element.paid || element.waived || element.chargeTimeType.value === 'Disbursement' || this.loanDetails.status.value !== 'Active') { + if ( + element.paid || + element.waived || + element.chargeTimeType.value === 'Disbursement' || + this.loanDetails.status.value !== 'Active' + ) { actionFlag = true; } else { actionFlag = false; } element.actionFlag = actionFlag; }); - this.chargesData = this.chargesData.sort(function (a: any, b: any) { return b.dueDate - a.dueDate; }); + this.chargesData = this.chargesData.sort(function (a: any, b: any) { + return b.dueDate - a.dueDate; + }); this.dataSource = new MatTableDataSource(this.chargesData); this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; @@ -110,6 +129,7 @@ export class ChargesTabComponent implements OnInit { type: 'date', required: true }) + ]; const data = { title: `Pay Charge ${chargeId}`, @@ -127,7 +147,8 @@ export class ChargesTabComponent implements OnInit { dateFormat, locale }; - this.loansService.executeLoansAccountChargesCommand(this.loanDetails.id, 'pay', dataObject, chargeId) + this.loansService + .executeLoansAccountChargesCommand(this.loanDetails.id, 'pay', dataObject, chargeId) .subscribe(() => { this.reload(); }); @@ -140,10 +161,19 @@ export class ChargesTabComponent implements OnInit { * @param {any} chargeId Charge Id */ waiveCharge(chargeId: any) { - const waiveChargeDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: this.translateService.instant('labels.heading.Waive Charge'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id') + `${chargeId} ?`, type: 'Basic' } }); + const waiveChargeDialogRef = this.dialog.open(ConfirmationDialogComponent, { + data: { + heading: this.translateService.instant('labels.heading.Waive Charge'), + dialogContext: + this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id') + + `${chargeId} ?`, + type: 'Basic' + } + }); waiveChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.loansService.executeLoansAccountChargesCommand(this.loanDetails.id, 'waive', {}, chargeId) + this.loansService + .executeLoansAccountChargesCommand(this.loanDetails.id, 'waive', {}, chargeId) .subscribe(() => { this.reload(); }); @@ -164,6 +194,7 @@ export class ChargesTabComponent implements OnInit { type: 'number', required: true }) + ]; const data = { title: `Edit Charge ${charge.id}`, @@ -180,10 +211,9 @@ export class ChargesTabComponent implements OnInit { dateFormat, locale }; - this.loansService.editLoansAccountCharge(this.loanDetails.id, dataObject, charge.id) - .subscribe(() => { - this.reload(); - }); + this.loansService.editLoansAccountCharge(this.loanDetails.id, dataObject, charge.id).subscribe(() => { + this.reload(); + }); } }); } @@ -198,10 +228,9 @@ export class ChargesTabComponent implements OnInit { }); deleteChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.loansService.deleteLoansAccountCharge(this.loanDetails.id, chargeId) - .subscribe(() => { - this.reload(); - }); + this.loansService.deleteLoansAccountCharge(this.loanDetails.id, chargeId).subscribe(() => { + this.reload(); + }); } }); } @@ -221,8 +250,8 @@ export class ChargesTabComponent implements OnInit { private reload() { const clientId = this.loanDetails.clientId; const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true }) + this.router + .navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } - } diff --git a/src/app/loans/loans-view/datatable-tab/datatable-tab.component.spec.ts b/src/app/loans/loans-view/datatable-tab/datatable-tab.component.spec.ts index 1f409cd4e..c2f4a85fd 100644 --- a/src/app/loans/loans-view/datatable-tab/datatable-tab.component.spec.ts +++ b/src/app/loans/loans-view/datatable-tab/datatable-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('DatatableTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DatatableTabComponent ] - }) - .compileComponents(); + declarations: [DatatableTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/datatable-tab/datatable-tab.component.ts b/src/app/loans/loans-view/datatable-tab/datatable-tab.component.ts index 17253d9ed..16ac5a2ce 100644 --- a/src/app/loans/loans-view/datatable-tab/datatable-tab.component.ts +++ b/src/app/loans/loans-view/datatable-tab/datatable-tab.component.ts @@ -7,7 +7,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./datatable-tab.component.scss'] }) export class DatatableTabComponent { - entityId: string; /** Loan Datatable */ entityDatatable: any = null; @@ -26,5 +25,4 @@ export class DatatableTabComponent { this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); } - } diff --git a/src/app/loans/loans-view/external-asset-owner-tab/external-asset-owner-tab.component.spec.ts b/src/app/loans/loans-view/external-asset-owner-tab/external-asset-owner-tab.component.spec.ts index 3e436262a..754e7ded5 100644 --- a/src/app/loans/loans-view/external-asset-owner-tab/external-asset-owner-tab.component.spec.ts +++ b/src/app/loans/loans-view/external-asset-owner-tab/external-asset-owner-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('ExternalAssetOwnerTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ExternalAssetOwnerTabComponent ] - }) - .compileComponents(); + declarations: [ExternalAssetOwnerTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/loans-view/external-asset-owner-tab/external-asset-owner-tab.component.ts b/src/app/loans/loans-view/external-asset-owner-tab/external-asset-owner-tab.component.ts index cf00c7343..2883f2a4b 100644 --- a/src/app/loans/loans-view/external-asset-owner-tab/external-asset-owner-tab.component.ts +++ b/src/app/loans/loans-view/external-asset-owner-tab/external-asset-owner-tab.component.ts @@ -11,32 +11,40 @@ import { CancelDialogComponent } from 'app/shared/cancel-dialog/cancel-dialog.co styleUrls: ['./external-asset-owner-tab.component.scss'] }) export class ExternalAssetOwnerTabComponent implements OnInit { - defaultDate = '9999-12-31'; loanTransfersData: any[] = []; activeTransferData: any; - loanTransferColumns: string[] = ['status', 'effectiveFrom', 'ownerExternalId', 'transferExternalId', 'settlementDate', 'purchasePriceRatio', 'actions']; + loanTransferColumns: string[] = [ + 'status', + 'effectiveFrom', + 'ownerExternalId', + 'transferExternalId', + 'settlementDate', + 'purchasePriceRatio', + 'actions' + ]; currentItem: any; existActiveTransfer = false; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private dialog: MatDialog, private externalAssetOwner: ExternalAssetOwner, private externalAssetOwnerService: ExternalAssetOwnerService - ) { - this.route.data.subscribe((data: { loanTransfersData: any, activeTransferData: any }) => { - this.loanTransfersData = data.loanTransfersData.empty ? [] : data.loanTransfersData.content; + ) { + this.route.data.subscribe((data: { loanTransfersData: any; activeTransferData: any }) => { + this.loanTransfersData = data.loanTransfersData.empty ? [] : data.loanTransfersData.content; this.activeTransferData = data.activeTransferData || null; - this.existActiveTransfer = (data.activeTransferData && data.activeTransferData.transferId != null); + this.existActiveTransfer = data.activeTransferData && data.activeTransferData.transferId != null; }); } ngOnInit(): void { this.currentItem = null; if (this.loanTransfersData.length > 0) { - this.currentItem = this.loanTransfersData[(this.loanTransfersData.length - 1)]; + this.currentItem = this.loanTransfersData[this.loanTransfersData.length - 1]; } } @@ -85,10 +93,11 @@ export class ExternalAssetOwnerTabComponent implements OnInit { const payload: any = { transferExternalId: this.currentItem.transferExternalId }; - this.externalAssetOwnerService.executeExternalAssetOwnerTransferCommand(this.currentItem.transferId, payload, 'cancel') + this.externalAssetOwnerService + .executeExternalAssetOwnerTransferCommand(this.currentItem.transferId, payload, 'cancel') .subscribe((result: any) => { this.reload(); - }); + }); } }); } @@ -103,7 +112,6 @@ export class ExternalAssetOwnerTabComponent implements OnInit { reload() { const url: string = this.router.url; - this.router.navigateByUrl(`/`, {skipLocationChange: true}) - .then(() => this.router.navigate([url])); + this.router.navigateByUrl(`/`, { skipLocationChange: true }).then(() => this.router.navigate([url])); } } diff --git a/src/app/loans/loans-view/external-asset-owner-tab/external-asset-transfer/external-asset-transfer.component.spec.ts b/src/app/loans/loans-view/external-asset-owner-tab/external-asset-transfer/external-asset-transfer.component.spec.ts index feefb23c5..f4b8c45ab 100644 --- a/src/app/loans/loans-view/external-asset-owner-tab/external-asset-transfer/external-asset-transfer.component.spec.ts +++ b/src/app/loans/loans-view/external-asset-owner-tab/external-asset-transfer/external-asset-transfer.component.spec.ts @@ -8,9 +8,8 @@ describe('ExternalAssetTransferComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ExternalAssetTransferComponent ] - }) - .compileComponents(); + declarations: [ExternalAssetTransferComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/loans-view/external-asset-owner-tab/external-asset-transfer/external-asset-transfer.component.ts b/src/app/loans/loans-view/external-asset-owner-tab/external-asset-transfer/external-asset-transfer.component.ts index 3e66403c8..f0b14ce2a 100644 --- a/src/app/loans/loans-view/external-asset-owner-tab/external-asset-transfer/external-asset-transfer.component.ts +++ b/src/app/loans/loans-view/external-asset-owner-tab/external-asset-transfer/external-asset-transfer.component.ts @@ -10,10 +10,9 @@ export class ExternalAssetTransferComponent { /** Input Fields Data */ @Input() transferData: any; - constructor(private externalAssetOwner: ExternalAssetOwner) { } + constructor(private externalAssetOwner: ExternalAssetOwner) {} itemStatus(status: string): string { return this.externalAssetOwner.itemStatus(status); } - } diff --git a/src/app/loans/loans-view/floating-interest-rates/floating-interest-rates.component.spec.ts b/src/app/loans/loans-view/floating-interest-rates/floating-interest-rates.component.spec.ts index 286b81c7a..05b220688 100644 --- a/src/app/loans/loans-view/floating-interest-rates/floating-interest-rates.component.spec.ts +++ b/src/app/loans/loans-view/floating-interest-rates/floating-interest-rates.component.spec.ts @@ -8,9 +8,8 @@ describe('FloatingInterestRatesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FloatingInterestRatesComponent ] - }) - .compileComponents(); + declarations: [FloatingInterestRatesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/floating-interest-rates/floating-interest-rates.component.ts b/src/app/loans/loans-view/floating-interest-rates/floating-interest-rates.component.ts index c9bd5a432..de22bd23b 100644 --- a/src/app/loans/loans-view/floating-interest-rates/floating-interest-rates.component.ts +++ b/src/app/loans/loans-view/floating-interest-rates/floating-interest-rates.component.ts @@ -7,20 +7,22 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./floating-interest-rates.component.scss'] }) export class FloatingInterestRatesComponent implements OnInit { - /** Loan Details */ loanDetails: any; /** Interest Rate Data */ interestRateData: any; /** Columns to be displayed in charges table. */ - displayedColumns: string[] = ['fromDate', 'interestRate']; + displayedColumns: string[] = [ + 'fromDate', + 'interestRate' + ]; /** * Retrieves the loans data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.parent.data.subscribe(( data: { loanDetailsData: any }) => { + this.route.parent.data.subscribe((data: { loanDetailsData: any }) => { this.loanDetails = data.loanDetailsData; }); } @@ -28,5 +30,4 @@ export class FloatingInterestRatesComponent implements OnInit { ngOnInit() { this.interestRateData = this.loanDetails.interestRatesPeriods; } - } diff --git a/src/app/loans/loans-view/general-tab/general-tab.component.spec.ts b/src/app/loans/loans-view/general-tab/general-tab.component.spec.ts index 68ff6503e..53d6cbc31 100644 --- a/src/app/loans/loans-view/general-tab/general-tab.component.spec.ts +++ b/src/app/loans/loans-view/general-tab/general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GeneralTabComponent ] - }) - .compileComponents(); + declarations: [GeneralTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/general-tab/general-tab.component.ts b/src/app/loans/loans-view/general-tab/general-tab.component.ts index b4b844619..b773b71e8 100644 --- a/src/app/loans/loans-view/general-tab/general-tab.component.ts +++ b/src/app/loans/loans-view/general-tab/general-tab.component.ts @@ -8,26 +8,36 @@ import { MatTableDataSource } from '@angular/material/table'; styleUrls: ['./general-tab.component.scss'] }) export class GeneralTabComponent implements OnInit { - /** Currency Code */ currencyCode: string; loanDetails: any; status: any; - loanSummaryColumns: string[] = ['Empty', 'Original', 'Paid', 'Waived', 'Written Off', 'Outstanding', 'Over Due']; - loanDetailsColumns: string[] = ['Key', 'Value']; + loanSummaryColumns: string[] = [ + 'Empty', + 'Original', + 'Paid', + 'Waived', + 'Written Off', + 'Outstanding', + 'Over Due' + ]; + loanDetailsColumns: string[] = [ + 'Key', + 'Value' + ]; loanSummaryTableData: { - 'property': string, - 'original': string, - 'adjustment': string, - 'paid': string, - 'waived': string, - 'writtenOff': string, - 'outstanding': string, - 'overdue': string + property: string; + original: string; + adjustment: string; + paid: string; + waived: string; + writtenOff: string; + outstanding: string; + overdue: string; }[]; loanDetailsTableData: { - 'key': string, - 'value'?: string + key: string; + value?: string; }[]; /** Data source for loans summary table. */ @@ -35,13 +45,22 @@ export class GeneralTabComponent implements OnInit { detailsDataSource: MatTableDataSource; constructor(private route: ActivatedRoute) { - this.route.parent.data.subscribe((data: { loanDetailsData: any, }) => { + this.route.parent.data.subscribe((data: { loanDetailsData: any }) => { this.loanDetails = data.loanDetailsData; this.currencyCode = this.loanDetails.currency.code; if (this.loanDetails.transactions) { this.loanDetails.transactions.some((transaction: any) => { if (transaction.type.code === 'loanTransactionType.chargeback') { - this.loanSummaryColumns = ['Empty', 'Original', 'Adjustments', 'Paid', 'Waived', 'Written Off', 'Outstanding', 'Over Due']; + this.loanSummaryColumns = [ + 'Empty', + 'Original', + 'Adjustments', + 'Paid', + 'Waived', + 'Written Off', + 'Outstanding', + 'Over Due' + ]; return; } }); @@ -62,123 +81,129 @@ export class GeneralTabComponent implements OnInit { setloanSummaryTableData() { this.loanSummaryTableData = [ { - 'property': 'Principal', - 'original': this.loanDetails.summary.principalDisbursed, - 'adjustment': this.loanDetails.summary.principalAdjustments || 0, - 'paid': this.loanDetails.summary.principalPaid, - 'waived': this.loanDetails.summary.principalWaived || 0, - 'writtenOff': this.loanDetails.summary.principalWrittenOff, - 'outstanding': this.loanDetails.summary.principalOutstanding, - 'overdue': this.loanDetails.summary.principalOverdue, - }, - { - 'property': 'Interest', - 'original': this.loanDetails.summary.interestCharged, - 'adjustment': '0', - 'paid': this.loanDetails.summary.interestPaid, - 'waived': this.loanDetails.summary.interestWaived, - 'writtenOff': this.loanDetails.summary.interestWrittenOff, - 'outstanding': this.loanDetails.summary.interestOutstanding, - 'overdue': this.loanDetails.summary.interestOverdue, - }, - { - 'property': 'Fees', - 'original': this.loanDetails.summary.feeChargesCharged, - 'adjustment': '0', - 'paid': this.loanDetails.summary.feeChargesPaid, - 'waived': this.loanDetails.summary.feeChargesWaived, - 'writtenOff': this.loanDetails.summary.feeChargesWrittenOff, - 'outstanding': this.loanDetails.summary.feeChargesOutstanding, - 'overdue': this.loanDetails.summary.feeChargesOverdue, - }, - { - 'property': 'Penalties', - 'original': this.loanDetails.summary.penaltyChargesCharged, - 'adjustment': '0', - 'paid': this.loanDetails.summary.penaltyChargesPaid, - 'waived': this.loanDetails.summary.penaltyChargesWaived, - 'writtenOff': this.loanDetails.summary.penaltyChargesWrittenOff, - 'outstanding': this.loanDetails.summary.penaltyChargesOutstanding, - 'overdue': this.loanDetails.summary.penaltyChargesOverdue, - }, - { - 'property': 'Total', - 'original': this.loanDetails.summary.totalExpectedRepayment, - 'adjustment': this.loanDetails.summary.principalAdjustments || 0, - 'paid': this.loanDetails.summary.totalRepayment, - 'waived': this.loanDetails.summary.totalWaived, - 'writtenOff': this.loanDetails.summary.totalWrittenOff, - 'outstanding': this.loanDetails.summary.totalOutstanding, - 'overdue': this.loanDetails.summary.totalOverdue, - } + property: 'Principal', + original: this.loanDetails.summary.principalDisbursed, + adjustment: this.loanDetails.summary.principalAdjustments || 0, + paid: this.loanDetails.summary.principalPaid, + waived: this.loanDetails.summary.principalWaived || 0, + writtenOff: this.loanDetails.summary.principalWrittenOff, + outstanding: this.loanDetails.summary.principalOutstanding, + overdue: this.loanDetails.summary.principalOverdue + }, + { + property: 'Interest', + original: this.loanDetails.summary.interestCharged, + adjustment: '0', + paid: this.loanDetails.summary.interestPaid, + waived: this.loanDetails.summary.interestWaived, + writtenOff: this.loanDetails.summary.interestWrittenOff, + outstanding: this.loanDetails.summary.interestOutstanding, + overdue: this.loanDetails.summary.interestOverdue + }, + { + property: 'Fees', + original: this.loanDetails.summary.feeChargesCharged, + adjustment: '0', + paid: this.loanDetails.summary.feeChargesPaid, + waived: this.loanDetails.summary.feeChargesWaived, + writtenOff: this.loanDetails.summary.feeChargesWrittenOff, + outstanding: this.loanDetails.summary.feeChargesOutstanding, + overdue: this.loanDetails.summary.feeChargesOverdue + }, + { + property: 'Penalties', + original: this.loanDetails.summary.penaltyChargesCharged, + adjustment: '0', + paid: this.loanDetails.summary.penaltyChargesPaid, + waived: this.loanDetails.summary.penaltyChargesWaived, + writtenOff: this.loanDetails.summary.penaltyChargesWrittenOff, + outstanding: this.loanDetails.summary.penaltyChargesOutstanding, + overdue: this.loanDetails.summary.penaltyChargesOverdue + }, + { + property: 'Total', + original: this.loanDetails.summary.totalExpectedRepayment, + adjustment: this.loanDetails.summary.principalAdjustments || 0, + paid: this.loanDetails.summary.totalRepayment, + waived: this.loanDetails.summary.totalWaived, + writtenOff: this.loanDetails.summary.totalWrittenOff, + outstanding: this.loanDetails.summary.totalOutstanding, + overdue: this.loanDetails.summary.totalOverdue + } ]; this.dataSource = new MatTableDataSource(this.loanSummaryTableData); } setloanDetailsTableData() { - this.loanDetailsTableData = [ { - 'key': 'Disbursement Date' + key: 'Disbursement Date' }, { - 'key': 'Loan Purpose' + key: 'Loan Purpose' }, { - 'key': 'Loan Officer' + key: 'Loan Officer' }, { - 'key': 'Currency' + key: 'Currency' }, { - 'key': 'External Id' + key: 'External Id' }, { - 'key': 'Proposed Amount', - 'value': this.loanDetails.proposedPrincipal, + key: 'Proposed Amount', + value: this.loanDetails.proposedPrincipal }, { - 'key': 'Approved Amount', - 'value': this.loanDetails.approvedPrincipal, + key: 'Approved Amount', + value: this.loanDetails.approvedPrincipal }, { - 'key': 'Disburse Amount', - 'value': this.loanDetails.principal, - }, + key: 'Disburse Amount', + value: this.loanDetails.principal + } ]; this.detailsDataSource = new MatTableDataSource(this.loanDetailsTableData); - } setloanNonDetailsTableData() { this.loanDetailsTableData = [ { - 'key': 'Disbursement Date' + key: 'Disbursement Date' }, { - 'key': 'Currency' + key: 'Currency' }, { - 'key': 'Loan Officer' + key: 'Loan Officer' }, { - 'key': 'External Id' + key: 'External Id' } ]; this.detailsDataSource = new MatTableDataSource(this.loanDetailsTableData); } showApprovedAmountBasedOnStatus() { - if (this.status === 'Submitted and pending approval' || this.status === 'Withdrawn by applicant' || this.status === 'Rejected') { - return false; + if ( + this.status === 'Submitted and pending approval' || + this.status === 'Withdrawn by applicant' || + this.status === 'Rejected' + ) { + return false; } return true; } - showDisbursedAmountBasedOnStatus = function() { - if (this.status === 'Submitted and pending approval' || this.status === 'Withdrawn by applicant' || this.status === 'Rejected' || - this.status === 'Approved') { - return false; + showDisbursedAmountBasedOnStatus = function () { + if ( + this.status === 'Submitted and pending approval' || + this.status === 'Withdrawn by applicant' || + this.status === 'Rejected' || + this.status === 'Approved' + ) { + return false; } return true; }; diff --git a/src/app/loans/loans-view/loan-account-actions/add-collateral/add-collateral.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/add-collateral/add-collateral.component.spec.ts index f3977f07b..4a66f24ea 100644 --- a/src/app/loans/loans-view/loan-account-actions/add-collateral/add-collateral.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/add-collateral/add-collateral.component.spec.ts @@ -8,9 +8,8 @@ describe('AddCollateralComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AddCollateralComponent ] - }) - .compileComponents(); + declarations: [AddCollateralComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/add-collateral/add-collateral.component.ts b/src/app/loans/loans-view/loan-account-actions/add-collateral/add-collateral.component.ts index 570bf2869..95457b619 100644 --- a/src/app/loans/loans-view/loan-account-actions/add-collateral/add-collateral.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/add-collateral/add-collateral.component.ts @@ -15,7 +15,6 @@ import { LoansService } from 'app/loans/loans.service'; styleUrls: ['./add-collateral.component.scss'] }) export class AddCollateralComponent implements OnInit { - @Input() dataObject: any; /** Collateral form. */ @@ -30,10 +29,12 @@ export class AddCollateralComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {LoansService} LoansService loans service. */ - constructor(private formBuilder: UntypedFormBuilder, - private router: Router, - private route: ActivatedRoute, - private loanService: LoansService ) { } + constructor( + private formBuilder: UntypedFormBuilder, + private router: Router, + private route: ActivatedRoute, + private loanService: LoansService + ) {} ngOnInit() { this.createAddCollateralForm(); @@ -44,9 +45,15 @@ export class AddCollateralComponent implements OnInit { */ createAddCollateralForm() { this.collateralForm = this.formBuilder.group({ - 'collateralTypeId': ['', Validators.required], - 'value': ['', Validators.required], - 'description': [''] + collateralTypeId: [ + '', + Validators.required + ], + value: [ + '', + Validators.required + ], + description: [''] }); } @@ -56,7 +63,7 @@ export class AddCollateralComponent implements OnInit { submit() { const collateralTypeId = this.collateralForm.value.collateralTypeId; this.collateralForm.patchValue({ - 'collateralTypeId': collateralTypeId + collateralTypeId: collateralTypeId }); const loanId = this.route.snapshot.params['loanId']; const collateralForm = this.collateralForm.value; @@ -65,5 +72,4 @@ export class AddCollateralComponent implements OnInit { this.router.navigate(['../../loan-collateral'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.html b/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.html index 5fcbc771e..1bec0af77 100644 --- a/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.html +++ b/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.html @@ -1,47 +1,60 @@
- -
- {{'Maturity Date' | translateKey:'inputs'}} : {{ maturityDate | dateFormat}} + +
+ {{ 'Maturity Date' | translateKey: 'inputs' }} : {{ maturityDate | dateFormat }} +
+
+ +
+ + {{ 'labels.inputs.Start Date' | translate }} + + + + + {{ 'labels.inputs.Start Date' | translate }}{{ 'labels.commons.required' | translate }} + + + + + {{ 'labels.inputs.End Date' | translate }} + + + + + {{ 'labels.inputs.End Date' | translate }}{{ 'labels.commons.required' | translate }} + +
- - -
- - {{ 'labels.inputs.Start Date' | translate }} - - - - - {{ 'labels.inputs.Start Date' | translate - }}{{ 'labels.commons.required' | translate }} - - - - - {{ 'labels.inputs.End Date' | translate }} - - - - - {{ 'labels.inputs.End Date' | translate - }}{{ 'labels.commons.required' | translate }} - - -
- - - - - -
- -
-
\ No newline at end of file + + + + + + +
+
diff --git a/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.scss b/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.scss index d9fcadfce..f6b89f7e9 100644 --- a/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.scss +++ b/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.scss @@ -1,8 +1,7 @@ .expandcollapsebutton { - margin-top: -7px; - } - - .container { - max-width: 37rem; - } - \ No newline at end of file + margin-top: -7px; +} + +.container { + max-width: 37rem; +} diff --git a/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.spec.ts index 7f11ccc01..8eb81ee9f 100644 --- a/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.spec.ts @@ -8,9 +8,8 @@ describe('AddInterestPauseComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ AddInterestPauseComponent ] - }) - .compileComponents(); + declarations: [AddInterestPauseComponent] + }).compileComponents(); fixture = TestBed.createComponent(AddInterestPauseComponent); component = fixture.componentInstance; diff --git a/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.ts b/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.ts index dc92290cc..4cd1035b3 100644 --- a/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/add-interest-pause/add-interest-pause.component.ts @@ -11,7 +11,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./add-interest-pause.component.scss'] }) export class AddInterestPauseComponent implements OnInit { - @Input() dataObject: any; /** Loan Id */ loanId: string; @@ -35,13 +34,14 @@ export class AddInterestPauseComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { - + private settingsService: SettingsService + ) { this.loanId = this.route.snapshot.params['loanId']; } @@ -64,8 +64,14 @@ export class AddInterestPauseComponent implements OnInit { */ createInterestPauseLoanForm() { this.interestPauseLoanForm = this.formBuilder.group({ - 'startDate': [this.startDate, Validators.required], - 'endDate': [this.startDate, Validators.required] + startDate: [ + this.startDate, + Validators.required + ], + endDate: [ + this.startDate, + Validators.required + ] }); } @@ -87,10 +93,8 @@ export class AddInterestPauseComponent implements OnInit { dateFormat, locale }; - this.loanService.addInterestPauseToLoan(this.loanId, data ) - .subscribe((response: any) => { - this.router.navigate(['../../term-variations'], { relativeTo: this.route }); - }); + this.loanService.addInterestPauseToLoan(this.loanId, data).subscribe((response: any) => { + this.router.navigate(['../../term-variations'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/add-loan-charge/add-loan-charge.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/add-loan-charge/add-loan-charge.component.spec.ts index 26b206bf2..fa5bdc2fc 100644 --- a/src/app/loans/loans-view/loan-account-actions/add-loan-charge/add-loan-charge.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/add-loan-charge/add-loan-charge.component.spec.ts @@ -8,9 +8,8 @@ describe('AddloanchargeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AddLoanChargeComponent ] - }) - .compileComponents(); + declarations: [AddLoanChargeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/add-loan-charge/add-loan-charge.component.ts b/src/app/loans/loans-view/loan-account-actions/add-loan-charge/add-loan-charge.component.ts index 0244d380c..5c7c05ad3 100644 --- a/src/app/loans/loans-view/loan-account-actions/add-loan-charge/add-loan-charge.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/add-loan-charge/add-loan-charge.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./add-loan-charge.component.scss'] }) export class AddLoanChargeComponent implements OnInit { - /** Minimum Due Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Due Date allowed. */ @@ -51,12 +50,14 @@ export class AddLoanChargeComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private loansService: LoansService, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private loansService: LoansService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { actionButtonData: any }) => { this.loanChargeOptions = data.actionButtonData.chargeOptions; }); @@ -69,8 +70,8 @@ export class AddLoanChargeComponent implements OnInit { ngOnInit() { this.maxDate = this.settingsService.maxFutureDate; this.createLoanChargeForm(); - this.loanChargeForm.controls.chargeId.valueChanges.subscribe(chargeId => { - const chargeDetails = this.loanChargeOptions.find(option => { + this.loanChargeForm.controls.chargeId.valueChanges.subscribe((chargeId) => { + const chargeDetails = this.loanChargeOptions.find((option) => { return option.id === chargeId; }); if (chargeDetails.chargeTimeType.id === 2) { @@ -79,9 +80,9 @@ export class AddLoanChargeComponent implements OnInit { this.loanChargeForm.removeControl('dueDate'); } this.loanChargeForm.patchValue({ - 'amount': chargeDetails.amount, - 'chargeCalculation': chargeDetails.chargeCalculationType.value, - 'chargeTime': chargeDetails.chargeTimeType.value + amount: chargeDetails.amount, + chargeCalculation: chargeDetails.chargeCalculationType.value, + chargeTime: chargeDetails.chargeTimeType.value }); }); } @@ -91,10 +92,16 @@ export class AddLoanChargeComponent implements OnInit { */ createLoanChargeForm() { this.loanChargeForm = this.formBuilder.group({ - 'chargeId': ['', Validators.required], - 'amount': ['', Validators.required], - 'chargeCalculation': [{ value: '', disabled: true }], - 'chargeTime': [{ value: '', disabled: true }] + chargeId: [ + '', + Validators.required + ], + amount: [ + '', + Validators.required + ], + chargeCalculation: [{ value: '', disabled: true }], + chargeTime: [{ value: '', disabled: true }] }); } @@ -111,7 +118,7 @@ export class AddLoanChargeComponent implements OnInit { dateFormat, locale }; - this.loansService.createLoanCharge(this.loanId, 'charges', data).subscribe(res => { + this.loansService.createLoanCharge(this.loanId, 'charges', data).subscribe((res) => { this.router.navigate(['../../general'], { relativeTo: this.route }); }); } diff --git a/src/app/loans/loans-view/loan-account-actions/adjust-loan-charge/adjust-loan-charge.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/adjust-loan-charge/adjust-loan-charge.component.spec.ts index 843fa1008..483390699 100644 --- a/src/app/loans/loans-view/loan-account-actions/adjust-loan-charge/adjust-loan-charge.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/adjust-loan-charge/adjust-loan-charge.component.spec.ts @@ -8,9 +8,8 @@ describe('AdjustLoanChargeComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ AdjustLoanChargeComponent ] - }) - .compileComponents(); + declarations: [AdjustLoanChargeComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/adjust-loan-charge/adjust-loan-charge.component.ts b/src/app/loans/loans-view/loan-account-actions/adjust-loan-charge/adjust-loan-charge.component.ts index 7bb04b3b0..c3ef2204d 100644 --- a/src/app/loans/loans-view/loan-account-actions/adjust-loan-charge/adjust-loan-charge.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/adjust-loan-charge/adjust-loan-charge.component.ts @@ -36,19 +36,21 @@ export class AdjustLoanChargeComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private settingsService: SettingsService, - private organizationService: OrganizationService) { - this.loanId = this.route.snapshot.params['loanId']; - this.chargeId = this.route.snapshot.params['id']; - this.route.data.subscribe((data: { loansAccountCharge: any, loanDetailsData: any }) => { - this.chargeData = data.loansAccountCharge; - this.loanDetailsData = data.loanDetailsData; - }); - } + private organizationService: OrganizationService + ) { + this.loanId = this.route.snapshot.params['loanId']; + this.chargeId = this.route.snapshot.params['id']; + this.route.data.subscribe((data: { loansAccountCharge: any; loanDetailsData: any }) => { + this.chargeData = data.loansAccountCharge; + this.loanDetailsData = data.loanDetailsData; + }); + } /** * Creates the repayment loan form @@ -65,10 +67,13 @@ export class AdjustLoanChargeComponent implements OnInit { */ createAdjustLoanChargeForm() { this.adjustLoanChargeForm = this.formBuilder.group({ - 'amount': [this.chargeData.amount, Validators.required], - 'externalId': '', - 'paymentTypeId': '', - 'note': '' + amount: [ + this.chargeData.amount, + Validators.required + ], + externalId: '', + paymentTypeId: '', + note: '' }); } @@ -107,10 +112,10 @@ export class AdjustLoanChargeComponent implements OnInit { locale }; const command = 'adjustment'; - this.loanService.executeLoansAccountChargesCommand(this.loanId, command, data, this.chargeId) + this.loanService + .executeLoansAccountChargesCommand(this.loanId, command, data, this.chargeId) .subscribe((response: any) => { this.router.navigate(['../..'], { relativeTo: this.route }); - }); + }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/approve-loan/approve-loan.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/approve-loan/approve-loan.component.spec.ts index 2cc6a2c10..95e9625f5 100644 --- a/src/app/loans/loans-view/loan-account-actions/approve-loan/approve-loan.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/approve-loan/approve-loan.component.spec.ts @@ -8,9 +8,8 @@ describe('ApproveLoanComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ApproveLoanComponent ] - }) - .compileComponents(); + declarations: [ApproveLoanComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/approve-loan/approve-loan.component.ts b/src/app/loans/loans-view/loan-account-actions/approve-loan/approve-loan.component.ts index 6c0bd9495..2924340c9 100644 --- a/src/app/loans/loans-view/loan-account-actions/approve-loan/approve-loan.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/approve-loan/approve-loan.component.ts @@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./approve-loan.component.scss'] }) export class ApproveLoanComponent implements OnInit { - /** Approve Loan form. */ approveLoanForm: UntypedFormGroup; /** Loan data. */ @@ -40,12 +39,14 @@ export class ApproveLoanComponent implements OnInit { * @param router Router. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private route: ActivatedRoute, private dateUtils: Dates, private loanService: LoansService, private router: Router, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { actionButtonData: any }) => { this.loanData = data.actionButtonData; this.currency = data.actionButtonData.currency; @@ -58,7 +59,7 @@ export class ApproveLoanComponent implements OnInit { this.loanService.getApproveAssociationsDetails(this.loanId).subscribe((response: any) => { this.associationData = response; this.approveLoanForm.patchValue({ - 'expectedDisbursementDate': new Date(response.timeline.expectedDisbursementDate) + expectedDisbursementDate: new Date(response.timeline.expectedDisbursementDate) }); }); } @@ -68,10 +69,16 @@ export class ApproveLoanComponent implements OnInit { */ setApproveLoanForm() { this.approveLoanForm = this.formBuilder.group({ - 'approvedOnDate': [this.settingsService.businessDate, Validators.required], - 'expectedDisbursementDate': [''], - 'approvedLoanAmount': [this.loanData.approvalAmount, Validators.required], - 'note': [''] + approvedOnDate: [ + this.settingsService.businessDate, + Validators.required + ], + expectedDisbursementDate: [''], + approvedLoanAmount: [ + this.loanData.approvalAmount, + Validators.required + ], + note: [''] }); } @@ -99,5 +106,4 @@ export class ApproveLoanComponent implements OnInit { this.router.navigate(['../../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/asset-transfer-loan/asset-transfer-loan.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/asset-transfer-loan/asset-transfer-loan.component.spec.ts index bdf6fbf6b..676db5e28 100644 --- a/src/app/loans/loans-view/loan-account-actions/asset-transfer-loan/asset-transfer-loan.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/asset-transfer-loan/asset-transfer-loan.component.spec.ts @@ -8,9 +8,8 @@ describe('AssetTransferLoanComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ AssetTransferLoanComponent ] - }) - .compileComponents(); + declarations: [AssetTransferLoanComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/asset-transfer-loan/asset-transfer-loan.component.ts b/src/app/loans/loans-view/loan-account-actions/asset-transfer-loan/asset-transfer-loan.component.ts index f24a07316..5c5ad6772 100644 --- a/src/app/loans/loans-view/loan-account-actions/asset-transfer-loan/asset-transfer-loan.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/asset-transfer-loan/asset-transfer-loan.component.ts @@ -11,7 +11,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./asset-transfer-loan.component.scss'] }) export class AssetTransferLoanComponent implements OnInit { - BUYBACK_COMMAND = 'buyback'; SALE_COMMAND = 'sale'; @@ -25,16 +24,18 @@ export class AssetTransferLoanComponent implements OnInit { /** Sell Loan Form */ saleLoanForm: UntypedFormGroup; - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private externalAssetOwnerService: ExternalAssetOwnerService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { - this.loanId = this.route.snapshot.params['loanId']; - const actionName = this.route.snapshot.params['action']; - this.command = (actionName === 'Sell Loan') ? this.SALE_COMMAND : this.BUYBACK_COMMAND; - } + private settingsService: SettingsService + ) { + this.loanId = this.route.snapshot.params['loanId']; + const actionName = this.route.snapshot.params['action']; + this.command = actionName === 'Sell Loan' ? this.SALE_COMMAND : this.BUYBACK_COMMAND; + } /** * Creates the Sell Loan form @@ -47,7 +48,7 @@ export class AssetTransferLoanComponent implements OnInit { } isBuyBack(): boolean { - return (this.command === this.BUYBACK_COMMAND); + return this.command === this.BUYBACK_COMMAND; } /** @@ -55,10 +56,19 @@ export class AssetTransferLoanComponent implements OnInit { */ createSaleLoanForm() { this.saleLoanForm = this.formBuilder.group({ - 'settlementDate': [this.settingsService.businessDate, Validators.required], - 'purchasePriceRatio': ['', Validators.required], - 'transferExternalId': '', - 'ownerExternalId': ['', Validators.required] + settlementDate: [ + this.settingsService.businessDate, + Validators.required + ], + purchasePriceRatio: [ + '', + Validators.required + ], + transferExternalId: '', + ownerExternalId: [ + '', + Validators.required + ] }); if (this.isBuyBack()) { @@ -80,11 +90,10 @@ export class AssetTransferLoanComponent implements OnInit { dateFormat, locale }; - this.externalAssetOwnerService.executeExternalAssetOwnerLoanCommand(this.loanId, data, this.command) + this.externalAssetOwnerService + .executeExternalAssetOwnerLoanCommand(this.loanId, data, this.command) .subscribe((response: any) => { this.router.navigate(['../../external-asset-owner'], { relativeTo: this.route }); - }); - + }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/assign-loan-officer/assign-loan-officer.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/assign-loan-officer/assign-loan-officer.component.spec.ts index bbad4d723..5bdf5906e 100644 --- a/src/app/loans/loans-view/loan-account-actions/assign-loan-officer/assign-loan-officer.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/assign-loan-officer/assign-loan-officer.component.spec.ts @@ -8,9 +8,8 @@ describe('AssignLoanOfficerComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AssignLoanOfficerComponent ] - }) - .compileComponents(); + declarations: [AssignLoanOfficerComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/assign-loan-officer/assign-loan-officer.component.ts b/src/app/loans/loans-view/loan-account-actions/assign-loan-officer/assign-loan-officer.component.ts index 457d7d896..bf41e3b39 100644 --- a/src/app/loans/loans-view/loan-account-actions/assign-loan-officer/assign-loan-officer.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/assign-loan-officer/assign-loan-officer.component.ts @@ -13,7 +13,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./assign-loan-officer.component.scss'] }) export class AssignLoanOfficerComponent implements OnInit { - @Input() dataObject: any; /** Loan Id */ loanId: string; @@ -32,14 +31,16 @@ export class AssignLoanOfficerComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { - this.loanId = this.route.snapshot.params['loanId']; - } + private settingsService: SettingsService + ) { + this.loanId = this.route.snapshot.params['loanId']; + } /** * Creates the assign officer form. @@ -55,8 +56,14 @@ export class AssignLoanOfficerComponent implements OnInit { */ createassignOfficerForm() { this.assignOfficerForm = this.formBuilder.group({ - 'toLoanOfficerId': ['', Validators.required], - 'assignmentDate': [new Date(), Validators.required] + toLoanOfficerId: [ + '', + Validators.required + ], + assignmentDate: [ + new Date(), + Validators.required + ] }); } @@ -74,10 +81,8 @@ export class AssignLoanOfficerComponent implements OnInit { locale }; data.fromLoanOfficerId = this.dataObject.loanOfficerId || ''; - this.loanService.loanActionButtons(this.loanId, 'assignLoanOfficer', data) - .subscribe((response: any) => { - this.router.navigate([`../../general`], { relativeTo: this.route }); + this.loanService.loanActionButtons(this.loanId, 'assignLoanOfficer', data).subscribe((response: any) => { + this.router.navigate([`../../general`], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/charge-off/charge-off.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/charge-off/charge-off.component.spec.ts index 8302d21ab..f86d915c5 100644 --- a/src/app/loans/loans-view/loan-account-actions/charge-off/charge-off.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/charge-off/charge-off.component.spec.ts @@ -8,9 +8,8 @@ describe('ChargeOffComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ChargeOffComponent ] - }) - .compileComponents(); + declarations: [ChargeOffComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/charge-off/charge-off.component.ts b/src/app/loans/loans-view/loan-account-actions/charge-off/charge-off.component.ts index ea5e5b3e4..f51daf756 100644 --- a/src/app/loans/loans-view/loan-account-actions/charge-off/charge-off.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/charge-off/charge-off.component.ts @@ -35,14 +35,16 @@ export class ChargeOffComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { - this.loanId = this.route.snapshot.params['loanId']; - } + private settingsService: SettingsService + ) { + this.loanId = this.route.snapshot.params['loanId']; + } /** * Creates the repayment loan form @@ -59,10 +61,13 @@ export class ChargeOffComponent implements OnInit { */ createChargeoffLoanForm() { this.chargeoffLoanForm = this.formBuilder.group({ - 'transactionDate': [this.settingsService.businessDate, Validators.required], - 'externalId': '', - 'chargeOffReasonId': '', - 'note': '' + transactionDate: [ + this.settingsService.businessDate, + Validators.required + ], + externalId: '', + chargeOffReasonId: '', + note: '' }); } @@ -80,10 +85,8 @@ export class ChargeOffComponent implements OnInit { locale }; const command = 'charge-off'; - this.loanService.submitLoanActionButton(this.loanId, data, command) - .subscribe((response: any) => { - this.router.navigate(['../../transactions'], { relativeTo: this.route }); + this.loanService.submitLoanActionButton(this.loanId, data, command).subscribe((response: any) => { + this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/close-as-rescheduled/close-as-rescheduled.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/close-as-rescheduled/close-as-rescheduled.component.spec.ts index f2ece1ef1..e982cc101 100644 --- a/src/app/loans/loans-view/loan-account-actions/close-as-rescheduled/close-as-rescheduled.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/close-as-rescheduled/close-as-rescheduled.component.spec.ts @@ -8,9 +8,8 @@ describe('CloseAsRescheduledComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CloseAsRescheduledComponent ] - }) - .compileComponents(); + declarations: [CloseAsRescheduledComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/close-as-rescheduled/close-as-rescheduled.component.ts b/src/app/loans/loans-view/loan-account-actions/close-as-rescheduled/close-as-rescheduled.component.ts index 938e23676..441163245 100644 --- a/src/app/loans/loans-view/loan-account-actions/close-as-rescheduled/close-as-rescheduled.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/close-as-rescheduled/close-as-rescheduled.component.ts @@ -13,7 +13,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./close-as-rescheduled.component.scss'] }) export class CloseAsRescheduledComponent implements OnInit { - @Input() dataObject: any; /** Close form. */ @@ -32,14 +31,16 @@ export class CloseAsRescheduledComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { - this.loanId = this.route.snapshot.params['loanId']; - } + private settingsService: SettingsService + ) { + this.loanId = this.route.snapshot.params['loanId']; + } /** * Creates the close form. @@ -54,8 +55,11 @@ export class CloseAsRescheduledComponent implements OnInit { */ createCloseForm() { this.closeLoanForm = this.formBuilder.group({ - 'transactionDate': [new Date(this.dataObject.date) || new Date(), Validators.required], - 'note': [] + transactionDate: [ + new Date(this.dataObject.date) || new Date(), + Validators.required + ], + note: [] }); } @@ -76,9 +80,8 @@ export class CloseAsRescheduledComponent implements OnInit { dateFormat, locale }; - this.loanService.submitLoanActionButton(this.loanId, data, 'close-rescheduled') - .subscribe((response: any) => { - this.router.navigate(['../../general'], { relativeTo: this.route }); + this.loanService.submitLoanActionButton(this.loanId, data, 'close-rescheduled').subscribe((response: any) => { + this.router.navigate(['../../general'], { relativeTo: this.route }); }); } } diff --git a/src/app/loans/loans-view/loan-account-actions/create-guarantor/create-guarantor.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/create-guarantor/create-guarantor.component.spec.ts index 029382373..29b15a332 100644 --- a/src/app/loans/loans-view/loan-account-actions/create-guarantor/create-guarantor.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/create-guarantor/create-guarantor.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateGuarantorComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateGuarantorComponent ] - }) - .compileComponents(); + declarations: [CreateGuarantorComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/create-guarantor/create-guarantor.component.ts b/src/app/loans/loans-view/loan-account-actions/create-guarantor/create-guarantor.component.ts index bffc27925..e60194f35 100644 --- a/src/app/loans/loans-view/loan-account-actions/create-guarantor/create-guarantor.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/create-guarantor/create-guarantor.component.ts @@ -18,7 +18,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-guarantor.component.scss'] }) export class CreateGuarantorComponent implements OnInit, AfterViewInit { - @Input() dataObject: any; /** New Guarantor Form */ newGuarantorForm: UntypedFormGroup; @@ -44,13 +43,15 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, private clientsService: ClientsService, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.loanId = this.route.snapshot.params['loanId']; } @@ -64,11 +65,14 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit { /** Create Guarantor Details Form */ createNewGuarantorForm() { this.newGuarantorForm = this.formBuilder.group({ - 'existingClient': [''], - 'name': ['', Validators.required], - 'clientRelationshipTypeId': [''], - 'savingsId': [''], - 'amount': [''] + existingClient: [''], + name: [ + '', + Validators.required + ], + clientRelationshipTypeId: [''], + savingsId: [''], + amount: [''] }); } @@ -123,10 +127,9 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit { if (this.newGuarantorForm.value.existingClient) { this.newGuarantorForm.get('name').valueChanges.subscribe((value: string) => { if (value.length >= 2) { - this.clientsService.getFilteredClients('displayName', 'ASC', true, value) - .subscribe((data: any) => { - this.clientsData = data.pageItems; - }); + this.clientsService.getFilteredClients('displayName', 'ASC', true, value).subscribe((data: any) => { + this.clientsData = data.pageItems; + }); } }); } @@ -155,7 +158,9 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit { const dateFormat = this.settingsService.dateFormat; const prevdob: Date = this.newGuarantorForm.value.dob; - const guarantorTypeId: number = this.newGuarantorForm.value.existingClient ? this.dataObject.guarantorTypeOptions[0].id : this.dataObject.guarantorTypeOptions[2].id; + const guarantorTypeId: number = this.newGuarantorForm.value.existingClient + ? this.dataObject.guarantorTypeOptions[0].id + : this.dataObject.guarantorTypeOptions[2].id; const data = { ...newGuarantorFormData, locale, @@ -174,10 +179,8 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit { delete data.existingClient; delete data.name; - this.loanService.createNewGuarantor(this.loanId, data) - .subscribe((response: any) => { - this.router.navigate(['../../general'], { relativeTo: this.route }); - }); + this.loanService.createNewGuarantor(this.loanId, data).subscribe((response: any) => { + this.router.navigate(['../../general'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/disburse-to-savings-account/disburse-to-savings-account.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/disburse-to-savings-account/disburse-to-savings-account.component.spec.ts index 4ac2f1b31..ef8869b95 100644 --- a/src/app/loans/loans-view/loan-account-actions/disburse-to-savings-account/disburse-to-savings-account.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/disburse-to-savings-account/disburse-to-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('DisburseToSavingsAccountComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ DisburseToSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [DisburseToSavingsAccountComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/disburse-to-savings-account/disburse-to-savings-account.component.ts b/src/app/loans/loans-view/loan-account-actions/disburse-to-savings-account/disburse-to-savings-account.component.ts index f03e5c1e1..4c05f0f25 100644 --- a/src/app/loans/loans-view/loan-account-actions/disburse-to-savings-account/disburse-to-savings-account.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/disburse-to-savings-account/disburse-to-savings-account.component.ts @@ -12,7 +12,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./disburse-to-savings-account.component.scss'] }) export class DisburseToSavingsAccountComponent implements OnInit { - @Input() dataObject: any; /** Minimum Date allowed. */ @@ -31,13 +30,14 @@ export class DisburseToSavingsAccountComponent implements OnInit { * @param {LoansService} loanService Loan Service. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, private loanService: LoansService, - private settingsService: SettingsService) { - } + private settingsService: SettingsService + ) {} ngOnInit() { this.maxDate = this.settingsService.businessDate; @@ -52,12 +52,21 @@ export class DisburseToSavingsAccountComponent implements OnInit { */ setDisbursementToSavingsForm() { this.disbursementForm = this.formBuilder.group({ - 'actualDisbursementDate': [new Date(), Validators.required], - 'transactionAmount': [this.dataObject.amount, Validators.required], - 'note': [''] + actualDisbursementDate: [ + new Date(), + Validators.required + ], + transactionAmount: [ + this.dataObject.amount, + Validators.required + ], + note: [''] }); if (this.dataObject.fixedEmiAmount) { - this.disbursementForm.addControl('fixedEmiAmount', new UntypedFormControl(this.dataObject.fixedEmiAmount, [Validators.required])); + this.disbursementForm.addControl( + 'fixedEmiAmount', + new UntypedFormControl(this.dataObject.fixedEmiAmount, [Validators.required]) + ); } } @@ -70,7 +79,10 @@ export class DisburseToSavingsAccountComponent implements OnInit { const dateFormat = this.settingsService.dateFormat; const prevActualDisbursementDate: Date = this.disbursementForm.value.actualDisbursementDate; if (disbursementLoanFormData.actualDisbursementDate instanceof Date) { - disbursementLoanFormData.actualDisbursementDate = this.dateUtils.formatDate(prevActualDisbursementDate, dateFormat); + disbursementLoanFormData.actualDisbursementDate = this.dateUtils.formatDate( + prevActualDisbursementDate, + dateFormat + ); } const data = { ...disbursementLoanFormData, @@ -83,5 +95,4 @@ export class DisburseToSavingsAccountComponent implements OnInit { this.router.navigate(['../../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.spec.ts index 790dbd5ed..0f91e1965 100644 --- a/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.spec.ts @@ -8,9 +8,8 @@ describe('DisburseComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DisburseComponent ] - }) - .compileComponents(); + declarations: [DisburseComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts b/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts index 684114b1d..61b34f757 100644 --- a/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts @@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./disburse.component.scss'] }) export class DisburseComponent implements OnInit { - @Input() dataObject: any; /** Loan Id */ loanId: string; @@ -41,16 +40,17 @@ export class DisburseComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.loanId = this.route.snapshot.params['loanId']; } - /** * Creates the disbursement loan form * and initialize with the required values @@ -69,18 +69,24 @@ export class DisburseComponent implements OnInit { */ createDisbursementLoanForm() { this.disbursementLoanForm = this.formBuilder.group({ - 'actualDisbursementDate': [this.settingsService.businessDate, Validators.required], - 'transactionAmount': ['', Validators.required], - 'externalId': '', - 'paymentTypeId': '', - 'note': '' + actualDisbursementDate: [ + this.settingsService.businessDate, + Validators.required + ], + transactionAmount: [ + '', + Validators.required + ], + externalId: '', + paymentTypeId: '', + note: '' }); } setDisbursementLoanDetails() { this.paymentTypes = this.dataObject.paymentTypeOptions; this.disbursementLoanForm.patchValue({ - transactionAmount: this.dataObject.amount, + transactionAmount: this.dataObject.amount // actualDisbursementDate: new Date(this.dataObject.date) }); } @@ -112,7 +118,10 @@ export class DisburseComponent implements OnInit { const dateFormat = this.settingsService.dateFormat; const prevActualDisbursementDate: Date = this.disbursementLoanForm.value.actualDisbursementDate; if (disbursementLoanFormData.actualDisbursementDate instanceof Date) { - disbursementLoanFormData.actualDisbursementDate = this.dateUtils.formatDate(prevActualDisbursementDate, dateFormat); + disbursementLoanFormData.actualDisbursementDate = this.dateUtils.formatDate( + prevActualDisbursementDate, + dateFormat + ); } const data = { ...disbursementLoanFormData, @@ -120,10 +129,8 @@ export class DisburseComponent implements OnInit { locale }; data['transactionAmount'] = data['transactionAmount'] * 1; - this.loanService.loanActionButtons(this.loanId, 'disburse', data ) - .subscribe((response: any) => { - this.router.navigate(['../../general'], { relativeTo: this.route }); - }); + this.loanService.loanActionButtons(this.loanId, 'disburse', data).subscribe((response: any) => { + this.router.navigate(['../../general'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/edit-repayment-schedule/edit-repayment-schedule.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/edit-repayment-schedule/edit-repayment-schedule.component.spec.ts index 20dba6e7d..17b21cb25 100644 --- a/src/app/loans/loans-view/loan-account-actions/edit-repayment-schedule/edit-repayment-schedule.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/edit-repayment-schedule/edit-repayment-schedule.component.spec.ts @@ -8,9 +8,8 @@ describe('EditRepaymentScheduleComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ EditRepaymentScheduleComponent ] - }) - .compileComponents(); + declarations: [EditRepaymentScheduleComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/edit-repayment-schedule/edit-repayment-schedule.component.ts b/src/app/loans/loans-view/loan-account-actions/edit-repayment-schedule/edit-repayment-schedule.component.ts index 893b4db85..febeab2b4 100644 --- a/src/app/loans/loans-view/loan-account-actions/edit-repayment-schedule/edit-repayment-schedule.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/edit-repayment-schedule/edit-repayment-schedule.component.ts @@ -17,7 +17,6 @@ import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base'; styleUrls: ['./edit-repayment-schedule.component.scss'] }) export class EditRepaymentScheduleComponent implements OnInit { - /** Loan ID. */ loanId: string; /** Indicates If the Schedule has been changed */ @@ -37,13 +36,15 @@ export class EditRepaymentScheduleComponent implements OnInit { * @param {Dates} dateUtils Dates Utils. * @param {SettingsService} settingsService Settings Service */ - constructor(private loansService: LoansService, + constructor( + private loansService: LoansService, private router: Router, private route: ActivatedRoute, private dialog: MatDialog, private dateUtils: Dates, private translateService: TranslateService, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.loanId = this.route.snapshot.params['loanId']; this.getRepaymentSchedule(); } @@ -62,7 +63,10 @@ export class EditRepaymentScheduleComponent implements OnInit { const periods: any = []; this.repaymentScheduleDetails['periods'].forEach((period: any) => { if (period.period) { - periods.push({ idx: period.period, dueDate: this.dateUtils.formatDate(period.dueDate, this.settingsService.dateFormat) }); + periods.push({ + idx: period.period, + dueDate: this.dateUtils.formatDate(period.dueDate, this.settingsService.dateFormat) + }); } }); const formfields: FormfieldBase[] = [ @@ -86,7 +90,8 @@ export class EditRepaymentScheduleComponent implements OnInit { value: '', type: 'number', required: true - }), + }) + ]; const data = { title: 'Pattern Update', @@ -118,34 +123,45 @@ export class EditRepaymentScheduleComponent implements OnInit { reset(): void { const recoverScheduleDialogRef = this.dialog.open(ConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Recover Original Schedule'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want recover the Original Schedule') } + data: { + heading: this.translateService.instant('labels.heading.Recover Original Schedule'), + dialogContext: this.translateService.instant( + 'labels.dialogContext.Are you sure you want recover the Original Schedule' + ) + } }); recoverScheduleDialogRef.afterClosed().subscribe((responseConfirmation: any) => { if (responseConfirmation.confirm) { - this.loansService.applyCommandLoanScheduleVariations(this.loanId, 'deleteVariations', {}).subscribe((response: any) => { - this.getRepaymentSchedule(); - this.wasChanged = false; - this.wasValidated = false; - }); + this.loansService + .applyCommandLoanScheduleVariations(this.loanId, 'deleteVariations', {}) + .subscribe((response: any) => { + this.getRepaymentSchedule(); + this.wasChanged = false; + this.wasValidated = false; + }); } }); } validate(): void { - this.loansService.applyCommandLoanScheduleVariations(this.loanId, 'calculateLoanSchedule', this.getPayload()).subscribe((response: any) => { - this.repaymentScheduleDetails['periods'] = []; - response['periods'].forEach((period: any) => { - period['changed'] = true; - this.repaymentScheduleDetails['periods'].push(period); - this.wasValidated = true; + this.loansService + .applyCommandLoanScheduleVariations(this.loanId, 'calculateLoanSchedule', this.getPayload()) + .subscribe((response: any) => { + this.repaymentScheduleDetails['periods'] = []; + response['periods'].forEach((period: any) => { + period['changed'] = true; + this.repaymentScheduleDetails['periods'].push(period); + this.wasValidated = true; + }); }); - }); } submit(): void { - this.loansService.applyCommandLoanScheduleVariations(this.loanId, 'addVariations', this.getPayload()).subscribe((response: any) => { - this.router.navigate(['../../repayment-schedule'], { relativeTo: this.route }); - }); + this.loansService + .applyCommandLoanScheduleVariations(this.loanId, 'addVariations', this.getPayload()) + .subscribe((response: any) => { + this.router.navigate(['../../repayment-schedule'], { relativeTo: this.route }); + }); } private getPayload(): any { @@ -163,5 +179,4 @@ export class EditRepaymentScheduleComponent implements OnInit { locale }; } - } diff --git a/src/app/loans/loans-view/loan-account-actions/foreclosure/foreclosure.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/foreclosure/foreclosure.component.spec.ts index ccf34a122..f5494c2b4 100644 --- a/src/app/loans/loans-view/loan-account-actions/foreclosure/foreclosure.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/foreclosure/foreclosure.component.spec.ts @@ -8,9 +8,8 @@ describe('ForeclosureComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ForeclosureComponent ] - }) - .compileComponents(); + declarations: [ForeclosureComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/foreclosure/foreclosure.component.ts b/src/app/loans/loans-view/loan-account-actions/foreclosure/foreclosure.component.ts index d4459b53d..e94c5617f 100644 --- a/src/app/loans/loans-view/loan-account-actions/foreclosure/foreclosure.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/foreclosure/foreclosure.component.ts @@ -30,14 +30,16 @@ export class ForeclosureComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { - this.loanId = this.route.snapshot.params['loanId']; - } + private settingsService: SettingsService + ) { + this.loanId = this.route.snapshot.params['loanId']; + } ngOnInit() { this.maxDate = this.settingsService.businessDate; @@ -47,21 +49,26 @@ export class ForeclosureComponent implements OnInit { createforeclosureForm() { this.foreclosureForm = this.formBuilder.group({ - 'transactionDate': [this.dataObject.date && new Date(this.dataObject.date), Validators.required], - 'outstandingPrincipalPortion': [{value: this.dataObject.principalPortion || 0, disabled: true}], - 'outstandingInterestPortion': [{value: this.dataObject.interestPortion || 0, disabled: true}], - 'outstandingFeeChargesPortion': [{value: this.dataObject.feeChargesPortion || 0, disabled: true}], - 'outstandingPenaltyChargesPortion': [{value: this.dataObject.penaltyChargesPortion || 0, disabled: true}], - 'transactionAmount': [{value: this.dataObject.amount, disabled: true}], - 'note': ['', Validators.required] + transactionDate: [ + this.dataObject.date && new Date(this.dataObject.date), + Validators.required + ], + outstandingPrincipalPortion: [{ value: this.dataObject.principalPortion || 0, disabled: true }], + outstandingInterestPortion: [{ value: this.dataObject.interestPortion || 0, disabled: true }], + outstandingFeeChargesPortion: [{ value: this.dataObject.feeChargesPortion || 0, disabled: true }], + outstandingPenaltyChargesPortion: [{ value: this.dataObject.penaltyChargesPortion || 0, disabled: true }], + transactionAmount: [{ value: this.dataObject.amount, disabled: true }], + note: [ + '', + Validators.required + ] }); } onChanges(): void { - this.foreclosureForm.get('transactionDate').valueChanges.subscribe(val => { + this.foreclosureForm.get('transactionDate').valueChanges.subscribe((val) => { this.retrieveLoanForeclosureTemplate(val); }); - } retrieveLoanForeclosureTemplate(val: any) { @@ -73,15 +80,14 @@ export class ForeclosureComponent implements OnInit { locale: this.settingsService.language.code, transactionDate: transactionDateFormatted }; - this.loanService.getForeclosureData(this.loanId, data) - .subscribe((response: any) => { + this.loanService.getForeclosureData(this.loanId, data).subscribe((response: any) => { this.foreclosuredata = response; this.foreclosureForm.patchValue({ outstandingPrincipalPortion: this.foreclosuredata.principalPortion, outstandingInterestPortion: this.foreclosuredata.interestPortion, outstandingFeeChargesPortion: this.foreclosuredata.feeChargesPortion, - outstandingPenaltyChargesPortion: this.foreclosuredata.penaltyChargesPortion, + outstandingPenaltyChargesPortion: this.foreclosuredata.penaltyChargesPortion }); }); } @@ -100,10 +106,8 @@ export class ForeclosureComponent implements OnInit { locale }; - this.loanService.loanForclosureData(this.loanId, data) - .subscribe((response: any) => { - this.router.navigate([`../../general`], { relativeTo: this.route }); - }); - } - + this.loanService.loanForclosureData(this.loanId, data).subscribe((response: any) => { + this.router.navigate([`../../general`], { relativeTo: this.route }); + }); + } } diff --git a/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html b/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html index 2ea093c31..c2e19b9e5 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html +++ b/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html @@ -57,4 +57,7 @@ - + diff --git a/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.spec.ts index 1a03202a0..b15e2a6eb 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanAccountActionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanAccountActionsComponent ] - }) - .compileComponents(); + declarations: [LoanAccountActionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts index 65c4e0ae8..9e9d98c57 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts @@ -11,84 +11,83 @@ import { ActivatedRoute, Router } from '@angular/router'; styleUrls: ['./loan-account-actions.component.scss'] }) export class LoanAccountActionsComponent { - /** Loan Details Data */ navigationData: any; /** flag object to store possible actions and render appropriate UI to the user */ actions: { - 'Close': boolean, - 'Undo Approval': boolean, - 'Write Off': boolean, - 'Add Collateral': boolean, - 'Assign Loan Officer': boolean, - 'Foreclosure': boolean, - 'Prepay Loan': boolean, - 'Reject': boolean, - 'Disburse to Savings': boolean, - 'Make Repayment': boolean, - 'Waive Interest': boolean, - 'Close (as Rescheduled)': boolean, - 'Reschedule': boolean, - 'Recovery Payment': boolean, - 'View Guarantors': boolean, - 'Create Guarantor': boolean, - 'Disburse': boolean, - 'Withdrawn by Client': boolean, - 'Undo Disbursal': boolean, - 'Undo Last Disbursal': boolean, - 'Loan Screen Reports': boolean, - 'Approve': boolean, - 'Add Loan Charge': boolean, - 'Goodwill Credit': boolean, - 'Merchant Issued Refund': boolean, - 'Payout Refund': boolean, - 'Credit Balance Refund': boolean, - 'Edit Repayment Schedule': boolean, - 'Charge-Off': boolean, - 'Sell Loan': boolean, - 'Buy Back Loan': boolean, - 'Re-Age': boolean, - 'Re-Amortize': boolean, - 'Interest Payment Waiver': boolean, - 'Add Interest Pause': boolean + Close: boolean; + 'Undo Approval': boolean; + 'Write Off': boolean; + 'Add Collateral': boolean; + 'Assign Loan Officer': boolean; + Foreclosure: boolean; + 'Prepay Loan': boolean; + Reject: boolean; + 'Disburse to Savings': boolean; + 'Make Repayment': boolean; + 'Waive Interest': boolean; + 'Close (as Rescheduled)': boolean; + Reschedule: boolean; + 'Recovery Payment': boolean; + 'View Guarantors': boolean; + 'Create Guarantor': boolean; + Disburse: boolean; + 'Withdrawn by Client': boolean; + 'Undo Disbursal': boolean; + 'Undo Last Disbursal': boolean; + 'Loan Screen Reports': boolean; + Approve: boolean; + 'Add Loan Charge': boolean; + 'Goodwill Credit': boolean; + 'Merchant Issued Refund': boolean; + 'Payout Refund': boolean; + 'Credit Balance Refund': boolean; + 'Edit Repayment Schedule': boolean; + 'Charge-Off': boolean; + 'Sell Loan': boolean; + 'Buy Back Loan': boolean; + 'Re-Age': boolean; + 'Re-Amortize': boolean; + 'Interest Payment Waiver': boolean; + 'Add Interest Pause': boolean; } = { - 'Close': false, - 'Undo Approval': false, - 'Write Off': false, - 'Add Collateral': false, - 'Assign Loan Officer': false, - 'Foreclosure': false, - 'Prepay Loan': false, - 'Reject': false, - 'Disburse to Savings': false, - 'Make Repayment': false, - 'Waive Interest': false, - 'Close (as Rescheduled)': false, - 'Reschedule': false, - 'Recovery Payment': false, - 'View Guarantors': false, - 'Create Guarantor': false, - 'Disburse': false, - 'Withdrawn by Client': false, - 'Undo Disbursal': false, - 'Undo Last Disbursal': false, - 'Loan Screen Reports': false, - 'Approve': false, - 'Add Loan Charge': false, - 'Goodwill Credit': false, - 'Merchant Issued Refund': false, - 'Payout Refund': false, - 'Credit Balance Refund': false, - 'Edit Repayment Schedule': false, - 'Charge-Off': false, - 'Sell Loan': false, - 'Buy Back Loan': false, - 'Re-Age': false, - 'Re-Amortize': false, - 'Interest Payment Waiver': false, - 'Add Interest Pause': false - }; + Close: false, + 'Undo Approval': false, + 'Write Off': false, + 'Add Collateral': false, + 'Assign Loan Officer': false, + Foreclosure: false, + 'Prepay Loan': false, + Reject: false, + 'Disburse to Savings': false, + 'Make Repayment': false, + 'Waive Interest': false, + 'Close (as Rescheduled)': false, + Reschedule: false, + 'Recovery Payment': false, + 'View Guarantors': false, + 'Create Guarantor': false, + Disburse: false, + 'Withdrawn by Client': false, + 'Undo Disbursal': false, + 'Undo Last Disbursal': false, + 'Loan Screen Reports': false, + Approve: false, + 'Add Loan Charge': false, + 'Goodwill Credit': false, + 'Merchant Issued Refund': false, + 'Payout Refund': false, + 'Credit Balance Refund': false, + 'Edit Repayment Schedule': false, + 'Charge-Off': false, + 'Sell Loan': false, + 'Buy Back Loan': false, + 'Re-Age': false, + 'Re-Amortize': false, + 'Interest Payment Waiver': false, + 'Add Interest Pause': false + }; actionButtonData: any; actionName: any; @@ -96,7 +95,8 @@ export class LoanAccountActionsComponent { /** * @param route Activated Route. */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router ) { this.navigationData = this.router.getCurrentNavigation().extras.state.data; @@ -104,7 +104,7 @@ export class LoanAccountActionsComponent { this.actionButtonData = data.actionButtonData; }); - this.route.params.subscribe(params => { + this.route.params.subscribe((params) => { this.actionName = params['action']; if (this.actionName === 'Change Loan Officer') { this.actionName = 'Assign Loan Officer'; @@ -115,5 +115,4 @@ export class LoanAccountActionsComponent { this.actions[this.actionName] = true; }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/loan-credit-balance-refund/loan-credit-balance-refund.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/loan-credit-balance-refund/loan-credit-balance-refund.component.spec.ts index 44594f072..73563434d 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-credit-balance-refund/loan-credit-balance-refund.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-credit-balance-refund/loan-credit-balance-refund.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanCreditBalanceRefundComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ LoanCreditBalanceRefundComponent ] - }) - .compileComponents(); + declarations: [LoanCreditBalanceRefundComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/loan-credit-balance-refund/loan-credit-balance-refund.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-credit-balance-refund/loan-credit-balance-refund.component.ts index f2ed11195..cb4deb7ab 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-credit-balance-refund/loan-credit-balance-refund.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-credit-balance-refund/loan-credit-balance-refund.component.ts @@ -12,7 +12,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./loan-credit-balance-refund.component.scss'] }) export class LoanCreditBalanceRefundComponent implements OnInit { - @Input() dataObject: any; /** Loan Id */ loanId: string; @@ -31,14 +30,16 @@ export class LoanCreditBalanceRefundComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { - this.loanId = this.route.snapshot.params['loanId']; - } + private settingsService: SettingsService + ) { + this.loanId = this.route.snapshot.params['loanId']; + } /** * Creates the Credit Balance loan form @@ -58,10 +59,16 @@ export class LoanCreditBalanceRefundComponent implements OnInit { */ createCreditBalanceLoanForm() { this.creditBalanceLoanForm = this.formBuilder.group({ - 'transactionDate': [new Date(), Validators.required], - 'transactionAmount': ['', Validators.required], - 'externalId': '', - 'note': '' + transactionDate: [ + new Date(), + Validators.required + ], + transactionAmount: [ + '', + Validators.required + ], + externalId: '', + note: '' }); } @@ -87,10 +94,8 @@ export class LoanCreditBalanceRefundComponent implements OnInit { }; const command = this.dataObject.type.code.split('.')[1]; data['transactionAmount'] = data['transactionAmount'] * 1; - this.loanService.submitLoanActionButton(this.loanId, data, command) - .subscribe((response: any) => { - this.router.navigate(['../../transactions'], { relativeTo: this.route }); + this.loanService.submitLoanActionButton(this.loanId, data, command).subscribe((response: any) => { + this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.spec.ts index 022dd2cf7..a382d78eb 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanReagingComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ LoanReagingComponent ] - }) - .compileComponents(); + declarations: [LoanReagingComponent] + }).compileComponents(); fixture = TestBed.createComponent(LoanReagingComponent); component = fixture.componentInstance; diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.ts index f45ce07de..d24870a87 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-reaging/loan-reaging.component.ts @@ -26,13 +26,15 @@ export class LoanReagingComponent implements OnInit { /** Maximum Date allowed. */ maxDate = new Date(); - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private route: ActivatedRoute, private router: Router, private settingsService: SettingsService, private dropdownOptions: DropdownOptions, private loanService: LoansService, - private dateUtils: Dates) { + private dateUtils: Dates + ) { this.loanId = this.route.snapshot.params['loanId']; this.frequencyOptions = this.dropdownOptions.retrievePeriodFrequencyTypeOptions(false); } @@ -44,12 +46,24 @@ export class LoanReagingComponent implements OnInit { createReagingLoanForm() { this.reagingLoanForm = this.formBuilder.group({ - 'numberOfInstallments': [1, Validators.required], - 'startDate': [this.settingsService.businessDate, Validators.required], - 'frequencyNumber': [1, Validators.required], - 'frequencyType': [, Validators.required], - 'note': '', - 'externalId': '' + numberOfInstallments: [ + 1, + Validators.required + ], + startDate: [ + this.settingsService.businessDate, + Validators.required + ], + frequencyNumber: [ + 1, + Validators.required + ], + frequencyType: [ + , + Validators.required + ], + note: '', + externalId: '' }); } @@ -66,10 +80,8 @@ export class LoanReagingComponent implements OnInit { dateFormat, locale }; - this.loanService.submitLoanActionButton(this.loanId, data, 'reAge') - .subscribe((response: any) => { - this.router.navigate(['../../transactions'], { relativeTo: this.route }); + this.loanService.submitLoanActionButton(this.loanId, data, 'reAge').subscribe((response: any) => { + this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.spec.ts index a30e38ca9..0afbaa159 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanReamortizeComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ LoanReamortizeComponent ] - }) - .compileComponents(); + declarations: [LoanReamortizeComponent] + }).compileComponents(); fixture = TestBed.createComponent(LoanReamortizeComponent); component = fixture.componentInstance; diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.ts index 54de24bc2..3c12370c8 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component.ts @@ -15,11 +15,13 @@ export class LoanReamortizeComponent implements OnInit { /** ReAmortize Loan Form */ reamortizeLoanForm: UntypedFormGroup; - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private route: ActivatedRoute, private router: Router, - private loanService: LoansService) { - this.loanId = this.route.snapshot.params['loanId']; + private loanService: LoansService + ) { + this.loanId = this.route.snapshot.params['loanId']; } ngOnInit(): void { @@ -28,19 +30,15 @@ export class LoanReamortizeComponent implements OnInit { createReAmortizeLoanForm() { this.reamortizeLoanForm = this.formBuilder.group({ - 'note': '', - 'externalId': '' + note: '', + externalId: '' }); } submit(): void { const data = this.reamortizeLoanForm.value; - this.loanService.submitLoanActionButton(this.loanId, data, 'reAmortize') - .subscribe((response: any) => { - this.router.navigate(['../../transactions'], { relativeTo: this.route }); + this.loanService.submitLoanActionButton(this.loanId, data, 'reAmortize').subscribe((response: any) => { + this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - - - } diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reschedule/loan-reschedule.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/loan-reschedule/loan-reschedule.component.spec.ts index 61a533603..91d72e9b1 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reschedule/loan-reschedule.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-reschedule/loan-reschedule.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanRescheduleComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanRescheduleComponent ] - }) - .compileComponents(); + declarations: [LoanRescheduleComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reschedule/loan-reschedule.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-reschedule/loan-reschedule.component.ts index ad191905c..56f17d5ba 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-reschedule/loan-reschedule.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-reschedule/loan-reschedule.component.ts @@ -13,7 +13,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./loan-reschedule.component.scss'] }) export class LoanRescheduleComponent implements OnInit { - @Input() dataObject: any; loanId: any; rescheduleLoanForm: UntypedFormGroup; @@ -36,14 +35,16 @@ export class LoanRescheduleComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { - this.loanId = this.route.snapshot.params['loanId']; - } + private settingsService: SettingsService + ) { + this.loanId = this.route.snapshot.params['loanId']; + } ngOnInit() { this.maxDate = this.settingsService.businessDate; @@ -53,17 +54,25 @@ export class LoanRescheduleComponent implements OnInit { setRescheduleLoanForm() { this.rescheduleLoanForm = this.formBuilder.group({ - 'rescheduleFromDate': [new Date(), Validators.required], - 'rescheduleReasonId': ['', Validators.required], - 'submittedOnDate': [new Date(), Validators.required], - 'rescheduleReasonComment': [''], - 'adjustedDueDate': [''], - 'graceOnPrincipal': [''], - 'graceOnInterest': [''], - 'extraTerms': [''], - 'newInterestRate': [''] + rescheduleFromDate: [ + new Date(), + Validators.required + ], + rescheduleReasonId: [ + '', + Validators.required + ], + submittedOnDate: [ + new Date(), + Validators.required + ], + rescheduleReasonComment: [''], + adjustedDueDate: [''], + graceOnPrincipal: [''], + graceOnInterest: [''], + extraTerms: [''], + newInterestRate: [''] }); - } submit() { @@ -89,12 +98,10 @@ export class LoanRescheduleComponent implements OnInit { }; data.loanId = this.loanId; this.loanService.submitRescheduleData(data).subscribe((response: any) => { - // TODO: needs to be updated // mentioned in Community App: // location.path('/loans-accounts/' + scope.loanId + '/viewreschedulerequest/'+ data.resourceId); - this.router.navigate(['../../general'], { relativeTo: this.route }); + this.router.navigate(['../../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/loan-screen-reports/loan-screen-reports.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/loan-screen-reports/loan-screen-reports.component.spec.ts index ef9a6baf0..bea98fb5c 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-screen-reports/loan-screen-reports.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-screen-reports/loan-screen-reports.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanScreenReportsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanScreenReportsComponent ] - }) - .compileComponents(); + declarations: [LoanScreenReportsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/loan-screen-reports/loan-screen-reports.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-screen-reports/loan-screen-reports.component.ts index f58df2fd2..aabe5a512 100644 --- a/src/app/loans/loans-view/loan-account-actions/loan-screen-reports/loan-screen-reports.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/loan-screen-reports/loan-screen-reports.component.ts @@ -16,7 +16,6 @@ import { DomSanitizer } from '@angular/platform-browser'; styleUrls: ['./loan-screen-reports.component.scss'] }) export class LoanScreenReportsComponent implements OnInit { - @Input() dataObject: any; /** Loan Screen Reportform. */ loanScreenReportForm: UntypedFormGroup; @@ -38,11 +37,13 @@ export class LoanScreenReportsComponent implements OnInit { * @param {DomSanitizer} sanitizer DOM Sanitizer * @param {Renderer2} renderer Renderer 2 */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loansService: LoansService, private route: ActivatedRoute, private sanitizer: DomSanitizer, - private renderer: Renderer2) { + private renderer: Renderer2 + ) { this.loanId = this.route.snapshot.params['loanId']; } @@ -59,7 +60,7 @@ export class LoanScreenReportsComponent implements OnInit { */ createLoanScreenReportForm() { this.loanScreenReportForm = this.formBuilder.group({ - 'templateId': [''] + templateId: [''] }); } @@ -86,5 +87,4 @@ export class LoanScreenReportsComponent implements OnInit { this.renderer.setProperty(this.screenReportRef.nativeElement, 'innerHTML', this.template); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/loans-account-close/loans-account-close.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/loans-account-close/loans-account-close.component.spec.ts index dca7459dc..e3fa2d0a9 100644 --- a/src/app/loans/loans-view/loan-account-actions/loans-account-close/loans-account-close.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/loans-account-close/loans-account-close.component.spec.ts @@ -8,9 +8,8 @@ describe('LoansAccountCloseComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoansAccountCloseComponent ] - }) - .compileComponents(); + declarations: [LoansAccountCloseComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/loans-account-close/loans-account-close.component.ts b/src/app/loans/loans-view/loan-account-actions/loans-account-close/loans-account-close.component.ts index fab44ceec..fe6b2abd4 100644 --- a/src/app/loans/loans-view/loan-account-actions/loans-account-close/loans-account-close.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/loans-account-close/loans-account-close.component.ts @@ -14,7 +14,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./loans-account-close.component.scss'] }) export class LoansAccountCloseComponent implements OnInit { - @Input() dataObject: any; /** Close form. */ @@ -33,14 +32,16 @@ export class LoansAccountCloseComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { - this.loanId = this.route.snapshot.params['loanId']; - } + private settingsService: SettingsService + ) { + this.loanId = this.route.snapshot.params['loanId']; + } /** * Creates the close form. @@ -55,8 +56,11 @@ export class LoansAccountCloseComponent implements OnInit { */ createCloseForm() { this.closeLoanForm = this.formBuilder.group({ - 'transactionDate': [new Date(this.dataObject.date) || new Date(), Validators.required], - 'note': [] + transactionDate: [ + new Date(this.dataObject.date) || new Date(), + Validators.required + ], + note: [] }); } @@ -77,10 +81,8 @@ export class LoansAccountCloseComponent implements OnInit { dateFormat, locale }; - this.loanService.submitLoanActionButton(this.loanId, data, 'close') - .subscribe((response: any) => { - this.router.navigate(['../../general'], { relativeTo: this.route }); + this.loanService.submitLoanActionButton(this.loanId, data, 'close').subscribe((response: any) => { + this.router.navigate(['../../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.spec.ts index cf871ec74..88f69f58b 100644 --- a/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.spec.ts @@ -8,9 +8,8 @@ describe('MakeRepaymentComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ MakeRepaymentComponent ] - }) - .compileComponents(); + declarations: [MakeRepaymentComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts b/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts index 91e4e6daf..48876247d 100644 --- a/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts @@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./make-repayment.component.scss'] }) export class MakeRepaymentComponent implements OnInit { - @Input() dataObject: any; /** Loan Id */ loanId: string; @@ -41,14 +40,16 @@ export class MakeRepaymentComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { - this.loanId = this.route.snapshot.params['loanId']; - } + private settingsService: SettingsService + ) { + this.loanId = this.route.snapshot.params['loanId']; + } /** * Creates the repayment loan form @@ -68,11 +69,17 @@ export class MakeRepaymentComponent implements OnInit { */ createRepaymentLoanForm() { this.repaymentLoanForm = this.formBuilder.group({ - 'transactionDate': [this.settingsService.businessDate, Validators.required], - 'transactionAmount': ['', Validators.required], - 'externalId': '', - 'paymentTypeId': '', - 'note': '' + transactionDate: [ + this.settingsService.businessDate, + Validators.required + ], + transactionAmount: [ + '', + Validators.required + ], + externalId: '', + paymentTypeId: '', + note: '' }); } @@ -119,10 +126,8 @@ export class MakeRepaymentComponent implements OnInit { }; const command = this.dataObject.type.code.split('.')[1]; data['transactionAmount'] = data['transactionAmount'] * 1; - this.loanService.submitLoanActionButton(this.loanId, data, command) - .subscribe((response: any) => { - this.router.navigate(['../../transactions'], { relativeTo: this.route }); + this.loanService.submitLoanActionButton(this.loanId, data, command).subscribe((response: any) => { + this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.spec.ts index 52d286722..5d7502f09 100644 --- a/src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.spec.ts @@ -8,9 +8,8 @@ describe('PrepayLoanComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PrepayLoanComponent ] - }) - .compileComponents(); + declarations: [PrepayLoanComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.ts b/src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.ts index d6094f431..db3b5278f 100644 --- a/src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.ts @@ -9,7 +9,6 @@ import { SettingsService } from 'app/settings/settings.service'; import { Dates } from 'app/core/utils/dates'; import { Currency } from 'app/shared/models/general.model'; - /** * Loan Prepay Loan Option */ @@ -19,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./prepay-loan.component.scss'] }) export class PrepayLoanComponent implements OnInit { - @Input() dataObject: any; /** Loan Id */ loanId: string; @@ -48,14 +46,16 @@ export class PrepayLoanComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { - this.loanId = this.route.snapshot.params['loanId']; - } + private settingsService: SettingsService + ) { + this.loanId = this.route.snapshot.params['loanId']; + } /** * Creates the prepay loan form @@ -76,11 +76,17 @@ export class PrepayLoanComponent implements OnInit { */ createprepayLoanForm() { this.prepayLoanForm = this.formBuilder.group({ - 'transactionDate': [new Date(), Validators.required], - 'transactionAmount': ['', Validators.required], - 'externalId': [''], - 'paymentTypeId': [''], - 'note': [''] + transactionDate: [ + new Date(), + Validators.required + ], + transactionAmount: [ + '', + Validators.required + ], + externalId: [''], + paymentTypeId: [''], + note: [''] }); } @@ -95,8 +101,7 @@ export class PrepayLoanComponent implements OnInit { this.prepayLoanForm.get('transactionDate').valueChanges.subscribe((transactionDate: string) => { const prepayDate = this.dateUtils.formatDate(transactionDate, this.settingsService.dateFormat); - this.loanService.getLoanPrepayLoanActionTemplate(this.loanId, prepayDate) - .subscribe((response: any) => { + this.loanService.getLoanPrepayLoanActionTemplate(this.loanId, prepayDate).subscribe((response: any) => { this.prepayData = response; this.prepayLoanForm.patchValue({ transactionAmount: this.prepayData.amount @@ -142,10 +147,8 @@ export class PrepayLoanComponent implements OnInit { locale }; data['transactionAmount'] = data['transactionAmount'] * 1; - this.loanService.submitLoanActionButton(this.loanId, data, 'repayment') - .subscribe((response: any) => { - this.router.navigate(['../../general'], { relativeTo: this.route }); + this.loanService.submitLoanActionButton(this.loanId, data, 'repayment').subscribe((response: any) => { + this.router.navigate(['../../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/recovery-repayment/recovery-repayment.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/recovery-repayment/recovery-repayment.component.spec.ts index 1bc6af53d..250fa6893 100644 --- a/src/app/loans/loans-view/loan-account-actions/recovery-repayment/recovery-repayment.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/recovery-repayment/recovery-repayment.component.spec.ts @@ -8,9 +8,8 @@ describe('RecoveryRepaymentComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecoveryRepaymentComponent ] - }) - .compileComponents(); + declarations: [RecoveryRepaymentComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/recovery-repayment/recovery-repayment.component.ts b/src/app/loans/loans-view/loan-account-actions/recovery-repayment/recovery-repayment.component.ts index 3224bf091..b99736fa0 100644 --- a/src/app/loans/loans-view/loan-account-actions/recovery-repayment/recovery-repayment.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/recovery-repayment/recovery-repayment.component.ts @@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./recovery-repayment.component.scss'] }) export class RecoveryRepaymentComponent implements OnInit { - @Input() dataObject: any; /** Loan Id */ loanId: string; @@ -41,12 +40,14 @@ export class RecoveryRepaymentComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.loanId = this.route.snapshot.params['loanId']; } @@ -68,11 +69,17 @@ export class RecoveryRepaymentComponent implements OnInit { */ createRecoveryRepaymentLoanForm() { this.recoveryRepaymentLoanForm = this.formBuilder.group({ - 'transactionDate': [new Date(), Validators.required], - 'transactionAmount': ['', Validators.required], - 'externalId': [''], - 'paymentTypeId': [''], - 'note': [''] + transactionDate: [ + new Date(), + Validators.required + ], + transactionAmount: [ + '', + Validators.required + ], + externalId: [''], + paymentTypeId: [''], + note: [''] }); } @@ -120,10 +127,8 @@ export class RecoveryRepaymentComponent implements OnInit { locale }; data['transactionAmount'] = data['transactionAmount'] * 1; - this.loanService.submitLoanActionButton(this.loanId, data, 'recoverypayment') - .subscribe((response: any) => { - this.router.navigate(['../../general'], { relativeTo: this.route }); - }); + this.loanService.submitLoanActionButton(this.loanId, data, 'recoverypayment').subscribe((response: any) => { + this.router.navigate(['../../general'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/reject-loan/reject-loan.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/reject-loan/reject-loan.component.spec.ts index 970724df1..ab494f279 100644 --- a/src/app/loans/loans-view/loan-account-actions/reject-loan/reject-loan.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/reject-loan/reject-loan.component.spec.ts @@ -8,9 +8,8 @@ describe('RejectLoanComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RejectLoanComponent ] - }) - .compileComponents(); + declarations: [RejectLoanComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/reject-loan/reject-loan.component.ts b/src/app/loans/loans-view/loan-account-actions/reject-loan/reject-loan.component.ts index 3091c2c97..29fc1fda3 100644 --- a/src/app/loans/loans-view/loan-account-actions/reject-loan/reject-loan.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/reject-loan/reject-loan.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./reject-loan.component.scss'] }) export class RejectLoanComponent implements OnInit { - /** Loan Id. */ loanId: any; /** Reject Loan form. */ @@ -34,12 +33,14 @@ export class RejectLoanComponent implements OnInit { * @param route Activated Route. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private router: Router, - private route: ActivatedRoute, - private loanService: LoansService, - private dateUtils: Dates, - private settingsService: SettingsService ) { + constructor( + private formBuilder: UntypedFormBuilder, + private router: Router, + private route: ActivatedRoute, + private loanService: LoansService, + private dateUtils: Dates, + private settingsService: SettingsService + ) { this.loanId = this.route.snapshot.params['loanId']; } @@ -53,8 +54,11 @@ export class RejectLoanComponent implements OnInit { */ setRejectLoanForm() { this.rejectLoanForm = this.formBuilder.group({ - 'rejectedOnDate': [new Date(), Validators.required], - 'note': [''] + rejectedOnDate: [ + new Date(), + Validators.required + ], + note: [''] }); } @@ -78,5 +82,4 @@ export class RejectLoanComponent implements OnInit { this.router.navigate(['../../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/undo-approval/undo-approval.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/undo-approval/undo-approval.component.spec.ts index 1e34af423..4c9134552 100644 --- a/src/app/loans/loans-view/loan-account-actions/undo-approval/undo-approval.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/undo-approval/undo-approval.component.spec.ts @@ -8,9 +8,8 @@ describe('UndoApprovalComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UndoApprovalComponent ] - }) - .compileComponents(); + declarations: [UndoApprovalComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/undo-approval/undo-approval.component.ts b/src/app/loans/loans-view/loan-account-actions/undo-approval/undo-approval.component.ts index 17b544226..6fb7beaa2 100644 --- a/src/app/loans/loans-view/loan-account-actions/undo-approval/undo-approval.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/undo-approval/undo-approval.component.ts @@ -14,7 +14,6 @@ import { LoansService } from 'app/loans/loans.service'; styleUrls: ['./undo-approval.component.scss'] }) export class UndoApprovalComponent implements OnInit { - /** Form Controller. */ note: UntypedFormControl; @@ -23,10 +22,12 @@ export class UndoApprovalComponent implements OnInit { * @param route Activated Route. * @param router Router. */ - constructor(private loanService: LoansService, - private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router) { } + constructor( + private loanService: LoansService, + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router + ) {} ngOnInit() { this.note = this.formBuilder.control(''); @@ -37,9 +38,8 @@ export class UndoApprovalComponent implements OnInit { */ submit() { const loanId = this.route.snapshot.params['loanId']; - this.loanService.loanActionButtons(loanId, 'undoapproval', { 'note': this.note.value }).subscribe((response: any) => { - this.router.navigate(['../../general'], {relativeTo: this.route}); + this.loanService.loanActionButtons(loanId, 'undoapproval', { note: this.note.value }).subscribe((response: any) => { + this.router.navigate(['../../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.spec.ts index 6a7777c5b..58b3acb94 100644 --- a/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.spec.ts @@ -8,9 +8,8 @@ describe('UndoDisbursalComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UndoDisbursalComponent ] - }) - .compileComponents(); + declarations: [UndoDisbursalComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.ts b/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.ts index a17eb7945..afaa12cab 100644 --- a/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.ts @@ -15,7 +15,6 @@ import { LoansService } from '../../../loans.service'; styleUrls: ['./undo-disbursal.component.scss'] }) export class UndoDisbursalComponent implements OnInit { - @Input() actionName: string; /** Loan ID. */ @@ -29,10 +28,12 @@ export class UndoDisbursalComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private loansService: LoansService, - private router: Router, - private route: ActivatedRoute) { + constructor( + private formBuilder: UntypedFormBuilder, + private loansService: LoansService, + private router: Router, + private route: ActivatedRoute + ) { this.loanId = this.route.snapshot.params['loanId']; } @@ -51,9 +52,8 @@ export class UndoDisbursalComponent implements OnInit { if (this.actionName === 'Undo Last Disbursal') { command = 'undolastdisbursal'; } - this.loansService.loanActionButtons(this.loanId, command, {'note': this.note.value}).subscribe((response: any) => { + this.loansService.loanActionButtons(this.loanId, command, { note: this.note.value }).subscribe((response: any) => { this.router.navigate(['../../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/view-guarantors/view-guarantors.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/view-guarantors/view-guarantors.component.spec.ts index 682653ed1..3a3eab043 100644 --- a/src/app/loans/loans-view/loan-account-actions/view-guarantors/view-guarantors.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/view-guarantors/view-guarantors.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewGuarantorsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewGuarantorsComponent ] - }) - .compileComponents(); + declarations: [ViewGuarantorsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/view-guarantors/view-guarantors.component.ts b/src/app/loans/loans-view/loan-account-actions/view-guarantors/view-guarantors.component.ts index 89b7373dc..c666792b8 100644 --- a/src/app/loans/loans-view/loan-account-actions/view-guarantors/view-guarantors.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/view-guarantors/view-guarantors.component.ts @@ -20,12 +20,20 @@ import { LoansAccountViewGuarantorDetailsDialogComponent } from 'app/loans/custo styleUrls: ['./view-guarantors.component.scss'] }) export class ViewGuarantorsComponent implements OnInit { - @Input() dataObject: any; guarantorDetails: any; showDeletedGuarantorsAccounts = false; loanId: any; - guarantorsDisplayedColumns: string[] = ['fullname', 'relationship', 'guarantortype', 'depositAccount', 'amount', 'remainingAmount', 'status', 'action']; + guarantorsDisplayedColumns: string[] = [ + 'fullname', + 'relationship', + 'guarantortype', + 'depositAccount', + 'amount', + 'remainingAmount', + 'status', + 'action' + ]; /** View and perform various action on existing list of guarantors * @param {MatDialog} dialog Dialog @@ -33,10 +41,12 @@ export class ViewGuarantorsComponent implements OnInit { * @param {route} Route Route * @param {router} Router Router */ - constructor(public dialog: MatDialog, - public loansService: LoansService, - private route: ActivatedRoute, - private router: Router) { + constructor( + public dialog: MatDialog, + public loansService: LoansService, + private route: ActivatedRoute, + private router: Router + ) { this.loanId = this.route.snapshot.params['loanId']; } @@ -75,8 +85,8 @@ export class ViewGuarantorsComponent implements OnInit { private reload() { const clientId = this.dataObject.clientId; const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true }) + this.router + .navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/waive-interest/waive-interest.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/waive-interest/waive-interest.component.spec.ts index 1d7c7217a..94c6cf7b8 100644 --- a/src/app/loans/loans-view/loan-account-actions/waive-interest/waive-interest.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/waive-interest/waive-interest.component.spec.ts @@ -8,9 +8,8 @@ describe('WaiveInterestComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WaiveInterestComponent ] - }) - .compileComponents(); + declarations: [WaiveInterestComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/waive-interest/waive-interest.component.ts b/src/app/loans/loans-view/loan-account-actions/waive-interest/waive-interest.component.ts index 5d32bb6b0..6187b15e8 100644 --- a/src/app/loans/loans-view/loan-account-actions/waive-interest/waive-interest.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/waive-interest/waive-interest.component.ts @@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./waive-interest.component.scss'] }) export class WaiveInterestComponent implements OnInit { - @Input() dataObject: any; /** Loan Interest form. */ @@ -36,12 +35,14 @@ export class WaiveInterestComponent implements OnInit { * @param {LoansService} loanService Loan Service. * @param {ActivatedRoute} route Activated Route. */ - constructor(private formBuilder: UntypedFormBuilder, - private router: Router, - private settingsService: SettingsService, - private dateUtils: Dates, - private loanService: LoansService, - private route: ActivatedRoute) { } + constructor( + private formBuilder: UntypedFormBuilder, + private router: Router, + private settingsService: SettingsService, + private dateUtils: Dates, + private loanService: LoansService, + private route: ActivatedRoute + ) {} ngOnInit() { this.maxDate = this.settingsService.businessDate; @@ -56,9 +57,15 @@ export class WaiveInterestComponent implements OnInit { */ setLoanInterestForm() { this.loanInterestForm = this.formBuilder.group({ - 'transactionAmount': [this.dataObject.amount, Validators.required], - 'transactionDate': [this.dataObject.date && new Date(this.dataObject.date), Validators.required], - 'note': [''] + transactionAmount: [ + this.dataObject.amount, + Validators.required + ], + transactionDate: [ + this.dataObject.date && new Date(this.dataObject.date), + Validators.required + ], + note: [''] }); } @@ -81,8 +88,7 @@ export class WaiveInterestComponent implements OnInit { data['transactionAmount'] = data['transactionAmount'] * 1; const loanId = this.route.snapshot.params['loanId']; this.loanService.submitLoanActionButton(loanId, data, 'waiveinterest').subscribe((response: any) => { - this.router.navigate(['../../general'], {relativeTo: this.route}); + this.router.navigate(['../../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component.spec.ts index c23137af1..a675b7716 100644 --- a/src/app/loans/loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component.spec.ts @@ -8,9 +8,8 @@ describe('WithdrawnByClientComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WithdrawnByClientComponent ] - }) - .compileComponents(); + declarations: [WithdrawnByClientComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component.ts b/src/app/loans/loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component.ts index 14478afb0..6081fd7eb 100644 --- a/src/app/loans/loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./withdrawn-by-client.component.scss'] }) export class WithdrawnByClientComponent implements OnInit { - @Input() dataObject: any; /** Loan Id */ loanId: string; @@ -35,12 +34,14 @@ export class WithdrawnByClientComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private loanService: LoansService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.loanId = this.route.snapshot.params['loanId']; } @@ -58,8 +59,11 @@ export class WithdrawnByClientComponent implements OnInit { */ createWithdrawnByClientLoanForm() { this.withdrawnByClientLoanForm = this.formBuilder.group({ - 'withdrawnOnDate': [new Date(), Validators.required], - 'note': '' + withdrawnOnDate: [ + new Date(), + Validators.required + ], + note: '' }); } @@ -77,10 +81,8 @@ export class WithdrawnByClientComponent implements OnInit { dateFormat, locale }; - this.loanService.loanActionButtons(this.loanId, 'withdrawnByApplicant', data) - .subscribe((response: any) => { - this.router.navigate(['../../general'], { relativeTo: this.route }); - }); + this.loanService.loanActionButtons(this.loanId, 'withdrawnByApplicant', data).subscribe((response: any) => { + this.router.navigate(['../../general'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.spec.ts index acc7576ae..ae886800a 100644 --- a/src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.spec.ts +++ b/src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.spec.ts @@ -8,9 +8,8 @@ describe('WriteOffPageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WriteOffPageComponent ] - }) - .compileComponents(); + declarations: [WriteOffPageComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.ts b/src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.ts index 3c4abfd39..b38e1601e 100644 --- a/src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.ts +++ b/src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./write-off-page.component.scss'] }) export class WriteOffPageComponent implements OnInit { - @Input() dataObject: any; /** Minimum Date allowed. */ @@ -37,12 +36,14 @@ export class WriteOffPageComponent implements OnInit { * @param {Router} router Router. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private loanService: LoansService, - private dateUtils: Dates, - private router: Router, - private settingsService: SettingsService) { } + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private loanService: LoansService, + private dateUtils: Dates, + private router: Router, + private settingsService: SettingsService + ) {} ngOnInit() { this.maxDate = this.settingsService.businessDate; @@ -54,9 +55,12 @@ export class WriteOffPageComponent implements OnInit { */ setWriteOffForm() { this.writeOffForm = this.formBuilder.group({ - 'transactionDate': [this.dataObject.date && new Date(this.dataObject.date), Validators.required], - 'amount': [{value: this.dataObject.amount, disabled: true}], - 'note': [''] + transactionDate: [ + this.dataObject.date && new Date(this.dataObject.date), + Validators.required + ], + amount: [{ value: this.dataObject.amount, disabled: true }], + note: [''] }); } @@ -79,8 +83,7 @@ export class WriteOffPageComponent implements OnInit { const loanId = this.route.snapshot.params['loanId']; delete data.amount; this.loanService.submitLoanActionButton(loanId, data, 'writeoff').subscribe((response: any) => { - this.router.navigate(['../../general'], {relativeTo: this.route}); + this.router.navigate(['../../general'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/loan-accounts-button-config.ts b/src/app/loans/loans-view/loan-accounts-button-config.ts index 9e9a39855..2ba6c2b5e 100644 --- a/src/app/loans/loans-view/loan-accounts-button-config.ts +++ b/src/app/loans/loans-view/loan-accounts-button-config.ts @@ -1,20 +1,19 @@ /** Recurring Deposits Account Buttons Configuration */ export class LoansAccountButtonConfiguration { - optionArray: { - name: string, - taskPermissionName?: string, + name: string; + taskPermissionName?: string; }[]; optionPaymentArray: { - name: string, - taskPermissionName?: string, + name: string; + taskPermissionName?: string; }[]; buttonsArray: { - name: string, - icon: string, - taskPermissionName?: string, + name: string; + icon: string; + taskPermissionName?: string; }[]; constructor(status: string) { @@ -41,22 +40,22 @@ export class LoansAccountButtonConfiguration { { name: 'Add Loan Charge', icon: 'plus', - taskPermissionName: 'CREATE_LOANCHARGE', + taskPermissionName: 'CREATE_LOANCHARGE' }, { name: 'Foreclosure', icon: 'heart-broken', - taskPermissionName: 'FORECLOSURE_LOAN', + taskPermissionName: 'FORECLOSURE_LOAN' }, { name: 'Make Repayment', icon: 'coins', - taskPermissionName: 'REPAYMENT_LOAN', + taskPermissionName: 'REPAYMENT_LOAN' }, { name: 'Undo Disbursal', icon: 'undo', - taskPermissionName: 'DISBURSALUNDO_LOAN', + taskPermissionName: 'DISBURSALUNDO_LOAN' } ]; break; @@ -65,23 +64,23 @@ export class LoansAccountButtonConfiguration { { name: 'Add Loan Charge', icon: 'plus', - taskPermissionName: 'CREATE_LOANCHARGE', + taskPermissionName: 'CREATE_LOANCHARGE' }, { name: 'Approve', icon: 'check', - taskPermissionName: 'APPROVE_LOAN', + taskPermissionName: 'APPROVE_LOAN' }, { name: 'Modify Application', icon: 'edit', - taskPermissionName: 'UPDATE_LOAN', + taskPermissionName: 'UPDATE_LOAN' }, { name: 'Reject', icon: 'times', - taskPermissionName: 'REJECT_LOAN', - }, + taskPermissionName: 'REJECT_LOAN' + } ]; break; case 'Approved': @@ -89,18 +88,18 @@ export class LoansAccountButtonConfiguration { { name: 'Disburse', icon: 'hand-holding-usd', - taskPermissionName: 'DISBURSE_LOAN', + taskPermissionName: 'DISBURSE_LOAN' }, { name: 'Disburse to Savings', icon: 'piggy-bank', - taskPermissionName: 'DISBURSETOSAVINGS_LOAN', + taskPermissionName: 'DISBURSETOSAVINGS_LOAN' }, { name: 'Undo Approval', icon: 'undo', - taskPermissionName: 'APPROVALUNDO_LOAN', - }, + taskPermissionName: 'APPROVALUNDO_LOAN' + } ]; break; case 'Overpaid': @@ -108,12 +107,12 @@ export class LoansAccountButtonConfiguration { { name: 'Transfer Funds', icon: 'exchange', - taskPermissionName: 'CREATE_ACCOUNTTRANSFER', + taskPermissionName: 'CREATE_ACCOUNTTRANSFER' }, { name: 'Credit Balance Refund', icon: 'coins', - taskPermissionName: 'CREATE_CREDIT_BALANCE_REFUND', + taskPermissionName: 'CREATE_CREDIT_BALANCE_REFUND' } ]; break; @@ -122,8 +121,8 @@ export class LoansAccountButtonConfiguration { { name: 'Recovery Payment', icon: 'briefcase', - taskPermissionName: 'RECOVERYPAYMENT_LOAN', - }, + taskPermissionName: 'RECOVERYPAYMENT_LOAN' + } ]; break; case 'Closed (obligations met)': @@ -131,22 +130,22 @@ export class LoansAccountButtonConfiguration { { name: 'Goodwill Credit', icon: 'coins', - taskPermissionName: 'CREATE_GOODWILL_TRANSACTION', + taskPermissionName: 'CREATE_GOODWILL_TRANSACTION' }, { name: 'Interest Payment Waiver', icon: 'coins', - taskPermissionName: 'CREATE_INTERESTPAYMENTWAIVER_TRANSACTION', + taskPermissionName: 'CREATE_INTERESTPAYMENTWAIVER_TRANSACTION' }, { name: 'Payout Refund', icon: 'coins', - taskPermissionName: 'CREATE_PAYOUT_REFUND', + taskPermissionName: 'CREATE_PAYOUT_REFUND' }, { name: 'Merchant Issued Refund', icon: 'coins', - taskPermissionName: 'CREATE_MERCHANT_ISSUED_REFUND', + taskPermissionName: 'CREATE_MERCHANT_ISSUED_REFUND' } ]; break; @@ -161,61 +160,61 @@ export class LoansAccountButtonConfiguration { this.optionArray = [ { name: 'Waive Interest', - taskPermissionName: 'WAIVEINTERESTPORTION_LOAN', + taskPermissionName: 'WAIVEINTERESTPORTION_LOAN' }, { name: 'Reschedule', - taskPermissionName: 'CREATE_RESCHEDULELOAN', + taskPermissionName: 'CREATE_RESCHEDULELOAN' }, { name: 'Write Off', - taskPermissionName: 'WRITEOFF_LOAN', + taskPermissionName: 'WRITEOFF_LOAN' }, { name: 'Close (as Rescheduled)', - taskPermissionName: 'CLOSEASRESCHEDULED_LOAN', + taskPermissionName: 'CLOSEASRESCHEDULED_LOAN' }, { name: 'Close', - taskPermissionName: 'CLOSE_LOAN', + taskPermissionName: 'CLOSE_LOAN' }, { name: 'Loan Screen Report', - taskPermissionName: 'READ_LOAN', + taskPermissionName: 'READ_LOAN' }, { name: 'View Guarantors', - taskPermissionName: 'READ_GUARANTOR', + taskPermissionName: 'READ_GUARANTOR' }, { name: 'Create Guarantor', - taskPermissionName: 'CREATE_GUARANTOR', + taskPermissionName: 'CREATE_GUARANTOR' }, { name: 'Recover From Guarantor', - taskPermissionName: 'RECOVERGUARANTEES_LOAN', + taskPermissionName: 'RECOVERGUARANTEES_LOAN' }, { name: 'Sell Loan', - taskPermissionName: 'SALE_LOAN', + taskPermissionName: 'SALE_LOAN' } ]; this.optionPaymentArray = [ { name: 'Goodwill Credit', - taskPermissionName: 'CREATE_GOODWILL_TRANSACTION', + taskPermissionName: 'CREATE_GOODWILL_TRANSACTION' }, { name: 'Interest Payment Waiver', - taskPermissionName: 'CREATE_INTERESTPAYMENTWAIVER_TRANSACTION', + taskPermissionName: 'CREATE_INTERESTPAYMENTWAIVER_TRANSACTION' }, { name: 'Payout Refund', - taskPermissionName: 'CREATE_PAYOUT_REFUND', + taskPermissionName: 'CREATE_PAYOUT_REFUND' }, { name: 'Merchant Issued Refund', - taskPermissionName: 'CREATE_MERCHANT_ISSUED_REFUND', + taskPermissionName: 'CREATE_MERCHANT_ISSUED_REFUND' } ]; break; @@ -223,28 +222,28 @@ export class LoansAccountButtonConfiguration { this.optionArray = [ { name: 'Withdrawn by Client', - taskPermissionName: 'WITHDRAW_LOAN', + taskPermissionName: 'WITHDRAW_LOAN' }, { name: 'Delete', - taskPermissionName: 'DELETE_LOAN', + taskPermissionName: 'DELETE_LOAN' }, { name: 'Add Collateral', - taskPermissionName: 'CREATE_COLLATERAL', + taskPermissionName: 'CREATE_COLLATERAL' }, { name: 'View Guarantors', - taskPermissionName: 'READ_GUARANTOR', + taskPermissionName: 'READ_GUARANTOR' }, { name: 'Create Guarantor', - taskPermissionName: 'CREATE_GUARANTOR', + taskPermissionName: 'CREATE_GUARANTOR' }, { name: 'Loan Screen Reports', - taskPermissionName: 'READ_LOAN', - }, + taskPermissionName: 'READ_LOAN' + } ]; this.optionPaymentArray = []; break; @@ -252,20 +251,20 @@ export class LoansAccountButtonConfiguration { this.optionArray = [ { name: 'Add Loan Charge', - taskPermissionName: 'CREATE_LOANCHARGE', + taskPermissionName: 'CREATE_LOANCHARGE' }, { name: 'View Guarantors', - taskPermissionName: 'READ_GUARANTOR', + taskPermissionName: 'READ_GUARANTOR' }, { name: 'Create Guarantor', - taskPermissionName: 'CREATE_GUARANTOR', + taskPermissionName: 'CREATE_GUARANTOR' }, { name: 'Loan Screen Report', - taskPermissionName: 'READ_LOAN', - }, + taskPermissionName: 'READ_LOAN' + } ]; this.optionPaymentArray = []; break; @@ -275,12 +274,11 @@ export class LoansAccountButtonConfiguration { } } - addOption(option: { name: string, icon?: string, taskPermissionName?: string }) { + addOption(option: { name: string; icon?: string; taskPermissionName?: string }) { this.optionArray.push(option); } - addButton(option: { name: string, icon: string, taskPermissionName?: string }) { + addButton(option: { name: string; icon: string; taskPermissionName?: string }) { this.buttonsArray.push(option); } - } diff --git a/src/app/loans/loans-view/loan-collateral-tab/loan-collateral-tab.component.spec.ts b/src/app/loans/loans-view/loan-collateral-tab/loan-collateral-tab.component.spec.ts index 81d79f113..dae6880c4 100644 --- a/src/app/loans/loans-view/loan-collateral-tab/loan-collateral-tab.component.spec.ts +++ b/src/app/loans/loans-view/loan-collateral-tab/loan-collateral-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanCollateralTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanCollateralTabComponent ] - }) - .compileComponents(); + declarations: [LoanCollateralTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-collateral-tab/loan-collateral-tab.component.ts b/src/app/loans/loans-view/loan-collateral-tab/loan-collateral-tab.component.ts index ce12dd813..176a337fd 100644 --- a/src/app/loans/loans-view/loan-collateral-tab/loan-collateral-tab.component.ts +++ b/src/app/loans/loans-view/loan-collateral-tab/loan-collateral-tab.component.ts @@ -7,11 +7,15 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./loan-collateral-tab.component.scss'] }) export class LoanCollateralTabComponent implements OnInit { - /** Loan Collateral Details */ loanCollaterals: any[] = []; /** Columns to be displayed in collateral table. */ - displayedColumns: string[] = ['id', 'currency', 'description', 'total']; + displayedColumns: string[] = [ + 'id', + 'currency', + 'description', + 'total' + ]; totalAmount: number; @@ -31,5 +35,4 @@ export class LoanCollateralTabComponent implements OnInit { this.totalAmount = this.totalAmount + collateral.value; }); } - } diff --git a/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.spec.ts b/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.spec.ts index a396de2ca..966ec220e 100644 --- a/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.spec.ts +++ b/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanDelinquencyTagsTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ LoanDelinquencyTagsTabComponent ] - }) - .compileComponents(); + declarations: [LoanDelinquencyTagsTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.ts b/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.ts index 5dee12fd9..bca7aecbb 100644 --- a/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.ts +++ b/src/app/loans/loans-view/loan-delinquency-tags-tab/loan-delinquency-tags-tab.component.ts @@ -5,7 +5,12 @@ import { TranslateService } from '@ngx-translate/core'; import { Dates } from 'app/core/utils/dates'; import { LoanDelinquencyActionDialogComponent } from 'app/loans/custom-dialog/loan-delinquency-action-dialog/loan-delinquency-action-dialog.component'; import { LoansService } from 'app/loans/loans.service'; -import { DelinquentData, InstallmentLevelDelinquency, LoanDelinquencyAction, LoanDelinquencyTags } from 'app/loans/models/loan-account.model'; +import { + DelinquentData, + InstallmentLevelDelinquency, + LoanDelinquencyAction, + LoanDelinquencyTags +} from 'app/loans/models/loan-account.model'; import { SettingsService } from 'app/settings/settings.service'; import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-dialog.component'; import { Currency } from 'app/shared/models/general.model'; @@ -16,15 +21,28 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./loan-delinquency-tags-tab.component.scss'] }) export class LoanDelinquencyTagsTabComponent implements OnInit { - loanDelinquencyTags: LoanDelinquencyTags[] = []; loanDelinquencyActions: LoanDelinquencyAction[] = []; currentLoanDelinquencyAction: LoanDelinquencyAction | null; currency: Currency; installmentLevelDelinquency: InstallmentLevelDelinquency[] = []; - loanDelinquencyTagsColumns: string[] = ['classification', 'addedOn', 'liftedOn']; - loanDelinquencyActionsColumns: string[] = ['action', 'startDate', 'endDate', 'createdOn', 'actions']; - installmentDelinquencyTagsColumns: string[] = ['classification', 'minimumAgeDays', 'amount']; + loanDelinquencyTagsColumns: string[] = [ + 'classification', + 'addedOn', + 'liftedOn' + ]; + loanDelinquencyActionsColumns: string[] = [ + 'action', + 'startDate', + 'endDate', + 'createdOn', + 'actions' + ]; + installmentDelinquencyTagsColumns: string[] = [ + 'classification', + 'minimumAgeDays', + 'amount' + ]; allowPause = true; loanId: any; @@ -32,29 +50,33 @@ export class LoanDelinquencyTagsTabComponent implements OnInit { locale: string; dateFormat: string; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private loansServices: LoansService, private dateUtils: Dates, private settingsService: SettingsService, private translateService: TranslateService, - public dialog: MatDialog) { + public dialog: MatDialog + ) { this.loanId = this.route.parent.parent.snapshot.params['loanId']; - this.route.parent.data.subscribe((data: { - loanDelinquencyTagsData: LoanDelinquencyTags[], - loanDelinquencyData: any, - loanDelinquencyActions: LoanDelinquencyAction[] - }) => { - this.loanDelinquencyTags = data.loanDelinquencyTagsData; - this.loanDelinquencyActions = data.loanDelinquencyActions || []; - this.validateDelinquencyActions(); - const loanDelinquencyData: DelinquentData | null = data.loanDelinquencyData.delinquent || null; - this.currency = data.loanDelinquencyData.currency; - this.installmentLevelDelinquency = []; - if (loanDelinquencyData != null) { - this.installmentLevelDelinquency = loanDelinquencyData.installmentLevelDelinquency || []; + this.route.parent.data.subscribe( + (data: { + loanDelinquencyTagsData: LoanDelinquencyTags[]; + loanDelinquencyData: any; + loanDelinquencyActions: LoanDelinquencyAction[]; + }) => { + this.loanDelinquencyTags = data.loanDelinquencyTagsData; + this.loanDelinquencyActions = data.loanDelinquencyActions || []; + this.validateDelinquencyActions(); + const loanDelinquencyData: DelinquentData | null = data.loanDelinquencyData.delinquent || null; + this.currency = data.loanDelinquencyData.currency; + this.installmentLevelDelinquency = []; + if (loanDelinquencyData != null) { + this.installmentLevelDelinquency = loanDelinquencyData.installmentLevelDelinquency || []; + } } - }); + ); } ngOnInit(): void { @@ -68,7 +90,7 @@ export class LoanDelinquencyTagsTabComponent implements OnInit { if (this.loanDelinquencyActions.length > 0) { const businessDate: Date = this.settingsService.businessDate; this.currentLoanDelinquencyAction = this.loanDelinquencyActions[this.loanDelinquencyActions.length - 1]; - this.allowPause = (this.currentLoanDelinquencyAction.action === 'RESUME'); + this.allowPause = this.currentLoanDelinquencyAction.action === 'RESUME'; } } @@ -77,7 +99,7 @@ export class LoanDelinquencyTagsTabComponent implements OnInit { const loanDelinquencyActionDialogRef = this.dialog.open(LoanDelinquencyActionDialogComponent, { data: { action: action - }, + } }); loanDelinquencyActionDialogRef.afterClosed().subscribe((response: { data: any }) => { const startDate: Date = response.data.value.startDate; @@ -91,7 +113,10 @@ export class LoanDelinquencyTagsTabComponent implements OnInit { const removePauseDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: this.translateService.instant('labels.heading.Loan Delinquency Classification'), - dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want resume the Delinquency Classification for Loan') + this.loanId, + dialogContext: + this.translateService.instant( + 'labels.dialogContext.Are you sure you want resume the Delinquency Classification for Loan' + ) + this.loanId, type: 'Mild' } }); @@ -120,10 +145,12 @@ export class LoanDelinquencyTagsTabComponent implements OnInit { } this.loansServices.createDelinquencyActions(this.loanId, payload).subscribe((result: any) => { - this.loansServices.getDelinquencyActions(this.loanId).subscribe((loanDelinquencyActions: LoanDelinquencyAction[]) => { - this.loanDelinquencyActions = loanDelinquencyActions; - this.validateDelinquencyActions(); - }); + this.loansServices + .getDelinquencyActions(this.loanId) + .subscribe((loanDelinquencyActions: LoanDelinquencyAction[]) => { + this.loanDelinquencyActions = loanDelinquencyActions; + this.validateDelinquencyActions(); + }); }); } @@ -157,5 +184,4 @@ export class LoanDelinquencyTagsTabComponent implements OnInit { } return 'status-active'; } - } diff --git a/src/app/loans/loans-view/loan-documents-tab/loan-documents-tab.component.spec.ts b/src/app/loans/loans-view/loan-documents-tab/loan-documents-tab.component.spec.ts index 331d0c510..1bd93eb0c 100644 --- a/src/app/loans/loans-view/loan-documents-tab/loan-documents-tab.component.spec.ts +++ b/src/app/loans/loans-view/loan-documents-tab/loan-documents-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanDocumentsTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanDocumentsTabComponent ] - }) - .compileComponents(); + declarations: [LoanDocumentsTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-documents-tab/loan-documents-tab.component.ts b/src/app/loans/loans-view/loan-documents-tab/loan-documents-tab.component.ts index 2f83e00a6..affc4b99e 100644 --- a/src/app/loans/loans-view/loan-documents-tab/loan-documents-tab.component.ts +++ b/src/app/loans/loans-view/loan-documents-tab/loan-documents-tab.component.ts @@ -16,7 +16,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./loan-documents-tab.component.scss'] }) export class LoanDocumentsTabComponent { - /** Stores the resolved loan documents data */ entityDocuments: any; /** Loan account Id */ @@ -27,21 +26,34 @@ export class LoanDocumentsTabComponent { * Retrieves the loans data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private loansService: LoansService, - private settingsService: SettingsService) { - this.entityId = this.route.parent.snapshot.params['loanId']; + private settingsService: SettingsService + ) { + this.entityId = this.route.parent.snapshot.params['loanId']; - this.route.data.subscribe((data: { loanDocuments: any }) => { - this.getLoanDocumentsData(data.loanDocuments); - }); + this.route.data.subscribe((data: { loanDocuments: any }) => { + this.getLoanDocumentsData(data.loanDocuments); + }); } getLoanDocumentsData(data: any) { data.forEach((ele: any) => { - ele.docUrl = this.settingsService.serverUrl + '/loans/' + ele.parentEntityId + '/documents/' + ele.id + '/attachment?tenantIdentifier=' + environment.fineractPlatformTenantId; + ele.docUrl = + this.settingsService.serverUrl + + '/loans/' + + ele.parentEntityId + + '/documents/' + + ele.id + + '/attachment?tenantIdentifier=' + + environment.fineractPlatformTenantId; if (ele.fileName) { - if (ele.fileName.toLowerCase().indexOf('.jpg') !== -1 || ele.fileName.toLowerCase().indexOf('.jpeg') !== -1 || ele.fileName.toLowerCase().indexOf('.png') !== -1) { + if ( + ele.fileName.toLowerCase().indexOf('.jpg') !== -1 || + ele.fileName.toLowerCase().indexOf('.jpeg') !== -1 || + ele.fileName.toLowerCase().indexOf('.png') !== -1 + ) { ele.fileIsImage = true; } } @@ -55,7 +67,7 @@ export class LoanDocumentsTabComponent { } downloadDocument(documentId: string) { - this.loansService.downloadLoanDocument(this.entityId, documentId).subscribe(res => { + this.loansService.downloadLoanDocument(this.entityId, documentId).subscribe((res) => { const url = window.URL.createObjectURL(res); window.open(url); }); @@ -68,5 +80,4 @@ export class LoanDocumentsTabComponent { deleteDocument(documentId: any) { this.loansService.deleteLoanDocument(this.entityId, documentId).subscribe((res: any) => {}); } - } diff --git a/src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.html b/src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.html index 9831ad729..867f0433a 100644 --- a/src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.html +++ b/src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.html @@ -1,26 +1,26 @@

{{ 'labels.heading.Term Variations' | translate }}

- +
- + - + - + - + - +
{{"labels.inputs.Type" | translate}} {{ 'labels.inputs.Type' | translate }} {{ item.termType.value | translate }} {{"labels.inputs.Added On" | translate}} {{ 'labels.inputs.Added On' | translate }} {{ item.termVariationApplicableFrom | dateFormat }} {{"labels.inputs.Value" | translate}} {{ 'labels.inputs.Value' | translate }} {{ item.decimalValue | formatNumber }} {{"labels.inputs.Specific to Installment" | translate}} {{ 'labels.inputs.Specific to Installment' | translate }} {{ item.isSpecificToInstallment | yesNo }}

{{ 'labels.heading.Interest Pauses' | translate }}

@@ -48,16 +48,26 @@ {{ 'labels.inputs.Actions' | translate }} - - + @@ -71,4 +81,4 @@ {{ 'labels.text.No data found' | translate }}
- \ No newline at end of file + diff --git a/src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.spec.ts b/src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.spec.ts index 8a0f0050b..d8dcb40aa 100644 --- a/src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.spec.ts +++ b/src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanTermVariationsTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ LoanTermVariationsTabComponent ] - }) - .compileComponents(); + declarations: [LoanTermVariationsTabComponent] + }).compileComponents(); fixture = TestBed.createComponent(LoanTermVariationsTabComponent); component = fixture.componentInstance; diff --git a/src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.ts b/src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.ts index 66f586c84..e052cccb1 100644 --- a/src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.ts +++ b/src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.ts @@ -16,18 +16,29 @@ import { AnyKindOfDictionary } from 'cypress/types/lodash'; styleUrls: ['./loan-term-variations-tab.component.scss'] }) export class LoanTermVariationsTabComponent { - /** Loan Term Variation Data */ loanTermVariationsData: any[] = []; - loanDTermVariationsColumns: string[] = ['termType', 'applicableFrom', 'value', 'specificToInstallment']; + loanDTermVariationsColumns: string[] = [ + 'termType', + 'applicableFrom', + 'value', + 'specificToInstallment' + ]; /** Interest Pauses Data */ interestPausesData: any[] = []; - interestPausesColumns: string[] = ['row', 'startDate', 'endDate', 'days', 'actions']; + interestPausesColumns: string[] = [ + 'row', + 'startDate', + 'endDate', + 'days', + 'actions' + ]; loanId: number; clientId: AnyKindOfDictionary; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private dates: Dates, private settingsService: SettingsService, @@ -36,7 +47,7 @@ export class LoanTermVariationsTabComponent { ) { this.interestPausesData = []; this.clientId = this.route.parent.parent.snapshot.paramMap.get('clientId'); - this.route.data.subscribe((data: { loanDetailsData: any, interestPausesData: any }) => { + this.route.data.subscribe((data: { loanDetailsData: any; interestPausesData: any }) => { this.loanId = data.loanDetailsData.id; this.loanTermVariationsData = data.loanDetailsData.loanTermVariations; this.interestPausesData = []; @@ -85,7 +96,8 @@ export class LoanTermVariationsTabComponent { value: endDate, maxDate: this.settingsService.maxFutureDate, required: true - }), + }) + ]; const data = { @@ -104,7 +116,7 @@ export class LoanTermVariationsTabComponent { endDate: this.dates.formatDate(response.data.value.endDate, dateFormat), locale, dateFormat - } + }; this.loansService.updateInterestPause(this.loanId, variation.id, payload).subscribe((response: any) => { this.reload(); }); @@ -115,7 +127,8 @@ export class LoanTermVariationsTabComponent { private reload() { const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${this.clientId}/loans-accounts`, { skipLocationChange: true }) + this.router + .navigateByUrl(`/clients/${this.clientId}/loans-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } } diff --git a/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.spec.ts b/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.spec.ts index 4a3ad1a0a..6c75898f6 100644 --- a/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.spec.ts +++ b/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanTrancheDetailsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanTrancheDetailsComponent ] - }) - .compileComponents(); + declarations: [LoanTrancheDetailsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.ts b/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.ts index e553ccec6..63c2dac93 100644 --- a/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.ts +++ b/src/app/loans/loans-view/loan-tranche-details/loan-tranche-details.component.ts @@ -13,15 +13,23 @@ import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base'; @Component({ selector: 'mifosx-loan-tranche-details', templateUrl: './loan-tranche-details.component.html', - styleUrls: ['./loan-tranche-details.component.scss'], + styleUrls: ['./loan-tranche-details.component.scss'] }) export class LoanTrancheDetailsComponent implements OnInit { loanDetails: any; return: any; status: any; count: number; - expectedDisbursementColumns: string[] = ['expected disbursement on', 'disbursed on', 'principal', 'action']; - emivariationColumns: string[] = ['emi amount variation from', 'fixed emi amount']; + expectedDisbursementColumns: string[] = [ + 'expected disbursement on', + 'disbursed on', + 'principal', + 'action' + ]; + emivariationColumns: string[] = [ + 'emi amount variation from', + 'fixed emi amount' + ]; loanId: number; currentPrincipalAmount: number; @@ -36,11 +44,13 @@ export class LoanTrancheDetailsComponent implements OnInit { * Retrieves the loans data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, public dialog: MatDialog, private loanServices: LoansService, private settingsService: SettingsService, - private dateUtils: Dates) { + private dateUtils: Dates + ) { this.route.parent.data.subscribe((data: { loanDetailsData: any }) => { this.loanId = data.loanDetailsData.id; this.loanDetails = data.loanDetailsData; @@ -99,7 +109,7 @@ export class LoanTrancheDetailsComponent implements OnInit { this.totalMultiDisbursed = 0; this.count = 0; this.disbursementDataSource.forEach((item: any) => { - this.totalMultiDisbursed += (item.principal * 1); + this.totalMultiDisbursed += item.principal * 1; this.count += 1; }); } @@ -124,6 +134,7 @@ export class LoanTrancheDetailsComponent implements OnInit { required: true, order: 2 }) + ]; return formBase; } @@ -137,13 +148,13 @@ export class LoanTrancheDetailsComponent implements OnInit { const data = { title: 'Add Disbursement Details', layout: { addButtonText: 'Add' }, - formfields: this.buildForm(new Date(), (this.currentPrincipalAmount - this.totalMultiDisbursed)) + formfields: this.buildForm(new Date(), this.currentPrincipalAmount - this.totalMultiDisbursed) }; const disbursementDialogRef = this.dialog.open(FormDialogComponent, { data }); disbursementDialogRef.afterClosed().subscribe((response: any) => { if (response.data) { const principal = response.data.value.principal * 1; - if ((this.totalMultiDisbursed + principal) <= this.currentPrincipalAmount) { + if (this.totalMultiDisbursed + principal <= this.currentPrincipalAmount) { this.disbursementDataSource = this.disbursementDataSource.concat(response.data.value); this.pristine = false; } @@ -156,7 +167,9 @@ export class LoanTrancheDetailsComponent implements OnInit { */ editDisbursementDataEntry(index: number) { const principal: number = this.disbursementDataSource[index]['principal'] * 1; - const expectedDisbursementDate: Date = this.dateUtils.parseDate(this.disbursementDataSource[index]['expectedDisbursementDate']); + const expectedDisbursementDate: Date = this.dateUtils.parseDate( + this.disbursementDataSource[index]['expectedDisbursementDate'] + ); const data = { title: 'Edit Disbursement Details', @@ -167,7 +180,7 @@ export class LoanTrancheDetailsComponent implements OnInit { disbursementDialogRef.afterClosed().subscribe((response: any) => { if (response.data) { const newPrincipal = response.data.value.principal * 1; - if ((this.totalMultiDisbursed - principal + newPrincipal) <= this.currentPrincipalAmount) { + if (this.totalMultiDisbursed - principal + newPrincipal <= this.currentPrincipalAmount) { this.disbursementDataSource[index]['principal'] = newPrincipal; this.disbursementDataSource[index]['expectedDisbursementDate'] = response.data.value.expectedDisbursementDate; this.pristine = false; @@ -195,7 +208,10 @@ export class LoanTrancheDetailsComponent implements OnInit { const disbursementData: any = []; this.disbursementDataSource.forEach((item: any) => { disbursementData.push({ - expectedDisbursementDate: this.dateUtils.formatDate(item.expectedDisbursementDate, this.settingsService.dateFormat), + expectedDisbursementDate: this.dateUtils.formatDate( + item.expectedDisbursementDate, + this.settingsService.dateFormat + ), principal: item.principal }); }); @@ -205,10 +221,11 @@ export class LoanTrancheDetailsComponent implements OnInit { dateFormat: this.settingsService.dateFormat, locale: this.settingsService.language.code }; - this.loanServices.editDisbursements(this.loanId, payload).toPromise() - .then(result => { - this.pristine = true; - }); + this.loanServices + .editDisbursements(this.loanId, payload) + .toPromise() + .then((result) => { + this.pristine = true; + }); } - } diff --git a/src/app/loans/loans-view/loans-view.component.spec.ts b/src/app/loans/loans-view/loans-view.component.spec.ts index f3ab00e5f..3477396a6 100644 --- a/src/app/loans/loans-view/loans-view.component.spec.ts +++ b/src/app/loans/loans-view/loans-view.component.spec.ts @@ -8,9 +8,8 @@ describe('LoansViewComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoansViewComponent ] - }) - .compileComponents(); + declarations: [LoansViewComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/loans-view.component.ts b/src/app/loans/loans-view/loans-view.component.ts index c2b1366ff..4ada1128e 100644 --- a/src/app/loans/loans-view/loans-view.component.ts +++ b/src/app/loans/loans-view/loans-view.component.ts @@ -24,7 +24,6 @@ import { LoanTransaction } from 'app/products/loan-products/models/loan-account. styleUrls: ['./loans-view.component.scss'] }) export class LoansViewComponent implements OnInit { - /** Loan Details Data */ loanDetailsData: any; /** Loan Datatables */ @@ -51,29 +50,33 @@ export class LoansViewComponent implements OnInit { loanReAged = false; loanReAmortized = false; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, public loansService: LoansService, private translateService: TranslateService, - public dialog: MatDialog) { - this.route.data.subscribe((data: { loanDetailsData: any, loanDatatables: any, loanArrearsDelinquencyConfig: any }) => { - this.loanDetailsData = data.loanDetailsData; - this.loanDatatables = data.loanDatatables; - this.loanDisplayArrearsDelinquency = data.loanArrearsDelinquencyConfig.value || 0; - this.loanStatus = this.loanDetailsData.status; - this.currency = this.loanDetailsData.currency; - if (this.loanStatus.active) { - this.loanDetailsData.transactions.forEach((lt: LoanTransaction) => { - if (!lt.manuallyReversed) { - if (lt.type.reAge) { - this.loanReAged = true; - } else if (lt.type.reAmortize) { - this.loanReAmortized = true; + public dialog: MatDialog + ) { + this.route.data.subscribe( + (data: { loanDetailsData: any; loanDatatables: any; loanArrearsDelinquencyConfig: any }) => { + this.loanDetailsData = data.loanDetailsData; + this.loanDatatables = data.loanDatatables; + this.loanDisplayArrearsDelinquency = data.loanArrearsDelinquencyConfig.value || 0; + this.loanStatus = this.loanDetailsData.status; + this.currency = this.loanDetailsData.currency; + if (this.loanStatus.active) { + this.loanDetailsData.transactions.forEach((lt: LoanTransaction) => { + if (!lt.manuallyReversed) { + if (lt.type.reAge) { + this.loanReAged = true; + } else if (lt.type.reAmortize) { + this.loanReAmortized = true; + } } - } - }); + }); + } } - }); + ); this.loanId = this.route.snapshot.params['loanId']; this.clientId = this.loanDetailsData.clientId; } @@ -106,9 +109,8 @@ export class LoansViewComponent implements OnInit { this.buttonConfig = new LoansAccountButtonConfiguration(this.status); if (this.status === 'Submitted and pending approval') { - this.buttonConfig.addOption({ - name: (this.loanDetailsData.loanOfficerName ? 'Change Loan Officer' : 'Assign Loan Officer'), + name: this.loanDetailsData.loanOfficerName ? 'Change Loan Officer' : 'Assign Loan Officer', icon: 'user-tie', taskPermissionName: 'DISBURSE_LOAN' }); @@ -120,15 +122,12 @@ export class LoansViewComponent implements OnInit { taskPermissionName: 'ADJUST_REPAYMENT_SCHEDULE' }); } - } else if (this.status === 'Approved') { - this.buttonConfig.addButton({ - name: (this.loanDetailsData.loanOfficerName ? 'Change Loan Officer' : 'Assign Loan Officer'), + name: this.loanDetailsData.loanOfficerName ? 'Change Loan Officer' : 'Assign Loan Officer', icon: 'user-tie', taskPermissionName: 'DISBURSE_LOAN' }); - } else if (this.status === 'Active') { if (this.loanDetailsData.canDisburse || this.loanDetailsData.multiDisburseLoan) { this.buttonConfig.addButton({ @@ -196,13 +195,13 @@ export class LoansViewComponent implements OnInit { this.buttonConfig.addButton({ name: 'Re-Age', icon: 'calendar', - taskPermissionName: 'REAGE_LOAN', + taskPermissionName: 'REAGE_LOAN' }); } else { this.buttonConfig.addButton({ name: 'Undo Re-Age', icon: 'undo', - taskPermissionName: 'UNDO_REAGE_LOAN', + taskPermissionName: 'UNDO_REAGE_LOAN' }); } @@ -210,13 +209,13 @@ export class LoansViewComponent implements OnInit { this.buttonConfig.addButton({ name: 'Re-Amortize', icon: 'calendar-alt', - taskPermissionName: 'REAMORTIZE_LOAN', + taskPermissionName: 'REAMORTIZE_LOAN' }); } else { this.buttonConfig.addButton({ name: 'Undo Re-Amortize', icon: 'undo', - taskPermissionName: 'UNDO_REAMORTIZE_LOAN', + taskPermissionName: 'UNDO_REAMORTIZE_LOAN' }); } } @@ -235,7 +234,10 @@ export class LoansViewComponent implements OnInit { break; case 'Transfer Funds': const queryParams: any = { loanId: this.loanId, accountType: 'fromloans' }; - this.router.navigate(['transfer-funds/make-account-transfer'], { relativeTo: this.route, queryParams: queryParams }); + this.router.navigate(['transfer-funds/make-account-transfer'], { + relativeTo: this.route, + queryParams: queryParams + }); break; case 'Undo Re-Age': case 'Undo Re-Amortize': @@ -249,7 +251,13 @@ export class LoansViewComponent implements OnInit { data: this.loanDetailsData } }; - this.router.navigate(['actions', actionName], navigationExtras); + this.router.navigate( + [ + 'actions', + actionName + ], + navigationExtras + ); break; } } @@ -259,7 +267,13 @@ export class LoansViewComponent implements OnInit { */ private recoverFromGuarantor() { const recoverFromGuarantorDialogRef = this.dialog.open(ConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Recover from Guarantor'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want recover from Guarantor'), type: 'Mild' } + data: { + heading: this.translateService.instant('labels.heading.Recover from Guarantor'), + dialogContext: this.translateService.instant( + 'labels.dialogContext.Are you sure you want recover from Guarantor' + ), + type: 'Mild' + } }); recoverFromGuarantorDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { @@ -286,7 +300,10 @@ export class LoansViewComponent implements OnInit { const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: this.translateService.instant('labels.heading.Undo Transaction'), - dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') + ' ' + this.translateService.instant('labels.menus.' + actionName) + dialogContext: + this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') + + ' ' + + this.translateService.instant('labels.menus.' + actionName) } }); undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => { @@ -340,8 +357,8 @@ export class LoansViewComponent implements OnInit { private reload() { const clientId = this.clientId; const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true }) + this.router + .navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } - } diff --git a/src/app/loans/loans-view/notes-tab/notes-tab.component.spec.ts b/src/app/loans/loans-view/notes-tab/notes-tab.component.spec.ts index add42af72..338a5d831 100644 --- a/src/app/loans/loans-view/notes-tab/notes-tab.component.spec.ts +++ b/src/app/loans/loans-view/notes-tab/notes-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('NotesTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ NotesTabComponent ] - }) - .compileComponents(); + declarations: [NotesTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/notes-tab/notes-tab.component.ts b/src/app/loans/loans-view/notes-tab/notes-tab.component.ts index b6fd84138..6fcb6e9d6 100644 --- a/src/app/loans/loans-view/notes-tab/notes-tab.component.ts +++ b/src/app/loans/loans-view/notes-tab/notes-tab.component.ts @@ -13,14 +13,15 @@ import { AuthenticationService } from '../../../core/authentication/authenticati styleUrls: ['./notes-tab.component.scss'] }) export class NotesTabComponent { - entityId: string; username: string; entityNotes: any; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private loansService: LoansService, - private authenticationService: AuthenticationService) { + private authenticationService: AuthenticationService + ) { const savedCredentials = this.authenticationService.getCredentials(); this.username = savedCredentials.username; this.entityId = this.route.parent.snapshot.params['loanId']; @@ -47,10 +48,8 @@ export class NotesTabComponent { } deleteNote(noteId: string, index: number) { - this.loansService.deleteLoanNote(this.entityId, noteId) - .subscribe(() => { - this.entityNotes.splice(index, 1); + this.loansService.deleteLoanNote(this.entityId, noteId).subscribe(() => { + this.entityNotes.splice(index, 1); }); } - } diff --git a/src/app/loans/loans-view/original-schedule-tab/original-schedule-tab.component.spec.ts b/src/app/loans/loans-view/original-schedule-tab/original-schedule-tab.component.spec.ts index c969d75d4..d7677529c 100644 --- a/src/app/loans/loans-view/original-schedule-tab/original-schedule-tab.component.spec.ts +++ b/src/app/loans/loans-view/original-schedule-tab/original-schedule-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('OriginalScheduleTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ OriginalScheduleTabComponent ] - }) - .compileComponents(); + declarations: [OriginalScheduleTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/original-schedule-tab/original-schedule-tab.component.ts b/src/app/loans/loans-view/original-schedule-tab/original-schedule-tab.component.ts index 4334a20ff..a3ff96f67 100644 --- a/src/app/loans/loans-view/original-schedule-tab/original-schedule-tab.component.ts +++ b/src/app/loans/loans-view/original-schedule-tab/original-schedule-tab.component.ts @@ -8,11 +8,19 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./original-schedule-tab.component.scss'] }) export class OriginalScheduleTabComponent { - /** Loan Details Data */ originalScheduleDetails: any; /** Columns to be displayed in original schedule table. */ - displayedColumns: string[] = ['number', 'date', 'balanceOfLoan', 'principalDue', 'interest', 'fees', 'penalties', 'outstanding']; + displayedColumns: string[] = [ + 'number', + 'date', + 'balanceOfLoan', + 'principalDue', + 'interest', + 'fees', + 'penalties', + 'outstanding' + ]; currency: Currency | null = null; @@ -26,5 +34,4 @@ export class OriginalScheduleTabComponent { this.originalScheduleDetails = data.loanDetailsData.originalSchedule; }); } - } diff --git a/src/app/loans/loans-view/overdue-charges-tab/overdue-charges-tab.component.spec.ts b/src/app/loans/loans-view/overdue-charges-tab/overdue-charges-tab.component.spec.ts index 039848ad7..b76c76fde 100644 --- a/src/app/loans/loans-view/overdue-charges-tab/overdue-charges-tab.component.spec.ts +++ b/src/app/loans/loans-view/overdue-charges-tab/overdue-charges-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('OverdueChargesTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ OverdueChargesTabComponent ] - }) - .compileComponents(); + declarations: [OverdueChargesTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/overdue-charges-tab/overdue-charges-tab.component.ts b/src/app/loans/loans-view/overdue-charges-tab/overdue-charges-tab.component.ts index 1dda9da7d..5a936cac4 100644 --- a/src/app/loans/loans-view/overdue-charges-tab/overdue-charges-tab.component.ts +++ b/src/app/loans/loans-view/overdue-charges-tab/overdue-charges-tab.component.ts @@ -14,14 +14,18 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./overdue-charges-tab.component.scss'] }) export class OverdueChargesTabComponent implements OnInit { - /** Stores the resolved loan data */ loanDetails: any; /** Stores the overdue data */ overdueCharges: any; /** Columns to be displayed in overdue charges table. */ - displayedColumns: string[] = ['name', 'type', 'amount', 'collectedon']; + displayedColumns: string[] = [ + 'name', + 'type', + 'amount', + 'collectedon' + ]; /** Data source for codes table. */ dataSource: MatTableDataSource; @@ -35,7 +39,7 @@ export class OverdueChargesTabComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.parent.data.subscribe(( data: { loanDetailsData: any }) => { + this.route.parent.data.subscribe((data: { loanDetailsData: any }) => { this.loanDetails = data.loanDetailsData; }); } @@ -46,5 +50,4 @@ export class OverdueChargesTabComponent implements OnInit { this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.spec.ts b/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.spec.ts index f78fc41b0..a5607c93e 100644 --- a/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.spec.ts +++ b/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('RepaymentScheduleTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RepaymentScheduleTabComponent ] - }) - .compileComponents(); + declarations: [RepaymentScheduleTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.ts b/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.ts index b00505cb1..cca237e71 100644 --- a/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.ts +++ b/src/app/loans/loans-view/repayment-schedule-tab/repayment-schedule-tab.component.ts @@ -4,7 +4,7 @@ import { Dates } from 'app/core/utils/dates'; import { RepaymentSchedulePeriod } from 'app/loans/models/loan-account.model'; import { SettingsService } from 'app/settings/settings.service'; -import {jsPDF, jsPDFOptions} from 'jspdf'; +import { jsPDF, jsPDFOptions } from 'jspdf'; import autoTable from 'jspdf-autotable'; @Component({ @@ -13,7 +13,6 @@ import autoTable from 'jspdf-autotable'; styleUrls: ['./repayment-schedule-tab.component.scss'] }) export class RepaymentScheduleTabComponent implements OnInit { - /** Currency Code */ @Input() currencyCode: string; /** Loan Repayment Schedule to be Edited */ @@ -25,9 +24,34 @@ export class RepaymentScheduleTabComponent implements OnInit { /** Stores if there is any waived amount */ isWaived: boolean; /** Columns to be displayed in original schedule table. */ - displayedColumns: string[] = ['number', 'days', 'date', 'paiddate', 'check', 'balanceOfLoan', 'principalDue', 'interest', 'fees', 'penalties', 'due', 'paid', 'inadvance', 'late', 'waived', 'outstanding']; + displayedColumns: string[] = [ + 'number', + 'days', + 'date', + 'paiddate', + 'check', + 'balanceOfLoan', + 'principalDue', + 'interest', + 'fees', + 'penalties', + 'due', + 'paid', + 'inadvance', + 'late', + 'waived', + 'outstanding' + ]; /** Columns to be displayed in editable schedule table. */ - displayedColumnsEdit: string[] = ['number', 'date', 'balanceOfLoan', 'principalDue', 'interest', 'fees', 'due']; + displayedColumnsEdit: string[] = [ + 'number', + 'date', + 'balanceOfLoan', + 'principalDue', + 'interest', + 'fees', + 'due' + ]; /** Form functions event */ @Output() editPeriod = new EventEmitter(); @@ -38,7 +62,8 @@ export class RepaymentScheduleTabComponent implements OnInit { * Retrieves the loans with associations data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private settingsService: SettingsService, private dates: Dates ) { @@ -106,13 +131,17 @@ export class RepaymentScheduleTabComponent implements OnInit { autoTable(pdf, { html: '#repaymentSchedule', - bodyStyles: {lineColor: [0, 0, 0]}, + bodyStyles: { lineColor: [ + 0, + 0, + 0 + ] }, styles: { - fontSize: 8, - cellWidth: 'auto', - halign: 'center' - }}); + fontSize: 8, + cellWidth: 'auto', + halign: 'center' + } + }); pdf.save(fileName); } - } diff --git a/src/app/loans/loans-view/reschedule-loan-tab/reschedule-loan-tab.component.spec.ts b/src/app/loans/loans-view/reschedule-loan-tab/reschedule-loan-tab.component.spec.ts index 0313206b9..a4eb51ac9 100644 --- a/src/app/loans/loans-view/reschedule-loan-tab/reschedule-loan-tab.component.spec.ts +++ b/src/app/loans/loans-view/reschedule-loan-tab/reschedule-loan-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('RescheduleLoanTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ RescheduleLoanTabComponent ] - }) - .compileComponents(); + declarations: [RescheduleLoanTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/loans/loans-view/reschedule-loan-tab/reschedule-loan-tab.component.ts b/src/app/loans/loans-view/reschedule-loan-tab/reschedule-loan-tab.component.ts index 6f60fd1f5..353ecf1ea 100644 --- a/src/app/loans/loans-view/reschedule-loan-tab/reschedule-loan-tab.component.ts +++ b/src/app/loans/loans-view/reschedule-loan-tab/reschedule-loan-tab.component.ts @@ -17,16 +17,24 @@ export class RescheduleLoanTabComponent { @Input() loanStatus: LoanStatus; loanRescheduleData: any; - loanRescheduleDataColumns: string[] = ['id', 'rescheduleFromDate', 'reason', 'status', 'actions']; + loanRescheduleDataColumns: string[] = [ + 'id', + 'rescheduleFromDate', + 'reason', + 'status', + 'actions' + ]; clientId: any; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private loansServices: LoansService, private settingsService: SettingsService, private dateUtils: Dates, private translateService: TranslateService, - private dialog: MatDialog) { + private dialog: MatDialog + ) { this.clientId = this.route.parent.parent.snapshot.paramMap.get('clientId'); this.route.parent.data.subscribe((data: { loanRescheduleData: any }) => { this.loanRescheduleData = data.loanRescheduleData; @@ -35,7 +43,14 @@ export class RescheduleLoanTabComponent { manageRequest(request: any, command: string): void { const approveLoanRescheduleDialogRef = this.dialog.open(ConfirmationDialogComponent, { - data: { heading: `${command}` + this.translateService.instant('labels.heading.Loan Reschedule'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want') + `${command}` + this.translateService.instant('labels.dialogContext.the Loan Reschedule') + `${request.id}` } + data: { + heading: `${command}` + this.translateService.instant('labels.heading.Loan Reschedule'), + dialogContext: + this.translateService.instant('labels.dialogContext.Are you sure you want') + + `${command}` + + this.translateService.instant('labels.dialogContext.the Loan Reschedule') + + `${request.id}` + } }); approveLoanRescheduleDialogRef.afterClosed().subscribe((response: { confirm: any }) => { if (response.confirm) { @@ -50,9 +65,11 @@ export class RescheduleLoanTabComponent { } else { payload['rejectedOnDate'] = this.dateUtils.formatDate(this.settingsService.businessDate, dateFormat); } - this.loansServices.applyCommandLoanRescheduleRequests(request.id, command.toLowerCase(), payload).subscribe((result: any) => { - this.reload(); - }); + this.loansServices + .applyCommandLoanRescheduleRequests(request.id, command.toLowerCase(), payload) + .subscribe((result: any) => { + this.reload(); + }); } }); } @@ -62,7 +79,8 @@ export class RescheduleLoanTabComponent { */ private reload() { const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${this.clientId}/loans-accounts`, { skipLocationChange: true }) + this.router + .navigateByUrl(`/clients/${this.clientId}/loans-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } } diff --git a/src/app/loans/loans-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts b/src/app/loans/loans-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts index f3997e094..5a482658c 100644 --- a/src/app/loans/loans-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts +++ b/src/app/loans/loans-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('StandingInstructionsTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ StandingInstructionsTabComponent ] - }) - .compileComponents(); + declarations: [StandingInstructionsTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/standing-instructions-tab/standing-instructions-tab.component.ts b/src/app/loans/loans-view/standing-instructions-tab/standing-instructions-tab.component.ts index 410462e0d..d874bf2eb 100644 --- a/src/app/loans/loans-view/standing-instructions-tab/standing-instructions-tab.component.ts +++ b/src/app/loans/loans-view/standing-instructions-tab/standing-instructions-tab.component.ts @@ -21,7 +21,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./standing-instructions-tab.component.scss'] }) export class StandingInstructionsTabComponent implements OnInit { - /** Loans Data */ loanDetailsData: any; /** Instructions Data */ @@ -29,7 +28,15 @@ export class StandingInstructionsTabComponent implements OnInit { /** Data source for instructions table. */ dataSource = new MatTableDataSource(); /** Columns to be displayed in instructions table. */ - displayedColumns: string[] = ['client', 'fromAccount', 'beneficiary', 'toAccount', 'amount', 'validity', 'actions']; + displayedColumns: string[] = [ + 'client', + 'fromAccount', + 'beneficiary', + 'toAccount', + 'amount', + 'validity', + 'actions' + ]; /** Instruction Table Reference */ @ViewChild('instructionsTable', { static: true }) instructionTableRef: MatTable; @@ -39,11 +46,13 @@ export class StandingInstructionsTabComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {SettingsService} settingsService Settings Service */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private loansService: LoansService, private dialog: MatDialog, private accountTransfersService: AccountTransfersService, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.route.parent.data.subscribe((data: { loanDetailsData: any }) => { this.loanDetailsData = data.loanDetailsData; }); @@ -62,11 +71,13 @@ export class StandingInstructionsTabComponent implements OnInit { const accountId = this.loanDetailsData.id; const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; - this.loansService.getStandingInstructions(clientId, clientName, accountId, locale, dateFormat).subscribe((response: any) => { - this.instructionsData = response.pageItems; - this.dataSource.data = this.instructionsData; - this.instructionTableRef.renderRows(); - }); + this.loansService + .getStandingInstructions(clientId, clientName, accountId, locale, dateFormat) + .subscribe((response: any) => { + this.instructionsData = response.pageItems; + this.dataSource.data = this.instructionsData; + this.instructionTableRef.renderRows(); + }); } deleteStandingInstruction(instructionId: any) { @@ -75,10 +86,8 @@ export class StandingInstructionsTabComponent implements OnInit { }); deleteStandingInstructionDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.accountTransfersService.deleteStandingInstrucions(instructionId) - .subscribe(() => { }); + this.accountTransfersService.deleteStandingInstrucions(instructionId).subscribe(() => {}); } }); } - } diff --git a/src/app/loans/loans-view/transactions-tab/transactions-tab.component.spec.ts b/src/app/loans/loans-view/transactions-tab/transactions-tab.component.spec.ts index a67fc2279..0175d84c6 100644 --- a/src/app/loans/loans-view/transactions-tab/transactions-tab.component.spec.ts +++ b/src/app/loans/loans-view/transactions-tab/transactions-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('TransactionsTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ TransactionsTabComponent ] - }) - .compileComponents(); + declarations: [TransactionsTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts b/src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts index d5ef3fe0d..a1f9a9b99 100644 --- a/src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts +++ b/src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts @@ -19,7 +19,6 @@ import { LoanTransactionType } from 'app/loans/models/loan-transaction-type.mode styleUrls: ['./transactions-tab.component.scss'] }) export class TransactionsTabComponent implements OnInit { - /** Loan Details Data */ transactionsData: LoanTransaction[] = []; /** Form control to handle accural parameter */ @@ -28,9 +27,42 @@ export class TransactionsTabComponent implements OnInit { /** Stores the status of the loan account */ status: string; /** Columns to be displayed in original schedule table. */ - displayedColumns: string[] = ['row', 'id', 'office', 'externalId', 'date', 'transactionType', 'amount', 'principal', 'interest', 'fee', 'penalties', 'loanBalance', 'actions']; - displayedHeader1Columns: string[] = ['h1-row', 'h1-id', 'h1-office', 'h1-external-id', 'h1-transaction-date', 'h1-transaction-type', 'h1-space', 'h1-breakdown', 'h1-loan-balance', 'h1-actions']; - displayedHeader2Columns: string[] = ['h2-space', 'h2-amount', 'h2-principal', 'h2-interest', 'h2-fees', 'h2-penalties', 'h2-action']; + displayedColumns: string[] = [ + 'row', + 'id', + 'office', + 'externalId', + 'date', + 'transactionType', + 'amount', + 'principal', + 'interest', + 'fee', + 'penalties', + 'loanBalance', + 'actions' + ]; + displayedHeader1Columns: string[] = [ + 'h1-row', + 'h1-id', + 'h1-office', + 'h1-external-id', + 'h1-transaction-date', + 'h1-transaction-type', + 'h1-space', + 'h1-breakdown', + 'h1-loan-balance', + 'h1-actions' + ]; + displayedHeader2Columns: string[] = [ + 'h2-space', + 'h2-amount', + 'h2-principal', + 'h2-interest', + 'h2-fees', + 'h2-penalties', + 'h2-action' + ]; dataSource: MatTableDataSource; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @@ -41,13 +73,15 @@ export class TransactionsTabComponent implements OnInit { * Retrieves the loans with associations data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private dateUtils: Dates, private router: Router, private dialog: MatDialog, private loansService: LoansService, private translateService: TranslateService, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.route.parent.parent.data.subscribe((data: { loanDetailsData: any }) => { this.transactionsData = data.loanDetailsData.transactions; this.status = data.loanDetailsData.status.value; @@ -74,8 +108,13 @@ export class TransactionsTabComponent implements OnInit { * Checks Status of the loan account */ checkStatus() { - if (this.status === 'Active' || this.status === 'Closed (obligations met)' || this.status === 'Overpaid' || - this.status === 'Closed (rescheduled)' || this.status === 'Closed (written off)') { + if ( + this.status === 'Active' || + this.status === 'Closed (obligations met)' || + this.status === 'Overpaid' || + this.status === 'Closed (rescheduled)' || + this.status === 'Closed (written off)' + ) { return true; } return false; @@ -94,7 +133,7 @@ export class TransactionsTabComponent implements OnInit { if (hideAccrual || hideReversed) { transactions = this.transactionsData.filter((t: LoanTransaction) => { - return (!(hideReversed && t.manuallyReversed) && !(hideAccrual && t.type.accrual)); + return !(hideReversed && t.manuallyReversed) && !(hideAccrual && t.type.accrual); }); } this.dataSource = new MatTableDataSource(transactions); @@ -136,7 +175,22 @@ export class TransactionsTabComponent implements OnInit { * INTEREST REFUND:33 */ showTransactions(transactionsData: LoanTransaction) { - if ([1, 2, 4, 9, 20, 21, 22, 23, 26, 28, 29, 30, 31, 33].includes(transactionsData.type.id)) { + if ([ + 1, + 2, + 4, + 9, + 20, + 21, + 22, + 23, + 26, + 28, + 29, + 30, + 31, + 33 + ].includes(transactionsData.type.id)) { this.router.navigate([transactionsData.id], { relativeTo: this.route }); } } @@ -145,9 +199,12 @@ export class TransactionsTabComponent implements OnInit { if (transaction.manuallyReversed) { return false; } - return !(transaction.type.disbursement || transaction.type.chargeoff || this.isReAgoeOrReAmortize(transaction.type) - || transaction.type.interestRefund - ); + return !( + transaction.type.disbursement || + transaction.type.chargeoff || + this.isReAgoeOrReAmortize(transaction.type) || + transaction.type.interestRefund + ); } loanTransactionColor(transaction: LoanTransaction): string { @@ -209,8 +266,13 @@ export class TransactionsTabComponent implements OnInit { } const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Undo Transaction'), - dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') + `${transaction.type.value}` + this.translateService.instant('labels.dialogContext.with id') + `${transaction.id}` + data: { + heading: this.translateService.instant('labels.heading.Undo Transaction'), + dialogContext: + this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') + + `${transaction.type.value}` + + this.translateService.instant('labels.dialogContext.with id') + + `${transaction.id}` } }); undoTransactionAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => { @@ -219,10 +281,12 @@ export class TransactionsTabComponent implements OnInit { if (this.isChargeOff(transaction.type)) { transactionId = null; } - this.loansService.executeLoansAccountTransactionsCommand(loanId, command, payload, transactionId).subscribe((responseCmd: any) => { - transaction.manuallyReversed = true; - this.reload(); - }); + this.loansService + .executeLoansAccountTransactionsCommand(loanId, command, payload, transactionId) + .subscribe((responseCmd: any) => { + transaction.manuallyReversed = true; + this.reload(); + }); } }); } @@ -232,7 +296,10 @@ export class TransactionsTabComponent implements OnInit { const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: this.translateService.instant('labels.heading.Undo Transaction'), - dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') + ' ' + this.translateService.instant('labels.menus.' + actionName) + dialogContext: + this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') + + ' ' + + this.translateService.instant('labels.menus.' + actionName) } }); undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => { @@ -246,23 +313,23 @@ export class TransactionsTabComponent implements OnInit { } private isAccrual(transactionType: LoanTransactionType): boolean { - return (transactionType.accrual || transactionType.code === 'loanTransactionType.overdueCharge'); + return transactionType.accrual || transactionType.code === 'loanTransactionType.overdueCharge'; } private isChargeOff(transactionType: LoanTransactionType): boolean { - return (transactionType.chargeoff || transactionType.code === 'loanTransactionType.chargeOff'); + return transactionType.chargeoff || transactionType.code === 'loanTransactionType.chargeOff'; } private isDownPayment(transactionType: LoanTransactionType): boolean { - return (transactionType.downPayment || transactionType.code === 'loanTransactionType.downPayment'); + return transactionType.downPayment || transactionType.code === 'loanTransactionType.downPayment'; } private isReAge(transactionType: LoanTransactionType): boolean { - return (transactionType.reAge || transactionType.code === 'loanTransactionType.reAge'); + return transactionType.reAge || transactionType.code === 'loanTransactionType.reAge'; } private isReAmortize(transactionType: LoanTransactionType): boolean { - return (transactionType.reAmortize || transactionType.code === 'loanTransactionType.reAmortize'); + return transactionType.reAmortize || transactionType.code === 'loanTransactionType.reAmortize'; } private isReAgoeOrReAmortize(transactionType: LoanTransactionType): boolean { @@ -276,7 +343,8 @@ export class TransactionsTabComponent implements OnInit { private reload() { const clientId = this.route.parent.parent.snapshot.params['clientId']; const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true }) + this.router + .navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } @@ -286,5 +354,4 @@ export class TransactionsTabComponent implements OnInit { } return true; } - } diff --git a/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.spec.ts b/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.spec.ts index abea649f7..7e486c2ea 100644 --- a/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.spec.ts +++ b/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.spec.ts @@ -8,9 +8,8 @@ describe('EditTransactionComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditTransactionComponent ] - }) - .compileComponents(); + declarations: [EditTransactionComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.ts b/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.ts index b4ace495d..063766107 100644 --- a/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.ts +++ b/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.ts @@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./edit-transaction.component.scss'] }) export class EditTransactionComponent implements OnInit { - /** Minimum Due Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Due Date allowed. */ @@ -27,11 +26,11 @@ export class EditTransactionComponent implements OnInit { editTransactionForm: UntypedFormGroup; /** loans account transaction payment options. */ paymentTypeOptions: { - id: number, - name: string, - description: string, - isCashPayment: boolean, - position: number + id: number; + name: string; + description: string; + isCashPayment: boolean; + position: number; }[]; /** Flag to enable payment details fields. */ showPaymentDetails: Boolean = false; @@ -50,12 +49,14 @@ export class EditTransactionComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private loansService: LoansService, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private loansService: LoansService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { loansAccountTransactionTemplate: any }) => { this.transactionTemplateData = data.loansAccountTransactionTemplate; if (data.loansAccountTransactionTemplate.currency) { @@ -73,10 +74,10 @@ export class EditTransactionComponent implements OnInit { this.maxDate = this.settingsService.businessDate; this.createEditTransactionForm(); this.editTransactionForm.patchValue({ - 'transactionDate': this.transactionTemplateData.date && new Date(this.transactionTemplateData.date), - 'transactionAmount': this.transactionTemplateData.amount, - 'externalId': this.transactionTemplateData.externalId, - 'paymentTypeId': this.transactionTemplateData.paymentTypeId + transactionDate: this.transactionTemplateData.date && new Date(this.transactionTemplateData.date), + transactionAmount: this.transactionTemplateData.amount, + externalId: this.transactionTemplateData.externalId, + paymentTypeId: this.transactionTemplateData.paymentTypeId }); } @@ -85,10 +86,16 @@ export class EditTransactionComponent implements OnInit { */ createEditTransactionForm() { this.editTransactionForm = this.formBuilder.group({ - 'transactionDate': ['', Validators.required], - 'transactionAmount': ['', Validators.required], - 'externalId': [''], - 'paymentTypeId': [''], + transactionDate: [ + '', + Validators.required + ], + transactionAmount: [ + '', + Validators.required + ], + externalId: [''], + paymentTypeId: [''] }); } @@ -129,10 +136,10 @@ export class EditTransactionComponent implements OnInit { locale }; data['transactionAmount'] = data['transactionAmount'] * 1; - this.loansService.executeLoansAccountTransactionsCommand(this.loanAccountId, 'modify', data, this.transactionTemplateData.id) + this.loansService + .executeLoansAccountTransactionsCommand(this.loanAccountId, 'modify', data, this.transactionTemplateData.id) .subscribe((res: any) => { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/loans/loans-view/transactions/export-transactions/export-transactions.component.spec.ts b/src/app/loans/loans-view/transactions/export-transactions/export-transactions.component.spec.ts index 9965db862..95f792263 100644 --- a/src/app/loans/loans-view/transactions/export-transactions/export-transactions.component.spec.ts +++ b/src/app/loans/loans-view/transactions/export-transactions/export-transactions.component.spec.ts @@ -8,9 +8,8 @@ describe('ExportTransactionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ExportTransactionsComponent ] - }) - .compileComponents(); + declarations: [ExportTransactionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/transactions/export-transactions/export-transactions.component.ts b/src/app/loans/loans-view/transactions/export-transactions/export-transactions.component.ts index e7c32eda6..83e4146ce 100644 --- a/src/app/loans/loans-view/transactions/export-transactions/export-transactions.component.ts +++ b/src/app/loans/loans-view/transactions/export-transactions/export-transactions.component.ts @@ -18,7 +18,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./export-transactions.component.scss'] }) export class ExportTransactionsComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -41,12 +40,14 @@ export class ExportTransactionsComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {SettingsService} settingsService Settings Service */ - constructor(private sanitizer: DomSanitizer, - private reportsService: ReportsService, - private formBuilder: UntypedFormBuilder, - private dateUtils: Dates, - private route: ActivatedRoute, - private settingsService: SettingsService) { + constructor( + private sanitizer: DomSanitizer, + private reportsService: ReportsService, + private formBuilder: UntypedFormBuilder, + private dateUtils: Dates, + private route: ActivatedRoute, + private settingsService: SettingsService + ) { this.route.parent.parent.data.subscribe((data: { loanDetailsData: any }) => { this.loansAccountId = data.loanDetailsData.accountNo; }); @@ -62,8 +63,14 @@ export class ExportTransactionsComponent implements OnInit { */ createTransactionsReportForm() { this.transactionsReportForm = this.formBuilder.group({ - 'fromDate': ['', Validators.required], - 'toDate': [this.settingsService.businessDate, Validators.required], + fromDate: [ + '', + Validators.required + ], + toDate: [ + this.settingsService.businessDate, + Validators.required + ] }); } @@ -73,19 +80,19 @@ export class ExportTransactionsComponent implements OnInit { generate() { const dateFormat = this.settingsService.dateFormat; const data = { - 'output-type': 'PDF', - R_startDate: this.dateUtils.formatDate(this.transactionsReportForm.value.fromDate, dateFormat), - R_endDate: this.dateUtils.formatDate(this.transactionsReportForm.value.toDate, dateFormat), - R_selectLoan: this.loansAccountId + 'output-type': 'PDF', + R_startDate: this.dateUtils.formatDate(this.transactionsReportForm.value.fromDate, dateFormat), + R_endDate: this.dateUtils.formatDate(this.transactionsReportForm.value.toDate, dateFormat), + R_selectLoan: this.loansAccountId }; - this.reportsService.getPentahoRunReportData('Client Loan Account Schedule', data, 'default', 'en', dateFormat) - .subscribe( (res: any) => { + this.reportsService + .getPentahoRunReportData('Client Loan Account Schedule', data, 'default', 'en', dateFormat) + .subscribe((res: any) => { const contentType = res.headers.get('Content-Type'); - const file = new Blob([res.body], {type: contentType}); + const file = new Blob([res.body], { type: contentType }); const filecontent = URL.createObjectURL(file); this.pentahoUrl = this.sanitizer.bypassSecurityTrustResourceUrl(filecontent); this.hideOutput = false; }); } - } diff --git a/src/app/loans/loans-view/transactions/view-reciept/view-reciept.component.spec.ts b/src/app/loans/loans-view/transactions/view-reciept/view-reciept.component.spec.ts index a831d071f..c4cce096a 100644 --- a/src/app/loans/loans-view/transactions/view-reciept/view-reciept.component.spec.ts +++ b/src/app/loans/loans-view/transactions/view-reciept/view-reciept.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewRecieptComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewRecieptComponent ] - }) - .compileComponents(); + declarations: [ViewRecieptComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/transactions/view-reciept/view-reciept.component.ts b/src/app/loans/loans-view/transactions/view-reciept/view-reciept.component.ts index 06c9944d0..59527e50d 100644 --- a/src/app/loans/loans-view/transactions/view-reciept/view-reciept.component.ts +++ b/src/app/loans/loans-view/transactions/view-reciept/view-reciept.component.ts @@ -12,7 +12,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-reciept.component.scss'] }) export class ViewRecieptComponent implements OnInit { - /** trusted resource url for pentaho output */ pentahoUrl: any; /** Transaction Reciept Data */ @@ -23,8 +22,10 @@ export class ViewRecieptComponent implements OnInit { * @param {DomSanitizer} sanitizer DOM Sanitizer * @param {ActivatedRoute} route Activated Route */ - constructor(private sanitizer: DomSanitizer, - private route: ActivatedRoute) { + constructor( + private sanitizer: DomSanitizer, + private route: ActivatedRoute + ) { this.route.data.subscribe((data: { loansTransactionReciept: any }) => { this.transactionRecieptData = data.loansTransactionReciept; }); @@ -32,9 +33,8 @@ export class ViewRecieptComponent implements OnInit { ngOnInit() { const contentType = this.transactionRecieptData.headers.get('Content-Type'); - const file = new Blob([this.transactionRecieptData.body], {type: contentType}); + const file = new Blob([this.transactionRecieptData.body], { type: contentType }); const filecontent = URL.createObjectURL(file); this.pentahoUrl = this.sanitizer.bypassSecurityTrustResourceUrl(filecontent); } - } diff --git a/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.spec.ts b/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.spec.ts index bbff0d11b..bed3c6ae6 100644 --- a/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.spec.ts +++ b/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewTransactionComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewTransactionComponent ] - }) - .compileComponents(); + declarations: [ViewTransactionComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.ts b/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.ts index 01c3e61d6..07118fb73 100644 --- a/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.ts +++ b/src/app/loans/loans-view/transactions/view-transaction/view-transaction.component.ts @@ -30,7 +30,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./view-transaction.component.scss'] }) export class ViewTransactionComponent implements OnInit { - /** Transaction data. */ transactionData: any; transactionType: LoanTransactionType; @@ -45,7 +44,11 @@ export class ViewTransactionComponent implements OnInit { paymentTypeOptions: {}[] = []; transactionRelations = new MatTableDataSource(); /** Columns to be displayed in Transaction Relations table. */ - displayedColumns: string[] = ['relationType', 'toTransaction', 'amount']; + displayedColumns: string[] = [ + 'relationType', + 'toTransaction', + 'amount' + ]; isFullRelated = false; amountRelationsAllowed = 0; @@ -62,7 +65,8 @@ export class ViewTransactionComponent implements OnInit { * @param {SettingsService} settingsService Settings Service * @param {AlertService} alertService Alert Service */ - constructor(private loansService: LoansService, + constructor( + private loansService: LoansService, private route: ActivatedRoute, private dateUtils: Dates, private router: Router, @@ -70,17 +74,20 @@ export class ViewTransactionComponent implements OnInit { private translateService: TranslateService, private settingsService: SettingsService, private organizationService: OrganizationService, - private alertService: AlertService) { + private alertService: AlertService + ) { this.route.data.subscribe((data: { loansAccountTransaction: any }) => { this.transactionData = data.loansAccountTransaction; this.transactionType = this.transactionData.type; - this.allowEdition = !this.transactionData.manuallyReversed && !this.allowTransactionEdition(this.transactionData.type.id); + this.allowEdition = + !this.transactionData.manuallyReversed && !this.allowTransactionEdition(this.transactionData.type.id); this.allowUndo = this.allowUndoTransaction(this.transactionData.manuallyReversed, this.transactionType); - this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.transactionData.manuallyReversed; + this.allowChargeback = + this.allowChargebackTransaction(this.transactionType) && !this.transactionData.manuallyReversed; let transactionsChargebackRelated = false; if (this.transactionData.transactionRelations) { this.transactionRelations.data = this.transactionData.transactionRelations; - this.existTransactionRelations = (this.transactionData.transactionRelations.length > 0); + this.existTransactionRelations = this.transactionData.transactionRelations.length > 0; let amountRelations = 0; this.transactionData.transactionRelations.forEach((relation: any) => { if (relation.relationType === 'CHARGEBACK') { @@ -89,13 +96,17 @@ export class ViewTransactionComponent implements OnInit { } }); this.amountRelationsAllowed = this.transactionData.amount - amountRelations; - this.isFullRelated = (this.amountRelationsAllowed === 0); + this.isFullRelated = this.amountRelationsAllowed === 0; this.allowChargeback = this.allowChargebackTransaction(this.transactionType) && !this.isFullRelated; } if (!this.allowChargeback) { this.allowEdition = false; } - if ((this.existTransactionRelations && transactionsChargebackRelated) || this.transactionType.reAge || this.transactionType.reAmortize) { + if ( + (this.existTransactionRelations && transactionsChargebackRelated) || + this.transactionType.reAge || + this.transactionType.reAmortize + ) { this.allowUndo = false; } }); @@ -106,8 +117,10 @@ export class ViewTransactionComponent implements OnInit { ngOnInit(): void { if (this.allowChargeback) { - this.organizationService.getPaymentTypesWithCode().toPromise() - .then(data => { + this.organizationService + .getPaymentTypesWithCode() + .toPromise() + .then((data) => { this.paymentTypeOptions = data; }); } @@ -117,15 +130,24 @@ export class ViewTransactionComponent implements OnInit { * Allow edit, undo and chargeback actions */ allowTransactionEdition(transactionType: number): boolean { - return (transactionType === 20 - || transactionType === 21 || transactionType === 22 - || transactionType === 23 || transactionType === 28); + return ( + transactionType === 20 || + transactionType === 21 || + transactionType === 22 || + transactionType === 23 || + transactionType === 28 + ); } allowChargebackTransaction(transactionType: LoanTransactionType): boolean { - return (transactionType.repayment || transactionType.interestPaymentWaiver - || transactionType.goodwillCredit || transactionType.payoutRefund - || transactionType.merchantIssuedRefund || transactionType.downPayment); + return ( + transactionType.repayment || + transactionType.interestPaymentWaiver || + transactionType.goodwillCredit || + transactionType.payoutRefund || + transactionType.merchantIssuedRefund || + transactionType.downPayment + ); } allowUndoTransaction(manuallyReversed: boolean, transactionType: LoanTransactionType): boolean { @@ -144,21 +166,31 @@ export class ViewTransactionComponent implements OnInit { undoTransaction() { const accountId = this.route.snapshot.params['loanId']; const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Undo Transaction'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction') + `${this.transactionData.id}` } + data: { + heading: this.translateService.instant('labels.heading.Undo Transaction'), + dialogContext: + this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction') + + `${this.transactionData.id}` + } }); undoTransactionAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => { if (response.confirm) { const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; const data = { - transactionDate: this.dateUtils.formatDate(this.transactionData.date && new Date(this.transactionData.date), dateFormat), + transactionDate: this.dateUtils.formatDate( + this.transactionData.date && new Date(this.transactionData.date), + dateFormat + ), transactionAmount: 0, dateFormat, locale }; - this.loansService.executeLoansAccountTransactionsCommand(accountId, 'undo', data, this.transactionData.id).subscribe(() => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.loansService + .executeLoansAccountTransactionsCommand(accountId, 'undo', data, this.transactionData.id) + .subscribe(() => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } }); } @@ -183,6 +215,7 @@ export class ViewTransactionComponent implements OnInit { max: this.amountRelationsAllowed, order: 2 }) + ]; const data = { title: `Chargeback ${this.transactionType.value} Transaction`, @@ -199,9 +232,11 @@ export class ViewTransactionComponent implements OnInit { paymentTypeId: response.data.value.paymentTypeId, locale }; - this.loansService.executeLoansAccountTransactionsCommand(accountId, 'chargeback', payload, this.transactionData.id).subscribe(() => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.loansService + .executeLoansAccountTransactionsCommand(accountId, 'chargeback', payload, this.transactionData.id) + .subscribe(() => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } else { this.alertService.alert({ type: 'BusinessRule', @@ -225,5 +260,4 @@ export class ViewTransactionComponent implements OnInit { } return 'active'; } - } diff --git a/src/app/loans/loans-view/view-charge/view-charge.component.spec.ts b/src/app/loans/loans-view/view-charge/view-charge.component.spec.ts index 6c6e3739c..d40f3ae62 100644 --- a/src/app/loans/loans-view/view-charge/view-charge.component.spec.ts +++ b/src/app/loans/loans-view/view-charge/view-charge.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewChargeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewChargeComponent ] - }) - .compileComponents(); + declarations: [ViewChargeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/loans/loans-view/view-charge/view-charge.component.ts b/src/app/loans/loans-view/view-charge/view-charge.component.ts index da1c404e0..173d4001c 100644 --- a/src/app/loans/loans-view/view-charge/view-charge.component.ts +++ b/src/app/loans/loans-view/view-charge/view-charge.component.ts @@ -28,7 +28,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./view-charge.component.scss'] }) export class ViewChargeComponent { - /** Charge data. */ chargeData: any; /** Loans Account Data */ @@ -45,16 +44,18 @@ export class ViewChargeComponent { * @param {Dates} dateUtils Date Utils. * @param {SettingsService} settingsService Settings Service */ - constructor(private loansService: LoansService, + constructor( + private loansService: LoansService, private route: ActivatedRoute, private dateUtils: Dates, private router: Router, private translateService: TranslateService, public dialog: MatDialog, - private settingsService: SettingsService) { - this.route.data.subscribe((data: { loansAccountCharge: any, loanDetailsData: any }) => { + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { loansAccountCharge: any; loanDetailsData: any }) => { this.chargeData = data.loansAccountCharge; - this.allowPayCharge = (this.chargeData.chargePayable && !this.chargeData.paid); + this.allowPayCharge = this.chargeData.chargePayable && !this.chargeData.paid; this.allowWaive = !this.chargeData.chargeTimeType.waived; this.loansAccountData = data.loanDetailsData; }); @@ -72,6 +73,7 @@ export class ViewChargeComponent { type: 'date', required: true }) + ]; const data = { title: `Pay Charge ${this.chargeData.id}`, @@ -89,7 +91,8 @@ export class ViewChargeComponent { dateFormat, locale }; - this.loansService.executeLoansAccountChargesCommand(this.chargeData.loanId, 'pay', dataObject, this.chargeData.id) + this.loansService + .executeLoansAccountChargesCommand(this.chargeData.loanId, 'pay', dataObject, this.chargeData.id) .subscribe(() => { this.reload(); }); @@ -101,10 +104,19 @@ export class ViewChargeComponent { * Waive's the charge */ waiveCharge() { - const waiveChargeDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: this.translateService.instant('labels.heading.Waive Charge'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id:')` ${this.chargeData.id}`, type: 'Basic' } }); + const waiveChargeDialogRef = this.dialog.open(ConfirmationDialogComponent, { + data: { + heading: this.translateService.instant('labels.heading.Waive Charge'), + dialogContext: this.translateService.instant( + 'labels.dialogContext.Are you sure you want to waive charge with id:' + )` ${this.chargeData.id}`, + type: 'Basic' + } + }); waiveChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.loansService.executeLoansAccountChargesCommand(this.chargeData.loanId, 'waive', {}, this.chargeData.id) + this.loansService + .executeLoansAccountChargesCommand(this.chargeData.loanId, 'waive', {}, this.chargeData.id) .subscribe(() => { this.reload(); }); @@ -132,6 +144,7 @@ export class ViewChargeComponent { maxDate: this.settingsService.maxAllowedDate, required: true }) + ]; const data = { title: 'Edit Charge', @@ -151,7 +164,8 @@ export class ViewChargeComponent { dateFormat, locale }; - this.loansService.editLoansAccountCharge(this.loansAccountData.id, dataObject, this.chargeData.id) + this.loansService + .editLoansAccountCharge(this.loansAccountData.id, dataObject, this.chargeData.id) .subscribe(() => { this.reload(); }); @@ -168,10 +182,9 @@ export class ViewChargeComponent { }); deleteChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.loansService.deleteLoansAccountCharge(this.loansAccountData.id, this.chargeData.id) - .subscribe(() => { - this.reload(); - }); + this.loansService.deleteLoansAccountCharge(this.loansAccountData.id, this.chargeData.id).subscribe(() => { + this.reload(); + }); } }); } @@ -191,8 +204,8 @@ export class ViewChargeComponent { private reload() { const clientId = this.loansAccountData.clientId; const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true }) + this.router + .navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } - } diff --git a/src/app/loans/loans.module.ts b/src/app/loans/loans.module.ts index 99e59db85..4cf4d0bbb 100644 --- a/src/app/loans/loans.module.ts +++ b/src/app/loans/loans.module.ts @@ -173,6 +173,6 @@ import { AddInterestPauseComponent } from './loans-view/loan-account-actions/add LoanTermVariationsTabComponent, AddInterestPauseComponent ], - providers: [ ], + providers: [] }) export class LoansModule {} diff --git a/src/app/loans/loans.service.ts b/src/app/loans/loans.service.ts index fae5ce905..0fbf95b5a 100644 --- a/src/app/loans/loans.service.ts +++ b/src/app/loans/loans.service.ts @@ -14,9 +14,11 @@ import { SettingsService } from 'app/settings/settings.service'; providedIn: 'root' }) export class LoansService { - constructor(private http: HttpClient, + constructor( + private http: HttpClient, private settingsService: SettingsService, - private dateUtils: Dates) { } + private dateUtils: Dates + ) {} /** * @param {string} loanId loanId of the loan. * @returns {Observable} @@ -34,7 +36,8 @@ export class LoansService { if (!transactionDate) { transactionDate = this.dateUtils.formatDate(this.settingsService.businessDate, this.settingsService.dateFormat); } - const httpParams = new HttpParams().set('command', 'prepayLoan') + const httpParams = new HttpParams() + .set('command', 'prepayLoan') .set('transactionDate', transactionDate) .set('locale', this.settingsService.language.code) .set('dateFormat', this.settingsService.dateFormat); @@ -46,7 +49,10 @@ export class LoansService { .set('command', 'foreclosure') .set('locale', this.settingsService.language.code) .set('dateFormat', this.settingsService.dateFormat) - .set('transactionDate', this.dateUtils.formatDate(this.settingsService.businessDate, this.settingsService.dateFormat)); + .set( + 'transactionDate', + this.dateUtils.formatDate(this.settingsService.businessDate, this.settingsService.dateFormat) + ); return this.http.get(`/loans/${loanId}/transactions/template`, { params: httpParams }); } @@ -76,9 +82,7 @@ export class LoansService { } getDelinquencyData(loanId: string) { - const httpParams = new HttpParams() - .set('associations', 'collection') - .set('exclude', 'guarantors,futureSchedule'); + const httpParams = new HttpParams().set('associations', 'collection').set('exclude', 'guarantors,futureSchedule'); return this.http.get(`/loans/${loanId}`, { params: httpParams }); } @@ -151,15 +155,12 @@ export class LoansService { * @param loanId Loan ID */ getLoanAccountAssociationDetails(loanId: string) { - const httpParams = new HttpParams() - .set('associations', 'all') - .set('exclude', 'guarantors,futureSchedule'); + const httpParams = new HttpParams().set('associations', 'all').set('exclude', 'guarantors,futureSchedule'); return this.http.get(`/loans/${loanId}`, { params: httpParams }); } getApproveAssociationsDetails(loanId: any) { - const httpParams = new HttpParams() - .set('associations', 'multiDisburseDetails'); + const httpParams = new HttpParams().set('associations', 'multiDisburseDetails'); return this.http.get(`/loans/${loanId}`, { params: httpParams }); } /** @@ -212,8 +213,7 @@ export class LoansService { } getLoanScreenReportsData(): Observable { - const httpParams = new HttpParams().set('entityId', '1') - .set('typeId', '0'); + const httpParams = new HttpParams().set('entityId', '1').set('typeId', '0'); return this.http.get(`/templates`, { params: httpParams }); } @@ -298,7 +298,8 @@ export class LoansService { * @param {any} foreclosuredata ForeClosure Data */ getForeclosureData(loanId: string | number, foreclosuredata: any) { - const httpParams = new HttpParams().set('command', foreclosuredata.command) + const httpParams = new HttpParams() + .set('command', foreclosuredata.command) .set('dateFormat', foreclosuredata.dateFormat) .set('locale', foreclosuredata.locale) .set('transactionDate', foreclosuredata.transactionDate); @@ -360,18 +361,17 @@ export class LoansService { * @param {any} productId Product ID */ getLoansAccountTemplateResource(entityId: any, isGroup: boolean, productId?: any): Observable { - let httpParams = new HttpParams().set('activeOnly', 'true') - .set('staffInSelectedOfficeOnly', 'true'); + let httpParams = new HttpParams().set('activeOnly', 'true').set('staffInSelectedOfficeOnly', 'true'); httpParams = productId ? httpParams.set('productId', productId) : httpParams; - httpParams = isGroup ? httpParams.set('groupId', entityId) - .set('templateType', 'group') : - httpParams.set('clientId', entityId) - .set('templateType', 'individual'); + httpParams = isGroup + ? httpParams.set('groupId', entityId).set('templateType', 'group') + : httpParams.set('clientId', entityId).set('templateType', 'individual'); return this.http.get('/loans/template', { params: httpParams }); } getLoansAccountAndTemplateResource(loanId: any): Observable { - const httpParams = new HttpParams().set('associations', 'charges,collateral,meeting,multiDisburseDetails') + const httpParams = new HttpParams() + .set('associations', 'charges,collateral,meeting,multiDisburseDetails') .set('staffInSelectedOfficeOnly', 'true') .set('template', 'true'); return this.http.get(`/loans/${loanId}`, { params: httpParams }); @@ -382,7 +382,8 @@ export class LoansService { * @param {any} productId Product ID */ getLoansCollateralTemplateResource(productId: any): Observable { - const httpParams = new HttpParams().set('fields', 'id, loanCollateralOptions') + const httpParams = new HttpParams() + .set('fields', 'id, loanCollateralOptions') .set('productId', productId) .set('templateType', 'collateral'); return this.http.get('/loans/template', { params: httpParams }); @@ -421,8 +422,12 @@ export class LoansService { * @returns {Observable} Standing Instructions */ getStandingInstructions( - clientId: string, clientName: string, fromAccountId: string, - locale: string, dateFormat: string): Observable { + clientId: string, + clientName: string, + fromAccountId: string, + locale: string, + dateFormat: string + ): Observable { const httpParams = new HttpParams() .set('clientId', clientId) .set('clientName', clientName) @@ -450,14 +455,12 @@ export class LoansService { * @returns {Observable} */ getLoanApprovalTemplate(loanId: string): Observable { - const httpParams = new HttpParams() - .set('templateType', 'approval'); + const httpParams = new HttpParams().set('templateType', 'approval'); return this.http.get(`/loans/${loanId}/template`, { params: httpParams }); } guarantorAccountResource(loanId: string, clientId: any): Observable { - const httpParams = new HttpParams() - .set('clientId', clientId); + const httpParams = new HttpParams().set('clientId', clientId); return this.http.get(`/loans/${loanId}/guarantors/accounts/template`, { params: httpParams }); } @@ -536,7 +539,12 @@ export class LoansService { * @param {string} transactionId Transaction Id * @returns {Observable} */ - executeLoansAccountTransactionsCommand(accountId: string, command: string, data: any, transactionId?: any): Observable { + executeLoansAccountTransactionsCommand( + accountId: string, + command: string, + data: any, + transactionId?: any + ): Observable { const httpParams = new HttpParams().set('command', command); if (transactionId) { return this.http.post(`/loans/${accountId}/transactions/${transactionId}`, data, { params: httpParams }); @@ -553,7 +561,8 @@ export class LoansService { } getGLIMLoanAccountTemplate(groupId: any): Observable { - const httpParams = new HttpParams().set('groupId', groupId) + const httpParams = new HttpParams() + .set('groupId', groupId) .set('lendingStrategy', '300') .set('templateType', 'jlgbulk'); return this.http.get('/loans/template', { params: httpParams }); @@ -575,17 +584,23 @@ export class LoansService { * @param dateFormat String with date format to manage dates * @returns Object with Loan Account payload data. */ - buildLoanRequestPayload(loansAccount: any, loansAccountTemplate: any, calendarOptions: any, locale: string, dateFormat: string): any { + buildLoanRequestPayload( + loansAccount: any, + loansAccountTemplate: any, + calendarOptions: any, + locale: string, + dateFormat: string + ): any { const loansAccountData = { ...loansAccount, charges: loansAccount.charges.map((charge: any) => ({ chargeId: charge.id, amount: charge.amount, - dueDate: charge.dueDate && this.dateUtils.formatDate(charge.dueDate, dateFormat), + dueDate: charge.dueDate && this.dateUtils.formatDate(charge.dueDate, dateFormat) })), collateral: loansAccount.collateral.map((collateralEle: any) => ({ clientCollateralId: collateralEle.type.collateralId, - quantity: collateralEle.value, + quantity: collateralEle.value })), disbursementData: loansAccount.disbursementData.map((item: any) => ({ expectedDisbursementDate: this.dateUtils.formatDate(item.expectedDisbursementDate, dateFormat), @@ -596,7 +611,7 @@ export class LoansService { submittedOnDate: this.dateUtils.formatDate(loansAccount.submittedOnDate, dateFormat), expectedDisbursementDate: this.dateUtils.formatDate(loansAccount.expectedDisbursementDate, dateFormat), dateFormat, - locale, + locale }; if (loansAccountTemplate.clientId) { loansAccountData.clientId = loansAccountTemplate.clientId; @@ -612,7 +627,10 @@ export class LoansService { } if (loansAccountData.recalculationRestFrequencyDate) { - loansAccountData.recalculationRestFrequencyDate = this.dateUtils.formatDate(loansAccount.recalculationRestFrequencyDate, dateFormat); + loansAccountData.recalculationRestFrequencyDate = this.dateUtils.formatDate( + loansAccount.recalculationRestFrequencyDate, + dateFormat + ); } if (loansAccountData.interestCalculationPeriodType === 0) { @@ -621,7 +639,7 @@ export class LoansService { if (!(loansAccountData.isFloatingInterestRate === false)) { delete loansAccountData.isFloatingInterestRate; } - if (!(loansAccountData.multiDisburseLoan)) { + if (!loansAccountData.multiDisburseLoan) { delete loansAccountData.disbursementData; } delete loansAccountData.isValid; @@ -630,5 +648,4 @@ export class LoansService { delete loansAccountData.multiDisburseLoan; // this was just added so that disbursement data can be send in the backend return loansAccountData; } - } diff --git a/src/app/loans/models/loan-account.model.ts b/src/app/loans/models/loan-account.model.ts index 5a4882715..42cd7675c 100644 --- a/src/app/loans/models/loan-account.model.ts +++ b/src/app/loans/models/loan-account.model.ts @@ -1,118 +1,117 @@ import { Currency } from 'app/shared/models/general.model'; export interface DelinquencyRange { - id: number; + id: number; classification: string; minimumAgeDays: number; } export interface DelinquentData { - availableDisbursementAmount: number; - pastDueDays: number; - nextPaymentDueDate: number[]; - delinquentDays: number; - delinquentDate: number[]; - delinquentAmount: number; - lastPaymentAmount: number; - lastRepaymentAmount: number; - delinquencyCalculationPaused: boolean; - installmentLevelDelinquency?: InstallmentLevelDelinquency[]; + availableDisbursementAmount: number; + pastDueDays: number; + nextPaymentDueDate: number[]; + delinquentDays: number; + delinquentDate: number[]; + delinquentAmount: number; + lastPaymentAmount: number; + lastRepaymentAmount: number; + delinquencyCalculationPaused: boolean; + installmentLevelDelinquency?: InstallmentLevelDelinquency[]; } export interface InstallmentLevelDelinquency { - rangeId: number; - classification: string; - minimumAgeDays: number; + rangeId: number; + classification: string; + minimumAgeDays: number; delinquentAmount: number; } export interface LoanDelinquencyTags { - id: number; - loanId: number; + id: number; + loanId: number; delinquencyRange: DelinquencyRange; - addedOnDate: number[]; - liftedOnDate: number[]; + addedOnDate: number[]; + liftedOnDate: number[]; } export interface LoanDelinquencyAction { - id: number; - action: string; - startDate: number[]; - endDate: number[]; - createdById: number; - createdOn: Date; - updatedById: number; + id: number; + action: string; + startDate: number[]; + endDate: number[]; + createdById: number; + createdOn: Date; + updatedById: number; lastModifiedOn: Date; } export interface DelinquencyPausePeriod { - active: boolean; + active: boolean; pausePeriodStart: number[]; - pausePeriodEnd: number[]; + pausePeriodEnd: number[]; } - export interface RepaymentSchedule { - currency: Currency; - loanTermInDays: number; - totalPrincipalDisbursed: number; - totalPrincipalExpected: number; - totalPrincipalPaid: number; - totalInterestCharged: number; - totalFeeChargesCharged: number; + currency: Currency; + loanTermInDays: number; + totalPrincipalDisbursed: number; + totalPrincipalExpected: number; + totalPrincipalPaid: number; + totalInterestCharged: number; + totalFeeChargesCharged: number; totalPenaltyChargesCharged: number; - totalWaived: number; - totalWrittenOff: number; - totalRepaymentExpected: number; - totalRepayment: number; - totalPaidInAdvance: number; - totalPaidLate: number; - totalOutstanding: number; - totalCredits: number; - periods: RepaymentSchedulePeriod[]; + totalWaived: number; + totalWrittenOff: number; + totalRepaymentExpected: number; + totalRepayment: number; + totalPaidInAdvance: number; + totalPaidLate: number; + totalOutstanding: number; + totalCredits: number; + periods: RepaymentSchedulePeriod[]; } export interface RepaymentSchedulePeriod { - dueDate: number[]; - principalDisbursed?: number; - principalLoanBalanceOutstanding: number; - feeChargesDue: number; - feeChargesPaid: number; - feeChargesOutstanding: number; - totalOriginalDueForPeriod: number; - totalDueForPeriod: number; - totalPaidForPeriod: number; - totalOutstandingForPeriod: number; - totalOverdue?: number; - totalActualCostOfLoanForPeriod: number; - totalCredits: number; - period?: number; - fromDate?: number[]; - complete?: boolean; - isAdditional?: boolean; - downPaymentPeriod?: boolean; - daysInPeriod?: number; - principalOriginalDue?: number; - principalDue?: number; - principalPaid?: number; - principalWrittenOff?: number; - principalOutstanding?: number; - interestOriginalDue?: number; - interestDue?: number; - interestPaid?: number; - interestWaived?: number; - interestWrittenOff?: number; - interestOutstanding?: number; - feeChargesWaived?: number; - feeChargesWrittenOff?: number; - penaltyChargesDue?: number; - penaltyChargesPaid?: number; - penaltyChargesWaived?: number; - penaltyChargesWrittenOff?: number; - penaltyChargesOutstanding?: number; - totalPaidInAdvanceForPeriod?: number; - totalPaidLateForPeriod?: number; - totalWaivedForPeriod?: number; - totalWrittenOffForPeriod?: number; + dueDate: number[]; + principalDisbursed?: number; + principalLoanBalanceOutstanding: number; + feeChargesDue: number; + feeChargesPaid: number; + feeChargesOutstanding: number; + totalOriginalDueForPeriod: number; + totalDueForPeriod: number; + totalPaidForPeriod: number; + totalOutstandingForPeriod: number; + totalOverdue?: number; + totalActualCostOfLoanForPeriod: number; + totalCredits: number; + period?: number; + fromDate?: number[]; + complete?: boolean; + isAdditional?: boolean; + downPaymentPeriod?: boolean; + daysInPeriod?: number; + principalOriginalDue?: number; + principalDue?: number; + principalPaid?: number; + principalWrittenOff?: number; + principalOutstanding?: number; + interestOriginalDue?: number; + interestDue?: number; + interestPaid?: number; + interestWaived?: number; + interestWrittenOff?: number; + interestOutstanding?: number; + feeChargesWaived?: number; + feeChargesWrittenOff?: number; + penaltyChargesDue?: number; + penaltyChargesPaid?: number; + penaltyChargesWaived?: number; + penaltyChargesWrittenOff?: number; + penaltyChargesOutstanding?: number; + totalPaidInAdvanceForPeriod?: number; + totalPaidLateForPeriod?: number; + totalWaivedForPeriod?: number; + totalWrittenOffForPeriod?: number; totalInstallmentAmountForPeriod?: number; } diff --git a/src/app/loans/models/loan-transaction-type.model.ts b/src/app/loans/models/loan-transaction-type.model.ts index 686e19912..7fd5487d6 100644 --- a/src/app/loans/models/loan-transaction-type.model.ts +++ b/src/app/loans/models/loan-transaction-type.model.ts @@ -1,35 +1,35 @@ export interface LoanTransactionType { - id: number; - code: string; - value: string; + id: number; + code: string; + value: string; - disbursement: boolean; + disbursement: boolean; repaymentAtDisbursement: boolean; - repayment: boolean; - merchantIssuedRefund: boolean; - payoutRefund: boolean; - goodwillCredit: boolean; - interestPaymentWaiver: boolean; - interestRefund: boolean; - chargeRefund: boolean; - contra: boolean; - waiveInterest: boolean; - waiveCharges: boolean; - accrual: boolean; - writeOff: boolean; - recoveryRepayment: boolean; - initiateTransfer: boolean; - approveTransfer: boolean; - withdrawTransfer: boolean; - rejectTransfer: boolean; - chargePayment: boolean; - refund: boolean; - refundForActiveLoans: boolean; - creditBalanceRefund: boolean; - chargeAdjustment: boolean; - chargeback: boolean; - chargeoff: boolean; - downPayment: boolean; - reAge: boolean; - reAmortize: boolean; + repayment: boolean; + merchantIssuedRefund: boolean; + payoutRefund: boolean; + goodwillCredit: boolean; + interestPaymentWaiver: boolean; + interestRefund: boolean; + chargeRefund: boolean; + contra: boolean; + waiveInterest: boolean; + waiveCharges: boolean; + accrual: boolean; + writeOff: boolean; + recoveryRepayment: boolean; + initiateTransfer: boolean; + approveTransfer: boolean; + withdrawTransfer: boolean; + rejectTransfer: boolean; + chargePayment: boolean; + refund: boolean; + refundForActiveLoans: boolean; + creditBalanceRefund: boolean; + chargeAdjustment: boolean; + chargeback: boolean; + chargeoff: boolean; + downPayment: boolean; + reAge: boolean; + reAmortize: boolean; } diff --git a/src/app/loans/services/external-asset-owner.service.ts b/src/app/loans/services/external-asset-owner.service.ts index ae3a00c7d..29db09f09 100644 --- a/src/app/loans/services/external-asset-owner.service.ts +++ b/src/app/loans/services/external-asset-owner.service.ts @@ -6,10 +6,9 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class ExternalAssetOwnerService { - basePath = '/external-asset-owners'; - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * @param {string} loanId Loan Id @@ -66,5 +65,4 @@ export class ExternalAssetOwnerService { searchExternalAssetOwnerTransfer(request: any): Observable { return this.http.post(`${this.basePath}/search`, request); } - } diff --git a/src/app/loans/services/external-asset-owner.ts b/src/app/loans/services/external-asset-owner.ts index e9d183f93..ed450aaa5 100644 --- a/src/app/loans/services/external-asset-owner.ts +++ b/src/app/loans/services/external-asset-owner.ts @@ -8,7 +8,7 @@ export class ExternalAssetOwner { validateStatus(item: any, status: string): boolean { if (item != null) { - return (item.status === status); + return item.status === status; } return false; } @@ -25,15 +25,15 @@ export class ExternalAssetOwner { } isPending(item: any): boolean { - return (item.status === 'PENDING'); + return item.status === 'PENDING'; } isPendingOrCanceled(item: any): boolean { - return ((item.status === 'PENDING') || (item.status === 'CANCELLED') || this.isBuyBackPending(item)); + return item.status === 'PENDING' || item.status === 'CANCELLED' || this.isBuyBackPending(item); } isBuyBackPending(item: any): boolean { - return (item.status === 'BUYBACK' && item.effectiveTo === this.defaultDate); + return item.status === 'BUYBACK' && item.effectiveTo === this.defaultDate; } canBeCancelled(item: any): boolean { @@ -44,12 +44,13 @@ export class ExternalAssetOwner { if (item == null) { return true; } - return ['', 'CANCELLED'].includes(item.status) - || (item.status === 'BUYBACK' && item.effectiveTo !== this.defaultDate); + return [ + '', + 'CANCELLED' + ].includes(item.status) || (item.status === 'BUYBACK' && item.effectiveTo !== this.defaultDate); } canBeBuyed(item: any): boolean { return this.validateStatus(item, 'ACTIVE'); } - } diff --git a/src/app/login/login-form/login-form.component.spec.ts b/src/app/login/login-form/login-form.component.spec.ts index c5f08d40e..aebc1e500 100644 --- a/src/app/login/login-form/login-form.component.spec.ts +++ b/src/app/login/login-form/login-form.component.spec.ts @@ -8,9 +8,8 @@ describe('LoginFormComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoginFormComponent ] - }) - .compileComponents(); + declarations: [LoginFormComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/login/login-form/login-form.component.ts b/src/app/login/login-form/login-form.component.ts index a2f1e0f16..a76d47404 100644 --- a/src/app/login/login-form/login-form.component.ts +++ b/src/app/login/login-form/login-form.component.ts @@ -17,7 +17,6 @@ import { AuthenticationService } from '../../core/authentication/authentication. styleUrls: ['./login-form.component.scss'] }) export class LoginFormComponent implements OnInit { - /** Login form group. */ loginForm: UntypedFormGroup; /** Password input field type. */ @@ -29,8 +28,10 @@ export class LoginFormComponent implements OnInit { * @param {FormBuilder} formBuilder Form Builder. * @param {AuthenticationService} authenticationService Authentication Service. */ - constructor(private formBuilder: UntypedFormBuilder, - private authenticationService: AuthenticationService) { } + constructor( + private formBuilder: UntypedFormBuilder, + private authenticationService: AuthenticationService + ) {} /** * Creates login form. @@ -48,14 +49,18 @@ export class LoginFormComponent implements OnInit { login() { this.loading = true; this.loginForm.disable(); - this.authenticationService.login(this.loginForm.value) - .pipe(finalize(() => { - this.loginForm.reset(); - this.loginForm.markAsPristine(); - // Angular Material Bug: Validation errors won't get removed on reset. - this.loginForm.enable(); - this.loading = false; - })).subscribe(); + this.authenticationService + .login(this.loginForm.value) + .pipe( + finalize(() => { + this.loginForm.reset(); + this.loginForm.markAsPristine(); + // Angular Material Bug: Validation errors won't get removed on reset. + this.loginForm.enable(); + this.loading = false; + }) + ) + .subscribe(); } /** @@ -70,10 +75,15 @@ export class LoginFormComponent implements OnInit { */ private createLoginForm() { this.loginForm = this.formBuilder.group({ - 'username': ['', Validators.required], - 'password': ['', Validators.required], - 'remember': false + username: [ + '', + Validators.required + ], + password: [ + '', + Validators.required + ], + remember: false }); } - } diff --git a/src/app/login/login-routing.module.ts b/src/app/login/login-routing.module.ts index 407f3571e..f2e46de63 100644 --- a/src/app/login/login-routing.module.ts +++ b/src/app/login/login-routing.module.ts @@ -24,4 +24,4 @@ const routes: Routes = [ exports: [RouterModule], providers: [] }) -export class LoginRoutingModule { } +export class LoginRoutingModule {} diff --git a/src/app/login/login.component.spec.ts b/src/app/login/login.component.spec.ts index d6d85a846..6db09b69b 100644 --- a/src/app/login/login.component.spec.ts +++ b/src/app/login/login.component.spec.ts @@ -8,9 +8,8 @@ describe('LoginComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoginComponent ] - }) - .compileComponents(); + declarations: [LoginComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 978599318..91a3bd93e 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -24,7 +24,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./login.component.scss'] }) export class LoginComponent implements OnInit, OnDestroy { - public environment = environment; /** True if password requires a reset. */ @@ -38,9 +37,11 @@ export class LoginComponent implements OnInit, OnDestroy { * @param {AlertService} alertService Alert Service. * @param {Router} router Router for navigation. */ - constructor(private alertService: AlertService, - private settingsService: SettingsService, - private router: Router) { } + constructor( + private alertService: AlertService, + private settingsService: SettingsService, + private router: Router + ) {} /** * Subscribes to alert event of alert service. @@ -80,5 +81,4 @@ export class LoginComponent implements OnInit, OnDestroy { displayTenantSelector(): boolean { return environment.displayTenantSelector === 'false' ? false : true; } - } diff --git a/src/app/login/login.module.ts b/src/app/login/login.module.ts index 63e724ab3..08b17947e 100644 --- a/src/app/login/login.module.ts +++ b/src/app/login/login.module.ts @@ -30,4 +30,4 @@ import { TranslateModule } from '@ngx-translate/core'; TwoFactorAuthenticationComponent ] }) -export class LoginModule { } +export class LoginModule {} diff --git a/src/app/login/reset-password/confirm-password.validator.ts b/src/app/login/reset-password/confirm-password.validator.ts index f17865784..339fd1fcb 100644 --- a/src/app/login/reset-password/confirm-password.validator.ts +++ b/src/app/login/reset-password/confirm-password.validator.ts @@ -5,5 +5,5 @@ import { UntypedFormGroup, ValidatorFn, ValidationErrors } from '@angular/forms' export const confirmPasswordValidator: ValidatorFn = (resetPasswordForm: UntypedFormGroup): ValidationErrors | null => { const password = resetPasswordForm.get('password'); const confirmPassword = resetPasswordForm.get('repeatPassword'); - return password && confirmPassword && password.value !== confirmPassword.value ? { 'passwordsDoNotMatch': true } : null; + return password && confirmPassword && password.value !== confirmPassword.value ? { passwordsDoNotMatch: true } : null; }; diff --git a/src/app/login/reset-password/reset-password.component.spec.ts b/src/app/login/reset-password/reset-password.component.spec.ts index 3f034711b..0f9d0816e 100644 --- a/src/app/login/reset-password/reset-password.component.spec.ts +++ b/src/app/login/reset-password/reset-password.component.spec.ts @@ -8,9 +8,8 @@ describe('ResetPasswordComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ResetPasswordComponent ] - }) - .compileComponents(); + declarations: [ResetPasswordComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/login/reset-password/reset-password.component.ts b/src/app/login/reset-password/reset-password.component.ts index fd270bb28..61144bca9 100644 --- a/src/app/login/reset-password/reset-password.component.ts +++ b/src/app/login/reset-password/reset-password.component.ts @@ -21,7 +21,6 @@ import { PasswordsUtility } from 'app/core/utils/passwords-utility'; styleUrls: ['./reset-password.component.scss'] }) export class ResetPasswordComponent implements OnInit { - /** Reset password form group. */ resetPasswordForm: UntypedFormGroup; /** Password input field type. */ @@ -33,9 +32,11 @@ export class ResetPasswordComponent implements OnInit { * @param {FormBuilder} formBuilder Form Builder. * @param {AuthenticationService} authenticationService Authentication Service. */ - constructor(private formBuilder: UntypedFormBuilder, - private authenticationService: AuthenticationService, - private passwordsUtility: PasswordsUtility) { } + constructor( + private formBuilder: UntypedFormBuilder, + private authenticationService: AuthenticationService, + private passwordsUtility: PasswordsUtility + ) {} /** * Creates reset password form. @@ -53,24 +54,36 @@ export class ResetPasswordComponent implements OnInit { resetPassword() { this.loading = true; this.resetPasswordForm.disable(); - this.authenticationService.resetPassword(this.resetPasswordForm.value) - .pipe(finalize(() => { - this.resetPasswordForm.reset(); - this.resetPasswordForm.markAsPristine(); - // Angular Material Bug: Validation errors won't get removed on reset. - this.resetPasswordForm.enable(); - this.loading = false; - })).subscribe(); + this.authenticationService + .resetPassword(this.resetPasswordForm.value) + .pipe( + finalize(() => { + this.resetPasswordForm.reset(); + this.resetPasswordForm.markAsPristine(); + // Angular Material Bug: Validation errors won't get removed on reset. + this.resetPasswordForm.enable(); + this.loading = false; + }) + ) + .subscribe(); } /** * Creates reset password form. */ private createResetPasswordForm() { - this.resetPasswordForm = this.formBuilder.group({ - 'password': ['', this.passwordsUtility.getPasswordValidators()], - 'repeatPassword': ['', Validators.required] - }, { validator: confirmPasswordValidator }); + this.resetPasswordForm = this.formBuilder.group( + { + password: [ + '', + this.passwordsUtility.getPasswordValidators() + ], + repeatPassword: [ + '', + Validators.required + ] + }, + { validator: confirmPasswordValidator } + ); } - } diff --git a/src/app/login/two-factor-authentication/two-factor-authentication.component.spec.ts b/src/app/login/two-factor-authentication/two-factor-authentication.component.spec.ts index c914ab8c0..ac98d9a83 100644 --- a/src/app/login/two-factor-authentication/two-factor-authentication.component.spec.ts +++ b/src/app/login/two-factor-authentication/two-factor-authentication.component.spec.ts @@ -8,9 +8,8 @@ describe('TwoFactorAuthenticationComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ TwoFactorAuthenticationComponent ] - }) - .compileComponents(); + declarations: [TwoFactorAuthenticationComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/login/two-factor-authentication/two-factor-authentication.component.ts b/src/app/login/two-factor-authentication/two-factor-authentication.component.ts index b32eb3ad2..5271ac5c2 100644 --- a/src/app/login/two-factor-authentication/two-factor-authentication.component.ts +++ b/src/app/login/two-factor-authentication/two-factor-authentication.component.ts @@ -17,7 +17,6 @@ import { AuthenticationService } from '../../core/authentication/authentication. styleUrls: ['./two-factor-authentication.component.scss'] }) export class TwoFactorAuthenticationComponent implements OnInit { - /** Available delivery methods to receive OTP. */ twoFactorAuthenticationDeliveryMethods: any; /** Delivery method selected to receive OTP. */ @@ -39,8 +38,10 @@ export class TwoFactorAuthenticationComponent implements OnInit { * @param {FormBuilder} formBuilder Form Builder. * @param {AuthenticationService} authenticationService Authentication Service. */ - constructor(private formBuilder: UntypedFormBuilder, - private authenticationService: AuthenticationService) { } + constructor( + private formBuilder: UntypedFormBuilder, + private authenticationService: AuthenticationService + ) {} /** * Creates two factor authentication delivery method form. @@ -49,10 +50,9 @@ export class TwoFactorAuthenticationComponent implements OnInit { */ ngOnInit() { this.createTwoFactorAuthenticationDeliveryMethodForm(); - this.authenticationService.getDeliveryMethods() - .subscribe((deliveryMethods: any) => { - this.twoFactorAuthenticationDeliveryMethods = deliveryMethods; - }); + this.authenticationService.getDeliveryMethods().subscribe((deliveryMethods: any) => { + this.twoFactorAuthenticationDeliveryMethods = deliveryMethods; + }); } /** @@ -64,14 +64,17 @@ export class TwoFactorAuthenticationComponent implements OnInit { this.selectedTwoFactorAuthenticationDeliveryMethod = this.twoFactorAuthenticationDeliveryMethodForm.value.twoFactorAuthenticationDeliveryMethod; - this.authenticationService.requestOTP(this.selectedTwoFactorAuthenticationDeliveryMethod) - .pipe(finalize(() => { - this.twoFactorAuthenticationDeliveryMethodForm.reset(); - this.twoFactorAuthenticationDeliveryMethodForm.markAsPristine(); - // Angular Material Bug: Validation errors won't get removed on reset. - this.twoFactorAuthenticationDeliveryMethodForm.enable(); - this.loading = false; - })) + this.authenticationService + .requestOTP(this.selectedTwoFactorAuthenticationDeliveryMethod) + .pipe( + finalize(() => { + this.twoFactorAuthenticationDeliveryMethodForm.reset(); + this.twoFactorAuthenticationDeliveryMethodForm.markAsPristine(); + // Angular Material Bug: Validation errors won't get removed on reset. + this.twoFactorAuthenticationDeliveryMethodForm.enable(); + this.loading = false; + }) + ) .subscribe((response: any) => { this.createTwoFactorAuthenticationForm(); this.otpRequested = true; @@ -85,14 +88,18 @@ export class TwoFactorAuthenticationComponent implements OnInit { validateOTP() { this.loading = true; this.twoFactorAuthenticationForm.disable(); - this.authenticationService.validateOTP(this.twoFactorAuthenticationForm.value.otp) - .pipe(finalize(() => { - this.twoFactorAuthenticationForm.reset(); - this.twoFactorAuthenticationForm.markAsPristine(); - // Angular Material Bug: Validation errors won't get removed on reset. - this.twoFactorAuthenticationForm.enable(); - this.loading = false; - })).subscribe(); + this.authenticationService + .validateOTP(this.twoFactorAuthenticationForm.value.otp) + .pipe( + finalize(() => { + this.twoFactorAuthenticationForm.reset(); + this.twoFactorAuthenticationForm.markAsPristine(); + // Angular Material Bug: Validation errors won't get removed on reset. + this.twoFactorAuthenticationForm.enable(); + this.loading = false; + }) + ) + .subscribe(); } /** @@ -101,14 +108,18 @@ export class TwoFactorAuthenticationComponent implements OnInit { resendOTP() { this.resendOTPLoading = true; this.twoFactorAuthenticationForm.disable(); - this.authenticationService.requestOTP(this.selectedTwoFactorAuthenticationDeliveryMethod) - .pipe(finalize(() => { - this.twoFactorAuthenticationForm.reset(); - this.twoFactorAuthenticationForm.markAsPristine(); - // Angular Material Bug: Validation errors won't get removed on reset. - this.twoFactorAuthenticationForm.enable(); - this.resendOTPLoading = false; - })).subscribe(); + this.authenticationService + .requestOTP(this.selectedTwoFactorAuthenticationDeliveryMethod) + .pipe( + finalize(() => { + this.twoFactorAuthenticationForm.reset(); + this.twoFactorAuthenticationForm.markAsPristine(); + // Angular Material Bug: Validation errors won't get removed on reset. + this.twoFactorAuthenticationForm.enable(); + this.resendOTPLoading = false; + }) + ) + .subscribe(); } /** @@ -116,7 +127,10 @@ export class TwoFactorAuthenticationComponent implements OnInit { */ private createTwoFactorAuthenticationDeliveryMethodForm() { this.twoFactorAuthenticationDeliveryMethodForm = this.formBuilder.group({ - 'twoFactorAuthenticationDeliveryMethod': ['', Validators.required] + twoFactorAuthenticationDeliveryMethod: [ + '', + Validators.required + ] }); } @@ -125,8 +139,10 @@ export class TwoFactorAuthenticationComponent implements OnInit { */ private createTwoFactorAuthenticationForm() { this.twoFactorAuthenticationForm = this.formBuilder.group({ - 'otp': ['', Validators.required] + otp: [ + '', + Validators.required + ] }); } - } diff --git a/src/app/navigation/center-navigation/center-navigation.component.spec.ts b/src/app/navigation/center-navigation/center-navigation.component.spec.ts index 1b3583c05..4f2418217 100644 --- a/src/app/navigation/center-navigation/center-navigation.component.spec.ts +++ b/src/app/navigation/center-navigation/center-navigation.component.spec.ts @@ -8,9 +8,8 @@ describe('CenterNavigationComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CenterNavigationComponent ] - }) - .compileComponents(); + declarations: [CenterNavigationComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/navigation/center-navigation/center-navigation.component.ts b/src/app/navigation/center-navigation/center-navigation.component.ts index b5a2b13a1..e1c0cb006 100644 --- a/src/app/navigation/center-navigation/center-navigation.component.ts +++ b/src/app/navigation/center-navigation/center-navigation.component.ts @@ -5,14 +5,12 @@ import { Component, Input, ViewChild } from '@angular/core'; import { LoanAccountTableComponent } from '../loan-account-table/loan-account-table.component'; import { SavingsAccountTableComponent } from '../savings-account-table/savings-account-table.component'; - @Component({ selector: 'mifosx-center-navigation', templateUrl: './center-navigation.component.html', styleUrls: ['./center-navigation.component.scss'] }) export class CenterNavigationComponent { - @ViewChild(LoanAccountTableComponent) loanAccountTableComponent: LoanAccountTableComponent; @ViewChild(SavingsAccountTableComponent) savingsAccountTableComponent: SavingsAccountTableComponent; @@ -21,6 +19,5 @@ export class CenterNavigationComponent { @Input() centerSummaryData: any; @Input() groupData: any; - constructor() { } - + constructor() {} } diff --git a/src/app/navigation/client-navigation/client-navigation.component.spec.ts b/src/app/navigation/client-navigation/client-navigation.component.spec.ts index f5e0f9582..b31270b10 100644 --- a/src/app/navigation/client-navigation/client-navigation.component.spec.ts +++ b/src/app/navigation/client-navigation/client-navigation.component.spec.ts @@ -8,9 +8,8 @@ describe('ClientNavigationComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ClientNavigationComponent ] - }) - .compileComponents(); + declarations: [ClientNavigationComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/navigation/client-navigation/client-navigation.component.ts b/src/app/navigation/client-navigation/client-navigation.component.ts index a55310990..853975835 100644 --- a/src/app/navigation/client-navigation/client-navigation.component.ts +++ b/src/app/navigation/client-navigation/client-navigation.component.ts @@ -13,7 +13,6 @@ import { MemberGroupsComponent } from '../member-groups/member-groups.component' styleUrls: ['./client-navigation.component.scss'] }) export class ClientNavigationComponent { - @ViewChild(LoanAccountTableComponent) loanAccountTableComponent: LoanAccountTableComponent; @ViewChild(SavingsAccountTableComponent) savingsAccountTableComponent: SavingsAccountTableComponent; @ViewChild(ShareAccountTableComponent) shareAccountTableComponent: ShareAccountTableComponent; @@ -22,6 +21,5 @@ export class ClientNavigationComponent { @Input() clientData: any; @Input() clientAccountsData: any; - constructor() { } - + constructor() {} } diff --git a/src/app/navigation/group-navigation/group-navigation.component.spec.ts b/src/app/navigation/group-navigation/group-navigation.component.spec.ts index b90114729..c073af07a 100644 --- a/src/app/navigation/group-navigation/group-navigation.component.spec.ts +++ b/src/app/navigation/group-navigation/group-navigation.component.spec.ts @@ -8,9 +8,8 @@ describe('GroupNavigationComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GroupNavigationComponent ] - }) - .compileComponents(); + declarations: [GroupNavigationComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/navigation/group-navigation/group-navigation.component.ts b/src/app/navigation/group-navigation/group-navigation.component.ts index be77e4705..6210e504d 100644 --- a/src/app/navigation/group-navigation/group-navigation.component.ts +++ b/src/app/navigation/group-navigation/group-navigation.component.ts @@ -5,14 +5,12 @@ import { Component, Input, ViewChild } from '@angular/core'; import { LoanAccountTableComponent } from '../loan-account-table/loan-account-table.component'; import { SavingsAccountTableComponent } from '../savings-account-table/savings-account-table.component'; - @Component({ selector: 'mifosx-group-navigation', templateUrl: './group-navigation.component.html', styleUrls: ['./group-navigation.component.scss'] }) export class GroupNavigationComponent { - @ViewChild(LoanAccountTableComponent) loanAccountTableComponent: LoanAccountTableComponent; @ViewChild(SavingsAccountTableComponent) savingsAccountTableComponent: SavingsAccountTableComponent; @@ -20,6 +18,5 @@ export class GroupNavigationComponent { @Input() groupAccountsData: any; @Input() clientData: any; - constructor() { } - + constructor() {} } diff --git a/src/app/navigation/loan-account-table/loan-account-table.component.spec.ts b/src/app/navigation/loan-account-table/loan-account-table.component.spec.ts index 9f73da835..23a771d35 100644 --- a/src/app/navigation/loan-account-table/loan-account-table.component.spec.ts +++ b/src/app/navigation/loan-account-table/loan-account-table.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanAccountTableComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanAccountTableComponent ] - }) - .compileComponents(); + declarations: [LoanAccountTableComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/navigation/loan-account-table/loan-account-table.component.ts b/src/app/navigation/loan-account-table/loan-account-table.component.ts index dde924611..4e14f022d 100644 --- a/src/app/navigation/loan-account-table/loan-account-table.component.ts +++ b/src/app/navigation/loan-account-table/loan-account-table.component.ts @@ -13,9 +13,13 @@ import { AccountsFilterPipe } from '../../pipes/accounts-filter.pipe'; styleUrls: ['./loan-account-table.component.scss'] }) export class LoanAccountTableComponent { - /** Columns to be displayed in the loan accounts table. */ - displayedColumns: string[] = ['accountNo', 'productName', 'Type', 'Status']; + displayedColumns: string[] = [ + 'accountNo', + 'productName', + 'Type', + 'Status' + ]; /** Show closed loan accounts */ showClosed = false; /** Data source for loan account table. */ @@ -31,7 +35,12 @@ export class LoanAccountTableComponent { /** Loan Account Setter */ @Input() set loanAccountData(data: any) { this.accountData = data; - const filteredAccountData = this.accountsFilterPipe.transform(data, 'loan', this.showClosed ? 'closed' : 'open', 'isLoan'); + const filteredAccountData = this.accountsFilterPipe.transform( + data, + 'loan', + this.showClosed ? 'closed' : 'open', + 'isLoan' + ); this.dataSource = new MatTableDataSource(filteredAccountData); this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; @@ -40,7 +49,7 @@ export class LoanAccountTableComponent { /** * @param {AccountsFilterPipe} accountsFilterPipe Accounts Filter Pipe. */ - constructor(private accountsFilterPipe: AccountsFilterPipe) { } + constructor(private accountsFilterPipe: AccountsFilterPipe) {} /** * Filters data in users table based on passed value. @@ -55,10 +64,14 @@ export class LoanAccountTableComponent { */ toggleClosed() { this.showClosed = !this.showClosed; - const filteredAccountData = this.accountsFilterPipe.transform(this.accountData, 'loan', this.showClosed ? 'closed' : 'open', 'isLoan'); + const filteredAccountData = this.accountsFilterPipe.transform( + this.accountData, + 'loan', + this.showClosed ? 'closed' : 'open', + 'isLoan' + ); this.dataSource = new MatTableDataSource(filteredAccountData); this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/navigation/member-groups/member-groups.component.spec.ts b/src/app/navigation/member-groups/member-groups.component.spec.ts index 906715ff7..eb497c791 100644 --- a/src/app/navigation/member-groups/member-groups.component.spec.ts +++ b/src/app/navigation/member-groups/member-groups.component.spec.ts @@ -8,9 +8,8 @@ describe('MemberGroupsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ MemberGroupsComponent ] - }) - .compileComponents(); + declarations: [MemberGroupsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/navigation/member-groups/member-groups.component.ts b/src/app/navigation/member-groups/member-groups.component.ts index 219186132..8e9cc6902 100644 --- a/src/app/navigation/member-groups/member-groups.component.ts +++ b/src/app/navigation/member-groups/member-groups.component.ts @@ -10,9 +10,11 @@ import { MatTableDataSource } from '@angular/material/table'; styleUrls: ['./member-groups.component.scss'] }) export class MemberGroupsComponent { - /** Columns to be displayed in the member groups table. */ - displayedColumns: string[] = ['accountNo', 'name']; + displayedColumns: string[] = [ + 'accountNo', + 'name' + ]; /** Data source for member groups table. */ dataSource: MatTableDataSource; @@ -28,7 +30,7 @@ export class MemberGroupsComponent { this.dataSource.sort = this.sort; } - constructor() { } + constructor() {} /** * Filters data in member groups table based on passed value. @@ -37,5 +39,4 @@ export class MemberGroupsComponent { applyFilter(filterValue: string) { this.dataSource.filter = filterValue.trim().toLowerCase(); } - } diff --git a/src/app/navigation/navigation-routing.module.ts b/src/app/navigation/navigation-routing.module.ts index 4d1fd6d1b..ae922bfbe 100644 --- a/src/app/navigation/navigation-routing.module.ts +++ b/src/app/navigation/navigation-routing.module.ts @@ -23,6 +23,7 @@ const routes: Routes = [ } } ]) + ]; /** @@ -37,4 +38,4 @@ const routes: Routes = [ OfficesResolver ] }) -export class NavigationRoutingModule { } +export class NavigationRoutingModule {} diff --git a/src/app/navigation/navigation.component.spec.ts b/src/app/navigation/navigation.component.spec.ts index 385771816..1c5f8ca2d 100644 --- a/src/app/navigation/navigation.component.spec.ts +++ b/src/app/navigation/navigation.component.spec.ts @@ -8,9 +8,8 @@ describe('NavigationComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ NavigationComponent ] - }) - .compileComponents(); + declarations: [NavigationComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/navigation/navigation.component.ts b/src/app/navigation/navigation.component.ts index 26208163e..bd0339974 100644 --- a/src/app/navigation/navigation.component.ts +++ b/src/app/navigation/navigation.component.ts @@ -22,7 +22,6 @@ import { ClientNavigationComponent } from './client-navigation/client-navigation styleUrls: ['./navigation.component.scss'] }) export class NavigationComponent implements OnInit { - /** Navigation Components */ @ViewChild(OfficeNavigationComponent) officeNavigationComponent: OfficeNavigationComponent; @ViewChild(StaffNavigationComponent) staffNavigationComponent: StaffNavigationComponent; @@ -66,9 +65,11 @@ export class NavigationComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private navigationService: NavigationService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private navigationService: NavigationService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { offices: any }) => { this.officeData = data.offices; }); @@ -89,7 +90,7 @@ export class NavigationComponent implements OnInit { * Sets the office selector */ setOfficeSelector() { - this.officeSelector.valueChanges.subscribe(officeId => { + this.officeSelector.valueChanges.subscribe((officeId) => { this.employeeSelector.reset(null, { emitEvent: false }); this.centerSelector.reset(null, { emitEvent: false }); this.groupSelector.reset(null, { emitEvent: false }); @@ -115,7 +116,7 @@ export class NavigationComponent implements OnInit { * Sets the employee selector */ setEmployeeSelector() { - this.employeeSelector.valueChanges.subscribe(employeeId => { + this.employeeSelector.valueChanges.subscribe((employeeId) => { if (employeeId) { this.centerSelector.reset(null, { emitEvent: false }); this.groupSelector.reset(null, { emitEvent: false }); @@ -141,7 +142,7 @@ export class NavigationComponent implements OnInit { * Sets the center selector */ setCenterSelector() { - this.centerSelector.valueChanges.subscribe(centerId => { + this.centerSelector.valueChanges.subscribe((centerId) => { if (centerId) { this.groupSelector.reset(null, { emitEvent: false }); this.clientSelector.reset(null, { emitEvent: false }); @@ -173,7 +174,7 @@ export class NavigationComponent implements OnInit { * Sets the group selector */ setGroupSelector() { - this.groupSelector.valueChanges.subscribe(groupId => { + this.groupSelector.valueChanges.subscribe((groupId) => { if (groupId) { this.clientSelector.reset(null, { emitEvent: false }); this.clientData = null; @@ -199,7 +200,7 @@ export class NavigationComponent implements OnInit { * Sets the client selector */ setClientSelector() { - this.clientSelector.valueChanges.subscribe(clientId => { + this.clientSelector.valueChanges.subscribe((clientId) => { if (clientId) { this.selectedItemAccounts = null; this.navigationService.getClient(clientId).subscribe((client: any) => { @@ -212,5 +213,4 @@ export class NavigationComponent implements OnInit { } }); } - } diff --git a/src/app/navigation/navigation.module.ts b/src/app/navigation/navigation.module.ts index 5aa767afe..fd7e5a707 100644 --- a/src/app/navigation/navigation.module.ts +++ b/src/app/navigation/navigation.module.ts @@ -42,4 +42,4 @@ import { MemberGroupsComponent } from './member-groups/member-groups.component'; MemberGroupsComponent ] }) -export class NavigationModule { } +export class NavigationModule {} diff --git a/src/app/navigation/navigation.service.ts b/src/app/navigation/navigation.service.ts index a8f24e0bd..79cb05ea9 100644 --- a/src/app/navigation/navigation.service.ts +++ b/src/app/navigation/navigation.service.ts @@ -12,11 +12,10 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class NavigationService { - /** * @param {HttpClient} http Http Client to send requests. */ - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * @returns {Observable} Offices. @@ -30,8 +29,7 @@ export class NavigationService { * @returns {Observable} Employees */ getEmployees(officeId: number): Observable { - const httpParams = new HttpParams() - .set('officeId', officeId.toString()); + const httpParams = new HttpParams().set('officeId', officeId.toString()); return this.http.get('/staff', { params: httpParams }); } @@ -40,9 +38,7 @@ export class NavigationService { * @returns {Observable} Centers */ getCentersFromStaffId(staffId: number): Observable { - const httpParams = new HttpParams() - .set('R_staffId', staffId.toString()) - .set('genericResultSet', false.toString()); + const httpParams = new HttpParams().set('R_staffId', staffId.toString()).set('genericResultSet', false.toString()); return this.http.get('/runreports/GroupNamesByStaff', { params: httpParams }); } @@ -51,8 +47,7 @@ export class NavigationService { * @returns {Observable} Center */ getCenter(centerId: number): Observable { - const httpParams = new HttpParams() - .set('associations', 'groupMembers'); + const httpParams = new HttpParams().set('associations', 'groupMembers'); return this.http.get(`/centers/${centerId}`, { params: httpParams }); } @@ -69,9 +64,7 @@ export class NavigationService { * @returns {Observable} Center Accounts */ getCenterSummary(centerId: number): Observable { - const httpParams = new HttpParams() - .set('R_groupId', centerId.toString()) - .set('genericResultSet', false.toString()); + const httpParams = new HttpParams().set('R_groupId', centerId.toString()).set('genericResultSet', false.toString()); return this.http.get('/runreports/GroupSummaryCounts', { params: httpParams }); } @@ -80,8 +73,7 @@ export class NavigationService { * @returns {Observable} Group */ getGroup(groupId: number): Observable { - const httpParams = new HttpParams() - .set('associations', 'all'); + const httpParams = new HttpParams().set('associations', 'all'); return this.http.get(`/groups/${groupId}`, { params: httpParams }); } @@ -108,5 +100,4 @@ export class NavigationService { getClientAccounts(clientId: number): Observable { return this.http.get(`/clients/${clientId}/accounts`); } - } diff --git a/src/app/navigation/office-navigation/office-navigation.component.spec.ts b/src/app/navigation/office-navigation/office-navigation.component.spec.ts index ffab91d96..b48e853e2 100644 --- a/src/app/navigation/office-navigation/office-navigation.component.spec.ts +++ b/src/app/navigation/office-navigation/office-navigation.component.spec.ts @@ -8,9 +8,8 @@ describe('OfficeNavigationComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ OfficeNavigationComponent ] - }) - .compileComponents(); + declarations: [OfficeNavigationComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/navigation/office-navigation/office-navigation.component.ts b/src/app/navigation/office-navigation/office-navigation.component.ts index 50d825612..7eb048bec 100644 --- a/src/app/navigation/office-navigation/office-navigation.component.ts +++ b/src/app/navigation/office-navigation/office-navigation.component.ts @@ -1,4 +1,3 @@ - /** Angular Imports */ import { Component, Input } from '@angular/core'; @@ -8,10 +7,8 @@ import { Component, Input } from '@angular/core'; styleUrls: ['./office-navigation.component.scss'] }) export class OfficeNavigationComponent { - @Input() officeData: any; @Input() employeeData: any; - constructor() { } - + constructor() {} } diff --git a/src/app/navigation/offices.resolver.ts b/src/app/navigation/offices.resolver.ts index 90cfc0ced..1029b1b77 100644 --- a/src/app/navigation/offices.resolver.ts +++ b/src/app/navigation/offices.resolver.ts @@ -13,7 +13,6 @@ import { NavigationService } from './navigation.service'; */ @Injectable() export class OfficesResolver implements Resolve { - /** * @param {NavigationService} navigationService Navigation service. */ @@ -26,5 +25,4 @@ export class OfficesResolver implements Resolve { resolve(): Observable { return this.navigationService.getOffices(); } - } diff --git a/src/app/navigation/savings-account-table/savings-account-table.component.spec.ts b/src/app/navigation/savings-account-table/savings-account-table.component.spec.ts index f6228cc50..c696b037d 100644 --- a/src/app/navigation/savings-account-table/savings-account-table.component.spec.ts +++ b/src/app/navigation/savings-account-table/savings-account-table.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingsAccountTableComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingsAccountTableComponent ] - }) - .compileComponents(); + declarations: [SavingsAccountTableComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/navigation/savings-account-table/savings-account-table.component.ts b/src/app/navigation/savings-account-table/savings-account-table.component.ts index 3f9304d94..8c93395de 100644 --- a/src/app/navigation/savings-account-table/savings-account-table.component.ts +++ b/src/app/navigation/savings-account-table/savings-account-table.component.ts @@ -13,9 +13,13 @@ import { AccountsFilterPipe } from '../../pipes/accounts-filter.pipe'; styleUrls: ['./savings-account-table.component.scss'] }) export class SavingsAccountTableComponent { - /** Columns to be displayed in the savings accounts table. */ - displayedColumns: string[] = ['accountNo', 'productName', 'accountBalance', 'Status']; + displayedColumns: string[] = [ + 'accountNo', + 'productName', + 'accountBalance', + 'Status' + ]; /** Show closed saving accounts */ showClosed = false; /** Data source for savings account table. */ @@ -31,7 +35,12 @@ export class SavingsAccountTableComponent { /** Savings Account Setter */ @Input() set savingsAccountData(data: any) { this.accountData = data; - const filteredAccountData = this.accountsFilterPipe.transform(data, 'saving', this.showClosed ? 'closed' : 'open', 'isSavings'); + const filteredAccountData = this.accountsFilterPipe.transform( + data, + 'saving', + this.showClosed ? 'closed' : 'open', + 'isSavings' + ); this.dataSource = new MatTableDataSource(filteredAccountData); this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; @@ -40,7 +49,7 @@ export class SavingsAccountTableComponent { /** * @param {AccountsFilterPipe} accountsFilterPipe Accounts Filter Pipe. */ - constructor(private accountsFilterPipe: AccountsFilterPipe) { } + constructor(private accountsFilterPipe: AccountsFilterPipe) {} /** * Filters data in users table based on passed value. @@ -55,10 +64,14 @@ export class SavingsAccountTableComponent { */ toggleClosed() { this.showClosed = !this.showClosed; - const filteredAccountData = this.accountsFilterPipe.transform(this.accountData, 'saving', this.showClosed ? 'closed' : 'open', 'isSavings'); + const filteredAccountData = this.accountsFilterPipe.transform( + this.accountData, + 'saving', + this.showClosed ? 'closed' : 'open', + 'isSavings' + ); this.dataSource = new MatTableDataSource(filteredAccountData); this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/navigation/share-account-table/share-account-table.component.spec.ts b/src/app/navigation/share-account-table/share-account-table.component.spec.ts index fa47ed34a..faf4e1495 100644 --- a/src/app/navigation/share-account-table/share-account-table.component.spec.ts +++ b/src/app/navigation/share-account-table/share-account-table.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareAccountTableComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ShareAccountTableComponent ] - }) - .compileComponents(); + declarations: [ShareAccountTableComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/navigation/share-account-table/share-account-table.component.ts b/src/app/navigation/share-account-table/share-account-table.component.ts index 2299293f0..a69fc4d5b 100644 --- a/src/app/navigation/share-account-table/share-account-table.component.ts +++ b/src/app/navigation/share-account-table/share-account-table.component.ts @@ -13,9 +13,13 @@ import { AccountsFilterPipe } from '../../pipes/accounts-filter.pipe'; styleUrls: ['./share-account-table.component.scss'] }) export class ShareAccountTableComponent { - /** Columns to be displayed in the share accounts table. */ - displayedColumns: string[] = ['accountNo', 'productName', 'totalApprovedShares', 'Status']; + displayedColumns: string[] = [ + 'accountNo', + 'productName', + 'totalApprovedShares', + 'Status' + ]; /** Show closed share accounts */ showClosed = false; /** Data source for share account table. */ @@ -31,7 +35,12 @@ export class ShareAccountTableComponent { /** Share Account Setter */ @Input() set shareAccountData(data: any) { this.accountData = data; - const filteredAccountData = this.accountsFilterPipe.transform(data, 'share', this.showClosed ? 'closed' : 'open', 'isShare'); + const filteredAccountData = this.accountsFilterPipe.transform( + data, + 'share', + this.showClosed ? 'closed' : 'open', + 'isShare' + ); this.dataSource = new MatTableDataSource(filteredAccountData); this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; @@ -40,7 +49,7 @@ export class ShareAccountTableComponent { /** * @param {AccountsFilterPipe} accountsFilterPipe Accounts Filter Pipe. */ - constructor(private accountsFilterPipe: AccountsFilterPipe) { } + constructor(private accountsFilterPipe: AccountsFilterPipe) {} /** * Filters data in users table based on passed value. @@ -55,10 +64,14 @@ export class ShareAccountTableComponent { */ toggleClosed() { this.showClosed = !this.showClosed; - const filteredAccountData = this.accountsFilterPipe.transform(this.accountData, 'share', this.showClosed ? 'closed' : 'open', 'isShare'); + const filteredAccountData = this.accountsFilterPipe.transform( + this.accountData, + 'share', + this.showClosed ? 'closed' : 'open', + 'isShare' + ); this.dataSource = new MatTableDataSource(filteredAccountData); this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/navigation/staff-navigation/staff-navigation.component.spec.ts b/src/app/navigation/staff-navigation/staff-navigation.component.spec.ts index d271edbbd..2fb9f5276 100644 --- a/src/app/navigation/staff-navigation/staff-navigation.component.spec.ts +++ b/src/app/navigation/staff-navigation/staff-navigation.component.spec.ts @@ -8,9 +8,8 @@ describe('StaffNavigationComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ StaffNavigationComponent ] - }) - .compileComponents(); + declarations: [StaffNavigationComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/navigation/staff-navigation/staff-navigation.component.ts b/src/app/navigation/staff-navigation/staff-navigation.component.ts index 1d9bbc3f7..ed79787bd 100644 --- a/src/app/navigation/staff-navigation/staff-navigation.component.ts +++ b/src/app/navigation/staff-navigation/staff-navigation.component.ts @@ -7,10 +7,8 @@ import { Component, Input } from '@angular/core'; styleUrls: ['./staff-navigation.component.scss'] }) export class StaffNavigationComponent { - @Input() employeeData: any; @Input() centerData: any; - constructor() { } - + constructor() {} } diff --git a/src/app/not-found/not-found.component.spec.ts b/src/app/not-found/not-found.component.spec.ts index 35189ed0b..8673a2658 100644 --- a/src/app/not-found/not-found.component.spec.ts +++ b/src/app/not-found/not-found.component.spec.ts @@ -8,9 +8,8 @@ describe('NotFoundComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ NotFoundComponent ] - }) - .compileComponents(); + declarations: [NotFoundComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/not-found/not-found.component.ts b/src/app/not-found/not-found.component.ts index e2c6801b0..4327fec7d 100644 --- a/src/app/not-found/not-found.component.ts +++ b/src/app/not-found/not-found.component.ts @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import {Location} from '@angular/common'; +import { Location } from '@angular/common'; @Component({ selector: 'mifosx-not-found', @@ -7,11 +7,9 @@ import {Location} from '@angular/common'; styleUrls: ['./not-found.component.scss'] }) export class NotFoundComponent { - -constructor(private location: Location) {} + constructor(private location: Location) {} goBack(): void { - this.location.back(); + this.location.back(); } - } diff --git a/src/app/notifications/notifications-page/notifications-page.component.spec.ts b/src/app/notifications/notifications-page/notifications-page.component.spec.ts index 6047a8b14..ccf1e82eb 100644 --- a/src/app/notifications/notifications-page/notifications-page.component.spec.ts +++ b/src/app/notifications/notifications-page/notifications-page.component.spec.ts @@ -8,9 +8,8 @@ describe('NotificationsPageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ NotificationsPageComponent ] - }) - .compileComponents(); + declarations: [NotificationsPageComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/notifications/notifications-page/notifications-page.component.ts b/src/app/notifications/notifications-page/notifications-page.component.ts index c425bbe69..c0ca9c0f3 100644 --- a/src/app/notifications/notifications-page/notifications-page.component.ts +++ b/src/app/notifications/notifications-page/notifications-page.component.ts @@ -14,11 +14,13 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./notifications-page.component.scss'] }) export class NotificationsPageComponent implements OnInit { - /** Notifications data. */ notificationsData: any; /** Columns to be displayed in notifications table. */ - displayedColumns: string[] = ['notification', 'createdAt']; + displayedColumns: string[] = [ + 'notification', + 'createdAt' + ]; /** Data source for notifications table. */ dataSource: MatTableDataSource; @@ -27,16 +29,16 @@ export class NotificationsPageComponent implements OnInit { * Shares, Savings, Deposits, Loans routes inaccessible because of dependency on entity ID. */ routeMap: any = { - 'client' : '/clients/', - 'group' : '/groups/', - 'loan': '/loans-accounts/', - 'center' : '/centers/', - 'shareAccount' : '/shares-accounts/', - 'fixedDeposit' : '/fixed-deposits-accounts/', - 'recurringDepositAccount': '/recurring-deposits-accounts/', - 'savingsAccount' : '/savings-accounts/', - 'shareProduct': '/products/share-products/', - 'loanProduct' : '/products/loan-products/' + client: '/clients/', + group: '/groups/', + loan: '/loans-accounts/', + center: '/centers/', + shareAccount: '/shares-accounts/', + fixedDeposit: '/fixed-deposits-accounts/', + recurringDepositAccount: '/recurring-deposits-accounts/', + savingsAccount: '/savings-accounts/', + shareProduct: '/products/share-products/', + loanProduct: '/products/loan-products/' }; /** Paginator for notifications table. */ @@ -49,7 +51,7 @@ export class NotificationsPageComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { notifications: any }) => { + this.route.data.subscribe((data: { notifications: any }) => { this.notificationsData = data.notifications.pageItems; }); } @@ -69,5 +71,4 @@ export class NotificationsPageComponent implements OnInit { this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/notifications/notifications-routing.module.ts b/src/app/notifications/notifications-routing.module.ts index ff6f5f9fb..b4a413c02 100644 --- a/src/app/notifications/notifications-routing.module.ts +++ b/src/app/notifications/notifications-routing.module.ts @@ -23,6 +23,7 @@ const routes: Routes = [ } } ]) + ]; @NgModule({ @@ -30,4 +31,4 @@ const routes: Routes = [ providers: [NotificationsResolver], exports: [RouterModule] }) -export class NotificationsRoutingModule { } +export class NotificationsRoutingModule {} diff --git a/src/app/notifications/notifications.module.ts b/src/app/notifications/notifications.module.ts index bd5859a73..b284a67c4 100644 --- a/src/app/notifications/notifications.module.ts +++ b/src/app/notifications/notifications.module.ts @@ -22,4 +22,4 @@ import { NotificationsPageComponent } from './notifications-page/notifications-p NotificationsRoutingModule ] }) -export class NotificationsModule { } +export class NotificationsModule {} diff --git a/src/app/notifications/notifications.resolver.ts b/src/app/notifications/notifications.resolver.ts index 253528df5..4fec3edff 100644 --- a/src/app/notifications/notifications.resolver.ts +++ b/src/app/notifications/notifications.resolver.ts @@ -13,7 +13,6 @@ import { NotificationsService } from './notifications.service'; */ @Injectable() export class NotificationsResolver implements Resolve { - /** * @param {NotificationsService} notificationsService Notifications service. */ @@ -26,5 +25,4 @@ export class NotificationsResolver implements Resolve { resolve(): Observable { return this.notificationsService.getNotifications(true, 50); } - } diff --git a/src/app/notifications/notifications.service.ts b/src/app/notifications/notifications.service.ts index 073281c63..ca9e1d099 100644 --- a/src/app/notifications/notifications.service.ts +++ b/src/app/notifications/notifications.service.ts @@ -12,11 +12,10 @@ import { Observable, of } from 'rxjs'; providedIn: 'root' }) export class NotificationsService { - /** * @param {HttpClient} http Http Client to send requests. */ - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * @returns {Observable} Notifications. @@ -30,7 +29,7 @@ export class NotificationsService { * @returns {Observable} Notifications. */ updateNotifications(): Observable { - return this.http.put('/notifications', { }); + return this.http.put('/notifications', {}); } /** @@ -39,20 +38,20 @@ export class NotificationsService { getMockUnreadNotification(): Observable { const date = new Date(); return of({ - 'totalFilteredRecords': 1, - 'pageItems': [ - { 'id': Math.floor(Math.random() * 100), - 'objectType': 'client', - 'objectId': Math.floor(Math.random() * 10), - 'action': 'clientCreated', - 'actorId': 2, - 'content': 'Client Created', - 'isRead': false, - 'isSystemGenerated': false, - 'createdAt': `${date.toLocaleDateString()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}` + totalFilteredRecords: 1, + pageItems: [ + { + id: Math.floor(Math.random() * 100), + objectType: 'client', + objectId: Math.floor(Math.random() * 10), + action: 'clientCreated', + actorId: 2, + content: 'Client Created', + isRead: false, + isSystemGenerated: false, + createdAt: `${date.toLocaleDateString()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}` } ] }); } - } diff --git a/src/app/organization/adhoc-query/adhoc-query-template.resolver.ts b/src/app/organization/adhoc-query/adhoc-query-template.resolver.ts index 8335a1b52..bc0f6c2d8 100644 --- a/src/app/organization/adhoc-query/adhoc-query-template.resolver.ts +++ b/src/app/organization/adhoc-query/adhoc-query-template.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class AdhocQueryTemplateResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class AdhocQueryTemplateResolver implements Resolve { resolve(): Observable { return this.organizationService.getAdhocQueryTemplate(); } - } diff --git a/src/app/organization/adhoc-query/adhoc-query.component.spec.ts b/src/app/organization/adhoc-query/adhoc-query.component.spec.ts index 7bb8b8ed9..4fe968702 100644 --- a/src/app/organization/adhoc-query/adhoc-query.component.spec.ts +++ b/src/app/organization/adhoc-query/adhoc-query.component.spec.ts @@ -8,9 +8,8 @@ describe('AdhocQueryComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AdhocQueryComponent ] - }) - .compileComponents(); + declarations: [AdhocQueryComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/adhoc-query/adhoc-query.component.ts b/src/app/organization/adhoc-query/adhoc-query.component.ts index c12ea4c3b..5d2a13e9b 100644 --- a/src/app/organization/adhoc-query/adhoc-query.component.ts +++ b/src/app/organization/adhoc-query/adhoc-query.component.ts @@ -17,11 +17,18 @@ import { of } from 'rxjs'; styleUrls: ['./adhoc-query.component.scss'] }) export class AdhocQueryComponent implements OnInit { - /** Adhoc Queries data. */ adhocQueriesData: any; /** Columns to be displayed in adhoc queries table. */ - displayedColumns: string[] = ['name', 'query', 'tableName', 'email', 'reportRunFrequency', 'isActive', 'createdBy']; + displayedColumns: string[] = [ + 'name', + 'query', + 'tableName', + 'email', + 'reportRunFrequency', + 'isActive', + 'createdBy' + ]; /** Data source for adhoc queries table. */ dataSource: MatTableDataSource; @@ -35,7 +42,7 @@ export class AdhocQueryComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { adhocQueries: any }) => { + this.route.data.subscribe((data: { adhocQueries: any }) => { this.adhocQueriesData = data.adhocQueries; }); } @@ -77,5 +84,4 @@ export class AdhocQueryComponent implements OnInit { this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/organization/adhoc-query/common-resolvers/adhoc-queries.resolver.ts b/src/app/organization/adhoc-query/common-resolvers/adhoc-queries.resolver.ts index afdc98352..9f2d1f641 100644 --- a/src/app/organization/adhoc-query/common-resolvers/adhoc-queries.resolver.ts +++ b/src/app/organization/adhoc-query/common-resolvers/adhoc-queries.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service'; */ @Injectable() export class AdhocQueriesResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class AdhocQueriesResolver implements Resolve { resolve(): Observable { return this.organizationService.getAdhocQueries(); } - } diff --git a/src/app/organization/adhoc-query/common-resolvers/adhoc-query-and-template.resolver.ts b/src/app/organization/adhoc-query/common-resolvers/adhoc-query-and-template.resolver.ts index 068e9b517..c6bbdf3ab 100644 --- a/src/app/organization/adhoc-query/common-resolvers/adhoc-query-and-template.resolver.ts +++ b/src/app/organization/adhoc-query/common-resolvers/adhoc-query-and-template.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class AdhocQueryAndTemplateResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -27,5 +26,4 @@ export class AdhocQueryAndTemplateResolver implements Resolve { const adhocQueryId = route.paramMap.get('id'); return this.organizationService.getAdhocQueryAndTemplate(adhocQueryId); } - } diff --git a/src/app/organization/adhoc-query/common-resolvers/adhoc-query.resolver.ts b/src/app/organization/adhoc-query/common-resolvers/adhoc-query.resolver.ts index f4ec3096a..72221cf38 100644 --- a/src/app/organization/adhoc-query/common-resolvers/adhoc-query.resolver.ts +++ b/src/app/organization/adhoc-query/common-resolvers/adhoc-query.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class AdhocQueryResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -27,5 +26,4 @@ export class AdhocQueryResolver implements Resolve { const adhocQueryId = route.paramMap.get('id'); return this.organizationService.getAdhocQuery(adhocQueryId); } - } diff --git a/src/app/organization/adhoc-query/create-adhoc-query/create-adhoc-query.component.spec.ts b/src/app/organization/adhoc-query/create-adhoc-query/create-adhoc-query.component.spec.ts index a9422e178..438eeb745 100644 --- a/src/app/organization/adhoc-query/create-adhoc-query/create-adhoc-query.component.spec.ts +++ b/src/app/organization/adhoc-query/create-adhoc-query/create-adhoc-query.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateAdhocQueryComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateAdhocQueryComponent ] - }) - .compileComponents(); + declarations: [CreateAdhocQueryComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/adhoc-query/create-adhoc-query/create-adhoc-query.component.ts b/src/app/organization/adhoc-query/create-adhoc-query/create-adhoc-query.component.ts index d8041e01f..53c83376b 100644 --- a/src/app/organization/adhoc-query/create-adhoc-query/create-adhoc-query.component.ts +++ b/src/app/organization/adhoc-query/create-adhoc-query/create-adhoc-query.component.ts @@ -15,7 +15,6 @@ import { OrganizationService } from '../../organization.service'; styleUrls: ['./create-adhoc-query.component.scss'] }) export class CreateAdhocQueryComponent implements OnInit { - /** Adhoc Query form. */ adhocQueryForm: UntypedFormGroup; /** Adhoc Query template data. */ @@ -30,10 +29,12 @@ export class CreateAdhocQueryComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { adhocQueryTemplate: any }) => { this.adhocQueryTemplateData = data.adhocQueryTemplate; }); @@ -53,13 +54,28 @@ export class CreateAdhocQueryComponent implements OnInit { createAdhocQueryForm() { this.reportRunFrequencyData = this.adhocQueryTemplateData.reportRunFrequencies; this.adhocQueryForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'query': ['', Validators.required], - 'tableName': ['', Validators.required], - 'tableFields': ['', Validators.required], - 'email': ['', Validators.email], - 'reportRunFrequency': [''], - 'isActive': [false] + name: [ + '', + Validators.required + ], + query: [ + '', + Validators.required + ], + tableName: [ + '', + Validators.required + ], + tableFields: [ + '', + Validators.required + ], + email: [ + '', + Validators.email + ], + reportRunFrequency: [''], + isActive: [false] }); } @@ -67,9 +83,14 @@ export class CreateAdhocQueryComponent implements OnInit { * Sets the conditional controls of the adhoc query form */ setConditionalControls() { - this.adhocQueryForm.get('reportRunFrequency').valueChanges.subscribe(reportRunFrequencyId => { + this.adhocQueryForm.get('reportRunFrequency').valueChanges.subscribe((reportRunFrequencyId) => { if (reportRunFrequencyId === 5) { - this.adhocQueryForm.addControl('reportRunEvery', new UntypedFormControl('', [Validators.required, Validators.min(1)])); + this.adhocQueryForm.addControl( + 'reportRunEvery', + new UntypedFormControl('', [ + Validators.required, + Validators.min(1)]) + ); } else { this.adhocQueryForm.removeControl('reportRunEvery'); } @@ -82,8 +103,13 @@ export class CreateAdhocQueryComponent implements OnInit { */ submit() { this.organizationService.createAdhocQuery(this.adhocQueryForm.value).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/organization/adhoc-query/edit-adhoc-query/edit-adhoc-query.component.spec.ts b/src/app/organization/adhoc-query/edit-adhoc-query/edit-adhoc-query.component.spec.ts index d9c88c69e..e9d7ceb47 100644 --- a/src/app/organization/adhoc-query/edit-adhoc-query/edit-adhoc-query.component.spec.ts +++ b/src/app/organization/adhoc-query/edit-adhoc-query/edit-adhoc-query.component.spec.ts @@ -8,9 +8,8 @@ describe('EditAdhocQueryComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditAdhocQueryComponent ] - }) - .compileComponents(); + declarations: [EditAdhocQueryComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/adhoc-query/edit-adhoc-query/edit-adhoc-query.component.ts b/src/app/organization/adhoc-query/edit-adhoc-query/edit-adhoc-query.component.ts index e8b1a9edd..60a0a3d11 100644 --- a/src/app/organization/adhoc-query/edit-adhoc-query/edit-adhoc-query.component.ts +++ b/src/app/organization/adhoc-query/edit-adhoc-query/edit-adhoc-query.component.ts @@ -15,7 +15,6 @@ import { OrganizationService } from '../../organization.service'; styleUrls: ['./edit-adhoc-query.component.scss'] }) export class EditAdhocQueryComponent implements OnInit { - /** Edit Adhoc Query form. */ editAdhocQueryForm: UntypedFormGroup; /** Adhoc Query template data. */ @@ -30,10 +29,12 @@ export class EditAdhocQueryComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private route: ActivatedRoute, + private router: Router + ) { this.route.data.subscribe((data: { adhocQueryAndTemplate: any }) => { this.adhocQueryTemplateData = data.adhocQueryAndTemplate; }); @@ -53,13 +54,28 @@ export class EditAdhocQueryComponent implements OnInit { createEditAdhocQueryForm() { this.reportRunFrequencyData = this.adhocQueryTemplateData.reportRunFrequencies; this.editAdhocQueryForm = this.formBuilder.group({ - 'name': [this.adhocQueryTemplateData.name, Validators.required], - 'query': [this.adhocQueryTemplateData.query, Validators.required], - 'tableName': [this.adhocQueryTemplateData.tableName, Validators.required], - 'tableFields': [this.adhocQueryTemplateData.tableFields, Validators.required], - 'email': [this.adhocQueryTemplateData.email, Validators.email], - 'reportRunFrequency': [''], - 'isActive': [this.adhocQueryTemplateData.isActive] + name: [ + this.adhocQueryTemplateData.name, + Validators.required + ], + query: [ + this.adhocQueryTemplateData.query, + Validators.required + ], + tableName: [ + this.adhocQueryTemplateData.tableName, + Validators.required + ], + tableFields: [ + this.adhocQueryTemplateData.tableFields, + Validators.required + ], + email: [ + this.adhocQueryTemplateData.email, + Validators.email + ], + reportRunFrequency: [''], + isActive: [this.adhocQueryTemplateData.isActive] }); } @@ -67,9 +83,14 @@ export class EditAdhocQueryComponent implements OnInit { * Sets the conditional controls of the adhoc query form */ setConditionalControls() { - this.editAdhocQueryForm.get('reportRunFrequency').valueChanges.subscribe(reportRunFrequencyId => { + this.editAdhocQueryForm.get('reportRunFrequency').valueChanges.subscribe((reportRunFrequencyId) => { if (reportRunFrequencyId === 5) { - this.editAdhocQueryForm.addControl('reportRunEvery', new UntypedFormControl('', [Validators.required, Validators.min(1)])); + this.editAdhocQueryForm.addControl( + 'reportRunEvery', + new UntypedFormControl('', [ + Validators.required, + Validators.min(1)]) + ); this.editAdhocQueryForm.get('reportRunEvery').patchValue(this.adhocQueryTemplateData.reportRunEvery); } else { this.editAdhocQueryForm.removeControl('reportRunEvery'); @@ -83,9 +104,10 @@ export class EditAdhocQueryComponent implements OnInit { * if successful redirects to view adhoc query. */ submit() { - this.organizationService.updateAdhocQuery(this.adhocQueryTemplateData.id, this.editAdhocQueryForm.value).subscribe(() => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.organizationService + .updateAdhocQuery(this.adhocQueryTemplateData.id, this.editAdhocQueryForm.value) + .subscribe(() => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.spec.ts b/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.spec.ts index 517d5c42e..4c9531e00 100644 --- a/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.spec.ts +++ b/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewAdhocQueryComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewAdhocQueryComponent ] - }) - .compileComponents(); + declarations: [ViewAdhocQueryComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.ts b/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.ts index 93cab92e5..7b4ba4ba5 100644 --- a/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.ts +++ b/src/app/organization/adhoc-query/view-adhoc-query/view-adhoc-query.component.ts @@ -18,7 +18,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./view-adhoc-query.component.scss'] }) export class ViewAdhocQueryComponent { - /** Adhoc query data. */ adhocQueryData: any; @@ -29,10 +28,12 @@ export class ViewAdhocQueryComponent { * @param {Router} router Router for navigation. * @param {MatDialog} dialog Dialog reference. */ - constructor(private organizationService: OrganizationService, - private route: ActivatedRoute, - private router: Router, - private dialog: MatDialog) { + constructor( + private organizationService: OrganizationService, + private route: ActivatedRoute, + private router: Router, + private dialog: MatDialog + ) { this.route.data.subscribe((data: { adhocQuery: any }) => { this.adhocQueryData = data.adhocQuery; }); @@ -59,12 +60,10 @@ export class ViewAdhocQueryComponent { }); deleteAdhocQueryDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.organizationService.deleteAdhocQuery(this.adhocQueryData.id) - .subscribe(() => { + this.organizationService.deleteAdhocQuery(this.adhocQueryData.id).subscribe(() => { this.router.navigate(['/organization/adhoc-query']); }); } }); } - } diff --git a/src/app/organization/bulk-import/bulk-import.component.spec.ts b/src/app/organization/bulk-import/bulk-import.component.spec.ts index dc14f588f..21873bd69 100644 --- a/src/app/organization/bulk-import/bulk-import.component.spec.ts +++ b/src/app/organization/bulk-import/bulk-import.component.spec.ts @@ -8,9 +8,8 @@ describe('BulkImportComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ BulkImportComponent ] - }) - .compileComponents(); + declarations: [BulkImportComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/bulk-import/bulk-import.resolver.ts b/src/app/organization/bulk-import/bulk-import.resolver.ts index 167a3833f..064cbcb17 100644 --- a/src/app/organization/bulk-import/bulk-import.resolver.ts +++ b/src/app/organization/bulk-import/bulk-import.resolver.ts @@ -16,14 +16,12 @@ import { BulkImports } from './view-bulk-import/bulk-imports'; */ @Injectable() export class BulkImportResolver implements Resolve { - - bulkImportsArray = BulkImports; + bulkImportsArray = BulkImports; /** * @param {OrganizationService} organizationService Organization service. */ - constructor(private organizationService: OrganizationService) { - } + constructor(private organizationService: OrganizationService) {} /** * Gets bulk-import's entity name @@ -42,5 +40,4 @@ export class BulkImportResolver implements Resolve { const entity = this.getEntityName(route.params['import-name']); return this.organizationService.getImports(entity); } - } diff --git a/src/app/organization/bulk-import/view-bulk-import/bulk-imports.ts b/src/app/organization/bulk-import/view-bulk-import/bulk-imports.ts index 0a05d454f..2071fe14d 100644 --- a/src/app/organization/bulk-import/view-bulk-import/bulk-imports.ts +++ b/src/app/organization/bulk-import/view-bulk-import/bulk-imports.ts @@ -1,129 +1,129 @@ /** TODO: Refactor Permissions */ export const BulkImports = [ - { - name: 'Offices', - entityType: 'offices', - urlSuffix: '/offices', - permission: 'READ_OFFICE', - formFields: 0 - }, - { - name: 'Users', - entityType: 'users', - urlSuffix: '/users', - permission: 'READ_CLIENT', - formFields: 2 - }, - { - name: 'Groups', - entityType: 'groups', - urlSuffix: '/groups', - permission: 'READ_CLIENT', - formFields: 2 - }, - { - name: 'Centers', - entityType: 'centers', - urlSuffix: '/centers', - permission: 'READ_CENTERS', - formFields: 2 - }, - { - name: 'Clients', - entityType: 'client', - urlSuffix: '/clients', - permission: 'READ_CLIENT', - formFields: 3 - }, - { - name: 'Employees', - entityType: 'staff', - urlSuffix: '/staff', - permission: 'READ_CLIENT', - formFields: 1 - }, - { - name: 'Guarantors', - entityType: 'guarantors', - urlSuffix: '/loans/1/guarantors', - permission: 'READ_CLIENT', - formFields: 1 - }, - { - name: 'Journal Entries', - entityType: 'gljournalentries', - urlSuffix: '/journalentries', - permission: 'READ_CLIENT', - formFields: 1 - }, - { - name: 'Loan Accounts', - entityType: 'loans', - urlSuffix: '/loans', - permission: 'READ_CLIENT', - formFields: 2 - }, - { - name: 'Savings Accounts', - entityType: 'savingsaccount', - urlSuffix: '/savingsaccounts', - permission: 'READ_CLIENT', - formFields: 2 - }, - { - name: 'Fixed Deposit Accounts', - entityType: 'fixeddepositaccounts', - urlSuffix: '/fixeddepositaccounts', - permission: 'READ_CLIENT', - formFields: 2 - }, - { - name: 'Reccuring Deposit Accounts', - entityType: 'recurringdeposits', - urlSuffix: '/recurringdepositaccounts', - permission: 'READ_CLIENT', - formFields: 2 - }, - { - name: 'Chart of Accounts', - entityType: 'chartofaccounts', - urlSuffix: '/glaccounts', - permission: 'READ_CLIENT', - formFields: 2 - }, - { - name: 'Share Accounts', - entityType: 'shareaccounts', - urlSuffix: '/accounts/share', - permission: 'READ_CLIENT', - formFields: 1 - }, - { - name: 'Loan Repayments', - entityType: 'loantransactions', - urlSuffix: '/loans/repayments', - permission: 'READ_CLIENT', - formFields: 1 - }, - { - name: 'Savings Transactions', - entityType: 'savingstransactions', - urlSuffix: '/savingsaccounts/transactions', - permission: 'READ_CLIENT', - formFields: 1 - }, - { - name: 'Fixed Deposit Transactions', - entityType: 'fixeddeposittransactions', - urlSuffix: '/fixeddepositaccounts/transaction', - permission: 'READ_CLIENT', - formFields: 1 - }, - { - name: 'Recurring Deposit Transactions', - entityType: 'recurringdepositstransactions', - urlSuffix: '/recurringdepositaccounts/transactions', - permission: 'READ_CLIENT', - formFields: 1 - }, - ]; + { + name: 'Offices', + entityType: 'offices', + urlSuffix: '/offices', + permission: 'READ_OFFICE', + formFields: 0 + }, + { + name: 'Users', + entityType: 'users', + urlSuffix: '/users', + permission: 'READ_CLIENT', + formFields: 2 + }, + { + name: 'Groups', + entityType: 'groups', + urlSuffix: '/groups', + permission: 'READ_CLIENT', + formFields: 2 + }, + { + name: 'Centers', + entityType: 'centers', + urlSuffix: '/centers', + permission: 'READ_CENTERS', + formFields: 2 + }, + { + name: 'Clients', + entityType: 'client', + urlSuffix: '/clients', + permission: 'READ_CLIENT', + formFields: 3 + }, + { + name: 'Employees', + entityType: 'staff', + urlSuffix: '/staff', + permission: 'READ_CLIENT', + formFields: 1 + }, + { + name: 'Guarantors', + entityType: 'guarantors', + urlSuffix: '/loans/1/guarantors', + permission: 'READ_CLIENT', + formFields: 1 + }, + { + name: 'Journal Entries', + entityType: 'gljournalentries', + urlSuffix: '/journalentries', + permission: 'READ_CLIENT', + formFields: 1 + }, + { + name: 'Loan Accounts', + entityType: 'loans', + urlSuffix: '/loans', + permission: 'READ_CLIENT', + formFields: 2 + }, + { + name: 'Savings Accounts', + entityType: 'savingsaccount', + urlSuffix: '/savingsaccounts', + permission: 'READ_CLIENT', + formFields: 2 + }, + { + name: 'Fixed Deposit Accounts', + entityType: 'fixeddepositaccounts', + urlSuffix: '/fixeddepositaccounts', + permission: 'READ_CLIENT', + formFields: 2 + }, + { + name: 'Reccuring Deposit Accounts', + entityType: 'recurringdeposits', + urlSuffix: '/recurringdepositaccounts', + permission: 'READ_CLIENT', + formFields: 2 + }, + { + name: 'Chart of Accounts', + entityType: 'chartofaccounts', + urlSuffix: '/glaccounts', + permission: 'READ_CLIENT', + formFields: 2 + }, + { + name: 'Share Accounts', + entityType: 'shareaccounts', + urlSuffix: '/accounts/share', + permission: 'READ_CLIENT', + formFields: 1 + }, + { + name: 'Loan Repayments', + entityType: 'loantransactions', + urlSuffix: '/loans/repayments', + permission: 'READ_CLIENT', + formFields: 1 + }, + { + name: 'Savings Transactions', + entityType: 'savingstransactions', + urlSuffix: '/savingsaccounts/transactions', + permission: 'READ_CLIENT', + formFields: 1 + }, + { + name: 'Fixed Deposit Transactions', + entityType: 'fixeddeposittransactions', + urlSuffix: '/fixeddepositaccounts/transaction', + permission: 'READ_CLIENT', + formFields: 1 + }, + { + name: 'Recurring Deposit Transactions', + entityType: 'recurringdepositstransactions', + urlSuffix: '/recurringdepositaccounts/transactions', + permission: 'READ_CLIENT', + formFields: 1 + } +]; diff --git a/src/app/organization/bulk-import/view-bulk-import/view-bulk-import.component.spec.ts b/src/app/organization/bulk-import/view-bulk-import/view-bulk-import.component.spec.ts index b48b23143..4bf73e60f 100644 --- a/src/app/organization/bulk-import/view-bulk-import/view-bulk-import.component.spec.ts +++ b/src/app/organization/bulk-import/view-bulk-import/view-bulk-import.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewBulkImportComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewBulkImportComponent ] - }) - .compileComponents(); + declarations: [ViewBulkImportComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/bulk-import/view-bulk-import/view-bulk-import.component.ts b/src/app/organization/bulk-import/view-bulk-import/view-bulk-import.component.ts index 031eef00f..81993a259 100644 --- a/src/app/organization/bulk-import/view-bulk-import/view-bulk-import.component.ts +++ b/src/app/organization/bulk-import/view-bulk-import/view-bulk-import.component.ts @@ -4,7 +4,7 @@ import { ActivatedRoute } from '@angular/router'; import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { MatTableDataSource, MatTable } from '@angular/material/table'; -import { UntypedFormGroup, UntypedFormBuilder} from '@angular/forms'; +import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms'; /** Custom Imports */ import { OrganizationService } from '../../organization.service'; @@ -19,7 +19,6 @@ import { BulkImports } from './bulk-imports'; styleUrls: ['./view-bulk-import.component.scss'] }) export class ViewBulkImportComponent implements OnInit { - /** offices Data */ officeData: any; /** staff Data */ @@ -37,8 +36,7 @@ export class ViewBulkImportComponent implements OnInit { /** Data source for imports table. */ dataSource = new MatTableDataSource(); /** Columns to be displayed in imports table. */ - displayedColumns: string[] = - [ + displayedColumns: string[] = [ 'name', 'importTime', 'endTime', @@ -62,12 +60,13 @@ export class ViewBulkImportComponent implements OnInit { * @param {FormBuilder} formBuilder FormBuilder * @param {OrganizationService} organizationService OrganizationService */ - constructor(private route: ActivatedRoute, - private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - ) { + constructor( + private route: ActivatedRoute, + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService + ) { this.bulkImport.name = this.route.snapshot.params['import-name']; - this.route.data.subscribe( (data: any) => { + this.route.data.subscribe((data: any) => { this.officeData = data.offices; this.importsData = data.imports; }); @@ -77,7 +76,7 @@ export class ViewBulkImportComponent implements OnInit { * Gets bulk import's properties. */ ngOnInit() { - this.bulkImport = this.bulkImportsArray.find( (entry) => entry.name === this.bulkImport.name); + this.bulkImport = this.bulkImportsArray.find((entry) => entry.name === this.bulkImport.name); this.createBulkImportForm(); this.buildDependencies(); this.setImports(); @@ -88,9 +87,9 @@ export class ViewBulkImportComponent implements OnInit { */ createBulkImportForm() { this.bulkImportForm = this.formBuilder.group({ - 'officeId': [''], - 'staffId': [''], - 'legalForm': [''], + officeId: [''], + staffId: [''], + legalForm: [''] }); } @@ -100,7 +99,7 @@ export class ViewBulkImportComponent implements OnInit { buildDependencies() { this.bulkImportForm.get('officeId').valueChanges.subscribe((value: any) => { if (this.bulkImport.formFields >= 2) { - this.organizationService.getStaff(value).subscribe( (data: any) => { + this.organizationService.getStaff(value).subscribe((data: any) => { this.staffData = data; }); } @@ -126,18 +125,20 @@ export class ViewBulkImportComponent implements OnInit { /** Only for Client Bulk Imports */ switch (this.bulkImportForm.get('legalForm').value) { case 'Person': - legalFormType = 'CLIENTS_PERSON'; + legalFormType = 'CLIENTS_PERSON'; break; case 'Entity': - legalFormType = 'CLIENTS_ENTITY'; + legalFormType = 'CLIENTS_ENTITY'; break; } - this.organizationService.getImportTemplate(this.bulkImport.urlSuffix, officeId, staffId, legalFormType).subscribe( (res: any) => { - const contentType = res.headers.get('Content-Type'); - const blob = new Blob([res.body], { type: contentType }); - const fileOfBlob = new File([blob], 'template.xls', { type: contentType }); - window.open(window.URL.createObjectURL(fileOfBlob)); - }); + this.organizationService + .getImportTemplate(this.bulkImport.urlSuffix, officeId, staffId, legalFormType) + .subscribe((res: any) => { + const contentType = res.headers.get('Content-Type'); + const blob = new Blob([res.body], { type: contentType }); + const fileOfBlob = new File([blob], 'template.xls', { type: contentType }); + window.open(window.URL.createObjectURL(fileOfBlob)); + }); } /** @@ -163,15 +164,17 @@ export class ViewBulkImportComponent implements OnInit { legalFormType = 'CLIENTS_PERSON'; } } - this.organizationService.uploadImportDocument(this.template, this.bulkImport.urlSuffix, legalFormType).subscribe(() => {}); + this.organizationService + .uploadImportDocument(this.template, this.bulkImport.urlSuffix, legalFormType) + .subscribe(() => {}); } /** * Reloads imports data table. */ refreshDocuments() { - this.organizationService.getImports(this.bulkImport.entityType).subscribe( (data: any) => { - this.dataSource = new MatTableDataSource(data); + this.organizationService.getImports(this.bulkImport.entityType).subscribe((data: any) => { + this.dataSource = new MatTableDataSource(data); this.importsTableRef.renderRows(); }); } @@ -182,12 +185,11 @@ export class ViewBulkImportComponent implements OnInit { * @param {any} id ImportID */ downloadDocument(name: string, id: any) { - this.organizationService.getImportDocument(id).subscribe( (res: any) => { + this.organizationService.getImportDocument(id).subscribe((res: any) => { const contentType = res.headers.get('Content-Type'); const blob = new Blob([res.body], { type: contentType }); const fileOfBlob = new File([blob], name, { type: contentType }); window.open(window.URL.createObjectURL(fileOfBlob)); }); } - } diff --git a/src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.spec.ts b/src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.spec.ts index a929403d7..a837f1760 100644 --- a/src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.spec.ts +++ b/src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.spec.ts @@ -8,9 +8,8 @@ describe('BulkLoanReassignmnetComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ BulkLoanReassignmnetComponent ] - }) - .compileComponents(); + declarations: [BulkLoanReassignmnetComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.ts b/src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.ts index 577f88cc5..bbf988c54 100644 --- a/src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.ts +++ b/src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./bulk-loan-reassignmnet.component.scss'] }) export class BulkLoanReassignmnetComponent implements OnInit { - /** Bulk Loan form. */ bulkLoanForm: UntypedFormGroup; /** Office data. */ @@ -45,13 +44,15 @@ export class BulkLoanReassignmnetComponent implements OnInit { * @param {SettingsService} settingsService Settings Service. * @param {Router} router Router. */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private organizationSevice: OrganizationService, - private settingsService: SettingsService, - private dateUtils: Dates, - private router: Router) { - this.route.data.subscribe((data: { offices: any} ) => { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private organizationSevice: OrganizationService, + private settingsService: SettingsService, + private dateUtils: Dates, + private router: Router + ) { + this.route.data.subscribe((data: { offices: any }) => { this.offices = data.offices; }); } @@ -66,8 +67,14 @@ export class BulkLoanReassignmnetComponent implements OnInit { */ setBulkLoanForm() { this.bulkLoanForm = this.formBuilder.group({ - 'assignmentDate': [new Date(), Validators.required], - 'toLoanOfficerId': ['', Validators.required] + assignmentDate: [ + new Date(), + Validators.required + ], + toLoanOfficerId: [ + '', + Validators.required + ] }); } @@ -88,7 +95,7 @@ export class BulkLoanReassignmnetComponent implements OnInit { * @param officerId Office Id. */ getFromOfficers(officerId: any) { - this.toLoanOfficers = this.fromLoanOfficers.filter((officer: any) => officer.id !== officerId ); + this.toLoanOfficers = this.fromLoanOfficers.filter((officer: any) => officer.id !== officerId); this.organizationSevice.getOfficerTemplate(officerId, this.officeTemplate.id).subscribe((response: any) => { this.officerTemplate = response; }); @@ -130,5 +137,4 @@ export class BulkLoanReassignmnetComponent implements OnInit { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/organization/currencies/currencies.component.spec.ts b/src/app/organization/currencies/currencies.component.spec.ts index e0d1232a8..889549435 100644 --- a/src/app/organization/currencies/currencies.component.spec.ts +++ b/src/app/organization/currencies/currencies.component.spec.ts @@ -8,9 +8,8 @@ describe('CurrenciesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CurrenciesComponent ] - }) - .compileComponents(); + declarations: [CurrenciesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/currencies/currencies.component.ts b/src/app/organization/currencies/currencies.component.ts index ffe6f1fe8..0294c4416 100644 --- a/src/app/organization/currencies/currencies.component.ts +++ b/src/app/organization/currencies/currencies.component.ts @@ -20,12 +20,14 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura templateUrl: './currencies.component.html', styleUrls: ['./currencies.component.scss'] }) -export class CurrenciesComponent implements OnInit, AfterViewInit { - +export class CurrenciesComponent implements OnInit, AfterViewInit { /** Currencies data. */ currenciesData: any; /** Columns to be displayed in currencies table. */ - displayedColumns: string[] = ['name', 'code']; + displayedColumns: string[] = [ + 'name', + 'code' + ]; /** Data source for currencies table. */ dataSource: MatTableDataSource; @@ -50,11 +52,13 @@ export class CurrenciesComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private route: ActivatedRoute, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { - this.route.data.subscribe(( data: { currencies: any }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { + this.route.data.subscribe((data: { currencies: any }) => { this.currenciesData = data.currencies.selectedCurrencyOptions; }); } @@ -90,7 +94,12 @@ export class CurrenciesComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -100,13 +109,13 @@ export class CurrenciesComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showCurrencyPage === true) { setTimeout(() => { - this.showPopover(this.templateButtonAddEdit, this.buttonAddEdit.nativeElement, 'bottom', true); + this.showPopover(this.templateButtonAddEdit, this.buttonAddEdit.nativeElement, 'bottom', true); }); } if (this.configurationWizardService.showCurrencyList === true) { setTimeout(() => { - this.showPopover(this.templateTableCurrencies, this.tableCurrencies.nativeElement, 'top', true); + this.showPopover(this.templateTableCurrencies, this.tableCurrencies.nativeElement, 'top', true); }); } } @@ -130,5 +139,4 @@ export class CurrenciesComponent implements OnInit, AfterViewInit { this.configurationWizardService.showAddEditCurrency = true; this.router.navigate(['/organization']); } - } diff --git a/src/app/organization/currencies/currencies.resolver.ts b/src/app/organization/currencies/currencies.resolver.ts index 1f674072e..c505f2a49 100644 --- a/src/app/organization/currencies/currencies.resolver.ts +++ b/src/app/organization/currencies/currencies.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service'; */ @Injectable() export class CurrenciesResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class CurrenciesResolver implements Resolve { resolve(): Observable { return this.organizationService.getCurrencies(); } - } diff --git a/src/app/organization/currencies/manage-currencies/manage-currencies.component.spec.ts b/src/app/organization/currencies/manage-currencies/manage-currencies.component.spec.ts index fbae113a6..86162118b 100644 --- a/src/app/organization/currencies/manage-currencies/manage-currencies.component.spec.ts +++ b/src/app/organization/currencies/manage-currencies/manage-currencies.component.spec.ts @@ -8,9 +8,8 @@ describe('ManageCurrenciesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ManageCurrenciesComponent ] - }) - .compileComponents(); + declarations: [ManageCurrenciesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/currencies/manage-currencies/manage-currencies.component.ts b/src/app/organization/currencies/manage-currencies/manage-currencies.component.ts index 7b050cde8..db18804bc 100644 --- a/src/app/organization/currencies/manage-currencies/manage-currencies.component.ts +++ b/src/app/organization/currencies/manage-currencies/manage-currencies.component.ts @@ -1,5 +1,15 @@ /** Angular Imports */ -import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit, OnDestroy, OnChanges, SimpleChanges } from '@angular/core'; +import { + Component, + OnInit, + TemplateRef, + ElementRef, + ViewChild, + AfterViewInit, + OnDestroy, + OnChanges, + SimpleChanges +} from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { MatDialog } from '@angular/material/dialog'; import { UntypedFormBuilder, UntypedFormControl, Validators } from '@angular/forms'; @@ -27,7 +37,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./manage-currencies.component.scss'] }) export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestroy, OnChanges { - /** Selected Currencies data. */ selectedCurrencies: any[]; /** Currency options data */ @@ -56,23 +65,23 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr * @param {OrganizationService} organizationservice Organization Service * @param {MatDialog} dialog Mat Dialog */ - constructor(private route: ActivatedRoute, - private formBuilder: UntypedFormBuilder, - private organizationservice: OrganizationService, - public dialog: MatDialog, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { - this.route.parent.data.subscribe(( data: { currencies: any }) => { + constructor( + private route: ActivatedRoute, + private formBuilder: UntypedFormBuilder, + private organizationservice: OrganizationService, + public dialog: MatDialog, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { + this.route.parent.data.subscribe((data: { currencies: any }) => { this.selectedCurrencies = data.currencies.selectedCurrencyOptions; this.currencyList = data.currencies.currencyOptions; }); } ngOnInit() { - this.filterFormCtrl.valueChanges - .pipe(takeUntil(this._onDestroy)) - .subscribe(() => { + this.filterFormCtrl.valueChanges.pipe(takeUntil(this._onDestroy)).subscribe(() => { this.searchItem(); }); this.createCurrencyForm(); @@ -94,7 +103,10 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr */ createCurrencyForm() { this.currencyForm = this.formBuilder.group({ - 'currency': ['', Validators.required] + currency: [ + '', + Validators.required + ] }); } @@ -103,11 +115,13 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr const search: string = this.filterFormCtrl.value.toLowerCase(); if (!search) { - this.currencyData.next(this.currencyList.slice()); + this.currencyData.next(this.currencyList.slice()); } else { - this.currencyData.next(this.currencyList.filter((option: Currency) => { - return option.name.toLowerCase().indexOf(search) >= 0 || option.code.toLowerCase().indexOf(search) >= 0; - })); + this.currencyData.next( + this.currencyList.filter((option: Currency) => { + return option.name.toLowerCase().indexOf(search) >= 0 || option.code.toLowerCase().indexOf(search) >= 0; + }) + ); } } } @@ -117,18 +131,17 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr */ addCurrency() { const newCurrency = this.currencyForm.value.currency; - const selectedCurrencyCodes: any[] = this.selectedCurrencies.map(currency => currency.code); + const selectedCurrencyCodes: any[] = this.selectedCurrencies.map((currency) => currency.code); if (!selectedCurrencyCodes.includes(newCurrency.code)) { selectedCurrencyCodes.push(newCurrency.code); - this.organizationservice.updateCurrencies(selectedCurrencyCodes) - .subscribe((response: any) => { - this.selectedCurrencies.push(newCurrency); - this.formRef.resetForm(); - if (this.configurationWizardService.showCurrencyForm === true) { - this.configurationWizardService.showCurrencyForm = false; - this.openDialog(); - } - }); + this.organizationservice.updateCurrencies(selectedCurrencyCodes).subscribe((response: any) => { + this.selectedCurrencies.push(newCurrency); + this.formRef.resetForm(); + if (this.configurationWizardService.showCurrencyForm === true) { + this.configurationWizardService.showCurrencyForm = false; + this.openDialog(); + } + }); } } @@ -138,30 +151,34 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr * @param {number} index Index */ deleteCurrency(currencyCode: string, index: number) { - const selectedCurrencyCodes: any[] = this.selectedCurrencies.map(currency => currency.code); + const selectedCurrencyCodes: any[] = this.selectedCurrencies.map((currency) => currency.code); selectedCurrencyCodes.splice(index, 1); const deleteCurrencyDialogRef = this.dialog.open(DeleteDialogComponent, { data: { deleteContext: `currency: ${currencyCode}` } }); deleteCurrencyDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.organizationservice.updateCurrencies(selectedCurrencyCodes) - .subscribe(() => { - this.selectedCurrencies.splice(index, 1); - this.formRef.resetForm(); - }); + this.organizationservice.updateCurrencies(selectedCurrencyCodes).subscribe(() => { + this.selectedCurrencies.splice(index, 1); + this.formRef.resetForm(); + }); } }); } - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } ngAfterViewInit() { if (this.configurationWizardService.showCurrencyForm === true) { setTimeout(() => { - this.showPopover(this.templateCurrencyFormRef, this.currencyFormRef.nativeElement, 'bottom', true); + this.showPopover(this.templateCurrencyFormRef, this.currencyFormRef.nativeElement, 'bottom', true); }); } } @@ -182,10 +199,10 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, { data: { stepName: 'currency' - }, + } }); continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => { - if (response.step === 1) { + if (response.step === 1) { this.configurationWizardService.showCurrencyForm = false; this.router.navigate(['../'], { relativeTo: this.route }); } else if (response.step === 2) { diff --git a/src/app/organization/employees/create-employee/create-employee.component.spec.ts b/src/app/organization/employees/create-employee/create-employee.component.spec.ts index 916d3f59f..95826fcc9 100644 --- a/src/app/organization/employees/create-employee/create-employee.component.spec.ts +++ b/src/app/organization/employees/create-employee/create-employee.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateEmployeeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateEmployeeComponent ] - }) - .compileComponents(); + declarations: [CreateEmployeeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/employees/create-employee/create-employee.component.ts b/src/app/organization/employees/create-employee/create-employee.component.ts index 64bbdc5b1..b40100676 100644 --- a/src/app/organization/employees/create-employee/create-employee.component.ts +++ b/src/app/organization/employees/create-employee/create-employee.component.ts @@ -1,5 +1,5 @@ /** Angular Imports */ -import { Component, OnInit , TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core'; +import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core'; import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms'; import { Router, ActivatedRoute } from '@angular/router'; @@ -23,7 +23,6 @@ import { ContinueSetupDialogComponent } from '../../../configuration-wizard/cont styleUrls: ['./create-employee.component.scss'] }) export class CreateEmployeeComponent implements OnInit, AfterViewInit { - /** Minimum joining date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum joining date allowed. */ @@ -50,15 +49,17 @@ export class CreateEmployeeComponent implements OnInit, AfterViewInit { * @param {PopoverService} popoverService PopoverService. * @param {MatDialog} dialog MatDialog. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private settingsService: SettingsService, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService, - public dialog: MatDialog) { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private settingsService: SettingsService, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService, + public dialog: MatDialog + ) { this.route.data.subscribe((data: { offices: any }) => { this.officeData = data.offices; }); @@ -77,12 +78,28 @@ export class CreateEmployeeComponent implements OnInit, AfterViewInit { */ createEmployeeForm() { this.employeeForm = this.formBuilder.group({ - 'officeId': ['', Validators.required], - 'firstname': ['', [Validators.required, Validators.pattern('(^[A-z]).*')]], - 'lastname': ['', [Validators.required, Validators.pattern('(^[A-z]).*')]], - 'isLoanOfficer': [false], - 'mobileNo': [''], - 'joiningDate': ['', Validators.required], + officeId: [ + '', + Validators.required + ], + firstname: [ + '', + [ + Validators.required, + Validators.pattern('(^[A-z]).*')] + ], + lastname: [ + '', + [ + Validators.required, + Validators.pattern('(^[A-z]).*')] + ], + isLoanOfficer: [false], + mobileNo: [''], + joiningDate: [ + '', + Validators.required + ] }); } @@ -120,7 +137,12 @@ export class CreateEmployeeComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -130,7 +152,7 @@ export class CreateEmployeeComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showEmployeeForm === true) { setTimeout(() => { - this.showPopover(this.templateCreateEmployeeForm, this.createEmployeeFormRef.nativeElement, 'right', true); + this.showPopover(this.templateCreateEmployeeForm, this.createEmployeeFormRef.nativeElement, 'right', true); }); } } @@ -160,7 +182,7 @@ export class CreateEmployeeComponent implements OnInit, AfterViewInit { const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, { data: { stepName: 'employee' - }, + } }); continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => { if (response.step === 1) { @@ -178,5 +200,4 @@ export class CreateEmployeeComponent implements OnInit, AfterViewInit { } }); } - } diff --git a/src/app/organization/employees/edit-employee.resolver.ts b/src/app/organization/employees/edit-employee.resolver.ts index 67afb90f7..81b62cb22 100644 --- a/src/app/organization/employees/edit-employee.resolver.ts +++ b/src/app/organization/employees/edit-employee.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service'; */ @Injectable() export class EditEmployeeResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -24,8 +23,7 @@ export class EditEmployeeResolver implements Resolve { * @returns {Observable} */ resolve(route: ActivatedRouteSnapshot): Observable { - const employeeId = route.paramMap.get('id'); + const employeeId = route.paramMap.get('id'); return this.organizationService.getEmployee(employeeId); } - } diff --git a/src/app/organization/employees/edit-employee/edit-employee.component.spec.ts b/src/app/organization/employees/edit-employee/edit-employee.component.spec.ts index ad008d708..e64b4532e 100644 --- a/src/app/organization/employees/edit-employee/edit-employee.component.spec.ts +++ b/src/app/organization/employees/edit-employee/edit-employee.component.spec.ts @@ -8,9 +8,8 @@ describe('EditEmployeeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditEmployeeComponent ] - }) - .compileComponents(); + declarations: [EditEmployeeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/employees/edit-employee/edit-employee.component.ts b/src/app/organization/employees/edit-employee/edit-employee.component.ts index ad7e882c2..fba1f7682 100644 --- a/src/app/organization/employees/edit-employee/edit-employee.component.ts +++ b/src/app/organization/employees/edit-employee/edit-employee.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./edit-employee.component.scss'] }) export class EditEmployeeComponent implements OnInit { - /** Employee data. */ employeeData: any; /** Minimum joining date allowed. */ @@ -38,13 +37,15 @@ export class EditEmployeeComponent implements OnInit { * @param {Router} router Router for navigation. * @param {Dates} dateUtils Date Utils to format date. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private settingsService: SettingsService, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates) { - this.route.data.subscribe((data: { employee: any, offices: any }) => { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private settingsService: SettingsService, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates + ) { + this.route.data.subscribe((data: { employee: any; offices: any }) => { this.employeeData = data.employee; this.officeData = data.employee.allowedOffices; }); @@ -63,13 +64,29 @@ export class EditEmployeeComponent implements OnInit { */ createEditEmployeeForm() { this.editEmployeeForm = this.formBuilder.group({ - 'officeId': [this.employeeData.officeId, Validators.required], - 'firstname': [this.employeeData.firstname, [Validators.required, Validators.pattern('(^[A-z]).*')]], - 'lastname': [this.employeeData.lastname, [Validators.required, Validators.pattern('(^[A-z]).*')]], - 'isLoanOfficer': [this.employeeData.isLoanOfficer], - 'mobileNo': [this.employeeData.mobileNo], - 'isActive': [this.employeeData.isActive], - 'joiningDate': [this.employeeData.joiningDate && new Date(this.employeeData.joiningDate), Validators.required] + officeId: [ + this.employeeData.officeId, + Validators.required + ], + firstname: [ + this.employeeData.firstname, + [ + Validators.required, + Validators.pattern('(^[A-z]).*')] + ], + lastname: [ + this.employeeData.lastname, + [ + Validators.required, + Validators.pattern('(^[A-z]).*')] + ], + isLoanOfficer: [this.employeeData.isLoanOfficer], + mobileNo: [this.employeeData.mobileNo], + isActive: [this.employeeData.isActive], + joiningDate: [ + this.employeeData.joiningDate && new Date(this.employeeData.joiningDate), + Validators.required + ] }); } @@ -91,8 +108,13 @@ export class EditEmployeeComponent implements OnInit { locale }; this.organizationService.updateEmployee(this.employeeData.id, data).subscribe((response: any) => { - this.router.navigate(['../../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/organization/employees/employee.resolver.ts b/src/app/organization/employees/employee.resolver.ts index 279658341..ef1c6ca9d 100644 --- a/src/app/organization/employees/employee.resolver.ts +++ b/src/app/organization/employees/employee.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class EmployeeResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -24,8 +23,7 @@ export class EmployeeResolver implements Resolve { * @returns {Observable} */ resolve(route: ActivatedRouteSnapshot): Observable { - const employeeId = route.paramMap.get('id'); + const employeeId = route.paramMap.get('id'); return this.organizationService.getEmployee(employeeId); } - } diff --git a/src/app/organization/employees/employees.component.spec.ts b/src/app/organization/employees/employees.component.spec.ts index a15bc296f..b80b39e8d 100644 --- a/src/app/organization/employees/employees.component.spec.ts +++ b/src/app/organization/employees/employees.component.spec.ts @@ -8,9 +8,8 @@ describe('EmployeesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EmployeesComponent ] - }) - .compileComponents(); + declarations: [EmployeesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/employees/employees.component.ts b/src/app/organization/employees/employees.component.ts index 542d47e04..c34da0038 100644 --- a/src/app/organization/employees/employees.component.ts +++ b/src/app/organization/employees/employees.component.ts @@ -21,11 +21,15 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura styleUrls: ['./employees.component.scss'] }) export class EmployeesComponent implements OnInit, AfterViewInit { - /** Employees data. */ employeesData: any; /** Columns to be displayed in employees table. */ - displayedColumns: string[] = ['displayName', 'isLoanOfficer', 'officeName', 'isActive']; + displayedColumns: string[] = [ + 'displayName', + 'isLoanOfficer', + 'officeName', + 'isActive' + ]; /** Data source for employees table. */ dataSource: MatTableDataSource; @@ -50,11 +54,13 @@ export class EmployeesComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private route: ActivatedRoute, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { - this.route.data.subscribe(( data: { employees: any }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { + this.route.data.subscribe((data: { employees: any }) => { this.employeesData = data.employees; }); } @@ -90,7 +96,12 @@ export class EmployeesComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -100,12 +111,12 @@ export class EmployeesComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showEmployeeList === true) { setTimeout(() => { - this.showPopover(this.templateButtonImportEmployees, this.buttonImportEmployees.nativeElement, 'bottom', true); + this.showPopover(this.templateButtonImportEmployees, this.buttonImportEmployees.nativeElement, 'bottom', true); }); } if (this.configurationWizardService.showEmployeeTable === true) { setTimeout(() => { - this.showPopover(this.templateTableEmployees, this.tableEmployees.nativeElement, 'top', true); + this.showPopover(this.templateTableEmployees, this.tableEmployees.nativeElement, 'top', true); }); } } @@ -129,5 +140,4 @@ export class EmployeesComponent implements OnInit, AfterViewInit { this.configurationWizardService.showCreateEmployee = true; this.router.navigate(['/organization']); } - } diff --git a/src/app/organization/employees/employees.resolver.ts b/src/app/organization/employees/employees.resolver.ts index 76e42e0cc..a533d0f3a 100644 --- a/src/app/organization/employees/employees.resolver.ts +++ b/src/app/organization/employees/employees.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service'; */ @Injectable() export class EmployeesResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class EmployeesResolver implements Resolve { resolve(): Observable { return this.organizationService.getEmployees(); } - } diff --git a/src/app/organization/employees/view-employee/view-employee.component.spec.ts b/src/app/organization/employees/view-employee/view-employee.component.spec.ts index 03efce7e6..9dd513213 100644 --- a/src/app/organization/employees/view-employee/view-employee.component.spec.ts +++ b/src/app/organization/employees/view-employee/view-employee.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewEmployeeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewEmployeeComponent ] - }) - .compileComponents(); + declarations: [ViewEmployeeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/employees/view-employee/view-employee.component.ts b/src/app/organization/employees/view-employee/view-employee.component.ts index 3c8dbf82f..74f0ab27c 100644 --- a/src/app/organization/employees/view-employee/view-employee.component.ts +++ b/src/app/organization/employees/view-employee/view-employee.component.ts @@ -11,7 +11,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-employee.component.scss'] }) export class ViewEmployeeComponent { - /** Employee data. */ employeeData: any; @@ -24,5 +23,4 @@ export class ViewEmployeeComponent { this.employeeData = data.employee; }); } - } diff --git a/src/app/organization/entity-data-table-checks/create-enity-data-table-checks/create-enity-data-table-checks.component.spec.ts b/src/app/organization/entity-data-table-checks/create-enity-data-table-checks/create-enity-data-table-checks.component.spec.ts index 7eafc9824..b63aed28e 100644 --- a/src/app/organization/entity-data-table-checks/create-enity-data-table-checks/create-enity-data-table-checks.component.spec.ts +++ b/src/app/organization/entity-data-table-checks/create-enity-data-table-checks/create-enity-data-table-checks.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateEnityDataTableChecksComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateEnityDataTableChecksComponent ] - }) - .compileComponents(); + declarations: [CreateEnityDataTableChecksComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/entity-data-table-checks/create-enity-data-table-checks/create-enity-data-table-checks.component.ts b/src/app/organization/entity-data-table-checks/create-enity-data-table-checks/create-enity-data-table-checks.component.ts index 9944a6c98..b4c7645df 100644 --- a/src/app/organization/entity-data-table-checks/create-enity-data-table-checks/create-enity-data-table-checks.component.ts +++ b/src/app/organization/entity-data-table-checks/create-enity-data-table-checks/create-enity-data-table-checks.component.ts @@ -15,7 +15,6 @@ import { OrganizationService } from 'app/organization/organization.service'; styleUrls: ['./create-enity-data-table-checks.component.scss'] }) export class CreateEnityDataTableChecksComponent implements OnInit { - /** Create Entity Datatable Checks form. */ createEntityForm: UntypedFormGroup; /** Entity Datatable Checks data. */ @@ -36,11 +35,13 @@ export class CreateEnityDataTableChecksComponent implements OnInit { * @param {OrganizationService} organizationService Organization Service. * @param {Router} router Router. */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private organizationService: OrganizationService, - private router: Router) { - this.route.data.subscribe((data: {dataTableEntity: any}) => { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private organizationService: OrganizationService, + private router: Router + ) { + this.route.data.subscribe((data: { dataTableEntity: any }) => { this.createEntityData = data.dataTableEntity; this.entityTypes = [ { name: 'Client', value: this.createEntityData.entities[0] }, @@ -61,9 +62,18 @@ export class CreateEnityDataTableChecksComponent implements OnInit { */ setCreateEntityDataTableForm() { this.createEntityForm = this.formBuilder.group({ - 'entity': ['', Validators.required], - 'status': ['', Validators.required], - 'datatableName': ['', Validators.required] + entity: [ + '', + Validators.required + ], + status: [ + '', + Validators.required + ], + datatableName: [ + '', + Validators.required + ] }); } @@ -95,9 +105,11 @@ export class CreateEnityDataTableChecksComponent implements OnInit { this.createEntityForm.removeControl('productId'); break; } - default : { + default: { this.entityType = 'm_savings_account'; - this.dataTableList = this.createEntityData.datatables.filter((data: any) => data.entity === 'm_savings_account'); + this.dataTableList = this.createEntityData.datatables.filter( + (data: any) => data.entity === 'm_savings_account' + ); this.statusList = this.createEntityData.statusSavings; this.createEntityForm.addControl('productId', new UntypedFormControl('', Validators.required)); break; @@ -114,5 +126,4 @@ export class CreateEnityDataTableChecksComponent implements OnInit { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/organization/entity-data-table-checks/enitity-data-table-checks-template.resolver.ts b/src/app/organization/entity-data-table-checks/enitity-data-table-checks-template.resolver.ts index 42377d2f1..3937ac8a1 100644 --- a/src/app/organization/entity-data-table-checks/enitity-data-table-checks-template.resolver.ts +++ b/src/app/organization/entity-data-table-checks/enitity-data-table-checks-template.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service'; */ @Injectable() export class EntityDataTableChecksTemplateResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class EntityDataTableChecksTemplateResolver implements Resolve { resolve(): Observable { return this.organizationService.getEntityDataTableChecksTemplate(); } - } diff --git a/src/app/organization/entity-data-table-checks/entity-data-table-checks.component.spec.ts b/src/app/organization/entity-data-table-checks/entity-data-table-checks.component.spec.ts index 650157fb5..8c9ce7b37 100644 --- a/src/app/organization/entity-data-table-checks/entity-data-table-checks.component.spec.ts +++ b/src/app/organization/entity-data-table-checks/entity-data-table-checks.component.spec.ts @@ -8,9 +8,8 @@ describe('EntityDataTableChecksComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EntityDataTableChecksComponent ] - }) - .compileComponents(); + declarations: [EntityDataTableChecksComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/entity-data-table-checks/entity-data-table-checks.component.ts b/src/app/organization/entity-data-table-checks/entity-data-table-checks.component.ts index 821df732d..5e4f44c5a 100644 --- a/src/app/organization/entity-data-table-checks/entity-data-table-checks.component.ts +++ b/src/app/organization/entity-data-table-checks/entity-data-table-checks.component.ts @@ -21,11 +21,17 @@ import { DeleteDialogComponent } from '../../shared/delete-dialog/delete-dialog. styleUrls: ['./entity-data-table-checks.component.scss'] }) export class EntityDataTableChecksComponent implements OnInit { - /** Entity Data Table Checks data. */ entityDataTableChecksData: any; /** Columns to be displayed in entity data table checks table. */ - displayedColumns: string[] = ['entity', 'productName', 'datatableName', 'status', 'systemDefined', 'actions']; + displayedColumns: string[] = [ + 'entity', + 'productName', + 'datatableName', + 'status', + 'systemDefined', + 'actions' + ]; /** Data source for entity data table checks table. */ dataSource: MatTableDataSource; /** Corresponding values for Entity */ @@ -59,10 +65,12 @@ export class EntityDataTableChecksComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {MatDialog} dialog Dialog reference. */ - constructor(private organizationService: OrganizationService, - private route: ActivatedRoute, - private dialog: MatDialog) { - this.route.data.subscribe(( data: { entityDataTableChecks: any }) => { + constructor( + private organizationService: OrganizationService, + private route: ActivatedRoute, + private dialog: MatDialog + ) { + this.route.data.subscribe((data: { entityDataTableChecks: any }) => { this.entityDataTableChecksData = data.entityDataTableChecks.pageItems; }); } @@ -105,8 +113,10 @@ export class EntityDataTableChecksComponent implements OnInit { this.dataSource.sort = this.sort; this.dataSource.sortingDataAccessor = (item, property) => { switch (property) { - case 'status': return item.status.value; - default: return item[property]; + case 'status': + return item.status.value; + default: + return item[property]; } }; } @@ -121,13 +131,13 @@ export class EntityDataTableChecksComponent implements OnInit { }); deleteEntityDataTableCheckDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.organizationService.deleteEntityDataTableCheck(entityDataTableCheckId) - .subscribe(() => { - this.entityDataTableChecksData = this.entityDataTableChecksData.filter((entityDataTableChecks: any) => entityDataTableChecks.id !== entityDataTableCheckId); - this.dataSource.data = this.entityDataTableChecksData; - }); + this.organizationService.deleteEntityDataTableCheck(entityDataTableCheckId).subscribe(() => { + this.entityDataTableChecksData = this.entityDataTableChecksData.filter( + (entityDataTableChecks: any) => entityDataTableChecks.id !== entityDataTableCheckId + ); + this.dataSource.data = this.entityDataTableChecksData; + }); } }); } - } diff --git a/src/app/organization/entity-data-table-checks/entity-data-table-checks.resolver.ts b/src/app/organization/entity-data-table-checks/entity-data-table-checks.resolver.ts index a3fa811da..7e9e00c57 100644 --- a/src/app/organization/entity-data-table-checks/entity-data-table-checks.resolver.ts +++ b/src/app/organization/entity-data-table-checks/entity-data-table-checks.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service'; */ @Injectable() export class EntityDataTableChecksResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class EntityDataTableChecksResolver implements Resolve { resolve(): Observable { return this.organizationService.getEntityDataTableChecks(); } - } diff --git a/src/app/organization/fund-mapping/advance-search-template.resolver.ts b/src/app/organization/fund-mapping/advance-search-template.resolver.ts index 97ad06346..d1ff2687a 100644 --- a/src/app/organization/fund-mapping/advance-search-template.resolver.ts +++ b/src/app/organization/fund-mapping/advance-search-template.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service'; */ @Injectable() export class AdvanceSearchTemplateResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class AdvanceSearchTemplateResolver implements Resolve { resolve(): Observable { return this.organizationService.getAdvanceSearchTemplate(); } - } diff --git a/src/app/organization/fund-mapping/fund-mapping.component.spec.ts b/src/app/organization/fund-mapping/fund-mapping.component.spec.ts index 56905b3a2..2ed9921d2 100644 --- a/src/app/organization/fund-mapping/fund-mapping.component.spec.ts +++ b/src/app/organization/fund-mapping/fund-mapping.component.spec.ts @@ -8,9 +8,8 @@ describe('FundMappingComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FundMappingComponent ] - }) - .compileComponents(); + declarations: [FundMappingComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/fund-mapping/fund-mapping.component.ts b/src/app/organization/fund-mapping/fund-mapping.component.ts index b1d4f85f4..ed42c17be 100644 --- a/src/app/organization/fund-mapping/fund-mapping.component.ts +++ b/src/app/organization/fund-mapping/fund-mapping.component.ts @@ -20,7 +20,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./fund-mapping.component.scss'] }) export class FundMappingComponent implements OnInit { - /** Minimum Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Date allowed. */ @@ -33,7 +32,13 @@ export class FundMappingComponent implements OnInit { isCollapsed = false; /** Columns to be displayed in loans table. */ - displayedColumns: string[] = ['officeName', 'productName', 'count', 'outstanding', 'percentage']; + displayedColumns: string[] = [ + 'officeName', + 'productName', + 'count', + 'outstanding', + 'percentage' + ]; /** Data source for loans table. */ dataSource: MatTableDataSource; @@ -50,11 +55,13 @@ export class FundMappingComponent implements OnInit { * @param {Router} router Router for navigation. * @param {Dates} dateUtils Date Utils to format date. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private settingsService: SettingsService, - private route: ActivatedRoute, - private dateUtils: Dates) { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private settingsService: SettingsService, + private route: ActivatedRoute, + private dateUtils: Dates + ) { this.route.data.subscribe((data: { advanceSearchTemplate: any }) => { this.advanceSearchTemplate = data.advanceSearchTemplate; }); @@ -71,14 +78,23 @@ export class FundMappingComponent implements OnInit { */ createFundMappingForm() { this.fundMappingForm = this.formBuilder.group({ - 'loanStatus': [''], - 'loanProducts': [''], - 'offices': [''], - 'loanDateOption': ['', Validators.required], - 'loanFromDate': ['', Validators.required], - 'loanToDate': ['', Validators.required], - 'includeOutStandingAmountPercentage': [false], - 'includeOutstandingAmount': [false] + loanStatus: [''], + loanProducts: [''], + offices: [''], + loanDateOption: [ + '', + Validators.required + ], + loanFromDate: [ + '', + Validators.required + ], + loanToDate: [ + '', + Validators.required + ], + includeOutStandingAmountPercentage: [false], + includeOutstandingAmount: [false] }); } @@ -88,14 +104,26 @@ export class FundMappingComponent implements OnInit { buildDependencies() { this.fundMappingForm.get('includeOutStandingAmountPercentage').valueChanges.subscribe((value: boolean) => { if (value) { - this.fundMappingForm.addControl('outStandingAmountPercentageCondition', new UntypedFormControl('', Validators.required)); + this.fundMappingForm.addControl( + 'outStandingAmountPercentageCondition', + new UntypedFormControl('', Validators.required) + ); this.fundMappingForm.get('outStandingAmountPercentageCondition').valueChanges.subscribe((_value: string) => { if (_value === 'between') { - this.fundMappingForm.addControl('minOutStandingAmountPercentage', new UntypedFormControl('', Validators.required)); - this.fundMappingForm.addControl('maxOutStandingAmountPercentage', new UntypedFormControl('', Validators.required)); + this.fundMappingForm.addControl( + 'minOutStandingAmountPercentage', + new UntypedFormControl('', Validators.required) + ); + this.fundMappingForm.addControl( + 'maxOutStandingAmountPercentage', + new UntypedFormControl('', Validators.required) + ); this.fundMappingForm.removeControl('outStandingAmountPercentage'); } else { - this.fundMappingForm.addControl('outStandingAmountPercentage', new UntypedFormControl('', Validators.required)); + this.fundMappingForm.addControl( + 'outStandingAmountPercentage', + new UntypedFormControl('', Validators.required) + ); this.fundMappingForm.removeControl('minOutStandingAmountPercentage'); this.fundMappingForm.removeControl('maxOutStandingAmountPercentage'); } @@ -170,5 +198,4 @@ export class FundMappingComponent implements OnInit { this.setLoans(response); }); } - } diff --git a/src/app/organization/holidays/create-holiday/checklist-db.class.ts b/src/app/organization/holidays/create-holiday/checklist-db.class.ts index de1bf2db4..6a15d95d1 100644 --- a/src/app/organization/holidays/create-holiday/checklist-db.class.ts +++ b/src/app/organization/holidays/create-holiday/checklist-db.class.ts @@ -3,44 +3,41 @@ import { Injectable } from '@angular/core'; import { OfficeItemNode } from './office-item.class'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class ChecklistDatabase { + // rxjs functionality to update DOM via subscribe + dataChange = new BehaviorSubject([]); + get data(): OfficeItemNode[] { + return this.dataChange.value; + } + TREE_DATA = {}; + constructor() {} - // rxjs functionality to update DOM via subscribe - dataChange = new BehaviorSubject([]); - get data(): OfficeItemNode[] { - return this.dataChange.value; - } - TREE_DATA = {}; + // called every time the data in route changes + initialize(trie: any) { + this.TREE_DATA = trie; + const data = this.buildFileTree(this.TREE_DATA, 0); + this.dataChange.next(data); + } - constructor() { - } + // builds hierarchical tree of officeItemNodes + buildFileTree(obj: { [key: string]: any }, level: number): OfficeItemNode[] { + return Object.keys(obj).reduce((accumulator, key) => { + const value = obj[key]; + const node = new OfficeItemNode(); + node.item = key; - // called every time the data in route changes - initialize(trie: any) { - this.TREE_DATA = trie; - const data = this.buildFileTree(this.TREE_DATA, 0); - this.dataChange.next(data); - } + if (value != null) { + if (typeof value === 'object') { + node.children = this.buildFileTree(value, level + 1); + } else { + node.item = value; + } + } - // builds hierarchical tree of officeItemNodes - buildFileTree(obj: { [key: string]: any }, level: number): OfficeItemNode[] { - return Object.keys(obj).reduce((accumulator, key) => { - const value = obj[key]; - const node = new OfficeItemNode(); - node.item = key; - - if (value != null) { - if (typeof value === 'object') { - node.children = this.buildFileTree(value, level + 1); - } else { - node.item = value; - } - } - - return accumulator.concat(node); - }, []); - } + return accumulator.concat(node); + }, []); + } } diff --git a/src/app/organization/holidays/create-holiday/create-holiday.component.spec.ts b/src/app/organization/holidays/create-holiday/create-holiday.component.spec.ts index b8964339e..dc09d2145 100644 --- a/src/app/organization/holidays/create-holiday/create-holiday.component.spec.ts +++ b/src/app/organization/holidays/create-holiday/create-holiday.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateHolidayComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateHolidayComponent ] - }) - .compileComponents(); + declarations: [CreateHolidayComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/holidays/create-holiday/create-holiday.component.ts b/src/app/organization/holidays/create-holiday/create-holiday.component.ts index 27af6925b..fd255098a 100644 --- a/src/app/organization/holidays/create-holiday/create-holiday.component.ts +++ b/src/app/organization/holidays/create-holiday/create-holiday.component.ts @@ -24,7 +24,6 @@ import { CreateHoliday } from './create-holiday.service'; styleUrls: ['./create-holiday.component.scss'] }) export class CreateHolidayComponent implements OnInit { - /** Create Holiday form. */ holidayForm: UntypedFormGroup; /** Repayment Scheduling data. */ @@ -73,15 +72,17 @@ export class CreateHolidayComponent implements OnInit { * @param {OrganizationService} organizationService Organization Service. * @param {Router} router Router. */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private dateUtils: Dates, - private organizationService: OrganizationService, - private settings: SettingsService, - private router: Router, - private _database: ChecklistDatabase, - private createHoliday: CreateHoliday ) { - this.route.data.subscribe((data: { offices: any, holidayTemplate: any }) => { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private dateUtils: Dates, + private organizationService: OrganizationService, + private settings: SettingsService, + private router: Router, + private _database: ChecklistDatabase, + private createHoliday: CreateHoliday + ) { + this.route.data.subscribe((data: { offices: any; holidayTemplate: any }) => { this.officesData = data.offices; this.repaymentSchedulingTypes = data.holidayTemplate; // Constructs trie everytime data changes @@ -121,7 +122,7 @@ export class CreateHolidayComponent implements OnInit { // Sets root as the first object root = trie[Object.keys(trie)[0]]; // Construction of hierarchy via Depth First Search - hierarchy.forEach((stage: string) => { + hierarchy.forEach((stage: string) => { if (!(stage in root)) { root[stage] = {}; } @@ -160,7 +161,7 @@ export class CreateHolidayComponent implements OnInit { this.flatNodeMap.set(flatNode, node); this.nestedNodeMap.set(node, flatNode); return flatNode; - } + }; /** Whether all the descendants of the node are selected. */ descendantsAllSelected(node: OfficeItemFlatNode): boolean { @@ -176,7 +177,7 @@ export class CreateHolidayComponent implements OnInit { setSelectedOffices() { this.holidayForm.patchValue({ - offices: this.checklistSelection.selected.map((item) => item.item), + offices: this.checklistSelection.selected.map((item) => item.item) }); } @@ -256,12 +257,27 @@ export class CreateHolidayComponent implements OnInit { */ setHolidayForm() { this.holidayForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'fromDate': ['', Validators.required], - 'toDate': ['', Validators.required], - 'reschedulingType': ['', Validators.required], - 'description': [''], - 'offices': ['', Validators.required] + name: [ + '', + Validators.required + ], + fromDate: [ + '', + Validators.required + ], + toDate: [ + '', + Validators.required + ], + reschedulingType: [ + '', + Validators.required + ], + description: [''], + offices: [ + '', + Validators.required + ] }); } @@ -294,7 +310,7 @@ export class CreateHolidayComponent implements OnInit { holidayFormData.repaymentsRescheduledTo = this.dateUtils.formatDate(prevRepaymentsRescheduledTo, dateFormat); } const offices = this.holidayForm.value.offices.map((office: string) => { - return {'officeId': Number.parseInt(office, 10)}; + return { officeId: Number.parseInt(office, 10) }; }); const data = { ...holidayFormData, @@ -303,8 +319,13 @@ export class CreateHolidayComponent implements OnInit { offices }; this.organizationService.createHoliday(data).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/organization/holidays/create-holiday/create-holiday.service.ts b/src/app/organization/holidays/create-holiday/create-holiday.service.ts index 6cebbd079..1bcbd69d7 100644 --- a/src/app/organization/holidays/create-holiday/create-holiday.service.ts +++ b/src/app/organization/holidays/create-holiday/create-holiday.service.ts @@ -1,17 +1,16 @@ import { Injectable } from '@angular/core'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class CreateHoliday { - setEmptyObjectsToNull(root: any) { - Object.keys(root).forEach((key) => { - if (Object.keys(root[key]).length === 0) { - root[key] = null; - } else { - this.setEmptyObjectsToNull(root[key]); - } - }); - } - + setEmptyObjectsToNull(root: any) { + Object.keys(root).forEach((key) => { + if (Object.keys(root[key]).length === 0) { + root[key] = null; + } else { + this.setEmptyObjectsToNull(root[key]); + } + }); + } } diff --git a/src/app/organization/holidays/create-holiday/office-flat-item.class.ts b/src/app/organization/holidays/create-holiday/office-flat-item.class.ts index 159991061..d2b344bbf 100644 --- a/src/app/organization/holidays/create-holiday/office-flat-item.class.ts +++ b/src/app/organization/holidays/create-holiday/office-flat-item.class.ts @@ -1,10 +1,10 @@ import { Injectable } from '@angular/core'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class OfficeItemFlatNode { - item: string; - level: number; - expandable: boolean; - } + item: string; + level: number; + expandable: boolean; +} diff --git a/src/app/organization/holidays/create-holiday/office-item.class.ts b/src/app/organization/holidays/create-holiday/office-item.class.ts index 33add8f69..18875c502 100644 --- a/src/app/organization/holidays/create-holiday/office-item.class.ts +++ b/src/app/organization/holidays/create-holiday/office-item.class.ts @@ -1,9 +1,9 @@ import { Injectable } from '@angular/core'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class OfficeItemNode { - children: OfficeItemNode[]; - item: string; + children: OfficeItemNode[]; + item: string; } diff --git a/src/app/organization/holidays/edit-holiday/edit-holiday.component.spec.ts b/src/app/organization/holidays/edit-holiday/edit-holiday.component.spec.ts index bc36aef58..6a8671386 100644 --- a/src/app/organization/holidays/edit-holiday/edit-holiday.component.spec.ts +++ b/src/app/organization/holidays/edit-holiday/edit-holiday.component.spec.ts @@ -8,9 +8,8 @@ describe('EditHolidayComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditHolidayComponent ] - }) - .compileComponents(); + declarations: [EditHolidayComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/holidays/edit-holiday/edit-holiday.component.ts b/src/app/organization/holidays/edit-holiday/edit-holiday.component.ts index f196ad400..00f3ed751 100644 --- a/src/app/organization/holidays/edit-holiday/edit-holiday.component.ts +++ b/src/app/organization/holidays/edit-holiday/edit-holiday.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-holiday.component.scss'] }) export class EditHolidayComponent implements OnInit { - /** Edit Holiday form. */ holidayForm: UntypedFormGroup; /** Holiday data. */ @@ -39,17 +38,19 @@ export class EditHolidayComponent implements OnInit { * @param {OrganizationService} organizatioService Organization Service. * @param {Router} router Router. */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private dateUtils: Dates, - private organizatioService: OrganizationService, - private settingsService: SettingsService, - private router: Router ) { - this.route.data.subscribe((data: { holiday: any, holidayTemplate: any }) => { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private dateUtils: Dates, + private organizatioService: OrganizationService, + private settingsService: SettingsService, + private router: Router + ) { + this.route.data.subscribe((data: { holiday: any; holidayTemplate: any }) => { this.holidayData = data.holiday; this.holidayData.repaymentSchedulingTypes = data.holidayTemplate; this.reSchedulingType = this.holidayData.reschedulingType; - if ( this.holidayData.status.value === 'Active' ) { + if (this.holidayData.status.value === 'Active') { this.isActiveHoliday = true; } else { this.isActiveHoliday = false; @@ -70,15 +71,33 @@ export class EditHolidayComponent implements OnInit { */ setEditForm() { this.holidayForm = this.formBuilder.group({ - 'name': [this.holidayData.name, Validators.required], - 'description': [this.holidayData.description] + name: [ + this.holidayData.name, + Validators.required + ], + description: [this.holidayData.description] }); if (!this.isActiveHoliday) { - this.holidayForm.addControl('fromDate', new UntypedFormControl(this.holidayData.fromDate && new Date(this.holidayData.fromDate), Validators.required)); - this.holidayForm.addControl('toDate', new UntypedFormControl(this.holidayData.toDate && new Date(this.holidayData.toDate), Validators.required)); - this.holidayForm.addControl('reschedulingType', new UntypedFormControl(this.holidayData.reschedulingType, Validators.required)); + this.holidayForm.addControl( + 'fromDate', + new UntypedFormControl(this.holidayData.fromDate && new Date(this.holidayData.fromDate), Validators.required) + ); + this.holidayForm.addControl( + 'toDate', + new UntypedFormControl(this.holidayData.toDate && new Date(this.holidayData.toDate), Validators.required) + ); + this.holidayForm.addControl( + 'reschedulingType', + new UntypedFormControl(this.holidayData.reschedulingType, Validators.required) + ); if (this.reSchedulingType === 2) { - this.holidayForm.addControl('repaymentsRescheduledTo', new UntypedFormControl(this.holidayData.repaymentsRescheduledTo && new Date(this.holidayData.repaymentsRescheduledTo), Validators.required)); + this.holidayForm.addControl( + 'repaymentsRescheduledTo', + new UntypedFormControl( + this.holidayData.repaymentsRescheduledTo && new Date(this.holidayData.repaymentsRescheduledTo), + Validators.required + ) + ); } } } @@ -87,7 +106,7 @@ export class EditHolidayComponent implements OnInit { * Get Rescheduling Type. */ getReschedulingType() { - this.holidayForm.get('reschedulingType').valueChanges.subscribe( (option: any) => { + this.holidayForm.get('reschedulingType').valueChanges.subscribe((option: any) => { this.reSchedulingType = option; if (option === 2) { this.holidayForm.addControl('repaymentsRescheduledTo', new UntypedFormControl(new Date(), Validators.required)); @@ -105,7 +124,7 @@ export class EditHolidayComponent implements OnInit { const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; if (!this.isActiveHoliday) { - if (this.reSchedulingType === 2 ) { + if (this.reSchedulingType === 2) { const repaymentScheduledTo: Date = this.holidayForm.value.repaymentsRescheduledTo; holidayFormData.repaymentsRescheduledTo = this.dateUtils.formatDate(repaymentScheduledTo, dateFormat); } @@ -123,10 +142,9 @@ export class EditHolidayComponent implements OnInit { dateFormat, locale }; - this.organizatioService.updateHoliday(this.holidayData.id, data).subscribe(response => { + this.organizatioService.updateHoliday(this.holidayData.id, data).subscribe((response) => { /** TODO Add Redirects to ViewMakerCheckerTask page. */ this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/organization/holidays/holiday-template.resolver.ts b/src/app/organization/holidays/holiday-template.resolver.ts index 19c6016c9..ae09f0f26 100644 --- a/src/app/organization/holidays/holiday-template.resolver.ts +++ b/src/app/organization/holidays/holiday-template.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class HolidayTemplateResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class HolidayTemplateResolver implements Resolve { resolve(): Observable { return this.organizationService.getHolidayTemplate(); } - } diff --git a/src/app/organization/holidays/holiday.resolver.ts b/src/app/organization/holidays/holiday.resolver.ts index fb7205943..a331665f5 100644 --- a/src/app/organization/holidays/holiday.resolver.ts +++ b/src/app/organization/holidays/holiday.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class HolidayResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -24,8 +23,7 @@ export class HolidayResolver implements Resolve { * @returns {Observable} */ resolve(route: ActivatedRouteSnapshot): Observable { - const holidayId = route.paramMap.get('id'); + const holidayId = route.paramMap.get('id'); return this.organizationService.getHoliday(holidayId); } - } diff --git a/src/app/organization/holidays/holidays.component.spec.ts b/src/app/organization/holidays/holidays.component.spec.ts index a3e55a9fb..a16337990 100644 --- a/src/app/organization/holidays/holidays.component.spec.ts +++ b/src/app/organization/holidays/holidays.component.spec.ts @@ -8,9 +8,8 @@ describe('HolidaysComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ HolidaysComponent ] - }) - .compileComponents(); + declarations: [HolidaysComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/holidays/holidays.component.ts b/src/app/organization/holidays/holidays.component.ts index 8911c219a..e2028b807 100644 --- a/src/app/organization/holidays/holidays.component.ts +++ b/src/app/organization/holidays/holidays.component.ts @@ -23,7 +23,6 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura styleUrls: ['./holidays.component.scss'] }) export class HolidaysComponent implements OnInit, AfterViewInit { - /** Office selector. */ officeSelector = new UntypedFormControl(); /** Holidays data. */ @@ -31,7 +30,13 @@ export class HolidaysComponent implements OnInit, AfterViewInit { /** Offices data. */ officeData: any; /** Columns to be displayed in holidays table. */ - displayedColumns: string[] = ['name', 'fromDate', 'toDate', 'repaymentsRescheduledTo', 'status']; + displayedColumns: string[] = [ + 'name', + 'fromDate', + 'toDate', + 'repaymentsRescheduledTo', + 'status' + ]; /** Data source for holidays table. */ dataSource: MatTableDataSource; @@ -58,12 +63,14 @@ export class HolidaysComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private organizationService: OrganizationService, - private route: ActivatedRoute, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { - this.route.data.subscribe(( data: { offices: any }) => { + constructor( + private organizationService: OrganizationService, + private route: ActivatedRoute, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { + this.route.data.subscribe((data: { offices: any }) => { this.officeData = data.offices; }); } @@ -112,7 +119,12 @@ export class HolidaysComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -122,13 +134,13 @@ export class HolidaysComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showHolidayPage === true) { setTimeout(() => { - this.showPopover(this.templateButtonCreateHoliday, this.buttonCreateHoliday.nativeElement, 'bottom', true); + this.showPopover(this.templateButtonCreateHoliday, this.buttonCreateHoliday.nativeElement, 'bottom', true); }); } if (this.configurationWizardService.showHolidayFilter === true) { setTimeout(() => { - this.showPopover(this.templateFilterRef, this.filterRef.nativeElement, 'bottom', true); + this.showPopover(this.templateFilterRef, this.filterRef.nativeElement, 'bottom', true); }); } } diff --git a/src/app/organization/holidays/view-holidays/view-holidays.component.spec.ts b/src/app/organization/holidays/view-holidays/view-holidays.component.spec.ts index c0f916916..37a6db570 100644 --- a/src/app/organization/holidays/view-holidays/view-holidays.component.spec.ts +++ b/src/app/organization/holidays/view-holidays/view-holidays.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewHolidaysComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewHolidaysComponent ] - }) - .compileComponents(); + declarations: [ViewHolidaysComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/holidays/view-holidays/view-holidays.component.ts b/src/app/organization/holidays/view-holidays/view-holidays.component.ts index ff78084f8..6f4ce9d0a 100644 --- a/src/app/organization/holidays/view-holidays/view-holidays.component.ts +++ b/src/app/organization/holidays/view-holidays/view-holidays.component.ts @@ -20,7 +20,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./view-holidays.component.scss'] }) export class ViewHolidaysComponent { - /** Holiday data. */ holidayData: any; @@ -28,11 +27,13 @@ export class ViewHolidaysComponent { * Retrieves hioliday data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private dialog: MatDialog, private translateService: TranslateService, - private organizationService: OrganizationService) { + private organizationService: OrganizationService + ) { this.route.data.subscribe((data: { holidays: any }) => { this.holidayData = data.holidays; }); @@ -47,10 +48,9 @@ export class ViewHolidaysComponent { }); deleteHolidayDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.organizationService.deleteHoliday(this.holidayData.id) - .subscribe(() => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.organizationService.deleteHoliday(this.holidayData.id).subscribe(() => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } }); } @@ -60,16 +60,20 @@ export class ViewHolidaysComponent { */ activateHoliday() { const unAssignStaffDialogRef = this.dialog.open(ConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Holiday'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to activate') + ` ${this.holidayData.name} ` + this.translateService.instant('labels.dialogContext.holiday') } + data: { + heading: this.translateService.instant('labels.heading.Holiday'), + dialogContext: + this.translateService.instant('labels.dialogContext.Are you sure you want to activate') + + ` ${this.holidayData.name} ` + + this.translateService.instant('labels.dialogContext.holiday') + } }); unAssignStaffDialogRef.afterClosed().subscribe((response: { confirm: any }) => { if (response.confirm) { - this.organizationService.activateHoliday(this.holidayData.id) - .subscribe(() => { - this.router.navigate(['/organization/holidays']); - }); + this.organizationService.activateHoliday(this.holidayData.id).subscribe(() => { + this.router.navigate(['/organization/holidays']); + }); } }); } - } diff --git a/src/app/organization/investors/investors.component.spec.ts b/src/app/organization/investors/investors.component.spec.ts index 7e5bc514d..00ab9cea0 100644 --- a/src/app/organization/investors/investors.component.spec.ts +++ b/src/app/organization/investors/investors.component.spec.ts @@ -8,9 +8,8 @@ describe('InvestorsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ InvestorsComponent ] - }) - .compileComponents(); + declarations: [InvestorsComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/organization/investors/investors.component.ts b/src/app/organization/investors/investors.component.ts index 2b8fc23b6..a7c81795c 100644 --- a/src/app/organization/investors/investors.component.ts +++ b/src/app/organization/investors/investors.component.ts @@ -18,14 +18,13 @@ import { CancelDialogComponent } from 'app/shared/cancel-dialog/cancel-dialog.co styleUrls: ['./investors.component.scss'], animations: [ trigger('detailExpand', [ - state('collapsed', style({height: '0px', minHeight: '0'})), - state('expanded', style({height: '*'})), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')), - ]), - ], + state('collapsed', style({ height: '0px', minHeight: '0' })), + state('expanded', style({ height: '*' })), + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + + ] }) export class InvestorsComponent implements OnInit { - /** Minimum transaction date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum transaction date allowed. */ @@ -74,13 +73,25 @@ export class InvestorsComponent implements OnInit { ]; /** Columns to be displayed in investors table. */ - displayedColumns: string[] = ['status', 'effectiveFrom', 'ownerExternalId', 'loanAccount', 'transferExternalId', 'settlementDate', 'purchasePriceRatio', 'totalAmount', 'actions']; - constructor(private settingsService: SettingsService, + displayedColumns: string[] = [ + 'status', + 'effectiveFrom', + 'ownerExternalId', + 'loanAccount', + 'transferExternalId', + 'settlementDate', + 'purchasePriceRatio', + 'totalAmount', + 'actions' + ]; + constructor( + private settingsService: SettingsService, private router: Router, private dialog: MatDialog, private externalAssetOwner: ExternalAssetOwner, private externalAssetOwnerService: ExternalAssetOwnerService, - private dateUtils: Dates) { } + private dateUtils: Dates + ) {} ngOnInit(): void { this.maxDate = this.settingsService.maxAllowedDate; @@ -118,9 +129,9 @@ export class InvestorsComponent implements OnInit { searchEAO(): void { this.isLoading = true; const payload: any = { - 'request': {}, - 'page': this.currentPage, - 'size': this.pageSize + request: {}, + page: this.currentPage, + size: this.pageSize }; const dateFormat = 'yyyy-MM-dd'; const request: any = {}; @@ -142,12 +153,11 @@ export class InvestorsComponent implements OnInit { payload['request'] = request; this.externalAssetOwnerService.searchExternalAssetOwnerTransfer(payload).subscribe((response: any) => { this.totalRows = response.totalElements; - this.existsDataToFilter = (response.totalElements > 0); + this.existsDataToFilter = response.totalElements > 0; this.dataSource.data = response.content; this.searchResults = response.content; this.isLoading = false; }); - } transform(data: any): any { @@ -169,18 +179,18 @@ export class InvestorsComponent implements OnInit { const payload: any = { transferExternalId: transfer.transferExternalId }; - this.externalAssetOwnerService.executeExternalAssetOwnerTransferCommand(transfer.transferId, payload, 'cancel') + this.externalAssetOwnerService + .executeExternalAssetOwnerTransferCommand(transfer.transferId, payload, 'cancel') .subscribe((result: any) => { this.reload(); - }); + }); } }); } reload() { const url: string = this.router.url; - this.router.navigateByUrl(`/`, {skipLocationChange: true}) - .then(() => this.router.navigate([url])); + this.router.navigateByUrl(`/`, { skipLocationChange: true }).then(() => this.router.navigate([url])); } private resetPaginator() { diff --git a/src/app/organization/loan-provisioning-criteria/common-resolvers/loan-provisioning-criteria-and-template.resolver.ts b/src/app/organization/loan-provisioning-criteria/common-resolvers/loan-provisioning-criteria-and-template.resolver.ts index f6e08f5d2..abd44da8e 100644 --- a/src/app/organization/loan-provisioning-criteria/common-resolvers/loan-provisioning-criteria-and-template.resolver.ts +++ b/src/app/organization/loan-provisioning-criteria/common-resolvers/loan-provisioning-criteria-and-template.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service'; */ @Injectable() export class LoanProvisioningCriteriaAndTemplateResolver implements Resolve { - /** * @param {OrganizationService} organizationService Products service. */ @@ -27,5 +26,4 @@ export class LoanProvisioningCriteriaAndTemplateResolver implements Resolve { - /** * @param {OrganizationService} organizationService Products service. */ @@ -26,5 +25,4 @@ export class LoanProvisioningCriteriaTemplateResolver implements Resolve resolve(): Observable { return this.organizationService.getProvisioningCriteriaTemplate(); } - } diff --git a/src/app/organization/loan-provisioning-criteria/common-resolvers/loan-provisioning-criteria.resolver.ts b/src/app/organization/loan-provisioning-criteria/common-resolvers/loan-provisioning-criteria.resolver.ts index 809a283db..974ccdefb 100644 --- a/src/app/organization/loan-provisioning-criteria/common-resolvers/loan-provisioning-criteria.resolver.ts +++ b/src/app/organization/loan-provisioning-criteria/common-resolvers/loan-provisioning-criteria.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service'; */ @Injectable() export class LoanProvisioningCriteriaResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -27,5 +26,4 @@ export class LoanProvisioningCriteriaResolver implements Resolve { const provisioningId = route.paramMap.get('id'); return this.organizationService.getProvisioningCriteria(provisioningId); } - } diff --git a/src/app/organization/loan-provisioning-criteria/common-resolvers/loan-provisioning-criterias.resolver.ts b/src/app/organization/loan-provisioning-criteria/common-resolvers/loan-provisioning-criterias.resolver.ts index dc3139a94..ce3ca5f3d 100644 --- a/src/app/organization/loan-provisioning-criteria/common-resolvers/loan-provisioning-criterias.resolver.ts +++ b/src/app/organization/loan-provisioning-criteria/common-resolvers/loan-provisioning-criterias.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service'; */ @Injectable() export class LoanProvisioningCriteriasResolver implements Resolve { - /** * @param {OrganizationService} organizationService Products service. */ @@ -26,5 +25,4 @@ export class LoanProvisioningCriteriasResolver implements Resolve { resolve(): Observable { return this.organizationService.getProvisioningCriterias(); } - } diff --git a/src/app/organization/loan-provisioning-criteria/create-loan-provisioning-criteria/create-loan-provisioning-criteria.component.spec.ts b/src/app/organization/loan-provisioning-criteria/create-loan-provisioning-criteria/create-loan-provisioning-criteria.component.spec.ts index 7d1e26630..71059a58e 100644 --- a/src/app/organization/loan-provisioning-criteria/create-loan-provisioning-criteria/create-loan-provisioning-criteria.component.spec.ts +++ b/src/app/organization/loan-provisioning-criteria/create-loan-provisioning-criteria/create-loan-provisioning-criteria.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateLoanProvisioningCriteriaComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateLoanProvisioningCriteriaComponent ] - }) - .compileComponents(); + declarations: [CreateLoanProvisioningCriteriaComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/loan-provisioning-criteria/create-loan-provisioning-criteria/create-loan-provisioning-criteria.component.ts b/src/app/organization/loan-provisioning-criteria/create-loan-provisioning-criteria/create-loan-provisioning-criteria.component.ts index efb065092..38f8cba43 100644 --- a/src/app/organization/loan-provisioning-criteria/create-loan-provisioning-criteria/create-loan-provisioning-criteria.component.ts +++ b/src/app/organization/loan-provisioning-criteria/create-loan-provisioning-criteria/create-loan-provisioning-criteria.component.ts @@ -26,7 +26,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./create-loan-provisioning-criteria.component.scss'] }) export class CreateLoanProvisioningCriteriaComponent implements OnInit { - /** Loan Provisioning Criteria form. */ provisioningCriteriaForm: UntypedFormGroup; /** Loan Provisioning Criteria Template */ @@ -37,16 +36,24 @@ export class CreateLoanProvisioningCriteriaComponent implements OnInit { expenseAccounts: any; /** Columns to be displayed in definitions table. */ - displayedColumns: string[] = ['category', 'minAge', 'maxAge', 'percentage', 'liabilityAccount', 'expenseAccount', 'edit']; + displayedColumns: string[] = [ + 'category', + 'minAge', + 'maxAge', + 'percentage', + 'liabilityAccount', + 'expenseAccount', + 'edit' + ]; /** Criteria Definitions Array */ definitions: { - categoryId: number, - categoryName: string, - maxAge?: number, - minAge?: number, - liabilityAccount?: string, - expenseAccount?: string, - provisioningPercentage?: number + categoryId: number; + categoryName: string; + maxAge?: number; + minAge?: number; + liabilityAccount?: string; + expenseAccount?: string; + provisioningPercentage?: number; }[] = []; /** Checks Definitons Table Validity */ isDefinitionValid: any = {}; @@ -59,18 +66,24 @@ export class CreateLoanProvisioningCriteriaComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private settingsService: SettingsService, - private router: Router, - public dialog: MatDialog, - private route: ActivatedRoute) { - this.route.data.subscribe((data: { loanProvisioningCriteriaTemplate: any }) => { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private settingsService: SettingsService, + private router: Router, + public dialog: MatDialog, + private route: ActivatedRoute + ) { + this.route.data.subscribe((data: { loanProvisioningCriteriaTemplate: any }) => { this.loanProvisioningCriteriaTemplate = data.loanProvisioningCriteriaTemplate; this.definitions = this.loanProvisioningCriteriaTemplate.definitions; - this.liabilityAccounts = this.loanProvisioningCriteriaTemplate.glAccounts.filter((account: any) => account.type.value === 'LIABILITY'); - this.expenseAccounts = this.loanProvisioningCriteriaTemplate.glAccounts.filter((account: any) => account.type.value === 'EXPENSE'); - }); + this.liabilityAccounts = this.loanProvisioningCriteriaTemplate.glAccounts.filter( + (account: any) => account.type.value === 'LIABILITY' + ); + this.expenseAccounts = this.loanProvisioningCriteriaTemplate.glAccounts.filter( + (account: any) => account.type.value === 'EXPENSE' + ); + }); } ngOnInit() { @@ -82,8 +95,11 @@ export class CreateLoanProvisioningCriteriaComponent implements OnInit { */ createProvisioningCriteriaForm() { this.provisioningCriteriaForm = this.formBuilder.group({ - 'criteriaName': ['', Validators.required], - 'loanProducts': [''] + criteriaName: [ + '', + Validators.required + ], + loanProducts: [''] }); } @@ -119,46 +135,56 @@ export class CreateLoanProvisioningCriteriaComponent implements OnInit { */ getDefinitionFormFields(definition: any) { const formfields: FormfieldBase[] = []; - formfields.push(new InputBase({ - controlName: 'minAge', - label: 'Min Age', - value: definition ? definition.minAge : '', - type: 'number', - required: true, - order: 1 - })); - formfields.push(new InputBase({ - controlName: 'maxAge', - label: 'Max Age', - value: definition ? definition.maxAge : '', - type: 'number', - required: true, - order: 2 - })); - formfields.push(new InputBase({ - controlName: 'provisioningPercentage', - label: 'Percentage (%)', - value: definition ? definition.provisioningPercentage : '', - type: 'number', - required: true, - order: 3 - })); - formfields.push(new SelectBase({ - controlName: 'liabilityAccount', - label: 'Liability Account', - value: definition ? definition.liabilityAccount : '', - options: { label: 'name', value: 'id', data: this.liabilityAccounts }, - required: true, - order: 4 - })); - formfields.push(new SelectBase({ - controlName: 'expenseAccount', - label: 'Expense Account', - value: definition ? definition.expenseAccount : '', - options: { label: 'name', value: 'id', data: this.expenseAccounts }, - required: true, - order: 5 - })); + formfields.push( + new InputBase({ + controlName: 'minAge', + label: 'Min Age', + value: definition ? definition.minAge : '', + type: 'number', + required: true, + order: 1 + }) + ); + formfields.push( + new InputBase({ + controlName: 'maxAge', + label: 'Max Age', + value: definition ? definition.maxAge : '', + type: 'number', + required: true, + order: 2 + }) + ); + formfields.push( + new InputBase({ + controlName: 'provisioningPercentage', + label: 'Percentage (%)', + value: definition ? definition.provisioningPercentage : '', + type: 'number', + required: true, + order: 3 + }) + ); + formfields.push( + new SelectBase({ + controlName: 'liabilityAccount', + label: 'Liability Account', + value: definition ? definition.liabilityAccount : '', + options: { label: 'name', value: 'id', data: this.liabilityAccounts }, + required: true, + order: 4 + }) + ); + formfields.push( + new SelectBase({ + controlName: 'expenseAccount', + label: 'Expense Account', + value: definition ? definition.expenseAccount : '', + options: { label: 'name', value: 'id', data: this.expenseAccounts }, + required: true, + order: 5 + }) + ); return formfields; } @@ -166,7 +192,8 @@ export class CreateLoanProvisioningCriteriaComponent implements OnInit { * Returns validity of form and table. */ get provisioningCriteriaFormValid() { - const definitionsValid: boolean = Object.entries(this.isDefinitionValid).length === this.definitions.length ? true : false; + const definitionsValid: boolean = + Object.entries(this.isDefinitionValid).length === this.definitions.length ? true : false; return this.provisioningCriteriaForm.valid && definitionsValid; } @@ -186,8 +213,13 @@ export class CreateLoanProvisioningCriteriaComponent implements OnInit { locale }; this.organizationService.createProvisioningCriteria(loanProvisioningCriteria).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/organization/loan-provisioning-criteria/edit-loan-provisioning-criteria/edit-loan-provisioning-criteria.component.spec.ts b/src/app/organization/loan-provisioning-criteria/edit-loan-provisioning-criteria/edit-loan-provisioning-criteria.component.spec.ts index 41d4a9dcf..7d9838c2c 100644 --- a/src/app/organization/loan-provisioning-criteria/edit-loan-provisioning-criteria/edit-loan-provisioning-criteria.component.spec.ts +++ b/src/app/organization/loan-provisioning-criteria/edit-loan-provisioning-criteria/edit-loan-provisioning-criteria.component.spec.ts @@ -8,9 +8,8 @@ describe('EditLoanProvisioningCriteriaComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditLoanProvisioningCriteriaComponent ] - }) - .compileComponents(); + declarations: [EditLoanProvisioningCriteriaComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/loan-provisioning-criteria/edit-loan-provisioning-criteria/edit-loan-provisioning-criteria.component.ts b/src/app/organization/loan-provisioning-criteria/edit-loan-provisioning-criteria/edit-loan-provisioning-criteria.component.ts index 06589aac1..0e53af737 100644 --- a/src/app/organization/loan-provisioning-criteria/edit-loan-provisioning-criteria/edit-loan-provisioning-criteria.component.ts +++ b/src/app/organization/loan-provisioning-criteria/edit-loan-provisioning-criteria/edit-loan-provisioning-criteria.component.ts @@ -26,7 +26,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-loan-provisioning-criteria.component.scss'] }) export class EditLoanProvisioningCriteriaComponent implements OnInit { - /** Loan Provisioning Criteria form. */ provisioningCriteriaForm: UntypedFormGroup; /** Loan Provisioning Criteria Template */ @@ -39,16 +38,24 @@ export class EditLoanProvisioningCriteriaComponent implements OnInit { loanProducts: any; /** Columns to be displayed in definitions table. */ - displayedColumns: string[] = ['category', 'minAge', 'maxAge', 'percentage', 'liabilityAccount', 'expenseAccount', 'edit']; + displayedColumns: string[] = [ + 'category', + 'minAge', + 'maxAge', + 'percentage', + 'liabilityAccount', + 'expenseAccount', + 'edit' + ]; /** Criteria Definitions Array */ definitions: { - categoryId: number, - categoryName: string, - maxAge?: number, - minAge?: number, - liabilityAccount?: string, - expenseAccount?: string, - provisioningPercentage?: number + categoryId: number; + categoryName: string; + maxAge?: number; + minAge?: number; + liabilityAccount?: string; + expenseAccount?: string; + provisioningPercentage?: number; }[] = []; /** @@ -59,19 +66,27 @@ export class EditLoanProvisioningCriteriaComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private router: Router, - private settingsService: SettingsService, - public dialog: MatDialog, - private route: ActivatedRoute) { - this.route.data.subscribe((data: { loanProvisioningCriteriaAndTemplate: any }) => { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private router: Router, + private settingsService: SettingsService, + public dialog: MatDialog, + private route: ActivatedRoute + ) { + this.route.data.subscribe((data: { loanProvisioningCriteriaAndTemplate: any }) => { this.loanProvisioningCriteriaAndTemplate = data.loanProvisioningCriteriaAndTemplate; this.definitions = this.loanProvisioningCriteriaAndTemplate.definitions; - this.loanProducts = this.loanProvisioningCriteriaAndTemplate.loanProducts.concat(this.loanProvisioningCriteriaAndTemplate.selectedLoanProducts); - this.liabilityAccounts = this.loanProvisioningCriteriaAndTemplate.glAccounts.filter((account: any) => account.type.value === 'LIABILITY'); - this.expenseAccounts = this.loanProvisioningCriteriaAndTemplate.glAccounts.filter((account: any) => account.type.value === 'EXPENSE'); - }); + this.loanProducts = this.loanProvisioningCriteriaAndTemplate.loanProducts.concat( + this.loanProvisioningCriteriaAndTemplate.selectedLoanProducts + ); + this.liabilityAccounts = this.loanProvisioningCriteriaAndTemplate.glAccounts.filter( + (account: any) => account.type.value === 'LIABILITY' + ); + this.expenseAccounts = this.loanProvisioningCriteriaAndTemplate.glAccounts.filter( + (account: any) => account.type.value === 'EXPENSE' + ); + }); } ngOnInit() { @@ -83,8 +98,11 @@ export class EditLoanProvisioningCriteriaComponent implements OnInit { */ createProvisioningCriteriaForm() { this.provisioningCriteriaForm = this.formBuilder.group({ - 'criteriaName': [this.loanProvisioningCriteriaAndTemplate.criteriaName, Validators.required], - 'loanProducts': [this.loanProvisioningCriteriaAndTemplate.selectedLoanProducts] + criteriaName: [ + this.loanProvisioningCriteriaAndTemplate.criteriaName, + Validators.required + ], + loanProducts: [this.loanProvisioningCriteriaAndTemplate.selectedLoanProducts] }); } @@ -128,46 +146,56 @@ export class EditLoanProvisioningCriteriaComponent implements OnInit { */ getDefinitionFormFields(definition: any) { const formfields: FormfieldBase[] = []; - formfields.push(new InputBase({ - controlName: 'minAge', - label: 'Min Age', - value: definition ? definition.minAge : '', - type: 'number', - required: true, - order: 1 - })); - formfields.push(new InputBase({ - controlName: 'maxAge', - label: 'Max Age', - value: definition ? definition.maxAge : '', - type: 'number', - required: true, - order: 2 - })); - formfields.push(new InputBase({ - controlName: 'provisioningPercentage', - label: 'Percentage (%)', - value: definition ? definition.provisioningPercentage : '', - type: 'number', - required: true, - order: 3 - })); - formfields.push(new SelectBase({ - controlName: 'liabilityAccount', - label: 'Liability Account', - value: definition ? definition.liabilityAccount : '', - options: { label: 'name', value: 'id', data: this.liabilityAccounts }, - required: true, - order: 4 - })); - formfields.push(new SelectBase({ - controlName: 'expenseAccount', - label: 'Expense Account', - value: definition ? definition.expenseAccount : '', - options: { label: 'name', value: 'id', data: this.expenseAccounts }, - required: true, - order: 5 - })); + formfields.push( + new InputBase({ + controlName: 'minAge', + label: 'Min Age', + value: definition ? definition.minAge : '', + type: 'number', + required: true, + order: 1 + }) + ); + formfields.push( + new InputBase({ + controlName: 'maxAge', + label: 'Max Age', + value: definition ? definition.maxAge : '', + type: 'number', + required: true, + order: 2 + }) + ); + formfields.push( + new InputBase({ + controlName: 'provisioningPercentage', + label: 'Percentage (%)', + value: definition ? definition.provisioningPercentage : '', + type: 'number', + required: true, + order: 3 + }) + ); + formfields.push( + new SelectBase({ + controlName: 'liabilityAccount', + label: 'Liability Account', + value: definition ? definition.liabilityAccount : '', + options: { label: 'name', value: 'id', data: this.liabilityAccounts }, + required: true, + order: 4 + }) + ); + formfields.push( + new SelectBase({ + controlName: 'expenseAccount', + label: 'Expense Account', + value: definition ? definition.expenseAccount : '', + options: { label: 'name', value: 'id', data: this.expenseAccounts }, + required: true, + order: 5 + }) + ); return formfields; } @@ -193,9 +221,10 @@ export class EditLoanProvisioningCriteriaComponent implements OnInit { definitions: this.definitions, locale }; - this.organizationService.updateProvisioningCriteria(this.loanProvisioningCriteriaAndTemplate.criteriaId, loanProvisioningCriteria).subscribe((response: any) => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.organizationService + .updateProvisioningCriteria(this.loanProvisioningCriteriaAndTemplate.criteriaId, loanProvisioningCriteria) + .subscribe((response: any) => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/organization/loan-provisioning-criteria/loan-provisioning-criteria.component.spec.ts b/src/app/organization/loan-provisioning-criteria/loan-provisioning-criteria.component.spec.ts index c47baeaef..1ce9d6055 100644 --- a/src/app/organization/loan-provisioning-criteria/loan-provisioning-criteria.component.spec.ts +++ b/src/app/organization/loan-provisioning-criteria/loan-provisioning-criteria.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanProvisioningCriteriaComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanProvisioningCriteriaComponent ] - }) - .compileComponents(); + declarations: [LoanProvisioningCriteriaComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/loan-provisioning-criteria/loan-provisioning-criteria.component.ts b/src/app/organization/loan-provisioning-criteria/loan-provisioning-criteria.component.ts index 1e16179fe..57568e4bd 100644 --- a/src/app/organization/loan-provisioning-criteria/loan-provisioning-criteria.component.ts +++ b/src/app/organization/loan-provisioning-criteria/loan-provisioning-criteria.component.ts @@ -17,11 +17,13 @@ import { of } from 'rxjs'; styleUrls: ['./loan-provisioning-criteria.component.scss'] }) export class LoanProvisioningCriteriaComponent implements OnInit { - /** Loan Provisioning Criteria data. */ loanProvisioningCriteriaData: any; /** Columns to be displayed in loan provisioning criteria table. */ - displayedColumns: string[] = ['criteriaName', 'createdBy']; + displayedColumns: string[] = [ + 'criteriaName', + 'createdBy' + ]; /** Data source for loan provisioning criteria table. */ dataSource: MatTableDataSource; @@ -35,7 +37,7 @@ export class LoanProvisioningCriteriaComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { loanProvisioningCriterias: any }) => { + this.route.data.subscribe((data: { loanProvisioningCriterias: any }) => { this.loanProvisioningCriteriaData = data.loanProvisioningCriterias; }); } @@ -63,5 +65,4 @@ export class LoanProvisioningCriteriaComponent implements OnInit { this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.spec.ts b/src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.spec.ts index 93fe25ffc..f62b12612 100644 --- a/src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.spec.ts +++ b/src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewLoanProvisioningCriteriaComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewLoanProvisioningCriteriaComponent ] - }) - .compileComponents(); + declarations: [ViewLoanProvisioningCriteriaComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.ts b/src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.ts index 1e4adb1a2..b025ad115 100644 --- a/src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.ts +++ b/src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.ts @@ -19,13 +19,19 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./view-loan-provisioning-criteria.component.scss'] }) export class ViewLoanProvisioningCriteriaComponent implements OnInit { - /** Loan Provisioning data. */ provisioningData: any; /** Loan Product String. */ loanProducts = ''; /** Column Headers for Mat Table. */ - displayedColumns: string[] = ['category', 'minAge', 'maxAge', 'percentage', 'liabilityAccount', 'expenseAccount']; + displayedColumns: string[] = [ + 'category', + 'minAge', + 'maxAge', + 'percentage', + 'liabilityAccount', + 'expenseAccount' + ]; /** Data source for loan provisioning criteria table. */ dataSource: MatTableDataSource; @@ -36,12 +42,14 @@ export class ViewLoanProvisioningCriteriaComponent implements OnInit { * @param {Router} router Router for navigation. * @param {MatDialog} dialog Dialog reference. */ - constructor(private organizationService: OrganizationService, - private route: ActivatedRoute, - private router: Router, - public dialog: MatDialog) { - this.route.data.subscribe((data: { loanProvisioningCriteria: any }) => { - this.provisioningData = data.loanProvisioningCriteria; + constructor( + private organizationService: OrganizationService, + private route: ActivatedRoute, + private router: Router, + public dialog: MatDialog + ) { + this.route.data.subscribe((data: { loanProvisioningCriteria: any }) => { + this.provisioningData = data.loanProvisioningCriteria; }); } @@ -55,7 +63,7 @@ export class ViewLoanProvisioningCriteriaComponent implements OnInit { setLoanProvisioningSelectedCriteria() { this.dataSource = new MatTableDataSource(this.provisioningData.definitions); - /** Get load products as a string. */ + /** Get load products as a string. */ for (let _id = 0; _id < this.provisioningData.loanProducts.length; _id++) { this.loanProducts += this.provisioningData.loanProducts[_id].name + ','; } @@ -70,12 +78,10 @@ export class ViewLoanProvisioningCriteriaComponent implements OnInit { }); deleteCriteriaDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.organizationService.deleteProvisioningCriteria(this.provisioningData.criteriaId) - .subscribe(() => { - this.router.navigate(['/organization/provisioningcriteria']); - }); + this.organizationService.deleteProvisioningCriteria(this.provisioningData.criteriaId).subscribe(() => { + this.router.navigate(['/organization/provisioningcriteria']); + }); } }); } - } diff --git a/src/app/organization/manage-funds/create-fund/create-fund.component.spec.ts b/src/app/organization/manage-funds/create-fund/create-fund.component.spec.ts index 333a8ecb0..918f292db 100644 --- a/src/app/organization/manage-funds/create-fund/create-fund.component.spec.ts +++ b/src/app/organization/manage-funds/create-fund/create-fund.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateFundComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ CreateFundComponent ] - }) - .compileComponents(); + declarations: [CreateFundComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/organization/manage-funds/create-fund/create-fund.component.ts b/src/app/organization/manage-funds/create-fund/create-fund.component.ts index beb912e77..aa8a80130 100644 --- a/src/app/organization/manage-funds/create-fund/create-fund.component.ts +++ b/src/app/organization/manage-funds/create-fund/create-fund.component.ts @@ -9,7 +9,6 @@ import { OrganizationService } from 'app/organization/organization.service'; styleUrls: ['./create-fund.component.scss'] }) export class CreateFundComponent implements OnInit { - /** Charge form. */ fundForm: UntypedFormGroup; @@ -20,11 +19,12 @@ export class CreateFundComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private organizationService: OrganizationService, - private formBuilder: UntypedFormBuilder, - private router: Router, - private route: ActivatedRoute) { - } + constructor( + private organizationService: OrganizationService, + private formBuilder: UntypedFormBuilder, + private router: Router, + private route: ActivatedRoute + ) {} ngOnInit() { this.createFundForm(); @@ -35,19 +35,18 @@ export class CreateFundComponent implements OnInit { */ createFundForm() { this.fundForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'externalId': [''] + name: [ + '', + Validators.required + ], + externalId: [''] }); } - submit() { const payload = this.fundForm.getRawValue(); - this.organizationService.createFund(payload) - .subscribe((response: any) => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.organizationService.createFund(payload).subscribe((response: any) => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } - - } diff --git a/src/app/organization/manage-funds/edit-fund/edit-fund.component.spec.ts b/src/app/organization/manage-funds/edit-fund/edit-fund.component.spec.ts index 8d33f0dcd..6a42f9154 100644 --- a/src/app/organization/manage-funds/edit-fund/edit-fund.component.spec.ts +++ b/src/app/organization/manage-funds/edit-fund/edit-fund.component.spec.ts @@ -8,9 +8,8 @@ describe('EditFundComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ EditFundComponent ] - }) - .compileComponents(); + declarations: [EditFundComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/organization/manage-funds/edit-fund/edit-fund.component.ts b/src/app/organization/manage-funds/edit-fund/edit-fund.component.ts index ef67472b3..ea1ccfb49 100644 --- a/src/app/organization/manage-funds/edit-fund/edit-fund.component.ts +++ b/src/app/organization/manage-funds/edit-fund/edit-fund.component.ts @@ -9,7 +9,6 @@ import { OrganizationService } from 'app/organization/organization.service'; styleUrls: ['./edit-fund.component.scss'] }) export class EditFundComponent implements OnInit { - /** Selected Data. */ fundData: any; /** Charge form. */ @@ -22,10 +21,12 @@ export class EditFundComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private organizationService: OrganizationService, - private formBuilder: UntypedFormBuilder, - private router: Router, - private route: ActivatedRoute) { + constructor( + private organizationService: OrganizationService, + private formBuilder: UntypedFormBuilder, + private router: Router, + private route: ActivatedRoute + ) { this.route.data.subscribe((data: { fundData: any }) => { this.fundData = data.fundData; }); @@ -40,17 +41,18 @@ export class EditFundComponent implements OnInit { */ createFundForm() { this.fundForm = this.formBuilder.group({ - 'name': [this.fundData.name, Validators.required], - 'externalId': [this.fundData.externalId] + name: [ + this.fundData.name, + Validators.required + ], + externalId: [this.fundData.externalId] }); } - submit() { const payload = this.fundForm.getRawValue(); - this.organizationService.editFund(this.fundData.id.toString(), payload) - .subscribe((response: any) => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.organizationService.editFund(this.fundData.id.toString(), payload).subscribe((response: any) => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } } diff --git a/src/app/organization/manage-funds/manage-funds.component.spec.ts b/src/app/organization/manage-funds/manage-funds.component.spec.ts index 84029683a..a5c22cb03 100644 --- a/src/app/organization/manage-funds/manage-funds.component.spec.ts +++ b/src/app/organization/manage-funds/manage-funds.component.spec.ts @@ -8,9 +8,8 @@ describe('ManageFundsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ManageFundsComponent ] - }) - .compileComponents(); + declarations: [ManageFundsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/manage-funds/manage-funds.component.ts b/src/app/organization/manage-funds/manage-funds.component.ts index 307550d3d..a08f188ca 100644 --- a/src/app/organization/manage-funds/manage-funds.component.ts +++ b/src/app/organization/manage-funds/manage-funds.component.ts @@ -31,7 +31,6 @@ import { MatSort } from '@angular/material/sort'; styleUrls: ['./manage-funds.component.scss'] }) export class ManageFundsComponent implements OnInit, AfterViewInit { - /** Manage Funds data. */ fundsData: any; /** New Fund form */ @@ -44,7 +43,10 @@ export class ManageFundsComponent implements OnInit, AfterViewInit { /* Template for popover on funds form */ @ViewChild('templateFundFormRef') templateFundFormRef: TemplateRef; /** Columns to be displayed in funds table. */ - displayedColumns: string[] = ['name', 'externalId']; + displayedColumns: string[] = [ + 'name', + 'externalId' + ]; /** Data source for Funds table. */ dataSource: MatTableDataSource; @@ -63,14 +65,16 @@ export class ManageFundsComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private route: ActivatedRoute, - private formBuilder: UntypedFormBuilder, - private organizationservice: OrganizationService, - public dialog: MatDialog, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { - this.route.data.subscribe(( data: { funds: any }) => { + constructor( + private route: ActivatedRoute, + private formBuilder: UntypedFormBuilder, + private organizationservice: OrganizationService, + public dialog: MatDialog, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { + this.route.data.subscribe((data: { funds: any }) => { this.fundsData = data.funds; }); } @@ -79,7 +83,6 @@ export class ManageFundsComponent implements OnInit, AfterViewInit { this.dataSource = new MatTableDataSource(this.fundsData); this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; - } /** @@ -95,7 +98,10 @@ export class ManageFundsComponent implements OnInit, AfterViewInit { */ createFundForm() { this.fundForm = this.formBuilder.group({ - 'name': ['', Validators.required] + name: [ + '', + Validators.required + ] }); } @@ -105,10 +111,10 @@ export class ManageFundsComponent implements OnInit, AfterViewInit { addFund() { const newFund = this.fundForm.value; this.organizationservice.createFund(newFund).subscribe((response: any) => { - this.fundsData.push({ - id: response.resourceId, - name: newFund.name - }); + this.fundsData.push({ + id: response.resourceId, + name: newFund.name + }); this.formRef.resetForm(); if (this.configurationWizardService.showManageFunds === true) { this.configurationWizardService.showManageFunds = false; @@ -131,7 +137,8 @@ export class ManageFundsComponent implements OnInit, AfterViewInit { value: fundContent, type: 'text', required: true - }), + }) + ]; const data = { title: 'Edit Fund', @@ -155,7 +162,12 @@ export class ManageFundsComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -165,7 +177,7 @@ export class ManageFundsComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showManageFunds === true) { setTimeout(() => { - this.showPopover(this.templateFundFormRef, this.fundFormRef.nativeElement, 'bottom', true); + this.showPopover(this.templateFundFormRef, this.fundFormRef.nativeElement, 'bottom', true); }); } } @@ -193,10 +205,10 @@ export class ManageFundsComponent implements OnInit, AfterViewInit { const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, { data: { stepName: 'fund' - }, + } }); continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => { - if (response.step === 1) { + if (response.step === 1) { this.configurationWizardService.showManageFunds = false; this.router.navigate(['../'], { relativeTo: this.route }); } else if (response.step === 2) { diff --git a/src/app/organization/manage-funds/manage-funds.resolver.ts b/src/app/organization/manage-funds/manage-funds.resolver.ts index ab49848a4..193a0d980 100644 --- a/src/app/organization/manage-funds/manage-funds.resolver.ts +++ b/src/app/organization/manage-funds/manage-funds.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service'; */ @Injectable() export class ManageFundsResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class ManageFundsResolver implements Resolve { resolve(): Observable { return this.organizationService.getFunds(); } - } diff --git a/src/app/organization/manage-funds/view-fund/view-fund.component.spec.ts b/src/app/organization/manage-funds/view-fund/view-fund.component.spec.ts index 65604c00d..5ff58e194 100644 --- a/src/app/organization/manage-funds/view-fund/view-fund.component.spec.ts +++ b/src/app/organization/manage-funds/view-fund/view-fund.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewFundComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ViewFundComponent ] - }) - .compileComponents(); + declarations: [ViewFundComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/organization/manage-funds/view-fund/view-fund.component.ts b/src/app/organization/manage-funds/view-fund/view-fund.component.ts index b10738a3f..00171e762 100644 --- a/src/app/organization/manage-funds/view-fund/view-fund.component.ts +++ b/src/app/organization/manage-funds/view-fund/view-fund.component.ts @@ -7,7 +7,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-fund.component.scss'] }) export class ViewFundComponent { - /** Fund data. */ fundData: any; @@ -20,5 +19,4 @@ export class ViewFundComponent { this.fundData = data.fundData; }); } - } diff --git a/src/app/organization/offices/common-resolvers/edit-office.resolver.ts b/src/app/organization/offices/common-resolvers/edit-office.resolver.ts index b39dadcb1..8526a4061 100644 --- a/src/app/organization/offices/common-resolvers/edit-office.resolver.ts +++ b/src/app/organization/offices/common-resolvers/edit-office.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service'; */ @Injectable() export class EditOfficeResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -27,5 +26,4 @@ export class EditOfficeResolver implements Resolve { const officeId = route.paramMap.get('officeId'); return this.organizationService.getOffice(officeId, true); } - } diff --git a/src/app/organization/offices/common-resolvers/office-datatable.resolver.ts b/src/app/organization/offices/common-resolvers/office-datatable.resolver.ts index f9bf1eb52..44d5fd8c1 100644 --- a/src/app/organization/offices/common-resolvers/office-datatable.resolver.ts +++ b/src/app/organization/offices/common-resolvers/office-datatable.resolver.ts @@ -11,11 +11,10 @@ import { Observable } from 'rxjs'; */ @Injectable() export class OfficeDatatableResolver implements Resolve { - /** * @param {SystemService} systemService Products service. */ - constructor(private systemService: SystemService) { } + constructor(private systemService: SystemService) {} /** * Returns the Office's Datatable data. @@ -26,5 +25,4 @@ export class OfficeDatatableResolver implements Resolve { const datatableName = route.paramMap.get('datatableName'); return this.systemService.getEntityDatatable(officeId, datatableName); } - } diff --git a/src/app/organization/offices/common-resolvers/office-datatables.resolver.ts b/src/app/organization/offices/common-resolvers/office-datatables.resolver.ts index ecc09bf6d..9137c9218 100644 --- a/src/app/organization/offices/common-resolvers/office-datatables.resolver.ts +++ b/src/app/organization/offices/common-resolvers/office-datatables.resolver.ts @@ -11,11 +11,10 @@ import { Observable } from 'rxjs'; */ @Injectable() export class OfficeDatatablesResolver implements Resolve { - /** * @param {SystemService} systemService Products service. */ - constructor(private systemService: SystemService) { } + constructor(private systemService: SystemService) {} /** * Returns the loan product data. @@ -24,5 +23,4 @@ export class OfficeDatatablesResolver implements Resolve { resolve(route: ActivatedRouteSnapshot): Observable { return this.systemService.getEntityDatatables('m_office'); } - } diff --git a/src/app/organization/offices/common-resolvers/office.resolver.ts b/src/app/organization/offices/common-resolvers/office.resolver.ts index 612795ee8..0a2cc8c12 100644 --- a/src/app/organization/offices/common-resolvers/office.resolver.ts +++ b/src/app/organization/offices/common-resolvers/office.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service'; */ @Injectable() export class OfficeResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -27,5 +26,4 @@ export class OfficeResolver implements Resolve { const officeId = route.parent.paramMap.get('officeId'); return this.organizationService.getOffice(officeId); } - } diff --git a/src/app/organization/offices/common-resolvers/offices.resolver.ts b/src/app/organization/offices/common-resolvers/offices.resolver.ts index 8d0a3e6fa..1ede35118 100644 --- a/src/app/organization/offices/common-resolvers/offices.resolver.ts +++ b/src/app/organization/offices/common-resolvers/offices.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service'; */ @Injectable() export class OfficesResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class OfficesResolver implements Resolve { resolve(): Observable { return this.organizationService.getOffices(); } - } diff --git a/src/app/organization/offices/create-office/create-office.component.spec.ts b/src/app/organization/offices/create-office/create-office.component.spec.ts index b5c5e596d..00a4911b7 100644 --- a/src/app/organization/offices/create-office/create-office.component.spec.ts +++ b/src/app/organization/offices/create-office/create-office.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateOfficeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateOfficeComponent ] - }) - .compileComponents(); + declarations: [CreateOfficeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/offices/create-office/create-office.component.ts b/src/app/organization/offices/create-office/create-office.component.ts index 84ca4614d..c109917ff 100644 --- a/src/app/organization/offices/create-office/create-office.component.ts +++ b/src/app/organization/offices/create-office/create-office.component.ts @@ -1,6 +1,5 @@ /** Angular Imports */ -import { Component, OnInit, TemplateRef, ElementRef , ViewChild, - AfterViewInit } from '@angular/core'; +import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core'; import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms'; import { Router, ActivatedRoute } from '@angular/router'; @@ -24,7 +23,6 @@ import { ContinueSetupDialogComponent } from '../../../configuration-wizard/cont styleUrls: ['./create-office.component.scss'] }) export class CreateOfficeComponent implements OnInit, AfterViewInit { - /** Office form. */ officeForm: UntypedFormGroup; /** Office Data */ @@ -51,15 +49,17 @@ export class CreateOfficeComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private settingsService: SettingsService, - private router: Router, - private route: ActivatedRoute, - private dateUtils: Dates, - private popoverService: PopoverService, - private configurationWizardService: ConfigurationWizardService, - public dialog: MatDialog) { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private settingsService: SettingsService, + private router: Router, + private route: ActivatedRoute, + private dateUtils: Dates, + private popoverService: PopoverService, + private configurationWizardService: ConfigurationWizardService, + public dialog: MatDialog + ) { this.route.data.subscribe((data: { offices: any }) => { this.officeData = data.offices; }); @@ -75,10 +75,19 @@ export class CreateOfficeComponent implements OnInit, AfterViewInit { */ createofficeForm() { this.officeForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'parentId': ['', Validators.required], - 'openingDate': ['', Validators.required], - 'externalId': [''], + name: [ + '', + Validators.required + ], + parentId: [ + '', + Validators.required + ], + openingDate: [ + '', + Validators.required + ], + externalId: [''] }); } @@ -99,7 +108,7 @@ export class CreateOfficeComponent implements OnInit, AfterViewInit { dateFormat, locale }; - this.organizationService.createOffice(data).subscribe(response => { + this.organizationService.createOffice(data).subscribe((response) => { if (this.configurationWizardService.showOfficeForm === true) { this.configurationWizardService.showOfficeForm = false; this.openDialog(); @@ -116,21 +125,21 @@ export class CreateOfficeComponent implements OnInit, AfterViewInit { const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, { data: { stepName: 'office' - }, + } }); continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => { if (response.step === 1) { - this.configurationWizardService.showOfficeForm = false; - this.router.navigate(['../'], { relativeTo: this.route }); - } else if (response.step === 2) { - this.configurationWizardService.showOfficeForm = true; - this.router.routeReuseStrategy.shouldReuseRoute = () => false; - this.router.onSameUrlNavigation = 'reload'; - this.router.navigate(['/organization/offices/create']); - } else if (response.step === 3) { - this.configurationWizardService.showOfficeForm = false; - this.configurationWizardService.showAddEditCurrency = true; - this.router.navigate(['/organization']); + this.configurationWizardService.showOfficeForm = false; + this.router.navigate(['../'], { relativeTo: this.route }); + } else if (response.step === 2) { + this.configurationWizardService.showOfficeForm = true; + this.router.routeReuseStrategy.shouldReuseRoute = () => false; + this.router.onSameUrlNavigation = 'reload'; + this.router.navigate(['/organization/offices/create']); + } else if (response.step === 3) { + this.configurationWizardService.showOfficeForm = false; + this.configurationWizardService.showAddEditCurrency = true; + this.router.navigate(['/organization']); } }); } @@ -142,7 +151,12 @@ export class CreateOfficeComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -152,7 +166,7 @@ export class CreateOfficeComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showOfficeForm === true) { setTimeout(() => { - this.showPopover(this.templateCreateOfficeForm, this.createOfficeFormRef.nativeElement, 'right', true); + this.showPopover(this.templateCreateOfficeForm, this.createOfficeFormRef.nativeElement, 'right', true); }); } } diff --git a/src/app/organization/offices/edit-office/edit-office.component.spec.ts b/src/app/organization/offices/edit-office/edit-office.component.spec.ts index 5dafec9d6..84373741f 100644 --- a/src/app/organization/offices/edit-office/edit-office.component.spec.ts +++ b/src/app/organization/offices/edit-office/edit-office.component.spec.ts @@ -8,9 +8,8 @@ describe('EditOfficeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditOfficeComponent ] - }) - .compileComponents(); + declarations: [EditOfficeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/offices/edit-office/edit-office.component.ts b/src/app/organization/offices/edit-office/edit-office.component.ts index 65e8f26f3..abcf7cc5f 100644 --- a/src/app/organization/offices/edit-office/edit-office.component.ts +++ b/src/app/organization/offices/edit-office/edit-office.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-office.component.scss'] }) export class EditOfficeComponent implements OnInit { - /** Selected Data. */ officeData: any; /** Office form. */ @@ -27,26 +26,28 @@ export class EditOfficeComponent implements OnInit { /** Maximum Date allowed. */ maxDate = new Date(); - /** - * Retrieves the charge data from `resolve`. - * @param {ProductsService} organizationService Organization Service. - * @param {SettingsService} settingsService Settings Service. - * @param {FormBuilder} formBuilder Form Builder. - * @param {ActivatedRoute} route Activated Route. - * @param {Router} router Router for navigation. - * @param {MatDialog} dialog Dialog reference. - * @param {Dates} dateUtils Date Utils - */ - constructor(private organizationService: OrganizationService, - private settingsService: SettingsService, - private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates) { - this.route.data.subscribe((data: { officeTemplate: any }) => { - this.officeData = data.officeTemplate; - }); - } + /** + * Retrieves the charge data from `resolve`. + * @param {ProductsService} organizationService Organization Service. + * @param {SettingsService} settingsService Settings Service. + * @param {FormBuilder} formBuilder Form Builder. + * @param {ActivatedRoute} route Activated Route. + * @param {Router} router Router for navigation. + * @param {MatDialog} dialog Dialog reference. + * @param {Dates} dateUtils Date Utils + */ + constructor( + private organizationService: OrganizationService, + private settingsService: SettingsService, + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates + ) { + this.route.data.subscribe((data: { officeTemplate: any }) => { + this.officeData = data.officeTemplate; + }); + } ngOnInit() { this.maxDate = this.settingsService.businessDate; @@ -58,9 +59,15 @@ export class EditOfficeComponent implements OnInit { */ createOfficeForm() { this.officeForm = this.formBuilder.group({ - 'name': [this.officeData.name, Validators.required], - 'openingDate': [this.officeData.openingDate && new Date(this.officeData.openingDate), Validators.required], - 'externalId': [this.officeData.externalId], + name: [ + this.officeData.name, + Validators.required + ], + openingDate: [ + this.officeData.openingDate && new Date(this.officeData.openingDate), + Validators.required + ], + externalId: [this.officeData.externalId] }); if (this.officeData.allowedParents.length) { this.officeForm.addControl('parentId', this.formBuilder.control(this.officeData.parentId, Validators.required)); @@ -87,5 +94,4 @@ export class EditOfficeComponent implements OnInit { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/organization/offices/office-node.model.ts b/src/app/organization/offices/office-node.model.ts index 8a0669eed..78cd23949 100644 --- a/src/app/organization/offices/office-node.model.ts +++ b/src/app/organization/offices/office-node.model.ts @@ -1,8 +1,7 @@ /** * Office Node model. */ - export class OfficeNode { - +export class OfficeNode { /** Office Node children. */ children: OfficeNode[]; @@ -14,13 +13,15 @@ parentName: string; openingDate: string; - constructor(name: string, - id: string = '', - parentId: string = '', - hierarchy: string = '', - externalId: string = '', - parentName: string = '', - openingDate: string = '') { + constructor( + name: string, + id: string = '', + parentId: string = '', + hierarchy: string = '', + externalId: string = '', + parentName: string = '', + openingDate: string = '' + ) { this.name = name; this.id = id; this.parentId = parentId; @@ -30,5 +31,4 @@ this.openingDate = openingDate; this.children = []; } - } diff --git a/src/app/organization/offices/office-tree-service.service.ts b/src/app/organization/offices/office-tree-service.service.ts index 10a5fa04a..217f9bf5b 100644 --- a/src/app/organization/offices/office-tree-service.service.ts +++ b/src/app/organization/offices/office-tree-service.service.ts @@ -14,7 +14,6 @@ import { OfficeNode } from './office-node.model'; providedIn: 'root' }) export class OfficeTreeService { - /** Office data. */ officesData: any; /** Offices tree data behavior subject to represent offices tree nodes. */ @@ -23,9 +22,11 @@ export class OfficeTreeService { /** * Gets the offices tree nodes. */ - get treeData(): OfficeNode[] { return this.treeDataChange.value; } + get treeData(): OfficeNode[] { + return this.treeDataChange.value; + } - constructor() { } + constructor() {} /** * Builds the offices tree and emits the value. @@ -60,8 +61,15 @@ export class OfficeTreeService { // Add offices to any array where index for each is denoted by its id for (const office of officesData) { - offices[office.id] = - new OfficeNode(office.name, office.id, office.parentId, office.hierarchy, office.externalId, office.parentName, office.openingDate); + offices[office.id] = new OfficeNode( + office.name, + office.id, + office.parentId, + office.hierarchy, + office.externalId, + office.parentName, + office.openingDate + ); } // Construct offices tree by adding all nodes belonging to headers (with parent id = 0), @@ -77,5 +85,4 @@ export class OfficeTreeService { } return officeTree; } - } diff --git a/src/app/organization/offices/offices.component.spec.ts b/src/app/organization/offices/offices.component.spec.ts index 289a311d7..7c99c706a 100644 --- a/src/app/organization/offices/offices.component.spec.ts +++ b/src/app/organization/offices/offices.component.spec.ts @@ -8,9 +8,8 @@ describe('OfficesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ OfficesComponent ] - }) - .compileComponents(); + declarations: [OfficesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/offices/offices.component.ts b/src/app/organization/offices/offices.component.ts index 2b78a7689..6290e9198 100644 --- a/src/app/organization/offices/offices.component.ts +++ b/src/app/organization/offices/offices.component.ts @@ -3,7 +3,7 @@ import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; import { MatTableDataSource } from '@angular/material/table'; -import { ActivatedRoute, Router, } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; /** rxjs Imports */ import { of } from 'rxjs'; @@ -33,7 +33,12 @@ export class OfficesComponent implements OnInit, AfterViewInit { /** Offices data. */ officesData: any; /** Columns to be displayed in offices table. */ - displayedColumns: string[] = ['name', 'externalId', 'parentName', 'openingDate']; + displayedColumns: string[] = [ + 'name', + 'externalId', + 'parentName', + 'openingDate' + ]; /** Data source for offices table. */ dataSource: MatTableDataSource; /** Nested tree control for offices tree. */ @@ -52,7 +57,6 @@ export class OfficesComponent implements OnInit, AfterViewInit { /** Sorter for offices table. */ @ViewChild(MatSort, { static: true }) sort: MatSort; - /* Reference of tree view button */ @ViewChild('buttonTreeView') buttonTreeView: ElementRef; /* Template for popover on tree view button */ @@ -70,13 +74,15 @@ export class OfficesComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private officeTreeService: OfficeTreeService, private treeControlService: TreeControlService, private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { - this.route.data.subscribe(( data: { offices: any, officeDataTables: any }) => { + private popoverService: PopoverService + ) { + this.route.data.subscribe((data: { offices: any; officeDataTables: any }) => { this.officesData = data.offices; officeTreeService.initialize(this.officesData); this.dataTablesData = data.officeDataTables; @@ -96,7 +102,7 @@ export class OfficesComponent implements OnInit, AfterViewInit { /** * Sets the offices table. */ - ngOnInit() { + ngOnInit() { this.setOffices(); this.officeTreeService.treeDataChange.subscribe((officeTreeData: OfficeNode[]) => { this.nestedTreeDataSource.data = officeTreeData; @@ -118,7 +124,7 @@ export class OfficesComponent implements OnInit, AfterViewInit { * View selected office. * @param {OfficeNode} office Office to be viewed. */ - viewOfficeNode(office: OfficeNode) { + viewOfficeNode(office: OfficeNode) { if (office.id) { this.office = office; } else { @@ -150,7 +156,12 @@ export class OfficesComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -160,12 +171,12 @@ export class OfficesComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showOfficeList === true) { setTimeout(() => { - this.showPopover(this.templateButtonTreeView, this.buttonTreeView.nativeElement, 'bottom', true); + this.showPopover(this.templateButtonTreeView, this.buttonTreeView.nativeElement, 'bottom', true); }); } if (this.configurationWizardService.showOfficeTable === true) { setTimeout(() => { - this.showPopover(this.templateTableOffices, this.tableOffices.nativeElement, 'top', true); + this.showPopover(this.templateTableOffices, this.tableOffices.nativeElement, 'top', true); }); } } @@ -196,5 +207,4 @@ export class OfficesComponent implements OnInit, AfterViewInit { toggleExpandCollapse() { this.isTreeExpanded = this.treeControlService.toggleExpandCollapse(this.nestedTreeControl, this.isTreeExpanded); } - } diff --git a/src/app/organization/offices/view-office/datatable-tabs/datatable-tabs.component.spec.ts b/src/app/organization/offices/view-office/datatable-tabs/datatable-tabs.component.spec.ts index 0f1dfa604..571f3ae93 100644 --- a/src/app/organization/offices/view-office/datatable-tabs/datatable-tabs.component.spec.ts +++ b/src/app/organization/offices/view-office/datatable-tabs/datatable-tabs.component.spec.ts @@ -8,9 +8,8 @@ describe('DatatableTabsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DatatableTabsComponent ] - }) - .compileComponents(); + declarations: [DatatableTabsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/offices/view-office/datatable-tabs/datatable-tabs.component.ts b/src/app/organization/offices/view-office/datatable-tabs/datatable-tabs.component.ts index 7018954f4..cf494eaed 100644 --- a/src/app/organization/offices/view-office/datatable-tabs/datatable-tabs.component.ts +++ b/src/app/organization/offices/view-office/datatable-tabs/datatable-tabs.component.ts @@ -29,5 +29,4 @@ export class DatatableTabsComponent { this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); } - } diff --git a/src/app/organization/offices/view-office/general-tab/general-tab.component.spec.ts b/src/app/organization/offices/view-office/general-tab/general-tab.component.spec.ts index 68ff6503e..53d6cbc31 100644 --- a/src/app/organization/offices/view-office/general-tab/general-tab.component.spec.ts +++ b/src/app/organization/offices/view-office/general-tab/general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ GeneralTabComponent ] - }) - .compileComponents(); + declarations: [GeneralTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/offices/view-office/general-tab/general-tab.component.ts b/src/app/organization/offices/view-office/general-tab/general-tab.component.ts index e4fbd5a82..036f7bfb7 100644 --- a/src/app/organization/offices/view-office/general-tab/general-tab.component.ts +++ b/src/app/organization/offices/view-office/general-tab/general-tab.component.ts @@ -11,7 +11,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./general-tab.component.scss'] }) export class GeneralTabComponent { - /** Office data */ officeData: any; @@ -24,5 +23,4 @@ export class GeneralTabComponent { this.officeData = data.office; }); } - } diff --git a/src/app/organization/offices/view-office/view-office.component.spec.ts b/src/app/organization/offices/view-office/view-office.component.spec.ts index 1003f346b..d47d56952 100644 --- a/src/app/organization/offices/view-office/view-office.component.spec.ts +++ b/src/app/organization/offices/view-office/view-office.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewOfficeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewOfficeComponent ] - }) - .compileComponents(); + declarations: [ViewOfficeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/offices/view-office/view-office.component.ts b/src/app/organization/offices/view-office/view-office.component.ts index 76c272d71..6c230a116 100644 --- a/src/app/organization/offices/view-office/view-office.component.ts +++ b/src/app/organization/offices/view-office/view-office.component.ts @@ -11,7 +11,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-office.component.scss'] }) export class ViewOfficeComponent { - /** Office datatables data */ officeDatatables: any; @@ -24,5 +23,4 @@ export class ViewOfficeComponent { this.officeDatatables = data.officeDatatables; }); } - } diff --git a/src/app/organization/organization-routing.module.ts b/src/app/organization/organization-routing.module.ts index f98abdb4b..bc7b3bb27 100644 --- a/src/app/organization/organization-routing.module.ts +++ b/src/app/organization/organization-routing.module.ts @@ -131,7 +131,7 @@ const routes: Routes = [ data: { title: 'Create Provisioning Criteria', breadcrumb: 'Create Provisioning Criteria' }, component: CreateLoanProvisioningCriteriaComponent, resolve: { - loanProvisioningCriteriaTemplate: LoanProvisioningCriteriaTemplateResolver, + loanProvisioningCriteriaTemplate: LoanProvisioningCriteriaTemplateResolver } }, { @@ -155,7 +155,7 @@ const routes: Routes = [ } ] } - ], + ] }, { path: 'offices', @@ -165,7 +165,7 @@ const routes: Routes = [ path: '', component: OfficesComponent, resolve: { - offices: OfficesResolver + offices: OfficesResolver } }, { @@ -173,7 +173,7 @@ const routes: Routes = [ component: CreateOfficeComponent, data: { title: 'Create Office', breadcrumb: 'Create Office' }, resolve: { - offices: OfficesResolver, + offices: OfficesResolver } }, { @@ -181,7 +181,7 @@ const routes: Routes = [ data: { title: 'View Office', breadcrumb: 'officeId', routeParamBreadcrumb: 'officeId' }, component: ViewOfficeComponent, resolve: { - officeDatatables: OfficeDatatablesResolver, + officeDatatables: OfficeDatatablesResolver }, children: [ { @@ -199,7 +199,8 @@ const routes: Routes = [ }, { path: 'datatables', - children: [{ + children: [ + { path: ':datatableName', component: DatatableTabsComponent, data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, @@ -248,7 +249,7 @@ const routes: Routes = [ path: '', component: ViewEmployeeComponent, resolve: { - employee: EmployeeResolver, + employee: EmployeeResolver } }, { @@ -272,7 +273,7 @@ const routes: Routes = [ children: [ { path: '', - component: CurrenciesComponent, + component: CurrenciesComponent }, { path: 'manage', @@ -302,7 +303,10 @@ const routes: Routes = [ }, { path: ':id', - data: { title: 'View SMS Campaign', routeResolveBreadcrumb: ['smsCampaign', 'campaignName'] }, + data: { title: 'View SMS Campaign', routeResolveBreadcrumb: [ + 'smsCampaign', + 'campaignName' + ] }, resolve: { smsCampaign: SmsCampaignResolver }, @@ -310,14 +314,14 @@ const routes: Routes = [ children: [ { path: '', - component: ViewCampaignComponent, + component: ViewCampaignComponent }, { path: 'edit', component: EditCampaignComponent, - data: { title: 'Edit SMS Campaign', breadcrumb: 'Edit', routeResolveBreadcrumb: false}, + data: { title: 'Edit SMS Campaign', breadcrumb: 'Edit', routeResolveBreadcrumb: false }, resolve: { - smsCampaignTemplate: SmsCampaignTemplateResolver, + smsCampaignTemplate: SmsCampaignTemplateResolver } } ] @@ -344,7 +348,7 @@ const routes: Routes = [ path: 'investors', component: InvestorsComponent, data: { title: 'Investors', breadcrumb: 'Investors' }, - resolve: { } + resolve: {} }, { path: 'adhoc-query', @@ -374,7 +378,7 @@ const routes: Routes = [ component: ViewAdhocQueryComponent, resolve: { adhocQuery: AdhocQueryResolver - }, + } }, { path: 'edit', @@ -416,7 +420,7 @@ const routes: Routes = [ component: ViewTellerComponent, resolve: { teller: TellerResolver - }, + } }, { path: 'edit', @@ -469,7 +473,11 @@ const routes: Routes = [ }, { path: 'transactions', - data: { title: 'Cashier Transactions', breadcrumb: 'Transactions', routeParamBreadcrumb: false }, + data: { + title: 'Cashier Transactions', + breadcrumb: 'Transactions', + routeParamBreadcrumb: false + }, component: TransactionsComponent, resolve: { currencies: CurrenciesResolver @@ -513,7 +521,7 @@ const routes: Routes = [ { path: 'create', component: CreatePaymentTypeComponent, - data: { title: 'Create Payment Type', breadcrumb: 'Create Payment Type'} + data: { title: 'Create Payment Type', breadcrumb: 'Create Payment Type' } }, { path: ':id', @@ -556,7 +564,7 @@ const routes: Routes = [ component: EntityDataTableChecksComponent, resolve: { entityDataTableChecks: EntityDataTableChecksResolver - }, + } }, { path: 'create', @@ -585,7 +593,7 @@ const routes: Routes = [ component: ManageFundsComponent, resolve: { funds: ManageFundsResolver - }, + } }, { path: 'create', @@ -604,7 +612,7 @@ const routes: Routes = [ component: ViewFundComponent, resolve: { fundData: ManageFundResolver - }, + } }, { path: 'edit', @@ -613,9 +621,9 @@ const routes: Routes = [ resolve: { fundData: ManageFundResolver } - }, + } ] - }, + } ], resolve: { funds: ManageFundsResolver @@ -627,7 +635,7 @@ const routes: Routes = [ children: [ { path: '', - component: BulkImportComponent, + component: BulkImportComponent }, { path: ':import-name', @@ -687,6 +695,7 @@ const routes: Routes = [ ] } ]) + ]; /** @@ -740,4 +749,4 @@ const routes: Routes = [ AdvanceSearchTemplateResolver ] }) -export class OrganizationRoutingModule { } +export class OrganizationRoutingModule {} diff --git a/src/app/organization/organization.component.spec.ts b/src/app/organization/organization.component.spec.ts index 928b99cc1..aa0752169 100644 --- a/src/app/organization/organization.component.spec.ts +++ b/src/app/organization/organization.component.spec.ts @@ -8,9 +8,8 @@ describe('OrganizationComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ OrganizationComponent ] - }) - .compileComponents(); + declarations: [OrganizationComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/organization.component.ts b/src/app/organization/organization.component.ts index e79130d98..77a7572d5 100644 --- a/src/app/organization/organization.component.ts +++ b/src/app/organization/organization.component.ts @@ -15,7 +15,6 @@ import { PopoverService } from '../configuration-wizard/popover/popover.service' styleUrls: ['./organization.component.scss'] }) export class OrganizationComponent implements AfterViewInit { - shouldShowFundMapping = false; /* Reference of manage offices */ @ViewChild('office') office: ElementRef; @@ -50,10 +49,12 @@ export class OrganizationComponent implements AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private activatedRoute: ActivatedRoute, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { } + constructor( + private activatedRoute: ActivatedRoute, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) {} /** * Popover function @@ -63,7 +64,12 @@ export class OrganizationComponent implements AfterViewInit { * @param backdrop Boolean. * @param arrowNumber - The index of the boolean value to toggle. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -73,32 +79,32 @@ export class OrganizationComponent implements AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showCreateOffice === true) { setTimeout(() => { - this.showPopover(this.templateOffice, this.office.nativeElement, 'bottom', true); + this.showPopover(this.templateOffice, this.office.nativeElement, 'bottom', true); }); } if (this.configurationWizardService.showAddEditCurrency === true) { setTimeout(() => { - this.showPopover(this.templateAddEditCurrency, this.addEditCurrency.nativeElement, 'bottom', true); + this.showPopover(this.templateAddEditCurrency, this.addEditCurrency.nativeElement, 'bottom', true); }); } if (this.configurationWizardService.showCreateHoliday === true) { setTimeout(() => { - this.showPopover(this.templateHolidays, this.holidays.nativeElement, 'bottom', true); + this.showPopover(this.templateHolidays, this.holidays.nativeElement, 'bottom', true); }); } if (this.configurationWizardService.showCreateEmployee === true) { setTimeout(() => { - this.showPopover(this.templateEmployee, this.employee.nativeElement, 'bottom', true); + this.showPopover(this.templateEmployee, this.employee.nativeElement, 'bottom', true); }); } if (this.configurationWizardService.showDefineWorkingDays === true) { setTimeout(() => { - this.showPopover(this.templateWorkingDays, this.workingDays.nativeElement, 'bottom', true); + this.showPopover(this.templateWorkingDays, this.workingDays.nativeElement, 'bottom', true); }); } if (this.configurationWizardService.showManageFunds === true) { setTimeout(() => { - this.showPopover(this.templateManageFunds, this.manageFunds.nativeElement, 'bottom', true); + this.showPopover(this.templateManageFunds, this.manageFunds.nativeElement, 'bottom', true); }); } } @@ -207,7 +213,7 @@ export class OrganizationComponent implements AfterViewInit { this.router.navigate(['/products/recurring-deposit-products']); } - arrowBooleansToggle(arrowNumber: number) { + arrowBooleansToggle(arrowNumber: number) { // Toggle the boolean value at the given index this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber]; } diff --git a/src/app/organization/organization.module.ts b/src/app/organization/organization.module.ts index 49f7bb7d2..eddedda8a 100644 --- a/src/app/organization/organization.module.ts +++ b/src/app/organization/organization.module.ts @@ -68,7 +68,6 @@ import { StandingInstructionsHistoryComponent } from './standing-instructions-hi import { FundMappingComponent } from './fund-mapping/fund-mapping.component'; import { CreateHolidayComponent } from './holidays/create-holiday/create-holiday.component'; - /** Custom Service */ import { OfficeItemNode } from './holidays/create-holiday/office-item.class'; import { OfficeItemFlatNode } from './holidays/create-holiday/office-flat-item.class'; @@ -79,7 +78,6 @@ import { EditFundComponent } from './manage-funds/edit-fund/edit-fund.component' import { ViewFundComponent } from './manage-funds/view-fund/view-fund.component'; import { InvestorsComponent } from './investors/investors.component'; - /** * Organization Module * @@ -164,4 +162,4 @@ import { InvestorsComponent } from './investors/investors.component'; OfficeItemNode ] }) -export class OrganizationModule { } +export class OrganizationModule {} diff --git a/src/app/organization/organization.service.ts b/src/app/organization/organization.service.ts index 96c8a6ae3..00f75198c 100644 --- a/src/app/organization/organization.service.ts +++ b/src/app/organization/organization.service.ts @@ -15,11 +15,13 @@ import { SettingsService } from 'app/settings/settings.service'; providedIn: 'root' }) export class OrganizationService { - /** * @param {HttpClient} http Http Client to send requests. */ - constructor(private http: HttpClient, private settingsService: SettingsService) { } + constructor( + private http: HttpClient, + private settingsService: SettingsService + ) {} /** * @returns {Observable} Loan Provisioning Criteria data @@ -490,7 +492,7 @@ export class OrganizationService { /** * @returns {Observable} Payment Types data */ - getPaymentTypesWithCode(): Observable { + getPaymentTypesWithCode(): Observable { return this.http.get('/paymenttypes?onlyWithCode=true'); } @@ -547,9 +549,7 @@ export class OrganizationService { * @returns {Observable} Entity Data Table Checks data. */ getEntityDataTableChecks(offset: number = 0, limit: number = -1): Observable { - const httpParams = new HttpParams() - .set('offset', offset.toString()) - .set('limit', limit.toString()); + const httpParams = new HttpParams().set('offset', offset.toString()).set('limit', limit.toString()); return this.http.get('/entityDatatableChecks', { params: httpParams }); } @@ -596,8 +596,7 @@ export class OrganizationService { * @returns {Observable} Holidays data. */ getHolidays(officeId: string): Observable { - const httpParams = new HttpParams() - .set('officeId', officeId.toString()); + const httpParams = new HttpParams().set('officeId', officeId.toString()); return this.http.get('/holidays', { params: httpParams }); } @@ -652,8 +651,7 @@ export class OrganizationService { * @returns {Observable} Resource Id. */ activateHoliday(holidayId: string): Observable { - const httpParams = new HttpParams() - .set('command', 'activate'); + const httpParams = new HttpParams().set('command', 'activate'); return this.http.post(`/holidays/${holidayId}`, null, { params: httpParams }); } @@ -709,8 +707,7 @@ export class OrganizationService { * @returns {Observable} Staff data. */ getStaff(officeId: any): Observable { - const httpParams = new HttpParams() - .set('officeId', officeId.toString()); + const httpParams = new HttpParams().set('officeId', officeId.toString()); return this.http.get('/staff', { params: httpParams }); } @@ -779,7 +776,11 @@ export class OrganizationService { if (legalFormType.length) { httpParams = httpParams.set('legalFormType', legalFormType); } - return this.http.get(`${urlSuffix}/downloadtemplate`, { params: httpParams, responseType: 'arraybuffer', observe: 'response' }); + return this.http.get(`${urlSuffix}/downloadtemplate`, { + params: httpParams, + responseType: 'arraybuffer', + observe: 'response' + }); } /** @@ -787,10 +788,12 @@ export class OrganizationService { * @returns {Observable} Import Document */ getImportDocument(id: any): Observable { - const httpParams = new HttpParams() - .set('importDocumentId', id) - .set('tenantIdentifier', 'default'); - return this.http.get('/imports/downloadOutputTemplate', { params: httpParams, responseType: 'arraybuffer', observe: 'response' }); + const httpParams = new HttpParams().set('importDocumentId', id).set('tenantIdentifier', 'default'); + return this.http.get('/imports/downloadOutputTemplate', { + params: httpParams, + responseType: 'arraybuffer', + observe: 'response' + }); } /** @@ -810,5 +813,4 @@ export class OrganizationService { formData.append('dateFormat', this.settingsService.dateFormat); return this.http.post(`${urlSuffix}/uploadtemplate`, formData, { params: httpParams }); } - } diff --git a/src/app/organization/password-preferences/password-preferences-template.resolver.ts b/src/app/organization/password-preferences/password-preferences-template.resolver.ts index ef038f28f..bd26b7280 100644 --- a/src/app/organization/password-preferences/password-preferences-template.resolver.ts +++ b/src/app/organization/password-preferences/password-preferences-template.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service'; */ @Injectable() export class PasswordPreferencesTemplateResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class PasswordPreferencesTemplateResolver implements Resolve { resolve(): Observable { return this.organizationService.getPasswordPreferencesTemplate(); } - } diff --git a/src/app/organization/password-preferences/password-preferences.component.spec.ts b/src/app/organization/password-preferences/password-preferences.component.spec.ts index a1a48d65b..2f6ee8222 100644 --- a/src/app/organization/password-preferences/password-preferences.component.spec.ts +++ b/src/app/organization/password-preferences/password-preferences.component.spec.ts @@ -8,9 +8,8 @@ describe('PasswordPreferencesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PasswordPreferencesComponent ] - }) - .compileComponents(); + declarations: [PasswordPreferencesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/password-preferences/password-preferences.component.ts b/src/app/organization/password-preferences/password-preferences.component.ts index d933663b2..772f7088a 100644 --- a/src/app/organization/password-preferences/password-preferences.component.ts +++ b/src/app/organization/password-preferences/password-preferences.component.ts @@ -15,7 +15,6 @@ import { OrganizationService } from '../organization.service'; styleUrls: ['./password-preferences.component.scss'] }) export class PasswordPreferencesComponent implements OnInit { - /** Password preferences form. */ passwordPreferencesForm: UntypedFormGroup; /** Password preferences data. */ @@ -28,11 +27,13 @@ export class PasswordPreferencesComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private route: ActivatedRoute, - private router: Router) { - this.route.data.subscribe((data: { passwordPreferencesTemplate: any}) => { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private route: ActivatedRoute, + private router: Router + ) { + this.route.data.subscribe((data: { passwordPreferencesTemplate: any }) => { this.passwordPreferencesData = data.passwordPreferencesTemplate; }); } @@ -50,7 +51,7 @@ export class PasswordPreferencesComponent implements OnInit { */ createPasswordPreferencesForm() { this.passwordPreferencesForm = this.formBuilder.group({ - 'validationPolicyId': [''] + validationPolicyId: [''] }); } @@ -75,5 +76,4 @@ export class PasswordPreferencesComponent implements OnInit { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/organization/payment-types/create-payment-type/create-payment-type.component.spec.ts b/src/app/organization/payment-types/create-payment-type/create-payment-type.component.spec.ts index 7a42d6404..458b38920 100644 --- a/src/app/organization/payment-types/create-payment-type/create-payment-type.component.spec.ts +++ b/src/app/organization/payment-types/create-payment-type/create-payment-type.component.spec.ts @@ -8,9 +8,8 @@ describe('CreatePaymentTypeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreatePaymentTypeComponent ] - }) - .compileComponents(); + declarations: [CreatePaymentTypeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/payment-types/create-payment-type/create-payment-type.component.ts b/src/app/organization/payment-types/create-payment-type/create-payment-type.component.ts index a41f1eb3e..7a54d62dd 100644 --- a/src/app/organization/payment-types/create-payment-type/create-payment-type.component.ts +++ b/src/app/organization/payment-types/create-payment-type/create-payment-type.component.ts @@ -15,7 +15,6 @@ import { OrganizationService } from '../../organization.service'; styleUrls: ['./create-payment-type.component.scss'] }) export class CreatePaymentTypeComponent implements OnInit { - /** Payment Type form. */ paymentTypeForm: UntypedFormGroup; @@ -25,10 +24,12 @@ export class CreatePaymentTypeComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private router: Router, - private route: ActivatedRoute) {} + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private router: Router, + private route: ActivatedRoute + ) {} /** * Creates and sets the payment type form. @@ -42,10 +43,16 @@ export class CreatePaymentTypeComponent implements OnInit { */ createpaymentTypeForm() { this.paymentTypeForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'description': [''], - 'isCashPayment': [false], - 'position': ['', Validators.required], + name: [ + '', + Validators.required + ], + description: [''], + isCashPayment: [false], + position: [ + '', + Validators.required + ] }); } @@ -55,9 +62,8 @@ export class CreatePaymentTypeComponent implements OnInit { */ submit() { const paymentType = this.paymentTypeForm.value; - this.organizationService.createPaymentType(paymentType).subscribe(response => { + this.organizationService.createPaymentType(paymentType).subscribe((response) => { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/organization/payment-types/edit-payment-type/edit-payment-type.component.spec.ts b/src/app/organization/payment-types/edit-payment-type/edit-payment-type.component.spec.ts index 19b5e34ca..0bdb6cee5 100644 --- a/src/app/organization/payment-types/edit-payment-type/edit-payment-type.component.spec.ts +++ b/src/app/organization/payment-types/edit-payment-type/edit-payment-type.component.spec.ts @@ -8,9 +8,8 @@ describe('EditPaymentTypeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditPaymentTypeComponent ] - }) - .compileComponents(); + declarations: [EditPaymentTypeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/payment-types/edit-payment-type/edit-payment-type.component.ts b/src/app/organization/payment-types/edit-payment-type/edit-payment-type.component.ts index 73d315131..2ca7c8d06 100644 --- a/src/app/organization/payment-types/edit-payment-type/edit-payment-type.component.ts +++ b/src/app/organization/payment-types/edit-payment-type/edit-payment-type.component.ts @@ -15,7 +15,6 @@ import { OrganizationService } from 'app/organization/organization.service'; styleUrls: ['./edit-payment-type.component.scss'] }) export class EditPaymentTypeComponent implements OnInit { - /** Payment Type form. */ paymentTypeForm: UntypedFormGroup; /** Payment Type Data. */ @@ -28,11 +27,13 @@ export class EditPaymentTypeComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private router: Router, - private route: ActivatedRoute) { - this.route.data.subscribe(( data: { paymentType: any }) => { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private router: Router, + private route: ActivatedRoute + ) { + this.route.data.subscribe((data: { paymentType: any }) => { this.paymentTypeData = data.paymentType; }); } @@ -49,10 +50,16 @@ export class EditPaymentTypeComponent implements OnInit { */ createPaymentTypeForm() { this.paymentTypeForm = this.formBuilder.group({ - 'name': [this.paymentTypeData.name, Validators.required], - 'description': [this.paymentTypeData.description], - 'isCashPayment': [this.paymentTypeData.isCashPayment], - 'position': [this.paymentTypeData.position, Validators.required], + name: [ + this.paymentTypeData.name, + Validators.required + ], + description: [this.paymentTypeData.description], + isCashPayment: [this.paymentTypeData.isCashPayment], + position: [ + this.paymentTypeData.position, + Validators.required + ] }); } @@ -62,9 +69,8 @@ export class EditPaymentTypeComponent implements OnInit { */ submit() { const paymentType = this.paymentTypeForm.value; - this.organizationService.updatePaymentType(this.paymentTypeData.id, paymentType).subscribe(response => { + this.organizationService.updatePaymentType(this.paymentTypeData.id, paymentType).subscribe((response) => { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/organization/payment-types/payment-types.component.spec.ts b/src/app/organization/payment-types/payment-types.component.spec.ts index 5d6809516..51c883324 100644 --- a/src/app/organization/payment-types/payment-types.component.spec.ts +++ b/src/app/organization/payment-types/payment-types.component.spec.ts @@ -8,9 +8,8 @@ describe('PaymentTypesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PaymentTypesComponent ] - }) - .compileComponents(); + declarations: [PaymentTypesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/payment-types/payment-types.component.ts b/src/app/organization/payment-types/payment-types.component.ts index e744fcdf9..5dba1542b 100644 --- a/src/app/organization/payment-types/payment-types.component.ts +++ b/src/app/organization/payment-types/payment-types.component.ts @@ -21,11 +21,18 @@ import { DeleteDialogComponent } from '../../shared/delete-dialog/delete-dialog. styleUrls: ['./payment-types.component.scss'] }) export class PaymentTypesComponent implements OnInit { - /** Payment Types data. */ paymentTypesData: any; /** Columns to be displayed in payment types table. */ - displayedColumns: string[] = ['name', 'description', 'codeName', 'isSystemDefined', 'isCashPayment', 'position', 'actions']; + displayedColumns: string[] = [ + 'name', + 'description', + 'codeName', + 'isSystemDefined', + 'isCashPayment', + 'position', + 'actions' + ]; /** Data source for payment types table. */ dataSource: MatTableDataSource; @@ -40,10 +47,12 @@ export class PaymentTypesComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {MatDialog} dialog Dialog reference. */ - constructor(private organizationService: OrganizationService, - private route: ActivatedRoute, - private dialog: MatDialog) { - this.route.data.subscribe(( data: { paymentTypes: any }) => { + constructor( + private organizationService: OrganizationService, + private route: ActivatedRoute, + private dialog: MatDialog + ) { + this.route.data.subscribe((data: { paymentTypes: any }) => { this.paymentTypesData = data.paymentTypes; }); } @@ -82,13 +91,11 @@ export class PaymentTypesComponent implements OnInit { }); deletePaymentTypeDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.organizationService.deletePaymentType(paymentTypeId) - .subscribe(() => { - this.paymentTypesData = this.paymentTypesData.filter((paymentType: any) => paymentType.id !== paymentTypeId); - this.setPaymentTypes(); - }); + this.organizationService.deletePaymentType(paymentTypeId).subscribe(() => { + this.paymentTypesData = this.paymentTypesData.filter((paymentType: any) => paymentType.id !== paymentTypeId); + this.setPaymentTypes(); + }); } }); } - } diff --git a/src/app/organization/payment-types/payment-types.resolver.ts b/src/app/organization/payment-types/payment-types.resolver.ts index f26d4c59b..c768b308e 100644 --- a/src/app/organization/payment-types/payment-types.resolver.ts +++ b/src/app/organization/payment-types/payment-types.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service'; */ @Injectable() export class PaymentTypesResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -23,7 +22,7 @@ export class PaymentTypesResolver implements Resolve { * Returns the payment types data. * @returns {Observable} */ - resolve(route: ActivatedRouteSnapshot): Observable { + resolve(route: ActivatedRouteSnapshot): Observable { const paymentTypeId = route.paramMap.get('id'); if (paymentTypeId) { return this.organizationService.getPaymentType(paymentTypeId); @@ -31,5 +30,4 @@ export class PaymentTypesResolver implements Resolve { return this.organizationService.getPaymentTypes(); } } - } diff --git a/src/app/organization/sms-campaigns/common-resolvers/sms-campaign-template.resolver.ts b/src/app/organization/sms-campaigns/common-resolvers/sms-campaign-template.resolver.ts index 527e98f05..9a57ab6c1 100644 --- a/src/app/organization/sms-campaigns/common-resolvers/sms-campaign-template.resolver.ts +++ b/src/app/organization/sms-campaigns/common-resolvers/sms-campaign-template.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service'; */ @Injectable() export class SmsCampaignTemplateResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class SmsCampaignTemplateResolver implements Resolve { resolve(): Observable { return this.organizationService.getSmsCampaignTemplate(); } - } diff --git a/src/app/organization/sms-campaigns/common-resolvers/sms-campaign.resolver.ts b/src/app/organization/sms-campaigns/common-resolvers/sms-campaign.resolver.ts index 4845b38c8..a7ba754fb 100644 --- a/src/app/organization/sms-campaigns/common-resolvers/sms-campaign.resolver.ts +++ b/src/app/organization/sms-campaigns/common-resolvers/sms-campaign.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class SmsCampaignResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -24,8 +23,7 @@ export class SmsCampaignResolver implements Resolve { * @returns {Observable} */ resolve(route: ActivatedRouteSnapshot): Observable { - const smsCampaignId = route.paramMap.get('id'); + const smsCampaignId = route.paramMap.get('id'); return this.organizationService.getSmsCampaign(smsCampaignId); } - } diff --git a/src/app/organization/sms-campaigns/common-resolvers/sms-campaigns.resolver.ts b/src/app/organization/sms-campaigns/common-resolvers/sms-campaigns.resolver.ts index 63d5ac14f..bcc7fd71a 100644 --- a/src/app/organization/sms-campaigns/common-resolvers/sms-campaigns.resolver.ts +++ b/src/app/organization/sms-campaigns/common-resolvers/sms-campaigns.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service'; */ @Injectable() export class SmsCampaignsResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class SmsCampaignsResolver implements Resolve { resolve(): Observable { return this.organizationService.getSmsCampaigns(); } - } diff --git a/src/app/organization/sms-campaigns/create-campaign/create-campaign.component.spec.ts b/src/app/organization/sms-campaigns/create-campaign/create-campaign.component.spec.ts index 823f0ae69..b71c638d8 100644 --- a/src/app/organization/sms-campaigns/create-campaign/create-campaign.component.spec.ts +++ b/src/app/organization/sms-campaigns/create-campaign/create-campaign.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateCampaignComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateCampaignComponent ] - }) - .compileComponents(); + declarations: [CreateCampaignComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/sms-campaigns/create-campaign/create-campaign.component.ts b/src/app/organization/sms-campaigns/create-campaign/create-campaign.component.ts index 7722d95f0..4677032fa 100644 --- a/src/app/organization/sms-campaigns/create-campaign/create-campaign.component.ts +++ b/src/app/organization/sms-campaigns/create-campaign/create-campaign.component.ts @@ -20,7 +20,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-campaign.component.scss'] }) export class CreateCampaignComponent { - /** SMS Campaign Template */ smsCampaignTemplate: any; /** Run report headers */ @@ -39,11 +38,13 @@ export class CreateCampaignComponent { * @param {SettingsService} settingsService Settings Service * @param {Dates} dateUtils Date Utils */ - constructor(private route: ActivatedRoute, - private router: Router, - private organizationService: OrganizationService, - private settingsService: SettingsService, - private dateUtils: Dates) { + constructor( + private route: ActivatedRoute, + private router: Router, + private organizationService: OrganizationService, + private settingsService: SettingsService, + private dateUtils: Dates + ) { this.route.data.subscribe((data: { smsCampaignTemplate: any }) => { this.smsCampaignTemplate = data.smsCampaignTemplate; }); @@ -95,8 +96,13 @@ export class CreateCampaignComponent { smsCampaign.recurrenceStartDate = this.dateUtils.formatDate(prevRecurrenceDate, dateTimeFormat); } this.organizationService.createSmsCampaign(smsCampaign).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/organization/sms-campaigns/edit-campaign/edit-campaign.component.spec.ts b/src/app/organization/sms-campaigns/edit-campaign/edit-campaign.component.spec.ts index 5de03936c..c74e8d7bb 100644 --- a/src/app/organization/sms-campaigns/edit-campaign/edit-campaign.component.spec.ts +++ b/src/app/organization/sms-campaigns/edit-campaign/edit-campaign.component.spec.ts @@ -8,9 +8,8 @@ describe('EditCampaignComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditCampaignComponent ] - }) - .compileComponents(); + declarations: [EditCampaignComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/sms-campaigns/edit-campaign/edit-campaign.component.ts b/src/app/organization/sms-campaigns/edit-campaign/edit-campaign.component.ts index 6856194e9..323d9e1ff 100644 --- a/src/app/organization/sms-campaigns/edit-campaign/edit-campaign.component.ts +++ b/src/app/organization/sms-campaigns/edit-campaign/edit-campaign.component.ts @@ -19,7 +19,6 @@ import { CampaignMessageStepComponent } from '../sms-campaign-stepper/campaign-m styleUrls: ['./edit-campaign.component.scss'] }) export class EditCampaignComponent { - /** smsCampaign */ smsCampaign: any; /** SMS Campaign Template */ @@ -38,12 +37,14 @@ export class EditCampaignComponent { * @param {OrganizationService} organizationService Organiztion Service * @param {SettingsService} settingsService Settings Service */ - constructor(private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private organizationService: OrganizationService, - private settingsService: SettingsService) { - this.route.data.subscribe((data: { smsCampaign: any, smsCampaignTemplate: any }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private organizationService: OrganizationService, + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { smsCampaign: any; smsCampaignTemplate: any }) => { this.smsCampaignTemplate = data.smsCampaignTemplate; this.smsCampaign = data.smsCampaign; this.smsCampaign.editFlag = true; @@ -87,11 +88,13 @@ export class EditCampaignComponent { locale }; if (this.smsCampaign.triggerType.id === 2) { - smsCampaign.recurrenceStartDate = this.dateUtils.formatDate(new Date(this.smsCampaign.recurrenceStartDate), dateTimeFormat); + smsCampaign.recurrenceStartDate = this.dateUtils.formatDate( + new Date(this.smsCampaign.recurrenceStartDate), + dateTimeFormat + ); } this.organizationService.updateSmsCampaign(smsCampaign, this.smsCampaign.id).subscribe((response: any) => { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-message-step/campaign-message-step.component.spec.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-message-step/campaign-message-step.component.spec.ts index 423c2ce7e..cf0645d4e 100644 --- a/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-message-step/campaign-message-step.component.spec.ts +++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-message-step/campaign-message-step.component.spec.ts @@ -8,9 +8,8 @@ describe('CampaignMessageStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CampaignMessageStepComponent ] - }) - .compileComponents(); + declarations: [CampaignMessageStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-message-step/campaign-message-step.component.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-message-step/campaign-message-step.component.ts index e873a378b..493936aec 100644 --- a/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-message-step/campaign-message-step.component.ts +++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-message-step/campaign-message-step.component.ts @@ -11,7 +11,6 @@ import { UntypedFormControl } from '@angular/forms'; styleUrls: ['./campaign-message-step.component.scss'] }) export class CampaignMessageStepComponent implements OnChanges { - /** Column headers */ @Input() templateParameters: any[]; /** Valdity check for sms campaign form */ @@ -24,7 +23,7 @@ export class CampaignMessageStepComponent implements OnChanges { /** Column header names */ parameterLabels: any[]; - constructor() { } + constructor() {} /** * Sets template parameters once response headers are retrieved. @@ -58,5 +57,4 @@ export class CampaignMessageStepComponent implements OnChanges { const newText = prevText + ` {{${label}}} `; this.message.patchValue(newText); } - } diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-preview-step/campaign-preview-step.component.spec.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-preview-step/campaign-preview-step.component.spec.ts index 18bc9e30f..38742202c 100644 --- a/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-preview-step/campaign-preview-step.component.spec.ts +++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-preview-step/campaign-preview-step.component.spec.ts @@ -8,9 +8,8 @@ describe('CampaignPreviewStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CampaignPreviewStepComponent ] - }) - .compileComponents(); + declarations: [CampaignPreviewStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-preview-step/campaign-preview-step.component.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-preview-step/campaign-preview-step.component.ts index 4cb7db56a..c1e5a196d 100644 --- a/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-preview-step/campaign-preview-step.component.ts +++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/campaign-preview-step/campaign-preview-step.component.ts @@ -10,7 +10,6 @@ import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; styleUrls: ['./campaign-preview-step.component.scss'] }) export class CampaignPreviewStepComponent implements OnInit { - /** SMS Campaign */ @Input() campaign: any; /** [Optional] SMS Campaign Template for create form */ @@ -24,9 +23,9 @@ export class CampaignPreviewStepComponent implements OnInit { smsProviders: any[]; /** Emits submit() event */ - @Output() submitEvent = new EventEmitter; + @Output() submitEvent = new EventEmitter(); - constructor() { } + constructor() {} /** * Sets SMS providers and trigger types options. @@ -35,5 +34,4 @@ export class CampaignPreviewStepComponent implements OnInit { this.triggerTypes = this.smsCampaignTemplate.triggerTypeOptions; this.smsProviders = this.smsCampaignTemplate.smsProviderOptions; } - } diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-business-rule-parameters/edit-business-rule-parameters.component.spec.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-business-rule-parameters/edit-business-rule-parameters.component.spec.ts index 6deb6e1e5..fab66e585 100644 --- a/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-business-rule-parameters/edit-business-rule-parameters.component.spec.ts +++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-business-rule-parameters/edit-business-rule-parameters.component.spec.ts @@ -8,9 +8,8 @@ describe('EditBusinessRuleParametersComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditBusinessRuleParametersComponent ] - }) - .compileComponents(); + declarations: [EditBusinessRuleParametersComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-business-rule-parameters/edit-business-rule-parameters.component.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-business-rule-parameters/edit-business-rule-parameters.component.ts index e4aa58018..8b9300e2b 100644 --- a/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-business-rule-parameters/edit-business-rule-parameters.component.ts +++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-business-rule-parameters/edit-business-rule-parameters.component.ts @@ -23,7 +23,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./edit-business-rule-parameters.component.scss'] }) export class EditBusinessRuleParametersComponent implements OnInit, OnChanges { - /** Run Report Parameters Data */ @Input() paramData: any; /** SMS Campaign */ @@ -46,9 +45,11 @@ export class EditBusinessRuleParametersComponent implements OnInit, OnChanges { * @param {ReportsService} reportsService Reports Service * @param {SettingsService} settingsService Settings Service. */ - constructor(private reportsService: ReportsService, - private settingsService: SettingsService, - private dateUtils: Dates) { } + constructor( + private reportsService: ReportsService, + private settingsService: SettingsService, + private dateUtils: Dates + ) {} ngOnInit(): void { this.maxDate = this.settingsService.businessDate; @@ -69,31 +70,31 @@ export class EditBusinessRuleParametersComponent implements OnInit, OnChanges { * Fetches dropdown options and builds child dependencies. */ createRunReportForm() { - this.paramData.forEach( - (param: any) => { - if (!param.parentParameterName) { // Non Child Parameter - this.ReportForm.addControl(param.name, new UntypedFormControl('', Validators.required)); - const controlValue = this.paramValue[param.variable].toString(); - switch (param.displayType) { - case 'text': - this.ReportForm.get(param.name).patchValue(controlValue); - break; - case 'select': - this.fetchSelectOptions(param, param.name); - break; - case 'date': - const dateFormat = this.settingsService.dateFormat; - const newControlValue = this.dateUtils.formatDate(controlValue, dateFormat); - this.ReportForm.get(param.name).patchValue(newControlValue); - break; - } - } else { // Child Parameter - const parent: ReportParameter = this.paramData - .find((entry: any) => entry.name === param.parentParameterName); - parent.childParameters.push(param); - this.updateParentParameters(parent); + this.paramData.forEach((param: any) => { + if (!param.parentParameterName) { + // Non Child Parameter + this.ReportForm.addControl(param.name, new UntypedFormControl('', Validators.required)); + const controlValue = this.paramValue[param.variable].toString(); + switch (param.displayType) { + case 'text': + this.ReportForm.get(param.name).patchValue(controlValue); + break; + case 'select': + this.fetchSelectOptions(param, param.name); + break; + case 'date': + const dateFormat = this.settingsService.dateFormat; + const newControlValue = this.dateUtils.formatDate(controlValue, dateFormat); + this.ReportForm.get(param.name).patchValue(newControlValue); + break; } - }); + } else { + // Child Parameter + const parent: ReportParameter = this.paramData.find((entry: any) => entry.name === param.parentParameterName); + parent.childParameters.push(param); + this.updateParentParameters(parent); + } + }); this.setChildControls(); } @@ -102,10 +103,12 @@ export class EditBusinessRuleParametersComponent implements OnInit, OnChanges { * @param {ReportParameter} parent Parent report parameter */ updateParentParameters(parent: ReportParameter) { - const parentNames = this.parentParameters.map(parameter => parameter.name); - if (!parentNames.includes(parent.name)) { // Parent's first child. + const parentNames = this.parentParameters.map((parameter) => parameter.name); + if (!parentNames.includes(parent.name)) { + // Parent's first child. this.parentParameters.push(parent); - } else { // Parent already has a child + } else { + // Parent already has a child const index = parentNames.indexOf(parent.name); this.parentParameters[index] = parent; } @@ -132,19 +135,19 @@ export class EditBusinessRuleParametersComponent implements OnInit, OnChanges { }); } - /** - * Fetches Select Dropdown options for param type "Select". - * @param {ReportParameter} param Parameter for which dropdown options are required. - * @param {string} inputstring url substring for API call. - */ + /** + * Fetches Select Dropdown options for param type "Select". + * @param {ReportParameter} param Parameter for which dropdown options are required. + * @param {string} inputstring url substring for API call. + */ fetchSelectOptions(param: ReportParameter, inputstring: string) { this.reportsService.getSelectOptions(inputstring).subscribe((options: SelectOption[]) => { param.selectOptions = options; if (param.selectAll === 'Y') { - param.selectOptions.push({id: '-1', name: 'All'}); + param.selectOptions.push({ id: '-1', name: 'All' }); } const optionId = this.paramValue[param.variable].toString(); - const option = options.find(entry => entry.id === optionId); + const option = options.find((entry) => entry.id === optionId); this.ReportForm.controls[param.name].patchValue({ id: optionId, name: option.name }); }); } @@ -164,9 +167,9 @@ export class EditBusinessRuleParametersComponent implements OnInit, OnChanges { */ disableFormWhenValid() { this.ReportForm.statusChanges.pipe(distinctUntilChanged()).subscribe((status: string) => { - if (status === 'VALID') { - this.ReportForm.disable(); - } + if (status === 'VALID') { + this.ReportForm.disable(); + } }); } @@ -177,9 +180,11 @@ export class EditBusinessRuleParametersComponent implements OnInit, OnChanges { formatUserResponse(response: any, forHeaders: boolean) { const formattedResponse: any = {}; let newKey: string; - for (const [key, value] of Object.entries(response)) { - const param: ReportParameter = this.paramData - .find((_entry: any) => _entry.variable === key); + for (const [ + key, + value + ] of Object.entries(response)) { + const param: ReportParameter = this.paramData.find((_entry: any) => _entry.variable === key); newKey = forHeaders ? param.inputName : param.variable; formattedResponse[newKey] = value; } @@ -205,5 +210,4 @@ export class EditBusinessRuleParametersComponent implements OnInit, OnChanges { } ); } - } diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-sms-campaign-step.component.spec.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-sms-campaign-step.component.spec.ts index 822c6f863..7e94b0476 100644 --- a/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-sms-campaign-step.component.spec.ts +++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-sms-campaign-step.component.spec.ts @@ -8,9 +8,8 @@ describe('EditSmsCampaignStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditSmsCampaignStepComponent ] - }) - .compileComponents(); + declarations: [EditSmsCampaignStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-sms-campaign-step.component.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-sms-campaign-step.component.ts index 81b369a4d..5d2a117b6 100644 --- a/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-sms-campaign-step.component.ts +++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-sms-campaign-step.component.ts @@ -18,7 +18,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-sms-campaign-step.component.scss'] }) export class EditSmsCampaignStepComponent implements OnInit { - /** SMS Campaign Template */ @Input() smsCampaignTemplate: any; /** SMS Campaign */ @@ -49,9 +48,11 @@ export class EditSmsCampaignStepComponent implements OnInit { * @param {ReportsService} reportService Reports Service * @param {SettingsService} settingsService Settings Service. */ - constructor(private formBuilder: UntypedFormBuilder, - private reportService: ReportsService, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private reportService: ReportsService, + private settingsService: SettingsService + ) { this.createSMSCampaignDetailsForm(); } @@ -60,11 +61,20 @@ export class EditSmsCampaignStepComponent implements OnInit { */ createSMSCampaignDetailsForm() { this.smsCampaignDetailsForm = this.formBuilder.group({ - 'campaignName': ['', Validators.required], - 'providerId': [null], - 'triggerType': ['', Validators.required], - 'runReportId': ['', Validators.required], - 'isNotification': [false] + campaignName: [ + '', + Validators.required + ], + providerId: [null], + triggerType: [ + '', + Validators.required + ], + runReportId: [ + '', + Validators.required + ], + isNotification: [false] }); } @@ -100,15 +110,17 @@ export class EditSmsCampaignStepComponent implements OnInit { */ setControlValues() { this.smsCampaignDetailsForm.patchValue({ - 'campaignName': this.smsCampaign.campaignName, - 'providerId': this.smsCampaign.providerId, - 'triggerType': this.smsCampaign.triggerType.id, - 'runReportId': this.smsCampaign.runReportId, - 'isNotification': this.smsCampaign.isNotification + campaignName: this.smsCampaign.campaignName, + providerId: this.smsCampaign.providerId, + triggerType: this.smsCampaign.triggerType.id, + runReportId: this.smsCampaign.runReportId, + isNotification: this.smsCampaign.isNotification }); if (this.smsCampaign.triggerType.value === 'Schedule') { - this.smsCampaignDetailsForm.addControl('recurrenceStartDate', new UntypedFormControl(new Date(this.smsCampaign.recurrenceStartDate))); + this.smsCampaignDetailsForm.addControl( + 'recurrenceStartDate', + new UntypedFormControl(new Date(this.smsCampaign.recurrenceStartDate)) + ); } } - } diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.spec.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.spec.ts index 3143697f1..612db7bba 100644 --- a/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.spec.ts +++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.spec.ts @@ -8,9 +8,8 @@ describe('BusinessRuleParametersComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ BusinessRuleParametersComponent ] - }) - .compileComponents(); + declarations: [BusinessRuleParametersComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.ts index bb9ac8a80..2d999311c 100644 --- a/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.ts +++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.ts @@ -20,7 +20,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./business-rule-parameters.component.scss'] }) export class BusinessRuleParametersComponent implements OnInit, OnChanges { - /** Run Report Parameters Data */ @Input() paramData: any; @@ -43,9 +42,11 @@ export class BusinessRuleParametersComponent implements OnInit, OnChanges { * @param {SettingsService} settingsService Settings Service. * @param {Dates} dateUtils Date Utils. */ - constructor(private reportsService: ReportsService, - private settingsService: SettingsService, - private dateUtils: Dates) { } + constructor( + private reportsService: ReportsService, + private settingsService: SettingsService, + private dateUtils: Dates + ) {} ngOnInit(): void { this.maxDate = this.settingsService.businessDate; @@ -74,20 +75,20 @@ export class BusinessRuleParametersComponent implements OnInit, OnChanges { * Fetches dropdown options and builds child dependencies. */ createRunReportForm() { - this.paramData.forEach( - (param: any) => { - if (!param.parentParameterName) { // Non-Child Parameter - this.ReportForm.addControl(param.name, new UntypedFormControl('', Validators.required)); - if (param.displayType === 'select') { - this.fetchSelectOptions(param, param.name); - } - } else { // Child Parameter - const parent: ReportParameter = this.paramData - .find((entry: any) => entry.name === param.parentParameterName); - parent.childParameters.push(param); - this.updateParentParameters(parent); + this.paramData.forEach((param: any) => { + if (!param.parentParameterName) { + // Non-Child Parameter + this.ReportForm.addControl(param.name, new UntypedFormControl('', Validators.required)); + if (param.displayType === 'select') { + this.fetchSelectOptions(param, param.name); } - }); + } else { + // Child Parameter + const parent: ReportParameter = this.paramData.find((entry: any) => entry.name === param.parentParameterName); + parent.childParameters.push(param); + this.updateParentParameters(parent); + } + }); this.setChildControls(); } @@ -96,18 +97,20 @@ export class BusinessRuleParametersComponent implements OnInit, OnChanges { * @param {ReportParameter} parent Parent report parameter */ updateParentParameters(parent: ReportParameter) { - const parentNames = this.parentParameters.map(parameter => parameter.name); - if (!parentNames.includes(parent.name)) { // Parent's first child. + const parentNames = this.parentParameters.map((parameter) => parameter.name); + if (!parentNames.includes(parent.name)) { + // Parent's first child. this.parentParameters.push(parent); - } else { // Parent already has a child + } else { + // Parent already has a child const index = parentNames.indexOf(parent.name); this.parentParameters[index] = parent; } } - /** - * Subscribes to changes in parent parameters value, builds child parameter vis-a-vis parent's value. - */ + /** + * Subscribes to changes in parent parameters value, builds child parameter vis-a-vis parent's value. + */ setChildControls() { this.parentParameters.forEach((param: ReportParameter) => { this.ReportForm.get(param.name).valueChanges.subscribe((option: any) => { @@ -126,16 +129,16 @@ export class BusinessRuleParametersComponent implements OnInit, OnChanges { }); } - /** - * Fetches Select Dropdown options for param type "Select". - * @param {ReportParameter} param Parameter for which dropdown options are required. - * @param {string} inputstring url substring for API call. - */ + /** + * Fetches Select Dropdown options for param type "Select". + * @param {ReportParameter} param Parameter for which dropdown options are required. + * @param {string} inputstring url substring for API call. + */ fetchSelectOptions(param: ReportParameter, inputstring: string) { this.reportsService.getSelectOptions(inputstring).subscribe((options: SelectOption[]) => { param.selectOptions = options; if (param.selectAll === 'Y') { - param.selectOptions.push({id: '-1', name: 'All'}); + param.selectOptions.push({ id: '-1', name: 'All' }); } }); } @@ -147,9 +150,11 @@ export class BusinessRuleParametersComponent implements OnInit, OnChanges { formatUserResponse(response: any, forHeaders: boolean) { const formattedResponse: any = {}; let newKey: string; - for (const [key, value] of Object.entries(response)) { - const param: ReportParameter = this.paramData - .find((_entry: any) => _entry.name === key); + for (const [ + key, + value + ] of Object.entries(response)) { + const param: ReportParameter = this.paramData.find((_entry: any) => _entry.name === key); newKey = forHeaders ? param.inputName : param.variable; switch (param.displayType) { case 'text': @@ -186,5 +191,4 @@ export class BusinessRuleParametersComponent implements OnInit, OnChanges { } ); } - } diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/sms-campaign-step.component.spec.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/sms-campaign-step.component.spec.ts index d69d66daf..30d9469f9 100644 --- a/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/sms-campaign-step.component.spec.ts +++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/sms-campaign-step.component.spec.ts @@ -8,9 +8,8 @@ describe('SmsCampaignStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SmsCampaignStepComponent ] - }) - .compileComponents(); + declarations: [SmsCampaignStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/sms-campaign-step.component.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/sms-campaign-step.component.ts index 139bbf963..98ceeda03 100644 --- a/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/sms-campaign-step.component.ts +++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/sms-campaign-step.component.ts @@ -1,5 +1,5 @@ /** Angular Imports */ -import { Component, OnInit, Input, ViewChild, EventEmitter, Output} from '@angular/core'; +import { Component, OnInit, Input, ViewChild, EventEmitter, Output } from '@angular/core'; import { UntypedFormGroup, UntypedFormBuilder, Validators, UntypedFormControl } from '@angular/forms'; /** Custom Services */ @@ -20,7 +20,6 @@ import { BusinessRuleParametersComponent } from './business-rule-parameters/busi styleUrls: ['./sms-campaign-step.component.scss'] }) export class SmsCampaignStepComponent implements OnInit { - /** SMS Campaign Template */ @Input() smsCampaignTemplate: any; /** Business Rule Parameters Component */ @@ -51,8 +50,10 @@ export class SmsCampaignStepComponent implements OnInit { * @param {FormBuilder} formBuilder Form Builder * @param {ReportsService} reportService Reports Service */ - constructor(private formBuilder: UntypedFormBuilder, - private reportService: ReportsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private reportService: ReportsService + ) { this.createSMSCampaignDetailsForm(); this.buildDependencies(); } @@ -112,11 +113,20 @@ export class SmsCampaignStepComponent implements OnInit { */ createSMSCampaignDetailsForm() { this.smsCampaignDetailsForm = this.formBuilder.group({ - 'campaignName': ['', Validators.required], - 'providerId': [null], - 'triggerType': ['', Validators.required], - 'runReportId': ['', Validators.required], - 'isNotification': [false] + campaignName: [ + '', + Validators.required + ], + providerId: [null], + triggerType: [ + '', + Validators.required + ], + runReportId: [ + '', + Validators.required + ], + isNotification: [false] }); } @@ -159,18 +169,44 @@ export class SmsCampaignStepComponent implements OnInit { this.smsCampaignDetailsForm.removeControl('repeatsOnDay'); switch (frequency) { case 1: // Daily - this.repetitionIntervals = ['1', '2', '3']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3' + ]; + break; case 2: // Weekly - this.repetitionIntervals = ['1', '2', '3']; + this.repetitionIntervals = [ + '1', + '2', + '3' + ]; this.smsCampaignDetailsForm.addControl('repeatsOnDay', new UntypedFormControl('', Validators.required)); - break; + break; case 3: // Monthly - this.repetitionIntervals = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '10', + '11' + ]; + break; case 4: // Yearly - this.repetitionIntervals = ['1', '2', '3', '4', '5']; - break; + this.repetitionIntervals = [ + '1', + '2', + '3', + '4', + '5' + ]; + break; } }); } else { @@ -181,5 +217,4 @@ export class SmsCampaignStepComponent implements OnInit { } }); } - } diff --git a/src/app/organization/sms-campaigns/sms-campaigns.component.spec.ts b/src/app/organization/sms-campaigns/sms-campaigns.component.spec.ts index c1a83f21e..6b4ace2cf 100644 --- a/src/app/organization/sms-campaigns/sms-campaigns.component.spec.ts +++ b/src/app/organization/sms-campaigns/sms-campaigns.component.spec.ts @@ -8,9 +8,8 @@ describe('SmsCampaignsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SmsCampaignsComponent ] - }) - .compileComponents(); + declarations: [SmsCampaignsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/sms-campaigns/sms-campaigns.component.ts b/src/app/organization/sms-campaigns/sms-campaigns.component.ts index e5df80aeb..0911a6f69 100644 --- a/src/app/organization/sms-campaigns/sms-campaigns.component.ts +++ b/src/app/organization/sms-campaigns/sms-campaigns.component.ts @@ -17,11 +17,17 @@ import { of } from 'rxjs'; styleUrls: ['./sms-campaigns.component.scss'] }) export class SmsCampaignsComponent implements OnInit { - /** SMS Campaigns data. */ smsCampaignsData: any; /** Columns to be displayed in sms campaigns table. */ - displayedColumns: string[] = ['campaignName', 'campaignMessage', 'campaignType.value', 'triggerType.value', 'campaignStatus.value', 'smsCampaignTimeLine.submittedByUsername']; + displayedColumns: string[] = [ + 'campaignName', + 'campaignMessage', + 'campaignType.value', + 'triggerType.value', + 'campaignStatus.value', + 'smsCampaignTimeLine.submittedByUsername' + ]; /** Data source for SMS campaigns table. */ dataSource: MatTableDataSource; @@ -35,7 +41,7 @@ export class SmsCampaignsComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { smsCampaigns: any }) => { + this.route.data.subscribe((data: { smsCampaigns: any }) => { this.smsCampaignsData = data.smsCampaigns.pageItems; }); } @@ -62,15 +68,19 @@ export class SmsCampaignsComponent implements OnInit { this.dataSource = new MatTableDataSource(this.smsCampaignsData); this.dataSource.sortingDataAccessor = (item, property) => { switch (property) { - case 'campaignType.value': return item.campaignType.value; - case 'triggerType.value': return item.triggerType.value; - case 'campaignStatus.value': return item.campaignStatus.value; - case 'smsCampaignTimeLine.submittedByUsername': return item.smsCampaignTimeLine.submittedByUsername; - default: return item[property]; + case 'campaignType.value': + return item.campaignType.value; + case 'triggerType.value': + return item.triggerType.value; + case 'campaignStatus.value': + return item.campaignStatus.value; + case 'smsCampaignTimeLine.submittedByUsername': + return item.smsCampaignTimeLine.submittedByUsername; + default: + return item[property]; } }; this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/organization/sms-campaigns/view-campaign/view-campaign.component.spec.ts b/src/app/organization/sms-campaigns/view-campaign/view-campaign.component.spec.ts index 248a518c1..576a059f4 100644 --- a/src/app/organization/sms-campaigns/view-campaign/view-campaign.component.spec.ts +++ b/src/app/organization/sms-campaigns/view-campaign/view-campaign.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewCampaignComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewCampaignComponent ] - }) - .compileComponents(); + declarations: [ViewCampaignComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/sms-campaigns/view-campaign/view-campaign.component.ts b/src/app/organization/sms-campaigns/view-campaign/view-campaign.component.ts index dd1ca65fd..fab7811ca 100644 --- a/src/app/organization/sms-campaigns/view-campaign/view-campaign.component.ts +++ b/src/app/organization/sms-campaigns/view-campaign/view-campaign.component.ts @@ -27,7 +27,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./view-campaign.component.scss'] }) export class ViewCampaignComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -39,7 +38,12 @@ export class ViewCampaignComponent implements OnInit { /** Message Status */ status: any; /** Data Table Columns */ - displayedColumns: string[] = ['Message', 'Status', 'Mobile No.', 'Campaign Name']; + displayedColumns: string[] = [ + 'Message', + 'Status', + 'Mobile No.', + 'Campaign Name' + ]; /** Data source for SMS campaigns table. */ dataSource = new MatTableDataSource(); @@ -80,13 +84,15 @@ export class ViewCampaignComponent implements OnInit { * @param {OrganizationService} organizationService Organization Service * @param {SettingsService} settingsService Setting Service */ - constructor(private router: Router, - private route: ActivatedRoute, - public dialog: MatDialog, - private formBuilder: UntypedFormBuilder, - private dateUtils: Dates, - private organizationService: OrganizationService, - private settingsService: SettingsService) { + constructor( + private router: Router, + private route: ActivatedRoute, + public dialog: MatDialog, + private formBuilder: UntypedFormBuilder, + private dateUtils: Dates, + private organizationService: OrganizationService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { smsCampaign: any }) => { this.smsCampaignData = data.smsCampaign; }); @@ -102,8 +108,8 @@ export class ViewCampaignComponent implements OnInit { */ createSMSForm() { this.smsForm = this.formBuilder.group({ - 'fromDate': [''], - 'toDate': [''], + fromDate: [''], + toDate: [''] }); } @@ -134,6 +140,7 @@ export class ViewCampaignComponent implements OnInit { type: 'date', required: true }) + ]; const data = { title: 'Close SMS Campaign', @@ -150,9 +157,11 @@ export class ViewCampaignComponent implements OnInit { dateFormat, locale }; - this.organizationService.executeSmsCampaignCommand(this.smsCampaignData.id, dataObject, 'close').subscribe(() => { - this.reload(); - }); + this.organizationService + .executeSmsCampaignCommand(this.smsCampaignData.id, dataObject, 'close') + .subscribe(() => { + this.reload(); + }); } }); } @@ -169,6 +178,7 @@ export class ViewCampaignComponent implements OnInit { type: 'date', required: true }) + ]; const data = { title: 'Activate SMS Campaign', @@ -185,9 +195,11 @@ export class ViewCampaignComponent implements OnInit { dateFormat, locale }; - this.organizationService.executeSmsCampaignCommand(this.smsCampaignData.id, dataObject, 'activate').subscribe(() => { - this.reload(); - }); + this.organizationService + .executeSmsCampaignCommand(this.smsCampaignData.id, dataObject, 'activate') + .subscribe(() => { + this.reload(); + }); } }); } @@ -204,6 +216,7 @@ export class ViewCampaignComponent implements OnInit { type: 'date', required: true }) + ]; const data = { title: 'Reactivate SMS Campaign', @@ -220,9 +233,11 @@ export class ViewCampaignComponent implements OnInit { dateFormat, locale }; - this.organizationService.executeSmsCampaignCommand(this.smsCampaignData.id, dataObject, 'reactivate').subscribe(() => { - this.reload(); - }); + this.organizationService + .executeSmsCampaignCommand(this.smsCampaignData.id, dataObject, 'reactivate') + .subscribe(() => { + this.reload(); + }); } }); } @@ -249,7 +264,8 @@ export class ViewCampaignComponent implements OnInit { */ private reload() { const url: string = this.router.url; - this.router.navigateByUrl(`/organization/sms-campaigns`, {skipLocationChange: true}) + this.router + .navigateByUrl(`/organization/sms-campaigns`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } @@ -280,5 +296,4 @@ export class ViewCampaignComponent implements OnInit { this.messageTableRef.renderRows(); }); } - } diff --git a/src/app/organization/standing-instructions-history/standing-instructions-history.component.spec.ts b/src/app/organization/standing-instructions-history/standing-instructions-history.component.spec.ts index 750c13d1c..56fd554e3 100644 --- a/src/app/organization/standing-instructions-history/standing-instructions-history.component.spec.ts +++ b/src/app/organization/standing-instructions-history/standing-instructions-history.component.spec.ts @@ -8,9 +8,8 @@ describe('StandingInstructionsHistoryComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ StandingInstructionsHistoryComponent ] - }) - .compileComponents(); + declarations: [StandingInstructionsHistoryComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/standing-instructions-history/standing-instructions-history.component.ts b/src/app/organization/standing-instructions-history/standing-instructions-history.component.ts index 7e326deac..edb5d3a8e 100644 --- a/src/app/organization/standing-instructions-history/standing-instructions-history.component.ts +++ b/src/app/organization/standing-instructions-history/standing-instructions-history.component.ts @@ -20,7 +20,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./standing-instructions-history.component.scss'] }) export class StandingInstructionsHistoryComponent implements OnInit { - /** Minimum Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Date allowed. */ @@ -33,7 +32,16 @@ export class StandingInstructionsHistoryComponent implements OnInit { isCollapsed = false; /** Columns to be displayed in instructions table. */ - displayedColumns: string[] = ['fromClient', 'fromAccount', 'toClient', 'toAccount', 'executionTime', 'amount', 'status', 'errorLog']; + displayedColumns: string[] = [ + 'fromClient', + 'fromAccount', + 'toClient', + 'toAccount', + 'executionTime', + 'amount', + 'status', + 'errorLog' + ]; /** Data source for instructions table. */ dataSource: MatTableDataSource; @@ -51,12 +59,14 @@ export class StandingInstructionsHistoryComponent implements OnInit { * @param {Router} router Router for navigation. * @param {Dates} dateUtils Date Utils to format date. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private settingsService: SettingsService, - private router: Router, - private route: ActivatedRoute, - private dateUtils: Dates) { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private settingsService: SettingsService, + private router: Router, + private route: ActivatedRoute, + private dateUtils: Dates + ) { this.route.data.subscribe((data: { standingInstructionsTemplate: any }) => { this.standingInstructionsTemplate = data.standingInstructionsTemplate; }); @@ -73,12 +83,12 @@ export class StandingInstructionsHistoryComponent implements OnInit { */ createInstructionForm() { this.instructionForm = this.formBuilder.group({ - 'clientName': [''], - 'clientId': [''], - 'transferType': [''], - 'fromAccountType': [''], - 'fromDate': [''], - 'toDate': [''] + clientName: [''], + clientId: [''], + transferType: [''], + fromAccountType: [''], + fromDate: [''], + toDate: [''] }); } @@ -126,5 +136,4 @@ export class StandingInstructionsHistoryComponent implements OnInit { this.setInstructions(response.pageItems); }); } - } diff --git a/src/app/organization/standing-instructions-history/standing-instructions-template.resolver.ts b/src/app/organization/standing-instructions-history/standing-instructions-template.resolver.ts index cdb9e989d..ea1452f05 100644 --- a/src/app/organization/standing-instructions-history/standing-instructions-template.resolver.ts +++ b/src/app/organization/standing-instructions-history/standing-instructions-template.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service'; */ @Injectable() export class StandingInstructionsTemplateResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class StandingInstructionsTemplateResolver implements Resolve { resolve(): Observable { return this.organizationService.getStandingInstructionTemplate(); } - } diff --git a/src/app/organization/tellers/cashiers/allocate-cash/allocate-cash.component.spec.ts b/src/app/organization/tellers/cashiers/allocate-cash/allocate-cash.component.spec.ts index eb5a24dee..1e01f18c4 100644 --- a/src/app/organization/tellers/cashiers/allocate-cash/allocate-cash.component.spec.ts +++ b/src/app/organization/tellers/cashiers/allocate-cash/allocate-cash.component.spec.ts @@ -8,9 +8,8 @@ describe('AllocateCashComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AllocateCashComponent ] - }) - .compileComponents(); + declarations: [AllocateCashComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/tellers/cashiers/allocate-cash/allocate-cash.component.ts b/src/app/organization/tellers/cashiers/allocate-cash/allocate-cash.component.ts index da76725cf..3a5ba68ab 100644 --- a/src/app/organization/tellers/cashiers/allocate-cash/allocate-cash.component.ts +++ b/src/app/organization/tellers/cashiers/allocate-cash/allocate-cash.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./allocate-cash.component.scss'] }) export class AllocateCashComponent implements OnInit { - /** Minimum Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Date allowed. */ @@ -36,13 +35,15 @@ export class AllocateCashComponent implements OnInit { * @param {SettingsService} settingsService Settings Service. * @param {Router} router Router. */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private dateUtils: Dates, - private organizationService: OrganizationService, - private settingsService: SettingsService, - private router: Router) { - this.route.data.subscribe((data: { cashierTemplate: any}) => { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private dateUtils: Dates, + private organizationService: OrganizationService, + private settingsService: SettingsService, + private router: Router + ) { + this.route.data.subscribe((data: { cashierTemplate: any }) => { this.cashierData = data.cashierTemplate; }); } @@ -57,14 +58,34 @@ export class AllocateCashComponent implements OnInit { */ setCashierForm() { this.allocateCashForm = this.formBuilder.group({ - 'office': [{value: this.cashierData.officeName, disabled: true}], - 'tellerName': [{value: this.cashierData.tellerName, disabled: true}], - 'cashier': [{value: this.cashierData.cashierName, disabled: true}], - 'assignmentPeriod': [{value: this.dateUtils.formatDate(this.cashierData.startDate, 'dd MMMM yyyy') + ' - ' + this.dateUtils.formatDate(this.cashierData.endDate, 'dd MMMM yyyy'), disabled: true}], - 'txnDate': [new Date(), Validators.required], - 'currencyCode': ['', Validators.required], - 'txnAmount': ['', Validators.required], - 'txnNote': ['', Validators.required] + office: [{ value: this.cashierData.officeName, disabled: true }], + tellerName: [{ value: this.cashierData.tellerName, disabled: true }], + cashier: [{ value: this.cashierData.cashierName, disabled: true }], + assignmentPeriod: [ + { + value: + this.dateUtils.formatDate(this.cashierData.startDate, 'dd MMMM yyyy') + + ' - ' + + this.dateUtils.formatDate(this.cashierData.endDate, 'dd MMMM yyyy'), + disabled: true + } + ], + txnDate: [ + new Date(), + Validators.required + ], + currencyCode: [ + '', + Validators.required + ], + txnAmount: [ + '', + Validators.required + ], + txnNote: [ + '', + Validators.required + ] }); } @@ -84,9 +105,10 @@ export class AllocateCashComponent implements OnInit { dateFormat, locale }; - this.organizationService.allocateCash(this.cashierData.tellerId, this.cashierData.cashierId, data).subscribe((response: any) => { - this.router.navigate(['../'], {relativeTo: this.route}); - }); + this.organizationService + .allocateCash(this.cashierData.tellerId, this.cashierData.cashierId, data) + .subscribe((response: any) => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/organization/tellers/cashiers/cashiers.component.spec.ts b/src/app/organization/tellers/cashiers/cashiers.component.spec.ts index c47ee5fe9..d575f6d36 100644 --- a/src/app/organization/tellers/cashiers/cashiers.component.spec.ts +++ b/src/app/organization/tellers/cashiers/cashiers.component.spec.ts @@ -8,9 +8,8 @@ describe('CashiersComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CashiersComponent ] - }) - .compileComponents(); + declarations: [CashiersComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/tellers/cashiers/cashiers.component.ts b/src/app/organization/tellers/cashiers/cashiers.component.ts index e30175977..b8c70435a 100644 --- a/src/app/organization/tellers/cashiers/cashiers.component.ts +++ b/src/app/organization/tellers/cashiers/cashiers.component.ts @@ -14,11 +14,15 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./cashiers.component.scss'] }) export class CashiersComponent implements OnInit { - /** Cashiers data. */ cashiersData: any; /** Columns to be displayed in cashiers table. */ - displayedColumns: string[] = ['period', 'staffName', 'isFullDay', 'vaultActions']; + displayedColumns: string[] = [ + 'period', + 'staffName', + 'isFullDay', + 'vaultActions' + ]; /** Data source for cashiers table. */ dataSource: MatTableDataSource; @@ -32,7 +36,7 @@ export class CashiersComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { cashiersData: any }) => { + this.route.data.subscribe((data: { cashiersData: any }) => { this.cashiersData = data.cashiersData.cashiers; }); } @@ -68,5 +72,4 @@ export class CashiersComponent implements OnInit { routeEdit($event: MouseEvent) { $event.stopPropagation(); } - } diff --git a/src/app/organization/tellers/cashiers/create-cashier/create-cashier.component.spec.ts b/src/app/organization/tellers/cashiers/create-cashier/create-cashier.component.spec.ts index ac2fba70e..dc2aeec2d 100644 --- a/src/app/organization/tellers/cashiers/create-cashier/create-cashier.component.spec.ts +++ b/src/app/organization/tellers/cashiers/create-cashier/create-cashier.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateCashierComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateCashierComponent ] - }) - .compileComponents(); + declarations: [CreateCashierComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/tellers/cashiers/create-cashier/create-cashier.component.ts b/src/app/organization/tellers/cashiers/create-cashier/create-cashier.component.ts index 878e54453..21e75aef5 100644 --- a/src/app/organization/tellers/cashiers/create-cashier/create-cashier.component.ts +++ b/src/app/organization/tellers/cashiers/create-cashier/create-cashier.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./create-cashier.component.scss'] }) export class CreateCashierComponent implements OnInit { - /** Minimum Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Date allowed. */ @@ -36,12 +35,14 @@ export class CreateCashierComponent implements OnInit { * @param {OrganizationService} organizationService Organization Service. * @param {SettingsService} settingsService Settings Service. */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private organizationService: OrganizationService, - private settingsService: SettingsService ) { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private organizationService: OrganizationService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { cashierTemplate: any }) => { this.cashierTemplate = data.cashierTemplate; }); @@ -57,11 +58,20 @@ export class CreateCashierComponent implements OnInit { */ setCreateCashierForm() { this.createCashierForm = this.formBuilder.group({ - 'staffId': ['', Validators.required], - 'description': [''], - 'startDate': ['', Validators.required], - 'endDate': ['', Validators.required], - 'isFullDay': [false] + staffId: [ + '', + Validators.required + ], + description: [''], + startDate: [ + '', + Validators.required + ], + endDate: [ + '', + Validators.required + ], + isFullDay: [false] }); } @@ -86,8 +96,7 @@ export class CreateCashierComponent implements OnInit { locale }; this.organizationService.createCashier(this.cashierTemplate.tellerId, data).subscribe((response: any) => { - this.router.navigate(['../'], {relativeTo: this.route}); + this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/organization/tellers/cashiers/edit-cashier/edit-cashier.component.spec.ts b/src/app/organization/tellers/cashiers/edit-cashier/edit-cashier.component.spec.ts index 3d6afa46a..5c39c3328 100644 --- a/src/app/organization/tellers/cashiers/edit-cashier/edit-cashier.component.spec.ts +++ b/src/app/organization/tellers/cashiers/edit-cashier/edit-cashier.component.spec.ts @@ -8,9 +8,8 @@ describe('EditCashierComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditCashierComponent ] - }) - .compileComponents(); + declarations: [EditCashierComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/tellers/cashiers/edit-cashier/edit-cashier.component.ts b/src/app/organization/tellers/cashiers/edit-cashier/edit-cashier.component.ts index fc64644c7..d633bfeb4 100644 --- a/src/app/organization/tellers/cashiers/edit-cashier/edit-cashier.component.ts +++ b/src/app/organization/tellers/cashiers/edit-cashier/edit-cashier.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-cashier.component.scss'] }) export class EditCashierComponent implements OnInit { - /** Cashier Data. */ cashierData: any = new Object(); /** Edit cashier form. */ @@ -38,16 +37,20 @@ export class EditCashierComponent implements OnInit { * @param {OrganizationService} organizationService Organization Service. * @param {SettingsService} settingsService Settings Service. */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private organizationService: OrganizationService, - private settingsService: SettingsService ) { - this.route.data.subscribe((data: { cashier: any, cashierTemplate: any }) => { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private organizationService: OrganizationService, + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { cashier: any; cashierTemplate: any }) => { this.cashierData.data = data.cashier; this.cashierData.template = data.cashierTemplate; - this.isStaffId = this.cashierData.template.staffOptions.some((element: any) => element.id === this.cashierData.data.staffId); + this.isStaffId = this.cashierData.template.staffOptions.some( + (element: any) => element.id === this.cashierData.data.staffId + ); }); } @@ -61,11 +64,20 @@ export class EditCashierComponent implements OnInit { */ setEditChargeForm() { this.editCashierForm = this.formBuilder.group({ - 'staffId': [{value: this.cashierData.data.staffId, disabled: true}], - 'description': [this.cashierData.data.description], - 'startDate': [this.cashierData.data.startDate && new Date(this.cashierData.data.startDate), Validators.required], - 'endDate': [this.cashierData.data.endDate && new Date(this.cashierData.data.endDate), Validators.required], - 'isFullDay': [this.cashierData.data.isFullDay, Validators.required] + staffId: [{ value: this.cashierData.data.staffId, disabled: true }], + description: [this.cashierData.data.description], + startDate: [ + this.cashierData.data.startDate && new Date(this.cashierData.data.startDate), + Validators.required + ], + endDate: [ + this.cashierData.data.endDate && new Date(this.cashierData.data.endDate), + Validators.required + ], + isFullDay: [ + this.cashierData.data.isFullDay, + Validators.required + ] }); } @@ -90,9 +102,10 @@ export class EditCashierComponent implements OnInit { dateFormat, locale }; - this.organizationService.updateCashier(this.cashierData.data.tellerId, this.cashierData.data.id, data).subscribe((response: any) => { - this.router.navigate(['../'], {relativeTo: this.route}); - }); + this.organizationService + .updateCashier(this.cashierData.data.tellerId, this.cashierData.data.id, data) + .subscribe((response: any) => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/organization/tellers/cashiers/settle-cash/settle-cash.component.spec.ts b/src/app/organization/tellers/cashiers/settle-cash/settle-cash.component.spec.ts index 1c732cc09..ca85b0ada 100644 --- a/src/app/organization/tellers/cashiers/settle-cash/settle-cash.component.spec.ts +++ b/src/app/organization/tellers/cashiers/settle-cash/settle-cash.component.spec.ts @@ -8,9 +8,8 @@ describe('SettleCashComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SettleCashComponent ] - }) - .compileComponents(); + declarations: [SettleCashComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/tellers/cashiers/settle-cash/settle-cash.component.ts b/src/app/organization/tellers/cashiers/settle-cash/settle-cash.component.ts index 9d3a68de7..31344393d 100644 --- a/src/app/organization/tellers/cashiers/settle-cash/settle-cash.component.ts +++ b/src/app/organization/tellers/cashiers/settle-cash/settle-cash.component.ts @@ -14,7 +14,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./settle-cash.component.scss'] }) export class SettleCashComponent implements OnInit { - /** Minimum Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Date allowed. */ @@ -33,13 +32,15 @@ export class SettleCashComponent implements OnInit { * @param {SettingsService} settingsService Settings Service. * @param {Router} router Router. */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private dateUtils: Dates, - private organizationService: OrganizationService, - private settingsService: SettingsService, - private router: Router) { - this.route.data.subscribe((data: { cashierTemplate: any}) => { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private dateUtils: Dates, + private organizationService: OrganizationService, + private settingsService: SettingsService, + private router: Router + ) { + this.route.data.subscribe((data: { cashierTemplate: any }) => { this.cashierData = data.cashierTemplate; }); } @@ -54,14 +55,34 @@ export class SettleCashComponent implements OnInit { */ setCashierForm() { this.settleCashForm = this.formBuilder.group({ - 'office': [{value: this.cashierData.officeName, disabled: true}], - 'tellerName': [{value: this.cashierData.tellerName, disabled: true}], - 'cashier': [{value: this.cashierData.cashierName, disabled: true}], - 'assignmentPeriod': [{value: this.dateUtils.formatDate(this.cashierData.startDate, 'dd MMMM yyyy') + ' - ' + this.dateUtils.formatDate(this.cashierData.endDate, 'dd MMMM yyyy'), disabled: true}], - 'txnDate': [new Date(), Validators.required], - 'currencyCode': ['', Validators.required], - 'txnAmount': ['', Validators.required], - 'txnNote': ['', Validators.required] + office: [{ value: this.cashierData.officeName, disabled: true }], + tellerName: [{ value: this.cashierData.tellerName, disabled: true }], + cashier: [{ value: this.cashierData.cashierName, disabled: true }], + assignmentPeriod: [ + { + value: + this.dateUtils.formatDate(this.cashierData.startDate, 'dd MMMM yyyy') + + ' - ' + + this.dateUtils.formatDate(this.cashierData.endDate, 'dd MMMM yyyy'), + disabled: true + } + ], + txnDate: [ + new Date(), + Validators.required + ], + currencyCode: [ + '', + Validators.required + ], + txnAmount: [ + '', + Validators.required + ], + txnNote: [ + '', + Validators.required + ] }); } @@ -81,9 +102,10 @@ export class SettleCashComponent implements OnInit { dateFormat, locale }; - this.organizationService.settleCash(this.cashierData.tellerId, this.cashierData.cashierId, data).subscribe((response: any) => { - this.router.navigate(['../'], {relativeTo: this.route}); - }); + this.organizationService + .settleCash(this.cashierData.tellerId, this.cashierData.cashierId, data) + .subscribe((response: any) => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/organization/tellers/cashiers/transactions/transactions.component.spec.ts b/src/app/organization/tellers/cashiers/transactions/transactions.component.spec.ts index b7cf5cf65..dd3cc10e9 100644 --- a/src/app/organization/tellers/cashiers/transactions/transactions.component.spec.ts +++ b/src/app/organization/tellers/cashiers/transactions/transactions.component.spec.ts @@ -8,9 +8,8 @@ describe('TransactionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ TransactionsComponent ] - }) - .compileComponents(); + declarations: [TransactionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/tellers/cashiers/transactions/transactions.component.ts b/src/app/organization/tellers/cashiers/transactions/transactions.component.ts index 994edf707..7a944a181 100644 --- a/src/app/organization/tellers/cashiers/transactions/transactions.component.ts +++ b/src/app/organization/tellers/cashiers/transactions/transactions.component.ts @@ -18,7 +18,6 @@ import { OrganizationService } from 'app/organization/organization.service'; styleUrls: ['./transactions.component.scss'] }) export class TransactionsComponent implements OnInit { - /** Currency selector. */ currencySelector = new UntypedFormControl(); /** Cashier Id */ @@ -30,7 +29,14 @@ export class TransactionsComponent implements OnInit { /** Currencys data. */ currencyData: any; /** Columns to be displayed in transactions table. */ - displayedColumns: string[] = ['date', 'transactions', 'allocation', 'cashIn', 'cashOut', 'settlement']; + displayedColumns: string[] = [ + 'date', + 'transactions', + 'allocation', + 'cashIn', + 'cashOut', + 'settlement' + ]; /** Data source for transactions table. */ dataSource: MatTableDataSource; @@ -44,9 +50,11 @@ export class TransactionsComponent implements OnInit { * @param {OrganizationService} organizationService Organization Service. * @param {ActivatedRoute} route Activated Route. */ - constructor(private organizationService: OrganizationService, - private route: ActivatedRoute) { - this.route.data.subscribe(( data: { currencies: any }) => { + constructor( + private organizationService: OrganizationService, + private route: ActivatedRoute + ) { + this.route.data.subscribe((data: { currencies: any }) => { this.currencyData = data.currencies.selectedCurrencyOptions; }); this.tellerId = this.route.parent.parent.parent.snapshot.params['id']; @@ -73,7 +81,8 @@ export class TransactionsComponent implements OnInit { */ onChangeCurrency() { this.currencySelector.valueChanges.subscribe((currencyCode: any) => { - this.organizationService.getCashierSummaryAndTransactions(this.tellerId, this.cashierId, currencyCode) + this.organizationService + .getCashierSummaryAndTransactions(this.tellerId, this.cashierId, currencyCode) .subscribe((response: any) => { this.cashierData = response; this.setTransactions(); @@ -89,5 +98,4 @@ export class TransactionsComponent implements OnInit { this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/organization/tellers/cashiers/view-cashier/view-cashier.component.spec.ts b/src/app/organization/tellers/cashiers/view-cashier/view-cashier.component.spec.ts index c2c29ef47..597a527c5 100644 --- a/src/app/organization/tellers/cashiers/view-cashier/view-cashier.component.spec.ts +++ b/src/app/organization/tellers/cashiers/view-cashier/view-cashier.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewCashierComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewCashierComponent ] - }) - .compileComponents(); + declarations: [ViewCashierComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/tellers/cashiers/view-cashier/view-cashier.component.ts b/src/app/organization/tellers/cashiers/view-cashier/view-cashier.component.ts index dfe2ac8df..9a7ca4d2b 100644 --- a/src/app/organization/tellers/cashiers/view-cashier/view-cashier.component.ts +++ b/src/app/organization/tellers/cashiers/view-cashier/view-cashier.component.ts @@ -18,7 +18,6 @@ import { OrganizationService } from 'app/organization/organization.service'; styleUrls: ['./view-cashier.component.scss'] }) export class ViewCashierComponent { - /** Cashier data. */ cashierData: any; @@ -29,10 +28,12 @@ export class ViewCashierComponent { * @param {OrganizationService} organizationService Organization Service * @param {MatDialog} dialog Mat Dialog */ - constructor(private route: ActivatedRoute, - private router: Router, - private organizationService: OrganizationService, - public dialog: MatDialog) { + constructor( + private route: ActivatedRoute, + private router: Router, + private organizationService: OrganizationService, + public dialog: MatDialog + ) { this.route.data.subscribe((data: { cashier: any }) => { this.cashierData = data.cashier; }); @@ -48,10 +49,9 @@ export class ViewCashierComponent { deleteCashierDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { this.organizationService.deleteCashier(this.cashierData.tellerId, this.cashierData.id).subscribe(() => { - this.router.navigate(['../'], {relativeTo: this.route}); + this.router.navigate(['../'], { relativeTo: this.route }); }); } }); } - } diff --git a/src/app/organization/tellers/common-resolvers/cashier.resolver.ts b/src/app/organization/tellers/common-resolvers/cashier.resolver.ts index 6b6b43353..d55ec62d0 100644 --- a/src/app/organization/tellers/common-resolvers/cashier.resolver.ts +++ b/src/app/organization/tellers/common-resolvers/cashier.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class CashierResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -28,5 +27,4 @@ export class CashierResolver implements Resolve { const tellerId = route.parent.parent.paramMap.get('id'); return this.organizationService.getCashier(tellerId, cashierId); } - } diff --git a/src/app/organization/tellers/common-resolvers/cashiers.resolver.ts b/src/app/organization/tellers/common-resolvers/cashiers.resolver.ts index cabe39a26..ef34473a5 100644 --- a/src/app/organization/tellers/common-resolvers/cashiers.resolver.ts +++ b/src/app/organization/tellers/common-resolvers/cashiers.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class CashiersResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -27,5 +26,4 @@ export class CashiersResolver implements Resolve { const tellerId = route.parent.paramMap.get('id'); return this.organizationService.getCashiers(tellerId); } - } diff --git a/src/app/organization/tellers/common-resolvers/edit-cashier.resolver.ts b/src/app/organization/tellers/common-resolvers/edit-cashier.resolver.ts index e12a8084d..e8a0e2556 100644 --- a/src/app/organization/tellers/common-resolvers/edit-cashier.resolver.ts +++ b/src/app/organization/tellers/common-resolvers/edit-cashier.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class EditCashierResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -27,5 +26,4 @@ export class EditCashierResolver implements Resolve { const tellerId = route.parent.parent.paramMap.get('id'); return this.organizationService.getCashierTemplate(tellerId); } - } diff --git a/src/app/organization/tellers/common-resolvers/teller-transaction-template.resolver.ts b/src/app/organization/tellers/common-resolvers/teller-transaction-template.resolver.ts index 507b1771b..85850a309 100644 --- a/src/app/organization/tellers/common-resolvers/teller-transaction-template.resolver.ts +++ b/src/app/organization/tellers/common-resolvers/teller-transaction-template.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class CashierTransactionTemplateResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -28,5 +27,4 @@ export class CashierTransactionTemplateResolver implements Resolve { const tellerId = route.parent.parent.paramMap.get('id'); return this.organizationService.getCashierTransactionTemplate(tellerId, cashierId); } - } diff --git a/src/app/organization/tellers/common-resolvers/teller.resolver.ts b/src/app/organization/tellers/common-resolvers/teller.resolver.ts index 35bf0edd7..0acc1e0a2 100644 --- a/src/app/organization/tellers/common-resolvers/teller.resolver.ts +++ b/src/app/organization/tellers/common-resolvers/teller.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class TellerResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -27,5 +26,4 @@ export class TellerResolver implements Resolve { const tellerId = route.paramMap.get('id'); return this.organizationService.getTeller(tellerId); } - } diff --git a/src/app/organization/tellers/common-resolvers/tellers.resolver.ts b/src/app/organization/tellers/common-resolvers/tellers.resolver.ts index ae97aef22..d594eb884 100644 --- a/src/app/organization/tellers/common-resolvers/tellers.resolver.ts +++ b/src/app/organization/tellers/common-resolvers/tellers.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service'; */ @Injectable() export class TellersResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class TellersResolver implements Resolve { resolve(): Observable { return this.organizationService.getTellers(); } - } diff --git a/src/app/organization/tellers/create-teller/create-teller.component.spec.ts b/src/app/organization/tellers/create-teller/create-teller.component.spec.ts index a39330292..01ba038a2 100644 --- a/src/app/organization/tellers/create-teller/create-teller.component.spec.ts +++ b/src/app/organization/tellers/create-teller/create-teller.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateTellerComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateTellerComponent ] - }) - .compileComponents(); + declarations: [CreateTellerComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/tellers/create-teller/create-teller.component.ts b/src/app/organization/tellers/create-teller/create-teller.component.ts index 2a67f7526..ced9a7697 100644 --- a/src/app/organization/tellers/create-teller/create-teller.component.ts +++ b/src/app/organization/tellers/create-teller/create-teller.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-teller.component.scss'] }) export class CreateTellerComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -38,17 +37,21 @@ export class CreateTellerComponent implements OnInit { * @param {Router} router Router for navigation. * @param {Dates} dateUtils Date Utils to format date. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private settingsService: SettingsService, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates) { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private settingsService: SettingsService, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates + ) { this.route.data.subscribe((data: { offices: any }) => { this.officeData = data.offices; }); - this.tellerStatusesData = [{'id': 300, 'code': '300', 'value': 'Active'}, - {'id': 400, 'code': '400', 'value': 'Inactive'}]; + this.tellerStatusesData = [ + { id: 300, code: '300', value: 'Active' }, + { id: 400, code: '400', value: 'Inactive' } + ]; } /** @@ -64,12 +67,26 @@ export class CreateTellerComponent implements OnInit { */ createTellerForm() { this.tellerForm = this.formBuilder.group({ - 'officeId': ['', Validators.required], - 'name': ['', [Validators.required, Validators.pattern('(^[A-z]).*')]], - 'description': [''], - 'startDate': ['', Validators.required], - 'endDate': [''], - 'status': ['', Validators.required], + officeId: [ + '', + Validators.required + ], + name: [ + '', + [ + Validators.required, + Validators.pattern('(^[A-z]).*')] + ], + description: [''], + startDate: [ + '', + Validators.required + ], + endDate: [''], + status: [ + '', + Validators.required + ] }); } @@ -95,8 +112,13 @@ export class CreateTellerComponent implements OnInit { locale }; this.organizationService.createTeller(data).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/organization/tellers/edit-teller/edit-teller.component.spec.ts b/src/app/organization/tellers/edit-teller/edit-teller.component.spec.ts index 433844959..6717a56ad 100644 --- a/src/app/organization/tellers/edit-teller/edit-teller.component.spec.ts +++ b/src/app/organization/tellers/edit-teller/edit-teller.component.spec.ts @@ -8,9 +8,8 @@ describe('EditTellerComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditTellerComponent ] - }) - .compileComponents(); + declarations: [EditTellerComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/tellers/edit-teller/edit-teller.component.ts b/src/app/organization/tellers/edit-teller/edit-teller.component.ts index 9c72f8bfb..5e4eca351 100644 --- a/src/app/organization/tellers/edit-teller/edit-teller.component.ts +++ b/src/app/organization/tellers/edit-teller/edit-teller.component.ts @@ -18,8 +18,7 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./edit-teller.component.scss'] }) export class EditTellerComponent implements OnInit { - -/** Minimum date allowed. */ + /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ maxDate = new Date(); @@ -41,26 +40,30 @@ export class EditTellerComponent implements OnInit { * @param {Router} router Router for navigation. * @param {Dates} dateUtils Date Utils to format date. */ - constructor(private formBuilder: UntypedFormBuilder, - private organizationService: OrganizationService, - private settingsService: SettingsService, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates) { - this.route.data.subscribe((data: { teller: any, offices: any }) => { + constructor( + private formBuilder: UntypedFormBuilder, + private organizationService: OrganizationService, + private settingsService: SettingsService, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates + ) { + this.route.data.subscribe((data: { teller: any; offices: any }) => { this.tellerData = data.teller; this.officeData = data.offices; }); if (this.tellerData.status) { if (this.tellerData.status === 'ACTIVE') { - this.tellerData.status = 300; + this.tellerData.status = 300; } else { - this.tellerData.status = 400; + this.tellerData.status = 400; } } - this.tellerStatusesData = [ {'id': 300, 'code': '300', 'value': 'Active'}, - {'id': 400, 'code': '400', 'value': 'Inactive'}]; + this.tellerStatusesData = [ + { id: 300, code: '300', value: 'Active' }, + { id: 400, code: '400', value: 'Inactive' } + ]; } /** @@ -76,12 +79,23 @@ export class EditTellerComponent implements OnInit { */ createEditTellerForm() { this.tellerForm = this.formBuilder.group({ - 'officeId': [{value: this.tellerData.officeId, disabled: true}], - 'name': [this.tellerData.name, [Validators.required, Validators.pattern('(^[A-z]).*')]], - 'description': [this.tellerData.description], - 'startDate': [this.tellerData.startDate && new Date(this.tellerData.startDate), Validators.required], - 'endDate': [this.tellerData.endDate && new Date(this.tellerData.endDate)], - 'status': [this.tellerData.status, Validators.required] + officeId: [{ value: this.tellerData.officeId, disabled: true }], + name: [ + this.tellerData.name, + [ + Validators.required, + Validators.pattern('(^[A-z]).*')] + ], + description: [this.tellerData.description], + startDate: [ + this.tellerData.startDate && new Date(this.tellerData.startDate), + Validators.required + ], + endDate: [this.tellerData.endDate && new Date(this.tellerData.endDate)], + status: [ + this.tellerData.status, + Validators.required + ] }); } @@ -108,8 +122,13 @@ export class EditTellerComponent implements OnInit { locale }; this.organizationService.updateTeller(this.tellerData.id, data).subscribe((response: any) => { - this.router.navigate(['../../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/organization/tellers/teller-transaction-template.resolver.ts b/src/app/organization/tellers/teller-transaction-template.resolver.ts index 507b1771b..85850a309 100644 --- a/src/app/organization/tellers/teller-transaction-template.resolver.ts +++ b/src/app/organization/tellers/teller-transaction-template.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from 'app/organization/organization.service'; */ @Injectable() export class CashierTransactionTemplateResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -28,5 +27,4 @@ export class CashierTransactionTemplateResolver implements Resolve { const tellerId = route.parent.parent.paramMap.get('id'); return this.organizationService.getCashierTransactionTemplate(tellerId, cashierId); } - } diff --git a/src/app/organization/tellers/tellers.component.spec.ts b/src/app/organization/tellers/tellers.component.spec.ts index 2572890ff..4907be308 100644 --- a/src/app/organization/tellers/tellers.component.spec.ts +++ b/src/app/organization/tellers/tellers.component.spec.ts @@ -8,9 +8,8 @@ describe('TellersComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ TellersComponent ] - }) - .compileComponents(); + declarations: [TellersComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/tellers/tellers.component.ts b/src/app/organization/tellers/tellers.component.ts index ca2a963a1..64f6473e5 100644 --- a/src/app/organization/tellers/tellers.component.ts +++ b/src/app/organization/tellers/tellers.component.ts @@ -17,11 +17,16 @@ import { of } from 'rxjs'; styleUrls: ['./tellers.component.scss'] }) export class TellersComponent implements OnInit { - /** Tellers data. */ tellersData: any; /** Columns to be displayed in tellers table. */ - displayedColumns: string[] = ['officeName', 'name', 'status', 'startDate', 'actions']; + displayedColumns: string[] = [ + 'officeName', + 'name', + 'status', + 'startDate', + 'actions' + ]; /** Data source for tellers table. */ dataSource: MatTableDataSource; @@ -35,7 +40,7 @@ export class TellersComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { tellers: any }) => { + this.route.data.subscribe((data: { tellers: any }) => { this.tellersData = data.tellers; }); } @@ -63,5 +68,4 @@ export class TellersComponent implements OnInit { this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/organization/tellers/view-teller/view-teller.component.spec.ts b/src/app/organization/tellers/view-teller/view-teller.component.spec.ts index 77a2ae9ed..b5322141a 100644 --- a/src/app/organization/tellers/view-teller/view-teller.component.spec.ts +++ b/src/app/organization/tellers/view-teller/view-teller.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewTellerComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewTellerComponent ] - }) - .compileComponents(); + declarations: [ViewTellerComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/tellers/view-teller/view-teller.component.ts b/src/app/organization/tellers/view-teller/view-teller.component.ts index c61d7e3e1..895d4881a 100644 --- a/src/app/organization/tellers/view-teller/view-teller.component.ts +++ b/src/app/organization/tellers/view-teller/view-teller.component.ts @@ -18,7 +18,6 @@ import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dial styleUrls: ['./view-teller.component.scss'] }) export class ViewTellerComponent { - /** Teller data. */ tellerData: any; @@ -29,10 +28,12 @@ export class ViewTellerComponent { * @param {Router} router Router for navigation. * @param {MatDialog} dialog Dialog reference. */ - constructor(private organizationService: OrganizationService, - private route: ActivatedRoute, - private router: Router, - public dialog: MatDialog) { + constructor( + private organizationService: OrganizationService, + private route: ActivatedRoute, + private router: Router, + public dialog: MatDialog + ) { this.route.data.subscribe((data: { teller: any }) => { this.tellerData = data.teller; }); @@ -47,12 +48,10 @@ export class ViewTellerComponent { }); deleteTellerDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.organizationService.deleteTeller(this.tellerData.id) - .subscribe(() => { - this.router.navigate(['/organization/tellers']); - }); + this.organizationService.deleteTeller(this.tellerData.id).subscribe(() => { + this.router.navigate(['/organization/tellers']); + }); } }); } - } diff --git a/src/app/organization/working-days/working-days.component.spec.ts b/src/app/organization/working-days/working-days.component.spec.ts index e256e38ba..350c1aa31 100644 --- a/src/app/organization/working-days/working-days.component.spec.ts +++ b/src/app/organization/working-days/working-days.component.spec.ts @@ -8,9 +8,8 @@ describe('WorkingDaysComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WorkingDaysComponent ] - }) - .compileComponents(); + declarations: [WorkingDaysComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/organization/working-days/working-days.component.ts b/src/app/organization/working-days/working-days.component.ts index 0210ce82b..0d2c7129b 100644 --- a/src/app/organization/working-days/working-days.component.ts +++ b/src/app/organization/working-days/working-days.component.ts @@ -25,7 +25,6 @@ const recurrenceDefaultValue = 'FREQ=WEEKLY;INTERVAL=1;BYDAY='; styleUrls: ['./working-days.component.scss'] }) export class WorkingDaysComponent implements OnInit, AfterViewInit { - /** Working days form. */ workingDaysForm: UntypedFormGroup; /** Working days data. */ @@ -59,14 +58,16 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private organizationService: OrganizationService, - private settingsService: SettingsService, - private router: Router, - private dialog: MatDialog, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private organizationService: OrganizationService, + private settingsService: SettingsService, + private router: Router, + private dialog: MatDialog, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { this.route.data.subscribe((data: { workingDays: any }) => { this.workingDaysData = data.workingDays; }); @@ -86,9 +87,9 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit { this.setWeeklyWorkingDays(); this.repaymentRescheduleTypeData = this.workingDaysData.repaymentRescheduleOptions; this.workingDaysForm = this.formBuilder.group({ - 'recurrence': this.formBuilder.array(this.createRecurrenceFormArray()), - 'repaymentRescheduleType': [this.workingDaysData.repaymentRescheduleType.id], - 'extendTermForDailyRepayments': [this.workingDaysData.extendTermForDailyRepayments] + recurrence: this.formBuilder.array(this.createRecurrenceFormArray()), + repaymentRescheduleType: [this.workingDaysData.repaymentRescheduleType.id], + extendTermForDailyRepayments: [this.workingDaysData.extendTermForDailyRepayments] }); } @@ -113,7 +114,7 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit { * Creates the recurrence form array. */ createRecurrenceFormArray() { - return this.weekDays.map(weekDay => new UntypedFormControl(weekDay.checked)); + return this.weekDays.map((weekDay) => new UntypedFormControl(weekDay.checked)); } /** @@ -131,7 +132,7 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit { } } workingDays.recurrence = recurrence; - this.organizationService.updateWorkingDays(workingDays).subscribe(response => { + this.organizationService.updateWorkingDays(workingDays).subscribe((response) => { if (this.configurationWizardService.showDefineWorkingDays === true) { this.configurationWizardService.showDefineWorkingDays = false; this.openNextStepDialog(); @@ -148,7 +149,12 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -158,7 +164,7 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showDefineWorkingDays === true) { setTimeout(() => { - this.showPopover(this.templateWorkingDaysFormRef, this.workingDaysFormRef.nativeElement, 'right', true); + this.showPopover(this.templateWorkingDaysFormRef, this.workingDaysFormRef.nativeElement, 'right', true); }); } } @@ -183,21 +189,21 @@ export class WorkingDaysComponent implements OnInit, AfterViewInit { * Next Step (System) Dialog Configuration Wizard. */ openNextStepDialog() { - const nextStepDialogRef = this.dialog.open( NextStepDialogComponent, { + const nextStepDialogRef = this.dialog.open(NextStepDialogComponent, { data: { nextStepName: 'Setup System', previousStepName: 'Organization', stepPercentage: 30 - }, + } }); nextStepDialogRef.afterClosed().subscribe((response: { nextStep: boolean }) => { - if (response.nextStep) { - this.configurationWizardService.showDefineWorkingDays = false; - this.configurationWizardService.showDatatables = true; - this.router.navigate(['/system']); + if (response.nextStep) { + this.configurationWizardService.showDefineWorkingDays = false; + this.configurationWizardService.showDatatables = true; + this.router.navigate(['/system']); } else { - this.configurationWizardService.showDefineWorkingDays = false; - this.router.navigate(['/home']); + this.configurationWizardService.showDefineWorkingDays = false; + this.router.navigate(['/home']); } }); } diff --git a/src/app/organization/working-days/working-days.resolver.ts b/src/app/organization/working-days/working-days.resolver.ts index ff516222e..bc4e56a2e 100644 --- a/src/app/organization/working-days/working-days.resolver.ts +++ b/src/app/organization/working-days/working-days.resolver.ts @@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service'; */ @Injectable() export class WorkingDaysResolver implements Resolve { - /** * @param {OrganizationService} organizationService Organization service. */ @@ -26,5 +25,4 @@ export class WorkingDaysResolver implements Resolve { resolve(): Observable { return this.organizationService.getWorkingDays(); } - } diff --git a/src/app/pipes/accounts-filter.pipe.ts b/src/app/pipes/accounts-filter.pipe.ts index 2280db00e..aa8c6e773 100644 --- a/src/app/pipes/accounts-filter.pipe.ts +++ b/src/app/pipes/accounts-filter.pipe.ts @@ -4,75 +4,86 @@ import { Pipe, PipeTransform } from '@angular/core'; name: 'accountsFilter' }) export class AccountsFilterPipe implements PipeTransform { - transform(accounts: any, type: any, status: any, checkSavings: any): any { if (accounts) { if (type === 'loan') { if (status === 'closed') { accounts = accounts.filter((account: any) => { - return (account.status.code === 'loanStatusType.closed.written.off' || + return ( + account.status.code === 'loanStatusType.closed.written.off' || account.status.code === 'loanStatusType.closed.obligations.met' || account.status.code === 'loanStatusType.closed.reschedule.outstanding.amount' || account.status.code === 'loanStatusType.withdrawn.by.client' || - account.status.code === 'loanStatusType.rejected'); + account.status.code === 'loanStatusType.rejected' + ); }); } else { accounts = accounts.filter((account: any) => { - return (account.status.code !== 'loanStatusType.closed.written.off' && + return ( + account.status.code !== 'loanStatusType.closed.written.off' && account.status.code !== 'loanStatusType.closed.obligations.met' && account.status.code !== 'loanStatusType.closed.reschedule.outstanding.amount' && account.status.code !== 'loanStatusType.withdrawn.by.client' && - account.status.code !== 'loanStatusType.rejected'); + account.status.code !== 'loanStatusType.rejected' + ); }); } } if (type === 'saving') { if (checkSavings === 'isFixed') { accounts = accounts.filter((account: any) => { - return (account.depositType.value === 'Fixed Deposit'); + return account.depositType.value === 'Fixed Deposit'; }); } else if (checkSavings === 'isRecurring') { accounts = accounts.filter((account: any) => { - return (account.depositType.value === 'Recurring Deposit'); + return account.depositType.value === 'Recurring Deposit'; }); } else if (checkSavings === 'isSavings') { accounts = accounts.filter((account: any) => { - return (account.depositType.value === 'Savings'); + return account.depositType.value === 'Savings'; }); } if (status === 'closed') { accounts = accounts.filter((account: any) => { - return (account.status.code === 'savingsAccountStatusType.withdrawn.by.applicant' || + return ( + account.status.code === 'savingsAccountStatusType.withdrawn.by.applicant' || account.status.code === 'savingsAccountStatusType.closed' || account.status.code === 'savingsAccountStatusType.pre.mature.closure' || - account.status.code === 'savingsAccountStatusType.rejected'); + account.status.code === 'savingsAccountStatusType.rejected' + ); }); } else { accounts = accounts.filter((account: any) => { - return (account.status.code !== 'savingsAccountStatusType.withdrawn.by.applicant' && + return ( + account.status.code !== 'savingsAccountStatusType.withdrawn.by.applicant' && account.status.code !== 'savingsAccountStatusType.closed' && account.status.code !== 'savingsAccountStatusType.pre.mature.closure' && - account.status.code !== 'savingsAccountStatusType.rejected'); + account.status.code !== 'savingsAccountStatusType.rejected' + ); }); } } if (type === 'share') { if (status === 'closed') { accounts = accounts.filter((account: any) => { - return (account.status.code === 'shareAccountStatusType.closed' || - account.status.code === 'shareAccountStatusType.rejected'); + return ( + account.status.code === 'shareAccountStatusType.closed' || + account.status.code === 'shareAccountStatusType.rejected' + ); }); } else { accounts = accounts.filter((account: any) => { - return (account.status.code !== 'shareAccountStatusType.closed' && - account.status.code !== 'shareAccountStatusType.rejected'); + return ( + account.status.code !== 'shareAccountStatusType.closed' && + account.status.code !== 'shareAccountStatusType.rejected' + ); }); } } if (type === 'guarantor') { if (status === false) { accounts = accounts.filter((account: any) => { - return (account.status === true); + return account.status === true; }); } else { return accounts; @@ -80,7 +91,7 @@ export class AccountsFilterPipe implements PipeTransform { } if (type === 'clientApproval') { accounts = accounts.filter((account: any) => { - return (account.active === false && account.status.value === 'Pending'); + return account.active === false && account.status.value === 'Pending'; }); } return accounts; diff --git a/src/app/pipes/charges-filter.pipe.ts b/src/app/pipes/charges-filter.pipe.ts index 1f430af93..0674251d8 100644 --- a/src/app/pipes/charges-filter.pipe.ts +++ b/src/app/pipes/charges-filter.pipe.ts @@ -4,11 +4,14 @@ import { Pipe, PipeTransform } from '@angular/core'; name: 'chargesFilter' }) export class ChargesFilterPipe implements PipeTransform { - transform(charges: any, chargesDataSource: any, currencyCode: string, multiDisburseLoan?: boolean): any { if (charges) { charges = charges.filter((charge: any) => { - if ((charge.currency.code !== currencyCode) || (!!multiDisburseLoan && charge.chargeTimeType.id === 12) || chargesDataSource.filter((chargeData: any) => chargeData.id === charge.id).length) { + if ( + charge.currency.code !== currencyCode || + (!!multiDisburseLoan && charge.chargeTimeType.id === 12) || + chargesDataSource.filter((chargeData: any) => chargeData.id === charge.id).length + ) { return false; } return true; @@ -16,5 +19,4 @@ export class ChargesFilterPipe implements PipeTransform { } return charges; } - } diff --git a/src/app/pipes/charges-penalty-filter.pipe.ts b/src/app/pipes/charges-penalty-filter.pipe.ts index f6571d5c8..89c17567f 100644 --- a/src/app/pipes/charges-penalty-filter.pipe.ts +++ b/src/app/pipes/charges-penalty-filter.pipe.ts @@ -4,7 +4,6 @@ import { Pipe, PipeTransform } from '@angular/core'; name: 'chargesPenaltyFilter' }) export class ChargesPenaltyFilterPipe implements PipeTransform { - transform(charges: any, penalty: boolean): any { if (charges) { charges = charges.filter((charge: any) => { @@ -16,5 +15,4 @@ export class ChargesPenaltyFilterPipe implements PipeTransform { } return charges; } - } diff --git a/src/app/pipes/date-format.pipe.spec.ts b/src/app/pipes/date-format.pipe.spec.ts index d9aef5171..bcc379bab 100644 --- a/src/app/pipes/date-format.pipe.spec.ts +++ b/src/app/pipes/date-format.pipe.spec.ts @@ -3,13 +3,11 @@ import { SettingsService } from 'app/settings/settings.service'; import { DateFormatPipe } from './date-format.pipe'; describe('DateFormatPipe', () => { - beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [ SettingsService ], - declarations: [ DateFormatPipe ] - }) - .compileComponents(); + imports: [SettingsService], + declarations: [DateFormatPipe] + }).compileComponents(); })); it('create an instance', () => { diff --git a/src/app/pipes/date-format.pipe.ts b/src/app/pipes/date-format.pipe.ts index c3346e8c6..580e5f493 100644 --- a/src/app/pipes/date-format.pipe.ts +++ b/src/app/pipes/date-format.pipe.ts @@ -6,9 +6,7 @@ import * as moment from 'moment'; name: 'dateFormat' }) export class DateFormatPipe implements PipeTransform { - - constructor(private settingsService: SettingsService) { - } + constructor(private settingsService: SettingsService) {} transform(value: any, dateFormat?: string): any { const defaultDateFormat = this.settingsService.dateFormat.replace('dd', 'DD'); @@ -27,5 +25,4 @@ export class DateFormatPipe implements PipeTransform { } return dateVal.format(dateFormat); } - } diff --git a/src/app/pipes/datetime-format.pipe.ts b/src/app/pipes/datetime-format.pipe.ts index 3fb14d99d..c44ebed79 100644 --- a/src/app/pipes/datetime-format.pipe.ts +++ b/src/app/pipes/datetime-format.pipe.ts @@ -6,9 +6,7 @@ import * as moment from 'moment'; name: 'datetimeFormat' }) export class DatetimeFormatPipe implements PipeTransform { - - constructor(private settingsService: SettingsService) { - } + constructor(private settingsService: SettingsService) {} transform(value: any, datetimeFormat?: string): any { const defaultDateFormat = this.settingsService.dateFormat.replace('dd', 'DD'); diff --git a/src/app/pipes/external-identifier.pipe.ts b/src/app/pipes/external-identifier.pipe.ts index 0eb1e8766..7960495db 100644 --- a/src/app/pipes/external-identifier.pipe.ts +++ b/src/app/pipes/external-identifier.pipe.ts @@ -4,7 +4,6 @@ import { Pipe, PipeTransform } from '@angular/core'; name: 'externalIdentifier' }) export class ExternalIdentifierPipe implements PipeTransform { - transform(externalId: string): string { const limit = 20; if (!externalId) { @@ -17,9 +16,8 @@ export class ExternalIdentifierPipe implements PipeTransform { return values[4]; } else { const inputLen = externalId.length; - return inputLen > limit ? externalId.substring((inputLen - limit), inputLen) : externalId; + return inputLen > limit ? externalId.substring(inputLen - limit, inputLen) : externalId; } } } - } diff --git a/src/app/pipes/find.pipe.ts b/src/app/pipes/find.pipe.ts index 0ce122c3c..c20150c1f 100644 --- a/src/app/pipes/find.pipe.ts +++ b/src/app/pipes/find.pipe.ts @@ -4,7 +4,6 @@ import { Pipe, PipeTransform } from '@angular/core'; name: 'find' }) export class FindPipe implements PipeTransform { - transform(value: any, options: any, key: string, property: string): any { let optionFound; if (options) { @@ -12,5 +11,4 @@ export class FindPipe implements PipeTransform { } return optionFound ? optionFound[property] : ''; } - } diff --git a/src/app/pipes/format-number.pipe.ts b/src/app/pipes/format-number.pipe.ts index 0edd4ab47..c3421e4db 100644 --- a/src/app/pipes/format-number.pipe.ts +++ b/src/app/pipes/format-number.pipe.ts @@ -6,10 +6,10 @@ import { SettingsService } from 'app/settings/settings.service'; name: 'formatNumber' }) export class FormatNumberPipe implements PipeTransform { - - constructor(private decimalFormat: DecimalPipe, - private settingsService: SettingsService) { - } + constructor( + private decimalFormat: DecimalPipe, + private settingsService: SettingsService + ) {} transform(value: string | number, defaultValue: any): string { if (!value) { @@ -19,5 +19,4 @@ export class FormatNumberPipe implements PipeTransform { const format = `1.${decimals}-${decimals}`; return this.decimalFormat.transform(value, format); } - } diff --git a/src/app/pipes/pipes.module.ts b/src/app/pipes/pipes.module.ts index 80732ee3f..021bca639 100644 --- a/src/app/pipes/pipes.module.ts +++ b/src/app/pipes/pipes.module.ts @@ -19,48 +19,53 @@ import { YesnoPipe } from './yesno.pipe'; imports: [ CommonModule ], - declarations: [ StatusLookupPipe, - AccountsFilterPipe, - ChargesFilterPipe, - ChargesPenaltyFilterPipe, - FindPipe, - UrlToStringPipe, - DateFormatPipe, - DatetimeFormatPipe, - ExternalIdentifierPipe, - FormatNumberPipe, - YesnoPipe, - PrettyPrintPipe, - TruncateTextPipe, - TranslatePipe - ], - providers: [StatusLookupPipe, - AccountsFilterPipe, - ChargesFilterPipe, - ChargesPenaltyFilterPipe, - FindPipe, - UrlToStringPipe, - DateFormatPipe, - DatetimeFormatPipe, - ExternalIdentifierPipe, - FormatNumberPipe, - YesnoPipe, - PrettyPrintPipe, - TranslatePipe, - TruncateTextPipe], - exports: [StatusLookupPipe, - AccountsFilterPipe, - ChargesFilterPipe, - ChargesPenaltyFilterPipe, - FindPipe, - UrlToStringPipe, - DateFormatPipe, - DatetimeFormatPipe, - ExternalIdentifierPipe, - FormatNumberPipe, - YesnoPipe, - PrettyPrintPipe, - TranslatePipe, - TruncateTextPipe] + declarations: [ + StatusLookupPipe, + AccountsFilterPipe, + ChargesFilterPipe, + ChargesPenaltyFilterPipe, + FindPipe, + UrlToStringPipe, + DateFormatPipe, + DatetimeFormatPipe, + ExternalIdentifierPipe, + FormatNumberPipe, + YesnoPipe, + PrettyPrintPipe, + TruncateTextPipe, + TranslatePipe + ], + providers: [ + StatusLookupPipe, + AccountsFilterPipe, + ChargesFilterPipe, + ChargesPenaltyFilterPipe, + FindPipe, + UrlToStringPipe, + DateFormatPipe, + DatetimeFormatPipe, + ExternalIdentifierPipe, + FormatNumberPipe, + YesnoPipe, + PrettyPrintPipe, + TranslatePipe, + TruncateTextPipe + ], + exports: [ + StatusLookupPipe, + AccountsFilterPipe, + ChargesFilterPipe, + ChargesPenaltyFilterPipe, + FindPipe, + UrlToStringPipe, + DateFormatPipe, + DatetimeFormatPipe, + ExternalIdentifierPipe, + FormatNumberPipe, + YesnoPipe, + PrettyPrintPipe, + TranslatePipe, + TruncateTextPipe + ] }) -export class PipesModule { } +export class PipesModule {} diff --git a/src/app/pipes/pretty-print.pipe.ts b/src/app/pipes/pretty-print.pipe.ts index 497824cf8..22f445ce4 100644 --- a/src/app/pipes/pretty-print.pipe.ts +++ b/src/app/pipes/pretty-print.pipe.ts @@ -1,19 +1,18 @@ -import {Pipe, PipeTransform} from '@angular/core'; +import { Pipe, PipeTransform } from '@angular/core'; import * as vkbeautify from 'vkbeautify'; @Pipe({ - name: 'prettyPrint' + name: 'prettyPrint' }) export class PrettyPrintPipe implements PipeTransform { - - transform(value: any) { - if (value.charAt(0) === '{' && value.charAt(value.length - 1) === '}') { - try { - return vkbeautify.json(value); - } catch (error) { - return value; - } - } + transform(value: any) { + if (value.charAt(0) === '{' && value.charAt(value.length - 1) === '}') { + try { + return vkbeautify.json(value); + } catch (error) { return value; + } } + return value; + } } diff --git a/src/app/pipes/status-lookup.pipe.ts b/src/app/pipes/status-lookup.pipe.ts index f150c99a3..13cc8dcad 100644 --- a/src/app/pipes/status-lookup.pipe.ts +++ b/src/app/pipes/status-lookup.pipe.ts @@ -4,13 +4,12 @@ import { Pipe, PipeTransform } from '@angular/core'; name: 'statusLookup' }) export class StatusLookupPipe implements PipeTransform { - transform(status: string): string { const cssClassNameLookup = { - 'true': 'status-active', - 'false': 'status-deleted', - 'Active': 'status-active', - 'Block': 'status-block', + true: 'status-active', + false: 'status-deleted', + Active: 'status-active', + Block: 'status-block', 'charges.StatusType.active.true': 'status-active', 'loanStatusType.submitted.and.pending.approval': 'status-pending', 'loanStatusType.approved': 'status-approved', diff --git a/src/app/pipes/translate.pipe.ts b/src/app/pipes/translate.pipe.ts index 0ade4c9da..628803e3c 100644 --- a/src/app/pipes/translate.pipe.ts +++ b/src/app/pipes/translate.pipe.ts @@ -5,12 +5,10 @@ import { TranslateService } from '@ngx-translate/core'; name: 'translateKey' }) export class TranslatePipe implements PipeTransform { - - constructor(private translateService: TranslateService) { } + constructor(private translateService: TranslateService) {} transform(attributeValue: any, group: string, prefix: string = 'labels'): string { const translationKey = `${prefix}.${group}.${attributeValue}`; return this.translateService.instant(translationKey); } - } diff --git a/src/app/pipes/truncate-text.pipe.ts b/src/app/pipes/truncate-text.pipe.ts index 590534dc4..5e1d20cf5 100644 --- a/src/app/pipes/truncate-text.pipe.ts +++ b/src/app/pipes/truncate-text.pipe.ts @@ -4,7 +4,6 @@ import { Pipe, PipeTransform } from '@angular/core'; name: 'truncateText' }) export class TruncateTextPipe implements PipeTransform { - transform(value: string, chars: number): string { if (value.length <= 40) { return value; @@ -17,5 +16,4 @@ export class TruncateTextPipe implements PipeTransform { return truncatedText; } - } diff --git a/src/app/pipes/url-to-string.pipe.ts b/src/app/pipes/url-to-string.pipe.ts index cf3b821fc..5253c927b 100644 --- a/src/app/pipes/url-to-string.pipe.ts +++ b/src/app/pipes/url-to-string.pipe.ts @@ -9,26 +9,25 @@ import { Pipe, PipeTransform } from '@angular/core'; name: 'urlToString' }) export class UrlToStringPipe implements PipeTransform { - transform(url: string): any { url = decodeURIComponent(url); const urlSubstrings: string[] = url.slice(1).split('/'); - if (url.includes('?')) { // Query params URL. + if (url.includes('?')) { + // Query params URL. const query = urlSubstrings.pop(); const prefix = query.slice(0, query.indexOf('?')); urlSubstrings.push(prefix); } - const stringRepresentation = - urlSubstrings - .map((path: string) => { - return path.split('-') - .map((str: string) => { - return str.charAt(0).toUpperCase() + str.slice(1); - }) - .join(' '); - }) - .join(' | '); + const stringRepresentation = urlSubstrings + .map((path: string) => { + return path + .split('-') + .map((str: string) => { + return str.charAt(0).toUpperCase() + str.slice(1); + }) + .join(' '); + }) + .join(' | '); return stringRepresentation; } - } diff --git a/src/app/pipes/yesno.pipe.ts b/src/app/pipes/yesno.pipe.ts index 8980d2a92..2a5bbdf8d 100644 --- a/src/app/pipes/yesno.pipe.ts +++ b/src/app/pipes/yesno.pipe.ts @@ -5,8 +5,7 @@ import { TranslateService } from '@ngx-translate/core'; name: 'yesNo' }) export class YesnoPipe implements PipeTransform { - - constructor(private translateService: TranslateService) { } + constructor(private translateService: TranslateService) {} transform(value: boolean, ...args: unknown[]): string { if (value == null) { @@ -15,5 +14,4 @@ export class YesnoPipe implements PipeTransform { const result = value ? 'Yes' : 'No'; return this.translateService.instant('labels.buttons.' + result); } - } diff --git a/src/app/products/charges/charge.resolver.ts b/src/app/products/charges/charge.resolver.ts index ea6e601d7..0f924b64a 100644 --- a/src/app/products/charges/charge.resolver.ts +++ b/src/app/products/charges/charge.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from 'app/products/products.service'; */ @Injectable() export class ChargeResolver implements Resolve { - /** * @param {productsService} productsService Products service. */ @@ -27,5 +26,4 @@ export class ChargeResolver implements Resolve { const chargeId = route.paramMap.get('id'); return this.productsService.getCharge(chargeId); } - } diff --git a/src/app/products/charges/charges-template-and-resolver.ts b/src/app/products/charges/charges-template-and-resolver.ts index f4e39d528..59efb0e43 100644 --- a/src/app/products/charges/charges-template-and-resolver.ts +++ b/src/app/products/charges/charges-template-and-resolver.ts @@ -10,16 +10,14 @@ import { ProductsService } from '../products.service'; @Injectable() export class ChargesTemplateAndResolver implements Resolve { + constructor(private productsService: ProductsService) {} - constructor(private productsService: ProductsService) { } - - /** - * Returns the changes template and data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const savingProductId = route.paramMap.get('id'); - return this.productsService.getCharge(savingProductId, true); - } - + /** + * Returns the changes template and data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const savingProductId = route.paramMap.get('id'); + return this.productsService.getCharge(savingProductId, true); + } } diff --git a/src/app/products/charges/charges-template.resolver.ts b/src/app/products/charges/charges-template.resolver.ts index 50b4a093c..5a30c2d28 100644 --- a/src/app/products/charges/charges-template.resolver.ts +++ b/src/app/products/charges/charges-template.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class ChargesTemplateResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -26,5 +25,4 @@ export class ChargesTemplateResolver implements Resolve { resolve(): Observable { return this.productsService.getChargesTemplate(); } - } diff --git a/src/app/products/charges/charges.component.spec.ts b/src/app/products/charges/charges.component.spec.ts index ddd24e84d..51897e3c6 100644 --- a/src/app/products/charges/charges.component.spec.ts +++ b/src/app/products/charges/charges.component.spec.ts @@ -8,9 +8,8 @@ describe('ChargesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChargesComponent ] - }) - .compileComponents(); + declarations: [ChargesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/charges/charges.component.ts b/src/app/products/charges/charges.component.ts index 968281f64..3f218c65e 100644 --- a/src/app/products/charges/charges.component.ts +++ b/src/app/products/charges/charges.component.ts @@ -24,11 +24,18 @@ import { Charge } from './models/charge.model'; styleUrls: ['./charges.component.scss'] }) export class ChargesComponent implements OnInit, AfterViewInit { - /** Charge data. */ chargeData: Charge[] = []; /** Columns to be displayed in charges table. */ - displayedColumns: string[] = ['name', 'chargeAppliesTo', 'chargeTimeType', 'chargeCalculationType', 'amount', 'penalty', 'active']; + displayedColumns: string[] = [ + 'name', + 'chargeAppliesTo', + 'chargeTimeType', + 'chargeCalculationType', + 'amount', + 'penalty', + 'active' + ]; /** Data source for charges table. */ dataSource: MatTableDataSource; @@ -55,12 +62,14 @@ export class ChargesComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private route: ActivatedRoute, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService, - private charges: Charges) { - this.route.data.subscribe(( data: { charges: any }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService, + private charges: Charges + ) { + this.route.data.subscribe((data: { charges: any }) => { this.chargeData = data.charges; }); this.chargeAppliesToOptions = this.charges.getChargeAppliesToOptions(); @@ -89,8 +98,10 @@ export class ChargesComponent implements OnInit, AfterViewInit { this.dataSource.paginator = this.paginator; this.dataSource.sortingDataAccessor = (charge: any, property: any) => { switch (property) { - case 'chargeAppliesTo': return charge.chargeAppliesTo.value; - default: return charge[property]; + case 'chargeAppliesTo': + return charge.chargeAppliesTo.value; + default: + return charge[property]; } }; this.dataSource.sort = this.sort; @@ -120,7 +131,12 @@ export class ChargesComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -146,9 +162,8 @@ export class ChargesComponent implements OnInit, AfterViewInit { filterByAppliesTo(chargeAppliesTo: number) { const filteredCharges: Charge[] = this.chargeData.filter((charge: Charge) => { - return (charge.chargeAppliesTo.id === chargeAppliesTo); + return charge.chargeAppliesTo.id === chargeAppliesTo; }); this.dataSource = new MatTableDataSource(filteredCharges); } - } diff --git a/src/app/products/charges/charges.resolver.ts b/src/app/products/charges/charges.resolver.ts index eca5b1c5c..d7711af76 100644 --- a/src/app/products/charges/charges.resolver.ts +++ b/src/app/products/charges/charges.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class ChargesResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -26,5 +25,4 @@ export class ChargesResolver implements Resolve { resolve(): Observable { return this.productsService.getCharges(); } - } diff --git a/src/app/products/charges/create-charge/create-charge.component.spec.ts b/src/app/products/charges/create-charge/create-charge.component.spec.ts index b3f670b77..9235f6f51 100644 --- a/src/app/products/charges/create-charge/create-charge.component.spec.ts +++ b/src/app/products/charges/create-charge/create-charge.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateChargeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateChargeComponent ] - }) - .compileComponents(); + declarations: [CreateChargeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/charges/create-charge/create-charge.component.ts b/src/app/products/charges/create-charge/create-charge.component.ts index 9008ca9c6..3e681e5f3 100644 --- a/src/app/products/charges/create-charge/create-charge.component.ts +++ b/src/app/products/charges/create-charge/create-charge.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-charge.component.scss'] }) export class CreateChargeComponent implements OnInit { - /** Charge form. */ chargeForm: UntypedFormGroup; /** Charges template data. */ @@ -46,17 +45,21 @@ export class CreateChargeComponent implements OnInit { * @param {Dates} dateUtils Date Utils to format date. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private productsService: ProductsService, private route: ActivatedRoute, private router: Router, private dateUtils: Dates, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { chargesTemplate: any }) => { this.chargesTemplateData = data.chargesTemplate; if (data.chargesTemplate.incomeOrLiabilityAccountOptions.liabilityAccountOptions) { - this.incomeAndLiabilityAccountData = data.chargesTemplate.incomeOrLiabilityAccountOptions.incomeAccountOptions - .concat(data.chargesTemplate.incomeOrLiabilityAccountOptions.liabilityAccountOptions); + this.incomeAndLiabilityAccountData = + data.chargesTemplate.incomeOrLiabilityAccountOptions.incomeAccountOptions.concat( + data.chargesTemplate.incomeOrLiabilityAccountOptions.liabilityAccountOptions + ); } else { this.incomeAndLiabilityAccountData = data.chargesTemplate.incomeOrLiabilityAccountOptions.incomeAccountOptions; } @@ -77,17 +80,37 @@ export class CreateChargeComponent implements OnInit { */ createChargeForm() { this.chargeForm = this.formBuilder.group({ - 'chargeAppliesTo': ['', Validators.required], - 'name': ['', Validators.required], - 'currencyCode': ['', Validators.required], - 'chargeTimeType': ['', Validators.required], - 'chargeCalculationType': ['', Validators.required], - 'amount': ['', [Validators.required, Validators.pattern('^\\s*(?=.*[1-9])\\d*(?:\\.\\d+)?\\s*$')]], - 'active': [false], - 'penalty': [false], - 'taxGroupId': [''], - 'minCap': [''], - 'maxCap': [''] + chargeAppliesTo: [ + '', + Validators.required + ], + name: [ + '', + Validators.required + ], + currencyCode: [ + '', + Validators.required + ], + chargeTimeType: [ + '', + Validators.required + ], + chargeCalculationType: [ + '', + Validators.required + ], + amount: [ + '', + [ + Validators.required, + Validators.pattern('^\\s*(?=.*[1-9])\\d*(?:\\.\\d+)?\\s*$')] + ], + active: [false], + penalty: [false], + taxGroupId: [''], + minCap: [''], + maxCap: [''] }); } @@ -122,15 +145,24 @@ export class CreateChargeComponent implements OnInit { */ filteredChargeCalculationType(): any { return this.chargeCalculationTypeData.filter((chargeCalculationType: any) => { - if (this.chargeForm.get('chargeTimeType').value === 12 && (chargeCalculationType.id === 3 || chargeCalculationType.id === 4)) { + if ( + this.chargeForm.get('chargeTimeType').value === 12 && + (chargeCalculationType.id === 3 || chargeCalculationType.id === 4) + ) { return false; } if (this.chargeForm.get('chargeTimeType').value !== 12 && chargeCalculationType.id === 5) { return false; } if (this.chargeForm.get('chargeAppliesTo').value === 2) { - if (!(this.chargeForm.get('chargeTimeType').value === 5 || this.chargeForm.get('chargeTimeType').value === 16 - || this.chargeForm.get('chargeTimeType').value === 17) && chargeCalculationType.id === 2) { + if ( + !( + this.chargeForm.get('chargeTimeType').value === 5 || + this.chargeForm.get('chargeTimeType').value === 16 || + this.chargeForm.get('chargeTimeType').value === 17 + ) && + chargeCalculationType.id === 2 + ) { return false; } } @@ -144,11 +176,16 @@ export class CreateChargeComponent implements OnInit { const chargeTimeType = this.chargeForm.controls.chargeTimeType.value; if (chargeAppliesTo === 1) { - return (chargeCalculationType === 2 || chargeCalculationType === 3 || chargeCalculationType === 4 || chargeCalculationType === 5); + return ( + chargeCalculationType === 2 || + chargeCalculationType === 3 || + chargeCalculationType === 4 || + chargeCalculationType === 5 + ); } else if (chargeAppliesTo === 2) { - return (chargeTimeType === 16 || chargeTimeType === 5) && (chargeCalculationType === 2); + return (chargeTimeType === 16 || chargeTimeType === 5) && chargeCalculationType === 2; } else if (chargeAppliesTo === 4) { - return ((chargeTimeType === 14 || chargeTimeType === 15) && chargeCalculationType === 2); + return (chargeTimeType === 14 || chargeTimeType === 15) && chargeCalculationType === 2; } return false; } @@ -195,7 +232,14 @@ export class CreateChargeComponent implements OnInit { break; case 7: // Monthly Fee this.chargeForm.addControl('feeOnMonthDay', new UntypedFormControl('')); - this.chargeForm.addControl('feeInterval', new UntypedFormControl('', [Validators.required, Validators.min(1), Validators.max(12), Validators.pattern('^[1-9]\\d*$')])); + this.chargeForm.addControl( + 'feeInterval', + new UntypedFormControl('', [ + Validators.required, + Validators.min(1), + Validators.max(12), + Validators.pattern('^[1-9]\\d*$')]) + ); this.repeatEveryLabel = 'Months'; break; case 9: // Overdue Fee @@ -204,7 +248,12 @@ export class CreateChargeComponent implements OnInit { this.chargeForm.get('addFeeFrequency').valueChanges.subscribe((addFeeFrequency) => { if (addFeeFrequency) { this.chargeForm.addControl('feeFrequency', new UntypedFormControl('', Validators.required)); - this.chargeForm.addControl('feeInterval', new UntypedFormControl('', [Validators.required, Validators.pattern('^[1-9]\\d*$')])); + this.chargeForm.addControl( + 'feeInterval', + new UntypedFormControl('', [ + Validators.required, + Validators.pattern('^[1-9]\\d*$')]) + ); } else { this.chargeForm.removeControl('feeFrequency'); this.chargeForm.removeControl('feeInterval'); @@ -212,17 +261,28 @@ export class CreateChargeComponent implements OnInit { }); break; case 11: // Weekly Fee - this.chargeForm.addControl('feeInterval', new UntypedFormControl('', [Validators.required, Validators.pattern('^[1-9]\\d*$')])); + this.chargeForm.addControl( + 'feeInterval', + new UntypedFormControl('', [ + Validators.required, + Validators.pattern('^[1-9]\\d*$')]) + ); this.repeatEveryLabel = 'Weeks'; break; } }); this.chargeForm.get('currencyCode').valueChanges.subscribe((currencyCode) => { - this.currencyDecimalPlaces = this.chargesTemplateData.currencyOptions.find((currency: any) => currency.code === currencyCode).decimalPlaces; + this.currencyDecimalPlaces = this.chargesTemplateData.currencyOptions.find( + (currency: any) => currency.code === currencyCode + ).decimalPlaces; if (this.currencyDecimalPlaces === 0) { - this.chargeForm.get('amount').setValidators([Validators.required, Validators.pattern('^[1-9]\\d*$')]); + this.chargeForm.get('amount').setValidators([ + Validators.required, + Validators.pattern('^[1-9]\\d*$')]); } else { - this.chargeForm.get('amount').setValidators([Validators.required, Validators.pattern(`^\\s*(?=.*[1-9])\\d*(\\.\\d{1,${this.currencyDecimalPlaces}})?\\s*$`)]); + this.chargeForm.get('amount').setValidators([ + Validators.required, + Validators.pattern(`^\\s*(?=.*[1-9])\\d*(\\.\\d{1,${this.currencyDecimalPlaces}})?\\s*$`)]); } }); } @@ -258,5 +318,4 @@ export class CreateChargeComponent implements OnInit { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/products/charges/edit-charge/edit-charge.component.spec.ts b/src/app/products/charges/edit-charge/edit-charge.component.spec.ts index cb4674637..5bee55392 100644 --- a/src/app/products/charges/edit-charge/edit-charge.component.spec.ts +++ b/src/app/products/charges/edit-charge/edit-charge.component.spec.ts @@ -8,9 +8,8 @@ describe('EditChargeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditChargeComponent ] - }) - .compileComponents(); + declarations: [EditChargeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/charges/edit-charge/edit-charge.component.ts b/src/app/products/charges/edit-charge/edit-charge.component.ts index 7feadb5b1..7fc07482f 100644 --- a/src/app/products/charges/edit-charge/edit-charge.component.ts +++ b/src/app/products/charges/edit-charge/edit-charge.component.ts @@ -7,7 +7,6 @@ import { ActivatedRoute, Router } from '@angular/router'; import { ProductsService } from 'app/products/products.service'; import { SettingsService } from 'app/settings/settings.service'; - /** * Edit Charge component. */ @@ -17,7 +16,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-charge.component.scss'] }) export class EditChargeComponent implements OnInit { - /** Selected Data. */ chargeData: any; /** Charge form. */ @@ -53,11 +51,13 @@ export class EditChargeComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private productsService: ProductsService, + constructor( + private productsService: ProductsService, private formBuilder: UntypedFormBuilder, private route: ActivatedRoute, private router: Router, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { chargesTemplate: any }) => { this.chargeData = data.chargesTemplate; }); @@ -71,19 +71,37 @@ export class EditChargeComponent implements OnInit { * Edit Charge form. */ editChargeForm() { - this.showFeeOptions = (this.chargeData.feeInterval && this.chargeData.feeInterval > 0); + this.showFeeOptions = this.chargeData.feeInterval && this.chargeData.feeInterval > 0; this.chargeForm = this.formBuilder.group({ - 'name': [this.chargeData.name, Validators.required], - 'chargeAppliesTo': [{ value: this.chargeData.chargeAppliesTo.id, disabled: true }, Validators.required], - 'currencyCode': [this.chargeData.currency.code, Validators.required], - 'amount': [this.chargeData.amount, Validators.required], - 'active': [this.chargeData.active], - 'penalty': [this.chargeData.penalty], - 'minCap': [this.chargeData.minCap], - 'maxCap': [this.chargeData.maxCap], - 'chargeTimeType': [this.chargeData.chargeTimeType.id, Validators.required], - 'chargeCalculationType': [this.chargeData.chargeCalculationType.id, Validators.required], + name: [ + this.chargeData.name, + Validators.required + ], + chargeAppliesTo: [ + { value: this.chargeData.chargeAppliesTo.id, disabled: true }, + Validators.required + ], + currencyCode: [ + this.chargeData.currency.code, + Validators.required + ], + amount: [ + this.chargeData.amount, + Validators.required + ], + active: [this.chargeData.active], + penalty: [this.chargeData.penalty], + minCap: [this.chargeData.minCap], + maxCap: [this.chargeData.maxCap], + chargeTimeType: [ + this.chargeData.chargeTimeType.id, + Validators.required + ], + chargeCalculationType: [ + this.chargeData.chargeCalculationType.id, + Validators.required + ] }); switch (this.chargeData.chargeAppliesTo.value) { case 'Loan': { @@ -91,12 +109,15 @@ export class EditChargeComponent implements OnInit { this.chargeCalculationTypeOptions = this.chargeData.loanChargeCalculationTypeOptions; this.addFeeFrequency = true; this.chargePaymentMode = true; - this.chargeForm.addControl('chargePaymentMode', this.formBuilder.control(this.chargeData.chargePaymentMode.id, Validators.required)); + this.chargeForm.addControl( + 'chargePaymentMode', + this.formBuilder.control(this.chargeData.chargePaymentMode.id, Validators.required) + ); if (this.showFeeOptions) { this.getFeeFrequency(this.showFeeOptions); this.chargeForm.patchValue({ - 'feeInterval': this.chargeData.feeInterval, - 'feeFrequency': this.chargeData.feeFrequency.id + feeInterval: this.chargeData.feeInterval, + feeFrequency: this.chargeData.feeFrequency.id }); } break; @@ -120,12 +141,18 @@ export class EditChargeComponent implements OnInit { this.chargeTimeTypeOptions = this.chargeData.clientChargeTimeTypeOptions; this.showGLAccount = true; this.addFeeFrequency = false; - this.chargeForm.addControl('incomeAccountId', this.formBuilder.control(this.chargeData.incomeOrLiabilityAccount.id, Validators.required)); + this.chargeForm.addControl( + 'incomeAccountId', + this.formBuilder.control(this.chargeData.incomeOrLiabilityAccount.id, Validators.required) + ); break; } } if (this.chargeData.taxGroup) { - this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: this.chargeData.taxGroup.id, disabled: true })); + this.chargeForm.addControl( + 'taxGroupId', + this.formBuilder.control({ value: this.chargeData.taxGroup.id, disabled: true }) + ); } else { this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: '' })); } @@ -160,10 +187,8 @@ export class EditChargeComponent implements OnInit { if (!charges.maxCap) { delete charges.maxCap; } - this.productsService.updateCharge(this.chargeData.id.toString(), charges) - .subscribe((response: any) => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.productsService.updateCharge(this.chargeData.id.toString(), charges).subscribe((response: any) => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/products/charges/models/charge.model.ts b/src/app/products/charges/models/charge.model.ts index c0a062f99..c8e5de940 100644 --- a/src/app/products/charges/models/charge.model.ts +++ b/src/app/products/charges/models/charge.model.ts @@ -2,51 +2,51 @@ import { Currency, PaymentTypeOption } from 'app/shared/models/general.model'; import { OptionData } from 'app/shared/models/option-data.model'; export interface Charge { - id: number; - name: string; - active: boolean; - penalty: boolean; - freeWithdrawal: boolean; - freeWithdrawalChargeFrequency: number; - restartFrequency: number; - restartFrequencyEnum: number; - isPaymentType: boolean; - currency: Currency; - amount: number; - chargeTimeType: OptionData; - chargeAppliesTo: OptionData; - chargeCalculationType: OptionData; - chargePaymentMode: OptionData; - feeInterval?: number; - feeFrequency?: OptionData; - feeOnMonthDay?: number[]; - paymentTypeOptions?: PaymentTypeOption; + id: number; + name: string; + active: boolean; + penalty: boolean; + freeWithdrawal: boolean; + freeWithdrawalChargeFrequency: number; + restartFrequency: number; + restartFrequencyEnum: number; + isPaymentType: boolean; + currency: Currency; + amount: number; + chargeTimeType: OptionData; + chargeAppliesTo: OptionData; + chargeCalculationType: OptionData; + chargePaymentMode: OptionData; + feeInterval?: number; + feeFrequency?: OptionData; + feeOnMonthDay?: number[]; + paymentTypeOptions?: PaymentTypeOption; } export enum ChargeAppliesToCode { - ChargeAppliesToClient = 'chargeAppliesTo.client', - ChargeAppliesToLoan = 'chargeAppliesTo.loan', - ChargeAppliesToSavings = 'chargeAppliesTo.savings', - ChargeAppliesToShares = 'chargeAppliesTo.shares', - ChargeCalculationTypeFlat = 'chargeCalculationType.flat', - ChargeCalculationTypePercentOfAmount = 'chargeCalculationType.percent.of.amount', - ChargeCalculationTypePercentOfAmountAndInterest = 'chargeCalculationType.percent.of.amount.and.interest', - ChargeCalculationTypePercentOfInterest = 'chargeCalculationType.percent.of.interest', - ChargeTimeTypeActivation = 'chargeTimeType.activation', - ChargeTimeTypeAnnualFee = 'chargeTimeType.annualFee', - ChargeTimeTypeDisbursement = 'chargeTimeType.disbursement', - ChargeTimeTypeInstalmentFee = 'chargeTimeType.instalmentFee', - ChargeTimeTypeMonthlyFee = 'chargeTimeType.monthlyFee', - ChargeTimeTypeOverdueInstallment = 'chargeTimeType.overdueInstallment', - ChargeTimeTypeSavingsActivation = 'chargeTimeType.savingsActivation', - ChargeTimeTypeSavingsNoActivityFee = 'chargeTimeType.savingsNoActivityFee', - ChargeTimeTypeSharespurchase = 'chargeTimeType.sharespurchase', - ChargeTimeTypeSharesredeem = 'chargeTimeType.sharesredeem', - ChargeTimeTypeSolidarityFund = 'chargeTimeType.solidarityFund', - ChargeTimeTypeSpecifiedDueDate = 'chargeTimeType.specifiedDueDate', - ChargeTimeTypeWeeklyFee = 'chargeTimeType.weeklyFee', - ChargeTimeTypeWithdrawalFee = 'chargeTimeType.withdrawalFee', - ChargepaymentmodeAccounttransfer = 'chargepaymentmode.accounttransfer', - ChargepaymentmodeRegular = 'chargepaymentmode.regular', - FeeFrequencyperiodFrequencyTypeMonths = 'feeFrequencyperiodFrequencyType.months', + ChargeAppliesToClient = 'chargeAppliesTo.client', + ChargeAppliesToLoan = 'chargeAppliesTo.loan', + ChargeAppliesToSavings = 'chargeAppliesTo.savings', + ChargeAppliesToShares = 'chargeAppliesTo.shares', + ChargeCalculationTypeFlat = 'chargeCalculationType.flat', + ChargeCalculationTypePercentOfAmount = 'chargeCalculationType.percent.of.amount', + ChargeCalculationTypePercentOfAmountAndInterest = 'chargeCalculationType.percent.of.amount.and.interest', + ChargeCalculationTypePercentOfInterest = 'chargeCalculationType.percent.of.interest', + ChargeTimeTypeActivation = 'chargeTimeType.activation', + ChargeTimeTypeAnnualFee = 'chargeTimeType.annualFee', + ChargeTimeTypeDisbursement = 'chargeTimeType.disbursement', + ChargeTimeTypeInstalmentFee = 'chargeTimeType.instalmentFee', + ChargeTimeTypeMonthlyFee = 'chargeTimeType.monthlyFee', + ChargeTimeTypeOverdueInstallment = 'chargeTimeType.overdueInstallment', + ChargeTimeTypeSavingsActivation = 'chargeTimeType.savingsActivation', + ChargeTimeTypeSavingsNoActivityFee = 'chargeTimeType.savingsNoActivityFee', + ChargeTimeTypeSharespurchase = 'chargeTimeType.sharespurchase', + ChargeTimeTypeSharesredeem = 'chargeTimeType.sharesredeem', + ChargeTimeTypeSolidarityFund = 'chargeTimeType.solidarityFund', + ChargeTimeTypeSpecifiedDueDate = 'chargeTimeType.specifiedDueDate', + ChargeTimeTypeWeeklyFee = 'chargeTimeType.weeklyFee', + ChargeTimeTypeWithdrawalFee = 'chargeTimeType.withdrawalFee', + ChargepaymentmodeAccounttransfer = 'chargepaymentmode.accounttransfer', + ChargepaymentmodeRegular = 'chargepaymentmode.regular', + FeeFrequencyperiodFrequencyTypeMonths = 'feeFrequencyperiodFrequencyType.months' } diff --git a/src/app/products/charges/view-charge/view-charge.component.spec.ts b/src/app/products/charges/view-charge/view-charge.component.spec.ts index 6c6e3739c..d40f3ae62 100644 --- a/src/app/products/charges/view-charge/view-charge.component.spec.ts +++ b/src/app/products/charges/view-charge/view-charge.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewChargeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewChargeComponent ] - }) - .compileComponents(); + declarations: [ViewChargeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/charges/view-charge/view-charge.component.ts b/src/app/products/charges/view-charge/view-charge.component.ts index 11bfa93a7..d5d05120c 100644 --- a/src/app/products/charges/view-charge/view-charge.component.ts +++ b/src/app/products/charges/view-charge/view-charge.component.ts @@ -19,7 +19,6 @@ import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dial styleUrls: ['./view-charge.component.scss'] }) export class ViewChargeComponent { - /** Charge data. */ chargeData: any; /** Boolean for MinCap and MaxCap */ @@ -33,11 +32,13 @@ export class ViewChargeComponent { * @param {MatDialog} dialog Dialog reference. * @param {TranslateService} translateService Translate Service. */ - constructor(private productsService: ProductsService, + constructor( + private productsService: ProductsService, private route: ActivatedRoute, private router: Router, private dialog: MatDialog, - private translateService: TranslateService) { + private translateService: TranslateService + ) { this.route.data.subscribe((data: { charge: any }) => { this.chargeData = data.charge; if (this.chargeData.minCap) { @@ -54,16 +55,14 @@ export class ViewChargeComponent { */ deleteCharge() { const deleteChargeDialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: this.translateService.instant('labels.inputs.Charge') + ' ' + this.chargeData.id} + data: { deleteContext: this.translateService.instant('labels.inputs.Charge') + ' ' + this.chargeData.id } }); deleteChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.productsService.deleteCharge(this.chargeData.id) - .subscribe(() => { - this.router.navigate(['/products/charges']); - }); + this.productsService.deleteCharge(this.chargeData.id).subscribe(() => { + this.router.navigate(['/products/charges']); + }); } }); } - } diff --git a/src/app/products/collaterals/collateral.resolver.ts b/src/app/products/collaterals/collateral.resolver.ts index 02c0bbe48..98d3ba49f 100644 --- a/src/app/products/collaterals/collateral.resolver.ts +++ b/src/app/products/collaterals/collateral.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class CollateralResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -27,5 +26,4 @@ export class CollateralResolver implements Resolve { const collateralId = route.paramMap.get('id'); return this.productsService.getCollateral(collateralId); } - } diff --git a/src/app/products/collaterals/collaterals-template.resolver.ts b/src/app/products/collaterals/collaterals-template.resolver.ts index 6d084ef48..1a2d834d5 100644 --- a/src/app/products/collaterals/collaterals-template.resolver.ts +++ b/src/app/products/collaterals/collaterals-template.resolver.ts @@ -13,16 +13,16 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class CollateralTemplateResolver implements Resolve { - /** - * @param {ProductsService} productsService products Service - */ - constructor(private productsService: ProductsService) {} + /** + * @param {ProductsService} productsService products Service + */ + constructor(private productsService: ProductsService) {} - /** - * Returns the product Data. - * @returns {Observable} - */ - resolve(): Observable { - return this.productsService.getCollateralTemplate(); - } + /** + * Returns the product Data. + * @returns {Observable} + */ + resolve(): Observable { + return this.productsService.getCollateralTemplate(); + } } diff --git a/src/app/products/collaterals/collaterals.component.spec.ts b/src/app/products/collaterals/collaterals.component.spec.ts index 203248b28..11794aab1 100644 --- a/src/app/products/collaterals/collaterals.component.spec.ts +++ b/src/app/products/collaterals/collaterals.component.spec.ts @@ -8,9 +8,8 @@ describe('CollateralsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ CollateralsComponent ] - }) - .compileComponents(); + declarations: [CollateralsComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/collaterals/collaterals.component.ts b/src/app/products/collaterals/collaterals.component.ts index 3658fa850..030f757db 100644 --- a/src/app/products/collaterals/collaterals.component.ts +++ b/src/app/products/collaterals/collaterals.component.ts @@ -11,11 +11,16 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./collaterals.component.scss'] }) export class CollateralsComponent implements OnInit { - /** Collateral Data */ collateralData: any; /** Columns to be displayed in the Collaterals Table */ - displayedColumns: string[] = ['name', 'quality', 'basePrice', 'basePercentage', 'unitType']; + displayedColumns: string[] = [ + 'name', + 'quality', + 'basePrice', + 'basePercentage', + 'unitType' + ]; /** DataSource for the Collateral Table */ dataSource: MatTableDataSource; @@ -28,8 +33,8 @@ export class CollateralsComponent implements OnInit { * Retrieves the Collaterals data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ - constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { collaterals: any }) => { + constructor(private route: ActivatedRoute) { + this.route.data.subscribe((data: { collaterals: any }) => { this.collateralData = data.collaterals; }); } @@ -52,10 +57,9 @@ export class CollateralsComponent implements OnInit { /** * Initializes the data source, paginator and sorter for collateral table. */ - setCollaterals() { + setCollaterals() { this.dataSource = new MatTableDataSource(this.collateralData); this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/products/collaterals/collaterals.resolver.ts b/src/app/products/collaterals/collaterals.resolver.ts index 6a4b3e300..e338ea522 100644 --- a/src/app/products/collaterals/collaterals.resolver.ts +++ b/src/app/products/collaterals/collaterals.resolver.ts @@ -13,16 +13,16 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class CollateralsResolver implements Resolve { - /** - * @param {ProductsService} productsService Products service - */ - constructor(private productsService: ProductsService) {} + /** + * @param {ProductsService} productsService Products service + */ + constructor(private productsService: ProductsService) {} - /** - * Returns the All Collaterals Data - * @returns {Observable} - */ - resolve(): Observable { - return this.productsService.getCollaterals(); - } + /** + * Returns the All Collaterals Data + * @returns {Observable} + */ + resolve(): Observable { + return this.productsService.getCollaterals(); + } } diff --git a/src/app/products/collaterals/create-collateral/create-collateral.component.spec.ts b/src/app/products/collaterals/create-collateral/create-collateral.component.spec.ts index 99d7e5f30..9576ca090 100644 --- a/src/app/products/collaterals/create-collateral/create-collateral.component.spec.ts +++ b/src/app/products/collaterals/create-collateral/create-collateral.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateCollateralComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ CreateCollateralComponent ] - }) - .compileComponents(); + declarations: [CreateCollateralComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/collaterals/create-collateral/create-collateral.component.ts b/src/app/products/collaterals/create-collateral/create-collateral.component.ts index 6392da71a..a535d68a8 100644 --- a/src/app/products/collaterals/create-collateral/create-collateral.component.ts +++ b/src/app/products/collaterals/create-collateral/create-collateral.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-collateral.component.scss'] }) export class CreateCollateralComponent implements OnInit { - /** Collateral form */ collateralForm: UntypedFormGroup; /** Charges Template data */ @@ -31,15 +30,17 @@ export class CreateCollateralComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private productsService: ProductsService, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { - this.route.data.subscribe((data: { collateralTemplate: any }) => { - this.collateralTemplateData = data.collateralTemplate; - }); - } + constructor( + private formBuilder: UntypedFormBuilder, + private productsService: ProductsService, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { collateralTemplate: any }) => { + this.collateralTemplateData = data.collateralTemplate; + }); + } /** * Create and sets Collateral Form @@ -53,12 +54,30 @@ export class CreateCollateralComponent implements OnInit { */ createCollateralForm() { this.collateralForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'unitType': ['', Validators.required], - 'basePrice': ['', Validators.required], - 'pctToBase': ['', Validators.required], - 'currency': ['', Validators.required], - 'quality': ['', Validators.required] + name: [ + '', + Validators.required + ], + unitType: [ + '', + Validators.required + ], + basePrice: [ + '', + Validators.required + ], + pctToBase: [ + '', + Validators.required + ], + currency: [ + '', + Validators.required + ], + quality: [ + '', + Validators.required + ] }); } @@ -76,7 +95,4 @@ export class CreateCollateralComponent implements OnInit { this.router.navigate(['../'], { relativeTo: this.route }); }); } - - - } diff --git a/src/app/products/collaterals/edit-collateral/edit-collateral.component.spec.ts b/src/app/products/collaterals/edit-collateral/edit-collateral.component.spec.ts index 66fbb5c31..47d972674 100644 --- a/src/app/products/collaterals/edit-collateral/edit-collateral.component.spec.ts +++ b/src/app/products/collaterals/edit-collateral/edit-collateral.component.spec.ts @@ -8,9 +8,8 @@ describe('EditCollateralComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ EditCollateralComponent ] - }) - .compileComponents(); + declarations: [EditCollateralComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/collaterals/edit-collateral/edit-collateral.component.ts b/src/app/products/collaterals/edit-collateral/edit-collateral.component.ts index bddf32a6a..3e0384711 100644 --- a/src/app/products/collaterals/edit-collateral/edit-collateral.component.ts +++ b/src/app/products/collaterals/edit-collateral/edit-collateral.component.ts @@ -13,7 +13,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-collateral.component.scss'] }) export class EditCollateralComponent implements OnInit { - /** Colalteral Data */ collateralData: any; /** Collateral Template */ @@ -29,16 +28,18 @@ export class EditCollateralComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service. */ - constructor(private productsService: ProductsService, - private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { - this.route.data.subscribe((data: { collateral: any, collateralTemplate: any }) => { - this.collateralData = data.collateral; - this.collateralTemplateData = data.collateralTemplate; - }); - } + constructor( + private productsService: ProductsService, + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { collateral: any; collateralTemplate: any }) => { + this.collateralData = data.collateral; + this.collateralTemplateData = data.collateralTemplate; + }); + } ngOnInit(): void { this.editCollateralForm(); @@ -49,12 +50,30 @@ export class EditCollateralComponent implements OnInit { */ editCollateralForm() { this.collateralForm = this.formBuilder.group({ - 'name': [this.collateralData.name, Validators.required], - 'quality': [this.collateralData.quality, Validators.required], - 'unitType': [this.collateralData.unitType, Validators.required], - 'basePrice': [this.collateralData.basePrice, Validators.required], - 'pctToBase': [this.collateralData.pctToBase, Validators.required], - 'currency': [this.collateralData.currency, Validators.required], + name: [ + this.collateralData.name, + Validators.required + ], + quality: [ + this.collateralData.quality, + Validators.required + ], + unitType: [ + this.collateralData.unitType, + Validators.required + ], + basePrice: [ + this.collateralData.basePrice, + Validators.required + ], + pctToBase: [ + this.collateralData.pctToBase, + Validators.required + ], + currency: [ + this.collateralData.currency, + Validators.required + ] }); } @@ -64,10 +83,8 @@ export class EditCollateralComponent implements OnInit { submit() { const collateral = this.collateralForm.value; collateral.locale = this.settingsService.language.code; - this.productsService.updateCollateral(this.collateralData.id.toString(), collateral) - .subscribe((response: any) => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.productsService.updateCollateral(this.collateralData.id.toString(), collateral).subscribe((response: any) => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/products/collaterals/view-collateral/view-collateral.component.spec.ts b/src/app/products/collaterals/view-collateral/view-collateral.component.spec.ts index ac97d75c7..6abfd2f6e 100644 --- a/src/app/products/collaterals/view-collateral/view-collateral.component.spec.ts +++ b/src/app/products/collaterals/view-collateral/view-collateral.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewCollateralComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ViewCollateralComponent ] - }) - .compileComponents(); + declarations: [ViewCollateralComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/collaterals/view-collateral/view-collateral.component.ts b/src/app/products/collaterals/view-collateral/view-collateral.component.ts index a682e14b9..4a2136870 100644 --- a/src/app/products/collaterals/view-collateral/view-collateral.component.ts +++ b/src/app/products/collaterals/view-collateral/view-collateral.component.ts @@ -18,7 +18,6 @@ import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dial styleUrls: ['./view-collateral.component.scss'] }) export class ViewCollateralComponent { - /** Collateral Data */ collateralData: any; @@ -30,31 +29,31 @@ export class ViewCollateralComponent { * @param {MatDialog} dialog Dialog reference. * @param {TranslateService} translateService Translate Service. */ - constructor(private productsService: ProductsService, - private route: ActivatedRoute, - private router: Router, - private dialog: MatDialog, - private translateService: TranslateService) { - this.route.data.subscribe((data: { collateral: any }) => { - this.collateralData = data.collateral; - }); - } + constructor( + private productsService: ProductsService, + private route: ActivatedRoute, + private router: Router, + private dialog: MatDialog, + private translateService: TranslateService + ) { + this.route.data.subscribe((data: { collateral: any }) => { + this.collateralData = data.collateral; + }); + } /** * Deletes the collateral and redirects to collaterals */ deleteCollateral() { const deleteCollateralDialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: this.translateService.instant('labels.text.Collateral') + ' ' + this.collateralData.id} + data: { deleteContext: this.translateService.instant('labels.text.Collateral') + ' ' + this.collateralData.id } }); deleteCollateralDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.productsService.deleteCollateral(this.collateralData.id) - .subscribe(() => { - this.router.navigate(['/products/collaterals']); - }); + this.productsService.deleteCollateral(this.collateralData.id).subscribe(() => { + this.router.navigate(['/products/collaterals']); + }); } }); } - } diff --git a/src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.spec.ts b/src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.spec.ts index 5919a0925..09db4398d 100644 --- a/src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.spec.ts +++ b/src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('DepositProductIncentiveFormDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DepositProductIncentiveFormDialogComponent ] - }) - .compileComponents(); + declarations: [DepositProductIncentiveFormDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.ts b/src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.ts index d6a694b89..c8cad3a26 100644 --- a/src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.ts +++ b/src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.ts @@ -9,9 +9,8 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./deposit-product-incentive-form-dialog.component.scss'] }) export class DepositProductIncentiveFormDialogComponent implements OnInit { - layout: { - addButtonText?: string + addButtonText?: string; } = { addButtonText: 'Add' }; @@ -26,10 +25,12 @@ export class DepositProductIncentiveFormDialogComponent implements OnInit { attributeValueData: any; incentiveTypeData: any; - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any, - private formBuilder: UntypedFormBuilder, - private translateService: TranslateService) { + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any, + private formBuilder: UntypedFormBuilder, + private translateService: TranslateService + ) { this.createDepositProductIncentiveForm(); this.setConditionalControls(); this.layout = { ...this.layout, ...data.layout }; @@ -46,38 +47,54 @@ export class DepositProductIncentiveFormDialogComponent implements OnInit { if (this.data.values) { this.depositProductIncentiveForm.patchValue({ - 'entityType': this.data.values.entityType, - 'attributeName': this.data.values.attributeName, - 'conditionType': this.data.values.conditionType, - 'attributeValue': this.data.values.attributeValue, - 'incentiveType': this.data.values.incentiveType, - 'amount': this.data.values.amount + entityType: this.data.values.entityType, + attributeName: this.data.values.attributeName, + conditionType: this.data.values.conditionType, + attributeValue: this.data.values.attributeValue, + incentiveType: this.data.values.incentiveType, + amount: this.data.values.amount }); } else { this.depositProductIncentiveForm.patchValue({ - 'entityType': this.data.entityType + entityType: this.data.entityType }); } this.title = this.translateService.instant('labels.heading.Incentives'); } setConditionalControls() { - this.depositProductIncentiveForm.get('attributeName').valueChanges - .subscribe((attributeName: any) => { - this.depositProductIncentiveForm.patchValue({ 'attributeValue': '' }); - this.attributeValueData = this.data.chartTemplate[`${this.attributeNameData.find((option: any) => option.id === attributeName).code.split('.')[1]}Options`]; - }); + this.depositProductIncentiveForm.get('attributeName').valueChanges.subscribe((attributeName: any) => { + this.depositProductIncentiveForm.patchValue({ attributeValue: '' }); + this.attributeValueData = + this.data.chartTemplate[ + `${this.attributeNameData.find((option: any) => option.id === attributeName).code.split('.')[1]}Options` + ]; + }); } createDepositProductIncentiveForm() { this.depositProductIncentiveForm = this.formBuilder.group({ - 'entityType': [''], - 'attributeName': ['', Validators.required], - 'conditionType': ['', Validators.required], - 'attributeValue': ['', Validators.required], - 'incentiveType': ['', Validators.required], - 'amount': ['', Validators.required] + entityType: [''], + attributeName: [ + '', + Validators.required + ], + conditionType: [ + '', + Validators.required + ], + attributeValue: [ + '', + Validators.required + ], + incentiveType: [ + '', + Validators.required + ], + amount: [ + '', + Validators.required + ] }); } - } diff --git a/src/app/products/fixed-deposit-products/create-fixed-deposit-product/create-fixed-deposit-product.component.spec.ts b/src/app/products/fixed-deposit-products/create-fixed-deposit-product/create-fixed-deposit-product.component.spec.ts index c67397c8e..477c611fb 100644 --- a/src/app/products/fixed-deposit-products/create-fixed-deposit-product/create-fixed-deposit-product.component.spec.ts +++ b/src/app/products/fixed-deposit-products/create-fixed-deposit-product/create-fixed-deposit-product.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateFixedDepositProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateFixedDepositProductComponent ] - }) - .compileComponents(); + declarations: [CreateFixedDepositProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/create-fixed-deposit-product/create-fixed-deposit-product.component.ts b/src/app/products/fixed-deposit-products/create-fixed-deposit-product/create-fixed-deposit-product.component.ts index 25a705ac4..03ef8e17c 100644 --- a/src/app/products/fixed-deposit-products/create-fixed-deposit-product/create-fixed-deposit-product.component.ts +++ b/src/app/products/fixed-deposit-products/create-fixed-deposit-product/create-fixed-deposit-product.component.ts @@ -22,14 +22,20 @@ import { Accounting } from 'app/core/utils/accounting'; styleUrls: ['./create-fixed-deposit-product.component.scss'] }) export class CreateFixedDepositProductComponent { - - @ViewChild(FixedDepositProductDetailsStepComponent, { static: true }) fixedDepositProductDetailsStep: FixedDepositProductDetailsStepComponent; - @ViewChild(FixedDepositProductCurrencyStepComponent, { static: true }) fixedDepositProductCurrencyStep: FixedDepositProductCurrencyStepComponent; - @ViewChild(FixedDepositProductTermsStepComponent, { static: true }) fixedDepositProductTermsStep: FixedDepositProductTermsStepComponent; - @ViewChild(FixedDepositProductSettingsStepComponent, { static: true }) fixedDepositProductSettingsStep: FixedDepositProductSettingsStepComponent; - @ViewChild(FixedDepositProductInterestRateChartStepComponent, { static: true }) fixedDepositProductInterestRateChartStep: FixedDepositProductInterestRateChartStepComponent; - @ViewChild(FixedDepositProductChargesStepComponent, { static: true }) fixedDepositProductChargesStep: FixedDepositProductChargesStepComponent; - @ViewChild(FixedDepositProductAccountingStepComponent, { static: true }) fixedDepositProductAccountingStep: FixedDepositProductAccountingStepComponent; + @ViewChild(FixedDepositProductDetailsStepComponent, { static: true }) + fixedDepositProductDetailsStep: FixedDepositProductDetailsStepComponent; + @ViewChild(FixedDepositProductCurrencyStepComponent, { static: true }) + fixedDepositProductCurrencyStep: FixedDepositProductCurrencyStepComponent; + @ViewChild(FixedDepositProductTermsStepComponent, { static: true }) + fixedDepositProductTermsStep: FixedDepositProductTermsStepComponent; + @ViewChild(FixedDepositProductSettingsStepComponent, { static: true }) + fixedDepositProductSettingsStep: FixedDepositProductSettingsStepComponent; + @ViewChild(FixedDepositProductInterestRateChartStepComponent, { static: true }) + fixedDepositProductInterestRateChartStep: FixedDepositProductInterestRateChartStepComponent; + @ViewChild(FixedDepositProductChargesStepComponent, { static: true }) + fixedDepositProductChargesStep: FixedDepositProductChargesStepComponent; + @ViewChild(FixedDepositProductAccountingStepComponent, { static: true }) + fixedDepositProductAccountingStep: FixedDepositProductAccountingStepComponent; fixedDepositProductsTemplate: any; accountingRuleData: string[] = []; @@ -41,11 +47,13 @@ export class CreateFixedDepositProductComponent { * @param {SettingsService} settingsService Settings Service. */ - constructor(private route: ActivatedRoute, - private productsService: ProductsService, - private router: Router, - private settingsService: SettingsService, - private accounting: Accounting) { + constructor( + private route: ActivatedRoute, + private productsService: ProductsService, + private router: Router, + private settingsService: SettingsService, + private accounting: Accounting + ) { this.route.data.subscribe((data: { fixedDepositProductsTemplate: any }) => { this.fixedDepositProductsTemplate = data.fixedDepositProductsTemplate; }); @@ -107,10 +115,14 @@ export class CreateFixedDepositProductComponent { locale: this.settingsService.language.code // locale required for depositAmount }; delete fixedDepositProduct.advancedAccountingRules; - this.productsService.createFixedDepositProduct(fixedDepositProduct) - .subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); - }); + this.productsService.createFixedDepositProduct(fixedDepositProduct).subscribe((response: any) => { + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); + }); } - } diff --git a/src/app/products/fixed-deposit-products/edit-fixed-deposit-product/edit-fixed-deposit-product.component.spec.ts b/src/app/products/fixed-deposit-products/edit-fixed-deposit-product/edit-fixed-deposit-product.component.spec.ts index f796f3055..f9e598ee7 100644 --- a/src/app/products/fixed-deposit-products/edit-fixed-deposit-product/edit-fixed-deposit-product.component.spec.ts +++ b/src/app/products/fixed-deposit-products/edit-fixed-deposit-product/edit-fixed-deposit-product.component.spec.ts @@ -8,9 +8,8 @@ describe('EditFixedDepositProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditFixedDepositProductComponent ] - }) - .compileComponents(); + declarations: [EditFixedDepositProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/edit-fixed-deposit-product/edit-fixed-deposit-product.component.ts b/src/app/products/fixed-deposit-products/edit-fixed-deposit-product/edit-fixed-deposit-product.component.ts index 5b7dc47ab..7e864812f 100644 --- a/src/app/products/fixed-deposit-products/edit-fixed-deposit-product/edit-fixed-deposit-product.component.ts +++ b/src/app/products/fixed-deposit-products/edit-fixed-deposit-product/edit-fixed-deposit-product.component.ts @@ -22,14 +22,20 @@ import { Accounting } from 'app/core/utils/accounting'; styleUrls: ['./edit-fixed-deposit-product.component.scss'] }) export class EditFixedDepositProductComponent { - - @ViewChild(FixedDepositProductDetailsStepComponent, { static: true }) fixedDepositProductDetailsStep: FixedDepositProductDetailsStepComponent; - @ViewChild(FixedDepositProductCurrencyStepComponent, { static: true }) fixedDepositProductCurrencyStep: FixedDepositProductCurrencyStepComponent; - @ViewChild(FixedDepositProductTermsStepComponent, { static: true }) fixedDepositProductTermsStep: FixedDepositProductTermsStepComponent; - @ViewChild(FixedDepositProductSettingsStepComponent, { static: true }) fixedDepositProductSettingsStep: FixedDepositProductSettingsStepComponent; - @ViewChild(FixedDepositProductInterestRateChartStepComponent, { static: true }) fixedDepositProductInterestRateChartStep: FixedDepositProductInterestRateChartStepComponent; - @ViewChild(FixedDepositProductChargesStepComponent, { static: true }) fixedDepositProductChargesStep: FixedDepositProductChargesStepComponent; - @ViewChild(FixedDepositProductAccountingStepComponent, { static: true }) fixedDepositProductAccountingStep: FixedDepositProductAccountingStepComponent; + @ViewChild(FixedDepositProductDetailsStepComponent, { static: true }) + fixedDepositProductDetailsStep: FixedDepositProductDetailsStepComponent; + @ViewChild(FixedDepositProductCurrencyStepComponent, { static: true }) + fixedDepositProductCurrencyStep: FixedDepositProductCurrencyStepComponent; + @ViewChild(FixedDepositProductTermsStepComponent, { static: true }) + fixedDepositProductTermsStep: FixedDepositProductTermsStepComponent; + @ViewChild(FixedDepositProductSettingsStepComponent, { static: true }) + fixedDepositProductSettingsStep: FixedDepositProductSettingsStepComponent; + @ViewChild(FixedDepositProductInterestRateChartStepComponent, { static: true }) + fixedDepositProductInterestRateChartStep: FixedDepositProductInterestRateChartStepComponent; + @ViewChild(FixedDepositProductChargesStepComponent, { static: true }) + fixedDepositProductChargesStep: FixedDepositProductChargesStepComponent; + @ViewChild(FixedDepositProductAccountingStepComponent, { static: true }) + fixedDepositProductAccountingStep: FixedDepositProductAccountingStepComponent; fixedDepositProductsTemplate: any; accountingRuleData: string[] = []; @@ -41,11 +47,13 @@ export class EditFixedDepositProductComponent { * @param {SettingsService} settingsService Settings Service */ - constructor(private route: ActivatedRoute, - private productsService: ProductsService, - private router: Router, - private settingsService: SettingsService, - private accounting: Accounting) { + constructor( + private route: ActivatedRoute, + private productsService: ProductsService, + private router: Router, + private settingsService: SettingsService, + private accounting: Accounting + ) { this.route.data.subscribe((data: { fixedDepositProductAndTemplate: any }) => { this.fixedDepositProductsTemplate = data.fixedDepositProductAndTemplate; }); @@ -84,14 +92,12 @@ export class EditFixedDepositProductComponent { this.fixedDepositProductSettingsForm.valid && this.fixedDepositProductInterestRateChartForm.valid && this.fixedDepositProductAccountingForm.valid && - ( - this.fixedDepositProductDetailsForm.pristine || + (this.fixedDepositProductDetailsForm.pristine || this.fixedDepositProductCurrencyForm.pristine || this.fixedDepositProductTermsForm.pristine || this.fixedDepositProductSettingsForm.pristine || this.fixedDepositProductInterestRateChartForm.pristine || - this.fixedDepositProductAccountingForm.pristine - ) + this.fixedDepositProductAccountingForm.pristine) ); } @@ -129,10 +135,10 @@ export class EditFixedDepositProductComponent { fixedDepositProduct.charts = charts; delete fixedDepositProduct.advancedAccountingRules; - this.productsService.updateFixedDepositProduct(this.fixedDepositProductsTemplate.id, fixedDepositProduct) + this.productsService + .updateFixedDepositProduct(this.fixedDepositProductsTemplate.id, fixedDepositProduct) .subscribe((response: any) => { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/products/fixed-deposit-products/edit-fixed-deposit-product/fixed-deposit-product-and-template.resolver.ts b/src/app/products/fixed-deposit-products/edit-fixed-deposit-product/fixed-deposit-product-and-template.resolver.ts index 90dd7fc34..5db55fcbc 100644 --- a/src/app/products/fixed-deposit-products/edit-fixed-deposit-product/fixed-deposit-product-and-template.resolver.ts +++ b/src/app/products/fixed-deposit-products/edit-fixed-deposit-product/fixed-deposit-product-and-template.resolver.ts @@ -13,11 +13,10 @@ import { ProductsService } from '../../products.service'; */ @Injectable() export class FixedDepositProductAndTemplateResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ - constructor(private productsService: ProductsService) { } + constructor(private productsService: ProductsService) {} /** * Returns the Fixed Deposits Product and Template. @@ -28,5 +27,4 @@ export class FixedDepositProductAndTemplateResolver implements Resolve { const productId = route.parent.paramMap.get('productId'); return this.productsService.getFixedDepositProductAndTemplate(productId); } - } diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-accounting-step/fixed-deposit-product-accounting-step.component.spec.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-accounting-step/fixed-deposit-product-accounting-step.component.spec.ts index 043c298eb..7f73c1b9e 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-accounting-step/fixed-deposit-product-accounting-step.component.spec.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-accounting-step/fixed-deposit-product-accounting-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositProductAccountingStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositProductAccountingStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositProductAccountingStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-accounting-step/fixed-deposit-product-accounting-step.component.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-accounting-step/fixed-deposit-product-accounting-step.component.ts index 85724594b..6bd442e9e 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-accounting-step/fixed-deposit-product-accounting-step.component.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-accounting-step/fixed-deposit-product-accounting-step.component.ts @@ -16,7 +16,6 @@ import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base'; styleUrls: ['./fixed-deposit-product-accounting-step.component.scss'] }) export class FixedDepositProductAccountingStepComponent implements OnInit { - @Input() fixedDepositProductsTemplate: any; @Input() accountingRuleData: any; @Input() fixedDepositProductFormValid: boolean; @@ -31,13 +30,23 @@ export class FixedDepositProductAccountingStepComponent implements OnInit { expenseAccountData: any; liabilityAccountData: any; - paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId', 'actions']; - feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId', 'actions']; + paymentFundSourceDisplayedColumns: string[] = [ + 'paymentTypeId', + 'fundSourceAccountId', + 'actions' + ]; + feesPenaltyIncomeDisplayedColumns: string[] = [ + 'chargeId', + 'incomeAccountId', + 'actions' + ]; - constructor(private formBuilder: UntypedFormBuilder, - public dialog: MatDialog, - private accounting: Accounting, - private translateService: TranslateService) { + constructor( + private formBuilder: UntypedFormBuilder, + public dialog: MatDialog, + private accounting: Accounting, + private translateService: TranslateService + ) { this.createfixedDepositProductAccountingForm(); this.setConditionalControls(); } @@ -49,7 +58,8 @@ export class FixedDepositProductAccountingStepComponent implements OnInit { this.assetAccountData = this.fixedDepositProductsTemplate.accountingMappingOptions.assetAccountOptions || []; this.incomeAccountData = this.fixedDepositProductsTemplate.accountingMappingOptions.incomeAccountOptions || []; this.expenseAccountData = this.fixedDepositProductsTemplate.accountingMappingOptions.expenseAccountOptions || []; - this.liabilityAccountData = this.fixedDepositProductsTemplate.accountingMappingOptions.liabilityAccountOptions || []; + this.liabilityAccountData = + this.fixedDepositProductsTemplate.accountingMappingOptions.liabilityAccountOptions || []; if (!(this.fixedDepositProductsTemplate === undefined) && this.fixedDepositProductsTemplate.id) { this.assignAccountingStepData(); } @@ -57,121 +67,191 @@ export class FixedDepositProductAccountingStepComponent implements OnInit { assignAccountingStepData() { this.fixedDepositProductAccountingForm.patchValue({ - 'accountingRule': this.fixedDepositProductsTemplate.accountingRule.id + accountingRule: this.fixedDepositProductsTemplate.accountingRule.id }); if (this.isCashOrAccrualAccounting()) { this.fixedDepositProductAccountingForm.patchValue({ - 'savingsReferenceAccountId': this.fixedDepositProductsTemplate.accountingMappings.savingsReferenceAccount.id, - 'savingsControlAccountId': this.fixedDepositProductsTemplate.accountingMappings.savingsControlAccount.id, - 'transfersInSuspenseAccountId': this.fixedDepositProductsTemplate.accountingMappings.transfersInSuspenseAccount.id, - 'incomeFromFeeAccountId': this.fixedDepositProductsTemplate.accountingMappings.incomeFromFeeAccount.id, - 'incomeFromPenaltyAccountId': this.fixedDepositProductsTemplate.accountingMappings.incomeFromPenaltyAccount.id, - 'interestOnSavingsAccountId': this.fixedDepositProductsTemplate.accountingMappings.interestOnSavingsAccount.id + savingsReferenceAccountId: this.fixedDepositProductsTemplate.accountingMappings.savingsReferenceAccount.id, + savingsControlAccountId: this.fixedDepositProductsTemplate.accountingMappings.savingsControlAccount.id, + transfersInSuspenseAccountId: + this.fixedDepositProductsTemplate.accountingMappings.transfersInSuspenseAccount.id, + incomeFromFeeAccountId: this.fixedDepositProductsTemplate.accountingMappings.incomeFromFeeAccount.id, + incomeFromPenaltyAccountId: this.fixedDepositProductsTemplate.accountingMappings.incomeFromPenaltyAccount.id, + interestOnSavingsAccountId: this.fixedDepositProductsTemplate.accountingMappings.interestOnSavingsAccount.id }); if (this.isAccrualAccounting()) { this.fixedDepositProductAccountingForm.patchValue({ - 'feesReceivableAccountId': this.fixedDepositProductsTemplate.accountingMappings.feeReceivableAccount.id, - 'penaltiesReceivableAccountId': this.fixedDepositProductsTemplate.accountingMappings.penaltyReceivableAccount.id, - 'interestPayableAccountId': this.fixedDepositProductsTemplate.accountingMappings.interestPayableAccount.id + feesReceivableAccountId: this.fixedDepositProductsTemplate.accountingMappings.feeReceivableAccount.id, + penaltiesReceivableAccountId: + this.fixedDepositProductsTemplate.accountingMappings.penaltyReceivableAccount.id, + interestPayableAccountId: this.fixedDepositProductsTemplate.accountingMappings.interestPayableAccount.id }); } - if (this.fixedDepositProductsTemplate.paymentChannelToFundSourceMappings || this.fixedDepositProductsTemplate.feeToIncomeAccountMappings || this.fixedDepositProductsTemplate.penaltyToIncomeAccountMappings) { + if ( + this.fixedDepositProductsTemplate.paymentChannelToFundSourceMappings || + this.fixedDepositProductsTemplate.feeToIncomeAccountMappings || + this.fixedDepositProductsTemplate.penaltyToIncomeAccountMappings + ) { this.fixedDepositProductAccountingForm.patchValue({ - 'advancedAccountingRules': true + advancedAccountingRules: true }); } if (this.fixedDepositProductsTemplate.paymentChannelToFundSourceMappings) { - this.fixedDepositProductsTemplate.paymentChannelToFundSourceMappings.forEach((paymentChannelToFundSourceMapping: any) => { - const paymentChannelToFundSourceMappingData = this.formBuilder.group({ - paymentTypeId: [paymentChannelToFundSourceMapping.paymentType.id, Validators.required], - fundSourceAccountId: [paymentChannelToFundSourceMapping.fundSourceAccount.id, Validators.required] - }); - const formArray = this.fixedDepositProductAccountingForm.controls['paymentChannelToFundSourceMappings'] as UntypedFormArray; - formArray.push(paymentChannelToFundSourceMappingData); - }); + this.fixedDepositProductsTemplate.paymentChannelToFundSourceMappings.forEach( + (paymentChannelToFundSourceMapping: any) => { + const paymentChannelToFundSourceMappingData = this.formBuilder.group({ + paymentTypeId: [ + paymentChannelToFundSourceMapping.paymentType.id, + Validators.required + ], + fundSourceAccountId: [ + paymentChannelToFundSourceMapping.fundSourceAccount.id, + Validators.required + ] + }); + const formArray = this.fixedDepositProductAccountingForm.controls[ + 'paymentChannelToFundSourceMappings' + ] as UntypedFormArray; + formArray.push(paymentChannelToFundSourceMappingData); + } + ); } if (this.fixedDepositProductsTemplate.feeToIncomeAccountMappings) { this.fixedDepositProductsTemplate.feeToIncomeAccountMappings.forEach((feeToIncomeAccountMapping: any) => { const feeToIncomeAccountMappingData = this.formBuilder.group({ - chargeId: [feeToIncomeAccountMapping.charge.id, Validators.required], - incomeAccountId: [feeToIncomeAccountMapping.incomeAccount.id, Validators.required] + chargeId: [ + feeToIncomeAccountMapping.charge.id, + Validators.required + ], + incomeAccountId: [ + feeToIncomeAccountMapping.incomeAccount.id, + Validators.required + ] }); - const formArray = this.fixedDepositProductAccountingForm.controls['feeToIncomeAccountMappings'] as UntypedFormArray; + const formArray = this.fixedDepositProductAccountingForm.controls[ + 'feeToIncomeAccountMappings' + ] as UntypedFormArray; formArray.push(feeToIncomeAccountMappingData); }); } if (this.fixedDepositProductsTemplate.penaltyToIncomeAccountMappings) { - this.fixedDepositProductsTemplate.penaltyToIncomeAccountMappings.forEach((penaltyToIncomeAccountMapping: any) => { - const penaltyToIncomeAccountMappingData = this.formBuilder.group({ - chargeId: [penaltyToIncomeAccountMapping.charge.id, Validators.required], - incomeAccountId: [penaltyToIncomeAccountMapping.incomeAccount.id, Validators.required] - }); - const formArray = this.fixedDepositProductAccountingForm.controls['penaltyToIncomeAccountMappings'] as UntypedFormArray; - formArray.push(penaltyToIncomeAccountMappingData); - }); + this.fixedDepositProductsTemplate.penaltyToIncomeAccountMappings.forEach( + (penaltyToIncomeAccountMapping: any) => { + const penaltyToIncomeAccountMappingData = this.formBuilder.group({ + chargeId: [ + penaltyToIncomeAccountMapping.charge.id, + Validators.required + ], + incomeAccountId: [ + penaltyToIncomeAccountMapping.incomeAccount.id, + Validators.required + ] + }); + const formArray = this.fixedDepositProductAccountingForm.controls[ + 'penaltyToIncomeAccountMappings' + ] as UntypedFormArray; + formArray.push(penaltyToIncomeAccountMappingData); + } + ); } } } createfixedDepositProductAccountingForm() { this.fixedDepositProductAccountingForm = this.formBuilder.group({ - 'accountingRule': [1] + accountingRule: [1] }); } existCharges(): boolean { - return (this.chargeData.length > 0); + return this.chargeData.length > 0; } setConditionalControls() { - this.fixedDepositProductAccountingForm.get('accountingRule').valueChanges - .subscribe((accountingRule: any) => { - if (accountingRule === 2 || accountingRule === 3) { - this.fixedDepositProductAccountingForm.addControl('savingsReferenceAccountId', new UntypedFormControl('', Validators.required)); - this.fixedDepositProductAccountingForm.addControl('savingsControlAccountId', new UntypedFormControl('', Validators.required)); - this.fixedDepositProductAccountingForm.addControl('transfersInSuspenseAccountId', new UntypedFormControl('', Validators.required)); - this.fixedDepositProductAccountingForm.addControl('interestOnSavingsAccountId', new UntypedFormControl('', Validators.required)); - this.fixedDepositProductAccountingForm.addControl('incomeFromFeeAccountId', new UntypedFormControl('', Validators.required)); - this.fixedDepositProductAccountingForm.addControl('incomeFromPenaltyAccountId', new UntypedFormControl('', Validators.required)); - this.fixedDepositProductAccountingForm.addControl('advancedAccountingRules', new UntypedFormControl(false)); + this.fixedDepositProductAccountingForm.get('accountingRule').valueChanges.subscribe((accountingRule: any) => { + if (accountingRule === 2 || accountingRule === 3) { + this.fixedDepositProductAccountingForm.addControl( + 'savingsReferenceAccountId', + new UntypedFormControl('', Validators.required) + ); + this.fixedDepositProductAccountingForm.addControl( + 'savingsControlAccountId', + new UntypedFormControl('', Validators.required) + ); + this.fixedDepositProductAccountingForm.addControl( + 'transfersInSuspenseAccountId', + new UntypedFormControl('', Validators.required) + ); + this.fixedDepositProductAccountingForm.addControl( + 'interestOnSavingsAccountId', + new UntypedFormControl('', Validators.required) + ); + this.fixedDepositProductAccountingForm.addControl( + 'incomeFromFeeAccountId', + new UntypedFormControl('', Validators.required) + ); + this.fixedDepositProductAccountingForm.addControl( + 'incomeFromPenaltyAccountId', + new UntypedFormControl('', Validators.required) + ); + this.fixedDepositProductAccountingForm.addControl('advancedAccountingRules', new UntypedFormControl(false)); - if (accountingRule === 3) { - this.fixedDepositProductAccountingForm.addControl('feesReceivableAccountId', new UntypedFormControl('', Validators.required)); - this.fixedDepositProductAccountingForm.addControl('penaltiesReceivableAccountId', new UntypedFormControl('', Validators.required)); - this.fixedDepositProductAccountingForm.addControl('interestPayableAccountId', new UntypedFormControl('', Validators.required)); - } - - this.fixedDepositProductAccountingForm.get('advancedAccountingRules').valueChanges - .subscribe((advancedAccountingRules: boolean) => { - if (advancedAccountingRules) { - this.fixedDepositProductAccountingForm.addControl('paymentChannelToFundSourceMappings', this.formBuilder.array([])); - this.fixedDepositProductAccountingForm.addControl('feeToIncomeAccountMappings', this.formBuilder.array([])); - this.fixedDepositProductAccountingForm.addControl('penaltyToIncomeAccountMappings', this.formBuilder.array([])); - } else { - this.fixedDepositProductAccountingForm.removeControl('paymentChannelToFundSourceMappings'); - this.fixedDepositProductAccountingForm.removeControl('feeToIncomeAccountMappings'); - this.fixedDepositProductAccountingForm.removeControl('penaltyToIncomeAccountMappings'); - } - }); - } else { - this.fixedDepositProductAccountingForm.removeControl('savingsReferenceAccountId'); - this.fixedDepositProductAccountingForm.removeControl('overdraftPortfolioControlId'); - this.fixedDepositProductAccountingForm.removeControl('savingsControlAccountId'); - this.fixedDepositProductAccountingForm.removeControl('transfersInSuspenseAccountId'); - this.fixedDepositProductAccountingForm.removeControl('interestOnSavingsAccountId'); - this.fixedDepositProductAccountingForm.removeControl('writeOffAccountId'); - this.fixedDepositProductAccountingForm.removeControl('incomeFromFeeAccountId'); - this.fixedDepositProductAccountingForm.removeControl('incomeFromPenaltyAccountId'); - this.fixedDepositProductAccountingForm.removeControl('incomeFromInterestId'); - this.fixedDepositProductAccountingForm.removeControl('advancedAccountingRules'); - this.fixedDepositProductAccountingForm.removeControl('escheatLiabilityId'); - this.fixedDepositProductAccountingForm.removeControl('feesReceivableAccountId'); - this.fixedDepositProductAccountingForm.removeControl('penaltiesReceivableAccountId'); - this.fixedDepositProductAccountingForm.removeControl('interestPayableAccountId'); + if (accountingRule === 3) { + this.fixedDepositProductAccountingForm.addControl( + 'feesReceivableAccountId', + new UntypedFormControl('', Validators.required) + ); + this.fixedDepositProductAccountingForm.addControl( + 'penaltiesReceivableAccountId', + new UntypedFormControl('', Validators.required) + ); + this.fixedDepositProductAccountingForm.addControl( + 'interestPayableAccountId', + new UntypedFormControl('', Validators.required) + ); } - }); + + this.fixedDepositProductAccountingForm + .get('advancedAccountingRules') + .valueChanges.subscribe((advancedAccountingRules: boolean) => { + if (advancedAccountingRules) { + this.fixedDepositProductAccountingForm.addControl( + 'paymentChannelToFundSourceMappings', + this.formBuilder.array([]) + ); + this.fixedDepositProductAccountingForm.addControl( + 'feeToIncomeAccountMappings', + this.formBuilder.array([]) + ); + this.fixedDepositProductAccountingForm.addControl( + 'penaltyToIncomeAccountMappings', + this.formBuilder.array([]) + ); + } else { + this.fixedDepositProductAccountingForm.removeControl('paymentChannelToFundSourceMappings'); + this.fixedDepositProductAccountingForm.removeControl('feeToIncomeAccountMappings'); + this.fixedDepositProductAccountingForm.removeControl('penaltyToIncomeAccountMappings'); + } + }); + } else { + this.fixedDepositProductAccountingForm.removeControl('savingsReferenceAccountId'); + this.fixedDepositProductAccountingForm.removeControl('overdraftPortfolioControlId'); + this.fixedDepositProductAccountingForm.removeControl('savingsControlAccountId'); + this.fixedDepositProductAccountingForm.removeControl('transfersInSuspenseAccountId'); + this.fixedDepositProductAccountingForm.removeControl('interestOnSavingsAccountId'); + this.fixedDepositProductAccountingForm.removeControl('writeOffAccountId'); + this.fixedDepositProductAccountingForm.removeControl('incomeFromFeeAccountId'); + this.fixedDepositProductAccountingForm.removeControl('incomeFromPenaltyAccountId'); + this.fixedDepositProductAccountingForm.removeControl('incomeFromInterestId'); + this.fixedDepositProductAccountingForm.removeControl('advancedAccountingRules'); + this.fixedDepositProductAccountingForm.removeControl('escheatLiabilityId'); + this.fixedDepositProductAccountingForm.removeControl('feesReceivableAccountId'); + this.fixedDepositProductAccountingForm.removeControl('penaltiesReceivableAccountId'); + this.fixedDepositProductAccountingForm.removeControl('interestPayableAccountId'); + } + }); } get paymentChannelToFundSourceMappings(): UntypedFormArray { @@ -219,9 +299,18 @@ export class FixedDepositProductAccountingStepComponent implements OnInit { getData(formType: string, values?: any) { switch (formType) { - case 'PaymentFundSource': return { title: 'Configure Fund Sources for Payment Channels', formfields: this.getPaymentFundSourceFormfields(values) }; - case 'FeesIncome': return { title: 'Map Fees to Income Accounts', formfields: this.getFeesIncomeFormfields(values) }; - case 'PenaltyIncome': return { title: 'Map Penalties to Specific Income Accounts', formfields: this.getPenaltyIncomeFormfields(values) }; + case 'PaymentFundSource': + return { + title: 'Configure Fund Sources for Payment Channels', + formfields: this.getPaymentFundSourceFormfields(values) + }; + case 'FeesIncome': + return { title: 'Map Fees to Income Accounts', formfields: this.getFeesIncomeFormfields(values) }; + case 'PenaltyIncome': + return { + title: 'Map Penalties to Specific Income Accounts', + formfields: this.getPenaltyIncomeFormfields(values) + }; } } @@ -243,6 +332,7 @@ export class FixedDepositProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -265,6 +355,7 @@ export class FixedDepositProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -287,6 +378,7 @@ export class FixedDepositProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -302,5 +394,4 @@ export class FixedDepositProductAccountingStepComponent implements OnInit { isAccrualAccounting(): boolean { return this.accounting.isAccrualAccountingRuleId(this.fixedDepositProductAccountingForm.value.accountingRule); } - } diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-charges-step/fixed-deposit-product-charges-step.component.spec.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-charges-step/fixed-deposit-product-charges-step.component.spec.ts index c255d7a5c..8c2c87d78 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-charges-step/fixed-deposit-product-charges-step.component.spec.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-charges-step/fixed-deposit-product-charges-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositProductChargesStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositProductChargesStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositProductChargesStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-charges-step/fixed-deposit-product-charges-step.component.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-charges-step/fixed-deposit-product-charges-step.component.ts index e27a36fc1..9f8b3cdee 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-charges-step/fixed-deposit-product-charges-step.component.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-charges-step/fixed-deposit-product-charges-step.component.ts @@ -11,18 +11,24 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./fixed-deposit-product-charges-step.component.scss'] }) export class FixedDepositProductChargesStepComponent implements OnInit { - @Input() fixedDepositProductsTemplate: any; @Input() currencyCode: UntypedFormControl; chargeData: any; chargesDataSource: {}[]; - displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'action']; + displayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'action' + ]; - constructor(public dialog: MatDialog, - private translateService: TranslateService) { - } + constructor( + public dialog: MatDialog, + private translateService: TranslateService + ) {} ngOnInit() { this.chargeData = this.fixedDepositProductsTemplate.chargeOptions; @@ -31,7 +37,7 @@ export class FixedDepositProductChargesStepComponent implements OnInit { } else { this.chargesDataSource = []; } - this.currencyCode.valueChanges.subscribe(() => this.chargesDataSource = []); + this.currencyCode.valueChanges.subscribe(() => (this.chargesDataSource = [])); } addCharge(charge: any) { @@ -56,5 +62,4 @@ export class FixedDepositProductChargesStepComponent implements OnInit { charges: this.chargesDataSource }; } - } diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-currency-step/fixed-deposit-product-currency-step.component.spec.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-currency-step/fixed-deposit-product-currency-step.component.spec.ts index c652db487..6ae6d8e65 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-currency-step/fixed-deposit-product-currency-step.component.spec.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-currency-step/fixed-deposit-product-currency-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositProductCurrencyStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositProductCurrencyStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositProductCurrencyStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-currency-step/fixed-deposit-product-currency-step.component.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-currency-step/fixed-deposit-product-currency-step.component.ts index b596c001d..c4bfb8b50 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-currency-step/fixed-deposit-product-currency-step.component.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-currency-step/fixed-deposit-product-currency-step.component.ts @@ -7,7 +7,6 @@ import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms styleUrls: ['./fixed-deposit-product-currency-step.component.scss'] }) export class FixedDepositProductCurrencyStepComponent implements OnInit { - @Input() fixedDepositProductsTemplate: any; fixedDepositProductCurrencyForm: UntypedFormGroup; @@ -23,28 +22,33 @@ export class FixedDepositProductCurrencyStepComponent implements OnInit { if (!(this.fixedDepositProductsTemplate === undefined) && this.fixedDepositProductsTemplate.id) { this.fixedDepositProductCurrencyForm.patchValue({ - 'currencyCode': this.fixedDepositProductsTemplate.currency.code, - 'digitsAfterDecimal': this.fixedDepositProductsTemplate.currency.decimalPlaces, - 'inMultiplesOf': this.fixedDepositProductsTemplate.currency.inMultiplesOf + currencyCode: this.fixedDepositProductsTemplate.currency.code, + digitsAfterDecimal: this.fixedDepositProductsTemplate.currency.decimalPlaces, + inMultiplesOf: this.fixedDepositProductsTemplate.currency.inMultiplesOf }); } else { this.fixedDepositProductCurrencyForm.patchValue({ - 'currencyCode': this.currencyData[0].code, - 'digitsAfterDecimal': 2 + currencyCode: this.currencyData[0].code, + digitsAfterDecimal: 2 }); } } createFixedDepositProductCurrencyForm() { this.fixedDepositProductCurrencyForm = this.formBuilder.group({ - 'currencyCode': ['', Validators.required], - 'digitsAfterDecimal': ['', Validators.required], - 'inMultiplesOf': [''] + currencyCode: [ + '', + Validators.required + ], + digitsAfterDecimal: [ + '', + Validators.required + ], + inMultiplesOf: [''] }); } get fixedDepositProductCurrency() { return this.fixedDepositProductCurrencyForm.value; } - } diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-details-step/fixed-deposit-product-details-step.component.spec.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-details-step/fixed-deposit-product-details-step.component.spec.ts index 2ccd0b025..4f8669985 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-details-step/fixed-deposit-product-details-step.component.spec.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-details-step/fixed-deposit-product-details-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositProductDetailsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositProductDetailsStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositProductDetailsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-details-step/fixed-deposit-product-details-step.component.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-details-step/fixed-deposit-product-details-step.component.ts index 43ffca9ce..76b4d021c 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-details-step/fixed-deposit-product-details-step.component.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-details-step/fixed-deposit-product-details-step.component.ts @@ -7,7 +7,6 @@ import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms styleUrls: ['./fixed-deposit-product-details-step.component.scss'] }) export class FixedDepositProductDetailsStepComponent implements OnInit { - @Input() fixedDepositProductsTemplate: any; fixedDepositProductDetailsForm: UntypedFormGroup; @@ -19,23 +18,31 @@ export class FixedDepositProductDetailsStepComponent implements OnInit { ngOnInit() { if (!(this.fixedDepositProductsTemplate === undefined) && this.fixedDepositProductsTemplate.id) { this.fixedDepositProductDetailsForm.patchValue({ - 'name': this.fixedDepositProductsTemplate.name, - 'shortName': this.fixedDepositProductsTemplate.shortName, - 'description': this.fixedDepositProductsTemplate.description, + name: this.fixedDepositProductsTemplate.name, + shortName: this.fixedDepositProductsTemplate.shortName, + description: this.fixedDepositProductsTemplate.description }); } } createFixedDepositProductDetailsForm() { this.fixedDepositProductDetailsForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'shortName': ['', Validators.required], - 'description': ['', Validators.required] + name: [ + '', + Validators.required + ], + shortName: [ + '', + Validators.required + ], + description: [ + '', + Validators.required + ] }); } get fixedDepositProductDetails() { return this.fixedDepositProductDetailsForm.value; } - } diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.spec.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.spec.ts index 21f54d656..4eb62ac2d 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.spec.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositProductInterestRateChartStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositProductInterestRateChartStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositProductInterestRateChartStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.ts index 1fb334d88..a7766ee46 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.ts @@ -27,12 +27,11 @@ import { SettingsService } from 'app/settings/settings.service'; trigger('expandChartSlab', [ state('collapsed', style({ height: '0px', minHeight: '0' })), state('expanded', style({ height: '*' })), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')) - ]) + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + ] }) export class FixedDepositProductInterestRateChartStepComponent implements OnInit { - @Input() fixedDepositProductsTemplate: any; fixedDepositProductInterestRateChartForm: UntypedFormGroup; @@ -48,7 +47,15 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit chartSlabsDisplayedColumns: any[] = []; chartSlabsIncentivesDisplayedColumns: string[] = ['incentives']; - incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount', 'actions']; + incentivesDisplayedColumns: string[] = [ + 'entityType', + 'attributeName', + 'conditionType', + 'attributeValue', + 'incentiveType', + 'amount', + 'actions' + ]; minDate = new Date(2000, 0, 1); maxDate = new Date(new Date().setFullYear(new Date().getFullYear() + 10)); @@ -64,11 +71,13 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit * @param {SettingsService} settingsService Settings Service. */ - constructor(private formBuilder: UntypedFormBuilder, - public dialog: MatDialog, - private dateUtils: Dates, - private settingsService: SettingsService, - private translateService: TranslateService) { + constructor( + private formBuilder: UntypedFormBuilder, + public dialog: MatDialog, + private dateUtils: Dates, + private settingsService: SettingsService, + private translateService: TranslateService + ) { this.createFixedDepositProductInterestRateChartForm(); } @@ -103,23 +112,33 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit // Iterates for every chart in charts this.charts.controls.forEach((chartDetailControl: UntypedFormGroup, i: number) => { - if (!this.chartsDetail[i]) { return; } // Iterate for every chartSlab in chart this.chartsDetail[i].chartSlabs.forEach((chartSlabDetail: any, j: number) => { - const chartSlabInfo = this.formBuilder.group({ id: [chartSlabDetail.id], amountRangeFrom: [chartSlabDetail.amountRangeFrom || ''], amountRangeTo: [chartSlabDetail.amountRangeTo || ''], - annualInterestRate: [chartSlabDetail.annualInterestRate, Validators.required], - description: [chartSlabDetail.description, Validators.required], - fromPeriod: [chartSlabDetail.fromPeriod, Validators.required], + annualInterestRate: [ + chartSlabDetail.annualInterestRate, + Validators.required + ], + description: [ + chartSlabDetail.description, + Validators.required + ], + fromPeriod: [ + chartSlabDetail.fromPeriod, + Validators.required + ], toPeriod: [chartSlabDetail.toPeriod || ''], - periodType: [chartSlabDetail.periodType, Validators.required], + periodType: [ + chartSlabDetail.periodType, + Validators.required + ], incentives: this.formBuilder.array([]) }); const formArray = chartDetailControl.controls['chartSlabs'] as UntypedFormArray; @@ -131,19 +150,35 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit // Iterate to input all the incentive for particular chart slab this.chartsDetail[i].chartSlabs[j].incentives.forEach((chartIncentiveDetail: any) => { const incentiveInfo = this.formBuilder.group({ - amount: [chartIncentiveDetail.amount, Validators.required], - attributeName: [chartIncentiveDetail.attributeName, Validators.required], - attribureValue: [chartIncentiveDetail.attribureValue, Validators.required], - conditionType: [chartIncentiveDetail.conditionType, Validators.required], - entityType: [chartIncentiveDetail.entityType, Validators.required], - incentiveType: [chartIncentiveDetail.incentiveType, Validators.required] + amount: [ + chartIncentiveDetail.amount, + Validators.required + ], + attributeName: [ + chartIncentiveDetail.attributeName, + Validators.required + ], + attribureValue: [ + chartIncentiveDetail.attribureValue, + Validators.required + ], + conditionType: [ + chartIncentiveDetail.conditionType, + Validators.required + ], + entityType: [ + chartIncentiveDetail.entityType, + Validators.required + ], + incentiveType: [ + chartIncentiveDetail.incentiveType, + Validators.required + ] }); const newFormArray = chartIncentiveControl['controls']['incentives'] as UntypedFormArray; newFormArray.push(incentiveInfo); }); - }); - }); } @@ -163,7 +198,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit this.chartsDetail.push(chart); }); this.fixedDepositProductInterestRateChartForm.patchValue({ - 'charts': this.chartsDetail + charts: this.chartsDetail }); } @@ -213,7 +248,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit attributeValue: incentiveData.attributeValue, conditionType: incentiveData.conditionType, entityType: incentiveData.entityType, - incentiveType: incentiveData.incentiveType, + incentiveType: incentiveData.incentiveType }; incentives.push(incentive); }); @@ -223,7 +258,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit createFixedDepositProductInterestRateChartForm() { this.fixedDepositProductInterestRateChartForm = this.formBuilder.group({ - 'charts': this.formBuilder.array([]) + charts: this.formBuilder.array([]) }); } @@ -233,13 +268,16 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit createChartForm(): UntypedFormGroup { return this.formBuilder.group({ - 'id': [null], - 'name': [''], - 'description': [''], - 'fromDate': ['', Validators.required], - 'endDate': [''], - 'isPrimaryGroupingByAmount': [false], - 'chartSlabs': this.formBuilder.array([], Validators.required) + id: [null], + name: [''], + description: [''], + fromDate: [ + '', + Validators.required + ], + endDate: [''], + isPrimaryGroupingByAmount: [false], + chartSlabs: this.formBuilder.array([], Validators.required) }); } @@ -249,10 +287,24 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit } setConditionalControls(chartIndex: number) { - this.chartSlabsDisplayedColumns[chartIndex] = ['period', 'amountRange', 'annualInterestRate', 'description', 'actions']; - this.charts.at(chartIndex).get('isPrimaryGroupingByAmount').valueChanges - .subscribe((isPrimaryGroupingByAmount: boolean) => { - this.chartSlabsDisplayedColumns[chartIndex] = isPrimaryGroupingByAmount ? ['amountRange', 'period'] : ['period', 'amountRange']; + this.chartSlabsDisplayedColumns[chartIndex] = [ + 'period', + 'amountRange', + 'annualInterestRate', + 'description', + 'actions' + ]; + this.charts + .at(chartIndex) + .get('isPrimaryGroupingByAmount') + .valueChanges.subscribe((isPrimaryGroupingByAmount: boolean) => { + this.chartSlabsDisplayedColumns[chartIndex] = isPrimaryGroupingByAmount ? [ + 'amountRange', + 'period' + ] : [ + 'period', + 'amountRange' + ]; this.chartSlabsDisplayedColumns[chartIndex].push('annualInterestRate', 'description', 'actions'); }); } @@ -283,7 +335,10 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit } editChartSlab(chartSlabs: UntypedFormArray, chartSlabIndex: number) { - const data = { ...this.getData('Slab', chartSlabs.at(chartSlabIndex).value), layout: { addButtonText: this.translateService.instant('labels.text.this') } }; + const data = { + ...this.getData('Slab', chartSlabs.at(chartSlabIndex).value), + layout: { addButtonText: this.translateService.instant('labels.text.this') } + }; const dialogRef = this.dialog.open(FormDialogComponent, { data }); dialogRef.afterClosed().subscribe((response: any) => { if (response.data) { @@ -293,7 +348,10 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit } editIncentive(incentives: UntypedFormArray, incentiveIndex: number) { - const data = { ...this.getData('Incentive', incentives.at(incentiveIndex).value), layout: { addButtonText: this.translateService.instant('labels.text.this') } }; + const data = { + ...this.getData('Incentive', incentives.at(incentiveIndex).value), + layout: { addButtonText: this.translateService.instant('labels.text.this') } + }; const dialogRef = this.dialog.open(DepositProductIncentiveFormDialogComponent, { data }); dialogRef.afterClosed().subscribe((response: any) => { if (response.data) { @@ -315,8 +373,13 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit getData(formType: string, values?: any) { switch (formType) { - case 'Slab': return { title: this.translateService.instant('labels.inputs.Slab'), formfields: this.getSlabFormfields(values) }; - case 'Incentive': return { values, chartTemplate: this.fixedDepositProductsTemplate.chartTemplate }; + case 'Slab': + return { + title: this.translateService.instant('labels.inputs.Slab'), + formfields: this.getSlabFormfields(values) + }; + case 'Incentive': + return { values, chartTemplate: this.fixedDepositProductsTemplate.chartTemplate }; } } @@ -374,6 +437,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit required: true, order: 7 }) + ]; return formfields; } @@ -403,5 +467,4 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit } return fixedDepositProductInterestRateChart; } - } diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-preview-step/fixed-deposit-product-preview-step.component.spec.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-preview-step/fixed-deposit-product-preview-step.component.spec.ts index 713d18343..da4145b9b 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-preview-step/fixed-deposit-product-preview-step.component.spec.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-preview-step/fixed-deposit-product-preview-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositProductPreviewStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositProductPreviewStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositProductPreviewStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-preview-step/fixed-deposit-product-preview-step.component.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-preview-step/fixed-deposit-product-preview-step.component.ts index b8200d27b..33f731686 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-preview-step/fixed-deposit-product-preview-step.component.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-preview-step/fixed-deposit-product-preview-step.component.ts @@ -9,14 +9,13 @@ import { OptionData } from 'app/shared/models/option-data.model'; styleUrls: ['./fixed-deposit-product-preview-step.component.scss'], animations: [ trigger('expandChartSlab', [ - state('collapsed', style({height: '0px', minHeight: '0'})), - state('expanded', style({height: '*'})), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')) - ]) + state('collapsed', style({ height: '0px', minHeight: '0' })), + state('expanded', style({ height: '*' })), + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + ] }) export class FixedDepositProductPreviewStepComponent implements OnInit, OnChanges { - @Input() fixedDepositProductsTemplate: any; @Input() chartSlabsDisplayedColumns: any[]; @Input() accountingRuleData: any; @@ -24,17 +23,35 @@ export class FixedDepositProductPreviewStepComponent implements OnInit, OnChange @Output() submitEvent = new EventEmitter(); chartSlabsIncentivesDisplayedColumns: string[] = ['incentives']; - incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount']; - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType']; - paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId']; - feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId']; + incentivesDisplayedColumns: string[] = [ + 'entityType', + 'attributeName', + 'conditionType', + 'attributeValue', + 'incentiveType', + 'amount' + ]; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType' + ]; + paymentFundSourceDisplayedColumns: string[] = [ + 'paymentTypeId', + 'fundSourceAccountId' + ]; + feesPenaltyIncomeDisplayedColumns: string[] = [ + 'chargeId', + 'incomeAccountId' + ]; expandChartSlabIndex: number[] = []; accountingMappings: any = {}; accountingRule: OptionData; - constructor(private accounting: Accounting) { } + constructor(private accounting: Accounting) {} ngOnInit() { this.setCurrentValues(); @@ -51,21 +68,49 @@ export class FixedDepositProductPreviewStepComponent implements OnInit, OnChange const assetAccountData = this.fixedDepositProductsTemplate.accountingMappingOptions.assetAccountOptions || []; const incomeAccountData = this.fixedDepositProductsTemplate.accountingMappingOptions.incomeAccountOptions || []; const expenseAccountData = this.fixedDepositProductsTemplate.accountingMappingOptions.expenseAccountOptions || []; - const liabilityAccountData = this.fixedDepositProductsTemplate.accountingMappingOptions.liabilityAccountOptions || []; + const liabilityAccountData = + this.fixedDepositProductsTemplate.accountingMappingOptions.liabilityAccountOptions || []; this.accountingMappings = { - 'savingsReferenceAccount': this.accounting.glAccountLookUp(this.fixedDepositProduct.savingsReferenceAccountId, assetAccountData), - 'savingsControlAccount': this.accounting.glAccountLookUp(this.fixedDepositProduct.savingsControlAccountId, liabilityAccountData), - 'transfersInSuspenseAccount': this.accounting.glAccountLookUp(this.fixedDepositProduct.transfersInSuspenseAccountId, liabilityAccountData), - 'interestOnSavingsAccount': this.accounting.glAccountLookUp(this.fixedDepositProduct.interestOnSavingsAccountId, expenseAccountData), - 'incomeFromFeeAccount': this.accounting.glAccountLookUp(this.fixedDepositProduct.incomeFromFeeAccountId, incomeAccountData), - 'incomeFromPenaltyAccount': this.accounting.glAccountLookUp(this.fixedDepositProduct.incomeFromPenaltyAccountId, incomeAccountData) + savingsReferenceAccount: this.accounting.glAccountLookUp( + this.fixedDepositProduct.savingsReferenceAccountId, + assetAccountData + ), + savingsControlAccount: this.accounting.glAccountLookUp( + this.fixedDepositProduct.savingsControlAccountId, + liabilityAccountData + ), + transfersInSuspenseAccount: this.accounting.glAccountLookUp( + this.fixedDepositProduct.transfersInSuspenseAccountId, + liabilityAccountData + ), + interestOnSavingsAccount: this.accounting.glAccountLookUp( + this.fixedDepositProduct.interestOnSavingsAccountId, + expenseAccountData + ), + incomeFromFeeAccount: this.accounting.glAccountLookUp( + this.fixedDepositProduct.incomeFromFeeAccountId, + incomeAccountData + ), + incomeFromPenaltyAccount: this.accounting.glAccountLookUp( + this.fixedDepositProduct.incomeFromPenaltyAccountId, + incomeAccountData + ) }; if (this.isAccrualAccounting()) { - this.accountingMappings['feeReceivableAccount'] = this.accounting.glAccountLookUp(this.fixedDepositProduct.feesReceivableAccountId, assetAccountData); - this.accountingMappings['penaltyReceivableAccount'] = this.accounting.glAccountLookUp(this.fixedDepositProduct.penaltiesReceivableAccountId, assetAccountData); - this.accountingMappings['interestPayableAccount'] = this.accounting.glAccountLookUp(this.fixedDepositProduct.interestPayableAccountId, liabilityAccountData); + this.accountingMappings['feeReceivableAccount'] = this.accounting.glAccountLookUp( + this.fixedDepositProduct.feesReceivableAccountId, + assetAccountData + ); + this.accountingMappings['penaltyReceivableAccount'] = this.accounting.glAccountLookUp( + this.fixedDepositProduct.penaltiesReceivableAccountId, + assetAccountData + ); + this.accountingMappings['interestPayableAccount'] = this.accounting.glAccountLookUp( + this.fixedDepositProduct.interestPayableAccountId, + liabilityAccountData + ); } } } @@ -81,5 +126,4 @@ export class FixedDepositProductPreviewStepComponent implements OnInit, OnChange isAccrualAccounting(): boolean { return this.accounting.isAccrualAccountingRuleId(this.fixedDepositProduct.accountingRule); } - } diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-settings-step/fixed-deposit-product-settings-step.component.spec.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-settings-step/fixed-deposit-product-settings-step.component.spec.ts index bb4411bb8..2145c7c6e 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-settings-step/fixed-deposit-product-settings-step.component.spec.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-settings-step/fixed-deposit-product-settings-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositProductSettingsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositProductSettingsStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositProductSettingsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-settings-step/fixed-deposit-product-settings-step.component.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-settings-step/fixed-deposit-product-settings-step.component.ts index 32d73ec34..9fe231b55 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-settings-step/fixed-deposit-product-settings-step.component.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-settings-step/fixed-deposit-product-settings-step.component.ts @@ -8,7 +8,6 @@ import { TooltipPosition } from '@angular/material/tooltip'; styleUrls: ['./fixed-deposit-product-settings-step.component.scss'] }) export class FixedDepositProductSettingsStepComponent implements OnInit { - @Input() fixedDepositProductsTemplate: any; fixedDepositProductSettingsForm: UntypedFormGroup; @@ -31,57 +30,72 @@ export class FixedDepositProductSettingsStepComponent implements OnInit { if (!(this.fixedDepositProductsTemplate === undefined) && this.fixedDepositProductsTemplate.id) { this.fixedDepositProductSettingsForm.patchValue({ - 'isMandatoryDeposit': this.fixedDepositProductsTemplate.isMandatoryDeposit, - 'adjustAdvanceTowardsFuturePayments': this.fixedDepositProductsTemplate.adjustAdvanceTowardsFuturePayments, - 'allowWithdrawal': this.fixedDepositProductsTemplate.allowWithdrawal, - 'lockinPeriodFrequency': this.fixedDepositProductsTemplate.lockinPeriodFrequency, - 'lockinPeriodFrequencyType': this.fixedDepositProductsTemplate.lockinPeriodFrequencyType ? this.fixedDepositProductsTemplate.lockinPeriodFrequencyType.id : '', - 'minDepositTerm': this.fixedDepositProductsTemplate.minDepositTerm, - 'minDepositTermTypeId': this.fixedDepositProductsTemplate.minDepositTermType ? this.fixedDepositProductsTemplate.minDepositTermType.id : '', - 'inMultiplesOfDepositTerm': this.fixedDepositProductsTemplate.inMultiplesOfDepositTerm, - 'inMultiplesOfDepositTermTypeId': this.fixedDepositProductsTemplate.inMultiplesOfDepositTermType ? this.fixedDepositProductsTemplate.inMultiplesOfDepositTerm.id : '', - 'maxDepositTerm': this.fixedDepositProductsTemplate.maxDepositTerm, - 'maxDepositTermTypeId': this.fixedDepositProductsTemplate.maxDepositTermType ? this.fixedDepositProductsTemplate.minDepositTermType.id : '', - 'preClosurePenalApplicable': this.fixedDepositProductsTemplate.preClosurePenalApplicable, - 'preClosurePenalInterest': this.fixedDepositProductsTemplate.preClosurePenalInterest, - 'preClosurePenalInterestOnTypeId': this.fixedDepositProductsTemplate.preClosurePenalInterestOnType ? this.fixedDepositProductsTemplate.preClosurePenalInterestOnType.id : '', - 'withHoldTax': this.fixedDepositProductsTemplate.withHoldTax + isMandatoryDeposit: this.fixedDepositProductsTemplate.isMandatoryDeposit, + adjustAdvanceTowardsFuturePayments: this.fixedDepositProductsTemplate.adjustAdvanceTowardsFuturePayments, + allowWithdrawal: this.fixedDepositProductsTemplate.allowWithdrawal, + lockinPeriodFrequency: this.fixedDepositProductsTemplate.lockinPeriodFrequency, + lockinPeriodFrequencyType: this.fixedDepositProductsTemplate.lockinPeriodFrequencyType + ? this.fixedDepositProductsTemplate.lockinPeriodFrequencyType.id + : '', + minDepositTerm: this.fixedDepositProductsTemplate.minDepositTerm, + minDepositTermTypeId: this.fixedDepositProductsTemplate.minDepositTermType + ? this.fixedDepositProductsTemplate.minDepositTermType.id + : '', + inMultiplesOfDepositTerm: this.fixedDepositProductsTemplate.inMultiplesOfDepositTerm, + inMultiplesOfDepositTermTypeId: this.fixedDepositProductsTemplate.inMultiplesOfDepositTermType + ? this.fixedDepositProductsTemplate.inMultiplesOfDepositTerm.id + : '', + maxDepositTerm: this.fixedDepositProductsTemplate.maxDepositTerm, + maxDepositTermTypeId: this.fixedDepositProductsTemplate.maxDepositTermType + ? this.fixedDepositProductsTemplate.minDepositTermType.id + : '', + preClosurePenalApplicable: this.fixedDepositProductsTemplate.preClosurePenalApplicable, + preClosurePenalInterest: this.fixedDepositProductsTemplate.preClosurePenalInterest, + preClosurePenalInterestOnTypeId: this.fixedDepositProductsTemplate.preClosurePenalInterestOnType + ? this.fixedDepositProductsTemplate.preClosurePenalInterestOnType.id + : '', + withHoldTax: this.fixedDepositProductsTemplate.withHoldTax }); } if (this.fixedDepositProductsTemplate.withHoldTax) { this.fixedDepositProductSettingsForm.patchValue({ - 'taxGroupId': this.fixedDepositProductsTemplate.taxGroup ? this.fixedDepositProductsTemplate.taxGroup.id : '' + taxGroupId: this.fixedDepositProductsTemplate.taxGroup ? this.fixedDepositProductsTemplate.taxGroup.id : '' }); } } createFixedDepositProductSettingsForm() { this.fixedDepositProductSettingsForm = this.formBuilder.group({ - 'lockinPeriodFrequency': [''], - 'lockinPeriodFrequencyType': [''], - 'minDepositTerm': ['', Validators.required], - 'minDepositTermTypeId': ['', Validators.required], - 'inMultiplesOfDepositTerm': [''], - 'inMultiplesOfDepositTermTypeId': [''], - 'maxDepositTerm': [''], - 'maxDepositTermTypeId': [''], - 'preClosurePenalApplicable': [false], - 'preClosurePenalInterest': [''], - 'preClosurePenalInterestOnTypeId': [''], - 'withHoldTax': [false] + lockinPeriodFrequency: [''], + lockinPeriodFrequencyType: [''], + minDepositTerm: [ + '', + Validators.required + ], + minDepositTermTypeId: [ + '', + Validators.required + ], + inMultiplesOfDepositTerm: [''], + inMultiplesOfDepositTermTypeId: [''], + maxDepositTerm: [''], + maxDepositTermTypeId: [''], + preClosurePenalApplicable: [false], + preClosurePenalInterest: [''], + preClosurePenalInterestOnTypeId: [''], + withHoldTax: [false] }); } setConditionalControls() { - this.fixedDepositProductSettingsForm.get('withHoldTax').valueChanges - .subscribe((withHoldTax: any) => { - if (withHoldTax) { - this.fixedDepositProductSettingsForm.addControl('taxGroupId', new UntypedFormControl('', Validators.required)); - } else { - this.fixedDepositProductSettingsForm.removeControl('taxGroupId'); - } - }); + this.fixedDepositProductSettingsForm.get('withHoldTax').valueChanges.subscribe((withHoldTax: any) => { + if (withHoldTax) { + this.fixedDepositProductSettingsForm.addControl('taxGroupId', new UntypedFormControl('', Validators.required)); + } else { + this.fixedDepositProductSettingsForm.removeControl('taxGroupId'); + } + }); } get fixedDepositProductSettings() { @@ -93,5 +107,4 @@ export class FixedDepositProductSettingsStepComponent implements OnInit { } return fixedDepositProductSettings; } - } diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-terms-step/fixed-deposit-product-terms-step.component.spec.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-terms-step/fixed-deposit-product-terms-step.component.spec.ts index baf9c2aae..583c46595 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-terms-step/fixed-deposit-product-terms-step.component.spec.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-terms-step/fixed-deposit-product-terms-step.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositProductTermsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositProductTermsStepComponent ] - }) - .compileComponents(); + declarations: [FixedDepositProductTermsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-terms-step/fixed-deposit-product-terms-step.component.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-terms-step/fixed-deposit-product-terms-step.component.ts index 51e86bfa3..efe7c471c 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-terms-step/fixed-deposit-product-terms-step.component.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-terms-step/fixed-deposit-product-terms-step.component.ts @@ -8,7 +8,6 @@ import { TooltipPosition } from '@angular/material/tooltip'; styleUrls: ['./fixed-deposit-product-terms-step.component.scss'] }) export class FixedDepositProductTermsStepComponent implements OnInit { - @Input() fixedDepositProductsTemplate: any; fixedDepositProductTermsForm: UntypedFormGroup; @@ -26,33 +25,49 @@ export class FixedDepositProductTermsStepComponent implements OnInit { this.interestCompoundingPeriodTypeData = this.fixedDepositProductsTemplate.interestCompoundingPeriodTypeOptions; this.interestPostingPeriodTypeData = this.fixedDepositProductsTemplate.interestPostingPeriodTypeOptions; this.interestCalculationTypeData = this.fixedDepositProductsTemplate.interestCalculationTypeOptions; - this.interestCalculationDaysInYearTypeData = this.fixedDepositProductsTemplate.interestCalculationDaysInYearTypeOptions; + this.interestCalculationDaysInYearTypeData = + this.fixedDepositProductsTemplate.interestCalculationDaysInYearTypeOptions; if (!(this.fixedDepositProductsTemplate === undefined) && this.fixedDepositProductsTemplate.id) { this.fixedDepositProductTermsForm.patchValue({ - 'minDepositAmount': this.fixedDepositProductsTemplate.minDepositAmount, - 'depositAmount': this.fixedDepositProductsTemplate.depositAmount, - 'maxDepositAmount': this.fixedDepositProductsTemplate.maxDepositAmount, + minDepositAmount: this.fixedDepositProductsTemplate.minDepositAmount, + depositAmount: this.fixedDepositProductsTemplate.depositAmount, + maxDepositAmount: this.fixedDepositProductsTemplate.maxDepositAmount }); } this.fixedDepositProductTermsForm.patchValue({ - 'interestCompoundingPeriodType': this.fixedDepositProductsTemplate.interestCompoundingPeriodType.id, - 'interestPostingPeriodType': this.fixedDepositProductsTemplate.interestPostingPeriodType.id, - 'interestCalculationType': this.fixedDepositProductsTemplate.interestCalculationType.id, - 'interestCalculationDaysInYearType': this.fixedDepositProductsTemplate.interestCalculationDaysInYearType.id + interestCompoundingPeriodType: this.fixedDepositProductsTemplate.interestCompoundingPeriodType.id, + interestPostingPeriodType: this.fixedDepositProductsTemplate.interestPostingPeriodType.id, + interestCalculationType: this.fixedDepositProductsTemplate.interestCalculationType.id, + interestCalculationDaysInYearType: this.fixedDepositProductsTemplate.interestCalculationDaysInYearType.id }); } createFixedDepositProductTermsForm() { this.fixedDepositProductTermsForm = this.formBuilder.group({ - 'minDepositAmount': [''], - 'depositAmount': ['', Validators.required], - 'maxDepositAmount': [''], - 'interestCompoundingPeriodType': ['', Validators.required], - 'interestPostingPeriodType': ['', Validators.required], - 'interestCalculationType': ['', Validators.required], - 'interestCalculationDaysInYearType': ['', Validators.required] + minDepositAmount: [''], + depositAmount: [ + '', + Validators.required + ], + maxDepositAmount: [''], + interestCompoundingPeriodType: [ + '', + Validators.required + ], + interestPostingPeriodType: [ + '', + Validators.required + ], + interestCalculationType: [ + '', + Validators.required + ], + interestCalculationDaysInYearType: [ + '', + Validators.required + ] }); } @@ -65,5 +80,4 @@ export class FixedDepositProductTermsStepComponent implements OnInit { } return fixedDepositProductTerms; } - } diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product.resolver.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product.resolver.ts index 40ea92f8e..8b600de47 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-product.resolver.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-product.resolver.ts @@ -13,11 +13,10 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class FixedDepositProductResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ - constructor(private productsService: ProductsService) { } + constructor(private productsService: ProductsService) {} /** * Returns the fixed deposit product data. @@ -27,5 +26,4 @@ export class FixedDepositProductResolver implements Resolve { const productId = route.parent.paramMap.get('productId'); return this.productsService.getFixedDepositProduct(productId); } - } diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-products-template.resolver.ts b/src/app/products/fixed-deposit-products/fixed-deposit-products-template.resolver.ts index be1332fcc..df70a0fea 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-products-template.resolver.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-products-template.resolver.ts @@ -10,7 +10,6 @@ import { ProductsService } from '../products.service'; @Injectable() export class FixedDepositProductsTemplateResolver implements Resolve { - constructor(private productsService: ProductsService) {} /** @@ -20,5 +19,4 @@ export class FixedDepositProductsTemplateResolver implements Resolve { resolve(): Observable { return this.productsService.getFixedDepositProductsTemplate(); } - } diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-products.component.spec.ts b/src/app/products/fixed-deposit-products/fixed-deposit-products.component.spec.ts index bfc58dd40..eeb4769aa 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-products.component.spec.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-products.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositProductsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FixedDepositProductsComponent ] - }) - .compileComponents(); + declarations: [FixedDepositProductsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-products.component.ts b/src/app/products/fixed-deposit-products/fixed-deposit-products.component.ts index c14d6a5d5..050ea0c03 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-products.component.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-products.component.ts @@ -21,11 +21,13 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura styleUrls: ['./fixed-deposit-products.component.scss'] }) export class FixedDepositProductsComponent implements OnInit, AfterViewInit { - /** Fixed deposit products data. */ fixedDepositProductData: any; /** Columns to be displayed in fixed deposit products table. */ - displayedColumns: string[] = ['name', 'shortName']; + displayedColumns: string[] = [ + 'name', + 'shortName' + ]; /** Data source for fixed deposit products table. */ dataSource: MatTableDataSource; @@ -50,11 +52,13 @@ export class FixedDepositProductsComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private route: ActivatedRoute, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { - this.route.data.subscribe(( data: { fixedDepositProducts: any }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { + this.route.data.subscribe((data: { fixedDepositProducts: any }) => { this.fixedDepositProductData = data.fixedDepositProducts; }); } @@ -89,7 +93,12 @@ export class FixedDepositProductsComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showFixedDepositProductsPage === true) { setTimeout(() => { - this.showPopover(this.templateButtonCreateFixedProduct, this.buttonCreateFixedProduct.nativeElement, 'bottom', true); + this.showPopover( + this.templateButtonCreateFixedProduct, + this.buttonCreateFixedProduct.nativeElement, + 'bottom', + true + ); }); } @@ -107,7 +116,12 @@ export class FixedDepositProductsComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -130,5 +144,4 @@ export class FixedDepositProductsComponent implements OnInit, AfterViewInit { this.configurationWizardService.showFixedDepositProducts = true; this.router.navigate(['/products']); } - } diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-products.resolver.ts b/src/app/products/fixed-deposit-products/fixed-deposit-products.resolver.ts index 3832baeb2..f61e7402b 100644 --- a/src/app/products/fixed-deposit-products/fixed-deposit-products.resolver.ts +++ b/src/app/products/fixed-deposit-products/fixed-deposit-products.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class FixedDepositProductsResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -26,5 +25,4 @@ export class FixedDepositProductsResolver implements Resolve { resolve(): Observable { return this.productsService.getFixedDepositProducts(); } - } diff --git a/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-datatable-tab/fixed-deposit-datatable-tab.component.spec.ts b/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-datatable-tab/fixed-deposit-datatable-tab.component.spec.ts index 20673af7c..c05619594 100644 --- a/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-datatable-tab/fixed-deposit-datatable-tab.component.spec.ts +++ b/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-datatable-tab/fixed-deposit-datatable-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositDatatableTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ FixedDepositDatatableTabComponent ] - }) - .compileComponents(); + declarations: [FixedDepositDatatableTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-datatable-tab/fixed-deposit-datatable-tab.component.ts b/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-datatable-tab/fixed-deposit-datatable-tab.component.ts index 044b5ac83..9101525ce 100644 --- a/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-datatable-tab/fixed-deposit-datatable-tab.component.ts +++ b/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-datatable-tab/fixed-deposit-datatable-tab.component.ts @@ -19,5 +19,4 @@ export class FixedDepositDatatableTabComponent { this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); } - } diff --git a/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-general-tab/fixed-deposit-general-tab.component.spec.ts b/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-general-tab/fixed-deposit-general-tab.component.spec.ts index 968909047..4355a91c9 100644 --- a/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-general-tab/fixed-deposit-general-tab.component.spec.ts +++ b/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-general-tab/fixed-deposit-general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositGeneralTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ FixedDepositGeneralTabComponent ] - }) - .compileComponents(); + declarations: [FixedDepositGeneralTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-general-tab/fixed-deposit-general-tab.component.ts b/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-general-tab/fixed-deposit-general-tab.component.ts index 95a7555fc..51a41e59e 100644 --- a/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-general-tab/fixed-deposit-general-tab.component.ts +++ b/src/app/products/fixed-deposit-products/view-fixed-deposit-product/fixed-deposit-general-tab/fixed-deposit-general-tab.component.ts @@ -8,10 +8,10 @@ import { trigger, state, transition, animate, style } from '@angular/animations' styleUrls: ['./fixed-deposit-general-tab.component.scss'], animations: [ trigger('expandChartSlab', [ - state('collapsed', style({height: '0px', minHeight: '0'})), - state('expanded', style({height: '*'})), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')) - ]) + state('collapsed', style({ height: '0px', minHeight: '0' })), + state('expanded', style({ height: '*' })), + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + ] }) export class FixedDepositGeneralTabComponent { @@ -20,21 +20,44 @@ export class FixedDepositGeneralTabComponent { fixedDepositProductsTemplate: any; chartSlabsIncentivesDisplayedColumns: string[] = ['incentives']; - chartSlabsDisplayedColumns: string[] = ['period', 'amountRange', 'annualInterestRate', 'description', 'actions']; - incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount']; - chargesDisplayedColumns: string[] = ['name', 'type', 'amount', 'collectedon']; - paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId']; - feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId']; + chartSlabsDisplayedColumns: string[] = [ + 'period', + 'amountRange', + 'annualInterestRate', + 'description', + 'actions' + ]; + incentivesDisplayedColumns: string[] = [ + 'entityType', + 'attributeName', + 'conditionType', + 'attributeValue', + 'incentiveType', + 'amount' + ]; + chargesDisplayedColumns: string[] = [ + 'name', + 'type', + 'amount', + 'collectedon' + ]; + paymentFundSourceDisplayedColumns: string[] = [ + 'paymentTypeId', + 'fundSourceAccountId' + ]; + feesPenaltyIncomeDisplayedColumns: string[] = [ + 'chargeId', + 'incomeAccountId' + ]; /** * Retrieves the fixed deposit product data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe((data: { fixedDepositProduct: any, fixedDepositProductsTemplate: any }) => { + this.route.data.subscribe((data: { fixedDepositProduct: any; fixedDepositProductsTemplate: any }) => { this.fixedDepositProductData = data.fixedDepositProduct; this.fixedDepositProductsTemplate = data.fixedDepositProductsTemplate; }); } - } diff --git a/src/app/products/fixed-deposit-products/view-fixed-deposit-product/view-fixed-deposit-product.component.spec.ts b/src/app/products/fixed-deposit-products/view-fixed-deposit-product/view-fixed-deposit-product.component.spec.ts index 98d17b6c5..9cad51732 100644 --- a/src/app/products/fixed-deposit-products/view-fixed-deposit-product/view-fixed-deposit-product.component.spec.ts +++ b/src/app/products/fixed-deposit-products/view-fixed-deposit-product/view-fixed-deposit-product.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewFixedDepositProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewFixedDepositProductComponent ] - }) - .compileComponents(); + declarations: [ViewFixedDepositProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/fixed-deposit-products/view-fixed-deposit-product/view-fixed-deposit-product.component.ts b/src/app/products/fixed-deposit-products/view-fixed-deposit-product/view-fixed-deposit-product.component.ts index af191dab4..2f8447280 100644 --- a/src/app/products/fixed-deposit-products/view-fixed-deposit-product/view-fixed-deposit-product.component.ts +++ b/src/app/products/fixed-deposit-products/view-fixed-deposit-product/view-fixed-deposit-product.component.ts @@ -10,9 +10,7 @@ import { ActivatedRoute } from '@angular/router'; templateUrl: './view-fixed-deposit-product.component.html', styleUrls: ['./view-fixed-deposit-product.component.scss'] }) - export class ViewFixedDepositProductComponent { - fixedDepositDatatables: any = []; constructor(private route: ActivatedRoute) { @@ -25,5 +23,4 @@ export class ViewFixedDepositProductComponent { }); }); } - } diff --git a/src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.spec.ts b/src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.spec.ts index bd5c7dc5c..b1e498aae 100644 --- a/src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.spec.ts +++ b/src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateFloatingRateComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateFloatingRateComponent ] - }) - .compileComponents(); + declarations: [CreateFloatingRateComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.ts b/src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.ts index 67c315be8..93a557279 100644 --- a/src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.ts +++ b/src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.ts @@ -26,7 +26,6 @@ import { FloatingRatePeriodDialogComponent } from '../floating-rate-period-dialo styleUrls: ['./create-floating-rate.component.scss'] }) export class CreateFloatingRateComponent implements OnInit { - /** Floating Rate Period Data. */ floatingRatePeriodsData: any[] = []; /** Minimum floating rate period date allowed. */ @@ -34,7 +33,12 @@ export class CreateFloatingRateComponent implements OnInit { /** Floating Rate Form. */ floatingRateForm: UntypedFormGroup; /** Columns to be displayed in floating rate periods table. */ - displayedColumns: string[] = ['fromDate', 'interestRate', 'isDifferential', 'actions']; + displayedColumns: string[] = [ + 'fromDate', + 'interestRate', + 'isDifferential', + 'actions' + ]; /** Data source for floating rate periods table. */ dataSource: MatTableDataSource; /** Date Format. */ @@ -55,14 +59,16 @@ export class CreateFloatingRateComponent implements OnInit { * @param {SettingsService} settingsService Settings Service. * @param {TranslateService} translateService Translate Service. */ - constructor(private router: Router, - private formBuilder: UntypedFormBuilder, - private productsService: ProductsService, - private route: ActivatedRoute, - private dateUtils: Dates, - private dialog: MatDialog, - private settingsService: SettingsService, - private translateService: TranslateService) { } + constructor( + private router: Router, + private formBuilder: UntypedFormBuilder, + private productsService: ProductsService, + private route: ActivatedRoute, + private dateUtils: Dates, + private dialog: MatDialog, + private settingsService: SettingsService, + private translateService: TranslateService + ) {} /** * Sets the floating rate periods table. @@ -77,9 +83,12 @@ export class CreateFloatingRateComponent implements OnInit { */ createFloatingRateForm() { this.floatingRateForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'isBaseLendingRate': [false], - 'isActive': [false] + name: [ + '', + Validators.required + ], + isBaseLendingRate: [false], + isActive: [false] }); } @@ -98,9 +107,15 @@ export class CreateFloatingRateComponent implements OnInit { */ createFloatingRatePeriodsForm(): UntypedFormGroup { return this.formBuilder.group({ - 'fromDate': ['', Validators.required], - 'interestRate': ['', Validators.required], - 'isDifferentialToBaseLendingRate': [false] + fromDate: [ + '', + Validators.required + ], + interestRate: [ + '', + Validators.required + ], + isDifferentialToBaseLendingRate: [false] }); } @@ -160,7 +175,12 @@ export class CreateFloatingRateComponent implements OnInit { */ deleteFloatingRatePeriod(ratePeriod: any) { const deleteFloatingRatePeriodRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: this.translateService.instant('labels.inputs.floating rate period with from date as') + ' ' + ratePeriod.fromDate } + data: { + deleteContext: + this.translateService.instant('labels.inputs.floating rate period with from date as') + + ' ' + + ratePeriod.fromDate + } }); deleteFloatingRatePeriodRef.afterClosed().subscribe((response: any) => { if (response.delete) { @@ -176,10 +196,14 @@ export class CreateFloatingRateComponent implements OnInit { */ submit() { this.floatingRateForm.value.ratePeriods = this.floatingRatePeriodsData; - this.productsService.createFloatingRate(this.floatingRateForm.value) - .subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); - }); + this.productsService.createFloatingRate(this.floatingRateForm.value).subscribe((response: any) => { + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); + }); } - } diff --git a/src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.spec.ts b/src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.spec.ts index 7c495be63..0a47d2416 100644 --- a/src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.spec.ts +++ b/src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.spec.ts @@ -8,9 +8,8 @@ describe('EditFloatingRateComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditFloatingRateComponent ] - }) - .compileComponents(); + declarations: [EditFloatingRateComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.ts b/src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.ts index 9ffd4c3e7..0fa0a85ed 100644 --- a/src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.ts +++ b/src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.ts @@ -26,7 +26,6 @@ import { FloatingRatePeriodDialogComponent } from '../floating-rate-period-dialo styleUrls: ['./edit-floating-rate.component.scss'] }) export class EditFloatingRateComponent implements OnInit { - /** Floating Rate Form. */ floatingRateForm: UntypedFormGroup; /** Floating Rate Data. */ @@ -36,7 +35,12 @@ export class EditFloatingRateComponent implements OnInit { /** Form Pristine Status. */ isFloatingRateFormPristine = true; /** Columns to be displayed in floating rate periods table. */ - displayedColumns: string[] = ['fromDate', 'interestRate', 'isDifferential', 'actions']; + displayedColumns: string[] = [ + 'fromDate', + 'interestRate', + 'isDifferential', + 'actions' + ]; /** Data source for floating rate periods table. */ dataSource: MatTableDataSource; /** Date Format. */ @@ -60,14 +64,16 @@ export class EditFloatingRateComponent implements OnInit { * @param {SettingsService} settingsService Settings Service. * @param {TranslateService} translateService Translate Service. */ - constructor(private router: Router, - private formBuilder: UntypedFormBuilder, - private productsService: ProductsService, - private route: ActivatedRoute, - private dateUtils: Dates, - private dialog: MatDialog, - private settingsService: SettingsService, - private translateService: TranslateService) { + constructor( + private router: Router, + private formBuilder: UntypedFormBuilder, + private productsService: ProductsService, + private route: ActivatedRoute, + private dateUtils: Dates, + private dialog: MatDialog, + private settingsService: SettingsService, + private translateService: TranslateService + ) { this.route.data.subscribe((data: { floatingRate: any }) => { this.floatingRateData = data.floatingRate; this.floatingRatePeriodsData = data.floatingRate.ratePeriods ? data.floatingRate.ratePeriods : []; @@ -87,9 +93,12 @@ export class EditFloatingRateComponent implements OnInit { */ createFloatingRateForm() { this.floatingRateForm = this.formBuilder.group({ - 'name': [this.floatingRateData.name, Validators.required], - 'isBaseLendingRate': [this.floatingRateData.isBaseLendingRate], - 'isActive': [this.floatingRateData.isActive] + name: [ + this.floatingRateData.name, + Validators.required + ], + isBaseLendingRate: [this.floatingRateData.isBaseLendingRate], + isActive: [this.floatingRateData.isActive] }); } @@ -157,7 +166,12 @@ export class EditFloatingRateComponent implements OnInit { */ deleteFloatingRatePeriod(ratePeriod: any) { const deleteFloatingRatePeriodRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: this.translateService.instant('labels.inputs.floating rate period with from date as') + ' ' + ratePeriod.fromDate } + data: { + deleteContext: + this.translateService.instant('labels.inputs.floating rate period with from date as') + + ' ' + + ratePeriod.fromDate + } }); deleteFloatingRatePeriodRef.afterClosed().subscribe((response: any) => { if (response.delete) { @@ -173,7 +187,7 @@ export class EditFloatingRateComponent implements OnInit { * if successful redirects to view created floating rate. */ submit() { - this.floatingRatePeriodsData.map(floatingRatePeriod => { + this.floatingRatePeriodsData.map((floatingRatePeriod) => { floatingRatePeriod.modifiedOn = undefined; floatingRatePeriod.createdOn = undefined; floatingRatePeriod.id = undefined; @@ -184,11 +198,18 @@ export class EditFloatingRateComponent implements OnInit { floatingRatePeriod.dateFormat = this.dateFormat; floatingRatePeriod.fromDate = this.dateUtils.formatDate(floatingRatePeriod.fromDate, this.dateFormat); }); - this.floatingRateForm.value.ratePeriods = this.floatingRatePeriodsData.length > 0 ? this.floatingRatePeriodsData : undefined; - this.productsService.updateFloatingRate(this.route.snapshot.paramMap.get('id'), this.floatingRateForm.value) + this.floatingRateForm.value.ratePeriods = + this.floatingRatePeriodsData.length > 0 ? this.floatingRatePeriodsData : undefined; + this.productsService + .updateFloatingRate(this.route.snapshot.paramMap.get('id'), this.floatingRateForm.value) .subscribe((response: any) => { - this.router.navigate(['../../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.spec.ts b/src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.spec.ts index a61cc6209..cd44ac3e0 100644 --- a/src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.spec.ts +++ b/src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('FloatingRatePeriodDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FloatingRatePeriodDialogComponent ] - }) - .compileComponents(); + declarations: [FloatingRatePeriodDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.ts b/src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.ts index 1b3f94390..df75ae718 100644 --- a/src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.ts +++ b/src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.ts @@ -13,7 +13,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./floating-rate-period-dialog.component.scss'] }) export class FloatingRatePeriodDialogComponent implements OnInit { - /** Floating Rate Period Form. */ floatingRatePeriodForm: UntypedFormGroup; /** Minimum floating rate period date allowed. */ @@ -24,11 +23,12 @@ export class FloatingRatePeriodDialogComponent implements OnInit { * @param {FormBuilder} formBuilder Form Builder. * @param {any} data Provides values for the form (if available). */ - constructor(public dialogRef: MatDialogRef, - public formBuilder: UntypedFormBuilder, - private settingsService: SettingsService, - @Inject(MAT_DIALOG_DATA) public data: any) { - } + constructor( + public dialogRef: MatDialogRef, + public formBuilder: UntypedFormBuilder, + private settingsService: SettingsService, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} /** * Creates the floating rate period form. @@ -36,16 +36,23 @@ export class FloatingRatePeriodDialogComponent implements OnInit { ngOnInit() { this.minDate = this.settingsService.businessDate; let rowDisabled = false; - if (this.data && (new Date(this.data.fromDate) < this.minDate)) { + if (this.data && new Date(this.data.fromDate) < this.minDate) { rowDisabled = true; } if (this.data.isNew) { rowDisabled = false; } this.floatingRatePeriodForm = this.formBuilder.group({ - 'fromDate': [{ value: this.data ? new Date(this.data.fromDate) : '', disabled: rowDisabled }, Validators.required], - 'interestRate': [{ value: this.data ? this.data.interestRate : '', disabled: rowDisabled }, Validators.required], - 'isDifferentialToBaseLendingRate': [{ value: this.data ? this.data.isDifferentialToBaseLendingRate : false, disabled: rowDisabled }] + fromDate: [ + { value: this.data ? new Date(this.data.fromDate) : '', disabled: rowDisabled }, + Validators.required + ], + interestRate: [ + { value: this.data ? this.data.interestRate : '', disabled: rowDisabled }, + Validators.required + ], + isDifferentialToBaseLendingRate: [ + { value: this.data ? this.data.isDifferentialToBaseLendingRate : false, disabled: rowDisabled }] }); } @@ -55,5 +62,4 @@ export class FloatingRatePeriodDialogComponent implements OnInit { submit() { this.dialogRef.close(this.floatingRatePeriodForm.value); } - } diff --git a/src/app/products/floating-rates/floating-rate.resolver.ts b/src/app/products/floating-rates/floating-rate.resolver.ts index 7b56ce94d..ccf2e43df 100644 --- a/src/app/products/floating-rates/floating-rate.resolver.ts +++ b/src/app/products/floating-rates/floating-rate.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class FloatingRateResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -27,5 +26,4 @@ export class FloatingRateResolver implements Resolve { const floatingRateId = route.paramMap.get('id'); return this.productsService.getFloatingRate(floatingRateId); } - } diff --git a/src/app/products/floating-rates/floating-rates.component.spec.ts b/src/app/products/floating-rates/floating-rates.component.spec.ts index 134e6bb47..8eae1d14e 100644 --- a/src/app/products/floating-rates/floating-rates.component.spec.ts +++ b/src/app/products/floating-rates/floating-rates.component.spec.ts @@ -8,9 +8,8 @@ describe('FloatingRatesComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ FloatingRatesComponent ] - }) - .compileComponents(); + declarations: [FloatingRatesComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/floating-rates/floating-rates.component.ts b/src/app/products/floating-rates/floating-rates.component.ts index e6f199e7b..29d5bdc7e 100644 --- a/src/app/products/floating-rates/floating-rates.component.ts +++ b/src/app/products/floating-rates/floating-rates.component.ts @@ -14,11 +14,15 @@ import { MatTableDataSource } from '@angular/material/table'; styleUrls: ['./floating-rates.component.scss'] }) export class FloatingRatesComponent implements OnInit { - /** Floating Rates data. */ floatingRatesData: any; /** Columns to be displayed in floating rates table. */ - displayedColumns: string[] = ['name', 'createdBy', 'isBaseLendingRate', 'isActive']; + displayedColumns: string[] = [ + 'name', + 'createdBy', + 'isBaseLendingRate', + 'isActive' + ]; /** Data source for floating rates table. */ dataSource: MatTableDataSource; @@ -32,10 +36,10 @@ export class FloatingRatesComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { floatingrates: any } ) => { + this.route.data.subscribe((data: { floatingrates: any }) => { this.floatingRatesData = data.floatingrates; }); - } + } /** * Filters data in floating rates table based on passed value. @@ -56,9 +60,8 @@ export class FloatingRatesComponent implements OnInit { * Initializes the data source, paginator and sorter for floating rates table. */ setFloatingRates() { - this.dataSource = new MatTableDataSource(this.floatingRatesData); - this.dataSource.paginator = this.paginator; - this.dataSource.sort = this.sort; + this.dataSource = new MatTableDataSource(this.floatingRatesData); + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; } - } diff --git a/src/app/products/floating-rates/floating-rates.resolver.ts b/src/app/products/floating-rates/floating-rates.resolver.ts index c044e84e7..f56652e75 100644 --- a/src/app/products/floating-rates/floating-rates.resolver.ts +++ b/src/app/products/floating-rates/floating-rates.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class FloatingRatesResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -26,5 +25,4 @@ export class FloatingRatesResolver implements Resolve { resolve(): Observable { return this.productsService.getFloatingRates(); } - } diff --git a/src/app/products/floating-rates/view-floating-rate/view-floating-rate.component.spec.ts b/src/app/products/floating-rates/view-floating-rate/view-floating-rate.component.spec.ts index 2436680df..d1e39ae6f 100644 --- a/src/app/products/floating-rates/view-floating-rate/view-floating-rate.component.spec.ts +++ b/src/app/products/floating-rates/view-floating-rate/view-floating-rate.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewFloatingRateComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewFloatingRateComponent ] - }) - .compileComponents(); + declarations: [ViewFloatingRateComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/floating-rates/view-floating-rate/view-floating-rate.component.ts b/src/app/products/floating-rates/view-floating-rate/view-floating-rate.component.ts index 2c504f796..a8b84b0cf 100644 --- a/src/app/products/floating-rates/view-floating-rate/view-floating-rate.component.ts +++ b/src/app/products/floating-rates/view-floating-rate/view-floating-rate.component.ts @@ -14,11 +14,14 @@ import { MatTableDataSource } from '@angular/material/table'; styleUrls: ['./view-floating-rate.component.scss'] }) export class ViewFloatingRateComponent implements OnInit { - /** Floating Rate Data. */ floatingRateData: any; /** Columns to be displayed in floating rate periods table. */ - displayedColumns: string[] = ['fromDate', 'interestRate', 'isDifferential']; + displayedColumns: string[] = [ + 'fromDate', + 'interestRate', + 'isDifferential' + ]; /** Data source for floating rate periods table. */ dataSource: MatTableDataSource; @@ -32,7 +35,7 @@ export class ViewFloatingRateComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { floatingRate: any } ) => { + this.route.data.subscribe((data: { floatingRate: any }) => { this.floatingRateData = data.floatingRate; }); } @@ -48,9 +51,8 @@ export class ViewFloatingRateComponent implements OnInit { * Initializes the data source, paginator and sorter for floating rate periods table. */ setFloatingRates() { - this.dataSource = new MatTableDataSource(this.floatingRateData.ratePeriods); - this.dataSource.paginator = this.paginator; - this.dataSource.sort = this.sort; + this.dataSource = new MatTableDataSource(this.floatingRateData.ratePeriods); + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; } - } diff --git a/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.spec.ts b/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.spec.ts index 57dc927c8..83403ec94 100644 --- a/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.spec.ts +++ b/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanProductSummaryComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ LoanProductSummaryComponent ] - }) - .compileComponents(); + declarations: [LoanProductSummaryComponent] + }).compileComponents(); fixture = TestBed.createComponent(LoanProductSummaryComponent); component = fixture.componentInstance; diff --git a/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.ts b/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.ts index d6331d21d..ef49733a3 100644 --- a/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.ts +++ b/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.ts @@ -11,7 +11,11 @@ import { PaymentType, PaymentTypeOption } from '../../../../shared/models/general.model'; -import { AdvancePaymentAllocationData, CreditAllocation, PaymentAllocation } from '../../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model'; +import { + AdvancePaymentAllocationData, + CreditAllocation, + PaymentAllocation +} from '../../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model'; import { LoanProducts } from '../../loan-products'; import { CodeName, OptionData, StringEnumOptionData } from '../../../../shared/models/option-data.model'; import { Accounting } from 'app/core/utils/accounting'; @@ -22,7 +26,6 @@ import { Accounting } from 'app/core/utils/accounting'; styleUrls: ['./loan-product-summary.component.scss'] }) export class LoanProductSummaryComponent implements OnInit, OnChanges { - @Input() action: string; @Input() loanProduct: LoanProduct; @Input() loanProductsTemplate: any | null; @@ -31,11 +34,31 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges { @Input() creditAllocations: CreditAllocation | null; @Input() supportedInterestRefundTypes: StringEnumOptionData[] | null; - variationsDisplayedColumns: string[] = ['valueConditionType', 'borrowerCycleNumber', 'minValue', 'defaultValue', 'maxValue']; - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType']; - paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId']; - feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId']; - chargeOffReasonExpenseDisplayedColumns: string[] = ['chargeOffReasonCodeValueId', 'expenseAccountId']; + variationsDisplayedColumns: string[] = [ + 'valueConditionType', + 'borrowerCycleNumber', + 'minValue', + 'defaultValue', + 'maxValue' + ]; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType' + ]; + paymentFundSourceDisplayedColumns: string[] = [ + 'paymentTypeId', + 'fundSourceAccountId' + ]; + feesPenaltyIncomeDisplayedColumns: string[] = [ + 'chargeId', + 'incomeAccountId' + ]; + chargeOffReasonExpenseDisplayedColumns: string[] = [ + 'chargeOffReasonCodeValueId', + 'expenseAccountId' + ]; accountingRuleData: string[] = []; isAdvancedPaymentAllocation = false; @@ -48,7 +71,7 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges { penaltyToIncomeAccountMappings: ChargeToIncomeAccountMapping[] = []; chargeOffReasonToExpenseAccountMappings: ChargeOffReasonToExpenseAccountMapping[] = []; - constructor(private accounting: Accounting) { } + constructor(private accounting: Accounting) {} ngOnInit() { this.accountingRuleData = this.accounting.getAccountingRulesForLoans(); @@ -60,7 +83,9 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges { } setCurrentValues(): void { - this.isAdvancedPaymentAllocation = LoanProducts.isAdvancedPaymentAllocationStrategy(this.loanProduct.transactionProcessingStrategyCode); + this.isAdvancedPaymentAllocation = LoanProducts.isAdvancedPaymentAllocationStrategy( + this.loanProduct.transactionProcessingStrategyCode + ); if (!this.loanProduct.currency) { this.loanProductsTemplate.currencyOptions.some((o: any) => { @@ -76,40 +101,67 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges { this.feeToIncomeAccountMappings = this.loanProduct.feeToIncomeAccountMappings || []; this.penaltyToIncomeAccountMappings = this.loanProduct.penaltyToIncomeAccountMappings || []; this.chargeOffReasonToExpenseAccountMappings = this.loanProduct.chargeOffReasonToExpenseAccountMappings || []; - } else { this.accountingMappings = {}; - if ((this.loanProduct.accountingRule && this.loanProduct.accountingRule > 1) || this.loanProductsTemplate.accountingRule.value !== 'NONE') { + if ( + (this.loanProduct.accountingRule && this.loanProduct.accountingRule > 1) || + this.loanProductsTemplate.accountingRule.value !== 'NONE' + ) { const assetAccountData = this.loanProductsTemplate.accountingMappingOptions.assetAccountOptions || []; const incomeAccountData = this.loanProductsTemplate.accountingMappingOptions.incomeAccountOptions || []; const expenseAccountData = this.loanProductsTemplate.accountingMappingOptions.expenseAccountOptions || []; const liabilityAccountData = this.loanProductsTemplate.accountingMappingOptions.liabilityAccountOptions || []; - const assetAndLiabilityAccountData = this.loanProductsTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions || []; + const assetAndLiabilityAccountData = + this.loanProductsTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions || []; const chargeOffReasonOptions: any = this.loanProductsTemplate.chargeOffReasonOptions || []; this.accountingMappings = { - 'fundSourceAccount': this.glAccountLookUp(this.loanProduct.fundSourceAccountId, assetAndLiabilityAccountData), - 'loanPortfolioAccount': this.glAccountLookUp(this.loanProduct.loanPortfolioAccountId, assetAccountData), - 'receivableInterestAccount': this.glAccountLookUp(this.loanProduct.receivableInterestAccountId, assetAccountData), - 'receivableFeeAccount': this.glAccountLookUp(this.loanProduct.receivableFeeAccountId, assetAccountData), - 'receivablePenaltyAccount': this.glAccountLookUp(this.loanProduct.receivablePenaltyAccountId, assetAccountData), - 'transfersInSuspenseAccount': this.glAccountLookUp(this.loanProduct.transfersInSuspenseAccountId, assetAccountData), + fundSourceAccount: this.glAccountLookUp(this.loanProduct.fundSourceAccountId, assetAndLiabilityAccountData), + loanPortfolioAccount: this.glAccountLookUp(this.loanProduct.loanPortfolioAccountId, assetAccountData), + receivableInterestAccount: this.glAccountLookUp( + this.loanProduct.receivableInterestAccountId, + assetAccountData + ), + receivableFeeAccount: this.glAccountLookUp(this.loanProduct.receivableFeeAccountId, assetAccountData), + receivablePenaltyAccount: this.glAccountLookUp(this.loanProduct.receivablePenaltyAccountId, assetAccountData), + transfersInSuspenseAccount: this.glAccountLookUp( + this.loanProduct.transfersInSuspenseAccountId, + assetAccountData + ), - 'interestOnLoanAccount': this.glAccountLookUp(this.loanProduct.interestOnLoanAccountId, incomeAccountData), - 'incomeFromFeeAccount': this.glAccountLookUp(this.loanProduct.incomeFromFeeAccountId, incomeAccountData), - 'incomeFromPenaltyAccount': this.glAccountLookUp(this.loanProduct.incomeFromPenaltyAccountId, incomeAccountData), - 'incomeFromRecoveryAccount': this.glAccountLookUp(this.loanProduct.incomeFromRecoveryAccountId, incomeAccountData), - 'incomeFromChargeOffInterestAccount': this.glAccountLookUp(this.loanProduct.incomeFromChargeOffInterestAccountId, incomeAccountData), - 'incomeFromChargeOffFeesAccount': this.glAccountLookUp(this.loanProduct.incomeFromChargeOffFeesAccountId, incomeAccountData), - 'incomeFromChargeOffPenaltyAccount': this.glAccountLookUp(this.loanProduct.incomeFromChargeOffPenaltyAccountId, incomeAccountData), + interestOnLoanAccount: this.glAccountLookUp(this.loanProduct.interestOnLoanAccountId, incomeAccountData), + incomeFromFeeAccount: this.glAccountLookUp(this.loanProduct.incomeFromFeeAccountId, incomeAccountData), + incomeFromPenaltyAccount: this.glAccountLookUp( + this.loanProduct.incomeFromPenaltyAccountId, + incomeAccountData + ), + incomeFromRecoveryAccount: this.glAccountLookUp( + this.loanProduct.incomeFromRecoveryAccountId, + incomeAccountData + ), + incomeFromChargeOffInterestAccount: this.glAccountLookUp( + this.loanProduct.incomeFromChargeOffInterestAccountId, + incomeAccountData + ), + incomeFromChargeOffFeesAccount: this.glAccountLookUp( + this.loanProduct.incomeFromChargeOffFeesAccountId, + incomeAccountData + ), + incomeFromChargeOffPenaltyAccount: this.glAccountLookUp( + this.loanProduct.incomeFromChargeOffPenaltyAccountId, + incomeAccountData + ), - 'writeOffAccount': this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData), - 'goodwillCreditAccount': this.glAccountLookUp(this.loanProduct.goodwillCreditAccountId, expenseAccountData), - 'chargeOffExpenseAccount': this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData), - 'chargeOffFraudExpenseAccount': this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData), + writeOffAccount: this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData), + goodwillCreditAccount: this.glAccountLookUp(this.loanProduct.goodwillCreditAccountId, expenseAccountData), + chargeOffExpenseAccount: this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData), + chargeOffFraudExpenseAccount: this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData), - 'overpaymentLiabilityAccount': this.glAccountLookUp(this.loanProduct.overpaymentLiabilityAccountId, liabilityAccountData), + overpaymentLiabilityAccount: this.glAccountLookUp( + this.loanProduct.overpaymentLiabilityAccountId, + liabilityAccountData + ) }; this.paymentChannelToFundSourceMappings = []; @@ -145,106 +197,159 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges { this.chargeOffReasonToExpenseAccountMappings = []; if (this.loanProduct.chargeOffReasonToExpenseAccountMappings?.length > 0) { - this.loanProduct.chargeOffReasonToExpenseAccountMappings.forEach((m: ChargeOffReasonToExpenseAccountMapping) => { - let optionData = this.optionDataLookUp(m.chargeOffReasonCodeValueId, chargeOffReasonOptions); - this.chargeOffReasonToExpenseAccountMappings.push({ - expenseAccount: this.glAccountLookUp(m.expenseAccountId, expenseAccountData), - chargeOffReasonCodeValue: { - id: optionData.id, - name: optionData.value - } as ChargeOffReasonCodeValue - }); - }); + this.loanProduct.chargeOffReasonToExpenseAccountMappings.forEach( + (m: ChargeOffReasonToExpenseAccountMapping) => { + let optionData = this.optionDataLookUp(m.chargeOffReasonCodeValueId, chargeOffReasonOptions); + this.chargeOffReasonToExpenseAccountMappings.push({ + expenseAccount: this.glAccountLookUp(m.expenseAccountId, expenseAccountData), + chargeOffReasonCodeValue: { + id: optionData.id, + name: optionData.value + } as ChargeOffReasonCodeValue + }); + } + ); } } if (this.loanProduct.isInterestRecalculationEnabled) { this.loanProduct.interestRecalculationData = { - interestRecalculationCompoundingType: this.optionDataLookUp(this.loanProduct.interestRecalculationCompoundingMethod, - this.loanProductsTemplate.interestRecalculationCompoundingTypeOptions), - rescheduleStrategyType: this.optionDataLookUp(this.loanProduct.rescheduleStrategyMethod, - this.loanProductsTemplate.rescheduleStrategyTypeOptions), - recalculationCompoundingFrequencyType: this.optionDataLookUp(this.loanProduct.recalculationCompoundingFrequencyType, - this.loanProductsTemplate.interestRecalculationFrequencyTypeOptions), - recalculationRestFrequencyType: this.optionDataLookUp(this.loanProduct.recalculationRestFrequencyType, - this.loanProductsTemplate.interestRecalculationFrequencyTypeOptions), - preClosureInterestCalculationStrategy: this.optionDataLookUp(this.loanProduct.preClosureInterestCalculationStrategy, - this.loanProductsTemplate.preClosureInterestCalculationStrategyOptions), + interestRecalculationCompoundingType: this.optionDataLookUp( + this.loanProduct.interestRecalculationCompoundingMethod, + this.loanProductsTemplate.interestRecalculationCompoundingTypeOptions + ), + rescheduleStrategyType: this.optionDataLookUp( + this.loanProduct.rescheduleStrategyMethod, + this.loanProductsTemplate.rescheduleStrategyTypeOptions + ), + recalculationCompoundingFrequencyType: this.optionDataLookUp( + this.loanProduct.recalculationCompoundingFrequencyType, + this.loanProductsTemplate.interestRecalculationFrequencyTypeOptions + ), + recalculationRestFrequencyType: this.optionDataLookUp( + this.loanProduct.recalculationRestFrequencyType, + this.loanProductsTemplate.interestRecalculationFrequencyTypeOptions + ), + preClosureInterestCalculationStrategy: this.optionDataLookUp( + this.loanProduct.preClosureInterestCalculationStrategy, + this.loanProductsTemplate.preClosureInterestCalculationStrategyOptions + ), allowCompoundingOnEod: this.loanProduct.allowCompoundingOnEod, isArrearsBasedOnOriginalSchedule: this.loanProduct.isArrearsBasedOnOriginalSchedule, isCompoundingToBePostedAsTransaction: this.loanProduct.isCompoundingToBePostedAsTransaction, recalculationRestFrequencyInterval: this.loanProduct.recalculationRestFrequencyInterval, - disallowInterestCalculationOnPastDue: this.loanProduct.disallowInterestCalculationOnPastDue, + disallowInterestCalculationOnPastDue: this.loanProduct.disallowInterestCalculationOnPastDue }; } - let optionValue: OptionData = this.optionDataLookUp(this.loanProduct.amortizationType, this.loanProductsTemplate.amortizationTypeOptions); + let optionValue: OptionData = this.optionDataLookUp( + this.loanProduct.amortizationType, + this.loanProductsTemplate.amortizationTypeOptions + ); this.loanProduct.amortizationType = optionValue; optionValue = this.optionDataLookUp(this.loanProduct.interestType, this.loanProductsTemplate.interestTypeOptions); this.loanProduct.interestType = optionValue; - optionValue = this.optionDataLookUp(this.loanProduct.interestCalculationPeriodType, this.loanProductsTemplate.interestCalculationPeriodTypeOptions); + optionValue = this.optionDataLookUp( + this.loanProduct.interestCalculationPeriodType, + this.loanProductsTemplate.interestCalculationPeriodTypeOptions + ); this.loanProduct.interestCalculationPeriodType = optionValue; if (!this.loanProduct.repaymentFrequencyType || !this.loanProduct.repaymentFrequencyType.value) { - optionValue = this.optionDataLookUp(this.loanProduct.repaymentFrequencyType, this.loanProductsTemplate.repaymentFrequencyTypeOptions); + optionValue = this.optionDataLookUp( + this.loanProduct.repaymentFrequencyType, + this.loanProductsTemplate.repaymentFrequencyTypeOptions + ); this.loanProduct.repaymentFrequencyType = optionValue; } - optionValue = this.optionDataLookUp(this.loanProduct.daysInMonthType, this.loanProductsTemplate.daysInMonthTypeOptions); + optionValue = this.optionDataLookUp( + this.loanProduct.daysInMonthType, + this.loanProductsTemplate.daysInMonthTypeOptions + ); this.loanProduct.daysInMonthType = optionValue; - optionValue = this.optionDataLookUp(this.loanProduct.daysInYearType, this.loanProductsTemplate.daysInYearTypeOptions); + optionValue = this.optionDataLookUp( + this.loanProduct.daysInYearType, + this.loanProductsTemplate.daysInYearTypeOptions + ); this.loanProduct.daysInYearType = optionValue; - optionValue = this.optionDataLookUp(this.loanProduct.interestRateFrequencyType, this.loanProductsTemplate.interestRateFrequencyTypeOptions); + optionValue = this.optionDataLookUp( + this.loanProduct.interestRateFrequencyType, + this.loanProductsTemplate.interestRateFrequencyTypeOptions + ); this.loanProduct.interestRateFrequencyType = optionValue; - optionValue = this.optionDataLookUp(this.loanProduct.repaymentStartDateType, this.loanProductsTemplate.repaymentStartDateTypeOptions); + optionValue = this.optionDataLookUp( + this.loanProduct.repaymentStartDateType, + this.loanProductsTemplate.repaymentStartDateTypeOptions + ); this.loanProduct.repaymentStartDateType = optionValue; if (this.loanProduct.delinquencyBucketId) { - this.loanProduct.delinquencyBucket = this.delinquencyBucketLookUp(this.loanProduct.delinquencyBucketId, this.loanProductsTemplate.delinquencyBucketOptions); + this.loanProduct.delinquencyBucket = this.delinquencyBucketLookUp( + this.loanProduct.delinquencyBucketId, + this.loanProductsTemplate.delinquencyBucketOptions + ); } - const codeValue: CodeName = this.codeNameLookUpByCode(this.loanProduct.transactionProcessingStrategyCode, - this.loanProductsTemplate.transactionProcessingStrategyOptions); + const codeValue: CodeName = this.codeNameLookUpByCode( + this.loanProduct.transactionProcessingStrategyCode, + this.loanProductsTemplate.transactionProcessingStrategyOptions + ); this.loanProduct.transactionProcessingStrategyName = codeValue.name; if (!this.loanProduct.loanScheduleType || !this.loanProduct.loanScheduleType.value) { - this.loanProduct.loanScheduleType = this.optionDataLookUpByCode(this.loanProduct.loanScheduleType, - this.loanProductsTemplate.loanScheduleTypeOptions); + this.loanProduct.loanScheduleType = this.optionDataLookUpByCode( + this.loanProduct.loanScheduleType, + this.loanProductsTemplate.loanScheduleTypeOptions + ); } if (this.isAdvancedPaymentAllocation) { if (!this.loanProduct.loanScheduleProcessingType || !this.loanProduct.loanScheduleProcessingType.value) { - this.loanProduct.loanScheduleProcessingType = this.optionDataLookUpByCode(this.loanProduct.loanScheduleProcessingType, - this.loanProductsTemplate.loanScheduleProcessingTypeOptions); + this.loanProduct.loanScheduleProcessingType = this.optionDataLookUpByCode( + this.loanProduct.loanScheduleProcessingType, + this.loanProductsTemplate.loanScheduleProcessingTypeOptions + ); } if (!this.loanProduct.chargeOffBehaviour.value) { - this.loanProduct.chargeOffBehaviour = this.stringEnumOptionDataLookUp(this.loanProduct.chargeOffBehaviour, this.loanProductsTemplate.chargeOffBehaviourOptions); + this.loanProduct.chargeOffBehaviour = this.stringEnumOptionDataLookUp( + this.loanProduct.chargeOffBehaviour, + this.loanProductsTemplate.chargeOffBehaviourOptions + ); } } } if (this.loanProduct.advancedPaymentAllocationTransactionTypes) { - const advancedAllocationTransactionTypes: OptionData[] = this.loanProduct.advancedPaymentAllocationTransactionTypes - .concat(this.loanProduct.creditAllocationTransactionTypes); - const advancedPaymentAllocationTypes: OptionData[] = this.loanProduct.advancedPaymentAllocationTypes - .concat(this.loanProduct.creditAllocationAllocationTypes); + const advancedAllocationTransactionTypes: OptionData[] = + this.loanProduct.advancedPaymentAllocationTransactionTypes.concat( + this.loanProduct.creditAllocationTransactionTypes + ); + const advancedPaymentAllocationTypes: OptionData[] = this.loanProduct.advancedPaymentAllocationTypes.concat( + this.loanProduct.creditAllocationAllocationTypes + ); this.advancePaymentAllocationData = { transactionTypes: advancedAllocationTransactionTypes, allocationTypes: advancedPaymentAllocationTypes, futureInstallmentAllocationRules: this.loanProduct.advancedPaymentAllocationFutureInstallmentAllocationRules }; } else { - const advancedAllocationTransactionTypes: OptionData[] = this.loanProductsTemplate.advancedPaymentAllocationTransactionTypes - .concat(this.loanProductsTemplate.creditAllocationTransactionTypes); - const advancedPaymentAllocationTypes: OptionData[] = this.loanProductsTemplate.advancedPaymentAllocationTypes - .concat(this.loanProductsTemplate.creditAllocationAllocationTypes); + const advancedAllocationTransactionTypes: OptionData[] = + this.loanProductsTemplate.advancedPaymentAllocationTransactionTypes.concat( + this.loanProductsTemplate.creditAllocationTransactionTypes + ); + const advancedPaymentAllocationTypes: OptionData[] = + this.loanProductsTemplate.advancedPaymentAllocationTypes.concat( + this.loanProductsTemplate.creditAllocationAllocationTypes + ); this.advancePaymentAllocationData = { transactionTypes: advancedAllocationTransactionTypes, allocationTypes: advancedPaymentAllocationTypes, - futureInstallmentAllocationRules: this.loanProductsTemplate.advancedPaymentAllocationFutureInstallmentAllocationRules + futureInstallmentAllocationRules: + this.loanProductsTemplate.advancedPaymentAllocationFutureInstallmentAllocationRules }; } } @@ -357,8 +462,7 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges { } accountingRule(): number { - return this.loanProduct.accountingRule.id ? - this.loanProduct.accountingRule.id : this.loanProduct.accountingRule; + return this.loanProduct.accountingRule.id ? this.loanProduct.accountingRule.id : this.loanProduct.accountingRule; } get isAccountingAccrualBased(): boolean { @@ -366,14 +470,16 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges { } isAccountingEnabled(): boolean { - return (this.accountingRule() >= 2); + return this.accountingRule() >= 2; } isAdvancedAccountingEnabled(): boolean { - return (this.loanProduct.paymentChannelToFundSourceMappings?.length > 0 - || this.loanProduct.feeToIncomeAccountMappings?.length > 0 - || this.loanProduct.penaltyToIncomeAccountMappings?.length > 0 - || this.loanProduct.chargeOffReasonToExpenseAccountMappings?.length > 0); + return ( + this.loanProduct.paymentChannelToFundSourceMappings?.length > 0 || + this.loanProduct.feeToIncomeAccountMappings?.length > 0 || + this.loanProduct.penaltyToIncomeAccountMappings?.length > 0 || + this.loanProduct.chargeOffReasonToExpenseAccountMappings?.length > 0 + ); } getAccountingRuleName(value: string): string { @@ -381,7 +487,6 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges { } mapHumanReadableValueStringEnumOptionDataList(incomingParameter: StringEnumOptionData[]): string[] { - return incomingParameter.map(v => v.value); + return incomingParameter.map((v) => v.value); } - } diff --git a/src/app/products/loan-products/create-loan-product/create-loan-product.component.spec.ts b/src/app/products/loan-products/create-loan-product/create-loan-product.component.spec.ts index 1991ac41d..a4995635a 100644 --- a/src/app/products/loan-products/create-loan-product/create-loan-product.component.spec.ts +++ b/src/app/products/loan-products/create-loan-product/create-loan-product.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateLoanProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateLoanProductComponent ] - }) - .compileComponents(); + declarations: [CreateLoanProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/loan-products/create-loan-product/create-loan-product.component.ts b/src/app/products/loan-products/create-loan-product/create-loan-product.component.ts index b3a11e353..7f85d76ad 100644 --- a/src/app/products/loan-products/create-loan-product/create-loan-product.component.ts +++ b/src/app/products/loan-products/create-loan-product/create-loan-product.component.ts @@ -14,7 +14,11 @@ import { LoanProductInterestRefundStepComponent } from '../loan-product-stepper/ /** Custom Services */ import { ProductsService } from 'app/products/products.service'; import { LoanProducts } from '../loan-products'; -import { AdvancedPaymentAllocation, AdvancedPaymentStrategy, PaymentAllocation } from '../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model'; +import { + AdvancedPaymentAllocation, + AdvancedPaymentStrategy, + PaymentAllocation +} from '../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model'; import { Accounting } from 'app/core/utils/accounting'; import { StringEnumOptionData } from '../../../shared/models/option-data.model'; @@ -24,14 +28,17 @@ import { StringEnumOptionData } from '../../../shared/models/option-data.model'; styleUrls: ['./create-loan-product.component.scss'] }) export class CreateLoanProductComponent implements OnInit { - @ViewChild(LoanProductDetailsStepComponent, { static: true }) loanProductDetailsStep: LoanProductDetailsStepComponent; - @ViewChild(LoanProductCurrencyStepComponent, { static: true }) loanProductCurrencyStep: LoanProductCurrencyStepComponent; - @ViewChild(LoanProductInterestRefundStepComponent, {static: true}) loanProductInterestRefundStep: LoanProductInterestRefundStepComponent; + @ViewChild(LoanProductCurrencyStepComponent, { static: true }) + loanProductCurrencyStep: LoanProductCurrencyStepComponent; + @ViewChild(LoanProductInterestRefundStepComponent, { static: true }) + loanProductInterestRefundStep: LoanProductInterestRefundStepComponent; @ViewChild(LoanProductTermsStepComponent, { static: true }) loanProductTermsStep: LoanProductTermsStepComponent; - @ViewChild(LoanProductSettingsStepComponent, { static: true }) loanProductSettingsStep: LoanProductSettingsStepComponent; + @ViewChild(LoanProductSettingsStepComponent, { static: true }) + loanProductSettingsStep: LoanProductSettingsStepComponent; @ViewChild(LoanProductChargesStepComponent, { static: true }) loanProductChargesStep: LoanProductChargesStepComponent; - @ViewChild(LoanProductAccountingStepComponent, { static: true }) loanProductAccountingStep: LoanProductAccountingStepComponent; + @ViewChild(LoanProductAccountingStepComponent, { static: true }) + loanProductAccountingStep: LoanProductAccountingStepComponent; loanProductsTemplate: any; accountingRuleData: string[] = []; @@ -44,23 +51,26 @@ export class CreateLoanProductComponent implements OnInit { advancedPaymentAllocations: AdvancedPaymentAllocation[] = []; advancedCreditAllocations: AdvancedPaymentAllocation[] = []; - /** - * @param {ActivatedRoute} route Activated Route. - * @param {ProductsService} productsService Product Service. - * @param {LoanProducts} loanProducts LoanProducts - * @param {Router} router Router for navigation. - */ - constructor(private route: ActivatedRoute, - private productsService: ProductsService, - private loanProducts: LoanProducts, - private router: Router, - private accounting: Accounting, - private advancedPaymentStrategy: AdvancedPaymentStrategy) { - this.route.data.subscribe((data: { loanProductsTemplate: any, configurations: any }) => { + /** + * @param {ActivatedRoute} route Activated Route. + * @param {ProductsService} productsService Product Service. + * @param {LoanProducts} loanProducts LoanProducts + * @param {Router} router Router for navigation. + */ + constructor( + private route: ActivatedRoute, + private productsService: ProductsService, + private loanProducts: LoanProducts, + private router: Router, + private accounting: Accounting, + private advancedPaymentStrategy: AdvancedPaymentStrategy + ) { + this.route.data.subscribe((data: { loanProductsTemplate: any; configurations: any }) => { this.loanProductsTemplate = data.loanProductsTemplate; const assetAccountData = this.loanProductsTemplate.accountingMappingOptions.assetAccountOptions || []; const liabilityAccountData = this.loanProductsTemplate.accountingMappingOptions.liabilityAccountOptions || []; - this.loanProductsTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions = assetAccountData.concat(liabilityAccountData); + this.loanProductsTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions = + assetAccountData.concat(liabilityAccountData); this.itemsByDefault = loanProducts.setItemsByDefault(data.configurations); this.loanProductsTemplate['itemsByDefault'] = this.itemsByDefault; @@ -98,7 +108,9 @@ export class CreateLoanProductComponent implements OnInit { } buildAdvancedPaymentAllocation(): void { - this.advancedPaymentAllocations = this.advancedPaymentStrategy.buildAdvancedPaymentAllocationList(this.loanProductsTemplate); + this.advancedPaymentAllocations = this.advancedPaymentStrategy.buildAdvancedPaymentAllocationList( + this.loanProductsTemplate + ); } setPaymentAllocation(paymentAllocation: PaymentAllocation[]): void { @@ -155,22 +167,29 @@ export class CreateLoanProductComponent implements OnInit { loanProduct['overDueDaysForRepaymentEvent'] = null; } if (this.isAdvancedPaymentStrategy) { - loanProduct['supportedInterestRefundTypes'] = this.mapStringEnumOptionToIdList(loanProduct['supportedInterestRefundTypes']); + loanProduct['supportedInterestRefundTypes'] = this.mapStringEnumOptionToIdList( + loanProduct['supportedInterestRefundTypes'] + ); } else { delete loanProduct['supportedInterestRefundTypes']; } delete loanProduct['useDueForRepaymentsConfigurations']; - this.productsService.createLoanProduct(loanProduct) - .subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); - }); + this.productsService.createLoanProduct(loanProduct).subscribe((response: any) => { + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); + }); } mapStringEnumOptionToIdList(incomingValues: StringEnumOptionData[]): string[] { if (!incomingValues) { return []; } - return incomingValues.map(v => v.id); + return incomingValues.map((v) => v.id); } } diff --git a/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.spec.ts b/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.spec.ts index 07abd03eb..82a492cdc 100644 --- a/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.spec.ts +++ b/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.spec.ts @@ -8,9 +8,8 @@ describe('EditLoanProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditLoanProductComponent ] - }) - .compileComponents(); + declarations: [EditLoanProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts b/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts index 1d3034e72..01d4e4357 100644 --- a/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts +++ b/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts @@ -14,7 +14,13 @@ import { LoanProductAccountingStepComponent } from '../loan-product-stepper/loan import { ProductsService } from 'app/products/products.service'; import { GlobalConfiguration } from 'app/system/configurations/global-configurations-tab/configuration.model'; import { LoanProducts } from '../loan-products'; -import { AdvancedCreditAllocation, AdvancedPaymentAllocation, AdvancedPaymentStrategy, CreditAllocation, PaymentAllocation } from '../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model'; +import { + AdvancedCreditAllocation, + AdvancedPaymentAllocation, + AdvancedPaymentStrategy, + CreditAllocation, + PaymentAllocation +} from '../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model'; import { Accounting } from 'app/core/utils/accounting'; import { LoanProductInterestRefundStepComponent } from '../loan-product-stepper/loan-product-interest-refund-step/loan-product-interest-refund-step.component'; import { StringEnumOptionData } from '../../../shared/models/option-data.model'; @@ -25,14 +31,17 @@ import { StringEnumOptionData } from '../../../shared/models/option-data.model'; styleUrls: ['./edit-loan-product.component.scss'] }) export class EditLoanProductComponent implements OnInit { - @ViewChild(LoanProductDetailsStepComponent, { static: true }) loanProductDetailsStep: LoanProductDetailsStepComponent; - @ViewChild(LoanProductCurrencyStepComponent, { static: true }) loanProductCurrencyStep: LoanProductCurrencyStepComponent; - @ViewChild(LoanProductInterestRefundStepComponent, { static: true }) loanProductInterestRefundStep: LoanProductInterestRefundStepComponent; + @ViewChild(LoanProductCurrencyStepComponent, { static: true }) + loanProductCurrencyStep: LoanProductCurrencyStepComponent; + @ViewChild(LoanProductInterestRefundStepComponent, { static: true }) + loanProductInterestRefundStep: LoanProductInterestRefundStepComponent; @ViewChild(LoanProductTermsStepComponent, { static: true }) loanProductTermsStep: LoanProductTermsStepComponent; - @ViewChild(LoanProductSettingsStepComponent, { static: true }) loanProductSettingsStep: LoanProductSettingsStepComponent; + @ViewChild(LoanProductSettingsStepComponent, { static: true }) + loanProductSettingsStep: LoanProductSettingsStepComponent; @ViewChild(LoanProductChargesStepComponent, { static: true }) loanProductChargesStep: LoanProductChargesStepComponent; - @ViewChild(LoanProductAccountingStepComponent, { static: true }) loanProductAccountingStep: LoanProductAccountingStepComponent; + @ViewChild(LoanProductAccountingStepComponent, { static: true }) + loanProductAccountingStep: LoanProductAccountingStepComponent; loanProductAndTemplate: any; accountingRuleData: string[] = []; @@ -53,17 +62,20 @@ export class EditLoanProductComponent implements OnInit { * @param {Router} router Router for navigation. */ - constructor(private route: ActivatedRoute, - private productsService: ProductsService, - private loanProducts: LoanProducts, - private router: Router, - private accounting: Accounting, - private advancedPaymentStrategy: AdvancedPaymentStrategy) { - this.route.data.subscribe((data: { loanProductAndTemplate: any, configurations: any }) => { + constructor( + private route: ActivatedRoute, + private productsService: ProductsService, + private loanProducts: LoanProducts, + private router: Router, + private accounting: Accounting, + private advancedPaymentStrategy: AdvancedPaymentStrategy + ) { + this.route.data.subscribe((data: { loanProductAndTemplate: any; configurations: any }) => { this.loanProductAndTemplate = data.loanProductAndTemplate; const assetAccountData = this.loanProductAndTemplate.accountingMappingOptions.assetAccountOptions || []; const liabilityAccountData = this.loanProductAndTemplate.accountingMappingOptions.liabilityAccountOptions || []; - this.loanProductAndTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions = assetAccountData.concat(liabilityAccountData); + this.loanProductAndTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions = + assetAccountData.concat(liabilityAccountData); this.itemsByDefault = loanProducts.setItemsByDefault(data.configurations); this.loanProductAndTemplate['itemsByDefault'] = this.itemsByDefault; @@ -108,8 +120,12 @@ export class EditLoanProductComponent implements OnInit { } buildAdvancedPaymentAllocation(): void { - this.advancedPaymentAllocations = this.advancedPaymentStrategy.buildAdvancedPaymentAllocationList(this.loanProductAndTemplate); - this.advancedCreditAllocations = this.advancedPaymentStrategy.buildAdvancedCreditAllocationList(this.loanProductAndTemplate); + this.advancedPaymentAllocations = this.advancedPaymentStrategy.buildAdvancedPaymentAllocationList( + this.loanProductAndTemplate + ); + this.advancedCreditAllocations = this.advancedPaymentStrategy.buildAdvancedCreditAllocationList( + this.loanProductAndTemplate + ); } setPaymentAllocation(paymentAllocation: PaymentAllocation[]): void { @@ -141,15 +157,13 @@ export class EditLoanProductComponent implements OnInit { this.loanProductTermsForm.valid && this.loanProductSettingsForm.valid && this.loanProductAccountingForm.valid && - ( - !this.loanProductDetailsForm.pristine || + (!this.loanProductDetailsForm.pristine || !this.loanProductCurrencyForm.pristine || !this.loanProductTermsForm.pristine || !this.loanProductSettingsForm.pristine || !this.loanProductChargesStep.pristine || !this.loanProductAccountingForm.pristine || - this.wasPaymentAllocationChanged - ) + this.wasPaymentAllocationChanged) ); } @@ -181,20 +195,26 @@ export class EditLoanProductComponent implements OnInit { loanProduct['overDueDaysForRepaymentEvent'] = null; } if (this.isAdvancedPaymentStrategy) { - loanProduct['supportedInterestRefundTypes'] = this.mapStringEnumOptionToIdList(loanProduct['supportedInterestRefundTypes']); + loanProduct['supportedInterestRefundTypes'] = this.mapStringEnumOptionToIdList( + loanProduct['supportedInterestRefundTypes'] + ); } else { delete loanProduct['supportedInterestRefundTypes']; } delete loanProduct['useDueForRepaymentsConfigurations']; - this.productsService.updateLoanProduct(this.loanProductAndTemplate.id, loanProduct) - .subscribe((response: any) => { - this.router.navigate(['../../', response.resourceId], { relativeTo: this.route }); - }); + this.productsService.updateLoanProduct(this.loanProductAndTemplate.id, loanProduct).subscribe((response: any) => { + this.router.navigate( + [ + '../../', + response.resourceId + ], + { relativeTo: this.route } + ); + }); } mapStringEnumOptionToIdList(incomingValues: StringEnumOptionData[]): string[] { - return incomingValues.map(v => v.id); + return incomingValues.map((v) => v.id); } - } diff --git a/src/app/products/loan-products/edit-loan-product/loan-product-and-template.resolver.ts b/src/app/products/loan-products/edit-loan-product/loan-product-and-template.resolver.ts index ae8118bff..89a3694d7 100644 --- a/src/app/products/loan-products/edit-loan-product/loan-product-and-template.resolver.ts +++ b/src/app/products/loan-products/edit-loan-product/loan-product-and-template.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../../products.service'; */ @Injectable() export class LoanProductAndTemplateResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -27,5 +26,4 @@ export class LoanProductAndTemplateResolver implements Resolve { const loanProductId = route.parent.paramMap.get('productId'); return this.productsService.getLoanProduct(loanProductId, true); } - } diff --git a/src/app/products/loan-products/loan-product-datatable.resolver.ts b/src/app/products/loan-products/loan-product-datatable.resolver.ts index 443762861..08a0c99ad 100644 --- a/src/app/products/loan-products/loan-product-datatable.resolver.ts +++ b/src/app/products/loan-products/loan-product-datatable.resolver.ts @@ -7,11 +7,10 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class LoanProductDatatableResolver implements Resolve { - /** * @param {SystemService} systemService Products service. */ - constructor(private systemService: SystemService) { } + constructor(private systemService: SystemService) {} /** * Returns the loan product data. @@ -22,5 +21,4 @@ export class LoanProductDatatableResolver implements Resolve { const datatableName = route.paramMap.get('datatableName'); return this.systemService.getEntityDatatable(productId, datatableName); } - } diff --git a/src/app/products/loan-products/loan-product-datatables.resolver.ts b/src/app/products/loan-products/loan-product-datatables.resolver.ts index 3ac77bee4..a12ac6e58 100644 --- a/src/app/products/loan-products/loan-product-datatables.resolver.ts +++ b/src/app/products/loan-products/loan-product-datatables.resolver.ts @@ -7,11 +7,10 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class LoanProductDatatablesResolver implements Resolve { - /** * @param {SystemService} systemService Products service. */ - constructor(private systemService: SystemService) { } + constructor(private systemService: SystemService) {} /** * Returns the loan product data. diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.html b/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.html index 00ffe5115..ad99a60cd 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.html +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.html @@ -302,7 +302,11 @@ > - @@ -467,7 +471,11 @@ > - diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.spec.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.spec.ts index c54daa1c3..a37505097 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.spec.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanProductAccountingStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanProductAccountingStepComponent ] - }) - .compileComponents(); + declarations: [LoanProductAccountingStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts index 8ac3c97c2..8fdf30877 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts @@ -16,7 +16,6 @@ import { ChargeOffReasonToExpenseAccountMapping } from 'app/shared/models/genera styleUrls: ['./loan-product-accounting-step.component.scss'] }) export class LoanProductAccountingStepComponent implements OnInit { - @Input() loanProductsTemplate: any; @Input() accountingRuleData: any; @Input() loanProductFormValid: boolean; @@ -37,13 +36,27 @@ export class LoanProductAccountingStepComponent implements OnInit { currentFormValues: any[] = []; allowAddChargeOffReasonExpense = true; - paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId', 'actions']; - feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId', 'actions']; - chargeOffReasonExpenseDisplayedColumns: string[] = ['chargeOffReasonCodeValueId', 'expenseAccountId', 'actions']; + paymentFundSourceDisplayedColumns: string[] = [ + 'paymentTypeId', + 'fundSourceAccountId', + 'actions' + ]; + feesPenaltyIncomeDisplayedColumns: string[] = [ + 'chargeId', + 'incomeAccountId', + 'actions' + ]; + chargeOffReasonExpenseDisplayedColumns: string[] = [ + 'chargeOffReasonCodeValueId', + 'expenseAccountId', + 'actions' + ]; - constructor(private formBuilder: UntypedFormBuilder, - public dialog: MatDialog, - private translateService: TranslateService) { + constructor( + private formBuilder: UntypedFormBuilder, + public dialog: MatDialog, + private translateService: TranslateService + ) { this.createLoanProductAccountingForm(); this.setConditionalControls(); } @@ -57,11 +70,12 @@ export class LoanProductAccountingStepComponent implements OnInit { this.expenseAccountData = this.loanProductsTemplate.accountingMappingOptions.expenseAccountOptions || []; this.liabilityAccountData = this.loanProductsTemplate.accountingMappingOptions.liabilityAccountOptions || []; this.incomeAndLiabilityAccountData = this.incomeAccountData.concat(this.liabilityAccountData); - this.assetAndLiabilityAccountData = this.loanProductsTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions || []; + this.assetAndLiabilityAccountData = + this.loanProductsTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions || []; this.chargeOffReasonOptions = this.loanProductsTemplate.chargeOffReasonOptions || []; this.loanProductAccountingForm.patchValue({ - 'accountingRule': this.loanProductsTemplate.accountingRule.id + accountingRule: this.loanProductsTemplate.accountingRule.id }); const accountingMappings = this.loanProductsTemplate.accountingMappings; @@ -69,130 +83,244 @@ export class LoanProductAccountingStepComponent implements OnInit { case 3: case 4: this.loanProductAccountingForm.patchValue({ - 'receivableInterestAccountId': accountingMappings.receivableInterestAccount.id, - 'receivableFeeAccountId': accountingMappings.receivableFeeAccount.id, - 'receivablePenaltyAccountId': accountingMappings.receivablePenaltyAccount.id, + receivableInterestAccountId: accountingMappings.receivableInterestAccount.id, + receivableFeeAccountId: accountingMappings.receivableFeeAccount.id, + receivablePenaltyAccountId: accountingMappings.receivablePenaltyAccount.id }); this.loanProductAccountingForm.patchValue({ - 'enableAccrualActivityPosting': this.loanProductsTemplate.enableAccrualActivityPosting + enableAccrualActivityPosting: this.loanProductsTemplate.enableAccrualActivityPosting }); - /* falls through */ + /* falls through */ case 2: this.loanProductAccountingForm.patchValue({ - 'fundSourceAccountId': accountingMappings.fundSourceAccount.id, - 'loanPortfolioAccountId': accountingMappings.loanPortfolioAccount.id, - 'transfersInSuspenseAccountId': accountingMappings.transfersInSuspenseAccount.id, - 'interestOnLoanAccountId': accountingMappings.interestOnLoanAccount.id, - 'incomeFromFeeAccountId': accountingMappings.incomeFromFeeAccount.id, - 'incomeFromPenaltyAccountId': accountingMappings.incomeFromPenaltyAccount.id, - 'incomeFromRecoveryAccountId': accountingMappings.incomeFromRecoveryAccount.id, - 'writeOffAccountId': accountingMappings.writeOffAccount.id, - 'goodwillCreditAccountId': accountingMappings.goodwillCreditAccount.id, - 'overpaymentLiabilityAccountId': accountingMappings.overpaymentLiabilityAccount.id, - 'chargeOffFraudExpenseAccountId': accountingMappings.chargeOffFraudExpenseAccount ? accountingMappings.chargeOffFraudExpenseAccount.id : '', - 'chargeOffExpenseAccountId': accountingMappings.chargeOffExpenseAccount ? accountingMappings.chargeOffExpenseAccount.id : '', - 'incomeFromChargeOffPenaltyAccountId': accountingMappings.incomeFromChargeOffPenaltyAccount ? accountingMappings.incomeFromChargeOffPenaltyAccount.id : '', - 'incomeFromChargeOffFeesAccountId': accountingMappings.incomeFromChargeOffFeesAccount ? accountingMappings.incomeFromChargeOffFeesAccount.id : '', - 'incomeFromChargeOffInterestAccountId': accountingMappings.incomeFromChargeOffInterestAccount ? accountingMappings.incomeFromChargeOffInterestAccount.id : '', - 'incomeFromGoodwillCreditInterestAccountId': accountingMappings.incomeFromGoodwillCreditInterestAccount ? accountingMappings.incomeFromGoodwillCreditInterestAccount.id : '', - 'incomeFromGoodwillCreditFeesAccountId': accountingMappings.incomeFromGoodwillCreditFeesAccount ? accountingMappings.incomeFromGoodwillCreditFeesAccount.id : '', - 'incomeFromGoodwillCreditPenaltyAccountId': accountingMappings.incomeFromGoodwillCreditPenaltyAccount ? accountingMappings.incomeFromGoodwillCreditPenaltyAccount.id : '', - 'advancedAccountingRules': (this.loanProductsTemplate.paymentChannelToFundSourceMappings || this.loanProductsTemplate.feeToIncomeAccountMappings || this.loanProductsTemplate.penaltyToIncomeAccountMappings || this.loanProductsTemplate.chargeOffReasonToExpenseAccountMappings) ? true : false + fundSourceAccountId: accountingMappings.fundSourceAccount.id, + loanPortfolioAccountId: accountingMappings.loanPortfolioAccount.id, + transfersInSuspenseAccountId: accountingMappings.transfersInSuspenseAccount.id, + interestOnLoanAccountId: accountingMappings.interestOnLoanAccount.id, + incomeFromFeeAccountId: accountingMappings.incomeFromFeeAccount.id, + incomeFromPenaltyAccountId: accountingMappings.incomeFromPenaltyAccount.id, + incomeFromRecoveryAccountId: accountingMappings.incomeFromRecoveryAccount.id, + writeOffAccountId: accountingMappings.writeOffAccount.id, + goodwillCreditAccountId: accountingMappings.goodwillCreditAccount.id, + overpaymentLiabilityAccountId: accountingMappings.overpaymentLiabilityAccount.id, + chargeOffFraudExpenseAccountId: accountingMappings.chargeOffFraudExpenseAccount + ? accountingMappings.chargeOffFraudExpenseAccount.id + : '', + chargeOffExpenseAccountId: accountingMappings.chargeOffExpenseAccount + ? accountingMappings.chargeOffExpenseAccount.id + : '', + incomeFromChargeOffPenaltyAccountId: accountingMappings.incomeFromChargeOffPenaltyAccount + ? accountingMappings.incomeFromChargeOffPenaltyAccount.id + : '', + incomeFromChargeOffFeesAccountId: accountingMappings.incomeFromChargeOffFeesAccount + ? accountingMappings.incomeFromChargeOffFeesAccount.id + : '', + incomeFromChargeOffInterestAccountId: accountingMappings.incomeFromChargeOffInterestAccount + ? accountingMappings.incomeFromChargeOffInterestAccount.id + : '', + incomeFromGoodwillCreditInterestAccountId: accountingMappings.incomeFromGoodwillCreditInterestAccount + ? accountingMappings.incomeFromGoodwillCreditInterestAccount.id + : '', + incomeFromGoodwillCreditFeesAccountId: accountingMappings.incomeFromGoodwillCreditFeesAccount + ? accountingMappings.incomeFromGoodwillCreditFeesAccount.id + : '', + incomeFromGoodwillCreditPenaltyAccountId: accountingMappings.incomeFromGoodwillCreditPenaltyAccount + ? accountingMappings.incomeFromGoodwillCreditPenaltyAccount.id + : '', + advancedAccountingRules: + this.loanProductsTemplate.paymentChannelToFundSourceMappings || + this.loanProductsTemplate.feeToIncomeAccountMappings || + this.loanProductsTemplate.penaltyToIncomeAccountMappings || + this.loanProductsTemplate.chargeOffReasonToExpenseAccountMappings + ? true + : false }); - this.loanProductAccountingForm.setControl('paymentChannelToFundSourceMappings', - this.formBuilder.array((this.loanProductsTemplate.paymentChannelToFundSourceMappings || []).map((paymentFundSource: any) => - ({ paymentTypeId: paymentFundSource.paymentType.id, fundSourceAccountId: paymentFundSource.fundSourceAccount.id })))); - this.loanProductAccountingForm.setControl('feeToIncomeAccountMappings', - this.formBuilder.array((this.loanProductsTemplate.feeToIncomeAccountMappings || []).map((feesIncome: any) => - ({ chargeId: feesIncome.charge.id, incomeAccountId: feesIncome.incomeAccount.id })))); - this.loanProductAccountingForm.setControl('penaltyToIncomeAccountMappings', - this.formBuilder.array((this.loanProductsTemplate.penaltyToIncomeAccountMappings || []).map((penaltyIncome: any) => - ({ chargeId: penaltyIncome.charge.id, incomeAccountId: penaltyIncome.incomeAccount.id })))); - this.loanProductAccountingForm.setControl('chargeOffReasonToExpenseAccountMappings', - this.formBuilder.array((this.loanProductsTemplate.chargeOffReasonToExpenseAccountMappings || []).map((m: ChargeOffReasonToExpenseAccountMapping) => - ({ chargeOffReasonCodeValueId: m.chargeOffReasonCodeValue.id, expenseAccountId: m.expenseAccount.id })))); + this.loanProductAccountingForm.setControl( + 'paymentChannelToFundSourceMappings', + this.formBuilder.array( + (this.loanProductsTemplate.paymentChannelToFundSourceMappings || []).map((paymentFundSource: any) => ({ + paymentTypeId: paymentFundSource.paymentType.id, + fundSourceAccountId: paymentFundSource.fundSourceAccount.id + })) + ) + ); + this.loanProductAccountingForm.setControl( + 'feeToIncomeAccountMappings', + this.formBuilder.array( + (this.loanProductsTemplate.feeToIncomeAccountMappings || []).map((feesIncome: any) => ({ + chargeId: feesIncome.charge.id, + incomeAccountId: feesIncome.incomeAccount.id + })) + ) + ); + this.loanProductAccountingForm.setControl( + 'penaltyToIncomeAccountMappings', + this.formBuilder.array( + (this.loanProductsTemplate.penaltyToIncomeAccountMappings || []).map((penaltyIncome: any) => ({ + chargeId: penaltyIncome.charge.id, + incomeAccountId: penaltyIncome.incomeAccount.id + })) + ) + ); + this.loanProductAccountingForm.setControl( + 'chargeOffReasonToExpenseAccountMappings', + this.formBuilder.array( + (this.loanProductsTemplate.chargeOffReasonToExpenseAccountMappings || []).map( + (m: ChargeOffReasonToExpenseAccountMapping) => ({ + chargeOffReasonCodeValueId: m.chargeOffReasonCodeValue.id, + expenseAccountId: m.expenseAccount.id + }) + ) + ) + ); } } createLoanProductAccountingForm() { this.loanProductAccountingForm = this.formBuilder.group({ - 'accountingRule': [1] + accountingRule: [1] }); } setConditionalControls() { - this.loanProductAccountingForm.get('accountingRule').valueChanges - .subscribe((accountingRule: any) => { - if (accountingRule >= 2 && accountingRule <= 4) { - this.loanProductAccountingForm.addControl('fundSourceAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('loanPortfolioAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('transfersInSuspenseAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('interestOnLoanAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('incomeFromFeeAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('incomeFromPenaltyAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('incomeFromRecoveryAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('writeOffAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('goodwillCreditAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('overpaymentLiabilityAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('advancedAccountingRules', new UntypedFormControl(false)); - this.loanProductAccountingForm.addControl('chargeOffFraudExpenseAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('chargeOffExpenseAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('incomeFromChargeOffPenaltyAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('incomeFromChargeOffFeesAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('incomeFromChargeOffInterestAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('incomeFromGoodwillCreditInterestAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('incomeFromGoodwillCreditFeesAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('incomeFromGoodwillCreditPenaltyAccountId', new UntypedFormControl('', Validators.required)); + this.loanProductAccountingForm.get('accountingRule').valueChanges.subscribe((accountingRule: any) => { + if (accountingRule >= 2 && accountingRule <= 4) { + this.loanProductAccountingForm.addControl( + 'fundSourceAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'loanPortfolioAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'transfersInSuspenseAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'interestOnLoanAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'incomeFromFeeAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'incomeFromPenaltyAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'incomeFromRecoveryAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl('writeOffAccountId', new UntypedFormControl('', Validators.required)); + this.loanProductAccountingForm.addControl( + 'goodwillCreditAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'overpaymentLiabilityAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl('advancedAccountingRules', new UntypedFormControl(false)); + this.loanProductAccountingForm.addControl( + 'chargeOffFraudExpenseAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'chargeOffExpenseAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'incomeFromChargeOffPenaltyAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'incomeFromChargeOffFeesAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'incomeFromChargeOffInterestAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'incomeFromGoodwillCreditInterestAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'incomeFromGoodwillCreditFeesAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'incomeFromGoodwillCreditPenaltyAccountId', + new UntypedFormControl('', Validators.required) + ); - this.loanProductAccountingForm.get('advancedAccountingRules').valueChanges - .subscribe((advancedAccountingRules: boolean) => { - if (advancedAccountingRules) { - this.loanProductAccountingForm.addControl('paymentChannelToFundSourceMappings', this.formBuilder.array([])); - this.loanProductAccountingForm.addControl('feeToIncomeAccountMappings', this.formBuilder.array([])); - this.loanProductAccountingForm.addControl('penaltyToIncomeAccountMappings', this.formBuilder.array([])); - this.loanProductAccountingForm.addControl('chargeOffReasonToExpenseAccountMappings', this.formBuilder.array([])); - } else { - this.loanProductAccountingForm.removeControl('paymentChannelToFundSourceMappings'); - this.loanProductAccountingForm.removeControl('feeToIncomeAccountMappings'); - this.loanProductAccountingForm.removeControl('penaltyToIncomeAccountMappings'); - this.loanProductAccountingForm.removeControl('chargeOffReasonToExpenseAccountMappings'); - } - }); - } else { - this.loanProductAccountingForm.removeControl('fundSourceAccountId'); - this.loanProductAccountingForm.removeControl('loanPortfolioAccountId'); - this.loanProductAccountingForm.removeControl('transfersInSuspenseAccountId'); - this.loanProductAccountingForm.removeControl('interestOnLoanAccountId'); - this.loanProductAccountingForm.removeControl('incomeFromFeeAccountId'); - this.loanProductAccountingForm.removeControl('incomeFromPenaltyAccountId'); - this.loanProductAccountingForm.removeControl('incomeFromRecoveryAccountId'); - this.loanProductAccountingForm.removeControl('writeOffAccountId'); - this.loanProductAccountingForm.removeControl('goodwillCreditAccountId'); - this.loanProductAccountingForm.removeControl('overpaymentLiabilityAccountId'); - this.loanProductAccountingForm.removeControl('advancedAccountingRules'); - this.loanProductAccountingForm.removeControl('chargeOffExpenseAccountId'); - this.loanProductAccountingForm.removeControl('chargeOffFraudExpenseAccountId'); - this.loanProductAccountingForm.removeControl('incomeFromChargeOffPenaltyAccountId'); - this.loanProductAccountingForm.removeControl('incomeFromChargeOffFeesAccountId'); - this.loanProductAccountingForm.removeControl('incomeFromChargeOffInterestAccountId'); - this.loanProductAccountingForm.removeControl('incomeFromGoodwillCreditInterestAccountId'); - this.loanProductAccountingForm.removeControl('incomeFromGoodwillCreditFeesAccountId'); - this.loanProductAccountingForm.removeControl('incomeFromGoodwillCreditPenaltyAccountId'); - } + this.loanProductAccountingForm + .get('advancedAccountingRules') + .valueChanges.subscribe((advancedAccountingRules: boolean) => { + if (advancedAccountingRules) { + this.loanProductAccountingForm.addControl( + 'paymentChannelToFundSourceMappings', + this.formBuilder.array([]) + ); + this.loanProductAccountingForm.addControl('feeToIncomeAccountMappings', this.formBuilder.array([])); + this.loanProductAccountingForm.addControl('penaltyToIncomeAccountMappings', this.formBuilder.array([])); + this.loanProductAccountingForm.addControl( + 'chargeOffReasonToExpenseAccountMappings', + this.formBuilder.array([]) + ); + } else { + this.loanProductAccountingForm.removeControl('paymentChannelToFundSourceMappings'); + this.loanProductAccountingForm.removeControl('feeToIncomeAccountMappings'); + this.loanProductAccountingForm.removeControl('penaltyToIncomeAccountMappings'); + this.loanProductAccountingForm.removeControl('chargeOffReasonToExpenseAccountMappings'); + } + }); + } else { + this.loanProductAccountingForm.removeControl('fundSourceAccountId'); + this.loanProductAccountingForm.removeControl('loanPortfolioAccountId'); + this.loanProductAccountingForm.removeControl('transfersInSuspenseAccountId'); + this.loanProductAccountingForm.removeControl('interestOnLoanAccountId'); + this.loanProductAccountingForm.removeControl('incomeFromFeeAccountId'); + this.loanProductAccountingForm.removeControl('incomeFromPenaltyAccountId'); + this.loanProductAccountingForm.removeControl('incomeFromRecoveryAccountId'); + this.loanProductAccountingForm.removeControl('writeOffAccountId'); + this.loanProductAccountingForm.removeControl('goodwillCreditAccountId'); + this.loanProductAccountingForm.removeControl('overpaymentLiabilityAccountId'); + this.loanProductAccountingForm.removeControl('advancedAccountingRules'); + this.loanProductAccountingForm.removeControl('chargeOffExpenseAccountId'); + this.loanProductAccountingForm.removeControl('chargeOffFraudExpenseAccountId'); + this.loanProductAccountingForm.removeControl('incomeFromChargeOffPenaltyAccountId'); + this.loanProductAccountingForm.removeControl('incomeFromChargeOffFeesAccountId'); + this.loanProductAccountingForm.removeControl('incomeFromChargeOffInterestAccountId'); + this.loanProductAccountingForm.removeControl('incomeFromGoodwillCreditInterestAccountId'); + this.loanProductAccountingForm.removeControl('incomeFromGoodwillCreditFeesAccountId'); + this.loanProductAccountingForm.removeControl('incomeFromGoodwillCreditPenaltyAccountId'); + } - if (accountingRule === 3 || accountingRule === 4) { - this.loanProductAccountingForm.addControl('receivableInterestAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('receivableFeeAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('receivablePenaltyAccountId', new UntypedFormControl('', Validators.required)); - this.loanProductAccountingForm.addControl('enableAccrualActivityPosting', new UntypedFormControl(false)); - } else { - this.loanProductAccountingForm.removeControl('receivableInterestAccountId'); - this.loanProductAccountingForm.removeControl('receivableFeeAccountId'); - this.loanProductAccountingForm.removeControl('receivablePenaltyAccountId'); - this.loanProductAccountingForm.removeControl('enableAccrualActivityPosting'); - } - }); + if (accountingRule === 3 || accountingRule === 4) { + this.loanProductAccountingForm.addControl( + 'receivableInterestAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'receivableFeeAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl( + 'receivablePenaltyAccountId', + new UntypedFormControl('', Validators.required) + ); + this.loanProductAccountingForm.addControl('enableAccrualActivityPosting', new UntypedFormControl(false)); + } else { + this.loanProductAccountingForm.removeControl('receivableInterestAccountId'); + this.loanProductAccountingForm.removeControl('receivableFeeAccountId'); + this.loanProductAccountingForm.removeControl('receivablePenaltyAccountId'); + this.loanProductAccountingForm.removeControl('enableAccrualActivityPosting'); + } + }); } get paymentChannelToFundSourceMappings(): UntypedFormArray { @@ -233,7 +361,7 @@ export class LoanProductAccountingStepComponent implements OnInit { if (response.data) { formArray.push(response.data); if (formType == 'ChargeOffReasonExpense') { - this.allowAddChargeOffReasonExpense = (formArray.value.length < this.chargeOffReasonOptions.length); + this.allowAddChargeOffReasonExpense = formArray.value.length < this.chargeOffReasonOptions.length; } this.setLoanProductAccountingFormDirty(); @@ -254,13 +382,13 @@ export class LoanProductAccountingStepComponent implements OnInit { delete(formType: string, formArray: UntypedFormArray, index: number) { const dialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: this.translateService.instant('labels.text.this') } + data: { deleteContext: this.translateService.instant('labels.text.this') } }); dialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { formArray.removeAt(index); if (formType == 'ChargeOffReasonExpense') { - this.allowAddChargeOffReasonExpense = (formArray.value.length < this.chargeOffReasonOptions.length); + this.allowAddChargeOffReasonExpense = formArray.value.length < this.chargeOffReasonOptions.length; } this.setLoanProductAccountingFormDirty(); } @@ -269,10 +397,23 @@ export class LoanProductAccountingStepComponent implements OnInit { getData(formType: string, values?: any) { switch (formType) { - case 'PaymentFundSource': return { title: 'Configure Fund Sources for Payment Channels', formfields: this.getPaymentFundSourceFormfields(values) }; - case 'FeesIncome': return { title: 'Map Fees to Income Accounts', formfields: this.getFeesIncomeFormfields(values) }; - case 'PenaltyIncome': return { title: 'Map Penalties to Specific Income Accounts', formfields: this.getPenaltyIncomeFormfields(values) }; - case 'ChargeOffReasonExpense': return { title: 'Map Charge-off reasons to Expense accounts', formfields: this.getChargeOffReasonExpenseFormfields(values) }; + case 'PaymentFundSource': + return { + title: 'Configure Fund Sources for Payment Channels', + formfields: this.getPaymentFundSourceFormfields(values) + }; + case 'FeesIncome': + return { title: 'Map Fees to Income Accounts', formfields: this.getFeesIncomeFormfields(values) }; + case 'PenaltyIncome': + return { + title: 'Map Penalties to Specific Income Accounts', + formfields: this.getPenaltyIncomeFormfields(values) + }; + case 'ChargeOffReasonExpense': + return { + title: 'Map Charge-off reasons to Expense accounts', + formfields: this.getChargeOffReasonExpenseFormfields(values) + }; } } @@ -294,6 +435,7 @@ export class LoanProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -316,6 +458,7 @@ export class LoanProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -338,6 +481,7 @@ export class LoanProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -361,17 +505,17 @@ export class LoanProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } get isAccountingAccrualBased() { const accountingRule = this.loanProductAccountingForm.value.accountingRule; - return accountingRule === 3 || accountingRule === 4; + return accountingRule === 3 || accountingRule === 4; } get loanProductAccounting() { return this.loanProductAccountingForm.value; } - } diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component.spec.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component.spec.ts index dabfa3948..ea94bf03c 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component.spec.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanProductChargesStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanProductChargesStepComponent ] - }) - .compileComponents(); + declarations: [LoanProductChargesStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component.ts index c0ac6691a..a34db0bf4 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component.ts @@ -11,7 +11,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./loan-product-charges-step.component.scss'] }) export class LoanProductChargesStepComponent implements OnInit { - @Input() loanProductsTemplate: any; @Input() currencyCode: UntypedFormControl; @Input() multiDisburseLoan: UntypedFormControl; @@ -20,25 +19,34 @@ export class LoanProductChargesStepComponent implements OnInit { overdueChargeData: any; chargesDataSource: {}[]; - displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'action']; + displayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'action' + ]; pristine = true; - constructor(public dialog: MatDialog, - private translateService: TranslateService) { - } + constructor( + public dialog: MatDialog, + private translateService: TranslateService + ) {} ngOnInit() { this.chargeData = this.loanProductsTemplate.chargeOptions; - this.overdueChargeData = this.loanProductsTemplate.penaltyOptions ? - this.loanProductsTemplate.penaltyOptions.filter((penalty: any) => penalty.chargeTimeType.code === 'chargeTimeType.overdueInstallment') : - []; + this.overdueChargeData = this.loanProductsTemplate.penaltyOptions + ? this.loanProductsTemplate.penaltyOptions.filter( + (penalty: any) => penalty.chargeTimeType.code === 'chargeTimeType.overdueInstallment' + ) + : []; this.chargesDataSource = this.loanProductsTemplate.charges || []; this.pristine = true; - this.currencyCode.valueChanges.subscribe(() => this.chargesDataSource = []); - this.multiDisburseLoan.valueChanges.subscribe(() => this.chargesDataSource = []); + this.currencyCode.valueChanges.subscribe(() => (this.chargesDataSource = [])); + this.multiDisburseLoan.valueChanges.subscribe(() => (this.chargesDataSource = [])); } addCharge(charge: any) { @@ -49,7 +57,7 @@ export class LoanProductChargesStepComponent implements OnInit { deleteCharge(charge: any) { const deleteChargeDialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: this.translateService.instant('labels.inputs.Charge') + ' ' + charge.name } + data: { deleteContext: this.translateService.instant('labels.inputs.Charge') + ' ' + charge.name } }); deleteChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { @@ -65,5 +73,4 @@ export class LoanProductChargesStepComponent implements OnInit { charges: this.chargesDataSource }; } - } diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component.spec.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component.spec.ts index e4059542d..a0a1820a5 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component.spec.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanProductCurrencyStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanProductCurrencyStepComponent ] - }) - .compileComponents(); + declarations: [LoanProductCurrencyStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component.ts index 2e3241b73..e7d39a8eb 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component.ts @@ -8,7 +8,6 @@ import { TooltipPosition } from '@angular/material/tooltip'; styleUrls: ['./loan-product-currency-step.component.scss'] }) export class LoanProductCurrencyStepComponent implements OnInit { - @Input() loanProductsTemplate: any; loanProductCurrencyForm: UntypedFormGroup; @@ -22,24 +21,31 @@ export class LoanProductCurrencyStepComponent implements OnInit { ngOnInit() { this.currencyData = this.loanProductsTemplate.currencyOptions; this.loanProductCurrencyForm.patchValue({ - 'currencyCode': this.loanProductsTemplate.currency.code || this.currencyData[0].code, - 'digitsAfterDecimal': this.loanProductsTemplate.currency.decimalPlaces ? this.loanProductsTemplate.currency.decimalPlaces : 2, - 'inMultiplesOf': this.loanProductsTemplate.currency.inMultiplesOf, - 'installmentAmountInMultiplesOf': this.loanProductsTemplate.installmentAmountInMultiplesOf + currencyCode: this.loanProductsTemplate.currency.code || this.currencyData[0].code, + digitsAfterDecimal: this.loanProductsTemplate.currency.decimalPlaces + ? this.loanProductsTemplate.currency.decimalPlaces + : 2, + inMultiplesOf: this.loanProductsTemplate.currency.inMultiplesOf, + installmentAmountInMultiplesOf: this.loanProductsTemplate.installmentAmountInMultiplesOf }); } createLoanProductCurrencyForm() { this.loanProductCurrencyForm = this.formBuilder.group({ - 'currencyCode': ['', Validators.required], - 'digitsAfterDecimal': [2, Validators.required], - 'inMultiplesOf': '', - 'installmentAmountInMultiplesOf': '' + currencyCode: [ + '', + Validators.required + ], + digitsAfterDecimal: [ + 2, + Validators.required + ], + inMultiplesOf: '', + installmentAmountInMultiplesOf: '' }); } get loanProductCurrency() { return this.loanProductCurrencyForm.value; } - } diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-details-step/loan-product-details-step.component.spec.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-details-step/loan-product-details-step.component.spec.ts index 46c1a2056..80192c099 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-details-step/loan-product-details-step.component.spec.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-details-step/loan-product-details-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanProductDetailsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanProductDetailsStepComponent ] - }) - .compileComponents(); + declarations: [LoanProductDetailsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-details-step/loan-product-details-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-details-step/loan-product-details-step.component.ts index f94a36540..eab8d5a30 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-details-step/loan-product-details-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-details-step/loan-product-details-step.component.ts @@ -13,7 +13,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./loan-product-details-step.component.scss'] }) export class LoanProductDetailsStepComponent implements OnInit { - @Input() loanProductsTemplate: any; loanProductDetailsForm: UntypedFormGroup; @@ -29,9 +28,11 @@ export class LoanProductDetailsStepComponent implements OnInit { * @param {SettingsService} settingsService Settings Service. */ - constructor(private formBuilder: UntypedFormBuilder, - private dateUtils: Dates, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private dateUtils: Dates, + private settingsService: SettingsService + ) { this.createLoanProductDetailsForm(); } @@ -39,27 +40,33 @@ export class LoanProductDetailsStepComponent implements OnInit { this.fundData = this.loanProductsTemplate.fundOptions; this.loanProductDetailsForm.patchValue({ - 'name': this.loanProductsTemplate.name, - 'shortName': this.loanProductsTemplate.shortName, - 'description': this.loanProductsTemplate.description, - 'externalId': this.loanProductsTemplate.externalId, - 'fundId': this.loanProductsTemplate.fundId, - 'startDate': this.loanProductsTemplate.startDate && new Date(this.loanProductsTemplate.startDate), - 'closeDate': this.loanProductsTemplate.closeDate && new Date(this.loanProductsTemplate.closeDate), - 'includeInBorrowerCycle': this.loanProductsTemplate.includeInBorrowerCycle + name: this.loanProductsTemplate.name, + shortName: this.loanProductsTemplate.shortName, + description: this.loanProductsTemplate.description, + externalId: this.loanProductsTemplate.externalId, + fundId: this.loanProductsTemplate.fundId, + startDate: this.loanProductsTemplate.startDate && new Date(this.loanProductsTemplate.startDate), + closeDate: this.loanProductsTemplate.closeDate && new Date(this.loanProductsTemplate.closeDate), + includeInBorrowerCycle: this.loanProductsTemplate.includeInBorrowerCycle }); } createLoanProductDetailsForm() { this.loanProductDetailsForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'shortName': ['', Validators.required], - 'description': [''], - 'externalId': [''], - 'fundId': [''], - 'startDate': [''], - 'closeDate': [''], - 'includeInBorrowerCycle': [false] + name: [ + '', + Validators.required + ], + shortName: [ + '', + Validators.required + ], + description: [''], + externalId: [''], + fundId: [''], + startDate: [''], + closeDate: [''], + includeInBorrowerCycle: [false] }); } @@ -76,5 +83,4 @@ export class LoanProductDetailsStepComponent implements OnInit { } return loanProductDetailsFormData; } - } diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-interest-refund-step/loan-product-interest-refund-step.component.spec.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-interest-refund-step/loan-product-interest-refund-step.component.spec.ts index 15fd377aa..52dfd72d1 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-interest-refund-step/loan-product-interest-refund-step.component.spec.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-interest-refund-step/loan-product-interest-refund-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanProductInterestRefundStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanProductInterestRefundStepComponent ] - }) - .compileComponents(); + declarations: [LoanProductInterestRefundStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-interest-refund-step/loan-product-interest-refund-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-interest-refund-step/loan-product-interest-refund-step.component.ts index e6ece66bb..72f202472 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-interest-refund-step/loan-product-interest-refund-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-interest-refund-step/loan-product-interest-refund-step.component.ts @@ -1,5 +1,5 @@ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; -import { UntypedFormBuilder, UntypedFormGroup} from '@angular/forms'; +import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { StringEnumOptionData } from '../../../../shared/models/option-data.model'; @Component({ @@ -8,7 +8,6 @@ import { StringEnumOptionData } from '../../../../shared/models/option-data.mode styleUrls: ['./loan-product-interest-refund-step.component.scss'] }) export class LoanProductInterestRefundStepComponent implements OnInit { - @Input() loanProductsTemplate: any; @Output() supportedInterestRefundTypes = new EventEmitter(); @@ -26,32 +25,33 @@ export class LoanProductInterestRefundStepComponent implements OnInit { const values: StringEnumOptionData[] = this.loanProductsTemplate.supportedInterestRefundTypes; const supportedInterestRefundTypes: string[] = this.mapStringEnumOptionToIdList(values); this.loanProductInterestRefundForm.patchValue({ - 'supportedInterestRefundTypes': supportedInterestRefundTypes + supportedInterestRefundTypes: supportedInterestRefundTypes }); this.supportedInterestRefundTypes.emit(values); } createLoanProductInterestRefundForm() { this.loanProductInterestRefundForm = this.formBuilder.group({ - 'supportedInterestRefundTypes': '' + supportedInterestRefundTypes: '' }); } setConditionalControls() { - this.loanProductInterestRefundForm.get('supportedInterestRefundTypes').valueChanges - .subscribe(value => { - this.supportedInterestRefundTypes.emit(this.mapIdToStringEnumOptionList(value, this.loanProductsTemplate.supportedInterestRefundTypesOptions)); - }); + this.loanProductInterestRefundForm.get('supportedInterestRefundTypes').valueChanges.subscribe((value) => { + this.supportedInterestRefundTypes.emit( + this.mapIdToStringEnumOptionList(value, this.loanProductsTemplate.supportedInterestRefundTypesOptions) + ); + }); } mapStringEnumOptionToIdList(incomingValues: StringEnumOptionData[]): string[] { if (!incomingValues) { return []; } - return incomingValues.map(v => v.id); + return incomingValues.map((v) => v.id); } mapIdToStringEnumOptionList(incomingValues: string[], options: StringEnumOptionData[]): StringEnumOptionData[] { - return options.filter(v => incomingValues.includes(v.id)); + return options.filter((v) => incomingValues.includes(v.id)); } } diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/advance-payment-allocation-tab/advance-payment-allocation-tab.component.spec.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/advance-payment-allocation-tab/advance-payment-allocation-tab.component.spec.ts index 151afe131..5a68dc33a 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/advance-payment-allocation-tab/advance-payment-allocation-tab.component.spec.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/advance-payment-allocation-tab/advance-payment-allocation-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('AdvancePaymentAllocationTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ AdvancePaymentAllocationTabComponent ] - }) - .compileComponents(); + declarations: [AdvancePaymentAllocationTabComponent] + }).compileComponents(); fixture = TestBed.createComponent(AdvancePaymentAllocationTabComponent); component = fixture.componentInstance; diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/advance-payment-allocation-tab/advance-payment-allocation-tab.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/advance-payment-allocation-tab/advance-payment-allocation-tab.component.ts index 3f49a07c9..fa18fb14d 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/advance-payment-allocation-tab/advance-payment-allocation-tab.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/advance-payment-allocation-tab/advance-payment-allocation-tab.component.ts @@ -5,7 +5,15 @@ import { MatDialog } from '@angular/material/dialog'; import { MatTable } from '@angular/material/table'; import { TranslateService } from '@ngx-translate/core'; import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component'; -import { AdvancedCreditAllocation, AdvancedPaymentAllocation, AdvancedPaymentStrategy, CreditAllocationOrder, FutureInstallmentAllocationRule, PaymentAllocationOrder, PaymentAllocationTransactionType } from '../payment-allocation-model'; +import { + AdvancedCreditAllocation, + AdvancedPaymentAllocation, + AdvancedPaymentStrategy, + CreditAllocationOrder, + FutureInstallmentAllocationRule, + PaymentAllocationOrder, + PaymentAllocationTransactionType +} from '../payment-allocation-model'; @Component({ selector: 'mifosx-advance-payment-allocation-tab', @@ -13,7 +21,6 @@ import { AdvancedCreditAllocation, AdvancedPaymentAllocation, AdvancedPaymentStr styleUrls: ['./advance-payment-allocation-tab.component.scss'] }) export class AdvancePaymentAllocationTabComponent implements OnInit { - @Input() advancedPaymentAllocation: AdvancedPaymentAllocation; @Input() advancedCreditAllocation: AdvancedCreditAllocation; @@ -24,15 +31,21 @@ export class AdvancePaymentAllocationTabComponent implements OnInit { creditAllocationsData: CreditAllocationOrder[] | null = null; /** Columns to be displayed in the table. */ - displayedColumns: string[] = ['actions', 'order', 'allocationRule']; + displayedColumns: string[] = [ + 'actions', + 'order', + 'allocationRule' + ]; futureInstallmentAllocationRule = new UntypedFormControl('', Validators.required); @ViewChild('table') table: MatTable; - constructor(private dialog: MatDialog, + constructor( + private dialog: MatDialog, private advancedPaymentStrategy: AdvancedPaymentStrategy, - private translateService: TranslateService) { } + private translateService: TranslateService + ) {} ngOnInit(): void { if (this.advancedCreditAllocation) { @@ -43,15 +56,19 @@ export class AdvancePaymentAllocationTabComponent implements OnInit { this.paymentAllocationsData = this.advancedPaymentAllocation?.paymentAllocationOrder; if (this.advancedPaymentAllocation.futureInstallmentAllocationRule) { - this.futureInstallmentAllocationRule.patchValue(this.advancedPaymentAllocation.futureInstallmentAllocationRule.code); + this.futureInstallmentAllocationRule.patchValue( + this.advancedPaymentAllocation.futureInstallmentAllocationRule.code + ); } this.futureInstallmentAllocationRule.valueChanges.subscribe((value: any) => { - this.advancedPaymentAllocation.futureInstallmentAllocationRules.forEach((item: FutureInstallmentAllocationRule) => { - if (value === item.code) { - this.advancedPaymentAllocation.futureInstallmentAllocationRule = item; - this.allocationChanged.emit(true); + this.advancedPaymentAllocation.futureInstallmentAllocationRules.forEach( + (item: FutureInstallmentAllocationRule) => { + if (value === item.code) { + this.advancedPaymentAllocation.futureInstallmentAllocationRule = item; + this.allocationChanged.emit(true); + } } - }); + ); }); } } @@ -90,7 +107,10 @@ export class AdvancePaymentAllocationTabComponent implements OnInit { transaction.credit = true; } const dialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: this.translateService.instant('labels.dialogContext.the Transaction Type') + ' ' + transaction.value } + data: { + deleteContext: + this.translateService.instant('labels.dialogContext.the Transaction Type') + ' ' + transaction.value + } }); dialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { @@ -98,5 +118,4 @@ export class AdvancePaymentAllocationTabComponent implements OnInit { } }); } - } diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/loan-product-payment-strategy-step.component.spec.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/loan-product-payment-strategy-step.component.spec.ts index 4f4aae7dc..4145479cf 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/loan-product-payment-strategy-step.component.spec.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/loan-product-payment-strategy-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanProductPaymentStrategyStepComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ LoanProductPaymentStrategyStepComponent ] - }) - .compileComponents(); + declarations: [LoanProductPaymentStrategyStepComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/loan-product-payment-strategy-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/loan-product-payment-strategy-step.component.ts index 5cf2f2ec0..ce5dbb2e0 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/loan-product-payment-strategy-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/loan-product-payment-strategy-step.component.ts @@ -1,5 +1,14 @@ import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'; -import { AdvancedCreditAllocation, AdvancedPaymentAllocation, AdvancedPaymentStrategy, CreditAllocation, CreditAllocationOrder, PaymentAllocation, PaymentAllocationOrder, PaymentAllocationTransactionType } from './payment-allocation-model'; +import { + AdvancedCreditAllocation, + AdvancedPaymentAllocation, + AdvancedPaymentStrategy, + CreditAllocation, + CreditAllocationOrder, + PaymentAllocation, + PaymentAllocationOrder, + PaymentAllocationTransactionType +} from './payment-allocation-model'; import { MatDialog } from '@angular/material/dialog'; import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base'; import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base'; @@ -13,7 +22,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./loan-product-payment-strategy-step.component.scss'] }) export class LoanProductPaymentStrategyStepComponent implements OnInit { - @Input() advancedPaymentAllocations: AdvancedPaymentAllocation[] = []; @Input() advancedCreditAllocations: AdvancedCreditAllocation[] = []; @Input() advancedPaymentAllocationTransactionTypes: PaymentAllocationTransactionType[] = []; @@ -27,16 +35,20 @@ export class LoanProductPaymentStrategyStepComponent implements OnInit { @ViewChild(MatTabGroup) tabGroup: MatTabGroup; - constructor(private dialog: MatDialog, + constructor( + private dialog: MatDialog, private advancedPaymentStrategy: AdvancedPaymentStrategy, - private translateService: TranslateService) { } + private translateService: TranslateService + ) {} ngOnInit(): void { this.sendAllocations(); } sendAllocations(): void { - this.setPaymentAllocation.emit(this.advancedPaymentStrategy.buildPaymentAllocations(this.advancedPaymentAllocations)); + this.setPaymentAllocation.emit( + this.advancedPaymentStrategy.buildPaymentAllocations(this.advancedPaymentAllocations) + ); this.setCreditAllocation.emit(this.advancedPaymentStrategy.buildCreditAllocations(this.advancedCreditAllocations)); } @@ -77,6 +89,7 @@ export class LoanProductPaymentStrategyStepComponent implements OnInit { options: { label: 'value', value: 'code', data: transactionTypesOptions }, order: 1 }) + ]; const data = { title: this.translateService.instant('labels.inputs.Advanced Payment Allocation Transaction Type'), @@ -94,12 +107,19 @@ export class LoanProductPaymentStrategyStepComponent implements OnInit { if (transactionType.code === response.data.value.code) { if (!transactionType.credit) { this.advancedPaymentAllocations.push( - this.advancedPaymentStrategy.buildAdvancedPaymentAllocation(true, transactionType, this.paymentAllocationOrderDefault, - defaultPaymentAllocation.futureInstallmentAllocationRules) + this.advancedPaymentStrategy.buildAdvancedPaymentAllocation( + true, + transactionType, + this.paymentAllocationOrderDefault, + defaultPaymentAllocation.futureInstallmentAllocationRules + ) ); } else { this.advancedCreditAllocations.push( - this.advancedPaymentStrategy.buildAdvancedCreditAllocation(transactionType, this.creditAllocationOrderDefault) + this.advancedPaymentStrategy.buildAdvancedCreditAllocation( + transactionType, + this.creditAllocationOrderDefault + ) ); } this.paymentAllocationChange.emit(true); @@ -116,7 +136,7 @@ export class LoanProductPaymentStrategyStepComponent implements OnInit { if (item.transaction.code === transaction.code) { this.advancedPaymentAllocations.splice(index, 1); this.paymentAllocationChange.emit(true); - this.tabGroup.selectedIndex = (index - 1); + this.tabGroup.selectedIndex = index - 1; this.sendAllocations(); } }); @@ -125,11 +145,10 @@ export class LoanProductPaymentStrategyStepComponent implements OnInit { if (item.transaction.code === transaction.code) { this.advancedCreditAllocations.splice(index, 1); this.paymentAllocationChange.emit(true); - this.tabGroup.selectedIndex = (index - 1); + this.tabGroup.selectedIndex = index - 1; this.sendAllocations(); } }); } } - } diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model.ts index 82c34acc6..f5b2b4e5a 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model.ts @@ -68,7 +68,6 @@ export class AdvancePaymentAllocationData { providedIn: 'root' }) export class AdvancedPaymentStrategy { - public buildAdvancedCreditAllocationList(loanProduct: any): AdvancedCreditAllocation[] { const advancedCreditAllocation: AdvancedCreditAllocation[] = []; const advancedCreditAllocationTransactionTypes: PaymentAllocationTransactionType[] = @@ -78,8 +77,10 @@ export class AdvancedPaymentStrategy { loanProduct.creditAllocation.forEach((item: CreditAllocation) => { advancedCreditAllocation.push({ transaction: this.getItemByCode(item.transactionType, advancedCreditAllocationTransactionTypes), - creditAllocationOrder: this.buildCurrentCreditAllocationOrder(item.creditAllocationOrder, - advancedPaymentAllocationTypes), + creditAllocationOrder: this.buildCurrentCreditAllocationOrder( + item.creditAllocationOrder, + advancedPaymentAllocationTypes + ) }); }); } @@ -97,11 +98,15 @@ export class AdvancedPaymentStrategy { loanProduct.paymentAllocation.forEach((item: PaymentAllocation) => { advancedPaymentAllocation.push({ transaction: this.getItemByCode(item.transactionType, advancedPaymentAllocationTransactionTypes), - paymentAllocationOrder: this.buildCurrentPaymentAllocationOrder(item.paymentAllocationOrder, - advancedPaymentAllocationTypes), - futureInstallmentAllocationRule: this.getItemByCode(item.futureInstallmentAllocationRule, - advancedPaymentAllocationFutureInstallmentAllocationRules), - futureInstallmentAllocationRules: advancedPaymentAllocationFutureInstallmentAllocationRules, + paymentAllocationOrder: this.buildCurrentPaymentAllocationOrder( + item.paymentAllocationOrder, + advancedPaymentAllocationTypes + ), + futureInstallmentAllocationRule: this.getItemByCode( + item.futureInstallmentAllocationRule, + advancedPaymentAllocationFutureInstallmentAllocationRules + ), + futureInstallmentAllocationRules: advancedPaymentAllocationFutureInstallmentAllocationRules }); }); } @@ -109,34 +114,47 @@ export class AdvancedPaymentStrategy { if (advancedPaymentAllocation.length === 0) { advancedPaymentAllocation.push({ transaction: PaymentAllocationTransactionTypes.DEFAULT_TRANSACTION, - paymentAllocationOrder: this.buildPaymentAllocationTransactionOrder(true, [], loanProduct.advancedPaymentAllocationTypes), + paymentAllocationOrder: this.buildPaymentAllocationTransactionOrder( + true, + [], + loanProduct.advancedPaymentAllocationTypes + ), futureInstallmentAllocationRule: loanProduct.advancedPaymentAllocationFutureInstallmentAllocationRules[0], - futureInstallmentAllocationRules: loanProduct.advancedPaymentAllocationFutureInstallmentAllocationRules, + futureInstallmentAllocationRules: loanProduct.advancedPaymentAllocationFutureInstallmentAllocationRules }); } return advancedPaymentAllocation; } - public buildAdvancedPaymentAllocation(forDefault: boolean, transaction: PaymentAllocationTransactionType, + public buildAdvancedPaymentAllocation( + forDefault: boolean, + transaction: PaymentAllocationTransactionType, currentItems: PaymentAllocationOrder[], - futureInstallmentAllocationRules: FutureInstallmentAllocationRule[]): AdvancedPaymentAllocation { + futureInstallmentAllocationRules: FutureInstallmentAllocationRule[] + ): AdvancedPaymentAllocation { return { transaction: transaction, paymentAllocationOrder: this.buildPaymentAllocationTransactionOrder(forDefault, currentItems, currentItems), futureInstallmentAllocationRule: futureInstallmentAllocationRules[0], - futureInstallmentAllocationRules: futureInstallmentAllocationRules, + futureInstallmentAllocationRules: futureInstallmentAllocationRules }; } - public buildAdvancedCreditAllocation(transaction: PaymentAllocationTransactionType, - currentItems: CreditAllocationOrder[]): AdvancedCreditAllocation { + public buildAdvancedCreditAllocation( + transaction: PaymentAllocationTransactionType, + currentItems: CreditAllocationOrder[] + ): AdvancedCreditAllocation { return { transaction: transaction, creditAllocationOrder: this.buildCreditAllocationTransactionOrder(true, currentItems, currentItems) }; } - public buildPaymentAllocationTransactionOrder(forDefault: boolean, currentItems: PaymentAllocationOrder[], defaultItems: PaymentAllocationOrder[]): PaymentAllocationOrder[] { + public buildPaymentAllocationTransactionOrder( + forDefault: boolean, + currentItems: PaymentAllocationOrder[], + defaultItems: PaymentAllocationOrder[] + ): PaymentAllocationOrder[] { const paymentAllocationOrder: PaymentAllocationOrder[] = []; if (forDefault) { return defaultItems; @@ -152,7 +170,11 @@ export class AdvancedPaymentStrategy { return paymentAllocationOrder; } - public buildCreditAllocationTransactionOrder(forDefault: boolean, currentItems: CreditAllocationOrder[], defaultItems: CreditAllocationOrder[]): CreditAllocationOrder[] { + public buildCreditAllocationTransactionOrder( + forDefault: boolean, + currentItems: CreditAllocationOrder[], + defaultItems: CreditAllocationOrder[] + ): CreditAllocationOrder[] { const paymentAllocationOrder: CreditAllocationOrder[] = []; if (forDefault) { return defaultItems; @@ -199,7 +221,7 @@ export class AdvancedPaymentStrategy { const paymentAllocations: any[] = []; paymentAllocationOrder.forEach((item: any, index: number) => { paymentAllocations.push({ - order: (index + 1), + order: index + 1, paymentAllocationRule: item.code }); }); @@ -211,7 +233,7 @@ export class AdvancedPaymentStrategy { const creditAllocations: CreditAllocationOrder[] = []; creditAllocationOrder.forEach((item: any, index: number) => { creditAllocations.push({ - order: (index + 1), + order: index + 1, creditAllocationRule: item.code }); }); @@ -219,26 +241,29 @@ export class AdvancedPaymentStrategy { return creditAllocations; } - private buildCurrentPaymentAllocationOrder(currentItems: any[], defaultItems: PaymentAllocationOrder[]): - PaymentAllocationOrder[] { - const paymentAllocationOrder: PaymentAllocationOrder[] = []; - currentItems.forEach((item: any) => { - paymentAllocationOrder.push(this.getItemByCode(item.paymentAllocationRule, defaultItems)); - }); - return paymentAllocationOrder; + private buildCurrentPaymentAllocationOrder( + currentItems: any[], + defaultItems: PaymentAllocationOrder[] + ): PaymentAllocationOrder[] { + const paymentAllocationOrder: PaymentAllocationOrder[] = []; + currentItems.forEach((item: any) => { + paymentAllocationOrder.push(this.getItemByCode(item.paymentAllocationRule, defaultItems)); + }); + return paymentAllocationOrder; } - private buildCurrentCreditAllocationOrder(currentItems: any[], defaultItems: CreditAllocationOrder[]): - CreditAllocationOrder[] { - const creditAllocationOrder: CreditAllocationOrder[] = []; - currentItems.forEach((item: any) => { - creditAllocationOrder.push(this.getItemByCode(item.creditAllocationRule, defaultItems)); - }); - return creditAllocationOrder; + private buildCurrentCreditAllocationOrder( + currentItems: any[], + defaultItems: CreditAllocationOrder[] + ): CreditAllocationOrder[] { + const creditAllocationOrder: CreditAllocationOrder[] = []; + currentItems.forEach((item: any) => { + creditAllocationOrder.push(this.getItemByCode(item.creditAllocationRule, defaultItems)); + }); + return creditAllocationOrder; } - private getItemByCode(code: string, - options: any[]): any { + private getItemByCode(code: string, options: any[]): any { let transaction: any; options.forEach((option: any) => { if (option.code === code) { @@ -249,7 +274,6 @@ export class AdvancedPaymentStrategy { } public isDefault(transaction: PaymentAllocationTransactionType): boolean { - return (transaction.code === PaymentAllocationTransactionTypes.DEFAULT_TRANSACTION.code); + return transaction.code === PaymentAllocationTransactionTypes.DEFAULT_TRANSACTION.code; } - } diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.spec.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.spec.ts index ddc6589ec..e188afb47 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.spec.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanProductPreviewStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanProductPreviewStepComponent ] - }) - .compileComponents(); + declarations: [LoanProductPreviewStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.ts index 34ebdff0c..5c861b501 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-preview-step/loan-product-preview-step.component.ts @@ -7,7 +7,6 @@ import { LoanProducts } from '../../loan-products'; styleUrls: ['./loan-product-preview-step.component.scss'] }) export class LoanProductPreviewStepComponent implements OnInit, OnChanges { - @Input() loanProductsTemplate: any; @Input() accountingRuleData: any; @Input() loanProduct: any; @@ -15,7 +14,7 @@ export class LoanProductPreviewStepComponent implements OnInit, OnChanges { isAdvancedPaymentAllocation = false; - constructor() { } + constructor() {} ngOnInit() { this.advancedPaymentAllocation(); @@ -26,7 +25,8 @@ export class LoanProductPreviewStepComponent implements OnInit, OnChanges { } advancedPaymentAllocation() { - this.isAdvancedPaymentAllocation = LoanProducts.isAdvancedPaymentAllocationStrategy(this.loanProduct.transactionProcessingStrategyCode); + this.isAdvancedPaymentAllocation = LoanProducts.isAdvancedPaymentAllocationStrategy( + this.loanProduct.transactionProcessingStrategyCode + ); } - } diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.spec.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.spec.ts index 30d2addd2..f34a1a677 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.spec.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanProductSettingsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanProductSettingsStepComponent ] - }) - .compileComponents(); + declarations: [LoanProductSettingsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts index ad75d4545..5c1d10315 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts @@ -6,14 +6,12 @@ import { GlobalConfiguration } from 'app/system/configurations/global-configurat import { CodeName, OptionData, StringEnumOptionData } from 'app/shared/models/option-data.model'; import { ProcessingStrategyService } from '../../services/processing-strategy.service'; - @Component({ selector: 'mifosx-loan-product-settings-step', templateUrl: './loan-product-settings-step.component.html', styleUrls: ['./loan-product-settings-step.component.scss'] }) export class LoanProductSettingsStepComponent implements OnInit { - DAYS_BEFORE_REPAYMENT_IS_DUE = LoanProducts.DAYS_BEFORE_REPAYMENT_IS_DUE; DAYS_AFTER_REPAYMENT_IS_OVERDUE = LoanProducts.DAYS_AFTER_REPAYMENT_IS_OVERDUE; @@ -51,21 +49,22 @@ export class LoanProductSettingsStepComponent implements OnInit { /** Values to Days for Repayments */ defaultConfigValues: GlobalConfiguration[] = []; - constructor(private formBuilder: UntypedFormBuilder, - private processingStrategyService: ProcessingStrategyService) { + constructor( + private formBuilder: UntypedFormBuilder, + private processingStrategyService: ProcessingStrategyService + ) { this.createLoanProductSettingsForm(); this.setConditionalControls(); } ngOnInit() { this.defaultConfigValues = this.loanProductsTemplate['itemsByDefault']; - this.isLinkedToFloatingInterestRates.valueChanges - .subscribe((isLinkedToFloatingInterestRates: any) => { - if (isLinkedToFloatingInterestRates) { - this.loanProductSettingsForm.get('isInterestRecalculationEnabled').setValue(true); - this.loanProductSettingsForm.get('allowPartialPeriodInterestCalcualtion').setValue(true); - } - }); + this.isLinkedToFloatingInterestRates.valueChanges.subscribe((isLinkedToFloatingInterestRates: any) => { + if (isLinkedToFloatingInterestRates) { + this.loanProductSettingsForm.get('isInterestRecalculationEnabled').setValue(true); + this.loanProductSettingsForm.get('allowPartialPeriodInterestCalcualtion').setValue(true); + } + }); this.amortizationTypeData = this.loanProductsTemplate.amortizationTypeOptions; this.interestTypeData = this.loanProductsTemplate.interestTypeOptions; @@ -74,13 +73,15 @@ export class LoanProductSettingsStepComponent implements OnInit { this.transactionProcessingStrategyDataBase = this.loanProductsTemplate.transactionProcessingStrategyOptions; this.daysInYearTypeData = this.loanProductsTemplate.daysInYearTypeOptions; this.daysInMonthTypeData = this.loanProductsTemplate.daysInMonthTypeOptions; - this.preClosureInterestCalculationStrategyData = this.loanProductsTemplate.preClosureInterestCalculationStrategyOptions; + this.preClosureInterestCalculationStrategyData = + this.loanProductsTemplate.preClosureInterestCalculationStrategyOptions; this.rescheduleStrategyTypeData = this.loanProductsTemplate.rescheduleStrategyTypeOptions; this.rescheduleStrategyTypeDataBase = this.loanProductsTemplate.rescheduleStrategyTypeOptions; - this.interestRecalculationCompoundingTypeData = this.loanProductsTemplate.interestRecalculationCompoundingTypeOptions; + this.interestRecalculationCompoundingTypeData = + this.loanProductsTemplate.interestRecalculationCompoundingTypeOptions; this.interestRecalculationFrequencyTypeData = this.loanProductsTemplate.interestRecalculationFrequencyTypeOptions; this.interestRecalculationNthDayTypeData = this.loanProductsTemplate.interestRecalculationNthDayTypeOptions; - this.interestRecalculationNthDayTypeData.push({ 'id': -2, 'code': 'onDay', 'value': 'on day' }); + this.interestRecalculationNthDayTypeData.push({ id: -2, code: 'onDay', value: 'on day' }); this.interestRecalculationDayOfWeekTypeData = this.loanProductsTemplate.interestRecalculationDayOfWeekTypeOptions; this.interestRecalculationOnDayTypeData = Array.from({ length: 28 }, (_, index) => index + 1); this.delinquencyBucketData = this.loanProductsTemplate.delinquencyBucketOptions; @@ -90,121 +91,158 @@ export class LoanProductSettingsStepComponent implements OnInit { // this.useDueForRepaymentsConfigurations = (!this.loanProduct.dueDaysForRepaymentEvent && !this.loanProduct.overDueDaysForRepaymentEvent); - const transactionProcessingStrategyCode: string = this.loanProductsTemplate.transactionProcessingStrategyCode || this.transactionProcessingStrategyData[0].code; + const transactionProcessingStrategyCode: string = + this.loanProductsTemplate.transactionProcessingStrategyCode || this.transactionProcessingStrategyData[0].code; this.loanProductSettingsForm.patchValue({ - 'amortizationType': this.loanProductsTemplate.amortizationType.id, - 'interestType': this.loanProductsTemplate.interestType.id, - 'isEqualAmortization': this.loanProductsTemplate.isEqualAmortization, - 'interestCalculationPeriodType': this.loanProductsTemplate.interestCalculationPeriodType.id, - 'allowPartialPeriodInterestCalcualtion': this.loanProductsTemplate.allowPartialPeriodInterestCalcualtion, - 'transactionProcessingStrategyCode': transactionProcessingStrategyCode, - 'graceOnPrincipalPayment': this.loanProductsTemplate.graceOnPrincipalPayment, - 'graceOnInterestPayment': this.loanProductsTemplate.graceOnInterestPayment, - 'graceOnInterestCharged': this.loanProductsTemplate.graceOnInterestCharged, - 'inArrearsTolerance': this.loanProductsTemplate.inArrearsTolerance, - 'daysInYearType': this.loanProductsTemplate.daysInYearType.id, - 'daysInMonthType': this.loanProductsTemplate.daysInMonthType.id, - 'canDefineInstallmentAmount': this.loanProductsTemplate.canDefineInstallmentAmount, - 'graceOnArrearsAgeing': this.loanProductsTemplate.graceOnArrearsAgeing, - 'overdueDaysForNPA': this.loanProductsTemplate.overdueDaysForNPA, - 'accountMovesOutOfNPAOnlyOnArrearsCompletion': this.loanProductsTemplate.accountMovesOutOfNPAOnlyOnArrearsCompletion, - 'principalThresholdForLastInstallment': this.loanProductsTemplate.principalThresholdForLastInstallment, - 'allowVariableInstallments': this.loanProductsTemplate.allowVariableInstallments, - 'disallowExpectedDisbursements': this.loanProductsTemplate.disallowExpectedDisbursements, - 'minimumGap': this.loanProductsTemplate.minimumGap, - 'maximumGap': this.loanProductsTemplate.maximumGap, - 'canUseForTopup': this.loanProductsTemplate.canUseForTopup, - 'isInterestRecalculationEnabled': this.loanProductsTemplate.isInterestRecalculationEnabled, - 'holdGuaranteeFunds': this.loanProductsTemplate.holdGuaranteeFunds, - 'multiDisburseLoan': this.loanProductsTemplate.multiDisburseLoan, - 'maxTrancheCount': this.loanProductsTemplate.maxTrancheCount, - 'outstandingLoanBalance': this.loanProductsTemplate.outstandingLoanBalance, - 'enableDownPayment': this.loanProductsTemplate.enableDownPayment, - 'enableInstallmentLevelDelinquency': this.loanProductsTemplate.enableInstallmentLevelDelinquency, - 'loanScheduleType': this.loanProductsTemplate.loanScheduleType.code, - 'useDueForRepaymentsConfigurations': this.loanProductsTemplate.useDueForRepaymentsConfigurations, - 'allowAccrualPostingInArrears': this.loanProductsTemplate.allowAccrualPostingInArrears, - 'chargeOffBehaviour': this.loanProductsTemplate.chargeOffBehaviour.id + amortizationType: this.loanProductsTemplate.amortizationType.id, + interestType: this.loanProductsTemplate.interestType.id, + isEqualAmortization: this.loanProductsTemplate.isEqualAmortization, + interestCalculationPeriodType: this.loanProductsTemplate.interestCalculationPeriodType.id, + allowPartialPeriodInterestCalcualtion: this.loanProductsTemplate.allowPartialPeriodInterestCalcualtion, + transactionProcessingStrategyCode: transactionProcessingStrategyCode, + graceOnPrincipalPayment: this.loanProductsTemplate.graceOnPrincipalPayment, + graceOnInterestPayment: this.loanProductsTemplate.graceOnInterestPayment, + graceOnInterestCharged: this.loanProductsTemplate.graceOnInterestCharged, + inArrearsTolerance: this.loanProductsTemplate.inArrearsTolerance, + daysInYearType: this.loanProductsTemplate.daysInYearType.id, + daysInMonthType: this.loanProductsTemplate.daysInMonthType.id, + canDefineInstallmentAmount: this.loanProductsTemplate.canDefineInstallmentAmount, + graceOnArrearsAgeing: this.loanProductsTemplate.graceOnArrearsAgeing, + overdueDaysForNPA: this.loanProductsTemplate.overdueDaysForNPA, + accountMovesOutOfNPAOnlyOnArrearsCompletion: + this.loanProductsTemplate.accountMovesOutOfNPAOnlyOnArrearsCompletion, + principalThresholdForLastInstallment: this.loanProductsTemplate.principalThresholdForLastInstallment, + allowVariableInstallments: this.loanProductsTemplate.allowVariableInstallments, + disallowExpectedDisbursements: this.loanProductsTemplate.disallowExpectedDisbursements, + minimumGap: this.loanProductsTemplate.minimumGap, + maximumGap: this.loanProductsTemplate.maximumGap, + canUseForTopup: this.loanProductsTemplate.canUseForTopup, + isInterestRecalculationEnabled: this.loanProductsTemplate.isInterestRecalculationEnabled, + holdGuaranteeFunds: this.loanProductsTemplate.holdGuaranteeFunds, + multiDisburseLoan: this.loanProductsTemplate.multiDisburseLoan, + maxTrancheCount: this.loanProductsTemplate.maxTrancheCount, + outstandingLoanBalance: this.loanProductsTemplate.outstandingLoanBalance, + enableDownPayment: this.loanProductsTemplate.enableDownPayment, + enableInstallmentLevelDelinquency: this.loanProductsTemplate.enableInstallmentLevelDelinquency, + loanScheduleType: this.loanProductsTemplate.loanScheduleType.code, + useDueForRepaymentsConfigurations: this.loanProductsTemplate.useDueForRepaymentsConfigurations, + allowAccrualPostingInArrears: this.loanProductsTemplate.allowAccrualPostingInArrears, + chargeOffBehaviour: this.loanProductsTemplate.chargeOffBehaviour.id }); - this.isAdvancedTransactionProcessingStrategy = LoanProducts.isAdvancedPaymentAllocationStrategy(transactionProcessingStrategyCode); + this.isAdvancedTransactionProcessingStrategy = LoanProducts.isAdvancedPaymentAllocationStrategy( + transactionProcessingStrategyCode + ); this.processingStrategyService.initialize(this.isAdvancedTransactionProcessingStrategy); this.validateAdvancedPaymentStrategyControls(); - if (this.loanProductsTemplate.dueDaysForRepaymentEvent != null && - this.loanProductsTemplate.overDueDaysForRepaymentEvent != null) { - this.loanProductSettingsForm.patchValue({ - 'useDueForRepaymentsConfigurations': false, - 'dueDaysForRepaymentEvent': this.loanProductsTemplate.dueDaysForRepaymentEvent, - 'overDueDaysForRepaymentEvent': this.loanProductsTemplate.overDueDaysForRepaymentEvent - }); + if ( + this.loanProductsTemplate.dueDaysForRepaymentEvent != null && + this.loanProductsTemplate.overDueDaysForRepaymentEvent != null + ) { + this.loanProductSettingsForm.patchValue({ + useDueForRepaymentsConfigurations: false, + dueDaysForRepaymentEvent: this.loanProductsTemplate.dueDaysForRepaymentEvent, + overDueDaysForRepaymentEvent: this.loanProductsTemplate.overDueDaysForRepaymentEvent + }); } else { this.loanProductSettingsForm.patchValue({ - 'useDueForRepaymentsConfigurations': true, - 'dueDaysForRepaymentEvent': null, - 'overDueDaysForRepaymentEvent': null + useDueForRepaymentsConfigurations: true, + dueDaysForRepaymentEvent: null, + overDueDaysForRepaymentEvent: null }); } if (this.loanProductsTemplate.delinquencyBucket) { this.loanProductSettingsForm.patchValue({ - 'delinquencyBucketId': this.loanProductsTemplate.delinquencyBucket.id > 0 ? this.loanProductsTemplate.delinquencyBucket.id : null + delinquencyBucketId: + this.loanProductsTemplate.delinquencyBucket.id > 0 ? this.loanProductsTemplate.delinquencyBucket.id : null }); } if (this.loanProductsTemplate.enableDownPayment) { this.loanProductSettingsForm.patchValue({ - 'disbursedAmountPercentageForDownPayment': this.loanProductsTemplate.disbursedAmountPercentageForDownPayment || 0, - 'enableAutoRepaymentForDownPayment': this.loanProductsTemplate.enableAutoRepaymentForDownPayment || false + disbursedAmountPercentageForDownPayment: this.loanProductsTemplate.disbursedAmountPercentageForDownPayment || 0, + enableAutoRepaymentForDownPayment: this.loanProductsTemplate.enableAutoRepaymentForDownPayment || false }); } if (this.loanProductsTemplate.isInterestRecalculationEnabled) { this.loanProductSettingsForm.patchValue({ - 'preClosureInterestCalculationStrategy': this.loanProductsTemplate.interestRecalculationData.preClosureInterestCalculationStrategy.id, - 'rescheduleStrategyMethod': this.loanProductsTemplate.interestRecalculationData.rescheduleStrategyType.id, - 'interestRecalculationCompoundingMethod': this.loanProductsTemplate.interestRecalculationData.interestRecalculationCompoundingType.id, - 'recalculationRestFrequencyType': this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyType.id, - 'isArrearsBasedOnOriginalSchedule': this.loanProductsTemplate.interestRecalculationData.isArrearsBasedOnOriginalSchedule, - 'recalculationCompoundingFrequencyType': this.loanProductsTemplate.interestRecalculationData.interestRecalculationCompoundingType.id && this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyType.id, - 'recalculationCompoundingFrequencyInterval': this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyInterval, - 'recalculationRestFrequencyInterval': this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyInterval, - 'recalculationRestFrequencyNthDayType': this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyType.id === 4 && this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyOnDay ? - -2 : this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyNthDay && this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyNthDay.id, - 'recalculationCompoundingFrequencyNthDayType': this.loanProductsTemplate.interestRecalculationData.interestRecalculationCompoundingType.id && this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyType.id === 4 - && this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyOnDay ? -2 : this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyNthDay - && this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyNthDay.id, - 'recalculationCompoundingFrequencyDayOfWeekType': this.loanProductsTemplate.interestRecalculationData.interestRecalculationCompoundingType.id && ((this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyType.id - === 4 && !this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyOnDay) || this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyType.id === 3) - && this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyWeekday && this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyWeekday.id, - 'recalculationRestFrequencyDayOfWeekType': ((this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyType.id === 4 && !this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyOnDay) - || this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyType.id === 3) && this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyWeekday - && this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyWeekday.id, - 'recalculationCompoundingFrequencyOnDayType': this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyOnDay, - 'recalculationRestFrequencyOnDayType': this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyOnDay + preClosureInterestCalculationStrategy: + this.loanProductsTemplate.interestRecalculationData.preClosureInterestCalculationStrategy.id, + rescheduleStrategyMethod: this.loanProductsTemplate.interestRecalculationData.rescheduleStrategyType.id, + interestRecalculationCompoundingMethod: + this.loanProductsTemplate.interestRecalculationData.interestRecalculationCompoundingType.id, + recalculationRestFrequencyType: + this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyType.id, + isArrearsBasedOnOriginalSchedule: + this.loanProductsTemplate.interestRecalculationData.isArrearsBasedOnOriginalSchedule, + recalculationCompoundingFrequencyType: + this.loanProductsTemplate.interestRecalculationData.interestRecalculationCompoundingType.id && + this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyType.id, + recalculationCompoundingFrequencyInterval: + this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyInterval, + recalculationRestFrequencyInterval: + this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyInterval, + recalculationRestFrequencyNthDayType: + this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyType.id === 4 && + this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyOnDay + ? -2 + : this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyNthDay && + this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyNthDay.id, + recalculationCompoundingFrequencyNthDayType: + this.loanProductsTemplate.interestRecalculationData.interestRecalculationCompoundingType.id && + this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyType.id === 4 && + this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyOnDay + ? -2 + : this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyNthDay && + this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyNthDay.id, + recalculationCompoundingFrequencyDayOfWeekType: + this.loanProductsTemplate.interestRecalculationData.interestRecalculationCompoundingType.id && + ((this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyType.id === 4 && + !this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyOnDay) || + this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyType.id === 3) && + this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyWeekday && + this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyWeekday.id, + recalculationRestFrequencyDayOfWeekType: + ((this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyType.id === 4 && + !this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyOnDay) || + this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyType.id === 3) && + this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyWeekday && + this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyWeekday.id, + recalculationCompoundingFrequencyOnDayType: + this.loanProductsTemplate.interestRecalculationData.recalculationCompoundingFrequencyOnDay, + recalculationRestFrequencyOnDayType: + this.loanProductsTemplate.interestRecalculationData.recalculationRestFrequencyOnDay }); } if (this.loanProductsTemplate.holdGuaranteeFunds) { this.loanProductSettingsForm.patchValue({ - 'mandatoryGuarantee': this.loanProductsTemplate.productGuaranteeData.mandatoryGuarantee, - 'minimumGuaranteeFromOwnFunds': this.loanProductsTemplate.productGuaranteeData.minimumGuaranteeFromOwnFunds, - 'minimumGuaranteeFromGuarantor': this.loanProductsTemplate.productGuaranteeData.minimumGuaranteeFromGuarantor + mandatoryGuarantee: this.loanProductsTemplate.productGuaranteeData.mandatoryGuarantee, + minimumGuaranteeFromOwnFunds: this.loanProductsTemplate.productGuaranteeData.minimumGuaranteeFromOwnFunds, + minimumGuaranteeFromGuarantor: this.loanProductsTemplate.productGuaranteeData.minimumGuaranteeFromGuarantor }); } if (this.loanProductsTemplate.allowAttributeOverrides) { this.loanProductSettingsForm.patchValue({ - 'allowAttributeConfiguration': Object.values(this.loanProductsTemplate.allowAttributeOverrides).some((attribute: boolean) => attribute), - 'allowAttributeOverrides': { - 'amortizationType': this.loanProductsTemplate.allowAttributeOverrides.amortizationType, - 'interestType': this.loanProductsTemplate.allowAttributeOverrides.interestType, - 'transactionProcessingStrategyCode': this.loanProductsTemplate.allowAttributeOverrides.transactionProcessingStrategyCode, - 'interestCalculationPeriodType': this.loanProductsTemplate.allowAttributeOverrides.interestCalculationPeriodType, - 'inArrearsTolerance': this.loanProductsTemplate.allowAttributeOverrides.inArrearsTolerance, - 'repaymentEvery': this.loanProductsTemplate.allowAttributeOverrides.repaymentEvery, - 'graceOnPrincipalAndInterestPayment': this.loanProductsTemplate.allowAttributeOverrides.graceOnPrincipalAndInterestPayment, - 'graceOnArrearsAgeing': this.loanProductsTemplate.allowAttributeOverrides.graceOnArrearsAgeing + allowAttributeConfiguration: Object.values(this.loanProductsTemplate.allowAttributeOverrides).some( + (attribute: boolean) => attribute + ), + allowAttributeOverrides: { + amortizationType: this.loanProductsTemplate.allowAttributeOverrides.amortizationType, + interestType: this.loanProductsTemplate.allowAttributeOverrides.interestType, + transactionProcessingStrategyCode: + this.loanProductsTemplate.allowAttributeOverrides.transactionProcessingStrategyCode, + interestCalculationPeriodType: + this.loanProductsTemplate.allowAttributeOverrides.interestCalculationPeriodType, + inArrearsTolerance: this.loanProductsTemplate.allowAttributeOverrides.inArrearsTolerance, + repaymentEvery: this.loanProductsTemplate.allowAttributeOverrides.repaymentEvery, + graceOnPrincipalAndInterestPayment: + this.loanProductsTemplate.allowAttributeOverrides.graceOnPrincipalAndInterestPayment, + graceOnArrearsAgeing: this.loanProductsTemplate.allowAttributeOverrides.graceOnArrearsAgeing } }); } @@ -212,63 +250,86 @@ export class LoanProductSettingsStepComponent implements OnInit { createLoanProductSettingsForm() { this.loanProductSettingsForm = this.formBuilder.group({ - 'amortizationType': ['', Validators.required], - 'interestType': ['', Validators.required], - 'isEqualAmortization': [false], - 'interestCalculationPeriodType': ['', Validators.required], - 'transactionProcessingStrategyCode': ['', Validators.required], - 'graceOnPrincipalPayment': [''], - 'graceOnInterestPayment': [''], - 'graceOnInterestCharged': [''], - 'inArrearsTolerance': [''], - 'daysInYearType': ['', Validators.required], - 'daysInMonthType': ['', Validators.required], - 'canDefineInstallmentAmount': [false], - 'graceOnArrearsAgeing': [''], - 'overdueDaysForNPA': [''], - 'accountMovesOutOfNPAOnlyOnArrearsCompletion': [false], - 'principalThresholdForLastInstallment': [''], - 'allowVariableInstallments': [false], - 'disallowExpectedDisbursements': [false], - 'canUseForTopup': [false], - 'isInterestRecalculationEnabled': [false], - 'holdGuaranteeFunds': [false], - 'multiDisburseLoan': [false], - 'allowAttributeConfiguration': [true], - 'allowPartialPeriodInterestCalcualtion': [false], - 'allowAttributeOverrides': this.formBuilder.group({ - 'amortizationType': [true], - 'interestType': [true], - 'transactionProcessingStrategyCode': [true], - 'interestCalculationPeriodType': [true], - 'inArrearsTolerance': [true], - 'repaymentEvery': [true], - 'graceOnPrincipalAndInterestPayment': [true], - 'graceOnArrearsAgeing': [true] + amortizationType: [ + '', + Validators.required + ], + interestType: [ + '', + Validators.required + ], + isEqualAmortization: [false], + interestCalculationPeriodType: [ + '', + Validators.required + ], + transactionProcessingStrategyCode: [ + '', + Validators.required + ], + graceOnPrincipalPayment: [''], + graceOnInterestPayment: [''], + graceOnInterestCharged: [''], + inArrearsTolerance: [''], + daysInYearType: [ + '', + Validators.required + ], + daysInMonthType: [ + '', + Validators.required + ], + canDefineInstallmentAmount: [false], + graceOnArrearsAgeing: [''], + overdueDaysForNPA: [''], + accountMovesOutOfNPAOnlyOnArrearsCompletion: [false], + principalThresholdForLastInstallment: [''], + allowVariableInstallments: [false], + disallowExpectedDisbursements: [false], + canUseForTopup: [false], + isInterestRecalculationEnabled: [false], + holdGuaranteeFunds: [false], + multiDisburseLoan: [false], + allowAttributeConfiguration: [true], + allowPartialPeriodInterestCalcualtion: [false], + allowAttributeOverrides: this.formBuilder.group({ + amortizationType: [true], + interestType: [true], + transactionProcessingStrategyCode: [true], + interestCalculationPeriodType: [true], + inArrearsTolerance: [true], + repaymentEvery: [true], + graceOnPrincipalAndInterestPayment: [true], + graceOnArrearsAgeing: [true] }), - 'delinquencyBucketId': [''], - 'enableDownPayment': [false], - 'enableInstallmentLevelDelinquency': [false], - 'useDueForRepaymentsConfigurations': [false], - 'dueDaysForRepaymentEvent': [''], - 'overDueDaysForRepaymentEvent': [''], - 'loanScheduleType': [LoanProducts.LOAN_SCHEDULE_TYPE_CUMULATIVE, Validators.required], - 'allowAccrualPostingInArrears': [false] + delinquencyBucketId: [''], + enableDownPayment: [false], + enableInstallmentLevelDelinquency: [false], + useDueForRepaymentsConfigurations: [false], + dueDaysForRepaymentEvent: [''], + overDueDaysForRepaymentEvent: [''], + loanScheduleType: [ + LoanProducts.LOAN_SCHEDULE_TYPE_CUMULATIVE, + Validators.required + ], + allowAccrualPostingInArrears: [false] }); } setConditionalControls() { const allowAttributeOverrides = this.loanProductSettingsForm.get('allowAttributeOverrides'); - this.loanProductSettingsForm.get('interestCalculationPeriodType').valueChanges - .subscribe((interestCalculationPeriodType: any) => { + this.loanProductSettingsForm + .get('interestCalculationPeriodType') + .valueChanges.subscribe((interestCalculationPeriodType: any) => { if (interestCalculationPeriodType === 0) { - this.loanProductSettingsForm.patchValue({ 'allowPartialPeriodInterestCalcualtion': false }); + this.loanProductSettingsForm.patchValue({ allowPartialPeriodInterestCalcualtion: false }); } }); - this.loanProductSettingsForm.get('allowVariableInstallments').valueChanges - .subscribe((allowVariableInstallments: any) => { + this.loanProductSettingsForm + .get('allowVariableInstallments') + .valueChanges.subscribe((allowVariableInstallments: any) => { if (allowVariableInstallments) { this.loanProductSettingsForm.addControl('minimumGap', new UntypedFormControl('', Validators.required)); this.loanProductSettingsForm.addControl('maximumGap', new UntypedFormControl('', Validators.required)); @@ -278,45 +339,84 @@ export class LoanProductSettingsStepComponent implements OnInit { } }); - this.loanProductSettingsForm.get('isInterestRecalculationEnabled').valueChanges - .subscribe((isInterestRecalculationEnabled: any) => { + this.loanProductSettingsForm + .get('isInterestRecalculationEnabled') + .valueChanges.subscribe((isInterestRecalculationEnabled: any) => { if (isInterestRecalculationEnabled) { - this.loanProductSettingsForm.addControl('preClosureInterestCalculationStrategy', new UntypedFormControl(this.preClosureInterestCalculationStrategyData[0].id, Validators.required)); - this.loanProductSettingsForm.addControl('rescheduleStrategyMethod', new UntypedFormControl(this.rescheduleStrategyTypeData[0].id, Validators.required)); - this.loanProductSettingsForm.addControl('interestRecalculationCompoundingMethod', new UntypedFormControl(this.interestRecalculationCompoundingTypeData[0].id, Validators.required)); - this.loanProductSettingsForm.addControl('recalculationRestFrequencyType', new UntypedFormControl(this.interestRecalculationFrequencyTypeData[0].id, Validators.required)); + this.loanProductSettingsForm.addControl( + 'preClosureInterestCalculationStrategy', + new UntypedFormControl(this.preClosureInterestCalculationStrategyData[0].id, Validators.required) + ); + this.loanProductSettingsForm.addControl( + 'rescheduleStrategyMethod', + new UntypedFormControl(this.rescheduleStrategyTypeData[0].id, Validators.required) + ); + this.loanProductSettingsForm.addControl( + 'interestRecalculationCompoundingMethod', + new UntypedFormControl(this.interestRecalculationCompoundingTypeData[0].id, Validators.required) + ); + this.loanProductSettingsForm.addControl( + 'recalculationRestFrequencyType', + new UntypedFormControl(this.interestRecalculationFrequencyTypeData[0].id, Validators.required) + ); this.loanProductSettingsForm.addControl('isArrearsBasedOnOriginalSchedule', new UntypedFormControl('')); if (this.loanProductSettingsForm.value.isInterestRecalculationEnabled) { this.setRescheduleStrategies(); } - this.loanProductSettingsForm.get('interestRecalculationCompoundingMethod').valueChanges - .subscribe((interestRecalculationCompoundingMethod: any) => { + this.loanProductSettingsForm + .get('interestRecalculationCompoundingMethod') + .valueChanges.subscribe((interestRecalculationCompoundingMethod: any) => { if (interestRecalculationCompoundingMethod !== 0) { - this.loanProductSettingsForm.addControl('recalculationCompoundingFrequencyType', new UntypedFormControl(this.interestRecalculationFrequencyTypeData[0].id, Validators.required)); + this.loanProductSettingsForm.addControl( + 'recalculationCompoundingFrequencyType', + new UntypedFormControl(this.interestRecalculationFrequencyTypeData[0].id, Validators.required) + ); - this.loanProductSettingsForm.get('recalculationCompoundingFrequencyType').valueChanges - .subscribe((recalculationCompoundingFrequencyType: any) => { + this.loanProductSettingsForm + .get('recalculationCompoundingFrequencyType') + .valueChanges.subscribe((recalculationCompoundingFrequencyType: any) => { if (recalculationCompoundingFrequencyType !== 1) { - this.loanProductSettingsForm.addControl('recalculationCompoundingFrequencyInterval', new UntypedFormControl('', Validators.required)); + this.loanProductSettingsForm.addControl( + 'recalculationCompoundingFrequencyInterval', + new UntypedFormControl('', Validators.required) + ); } else { this.loanProductSettingsForm.removeControl('recalculationCompoundingFrequencyInterval'); } if (recalculationCompoundingFrequencyType === 3) { - this.loanProductSettingsForm.addControl('recalculationCompoundingFrequencyDayOfWeekType', new UntypedFormControl('')); + this.loanProductSettingsForm.addControl( + 'recalculationCompoundingFrequencyDayOfWeekType', + new UntypedFormControl('') + ); this.loanProductSettingsForm.removeControl('recalculationCompoundingFrequencyNthDayType'); this.loanProductSettingsForm.removeControl('recalculationCompoundingFrequencyOnDayType'); } else if (recalculationCompoundingFrequencyType === 4) { - this.loanProductSettingsForm.addControl('recalculationCompoundingFrequencyNthDayType', new UntypedFormControl('')); - this.loanProductSettingsForm.addControl('recalculationCompoundingFrequencyDayOfWeekType', new UntypedFormControl('')); + this.loanProductSettingsForm.addControl( + 'recalculationCompoundingFrequencyNthDayType', + new UntypedFormControl('') + ); + this.loanProductSettingsForm.addControl( + 'recalculationCompoundingFrequencyDayOfWeekType', + new UntypedFormControl('') + ); - this.loanProductSettingsForm.get('recalculationCompoundingFrequencyNthDayType').valueChanges - .subscribe((recalculationCompoundingFrequencyNthDayType: any) => { + this.loanProductSettingsForm + .get('recalculationCompoundingFrequencyNthDayType') + .valueChanges.subscribe((recalculationCompoundingFrequencyNthDayType: any) => { if (recalculationCompoundingFrequencyNthDayType === -2) { - this.loanProductSettingsForm.addControl('recalculationCompoundingFrequencyOnDayType', new UntypedFormControl('')); - this.loanProductSettingsForm.removeControl('recalculationCompoundingFrequencyDayOfWeekType'); + this.loanProductSettingsForm.addControl( + 'recalculationCompoundingFrequencyOnDayType', + new UntypedFormControl('') + ); + this.loanProductSettingsForm.removeControl( + 'recalculationCompoundingFrequencyDayOfWeekType' + ); } else { - this.loanProductSettingsForm.addControl('recalculationCompoundingFrequencyDayOfWeekType', new UntypedFormControl('')); + this.loanProductSettingsForm.addControl( + 'recalculationCompoundingFrequencyDayOfWeekType', + new UntypedFormControl('') + ); this.loanProductSettingsForm.removeControl('recalculationCompoundingFrequencyOnDayType'); } }); @@ -326,46 +426,63 @@ export class LoanProductSettingsStepComponent implements OnInit { this.loanProductSettingsForm.removeControl('recalculationCompoundingFrequencyOnDayType'); } }); - } else { this.loanProductSettingsForm.removeControl('recalculationCompoundingFrequencyType'); } }); - this.loanProductSettingsForm.get('recalculationRestFrequencyType').valueChanges - .subscribe((recalculationRestFrequencyType: any) => { + this.loanProductSettingsForm + .get('recalculationRestFrequencyType') + .valueChanges.subscribe((recalculationRestFrequencyType: any) => { if (recalculationRestFrequencyType !== 1) { - this.loanProductSettingsForm.addControl('recalculationRestFrequencyInterval', new UntypedFormControl('', Validators.required)); + this.loanProductSettingsForm.addControl( + 'recalculationRestFrequencyInterval', + new UntypedFormControl('', Validators.required) + ); } else { this.loanProductSettingsForm.removeControl('recalculationRestFrequencyInterval'); } if (recalculationRestFrequencyType === 3) { - this.loanProductSettingsForm.addControl('recalculationRestFrequencyDayOfWeekType', new UntypedFormControl('')); + this.loanProductSettingsForm.addControl( + 'recalculationRestFrequencyDayOfWeekType', + new UntypedFormControl('') + ); this.loanProductSettingsForm.removeControl('recalculationRestFrequencyNthDayType'); this.loanProductSettingsForm.removeControl('recalculationRestFrequencyOnDayType'); } else if (recalculationRestFrequencyType === 4) { - this.loanProductSettingsForm.addControl('recalculationRestFrequencyNthDayType', new UntypedFormControl('')); - this.loanProductSettingsForm.addControl('recalculationRestFrequencyDayOfWeekType', new UntypedFormControl('')); + this.loanProductSettingsForm.addControl( + 'recalculationRestFrequencyNthDayType', + new UntypedFormControl('') + ); + this.loanProductSettingsForm.addControl( + 'recalculationRestFrequencyDayOfWeekType', + new UntypedFormControl('') + ); - this.loanProductSettingsForm.get('recalculationRestFrequencyNthDayType').valueChanges - .subscribe((recalculationRestFrequencyNthDayType: any) => { + this.loanProductSettingsForm + .get('recalculationRestFrequencyNthDayType') + .valueChanges.subscribe((recalculationRestFrequencyNthDayType: any) => { if (recalculationRestFrequencyNthDayType === -2) { - this.loanProductSettingsForm.addControl('recalculationRestFrequencyOnDayType', new UntypedFormControl('')); + this.loanProductSettingsForm.addControl( + 'recalculationRestFrequencyOnDayType', + new UntypedFormControl('') + ); this.loanProductSettingsForm.removeControl('recalculationRestFrequencyDayOfWeekType'); } else { - this.loanProductSettingsForm.addControl('recalculationRestFrequencyDayOfWeekType', new UntypedFormControl('')); + this.loanProductSettingsForm.addControl( + 'recalculationRestFrequencyDayOfWeekType', + new UntypedFormControl('') + ); this.loanProductSettingsForm.removeControl('recalculationRestFrequencyOnDayType'); } }); - } else { this.loanProductSettingsForm.removeControl('recalculationRestFrequencyNthDayType'); this.loanProductSettingsForm.removeControl('recalculationRestFrequencyDayOfWeekType'); this.loanProductSettingsForm.removeControl('recalculationRestFrequencyOnDayType'); } }); - } else { this.loanProductSettingsForm.removeControl('preClosureInterestCalculationStrategy'); this.loanProductSettingsForm.removeControl('rescheduleStrategyMethod'); @@ -376,122 +493,134 @@ export class LoanProductSettingsStepComponent implements OnInit { this.enableFieldsWhenScheduleTypeIsProgressiveAndInterestRateRecalculationEnabled(); }); - this.loanProductSettingsForm.get('holdGuaranteeFunds').valueChanges - .subscribe(holdGuaranteeFunds => { - if (holdGuaranteeFunds) { - this.loanProductSettingsForm.addControl('mandatoryGuarantee', new UntypedFormControl('', Validators.required)); - this.loanProductSettingsForm.addControl('minimumGuaranteeFromOwnFunds', new UntypedFormControl('')); - this.loanProductSettingsForm.addControl('minimumGuaranteeFromGuarantor', new UntypedFormControl('')); - } else { - this.loanProductSettingsForm.removeControl('mandatoryGuarantee'); - this.loanProductSettingsForm.removeControl('minimumGuaranteeFromOwnFunds'); - this.loanProductSettingsForm.removeControl('minimumGuaranteeFromGuarantor'); - } - }); + this.loanProductSettingsForm.get('holdGuaranteeFunds').valueChanges.subscribe((holdGuaranteeFunds) => { + if (holdGuaranteeFunds) { + this.loanProductSettingsForm.addControl('mandatoryGuarantee', new UntypedFormControl('', Validators.required)); + this.loanProductSettingsForm.addControl('minimumGuaranteeFromOwnFunds', new UntypedFormControl('')); + this.loanProductSettingsForm.addControl('minimumGuaranteeFromGuarantor', new UntypedFormControl('')); + } else { + this.loanProductSettingsForm.removeControl('mandatoryGuarantee'); + this.loanProductSettingsForm.removeControl('minimumGuaranteeFromOwnFunds'); + this.loanProductSettingsForm.removeControl('minimumGuaranteeFromGuarantor'); + } + }); - this.loanProductSettingsForm.get('multiDisburseLoan').valueChanges - .subscribe(multiDisburseLoan => { - if (multiDisburseLoan) { - this.loanProductSettingsForm.addControl('maxTrancheCount', new UntypedFormControl('', Validators.required)); - this.loanProductSettingsForm.addControl('outstandingLoanBalance', new UntypedFormControl('')); - } else { - this.loanProductSettingsForm.removeControl('maxTrancheCount'); - this.loanProductSettingsForm.removeControl('outstandingLoanBalance'); - this.loanProductSettingsForm.patchValue({ 'disallowExpectedDisbursements': false }); - } - }); + this.loanProductSettingsForm.get('multiDisburseLoan').valueChanges.subscribe((multiDisburseLoan) => { + if (multiDisburseLoan) { + this.loanProductSettingsForm.addControl('maxTrancheCount', new UntypedFormControl('', Validators.required)); + this.loanProductSettingsForm.addControl('outstandingLoanBalance', new UntypedFormControl('')); + } else { + this.loanProductSettingsForm.removeControl('maxTrancheCount'); + this.loanProductSettingsForm.removeControl('outstandingLoanBalance'); + this.loanProductSettingsForm.patchValue({ disallowExpectedDisbursements: false }); + } + }); - this.loanProductSettingsForm.get('enableDownPayment').valueChanges - .subscribe(enableDownPayment => { - if (enableDownPayment) { - this.loanProductSettingsForm.addControl('disbursedAmountPercentageForDownPayment', new UntypedFormControl(0, [Validators.required, rangeValidator(0, 100) ])); - this.loanProductSettingsForm.addControl('enableAutoRepaymentForDownPayment', new UntypedFormControl(false, [])); - } else { - this.loanProductSettingsForm.removeControl('disbursedAmountPercentageForDownPayment'); - this.loanProductSettingsForm.removeControl('enableAutoRepaymentForDownPayment'); - } - }); + this.loanProductSettingsForm.get('enableDownPayment').valueChanges.subscribe((enableDownPayment) => { + if (enableDownPayment) { + this.loanProductSettingsForm.addControl( + 'disbursedAmountPercentageForDownPayment', + new UntypedFormControl(0, [ + Validators.required, + rangeValidator(0, 100)]) + ); + this.loanProductSettingsForm.addControl('enableAutoRepaymentForDownPayment', new UntypedFormControl(false, [])); + } else { + this.loanProductSettingsForm.removeControl('disbursedAmountPercentageForDownPayment'); + this.loanProductSettingsForm.removeControl('enableAutoRepaymentForDownPayment'); + } + }); - this.loanProductSettingsForm.get('transactionProcessingStrategyCode').valueChanges - .subscribe((transactionProcessingStrategyCode: string) => { + this.loanProductSettingsForm + .get('transactionProcessingStrategyCode') + .valueChanges.subscribe((transactionProcessingStrategyCode: string) => { this.advancePaymentStrategy.emit(transactionProcessingStrategyCode); - this.isAdvancedTransactionProcessingStrategy = LoanProducts.isAdvancedPaymentAllocationStrategy(transactionProcessingStrategyCode); + this.isAdvancedTransactionProcessingStrategy = LoanProducts.isAdvancedPaymentAllocationStrategy( + transactionProcessingStrategyCode + ); this.processingStrategyService.initialize(this.isAdvancedTransactionProcessingStrategy); this.validateAdvancedPaymentStrategyControls(); }); - this.loanProductSettingsForm.get('allowAttributeConfiguration').valueChanges - .subscribe((allowAttributeConfiguration: any) => { + this.loanProductSettingsForm + .get('allowAttributeConfiguration') + .valueChanges.subscribe((allowAttributeConfiguration: any) => { if (allowAttributeConfiguration) { allowAttributeOverrides.patchValue({ - 'amortizationType': true, - 'interestType': true, - 'transactionProcessingStrategyCode': true, - 'interestCalculationPeriodType': true, - 'inArrearsTolerance': true, - 'repaymentEvery': true, - 'graceOnPrincipalAndInterestPayment': true, - 'graceOnArrearsAgeing': true + amortizationType: true, + interestType: true, + transactionProcessingStrategyCode: true, + interestCalculationPeriodType: true, + inArrearsTolerance: true, + repaymentEvery: true, + graceOnPrincipalAndInterestPayment: true, + graceOnArrearsAgeing: true }); } else { allowAttributeOverrides.patchValue({ - 'amortizationType': false, - 'interestType': false, - 'transactionProcessingStrategyCode': false, - 'interestCalculationPeriodType': false, - 'inArrearsTolerance': false, - 'repaymentEvery': false, - 'graceOnPrincipalAndInterestPayment': false, - 'graceOnArrearsAgeing': false + amortizationType: false, + interestType: false, + transactionProcessingStrategyCode: false, + interestCalculationPeriodType: false, + inArrearsTolerance: false, + repaymentEvery: false, + graceOnPrincipalAndInterestPayment: false, + graceOnArrearsAgeing: false }); } }); - this.loanProductSettingsForm.get('useDueForRepaymentsConfigurations').valueChanges - .subscribe((useDueForRepaymentsConfigurations: boolean) => { - if (useDueForRepaymentsConfigurations) { - this.loanProductSettingsForm.patchValue({ - 'dueDaysForRepaymentEvent': null, - 'overDueDaysForRepaymentEvent': null - }); - } else { - this.loanProductSettingsForm.patchValue({ - 'dueDaysForRepaymentEvent': this.getGlobalConfigValue(LoanProducts.DAYS_BEFORE_REPAYMENT_IS_DUE), - 'overDueDaysForRepaymentEvent': this.getGlobalConfigValue(LoanProducts.DAYS_AFTER_REPAYMENT_IS_OVERDUE) - }); - } - }); + this.loanProductSettingsForm + .get('useDueForRepaymentsConfigurations') + .valueChanges.subscribe((useDueForRepaymentsConfigurations: boolean) => { + if (useDueForRepaymentsConfigurations) { + this.loanProductSettingsForm.patchValue({ + dueDaysForRepaymentEvent: null, + overDueDaysForRepaymentEvent: null + }); + } else { + this.loanProductSettingsForm.patchValue({ + dueDaysForRepaymentEvent: this.getGlobalConfigValue(LoanProducts.DAYS_BEFORE_REPAYMENT_IS_DUE), + overDueDaysForRepaymentEvent: this.getGlobalConfigValue(LoanProducts.DAYS_AFTER_REPAYMENT_IS_OVERDUE) + }); + } + }); - this.loanProductSettingsForm.get('loanScheduleType').valueChanges - .subscribe((loanScheduleType: string) => { + this.loanProductSettingsForm.get('loanScheduleType').valueChanges.subscribe((loanScheduleType: string) => { this.transactionProcessingStrategyData = []; if (loanScheduleType === LoanProducts.LOAN_SCHEDULE_TYPE_CUMULATIVE) { // Filter Advanced Payment Allocation Strategy this.transactionProcessingStrategyData = this.transactionProcessingStrategyDataBase.filter( (cn: CodeName) => !LoanProducts.isAdvancedPaymentAllocationStrategy(cn.code) ); - if (LoanProducts.isAdvancedPaymentAllocationStrategy(this.loanProductSettingsForm.value.transactionProcessingStrategyCode)) { + if ( + LoanProducts.isAdvancedPaymentAllocationStrategy( + this.loanProductSettingsForm.value.transactionProcessingStrategyCode + ) + ) { this.loanProductSettingsForm.patchValue({ - 'transactionProcessingStrategyCode': this.transactionProcessingStrategyData[0].code + transactionProcessingStrategyCode: this.transactionProcessingStrategyData[0].code }); } this.advancedTransactionProcessingStrategyDisabled = false; - this.isAdvancedTransactionProcessingStrategy = false; + this.isAdvancedTransactionProcessingStrategy = false; this.loanProductSettingsForm.removeControl('chargeOffBehaviour'); } else { // Only Advanced Payment Allocation Strategy - this.transactionProcessingStrategyDataBase.some( - (cn: CodeName) => { + this.transactionProcessingStrategyDataBase.some((cn: CodeName) => { if (LoanProducts.isAdvancedPaymentAllocationStrategy(cn.code)) { this.transactionProcessingStrategyData.push(cn); } }); this.advancedTransactionProcessingStrategyDisabled = true; this.loanProductSettingsForm.patchValue({ - 'transactionProcessingStrategyCode': this.transactionProcessingStrategyData[0].code + transactionProcessingStrategyCode: this.transactionProcessingStrategyData[0].code }); - this.isAdvancedTransactionProcessingStrategy = true; - this.loanProductSettingsForm.addControl('chargeOffBehaviour', new UntypedFormControl(this.loanProductsTemplate.chargeOffBehaviour.id)); + this.isAdvancedTransactionProcessingStrategy = true; + this.loanProductSettingsForm.addControl( + 'chargeOffBehaviour', + new UntypedFormControl(this.loanProductsTemplate.chargeOffBehaviour.id) + ); } if (this.loanProductSettingsForm.value.isInterestRecalculationEnabled) { this.setRescheduleStrategies(); @@ -502,35 +631,36 @@ export class LoanProductSettingsStepComponent implements OnInit { } private enableFieldsWhenScheduleTypeIsProgressiveAndInterestRateRecalculationEnabled() { - const isProgressiveLoan = this.loanProductSettingsForm.get('loanScheduleType').value === LoanProducts.LOAN_SCHEDULE_TYPE_PROGRESSIVE; - const isInterestRecalculationEnabled = this.loanProductSettingsForm.get('isInterestRecalculationEnabled').value == true; + const isProgressiveLoan = + this.loanProductSettingsForm.get('loanScheduleType').value === LoanProducts.LOAN_SCHEDULE_TYPE_PROGRESSIVE; + const isInterestRecalculationEnabled = + this.loanProductSettingsForm.get('isInterestRecalculationEnabled').value == true; const shouldControlExists = isProgressiveLoan && isInterestRecalculationEnabled; const isControlExists = this.loanProductSettingsForm.contains('disallowInterestCalculationOnPastDue'); if (shouldControlExists && !isControlExists) { this.loanProductSettingsForm.addControl('disallowInterestCalculationOnPastDue', new UntypedFormControl('')); - this.loanProductSettingsForm.patchValue({'disallowInterestCalculationOnPastDue': this.loanProductsTemplate.interestRecalculationData?.disallowInterestCalculationOnPastDue ?? false}); + this.loanProductSettingsForm.patchValue({ + disallowInterestCalculationOnPastDue: + this.loanProductsTemplate.interestRecalculationData?.disallowInterestCalculationOnPastDue ?? false + }); } else if (isControlExists && !shouldControlExists) { - this.loanProductSettingsForm.patchValue({'disallowInterestCalculationOnPastDue': undefined }); + this.loanProductSettingsForm.patchValue({ disallowInterestCalculationOnPastDue: undefined }); this.loanProductSettingsForm.removeControl('disallowInterestCalculationOnPastDue'); } } private setRescheduleStrategies() { if (this.advancedTransactionProcessingStrategyDisabled) { - this.rescheduleStrategyTypeData = this.rescheduleStrategyTypeDataBase.filter( - (o: OptionData) => o.id > 3 - ); + this.rescheduleStrategyTypeData = this.rescheduleStrategyTypeDataBase.filter((o: OptionData) => o.id > 3); this.loanProductSettingsForm.patchValue({ - 'rescheduleStrategyMethod': this.rescheduleStrategyTypeData[0].id + rescheduleStrategyMethod: this.rescheduleStrategyTypeData[0].id }); this.rescheduleStrategyTypeDisabled = true; } else { - this.rescheduleStrategyTypeData = this.rescheduleStrategyTypeDataBase.filter( - (o: OptionData) => o.id < 4 - ); + this.rescheduleStrategyTypeData = this.rescheduleStrategyTypeDataBase.filter((o: OptionData) => o.id < 4); this.loanProductSettingsForm.patchValue({ - 'rescheduleStrategyMethod': this.rescheduleStrategyTypeData[0].id + rescheduleStrategyMethod: this.rescheduleStrategyTypeData[0].id }); this.rescheduleStrategyTypeDisabled = false; } @@ -549,7 +679,7 @@ export class LoanProductSettingsStepComponent implements OnInit { clearProperty($event: Event, propertyName: string): void { if (propertyName === 'delinquencyBucketId') { this.loanProductSettingsForm.patchValue({ - 'delinquencyBucketId': '' + delinquencyBucketId: '' }); } this.loanProductSettingsForm.markAsDirty(); @@ -570,8 +700,14 @@ export class LoanProductSettingsStepComponent implements OnInit { private validateAdvancedPaymentStrategyControls(): void { if (this.isAdvancedTransactionProcessingStrategy) { - this.loanProductSettingsForm.addControl('loanScheduleProcessingType', new UntypedFormControl( - this.loanProductsTemplate.loanScheduleProcessingType.code || LoanProducts.LOAN_SCHEDULE_PROCESSING_TYPE_HORIZONTAL, [Validators.required])); + this.loanProductSettingsForm.addControl( + 'loanScheduleProcessingType', + new UntypedFormControl( + this.loanProductsTemplate.loanScheduleProcessingType.code || + LoanProducts.LOAN_SCHEDULE_PROCESSING_TYPE_HORIZONTAL, + [Validators.required] + ) + ); } else { this.loanProductSettingsForm.removeControl('loanScheduleProcessingType'); } diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.spec.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.spec.ts index 7c563f65b..066e21569 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.spec.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanProductTermsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanProductTermsStepComponent ] - }) - .compileComponents(); + declarations: [LoanProductTermsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.ts index 7e8335ace..64e4b32de 100644 --- a/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.ts +++ b/src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.ts @@ -17,7 +17,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./loan-product-terms-step.component.scss'] }) export class LoanProductTermsStepComponent implements OnInit, OnChanges { - @Input() loanProductsTemplate: any; loanProductTermsForm: UntypedFormGroup; @@ -32,13 +31,22 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges { repaymentFrequencyTypeData: any; repaymentStartDateTypeOptions: any; - displayedColumns: string[] = ['valueConditionType', 'borrowerCycleNumber', 'minValue', 'defaultValue', 'maxValue', 'actions']; + displayedColumns: string[] = [ + 'valueConditionType', + 'borrowerCycleNumber', + 'minValue', + 'defaultValue', + 'maxValue', + 'actions' + ]; isAdvancedTransactionProcessingStrategy = false; - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private processingStrategyService: ProcessingStrategyService, private dialog: MatDialog, - private translateService: TranslateService) { + private translateService: TranslateService + ) { this.createLoanProductTermsForm(); this.setConditionalControls(); } @@ -49,49 +57,78 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges { this.interestRateFrequencyTypeData = this.loanProductsTemplate.interestRateFrequencyTypeOptions; this.repaymentFrequencyTypeData = this.loanProductsTemplate.repaymentFrequencyTypeOptions; this.repaymentStartDateTypeOptions = this.loanProductsTemplate.repaymentStartDateTypeOptions; - this.overAppliedCalculationTypeData = [{id: 'percentage', value: 'Percentage'}, {id: 'flat', value: 'Fixed Amount'}]; + this.overAppliedCalculationTypeData = [ + { id: 'percentage', value: 'Percentage' }, + { id: 'flat', value: 'Fixed Amount' } + ]; this.loanProductTermsForm.patchValue({ - 'minPrincipal': this.loanProductsTemplate.minPrincipal, - 'principal': this.loanProductsTemplate.principal, - 'maxPrincipal': this.loanProductsTemplate.maxPrincipal, - 'minNumberOfRepayments': this.loanProductsTemplate.minNumberOfRepayments, - 'numberOfRepayments': this.loanProductsTemplate.numberOfRepayments, - 'maxNumberOfRepayments': this.loanProductsTemplate.maxNumberOfRepayments, - 'isLinkedToFloatingInterestRates': this.loanProductsTemplate.isLinkedToFloatingInterestRates, - 'minInterestRatePerPeriod': this.loanProductsTemplate.minInterestRatePerPeriod, - 'interestRatePerPeriod': this.loanProductsTemplate.interestRatePerPeriod, - 'maxInterestRatePerPeriod': this.loanProductsTemplate.maxInterestRatePerPeriod, - 'interestRateFrequencyType': this.loanProductsTemplate.interestRateFrequencyType.id, - 'floatingRatesId': this.loanProductsTemplate.floatingRateId, - 'interestRateDifferential': this.loanProductsTemplate.interestRateDifferential, - 'isFloatingInterestRateCalculationAllowed': this.loanProductsTemplate.isFloatingInterestRateCalculationAllowed, - 'allowApprovedDisbursedAmountsOverApplied': this.loanProductsTemplate.allowApprovedDisbursedAmountsOverApplied, - 'minDifferentialLendingRate': this.loanProductsTemplate.minDifferentialLendingRate, - 'defaultDifferentialLendingRate': this.loanProductsTemplate.defaultDifferentialLendingRate, - 'maxDifferentialLendingRate': this.loanProductsTemplate.maxDifferentialLendingRate, - 'useBorrowerCycle': this.loanProductsTemplate.useBorrowerCycle, - 'repaymentEvery': this.loanProductsTemplate.repaymentEvery, - 'repaymentFrequencyType': this.loanProductsTemplate.repaymentFrequencyType.id, - 'minimumDaysBetweenDisbursalAndFirstRepayment': this.loanProductsTemplate.minimumDaysBetweenDisbursalAndFirstRepayment, - 'repaymentStartDateType': this.loanProductsTemplate.repaymentStartDateType.id || 1 + minPrincipal: this.loanProductsTemplate.minPrincipal, + principal: this.loanProductsTemplate.principal, + maxPrincipal: this.loanProductsTemplate.maxPrincipal, + minNumberOfRepayments: this.loanProductsTemplate.minNumberOfRepayments, + numberOfRepayments: this.loanProductsTemplate.numberOfRepayments, + maxNumberOfRepayments: this.loanProductsTemplate.maxNumberOfRepayments, + isLinkedToFloatingInterestRates: this.loanProductsTemplate.isLinkedToFloatingInterestRates, + minInterestRatePerPeriod: this.loanProductsTemplate.minInterestRatePerPeriod, + interestRatePerPeriod: this.loanProductsTemplate.interestRatePerPeriod, + maxInterestRatePerPeriod: this.loanProductsTemplate.maxInterestRatePerPeriod, + interestRateFrequencyType: this.loanProductsTemplate.interestRateFrequencyType.id, + floatingRatesId: this.loanProductsTemplate.floatingRateId, + interestRateDifferential: this.loanProductsTemplate.interestRateDifferential, + isFloatingInterestRateCalculationAllowed: this.loanProductsTemplate.isFloatingInterestRateCalculationAllowed, + allowApprovedDisbursedAmountsOverApplied: this.loanProductsTemplate.allowApprovedDisbursedAmountsOverApplied, + minDifferentialLendingRate: this.loanProductsTemplate.minDifferentialLendingRate, + defaultDifferentialLendingRate: this.loanProductsTemplate.defaultDifferentialLendingRate, + maxDifferentialLendingRate: this.loanProductsTemplate.maxDifferentialLendingRate, + useBorrowerCycle: this.loanProductsTemplate.useBorrowerCycle, + repaymentEvery: this.loanProductsTemplate.repaymentEvery, + repaymentFrequencyType: this.loanProductsTemplate.repaymentFrequencyType.id, + minimumDaysBetweenDisbursalAndFirstRepayment: + this.loanProductsTemplate.minimumDaysBetweenDisbursalAndFirstRepayment, + repaymentStartDateType: this.loanProductsTemplate.repaymentStartDateType.id || 1 }); if (this.loanProductsTemplate.allowApprovedDisbursedAmountsOverApplied) { this.loanProductTermsForm.patchValue({ - 'overAppliedCalculationType': this.loanProductsTemplate.overAppliedCalculationType, - 'overAppliedNumber': this.loanProductsTemplate.overAppliedNumber, + overAppliedCalculationType: this.loanProductsTemplate.overAppliedCalculationType, + overAppliedNumber: this.loanProductsTemplate.overAppliedNumber }); } - this.loanProductTermsForm.setControl('principalVariationsForBorrowerCycle', - this.formBuilder.array(this.loanProductsTemplate.principalVariationsForBorrowerCycle.map((variation: any) => ({ ...variation, valueConditionType: variation.valueConditionType.id })))); - this.loanProductTermsForm.setControl('numberOfRepaymentVariationsForBorrowerCycle', - this.formBuilder.array(this.loanProductsTemplate.numberOfRepaymentVariationsForBorrowerCycle.map((variation: any) => ({ ...variation, valueConditionType: variation.valueConditionType.id })))); - this.loanProductTermsForm.setControl('interestRateVariationsForBorrowerCycle', - this.formBuilder.array(this.loanProductsTemplate.interestRateVariationsForBorrowerCycle.map((variation: any) => ({ ...variation, valueConditionType: variation.valueConditionType.id })))); + this.loanProductTermsForm.setControl( + 'principalVariationsForBorrowerCycle', + this.formBuilder.array( + this.loanProductsTemplate.principalVariationsForBorrowerCycle.map((variation: any) => ({ + ...variation, + valueConditionType: variation.valueConditionType.id + })) + ) + ); + this.loanProductTermsForm.setControl( + 'numberOfRepaymentVariationsForBorrowerCycle', + this.formBuilder.array( + this.loanProductsTemplate.numberOfRepaymentVariationsForBorrowerCycle.map((variation: any) => ({ + ...variation, + valueConditionType: variation.valueConditionType.id + })) + ) + ); + this.loanProductTermsForm.setControl( + 'interestRateVariationsForBorrowerCycle', + this.formBuilder.array( + this.loanProductsTemplate.interestRateVariationsForBorrowerCycle.map((variation: any) => ({ + ...variation, + valueConditionType: variation.valueConditionType.id + })) + ) + ); - this.zeroInterest.patchValue((this.loanProductsTemplate.minInterestRatePerPeriod === 0 && this.loanProductsTemplate.interestRatePerPeriod === 0 && this.loanProductsTemplate.maxInterestRatePerPeriod === 0)); + this.zeroInterest.patchValue( + this.loanProductsTemplate.minInterestRatePerPeriod === 0 && + this.loanProductsTemplate.interestRatePerPeriod === 0 && + this.loanProductsTemplate.maxInterestRatePerPeriod === 0 + ); this.processingStrategyService.advancedTransactionProcessingStrategy.subscribe((value: boolean) => { this.isAdvancedTransactionProcessingStrategy = value; @@ -101,24 +138,42 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges { createLoanProductTermsForm() { this.loanProductTermsForm = this.formBuilder.group({ - 'useBorrowerCycle': [false], - 'minPrincipal': [''], - 'principal': ['', Validators.required], - 'maxPrincipal': [''], - 'minNumberOfRepayments': [''], - 'numberOfRepayments': ['', Validators.required], - 'maxNumberOfRepayments': [''], - 'isLinkedToFloatingInterestRates': [false], - 'allowApprovedDisbursedAmountsOverApplied': [false], - 'minInterestRatePerPeriod': [''], - 'interestRatePerPeriod': ['', Validators.required], - 'maxInterestRatePerPeriod': [''], - 'interestRateFrequencyType': ['', Validators.required], - 'repaymentEvery': ['', Validators.required], - 'repaymentFrequencyType': ['', Validators.required], - 'minimumDaysBetweenDisbursalAndFirstRepayment': [''], - 'repaymentStartDateType': [1], - 'fixedLength': [null] + useBorrowerCycle: [false], + minPrincipal: [''], + principal: [ + '', + Validators.required + ], + maxPrincipal: [''], + minNumberOfRepayments: [''], + numberOfRepayments: [ + '', + Validators.required + ], + maxNumberOfRepayments: [''], + isLinkedToFloatingInterestRates: [false], + allowApprovedDisbursedAmountsOverApplied: [false], + minInterestRatePerPeriod: [''], + interestRatePerPeriod: [ + '', + Validators.required + ], + maxInterestRatePerPeriod: [''], + interestRateFrequencyType: [ + '', + Validators.required + ], + repaymentEvery: [ + '', + Validators.required + ], + repaymentFrequencyType: [ + '', + Validators.required + ], + minimumDaysBetweenDisbursalAndFirstRepayment: [''], + repaymentStartDateType: [1], + fixedLength: [null] }); } @@ -127,8 +182,9 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges { } setConditionalControls() { - this.loanProductTermsForm.get('allowApprovedDisbursedAmountsOverApplied').valueChanges - .subscribe(allowApprovedDisbursedAmountsOverApplied => { + this.loanProductTermsForm + .get('allowApprovedDisbursedAmountsOverApplied') + .valueChanges.subscribe((allowApprovedDisbursedAmountsOverApplied) => { if (allowApprovedDisbursedAmountsOverApplied) { this.loanProductTermsForm.addControl('overAppliedCalculationType', new UntypedFormControl('')); this.loanProductTermsForm.addControl('overAppliedNumber', new UntypedFormControl('')); @@ -138,27 +194,48 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges { this.loanProductTermsForm.removeControl('overAppliedNumber'); this.loanProductTermsForm.removeControl('disallowExpectedDisbursements'); } - } - ); + }); - this.loanProductTermsForm.get('isLinkedToFloatingInterestRates').valueChanges - .subscribe(isLinkedToFloatingInterestRates => { + this.loanProductTermsForm + .get('isLinkedToFloatingInterestRates') + .valueChanges.subscribe((isLinkedToFloatingInterestRates) => { if (isLinkedToFloatingInterestRates) { this.loanProductTermsForm.removeControl('minInterestRatePerPeriod'); this.loanProductTermsForm.removeControl('interestRatePerPeriod'); this.loanProductTermsForm.removeControl('maxInterestRatePerPeriod'); this.loanProductTermsForm.removeControl('interestRateFrequencyType'); this.loanProductTermsForm.addControl('floatingRatesId', new UntypedFormControl('', Validators.required)); - this.loanProductTermsForm.addControl('interestRateDifferential', new UntypedFormControl('', Validators.required)); - this.loanProductTermsForm.addControl('isFloatingInterestRateCalculationAllowed', new UntypedFormControl(false)); - this.loanProductTermsForm.addControl('minDifferentialLendingRate', new UntypedFormControl('', Validators.required)); - this.loanProductTermsForm.addControl('defaultDifferentialLendingRate', new UntypedFormControl('', Validators.required)); - this.loanProductTermsForm.addControl('maxDifferentialLendingRate', new UntypedFormControl('', Validators.required)); + this.loanProductTermsForm.addControl( + 'interestRateDifferential', + new UntypedFormControl('', Validators.required) + ); + this.loanProductTermsForm.addControl( + 'isFloatingInterestRateCalculationAllowed', + new UntypedFormControl(false) + ); + this.loanProductTermsForm.addControl( + 'minDifferentialLendingRate', + new UntypedFormControl('', Validators.required) + ); + this.loanProductTermsForm.addControl( + 'defaultDifferentialLendingRate', + new UntypedFormControl('', Validators.required) + ); + this.loanProductTermsForm.addControl( + 'maxDifferentialLendingRate', + new UntypedFormControl('', Validators.required) + ); } else { this.loanProductTermsForm.addControl('minInterestRatePerPeriod', new UntypedFormControl('')); - this.loanProductTermsForm.addControl('interestRatePerPeriod', new UntypedFormControl('', Validators.required)); + this.loanProductTermsForm.addControl( + 'interestRatePerPeriod', + new UntypedFormControl('', Validators.required) + ); this.loanProductTermsForm.addControl('maxInterestRatePerPeriod', new UntypedFormControl('')); - this.loanProductTermsForm.addControl('interestRateFrequencyType', new UntypedFormControl(this.interestRateFrequencyTypeData.id, Validators.required)); + this.loanProductTermsForm.addControl( + 'interestRateFrequencyType', + new UntypedFormControl(this.interestRateFrequencyTypeData.id, Validators.required) + ); this.loanProductTermsForm.removeControl('floatingRatesId'); this.loanProductTermsForm.removeControl('interestRateDifferential'); this.loanProductTermsForm.removeControl('isFloatingInterestRateCalculationAllowed'); @@ -168,20 +245,19 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges { } }); - this.loanProductTermsForm.get('useBorrowerCycle').valueChanges - .subscribe(useBorrowerCycle => { - if (useBorrowerCycle) { - this.loanProductTermsForm.addControl('principalVariationsForBorrowerCycle', this.formBuilder.array([])); - this.loanProductTermsForm.addControl('numberOfRepaymentVariationsForBorrowerCycle', this.formBuilder.array([])); - this.loanProductTermsForm.addControl('interestRateVariationsForBorrowerCycle', this.formBuilder.array([])); - } else { - this.loanProductTermsForm.removeControl('principalVariationsForBorrowerCycle'); - this.loanProductTermsForm.removeControl('numberOfRepaymentVariationsForBorrowerCycle'); - this.loanProductTermsForm.removeControl('interestRateVariationsForBorrowerCycle'); - } - }); + this.loanProductTermsForm.get('useBorrowerCycle').valueChanges.subscribe((useBorrowerCycle) => { + if (useBorrowerCycle) { + this.loanProductTermsForm.addControl('principalVariationsForBorrowerCycle', this.formBuilder.array([])); + this.loanProductTermsForm.addControl('numberOfRepaymentVariationsForBorrowerCycle', this.formBuilder.array([])); + this.loanProductTermsForm.addControl('interestRateVariationsForBorrowerCycle', this.formBuilder.array([])); + } else { + this.loanProductTermsForm.removeControl('principalVariationsForBorrowerCycle'); + this.loanProductTermsForm.removeControl('numberOfRepaymentVariationsForBorrowerCycle'); + this.loanProductTermsForm.removeControl('interestRateVariationsForBorrowerCycle'); + } + }); - this.zeroInterest.valueChanges.subscribe(zeroInterest => { + this.zeroInterest.valueChanges.subscribe((zeroInterest) => { if (zeroInterest) { this.loanProductTermsForm.get('minInterestRatePerPeriod').patchValue(0); this.loanProductTermsForm.get('minInterestRatePerPeriod').disable(); @@ -190,11 +266,17 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges { this.loanProductTermsForm.get('maxInterestRatePerPeriod').patchValue(0); this.loanProductTermsForm.get('maxInterestRatePerPeriod').disable(); } else { - this.loanProductTermsForm.get('minInterestRatePerPeriod').patchValue(this.loanProductsTemplate.minInterestRatePerPeriod); + this.loanProductTermsForm + .get('minInterestRatePerPeriod') + .patchValue(this.loanProductsTemplate.minInterestRatePerPeriod); this.loanProductTermsForm.get('minInterestRatePerPeriod').enable(); - this.loanProductTermsForm.get('interestRatePerPeriod').patchValue(this.loanProductsTemplate.interestRatePerPeriod); + this.loanProductTermsForm + .get('interestRatePerPeriod') + .patchValue(this.loanProductsTemplate.interestRatePerPeriod); this.loanProductTermsForm.get('interestRatePerPeriod').enable(); - this.loanProductTermsForm.get('maxInterestRatePerPeriod').patchValue(this.loanProductsTemplate.maxInterestRatePerPeriod); + this.loanProductTermsForm + .get('maxInterestRatePerPeriod') + .patchValue(this.loanProductsTemplate.maxInterestRatePerPeriod); this.loanProductTermsForm.get('maxInterestRatePerPeriod').enable(); } this.validateAdvancedPaymentStrategyControls(); @@ -230,8 +312,15 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges { }); } - editVariationsForBorrowerCycle(formType: string, variationsForBorrowerCycleFormArray: UntypedFormArray, index: number) { - const data = { ...this.getData(formType, variationsForBorrowerCycleFormArray.at(index).value), layout: { addButtonText: 'Edit' } }; + editVariationsForBorrowerCycle( + formType: string, + variationsForBorrowerCycleFormArray: UntypedFormArray, + index: number + ) { + const data = { + ...this.getData(formType, variationsForBorrowerCycleFormArray.at(index).value), + layout: { addButtonText: 'Edit' } + }; const addVariationsForBorrowerCycleDialogRef = this.dialog.open(FormDialogComponent, { data }); addVariationsForBorrowerCycleDialogRef.afterClosed().subscribe((response: any) => { if (response.data) { @@ -255,15 +344,21 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges { getData(formType: string, values?: any) { switch (formType) { - case 'Principal': return { - title: this.translateService.instant('labels.heading.Principal by loan cycle'), formfields: this.getFormfields(values) - }; - case 'NumberOfRepayments': return { - title: this.translateService.instant('labels.heading.Number of Repayments by loan cycle'), formfields: this.getFormfields(values) - }; - case 'NominalInterestRate': return { - title: this.translateService.instant('labels.heading.Nominal Interest Rate by loan cycle'), formfields: this.getFormfields(values) - }; + case 'Principal': + return { + title: this.translateService.instant('labels.heading.Principal by loan cycle'), + formfields: this.getFormfields(values) + }; + case 'NumberOfRepayments': + return { + title: this.translateService.instant('labels.heading.Number of Repayments by loan cycle'), + formfields: this.getFormfields(values) + }; + case 'NominalInterestRate': + return { + title: this.translateService.instant('labels.heading.Nominal Interest Rate by loan cycle'), + formfields: this.getFormfields(values) + }; } } @@ -307,6 +402,7 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges { type: 'number', order: 5 }) + ]; return formfields; } @@ -330,5 +426,4 @@ export class LoanProductTermsStepComponent implements OnInit, OnChanges { this.loanProductTermsForm.get('fixedLength').patchValue(null); } } - } diff --git a/src/app/products/loan-products/loan-product.resolver.ts b/src/app/products/loan-products/loan-product.resolver.ts index d8f634e0d..b1f69f870 100644 --- a/src/app/products/loan-products/loan-product.resolver.ts +++ b/src/app/products/loan-products/loan-product.resolver.ts @@ -13,11 +13,10 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class LoanProductResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ - constructor(private productsService: ProductsService) { } + constructor(private productsService: ProductsService) {} /** * Returns the loan product data. @@ -27,5 +26,4 @@ export class LoanProductResolver implements Resolve { const productId = route.parent.paramMap.get('productId'); return this.productsService.getLoanProduct(productId); } - } diff --git a/src/app/products/loan-products/loan-products-template.resolver.ts b/src/app/products/loan-products/loan-products-template.resolver.ts index e5897d895..0fba1dcc5 100644 --- a/src/app/products/loan-products/loan-products-template.resolver.ts +++ b/src/app/products/loan-products/loan-products-template.resolver.ts @@ -10,7 +10,6 @@ import { ProductsService } from '../products.service'; @Injectable() export class LoanProductsTemplateResolver implements Resolve { - constructor(private productsService: ProductsService) {} /** @@ -20,5 +19,4 @@ export class LoanProductsTemplateResolver implements Resolve { resolve(): Observable { return this.productsService.getLoanProductsTemplate(); } - } diff --git a/src/app/products/loan-products/loan-products.component.spec.ts b/src/app/products/loan-products/loan-products.component.spec.ts index ba07bf46d..2e8dcbba0 100644 --- a/src/app/products/loan-products/loan-products.component.spec.ts +++ b/src/app/products/loan-products/loan-products.component.spec.ts @@ -8,9 +8,8 @@ describe('LoanProductsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ LoanProductsComponent ] - }) - .compileComponents(); + declarations: [LoanProductsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/loan-products/loan-products.component.ts b/src/app/products/loan-products/loan-products.component.ts index f18a2123c..d60605a4d 100644 --- a/src/app/products/loan-products/loan-products.component.ts +++ b/src/app/products/loan-products/loan-products.component.ts @@ -15,9 +15,13 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura styleUrls: ['./loan-products.component.scss'] }) export class LoanProductsComponent implements OnInit, AfterViewInit { - loanProductsData: any; - displayedColumns: string[] = ['name', 'shortName', 'closeDate', 'status']; + displayedColumns: string[] = [ + 'name', + 'shortName', + 'closeDate', + 'status' + ]; dataSource: MatTableDataSource; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @@ -38,10 +42,12 @@ export class LoanProductsComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private route: ActivatedRoute, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { + constructor( + private route: ActivatedRoute, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { this.route.data.subscribe((data: { loanProducts: any }) => { this.loanProductsData = data.loanProducts; }); @@ -63,7 +69,12 @@ export class LoanProductsComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showLoanProductsPage === true) { setTimeout(() => { - this.showPopover(this.templateButtonCreateLoanProduct, this.buttonCreateLoanProduct.nativeElement, 'bottom', true); + this.showPopover( + this.templateButtonCreateLoanProduct, + this.buttonCreateLoanProduct.nativeElement, + 'bottom', + true + ); }); } @@ -81,7 +92,12 @@ export class LoanProductsComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } diff --git a/src/app/products/loan-products/loan-products.resolver.ts b/src/app/products/loan-products/loan-products.resolver.ts index 9ba2cd1ba..ffe70660b 100644 --- a/src/app/products/loan-products/loan-products.resolver.ts +++ b/src/app/products/loan-products/loan-products.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class LoanProductsResolver implements Resolve { - /** * * @param {ProductsService} productsService Products service. @@ -27,5 +26,4 @@ export class LoanProductsResolver implements Resolve { resolve(): Observable { return this.productsService.getLoanProducts(); } - } diff --git a/src/app/products/loan-products/loan-products.ts b/src/app/products/loan-products/loan-products.ts index 2c0e1a160..1d53805d8 100644 --- a/src/app/products/loan-products/loan-products.ts +++ b/src/app/products/loan-products/loan-products.ts @@ -6,7 +6,6 @@ import { GlobalConfiguration } from 'app/system/configurations/global-configurat providedIn: 'root' }) export class LoanProducts { - public static LOAN_SCHEDULE_TYPE_CUMULATIVE = 'CUMULATIVE'; public static LOAN_SCHEDULE_TYPE_PROGRESSIVE = 'PROGRESSIVE'; @@ -18,20 +17,26 @@ export class LoanProducts { public static DAYS_BEFORE_REPAYMENT_IS_DUE = 'days-before-repayment-is-due'; public static DAYS_AFTER_REPAYMENT_IS_OVERDUE = 'days-after-repayment-is-overdue'; - globalConfigurations: string[] = [LoanProducts.DAYS_BEFORE_REPAYMENT_IS_DUE, LoanProducts.DAYS_AFTER_REPAYMENT_IS_OVERDUE]; - propertyNames: string[] = ['dueDaysForRepaymentEvent', 'overDueDaysForRepaymentEvent']; + globalConfigurations: string[] = [ + LoanProducts.DAYS_BEFORE_REPAYMENT_IS_DUE, + LoanProducts.DAYS_AFTER_REPAYMENT_IS_OVERDUE + ]; + propertyNames: string[] = [ + 'dueDaysForRepaymentEvent', + 'overDueDaysForRepaymentEvent' + ]; public static isAdvancedPaymentAllocationStrategy(code: string): boolean { - return (code === this.ADVANCED_PAYMENT_ALLOCATION_STRATEGY); + return code === this.ADVANCED_PAYMENT_ALLOCATION_STRATEGY; } - constructor(private settingsService: SettingsService) { } + constructor(private settingsService: SettingsService) {} public setItemsByDefault(configurations: any) { const itemsByDefault: GlobalConfiguration[] = []; configurations.globalConfiguration.forEach((config: GlobalConfiguration) => { if (this.globalConfigurations.includes(config.name)) { - itemsByDefault.push(config); + itemsByDefault.push(config); } }); return itemsByDefault; @@ -82,11 +87,11 @@ export class LoanProducts { } public isItemByDefault(propertyName: string): boolean { - return (this.propertyNames.includes(propertyName)); + return this.propertyNames.includes(propertyName); } public isGlobalConfigurations(propertyName: string): boolean { - return (this.globalConfigurations.includes(propertyName)); + return this.globalConfigurations.includes(propertyName); } private resolvePropertyName(configName: string): string { @@ -98,5 +103,4 @@ export class LoanProducts { } return ''; } - } diff --git a/src/app/products/loan-products/models/loan-account.model.ts b/src/app/products/loan-products/models/loan-account.model.ts index 8867fb578..cba12d5ae 100644 --- a/src/app/products/loan-products/models/loan-account.model.ts +++ b/src/app/products/loan-products/models/loan-account.model.ts @@ -2,26 +2,26 @@ import { LoanTransactionType } from 'app/loans/models/loan-transaction-type.mode import { Currency } from 'app/shared/models/general.model'; export interface LoanTransaction { - id: number; - loanId: number; - officeId: number; - officeName: string; - type: LoanTransactionType; - date: number[]; - currency: Currency; - amount: number; - netDisbursalAmount: number; - principalPortion: number; - interestPortion: number; - feeChargesPortion: number; - penaltyChargesPortion: number; - overpaymentPortion: number; - unrecognizedIncomePortion: number; - externalId: string; - outstandingLoanBalance: number; - submittedOnDate: number[]; - manuallyReversed: boolean; - loanChargePaidByList: any[]; - numberOfRepayments: number; - transactionRelations: any[]; + id: number; + loanId: number; + officeId: number; + officeName: string; + type: LoanTransactionType; + date: number[]; + currency: Currency; + amount: number; + netDisbursalAmount: number; + principalPortion: number; + interestPortion: number; + feeChargesPortion: number; + penaltyChargesPortion: number; + overpaymentPortion: number; + unrecognizedIncomePortion: number; + externalId: string; + outstandingLoanBalance: number; + submittedOnDate: number[]; + manuallyReversed: boolean; + loanChargePaidByList: any[]; + numberOfRepayments: number; + transactionRelations: any[]; } diff --git a/src/app/products/loan-products/models/loan-product.model.ts b/src/app/products/loan-products/models/loan-product.model.ts index 0a16eed7a..c07af8388 100644 --- a/src/app/products/loan-products/models/loan-product.model.ts +++ b/src/app/products/loan-products/models/loan-product.model.ts @@ -1,174 +1,181 @@ -import {AccountingMapping, ChargeOffReasonToExpenseAccountMapping, ChargeToIncomeAccountMapping, Currency, PaymentChannelToFundSourceMapping} from 'app/shared/models/general.model'; +import { + AccountingMapping, + ChargeOffReasonToExpenseAccountMapping, + ChargeToIncomeAccountMapping, + Currency, + PaymentChannelToFundSourceMapping +} from 'app/shared/models/general.model'; import { OptionData, StringEnumOptionData } from 'app/shared/models/option-data.model'; -import { CreditAllocation, PaymentAllocation } from '../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model'; +import { + CreditAllocation, + PaymentAllocation +} from '../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model'; export interface LoanProduct { - id: number; - name: string; - shortName: string; - includeInBorrowerCycle: boolean; - useBorrowerCycle: boolean; - status: string; - currency: Currency; - currencyCode?: string; - fundId?: number; - fundName?: string; - startDate?: string; - closeDate?: string; - description?: string; - installmentAmountInMultiplesOf?: number; - principal: number; - minPrincipal?: number; - maxPrincipal?: number; - numberOfRepayments: number; - minNumberOfRepayments?: number; - maxNumberOfRepayments?: number; - repaymentEvery: number; - repaymentFrequencyType: OptionData; - minimumDaysBetweenDisbursalAndFirstRepayment?: number; - interestRatePerPeriod: number; - interestRateFrequencyType: OptionData; - annualInterestRate: number; - isLinkedToFloatingInterestRates: boolean; - isFloatingInterestRateCalculationAllowed: boolean; - allowVariableInstallments: boolean; - minimumGap: number; - maximumGap: number; - amortizationType: OptionData; - interestType: OptionData; - interestCalculationPeriodType: OptionData; - allowPartialPeriodInterestCalculation: boolean; - transactionProcessingStrategyCode: string; - transactionProcessingStrategyName: string; - paymentAllocation?: PaymentAllocation[]; - creditAllocation?: CreditAllocation[]; - daysInMonthType: OptionData; - daysInYearType: OptionData; - isInterestRecalculationEnabled: boolean; - interestRecalculationData?: InterestRecalculationData; - interestRecalculationCompoundingMethod?: number; - preClosureInterestCalculationStrategy?: number; - rescheduleStrategyMethod?: number; - recalculationCompoundingFrequencyType?: number; - recalculationRestFrequencyType?: number; - allowCompoundingOnEod?: boolean; - disallowInterestCalculationOnPastDue?: boolean; - isArrearsBasedOnOriginalSchedule?: boolean; - isCompoundingToBePostedAsTransaction?: boolean; - recalculationRestFrequencyInterval?: number; + id: number; + name: string; + shortName: string; + includeInBorrowerCycle: boolean; + useBorrowerCycle: boolean; + status: string; + currency: Currency; + currencyCode?: string; + fundId?: number; + fundName?: string; + startDate?: string; + closeDate?: string; + description?: string; + installmentAmountInMultiplesOf?: number; + principal: number; + minPrincipal?: number; + maxPrincipal?: number; + numberOfRepayments: number; + minNumberOfRepayments?: number; + maxNumberOfRepayments?: number; + repaymentEvery: number; + repaymentFrequencyType: OptionData; + minimumDaysBetweenDisbursalAndFirstRepayment?: number; + interestRatePerPeriod: number; + interestRateFrequencyType: OptionData; + annualInterestRate: number; + isLinkedToFloatingInterestRates: boolean; + isFloatingInterestRateCalculationAllowed: boolean; + allowVariableInstallments: boolean; + minimumGap: number; + maximumGap: number; + amortizationType: OptionData; + interestType: OptionData; + interestCalculationPeriodType: OptionData; + allowPartialPeriodInterestCalculation: boolean; + transactionProcessingStrategyCode: string; + transactionProcessingStrategyName: string; + paymentAllocation?: PaymentAllocation[]; + creditAllocation?: CreditAllocation[]; + daysInMonthType: OptionData; + daysInYearType: OptionData; + isInterestRecalculationEnabled: boolean; + interestRecalculationData?: InterestRecalculationData; + interestRecalculationCompoundingMethod?: number; + preClosureInterestCalculationStrategy?: number; + rescheduleStrategyMethod?: number; + recalculationCompoundingFrequencyType?: number; + recalculationRestFrequencyType?: number; + allowCompoundingOnEod?: boolean; + disallowInterestCalculationOnPastDue?: boolean; + isArrearsBasedOnOriginalSchedule?: boolean; + isCompoundingToBePostedAsTransaction?: boolean; + recalculationRestFrequencyInterval?: number; - canDefineInstallmentAmount: boolean; - graceOnArrearsAgeing?: number; - overdueDaysForNPA?: number; - repaymentStartDateType: OptionData; - charges: any[]; - principalVariationsForBorrowerCycle: any[]; - interestRateVariationsForBorrowerCycle: any[]; - numberOfRepaymentVariationsForBorrowerCycle: any[]; - canUseForTopup: boolean; - isRatesEnabled: boolean; - rates: any[]; - advancedPaymentAllocationTransactionTypes: OptionData[]; + canDefineInstallmentAmount: boolean; + graceOnArrearsAgeing?: number; + overdueDaysForNPA?: number; + repaymentStartDateType: OptionData; + charges: any[]; + principalVariationsForBorrowerCycle: any[]; + interestRateVariationsForBorrowerCycle: any[]; + numberOfRepaymentVariationsForBorrowerCycle: any[]; + canUseForTopup: boolean; + isRatesEnabled: boolean; + rates: any[]; + advancedPaymentAllocationTransactionTypes: OptionData[]; advancedPaymentAllocationFutureInstallmentAllocationRules: OptionData[]; - advancedPaymentAllocationTypes: OptionData[]; - creditAllocationTransactionTypes: OptionData[]; - creditAllocationAllocationTypes: OptionData[]; - multiDisburseLoan: boolean; - maxTrancheCount: number; - disallowExpectedDisbursements: boolean; - allowApprovedDisbursedAmountsOverApplied: boolean; - overAppliedNumber: number; - principalThresholdForLastInstallment: number; - holdGuaranteeFunds: boolean; - accountMovesOutOfNPAOnlyOnArrearsCompletion: boolean; - allowAttributeOverrides: AllowAttributeOverrides; - syncExpectedWithDisbursementDate: boolean; - isEqualAmortization: boolean; - delinquencyBucketOptions: DelinquencyBucket[]; - delinquencyBucket: DelinquencyBucket; - delinquencyBucketId?: number; - graceOnPrincipalPayment?: number; - graceOnInterestPayment?: number; - graceOnInterestCharged?: number; - inArrearsTolerance?: number; - dueDaysForRepaymentEvent: number; - overDueDaysForRepaymentEvent: number; - enableDownPayment: boolean; - enableAutoRepaymentForDownPayment: boolean; - enableInstallmentLevelDelinquency: boolean; - loanScheduleType: OptionData; - loanScheduleProcessingType: OptionData; - allowAttributeConfiguration?: boolean; + advancedPaymentAllocationTypes: OptionData[]; + creditAllocationTransactionTypes: OptionData[]; + creditAllocationAllocationTypes: OptionData[]; + multiDisburseLoan: boolean; + maxTrancheCount: number; + disallowExpectedDisbursements: boolean; + allowApprovedDisbursedAmountsOverApplied: boolean; + overAppliedNumber: number; + principalThresholdForLastInstallment: number; + holdGuaranteeFunds: boolean; + accountMovesOutOfNPAOnlyOnArrearsCompletion: boolean; + allowAttributeOverrides: AllowAttributeOverrides; + syncExpectedWithDisbursementDate: boolean; + isEqualAmortization: boolean; + delinquencyBucketOptions: DelinquencyBucket[]; + delinquencyBucket: DelinquencyBucket; + delinquencyBucketId?: number; + graceOnPrincipalPayment?: number; + graceOnInterestPayment?: number; + graceOnInterestCharged?: number; + inArrearsTolerance?: number; + dueDaysForRepaymentEvent: number; + overDueDaysForRepaymentEvent: number; + enableDownPayment: boolean; + enableAutoRepaymentForDownPayment: boolean; + enableInstallmentLevelDelinquency: boolean; + loanScheduleType: OptionData; + loanScheduleProcessingType: OptionData; + allowAttributeConfiguration?: boolean; // Accounting - accountingRule: any; - accountingMappings?: { [key: string]: AccountingMapping }; - fundSourceAccountId?: number; - goodwillCreditAccountId?: number; - incomeFromChargeOffFeesAccountId?: number; - incomeFromChargeOffInterestAccountId?: number; - incomeFromChargeOffPenaltyAccountId?: number; - incomeFromFeeAccountId?: number; - incomeFromGoodwillCreditFeesAccountId?: number; - incomeFromGoodwillCreditInterestAccountId?: number; - incomeFromGoodwillCreditPenaltyAccountId?: number; - incomeFromPenaltyAccountId?: number; - incomeFromRecoveryAccountId?: number; - interestOnLoanAccountId?: number; - loanPortfolioAccountId?: number; - overpaymentLiabilityAccountId?: number; - receivableInterestAccountId?: number; - receivableFeeAccountId?: number; - receivablePenaltyAccountId?: number; - transfersInSuspenseAccountId?: number; - writeOffAccountId?: number; + accountingRule: any; + accountingMappings?: { [key: string]: AccountingMapping }; + fundSourceAccountId?: number; + goodwillCreditAccountId?: number; + incomeFromChargeOffFeesAccountId?: number; + incomeFromChargeOffInterestAccountId?: number; + incomeFromChargeOffPenaltyAccountId?: number; + incomeFromFeeAccountId?: number; + incomeFromGoodwillCreditFeesAccountId?: number; + incomeFromGoodwillCreditInterestAccountId?: number; + incomeFromGoodwillCreditPenaltyAccountId?: number; + incomeFromPenaltyAccountId?: number; + incomeFromRecoveryAccountId?: number; + interestOnLoanAccountId?: number; + loanPortfolioAccountId?: number; + overpaymentLiabilityAccountId?: number; + receivableInterestAccountId?: number; + receivableFeeAccountId?: number; + receivablePenaltyAccountId?: number; + transfersInSuspenseAccountId?: number; + writeOffAccountId?: number; // Advanced Accounting - paymentChannelToFundSourceMappings?: PaymentChannelToFundSourceMapping[]; - feeToIncomeAccountMappings?: ChargeToIncomeAccountMapping[]; - penaltyToIncomeAccountMappings?: ChargeToIncomeAccountMapping[]; - chargeOffReasonToExpenseAccountMappings?: ChargeOffReasonToExpenseAccountMapping[]; - enableAccrualActivityPosting?: boolean; - supportedInterestRefundTypes?: StringEnumOptionData[]; - chargeOffBehaviour?: StringEnumOptionData; + paymentChannelToFundSourceMappings?: PaymentChannelToFundSourceMapping[]; + feeToIncomeAccountMappings?: ChargeToIncomeAccountMapping[]; + penaltyToIncomeAccountMappings?: ChargeToIncomeAccountMapping[]; + chargeOffReasonToExpenseAccountMappings?: ChargeOffReasonToExpenseAccountMapping[]; + enableAccrualActivityPosting?: boolean; + supportedInterestRefundTypes?: StringEnumOptionData[]; + chargeOffBehaviour?: StringEnumOptionData; } - export interface AllowAttributeOverrides { - amortizationType: boolean; - interestType: boolean; - transactionProcessingStrategyCode: boolean; - interestCalculationPeriodType: boolean; - inArrearsTolerance: boolean; - repaymentEvery: boolean; + amortizationType: boolean; + interestType: boolean; + transactionProcessingStrategyCode: boolean; + interestCalculationPeriodType: boolean; + inArrearsTolerance: boolean; + repaymentEvery: boolean; graceOnPrincipalAndInterestPayment: boolean; - graceOnArrearsAgeing: boolean; - isNew: boolean; + graceOnArrearsAgeing: boolean; + isNew: boolean; } export interface DelinquencyBucket { - id: number; - name: string; + id: number; + name: string; ranges?: Range[]; } export interface Range { - id: number; - classification: string; - minimumAgeDays: number; + id: number; + classification: string; + minimumAgeDays: number; maximumAgeDays?: number; } - export interface InterestRecalculationData { - id?: number; - productId?: number; - recalculationCompoundingFrequencyType: OptionData; - interestRecalculationCompoundingType: OptionData; - rescheduleStrategyType: OptionData; - recalculationRestFrequencyType: OptionData; - recalculationRestFrequencyInterval: number; - isArrearsBasedOnOriginalSchedule: boolean; - isCompoundingToBePostedAsTransaction: boolean; - preClosureInterestCalculationStrategy: OptionData; - allowCompoundingOnEod: boolean; - disallowInterestCalculationOnPastDue: boolean; + id?: number; + productId?: number; + recalculationCompoundingFrequencyType: OptionData; + interestRecalculationCompoundingType: OptionData; + rescheduleStrategyType: OptionData; + recalculationRestFrequencyType: OptionData; + recalculationRestFrequencyInterval: number; + isArrearsBasedOnOriginalSchedule: boolean; + isCompoundingToBePostedAsTransaction: boolean; + preClosureInterestCalculationStrategy: OptionData; + allowCompoundingOnEod: boolean; + disallowInterestCalculationOnPastDue: boolean; } diff --git a/src/app/products/loan-products/services/processing-strategy.service.ts b/src/app/products/loan-products/services/processing-strategy.service.ts index 197545022..a722e39df 100644 --- a/src/app/products/loan-products/services/processing-strategy.service.ts +++ b/src/app/products/loan-products/services/processing-strategy.service.ts @@ -2,18 +2,18 @@ import { Injectable } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class ProcessingStrategyService { + advancedTransactionProcessingStrategy = new BehaviorSubject(false); - advancedTransactionProcessingStrategy = new BehaviorSubject(false); + constructor() {} - constructor() { } - - initialize(value: boolean) { - this.advancedTransactionProcessingStrategy.next(value); - } - - get isAdvancedTransactionProcessingStrategy(): boolean { return this.advancedTransactionProcessingStrategy.value; } + initialize(value: boolean) { + this.advancedTransactionProcessingStrategy.next(value); + } + get isAdvancedTransactionProcessingStrategy(): boolean { + return this.advancedTransactionProcessingStrategy.value; + } } diff --git a/src/app/products/loan-products/view-loan-product/datatable-tab/datatable-tab.component.spec.ts b/src/app/products/loan-products/view-loan-product/datatable-tab/datatable-tab.component.spec.ts index f9a212eff..2280125bd 100644 --- a/src/app/products/loan-products/view-loan-product/datatable-tab/datatable-tab.component.spec.ts +++ b/src/app/products/loan-products/view-loan-product/datatable-tab/datatable-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('DatatableTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ DatatableTabComponent ] - }) - .compileComponents(); + declarations: [DatatableTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/loan-products/view-loan-product/datatable-tab/datatable-tab.component.ts b/src/app/products/loan-products/view-loan-product/datatable-tab/datatable-tab.component.ts index e488f0eae..a1952df62 100644 --- a/src/app/products/loan-products/view-loan-product/datatable-tab/datatable-tab.component.ts +++ b/src/app/products/loan-products/view-loan-product/datatable-tab/datatable-tab.component.ts @@ -18,7 +18,5 @@ export class DatatableTabComponent { this.entityDatatable = data.loanProductDatatable; this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); - } - } diff --git a/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.spec.ts b/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.spec.ts index e1e449e17..ef60ea9bb 100644 --- a/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.spec.ts +++ b/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GeneralTabComponent ] - }) - .compileComponents(); + declarations: [GeneralTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.ts b/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.ts index e3baa02cd..bfda4263f 100644 --- a/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.ts +++ b/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.ts @@ -15,24 +15,28 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./general-tab.component.scss'] }) export class GeneralTabComponent implements OnInit { - loanProduct: LoanProduct; useDueForRepaymentsConfigurations = false; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private dialog: MatDialog, private productsService: ProductsService, private settingsService: SettingsService, - private translateService: TranslateService) { + private translateService: TranslateService + ) { this.route.data.subscribe((data: { loanProduct: any }) => { this.loanProduct = data.loanProduct; - this.useDueForRepaymentsConfigurations = (!this.loanProduct.dueDaysForRepaymentEvent && !this.loanProduct.overDueDaysForRepaymentEvent); + this.useDueForRepaymentsConfigurations = + !this.loanProduct.dueDaysForRepaymentEvent && !this.loanProduct.overDueDaysForRepaymentEvent; }); } ngOnInit() { - this.loanProduct.allowAttributeConfiguration = Object.values(this.loanProduct.allowAttributeOverrides).some((attribute: boolean) => attribute); + this.loanProduct.allowAttributeConfiguration = Object.values(this.loanProduct.allowAttributeOverrides).some( + (attribute: boolean) => attribute + ); } exportDefinition(): void { @@ -67,7 +71,8 @@ export class GeneralTabComponent implements OnInit { type: 'text', required: true, order: 2 - }), + }) + ]; const data = { title: `${this.translateService.instant('labels.buttons.Create')} ${this.translateService.instant('labels.inputs.Loan Product')}`, @@ -77,10 +82,11 @@ export class GeneralTabComponent implements OnInit { const createProductDialogRef = this.dialog.open(FormDialogComponent, { data }); createProductDialogRef.afterClosed().subscribe((productResponse: any) => { if (productResponse.data) { - productCopy['name'] = productResponse.data.value['name']; productCopy['shortName'] = productResponse.data.value['shortName']; - productCopy['delinquencyBucketId'] = productCopy['delinquencyBucket'] ? productCopy['delinquencyBucket']['id'] : null; + productCopy['delinquencyBucketId'] = productCopy['delinquencyBucket'] + ? productCopy['delinquencyBucket']['id'] + : null; productCopy['currencyCode'] = productCopy['currency'] ? productCopy['currency']['code'] : null; productCopy['interestRatePerPeriod'] = productCopy['annualInterestRate']; productCopy['transactionProcessingStrategyCode'] = productCopy['transactionProcessingStrategyName']; @@ -110,13 +116,16 @@ export class GeneralTabComponent implements OnInit { delete productCopy['allowPartialPeriodInterestCalculation']; delete productCopy['advancedPaymentAllocationFutureInstallmentAllocationRules']; - this.productsService.createLoanProduct(productCopy) - .subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.productsService.createLoanProduct(productCopy).subscribe((response: any) => { + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); - } }); } - } diff --git a/src/app/products/loan-products/view-loan-product/shared/view-advance-paymeny-allocation/view-advance-paymeny-allocation.component.spec.ts b/src/app/products/loan-products/view-loan-product/shared/view-advance-paymeny-allocation/view-advance-paymeny-allocation.component.spec.ts index 9a9ee51e5..1bca13ee1 100644 --- a/src/app/products/loan-products/view-loan-product/shared/view-advance-paymeny-allocation/view-advance-paymeny-allocation.component.spec.ts +++ b/src/app/products/loan-products/view-loan-product/shared/view-advance-paymeny-allocation/view-advance-paymeny-allocation.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewAdvancePaymenyAllocationComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ViewAdvancePaymenyAllocationComponent ] - }) - .compileComponents(); + declarations: [ViewAdvancePaymenyAllocationComponent] + }).compileComponents(); fixture = TestBed.createComponent(ViewAdvancePaymenyAllocationComponent); component = fixture.componentInstance; diff --git a/src/app/products/loan-products/view-loan-product/shared/view-advance-paymeny-allocation/view-advance-paymeny-allocation.component.ts b/src/app/products/loan-products/view-loan-product/shared/view-advance-paymeny-allocation/view-advance-paymeny-allocation.component.ts index c98d4e440..71608be84 100644 --- a/src/app/products/loan-products/view-loan-product/shared/view-advance-paymeny-allocation/view-advance-paymeny-allocation.component.ts +++ b/src/app/products/loan-products/view-loan-product/shared/view-advance-paymeny-allocation/view-advance-paymeny-allocation.component.ts @@ -1,5 +1,9 @@ import { Component, Input } from '@angular/core'; -import { AdvancePaymentAllocationData, CreditAllocation, PaymentAllocation } from 'app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model'; +import { + AdvancePaymentAllocationData, + CreditAllocation, + PaymentAllocation +} from 'app/products/loan-products/loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model'; @Component({ selector: 'mifosx-view-advance-paymeny-allocation', @@ -7,18 +11,17 @@ import { AdvancePaymentAllocationData, CreditAllocation, PaymentAllocation } fro styleUrls: ['./view-advance-paymeny-allocation.component.scss'] }) export class ViewAdvancePaymenyAllocationComponent { - @Input() paymentAllocation: PaymentAllocation | null; @Input() creditAllocation: CreditAllocation | null; @Input() advancePaymentAllocationData: AdvancePaymentAllocationData; - constructor() { } + constructor() {} transactionTypeValue(code: string): string { if (this.advancePaymentAllocationData == null) { return code; } - const transactionType = this.advancePaymentAllocationData.transactionTypes.find(t => t.code === code); + const transactionType = this.advancePaymentAllocationData.transactionTypes.find((t) => t.code === code); return transactionType.value; } @@ -26,7 +29,7 @@ export class ViewAdvancePaymenyAllocationComponent { if (this.advancePaymentAllocationData == null) { return code; } - const allocationType = this.advancePaymentAllocationData.allocationTypes.find(t => t.code === code); + const allocationType = this.advancePaymentAllocationData.allocationTypes.find((t) => t.code === code); return allocationType.value; } @@ -34,8 +37,9 @@ export class ViewAdvancePaymenyAllocationComponent { if (this.advancePaymentAllocationData == null) { return code; } - const futureInstallmentAllocationRule = this.advancePaymentAllocationData.futureInstallmentAllocationRules.find(t => t.code === code); + const futureInstallmentAllocationRule = this.advancePaymentAllocationData.futureInstallmentAllocationRules.find( + (t) => t.code === code + ); return futureInstallmentAllocationRule.value; } - } diff --git a/src/app/products/loan-products/view-loan-product/view-loan-product.component.spec.ts b/src/app/products/loan-products/view-loan-product/view-loan-product.component.spec.ts index 4337f3613..0fa66f48c 100644 --- a/src/app/products/loan-products/view-loan-product/view-loan-product.component.spec.ts +++ b/src/app/products/loan-products/view-loan-product/view-loan-product.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewLoanProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewLoanProductComponent ] - }) - .compileComponents(); + declarations: [ViewLoanProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/loan-products/view-loan-product/view-loan-product.component.ts b/src/app/products/loan-products/view-loan-product/view-loan-product.component.ts index 549a9a141..4adcef48e 100644 --- a/src/app/products/loan-products/view-loan-product/view-loan-product.component.ts +++ b/src/app/products/loan-products/view-loan-product/view-loan-product.component.ts @@ -7,7 +7,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-loan-product.component.scss'] }) export class ViewLoanProductComponent { - loanProductDatatables: any = []; constructor(private route: ActivatedRoute) { @@ -15,5 +14,4 @@ export class ViewLoanProductComponent { this.loanProductDatatables = data.loanProductDatatables; }); } - } diff --git a/src/app/products/manage-delinquency-buckets/delinquency-bucket/create-bucket/create-bucket.component.spec.ts b/src/app/products/manage-delinquency-buckets/delinquency-bucket/create-bucket/create-bucket.component.spec.ts index da9ee7ab6..968a9ea95 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-bucket/create-bucket/create-bucket.component.spec.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-bucket/create-bucket/create-bucket.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateBucketComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ CreateBucketComponent ] - }) - .compileComponents(); + declarations: [CreateBucketComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/manage-delinquency-buckets/delinquency-bucket/create-bucket/create-bucket.component.ts b/src/app/products/manage-delinquency-buckets/delinquency-bucket/create-bucket/create-bucket.component.ts index 8b1746fd3..d418692ca 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-bucket/create-bucket/create-bucket.component.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-bucket/create-bucket/create-bucket.component.ts @@ -26,18 +26,26 @@ export class CreateBucketComponent implements OnInit { delinquencyRangesIds: any; /** Delinquency Range Displayed Columns */ - displayedColumns: string[] = ['classification', 'minimumAgeDays', 'maximumAgeDays', 'actions']; + displayedColumns: string[] = [ + 'classification', + 'minimumAgeDays', + 'maximumAgeDays', + 'actions' + ]; - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private productsService: ProductsService, private router: Router, private route: ActivatedRoute, public dialog: MatDialog, - private translateService: TranslateService) { - this.route.data.subscribe((data: { delinquencyRanges: any }) => { + private translateService: TranslateService + ) { + this.route.data.subscribe((data: { delinquencyRanges: any }) => { this.delinquencyRangesData = data.delinquencyRanges; this.delinquencyRangesData = this.delinquencyRangesData.sort( - (objA: { minimumAgeDays: number; }, objB: { minimumAgeDays: number; }) => objA.minimumAgeDays - objB.minimumAgeDays, + (objA: { minimumAgeDays: number }, objB: { minimumAgeDays: number }) => + objA.minimumAgeDays - objB.minimumAgeDays ); }); } @@ -53,7 +61,10 @@ export class CreateBucketComponent implements OnInit { */ setupForm(): void { this.bucketForm = this.formBuilder.group({ - 'name': ['', Validators.required] + name: [ + '', + Validators.required + ] }); } @@ -64,7 +75,7 @@ export class CreateBucketComponent implements OnInit { let delinquencyRanges = this.delinquencyRangesData; if (this.delinquencyRangesIds.length > 0) { delinquencyRanges = this.delinquencyRangesData.filter((item: any) => { - return (this.delinquencyRangesIds.indexOf(item.id) < 0); + return this.delinquencyRangesIds.indexOf(item.id) < 0; }); } const formfields: FormfieldBase[] = [ @@ -74,6 +85,7 @@ export class CreateBucketComponent implements OnInit { options: { label: 'classification', value: 'id', data: delinquencyRanges }, order: 1 }) + ]; const data = { title: 'Add Delinquency Range', @@ -92,9 +104,9 @@ export class CreateBucketComponent implements OnInit { /** * Delete particular Delinquency Range in Delinquency Bucket */ - deleteDelinquencyRange(index: number) { + deleteDelinquencyRange(index: number) { const dialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: this.translateService.instant('labels.text.this')} + data: { deleteContext: this.translateService.instant('labels.text.this') } }); dialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { @@ -111,7 +123,9 @@ export class CreateBucketComponent implements OnInit { */ submit() { const ranges: any = []; - this.rangesDataSource.forEach((item: any) => { ranges.push(item.rangeId); }); + this.rangesDataSource.forEach((item: any) => { + ranges.push(item.rangeId); + }); if (ranges.length > 0) { const data = { ...this.bucketForm.value, @@ -119,7 +133,13 @@ export class CreateBucketComponent implements OnInit { }; this.productsService.createDelinquencyBucket(data).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } } diff --git a/src/app/products/manage-delinquency-buckets/delinquency-bucket/delinquency-bucket.component.resolver.ts b/src/app/products/manage-delinquency-buckets/delinquency-bucket/delinquency-bucket.component.resolver.ts index c1994c1b9..8749fe927 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-bucket/delinquency-bucket.component.resolver.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-bucket/delinquency-bucket.component.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../../products.service'; */ @Injectable() export class DelinquencyBucketComponentsResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -23,7 +22,7 @@ export class DelinquencyBucketComponentsResolver implements Resolve { * Returns the delinquency buckets data. * @returns {Observable} */ - resolve(route: ActivatedRouteSnapshot): Observable { + resolve(route: ActivatedRouteSnapshot): Observable { const delinquentcyBucketId = route.paramMap.get('bucketId'); if (delinquentcyBucketId === null) { return this.productsService.getDelinquencyBuckets(); @@ -31,5 +30,4 @@ export class DelinquencyBucketComponentsResolver implements Resolve { return this.productsService.getDelinquencyBucket(delinquentcyBucketId); } } - } diff --git a/src/app/products/manage-delinquency-buckets/delinquency-bucket/delinquency-bucket.component.spec.ts b/src/app/products/manage-delinquency-buckets/delinquency-bucket/delinquency-bucket.component.spec.ts index cde9014fd..aa7bf9595 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-bucket/delinquency-bucket.component.spec.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-bucket/delinquency-bucket.component.spec.ts @@ -8,9 +8,8 @@ describe('DelinquencyBucketComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ DelinquencyBucketComponent ] - }) - .compileComponents(); + declarations: [DelinquencyBucketComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/manage-delinquency-buckets/delinquency-bucket/delinquency-bucket.component.ts b/src/app/products/manage-delinquency-buckets/delinquency-bucket/delinquency-bucket.component.ts index 119a309ec..de691833f 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-bucket/delinquency-bucket.component.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-bucket/delinquency-bucket.component.ts @@ -10,7 +10,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./delinquency-bucket.component.scss'] }) export class DelinquencyBucketComponent implements OnInit { - delinquencyBucketData: any; /** Columns to be displayed in delinquency bucket table. */ displayedColumns: string[] = ['name']; @@ -23,7 +22,7 @@ export class DelinquencyBucketComponent implements OnInit { @ViewChild(MatSort, { static: true }) sort: MatSort; constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { delinquencyBuckets: any }) => { + this.route.data.subscribe((data: { delinquencyBuckets: any }) => { this.delinquencyBucketData = data.delinquencyBuckets; }); } @@ -36,7 +35,7 @@ export class DelinquencyBucketComponent implements OnInit { * Filters data in delinquency bucket table based on passed value. * @param {string} filterValue Value to filter data. */ - applyFilter(filterValue: string) { + applyFilter(filterValue: string) { this.dataSource.filter = filterValue.trim().toLowerCase(); } diff --git a/src/app/products/manage-delinquency-buckets/delinquency-bucket/edit-bucket/edit-bucket.component.spec.ts b/src/app/products/manage-delinquency-buckets/delinquency-bucket/edit-bucket/edit-bucket.component.spec.ts index 626bdc5a1..3e46decb7 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-bucket/edit-bucket/edit-bucket.component.spec.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-bucket/edit-bucket/edit-bucket.component.spec.ts @@ -8,9 +8,8 @@ describe('EditBucketComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ EditBucketComponent ] - }) - .compileComponents(); + declarations: [EditBucketComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/manage-delinquency-buckets/delinquency-bucket/edit-bucket/edit-bucket.component.ts b/src/app/products/manage-delinquency-buckets/delinquency-bucket/edit-bucket/edit-bucket.component.ts index f0d08fbdf..a00562cde 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-bucket/edit-bucket/edit-bucket.component.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-bucket/edit-bucket/edit-bucket.component.ts @@ -32,27 +32,35 @@ export class EditBucketComponent implements OnInit { dataWasChanged = false; /** Delinquency Range Displayed Columns */ - displayedColumns: string[] = ['classification', 'minimumAgeDays', 'maximumAgeDays', 'actions']; + displayedColumns: string[] = [ + 'classification', + 'minimumAgeDays', + 'maximumAgeDays', + 'actions' + ]; - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private productsService: ProductsService, private router: Router, private route: ActivatedRoute, public dialog: MatDialog, - private translateService: TranslateService) { - this.route.data.subscribe((data: { delinquencyBucket: any, delinquencyRanges: any }) => { - this.delinquencyRangesData = data.delinquencyRanges; - this.rangesDataSource = []; - this.delinquencyRangesIds = []; - this.delinquencyRangesData = this.delinquencyRangesData.sort( - (objA: { minimumAgeDays: number; }, objB: { minimumAgeDays: number; }) => objA.minimumAgeDays - objB.minimumAgeDays, - ); - this.delinquencyBucketData = data.delinquencyBucket; - this.delinquencyBucketId = data.delinquencyBucket.id; - this.rangesDataSource = this.delinquencyBucketData.ranges; - this.rangesDataSource.forEach((item: any) => { - this.delinquencyRangesIds.push(item.id); - }); + private translateService: TranslateService + ) { + this.route.data.subscribe((data: { delinquencyBucket: any; delinquencyRanges: any }) => { + this.delinquencyRangesData = data.delinquencyRanges; + this.rangesDataSource = []; + this.delinquencyRangesIds = []; + this.delinquencyRangesData = this.delinquencyRangesData.sort( + (objA: { minimumAgeDays: number }, objB: { minimumAgeDays: number }) => + objA.minimumAgeDays - objB.minimumAgeDays + ); + this.delinquencyBucketData = data.delinquencyBucket; + this.delinquencyBucketId = data.delinquencyBucket.id; + this.rangesDataSource = this.delinquencyBucketData.ranges; + this.rangesDataSource.forEach((item: any) => { + this.delinquencyRangesIds.push(item.id); + }); }); } @@ -65,18 +73,21 @@ export class EditBucketComponent implements OnInit { */ setupForm(): void { this.bucketForm = this.formBuilder.group({ - 'name': [{value: this.delinquencyBucketData.name, disabled: true}, Validators.required] + name: [ + { value: this.delinquencyBucketData.name, disabled: true }, + Validators.required + ] }); } /** * Add Delinquency Range for a Delinquency Bucket */ - addDelinquencyRange() { + addDelinquencyRange() { let delinquencyRanges = this.delinquencyRangesData; if (this.delinquencyRangesIds.length > 0) { delinquencyRanges = this.delinquencyRangesData.filter((item: any) => { - return (this.delinquencyRangesIds.indexOf(item.id) < 0); + return this.delinquencyRangesIds.indexOf(item.id) < 0; }); } const formfields: FormfieldBase[] = [ @@ -86,6 +97,7 @@ export class EditBucketComponent implements OnInit { options: { label: 'classification', value: 'id', data: delinquencyRanges }, order: 1 }) + ]; const data = { title: 'Add Delinquency Range', @@ -97,7 +109,7 @@ export class EditBucketComponent implements OnInit { if (response.data) { const itemSelected = response.data.value; const item = this.delinquencyRangesData.filter((range: any) => { - return (range.id === itemSelected.rangeId); + return range.id === itemSelected.rangeId; }); this.rangesDataSource = this.rangesDataSource.concat(item); this.delinquencyRangesIds.push(item.id); @@ -109,7 +121,7 @@ export class EditBucketComponent implements OnInit { /** * Delete particular Delinquency Range in Delinquency Bucket */ - deleteDelinquencyRange(index: number) { + deleteDelinquencyRange(index: number) { const dialogRef = this.dialog.open(DeleteDialogComponent, { data: { deleteContext: this.translateService.instant('labels.text.this') } }); @@ -129,7 +141,9 @@ export class EditBucketComponent implements OnInit { */ submit() { const ranges: any = []; - this.rangesDataSource.forEach((item: any) => { ranges.push(item.id); }); + this.rangesDataSource.forEach((item: any) => { + ranges.push(item.id); + }); if (ranges.length > 0) { const data = { ...this.bucketForm.value, diff --git a/src/app/products/manage-delinquency-buckets/delinquency-bucket/view-bucket/view-bucket.component.spec.ts b/src/app/products/manage-delinquency-buckets/delinquency-bucket/view-bucket/view-bucket.component.spec.ts index e8ca3c81c..6fe33c623 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-bucket/view-bucket/view-bucket.component.spec.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-bucket/view-bucket/view-bucket.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewBucketComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ViewBucketComponent ] - }) - .compileComponents(); + declarations: [ViewBucketComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/manage-delinquency-buckets/delinquency-bucket/view-bucket/view-bucket.component.ts b/src/app/products/manage-delinquency-buckets/delinquency-bucket/view-bucket/view-bucket.component.ts index 8e7ab095a..92cf381b6 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-bucket/view-bucket/view-bucket.component.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-bucket/view-bucket/view-bucket.component.ts @@ -10,18 +10,19 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./view-bucket.component.scss'] }) export class ViewBucketComponent { - /** Delinquency Bucket Data. */ delinquencyBucketData: any; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private dialog: MatDialog, - private productsService: ProductsService) { + private productsService: ProductsService + ) { this.route.data.subscribe((data: { delinquencyBucket: any }) => { this.delinquencyBucketData = data.delinquencyBucket; this.delinquencyBucketData.ranges = this.delinquencyBucketData.ranges.sort( - (objA: { minimumAge: number; }, objB: { minimumAge: number; }) => objA.minimumAge - objB.minimumAge, + (objA: { minimumAge: number }, objB: { minimumAge: number }) => objA.minimumAge - objB.minimumAge ); }); } @@ -38,5 +39,4 @@ export class ViewBucketComponent { } }); } - } diff --git a/src/app/products/manage-delinquency-buckets/delinquency-range/create-range/create-range.component.spec.ts b/src/app/products/manage-delinquency-buckets/delinquency-range/create-range/create-range.component.spec.ts index 7e7119c9a..ae966de4c 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-range/create-range/create-range.component.spec.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-range/create-range/create-range.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateRangeComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ CreateRangeComponent ] - }) - .compileComponents(); + declarations: [CreateRangeComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/manage-delinquency-buckets/delinquency-range/create-range/create-range.component.ts b/src/app/products/manage-delinquency-buckets/delinquency-range/create-range/create-range.component.ts index 418588143..0eeff6ae7 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-range/create-range/create-range.component.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-range/create-range/create-range.component.ts @@ -10,16 +10,16 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./create-range.component.scss'] }) export class CreateRangeComponent implements OnInit { - /** Delinquency Range form. */ delinquencyRangeForm: UntypedFormGroup; - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private productsService: ProductsService, private route: ActivatedRoute, private router: Router, - private settingsService: SettingsService) { - } + private settingsService: SettingsService + ) {} ngOnInit(): void { this.setInputForm(); @@ -30,9 +30,23 @@ export class CreateRangeComponent implements OnInit { */ setInputForm(): void { this.delinquencyRangeForm = this.formBuilder.group({ - 'classification': ['', [Validators.required]], - 'minimumAgeDays': [0, [Validators.required, Validators.pattern('^(0*[1-9][0-9]*?)$'), Validators.max(1000)]], - 'maximumAgeDays': ['', [Validators.pattern('^(0*[1-9][0-9]*?)$'), Validators.max(10000)]], + classification: [ + '', + [Validators.required] + ], + minimumAgeDays: [ + 0, + [ + Validators.required, + Validators.pattern('^(0*[1-9][0-9]*?)$'), + Validators.max(1000)] + ], + maximumAgeDays: [ + '', + [ + Validators.pattern('^(0*[1-9][0-9]*?)$'), + Validators.max(10000)] + ] }); } @@ -44,8 +58,13 @@ export class CreateRangeComponent implements OnInit { locale }; this.productsService.createDelinquencyRange(data).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/products/manage-delinquency-buckets/delinquency-range/delinquency-range.component.resolver.ts b/src/app/products/manage-delinquency-buckets/delinquency-range/delinquency-range.component.resolver.ts index 90aa71974..bdd11b9d0 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-range/delinquency-range.component.resolver.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-range/delinquency-range.component.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../../products.service'; */ @Injectable() export class DelinquencyRangeComponentsResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -31,5 +30,4 @@ export class DelinquencyRangeComponentsResolver implements Resolve { return this.productsService.getDelinquencyRange(delinquentcyRangeId); } } - } diff --git a/src/app/products/manage-delinquency-buckets/delinquency-range/delinquency-range.component.spec.ts b/src/app/products/manage-delinquency-buckets/delinquency-range/delinquency-range.component.spec.ts index 07582e9c5..8fe96c82e 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-range/delinquency-range.component.spec.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-range/delinquency-range.component.spec.ts @@ -8,9 +8,8 @@ describe('DelinquencyRangeComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ DelinquencyRangeComponent ] - }) - .compileComponents(); + declarations: [DelinquencyRangeComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/manage-delinquency-buckets/delinquency-range/delinquency-range.component.ts b/src/app/products/manage-delinquency-buckets/delinquency-range/delinquency-range.component.ts index c3b4f944e..b8a03cf16 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-range/delinquency-range.component.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-range/delinquency-range.component.ts @@ -10,10 +10,13 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./delinquency-range.component.scss'] }) export class DelinquencyRangeComponent implements OnInit { - delinquencyRangeData: any; /** Columns to be displayed in delinquency range table. */ - displayedColumns: string[] = ['classification', 'minimumAgeDays', 'maximumAgeDays']; + displayedColumns: string[] = [ + 'classification', + 'minimumAgeDays', + 'maximumAgeDays' + ]; /** Data source for delinquency range table. */ dataSource: MatTableDataSource; @@ -23,7 +26,7 @@ export class DelinquencyRangeComponent implements OnInit { @ViewChild(MatSort, { static: true }) sort: MatSort; constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { delinquencyRanges: any }) => { + this.route.data.subscribe((data: { delinquencyRanges: any }) => { this.delinquencyRangeData = data.delinquencyRanges; }); } @@ -36,7 +39,7 @@ export class DelinquencyRangeComponent implements OnInit { * Filters data in delinquency range table based on passed value. * @param {string} filterValue Value to filter data. */ - applyFilter(filterValue: string) { + applyFilter(filterValue: string) { this.dataSource.filter = filterValue.trim().toLowerCase(); } diff --git a/src/app/products/manage-delinquency-buckets/delinquency-range/edit-range/edit-range.component.spec.ts b/src/app/products/manage-delinquency-buckets/delinquency-range/edit-range/edit-range.component.spec.ts index 180bc935a..15c22b943 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-range/edit-range/edit-range.component.spec.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-range/edit-range/edit-range.component.spec.ts @@ -8,9 +8,8 @@ describe('EditRangeComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ EditRangeComponent ] - }) - .compileComponents(); + declarations: [EditRangeComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/manage-delinquency-buckets/delinquency-range/edit-range/edit-range.component.ts b/src/app/products/manage-delinquency-buckets/delinquency-range/edit-range/edit-range.component.ts index 8c489ff7c..6ad63bf94 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-range/edit-range/edit-range.component.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-range/edit-range/edit-range.component.ts @@ -10,17 +10,18 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-range.component.scss'] }) export class EditRangeComponent implements OnInit { - /** Delinquency Range Data. */ delinquencyRangeData: any; /** Delinquency Range form. */ delinquencyRangeForm: UntypedFormGroup; - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private productsService: ProductsService, private route: ActivatedRoute, private router: Router, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { delinquencyRange: any }) => { this.delinquencyRangeData = data.delinquencyRange; }); @@ -35,9 +36,23 @@ export class EditRangeComponent implements OnInit { */ setInputForm(): void { this.delinquencyRangeForm = this.formBuilder.group({ - 'classification': [this.delinquencyRangeData.classification, [Validators.required]], - 'minimumAgeDays': [this.delinquencyRangeData.minimumAgeDays, [Validators.required, Validators.pattern('^(0*[1-9][0-9]*?)$'), Validators.max(1000)]], - 'maximumAgeDays': [this.delinquencyRangeData.maximumAgeDays, [Validators.pattern('^(0*[1-9][0-9]*?)$'), Validators.max(10000)]], + classification: [ + this.delinquencyRangeData.classification, + [Validators.required] + ], + minimumAgeDays: [ + this.delinquencyRangeData.minimumAgeDays, + [ + Validators.required, + Validators.pattern('^(0*[1-9][0-9]*?)$'), + Validators.max(1000)] + ], + maximumAgeDays: [ + this.delinquencyRangeData.maximumAgeDays, + [ + Validators.pattern('^(0*[1-9][0-9]*?)$'), + Validators.max(10000)] + ] }); } @@ -49,8 +64,13 @@ export class EditRangeComponent implements OnInit { locale }; this.productsService.updateDelinquencyRange(this.delinquencyRangeData.id, data).subscribe((response: any) => { - this.router.navigate(['../../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/products/manage-delinquency-buckets/delinquency-range/view-range/view-range.component.spec.ts b/src/app/products/manage-delinquency-buckets/delinquency-range/view-range/view-range.component.spec.ts index 8ec4925c0..7b0440c12 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-range/view-range/view-range.component.spec.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-range/view-range/view-range.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewRangeComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ViewRangeComponent ] - }) - .compileComponents(); + declarations: [ViewRangeComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/manage-delinquency-buckets/delinquency-range/view-range/view-range.component.ts b/src/app/products/manage-delinquency-buckets/delinquency-range/view-range/view-range.component.ts index bedff6260..11937fc24 100644 --- a/src/app/products/manage-delinquency-buckets/delinquency-range/view-range/view-range.component.ts +++ b/src/app/products/manage-delinquency-buckets/delinquency-range/view-range/view-range.component.ts @@ -10,14 +10,15 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./view-range.component.scss'] }) export class ViewRangeComponent { - /** Delinquency Range Data. */ delinquencyRangeData: any; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private dialog: MatDialog, - private productsService: ProductsService) { + private productsService: ProductsService + ) { this.route.data.subscribe((data: { delinquencyRange: any }) => { this.delinquencyRangeData = data.delinquencyRange; }); @@ -35,5 +36,4 @@ export class ViewRangeComponent { } }); } - } diff --git a/src/app/products/manage-delinquency-buckets/manage-delinquency-buckets.component.spec.ts b/src/app/products/manage-delinquency-buckets/manage-delinquency-buckets.component.spec.ts index aa068bfc3..f663e6cc2 100644 --- a/src/app/products/manage-delinquency-buckets/manage-delinquency-buckets.component.spec.ts +++ b/src/app/products/manage-delinquency-buckets/manage-delinquency-buckets.component.spec.ts @@ -8,9 +8,8 @@ describe('ManageDelinquencyBucketsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ManageDelinquencyBucketsComponent ] - }) - .compileComponents(); + declarations: [ManageDelinquencyBucketsComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/manage-delinquency-buckets/manage-delinquency-buckets.component.ts b/src/app/products/manage-delinquency-buckets/manage-delinquency-buckets.component.ts index 6413b74aa..3b6fe6c9e 100644 --- a/src/app/products/manage-delinquency-buckets/manage-delinquency-buckets.component.ts +++ b/src/app/products/manage-delinquency-buckets/manage-delinquency-buckets.component.ts @@ -9,16 +9,15 @@ export class ManageDelinquencyBucketsComponent { // Initialize an array of 2 boolean values, all set to false arrowBooleans: boolean[] = new Array(2).fill(false); - constructor() { } + constructor() {} /** * Popover function * @param arrowNumber - The index of the boolean value to toggle. */ - arrowBooleansToggle(arrowNumber: number) { + arrowBooleansToggle(arrowNumber: number) { // Toggle the boolean value at the given index this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber]; } - } diff --git a/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.spec.ts b/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.spec.ts index 5734f144f..5f914207a 100644 --- a/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.spec.ts +++ b/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateTaxComponentComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateTaxComponentComponent ] - }) - .compileComponents(); + declarations: [CreateTaxComponentComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.ts b/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.ts index 43da8cc6d..5dbced148 100644 --- a/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.ts +++ b/src/app/products/manage-tax-components/create-tax-component/create-tax-component.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-tax-component.component.scss'] }) export class CreateTaxComponentComponent implements OnInit { - /** Minimum start date allowed. */ minDate = new Date(); /** Maximum start date allowed. */ @@ -44,12 +43,14 @@ export class CreateTaxComponentComponent implements OnInit { * @param {Dates} dateUtils Date Utils to format date. * @param {SettingsService} settingsService Settings Service. */ - constructor(private formBuilder: UntypedFormBuilder, - private productsService: ProductsService, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private productsService: ProductsService, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { taxComponentTemplate: any }) => { this.taxComponentTemplateData = data.taxComponentTemplate; }); @@ -71,11 +72,23 @@ export class CreateTaxComponentComponent implements OnInit { createTaxComponentForm() { this.creditAccountTypeData = this.debitAccountTypeData = this.taxComponentTemplateData.glAccountTypeOptions; this.taxComponentForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'percentage': ['', [Validators.required, Validators.pattern('^(0*[1-9][0-9]*(\\.[0-9]+)?|0+\\.[0-9]*[1-9][0-9]*)$'), Validators.max(100)]], - 'creditAccountType': [''], - 'debitAccountType': [''], - 'startDate': ['', Validators.required], + name: [ + '', + Validators.required + ], + percentage: [ + '', + [ + Validators.required, + Validators.pattern('^(0*[1-9][0-9]*(\\.[0-9]+)?|0+\\.[0-9]*[1-9][0-9]*)$'), + Validators.max(100)] + ], + creditAccountType: [''], + debitAccountType: [''], + startDate: [ + '', + Validators.required + ] }); } @@ -83,11 +96,11 @@ export class CreateTaxComponentComponent implements OnInit { * Sets the conditional controls of the tax Component form */ setConditionalControls() { - this.taxComponentForm.get('debitAccountType').valueChanges.subscribe(debitAccountTypeId => { + this.taxComponentForm.get('debitAccountType').valueChanges.subscribe((debitAccountTypeId) => { this.debitAccountData = this.getAccountsData(debitAccountTypeId); this.taxComponentForm.addControl('debitAcountId', new UntypedFormControl('', Validators.required)); }); - this.taxComponentForm.get('creditAccountType').valueChanges.subscribe(creditAccountTypeId => { + this.taxComponentForm.get('creditAccountType').valueChanges.subscribe((creditAccountTypeId) => { this.creditAccountData = this.getAccountsData(creditAccountTypeId); this.taxComponentForm.addControl('creditAcountId', new UntypedFormControl('', Validators.required)); }); @@ -130,7 +143,13 @@ export class CreateTaxComponentComponent implements OnInit { locale }; this.productsService.createTaxComponent(data).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } } diff --git a/src/app/products/manage-tax-components/edit-tax-component/edit-tax-component.component.spec.ts b/src/app/products/manage-tax-components/edit-tax-component/edit-tax-component.component.spec.ts index 4de1f6c84..9caff6e2a 100644 --- a/src/app/products/manage-tax-components/edit-tax-component/edit-tax-component.component.spec.ts +++ b/src/app/products/manage-tax-components/edit-tax-component/edit-tax-component.component.spec.ts @@ -8,9 +8,8 @@ describe('EditTaxComponentComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditTaxComponentComponent ] - }) - .compileComponents(); + declarations: [EditTaxComponentComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/manage-tax-components/edit-tax-component/edit-tax-component.component.ts b/src/app/products/manage-tax-components/edit-tax-component/edit-tax-component.component.ts index 581f23923..05fd73d5c 100644 --- a/src/app/products/manage-tax-components/edit-tax-component/edit-tax-component.component.ts +++ b/src/app/products/manage-tax-components/edit-tax-component/edit-tax-component.component.ts @@ -18,7 +18,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./edit-tax-component.component.scss'] }) export class EditTaxComponentComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum start date allowed. */ @@ -37,13 +36,15 @@ export class EditTaxComponentComponent implements OnInit { * @param {Dates} dateUtils Date Utils to format date. * @param {SettingsService} settingsService Settings Service. */ - constructor(private formBuilder: UntypedFormBuilder, - private productsService: ProductsService, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private settingsService: SettingsService, - private translateService: TranslateService) { + constructor( + private formBuilder: UntypedFormBuilder, + private productsService: ProductsService, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private settingsService: SettingsService, + private translateService: TranslateService + ) { this.route.data.subscribe((data: { taxComponent: any }) => { this.taxComponentData = data.taxComponent; }); @@ -63,11 +64,27 @@ export class EditTaxComponentComponent implements OnInit { */ editTaxComponent() { this.taxComponentForm = this.formBuilder.group({ - 'name': [this.taxComponentData.name, [Validators.required]], - 'percentage': [this.taxComponentData.percentage, [Validators.required, Validators.pattern('^(0*[1-9][0-9]*(\\.[0-9]+)?|0+\\.[0-9]*[1-9][0-9]*)$'), Validators.max(100)]], - 'startDate': [this.taxComponentData.startDate && new Date(this.taxComponentData.startDate)], - 'creditAccountType': [{ value: this.translateService.instant('labels.inputs.accounting.' + this.taxComponentData.creditAccountType.value), disabled: true }], - 'creditAccount': [{ value: this.taxComponentData.creditAccount.name, disabled: true }] + name: [ + this.taxComponentData.name, + [Validators.required] + ], + percentage: [ + this.taxComponentData.percentage, + [ + Validators.required, + Validators.pattern('^(0*[1-9][0-9]*(\\.[0-9]+)?|0+\\.[0-9]*[1-9][0-9]*)$'), + Validators.max(100)] + ], + startDate: [this.taxComponentData.startDate && new Date(this.taxComponentData.startDate)], + creditAccountType: [ + { + value: this.translateService.instant( + 'labels.inputs.accounting.' + this.taxComponentData.creditAccountType.value + ), + disabled: true + } + ], + creditAccount: [{ value: this.taxComponentData.creditAccount.name, disabled: true }] }); } @@ -89,8 +106,13 @@ export class EditTaxComponentComponent implements OnInit { locale }; this.productsService.updateTaxComponent(this.taxComponentData.id, data).subscribe((response: any) => { - this.router.navigate(['../../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/products/manage-tax-components/manage-tax-components.component.spec.ts b/src/app/products/manage-tax-components/manage-tax-components.component.spec.ts index 045c33c47..c9ad1d766 100644 --- a/src/app/products/manage-tax-components/manage-tax-components.component.spec.ts +++ b/src/app/products/manage-tax-components/manage-tax-components.component.spec.ts @@ -8,9 +8,8 @@ describe('FixedDepositProductsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ManageTaxComponentsComponent ] - }) - .compileComponents(); + declarations: [ManageTaxComponentsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/manage-tax-components/manage-tax-components.component.ts b/src/app/products/manage-tax-components/manage-tax-components.component.ts index 0a91edf29..c8db7eb6d 100644 --- a/src/app/products/manage-tax-components/manage-tax-components.component.ts +++ b/src/app/products/manage-tax-components/manage-tax-components.component.ts @@ -17,11 +17,15 @@ import { of } from 'rxjs'; styleUrls: ['./manage-tax-components.component.scss'] }) export class ManageTaxComponentsComponent implements OnInit { - /** Tax Components data. */ taxComponentData: any; /** Columns to be displayed in tax component table. */ - displayedColumns: string[] = ['name', 'percentage', 'startDate', 'glAccount']; + displayedColumns: string[] = [ + 'name', + 'percentage', + 'startDate', + 'glAccount' + ]; /** Data source for tax component table. */ dataSource: MatTableDataSource; @@ -35,7 +39,7 @@ export class ManageTaxComponentsComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { taxComponents: any }) => { + this.route.data.subscribe((data: { taxComponents: any }) => { this.taxComponentData = data.taxComponents; }); } @@ -63,5 +67,4 @@ export class ManageTaxComponentsComponent implements OnInit { this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/products/manage-tax-components/manage-tax-components.resolver.ts b/src/app/products/manage-tax-components/manage-tax-components.resolver.ts index 2fb4ab93e..106ecea17 100644 --- a/src/app/products/manage-tax-components/manage-tax-components.resolver.ts +++ b/src/app/products/manage-tax-components/manage-tax-components.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class ManageTaxComponentsResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -26,5 +25,4 @@ export class ManageTaxComponentsResolver implements Resolve { resolve(): Observable { return this.productsService.getTaxComponents(); } - } diff --git a/src/app/products/manage-tax-components/tax-component-template.resolver.ts b/src/app/products/manage-tax-components/tax-component-template.resolver.ts index 835a1ba88..9db1d9729 100644 --- a/src/app/products/manage-tax-components/tax-component-template.resolver.ts +++ b/src/app/products/manage-tax-components/tax-component-template.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class TaxComponentTemplateResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -26,5 +25,4 @@ export class TaxComponentTemplateResolver implements Resolve { resolve(): Observable { return this.productsService.getTaxComponentTemplate(); } - } diff --git a/src/app/products/manage-tax-components/tax-component.resolver.ts b/src/app/products/manage-tax-components/tax-component.resolver.ts index 30a5d839b..20d11f03c 100644 --- a/src/app/products/manage-tax-components/tax-component.resolver.ts +++ b/src/app/products/manage-tax-components/tax-component.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class TaxComponentResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ diff --git a/src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.spec.ts b/src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.spec.ts index 25d5f9ef4..a92d215e6 100644 --- a/src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.spec.ts +++ b/src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewTaxComponentComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewTaxComponentComponent ] - }) - .compileComponents(); + declarations: [ViewTaxComponentComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.ts b/src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.ts index 60cd285b9..064c85122 100644 --- a/src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.ts +++ b/src/app/products/manage-tax-components/view-tax-component/view-tax-component.component.ts @@ -11,7 +11,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-tax-component.component.scss'] }) export class ViewTaxComponentComponent { - /** tax Component Data. */ taxComponentData: any; @@ -24,5 +23,4 @@ export class ViewTaxComponentComponent { this.taxComponentData = data.taxComponent; }); } - } diff --git a/src/app/products/manage-tax-configurations/manage-tax-configurations.component.spec.ts b/src/app/products/manage-tax-configurations/manage-tax-configurations.component.spec.ts index 01f9b2d84..8658b8db6 100644 --- a/src/app/products/manage-tax-configurations/manage-tax-configurations.component.spec.ts +++ b/src/app/products/manage-tax-configurations/manage-tax-configurations.component.spec.ts @@ -8,9 +8,8 @@ describe('ManageTaxConfigurationsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ManageTaxConfigurationsComponent ] - }) - .compileComponents(); + declarations: [ManageTaxConfigurationsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/manage-tax-configurations/manage-tax-configurations.component.ts b/src/app/products/manage-tax-configurations/manage-tax-configurations.component.ts index 1d2a33490..091e86bb1 100644 --- a/src/app/products/manage-tax-configurations/manage-tax-configurations.component.ts +++ b/src/app/products/manage-tax-configurations/manage-tax-configurations.component.ts @@ -6,22 +6,21 @@ import { Component } from '@angular/core'; */ @Component({ selector: 'mifosx-manage-tax-configurations', - templateUrl: './manage-tax-configurations.component.html', + templateUrl: './manage-tax-configurations.component.html' }) export class ManageTaxConfigurationsComponent { // Initialize an array of 2 boolean values, all set to false arrowBooleans: boolean[] = new Array(2).fill(false); - constructor() { } + constructor() {} /** * Popover function * @param arrowNumber - The index of the boolean value to toggle. */ - arrowBooleansToggle(arrowNumber: number) { + arrowBooleansToggle(arrowNumber: number) { // Toggle the boolean value at the given index this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber]; } - } diff --git a/src/app/products/manage-tax-groups/create-tax-group/create-tax-group.component.spec.ts b/src/app/products/manage-tax-groups/create-tax-group/create-tax-group.component.spec.ts index b0c6fd56b..74cbef6c2 100644 --- a/src/app/products/manage-tax-groups/create-tax-group/create-tax-group.component.spec.ts +++ b/src/app/products/manage-tax-groups/create-tax-group/create-tax-group.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateTaxGroupComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateTaxGroupComponent ] - }) - .compileComponents(); + declarations: [CreateTaxGroupComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/manage-tax-groups/create-tax-group/create-tax-group.component.ts b/src/app/products/manage-tax-groups/create-tax-group/create-tax-group.component.ts index 712c21c6d..637d84360 100644 --- a/src/app/products/manage-tax-groups/create-tax-group/create-tax-group.component.ts +++ b/src/app/products/manage-tax-groups/create-tax-group/create-tax-group.component.ts @@ -26,7 +26,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./create-tax-group.component.scss'] }) export class CreateTaxGroupComponent implements OnInit { - /** Minimum start date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum start date allowed. */ @@ -41,7 +40,11 @@ export class CreateTaxGroupComponent implements OnInit { taxComponentOptions: any; /** Tax Component Displayed Columns */ - displayedColumns: string[] = ['name', 'startDate', 'actions']; + displayedColumns: string[] = [ + 'name', + 'startDate', + 'actions' + ]; /** * Retrieves the tax Group template data from `resolve`. @@ -53,14 +56,16 @@ export class CreateTaxGroupComponent implements OnInit { * @param {MatDialog} dialog Dialog reference. * @param {SettingsService} settingsService Settings Service. */ - constructor(private formBuilder: UntypedFormBuilder, - private productsService: ProductsService, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private dialog: MatDialog, - private settingsService: SettingsService, - private translateService: TranslateService) { + constructor( + private formBuilder: UntypedFormBuilder, + private productsService: ProductsService, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private dialog: MatDialog, + private settingsService: SettingsService, + private translateService: TranslateService + ) { this.route.data.subscribe((data: { taxGroupTemplate: any }) => { this.taxGroupTemplateData = data.taxGroupTemplate; this.taxComponentOptions = this.taxGroupTemplateData.taxComponents; @@ -77,7 +82,10 @@ export class CreateTaxGroupComponent implements OnInit { */ createTaxGroupForm() { this.taxGroupForm = this.formBuilder.group({ - 'name': ['', Validators.required] + name: [ + '', + Validators.required + ] }); } @@ -99,9 +107,13 @@ export class CreateTaxGroupComponent implements OnInit { maxDate: this.maxDate, order: 2 }) + ]; const data = { - title: this.translateService.instant('labels.buttons.Add') + ' ' + this.translateService.instant('labels.inputs.Tax Component'), + title: + this.translateService.instant('labels.buttons.Add') + + ' ' + + this.translateService.instant('labels.inputs.Tax Component'), layout: { addButtonText: 'Add' }, formfields: formfields }; @@ -133,6 +145,7 @@ export class CreateTaxGroupComponent implements OnInit { maxDate: this.maxDate, order: 2 }) + ]; const data = { title: 'Edit Tax Component', @@ -181,8 +194,13 @@ export class CreateTaxGroupComponent implements OnInit { taxComponent.startDate = this.dateUtils.formatDate(taxComponent.startDate, dateFormat) || ''; } this.productsService.createTaxGroup(taxGroup).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/products/manage-tax-groups/create-tax-group/manage-tax-group-template.resolver.ts b/src/app/products/manage-tax-groups/create-tax-group/manage-tax-group-template.resolver.ts index e36396f2d..b8ac33326 100644 --- a/src/app/products/manage-tax-groups/create-tax-group/manage-tax-group-template.resolver.ts +++ b/src/app/products/manage-tax-groups/create-tax-group/manage-tax-group-template.resolver.ts @@ -13,18 +13,16 @@ import { ProductsService } from '../../products.service'; */ @Injectable() export class ManageTaxGroupTemplateResolver implements Resolve { + /** + * @param {ProductsService} productsService Products service. + */ + constructor(private productsService: ProductsService) {} - /** - * @param {ProductsService} productsService Products service. - */ - constructor(private productsService: ProductsService) { } - - /** - * Returns the tax groups template data. - * @returns {Observable} - */ - resolve(): Observable { - return this.productsService.getTaxGroupTemplate(); - } - + /** + * Returns the tax groups template data. + * @returns {Observable} + */ + resolve(): Observable { + return this.productsService.getTaxGroupTemplate(); + } } diff --git a/src/app/products/manage-tax-groups/edit-tax-group/edit-tax-group.component.spec.ts b/src/app/products/manage-tax-groups/edit-tax-group/edit-tax-group.component.spec.ts index f0ab794b0..9934595ac 100644 --- a/src/app/products/manage-tax-groups/edit-tax-group/edit-tax-group.component.spec.ts +++ b/src/app/products/manage-tax-groups/edit-tax-group/edit-tax-group.component.spec.ts @@ -8,9 +8,8 @@ describe('EditTaxGroupComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditTaxGroupComponent ] - }) - .compileComponents(); + declarations: [EditTaxGroupComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/manage-tax-groups/edit-tax-group/edit-tax-group.component.ts b/src/app/products/manage-tax-groups/edit-tax-group/edit-tax-group.component.ts index 5e8b91a9e..cbdf25976 100644 --- a/src/app/products/manage-tax-groups/edit-tax-group/edit-tax-group.component.ts +++ b/src/app/products/manage-tax-groups/edit-tax-group/edit-tax-group.component.ts @@ -26,7 +26,6 @@ import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base'; styleUrls: ['./edit-tax-group.component.scss'] }) export class EditTaxGroupComponent implements OnInit { - /** Minimum start date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum start date allowed. */ @@ -41,7 +40,11 @@ export class EditTaxGroupComponent implements OnInit { taxComponentOptions: any; /** Tax Component Displayed Columns */ - displayedColumns: string[] = ['name', 'startDate', 'actions']; + displayedColumns: string[] = [ + 'name', + 'startDate', + 'actions' + ]; /** * Retrieves the tax Group template data from `resolve`. @@ -54,14 +57,16 @@ export class EditTaxGroupComponent implements OnInit { * @param {SettingsService} settingsService Settings Service. * @param {TranslateService} translateService translate Service. */ - constructor(private formBuilder: UntypedFormBuilder, - private productsService: ProductsService, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - public dialog: MatDialog, - private settingsService: SettingsService, - private translateService: TranslateService) { + constructor( + private formBuilder: UntypedFormBuilder, + private productsService: ProductsService, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + public dialog: MatDialog, + private settingsService: SettingsService, + private translateService: TranslateService + ) { this.route.data.subscribe((data: { taxGroup: any }) => { this.taxGroupData = data.taxGroup; this.taxComponentOptions = this.taxGroupData.taxComponents; @@ -79,7 +84,10 @@ export class EditTaxGroupComponent implements OnInit { */ createTaxGroupForm() { this.taxGroupForm = this.formBuilder.group({ - 'name': [this.taxGroupData.name, Validators.required] + name: [ + this.taxGroupData.name, + Validators.required + ] }); } @@ -101,6 +109,7 @@ export class EditTaxGroupComponent implements OnInit { maxDate: this.maxDate, order: 2 }) + ]; const data = { title: 'Add Tax Component', @@ -139,15 +148,18 @@ export class EditTaxGroupComponent implements OnInit { maxDate: this.maxDate, order: 2 }) + ]; if (!taxComponent.isNew) { - formfields.push(new DatepickerBase({ - controlName: 'endDate', - label: 'End Date', - minDate: this.minDate, - maxDate: this.maxDate, - order: 3 - })); + formfields.push( + new DatepickerBase({ + controlName: 'endDate', + label: 'End Date', + minDate: this.minDate, + maxDate: this.maxDate, + order: 3 + }) + ); } const data = { title: 'Edit Tax Component', @@ -220,5 +232,4 @@ export class EditTaxGroupComponent implements OnInit { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/products/manage-tax-groups/edit-tax-group/edit-tax-group.resolver.ts b/src/app/products/manage-tax-groups/edit-tax-group/edit-tax-group.resolver.ts index 0a1fe19c8..66e44f8ab 100644 --- a/src/app/products/manage-tax-groups/edit-tax-group/edit-tax-group.resolver.ts +++ b/src/app/products/manage-tax-groups/edit-tax-group/edit-tax-group.resolver.ts @@ -13,18 +13,17 @@ import { ProductsService } from '../../products.service'; */ @Injectable() export class EditTaxGroupResolver implements Resolve { + /** + * @param {ProductsService} productsService Products service. + */ + constructor(private productsService: ProductsService) {} - /** - * @param {ProductsService} productsService Products service. - */ - constructor(private productsService: ProductsService) { } - - /** - * Returns the tax Group data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const taxGroupId = route.parent.paramMap.get('id'); - return this.productsService.getTaxGroup(taxGroupId, 'true'); - } + /** + * Returns the tax Group data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const taxGroupId = route.parent.paramMap.get('id'); + return this.productsService.getTaxGroup(taxGroupId, 'true'); + } } diff --git a/src/app/products/manage-tax-groups/manage-tax-groups.component.spec.ts b/src/app/products/manage-tax-groups/manage-tax-groups.component.spec.ts index 5032b9ef4..f20664a5a 100644 --- a/src/app/products/manage-tax-groups/manage-tax-groups.component.spec.ts +++ b/src/app/products/manage-tax-groups/manage-tax-groups.component.spec.ts @@ -8,9 +8,8 @@ describe('ManageTaxGroupsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ManageTaxGroupsComponent ] - }) - .compileComponents(); + declarations: [ManageTaxGroupsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/manage-tax-groups/manage-tax-groups.component.ts b/src/app/products/manage-tax-groups/manage-tax-groups.component.ts index 47dfe4d98..96c08c015 100644 --- a/src/app/products/manage-tax-groups/manage-tax-groups.component.ts +++ b/src/app/products/manage-tax-groups/manage-tax-groups.component.ts @@ -17,7 +17,6 @@ import { of } from 'rxjs'; styleUrls: ['./manage-tax-groups.component.scss'] }) export class ManageTaxGroupsComponent implements OnInit { - /** Tax Groups data. */ taxGroupsData: any; /** Columns to be displayed in tax groups table. */ @@ -35,7 +34,7 @@ export class ManageTaxGroupsComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { taxGroups: any }) => { + this.route.data.subscribe((data: { taxGroups: any }) => { this.taxGroupsData = data.taxGroups; }); } @@ -63,5 +62,4 @@ export class ManageTaxGroupsComponent implements OnInit { this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/products/manage-tax-groups/manage-tax-groups.resolver.ts b/src/app/products/manage-tax-groups/manage-tax-groups.resolver.ts index 4f984a9c5..a61a1b28d 100644 --- a/src/app/products/manage-tax-groups/manage-tax-groups.resolver.ts +++ b/src/app/products/manage-tax-groups/manage-tax-groups.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class ManageTaxGroupsResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -26,5 +25,4 @@ export class ManageTaxGroupsResolver implements Resolve { resolve(): Observable { return this.productsService.getTaxGroups(); } - } diff --git a/src/app/products/manage-tax-groups/tax-group.resolver.ts b/src/app/products/manage-tax-groups/tax-group.resolver.ts index c367b6480..719a86320 100644 --- a/src/app/products/manage-tax-groups/tax-group.resolver.ts +++ b/src/app/products/manage-tax-groups/tax-group.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class TaxGroupResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ diff --git a/src/app/products/manage-tax-groups/view-tax-group/view-tax-group.component.spec.ts b/src/app/products/manage-tax-groups/view-tax-group/view-tax-group.component.spec.ts index e6be0f322..22eb61b13 100644 --- a/src/app/products/manage-tax-groups/view-tax-group/view-tax-group.component.spec.ts +++ b/src/app/products/manage-tax-groups/view-tax-group/view-tax-group.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewTaxGroupComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewTaxGroupComponent ] - }) - .compileComponents(); + declarations: [ViewTaxGroupComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/manage-tax-groups/view-tax-group/view-tax-group.component.ts b/src/app/products/manage-tax-groups/view-tax-group/view-tax-group.component.ts index f42e1af97..2c2e2e097 100644 --- a/src/app/products/manage-tax-groups/view-tax-group/view-tax-group.component.ts +++ b/src/app/products/manage-tax-groups/view-tax-group/view-tax-group.component.ts @@ -11,7 +11,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-tax-group.component.scss'] }) export class ViewTaxGroupComponent { - /** tax Group Data. */ taxGroupData: any; @@ -24,5 +23,4 @@ export class ViewTaxGroupComponent { this.taxGroupData = data.taxGroup; }); } - } diff --git a/src/app/products/products-mix/create-product-mix/create-product-mix.component.spec.ts b/src/app/products/products-mix/create-product-mix/create-product-mix.component.spec.ts index ab855a62a..0de7c0808 100644 --- a/src/app/products/products-mix/create-product-mix/create-product-mix.component.spec.ts +++ b/src/app/products/products-mix/create-product-mix/create-product-mix.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateProductMixComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateProductMixComponent ] - }) - .compileComponents(); + declarations: [CreateProductMixComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/products-mix/create-product-mix/create-product-mix.component.ts b/src/app/products/products-mix/create-product-mix/create-product-mix.component.ts index 3c916db41..1d4607aa8 100644 --- a/src/app/products/products-mix/create-product-mix/create-product-mix.component.ts +++ b/src/app/products/products-mix/create-product-mix/create-product-mix.component.ts @@ -15,7 +15,6 @@ import { ProductsService } from '../../products.service'; styleUrls: ['./create-product-mix.component.scss'] }) export class CreateProductMixComponent implements OnInit { - /** Product mix form. */ productMixForm: UntypedFormGroup; /** Products mix template data. */ @@ -32,11 +31,13 @@ export class CreateProductMixComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, - private productsService: ProductsService, - private route: ActivatedRoute, - private router: Router) { - this.route.data.subscribe(( data: { productsMixTemplate: any }) => { + constructor( + private formBuilder: UntypedFormBuilder, + private productsService: ProductsService, + private route: ActivatedRoute, + private router: Router + ) { + this.route.data.subscribe((data: { productsMixTemplate: any }) => { this.productsMixTemplateData = data.productsMixTemplate; }); } @@ -55,8 +56,14 @@ export class CreateProductMixComponent implements OnInit { createProductMixForm() { this.productOptionData = this.productsMixTemplateData.productOptions; this.productMixForm = this.formBuilder.group({ - 'productId': ['', Validators.required], - 'restrictedProducts': ['', Validators.required] + productId: [ + '', + Validators.required + ], + restrictedProducts: [ + '', + Validators.required + ] }); } @@ -64,15 +71,19 @@ export class CreateProductMixComponent implements OnInit { * Sets the conditional controls of the product mix form. */ setConditionalControls() { - this.productMixForm.get('productId').valueChanges.subscribe(productId => { + this.productMixForm.get('productId').valueChanges.subscribe((productId) => { this.productData = undefined; this.productMixForm.get('restrictedProducts').reset(); this.productsService.getProductMixTemplate(productId).subscribe((productMixTemplateData: any) => { const restrictedProductsData = productMixTemplateData.restrictedProducts; - this.productData = [...restrictedProductsData, ...productMixTemplateData.allowedProducts]; - this.productMixForm.get('restrictedProducts').setValue([...restrictedProductsData.map((restrictedProduct: any) => restrictedProduct.id)]); - } - ); + this.productData = [ + ...restrictedProductsData, + ...productMixTemplateData.allowedProducts + ]; + this.productMixForm + .get('restrictedProducts') + .setValue([...restrictedProductsData.map((restrictedProduct: any) => restrictedProduct.id)]); + }); }); } @@ -86,7 +97,13 @@ export class CreateProductMixComponent implements OnInit { }; const productMixId = this.productMixForm.value.productId; this.productsService.createProductMix(productMix, productMixId).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } } diff --git a/src/app/products/products-mix/edit-product-mix/edit-product-mix.component.spec.ts b/src/app/products/products-mix/edit-product-mix/edit-product-mix.component.spec.ts index 8339ac61e..99f12af2a 100644 --- a/src/app/products/products-mix/edit-product-mix/edit-product-mix.component.spec.ts +++ b/src/app/products/products-mix/edit-product-mix/edit-product-mix.component.spec.ts @@ -8,9 +8,8 @@ describe('EditProductMixComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditProductMixComponent ] - }) - .compileComponents(); + declarations: [EditProductMixComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/products-mix/edit-product-mix/edit-product-mix.component.ts b/src/app/products/products-mix/edit-product-mix/edit-product-mix.component.ts index 82ec01fbd..4d5f30d16 100644 --- a/src/app/products/products-mix/edit-product-mix/edit-product-mix.component.ts +++ b/src/app/products/products-mix/edit-product-mix/edit-product-mix.component.ts @@ -15,7 +15,6 @@ import { ProductsService } from '../../products.service'; styleUrls: ['./edit-product-mix.component.scss'] }) export class EditProductMixComponent implements OnInit { - /** Product mix form. */ productMixForm: UntypedFormGroup; /** Products mix template data. */ @@ -32,10 +31,12 @@ export class EditProductMixComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {Router} router Router for navigation. */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private productsService: ProductsService, private route: ActivatedRoute, - private router: Router) { + private router: Router + ) { this.route.data.subscribe((data: { productMix: any }) => { this.productMixData = data.productMix; }); @@ -54,8 +55,11 @@ export class EditProductMixComponent implements OnInit { */ createProductMixForm() { this.productMixForm = this.formBuilder.group({ - 'productId': [{ value: this.productMixData.productName, disabled: true}], - 'restrictedProducts': ['', Validators.required] + productId: [{ value: this.productMixData.productName, disabled: true }], + restrictedProducts: [ + '', + Validators.required + ] }); } @@ -64,8 +68,13 @@ export class EditProductMixComponent implements OnInit { */ setFormData() { const restrictedProductsData: {}[] = this.productMixData.restrictedProducts; - this.productData = [...restrictedProductsData, ...this.productMixData.allowedProducts]; - this.productMixForm.get('restrictedProducts').setValue([...restrictedProductsData.map((restrictedProduct: any) => restrictedProduct.id)]); + this.productData = [ + ...restrictedProductsData, + ...this.productMixData.allowedProducts + ]; + this.productMixForm + .get('restrictedProducts') + .setValue([...restrictedProductsData.map((restrictedProduct: any) => restrictedProduct.id)]); } /** diff --git a/src/app/products/products-mix/products-mix-template.resolver.ts b/src/app/products/products-mix/products-mix-template.resolver.ts index 614de5bd2..0887cfe3f 100644 --- a/src/app/products/products-mix/products-mix-template.resolver.ts +++ b/src/app/products/products-mix/products-mix-template.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class ProductsMixTemplateResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -26,5 +25,4 @@ export class ProductsMixTemplateResolver implements Resolve { resolve(): Observable { return this.productsService.getProductsMixTemplate(); } - } diff --git a/src/app/products/products-mix/products-mix.component.spec.ts b/src/app/products/products-mix/products-mix.component.spec.ts index b180f9939..16ec91010 100644 --- a/src/app/products/products-mix/products-mix.component.spec.ts +++ b/src/app/products/products-mix/products-mix.component.spec.ts @@ -8,9 +8,8 @@ describe('ProductsMixComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ProductsMixComponent ] - }) - .compileComponents(); + declarations: [ProductsMixComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/products-mix/products-mix.component.ts b/src/app/products/products-mix/products-mix.component.ts index a067bd642..16a83111d 100644 --- a/src/app/products/products-mix/products-mix.component.ts +++ b/src/app/products/products-mix/products-mix.component.ts @@ -17,7 +17,6 @@ import { of } from 'rxjs'; styleUrls: ['./products-mix.component.scss'] }) export class ProductsMixComponent implements OnInit { - /** productMix data. */ productMixData: any; /** Columns to be displayed in products mix table. */ @@ -34,7 +33,7 @@ export class ProductsMixComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. */ constructor(private route: ActivatedRoute) { - this.route.data.subscribe(( data: { products: any }) => { + this.route.data.subscribe((data: { products: any }) => { this.productMixData = data.products; }); } @@ -62,5 +61,4 @@ export class ProductsMixComponent implements OnInit { this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } - } diff --git a/src/app/products/products-mix/products-mix.resolver.ts b/src/app/products/products-mix/products-mix.resolver.ts index 27d0a1297..09cf9d7fe 100644 --- a/src/app/products/products-mix/products-mix.resolver.ts +++ b/src/app/products/products-mix/products-mix.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class ProductsMixResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -26,5 +25,4 @@ export class ProductsMixResolver implements Resolve { resolve(): Observable { return this.productsService.getProductMixes(); } - } diff --git a/src/app/products/products-mix/view-product-mix/view-product-mix.componenent.spec.ts b/src/app/products/products-mix/view-product-mix/view-product-mix.componenent.spec.ts index f3df3d5f6..21f824b17 100644 --- a/src/app/products/products-mix/view-product-mix/view-product-mix.componenent.spec.ts +++ b/src/app/products/products-mix/view-product-mix/view-product-mix.componenent.spec.ts @@ -1,25 +1,24 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ViewProductMixComponent } from './view-product-mix.component'; - -describe('ViewProductMixComponent', () => { - let component: ViewProductMixComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ ViewProductMixComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ViewProductMixComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ViewProductMixComponent } from './view-product-mix.component'; + +describe('ViewProductMixComponent', () => { + let component: ViewProductMixComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ViewProductMixComponent] + }).compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ViewProductMixComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/products/products-mix/view-product-mix/view-product-mix.component.ts b/src/app/products/products-mix/view-product-mix/view-product-mix.component.ts index cc7a128f0..dc1fe733e 100644 --- a/src/app/products/products-mix/view-product-mix/view-product-mix.component.ts +++ b/src/app/products/products-mix/view-product-mix/view-product-mix.component.ts @@ -1,101 +1,106 @@ -/** Angular Imports */ -import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { MatPaginator } from '@angular/material/paginator'; -import { MatSort } from '@angular/material/sort'; -import { MatTableDataSource } from '@angular/material/table'; -import { ActivatedRoute, Router } from '@angular/router'; -import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component'; - -/** Custom Services */ -import { TranslateService } from '@ngx-translate/core'; -import { ProductsService } from 'app/products/products.service'; - -/** - * View product mix component. - */ -@Component({ - selector: 'mifosx-view-product-mix', - templateUrl: './view-product-mix.component.html', - styleUrls: ['./view-product-mix.component.scss'] -}) -export class ViewProductMixComponent implements OnInit { - - /** Product mix data. */ - productMixData: any; - /** Allowed products datasource. */ - allowedProductsDatasource: MatTableDataSource; - /** Restricted products datasource. */ - restrictedProductsDatasource: MatTableDataSource; - /** Columns to be displayed in allowed products table. */ - allowedProductsDisplayedColumns: string[] = ['name']; - /** Columns to be displayed in restricted products table. */ - restrictedProductsDisplayedColumns: string[] = ['name']; - - /** Paginator for allowed products table. */ - @ViewChild('allowed', { static: true }) allowedPaginator: MatPaginator; - /** Paginator for restricted products table. */ - @ViewChild('restricted', { static: true }) restrictedPaginator: MatPaginator; - /** Sorter for allowed products table. */ - @ViewChild(MatSort, { static: true }) allowedSort: MatSort; - /** Sorter for restricted products table. */ - @ViewChild(MatSort, { static: true }) restrictedSort: MatSort; - - /** - * Retrieves the product mix data from `resolve`. - * @param {ActivatedRoute} route Activated Route. - * @param {TranslateService} translateService Translate Service. - */ - constructor(private route: ActivatedRoute, - private dialog: MatDialog, - private productsService: ProductsService, - private router: Router, - private translateService: TranslateService ) { - this.route.data.subscribe((data: { productMix: any }) => { - this.productMixData = data.productMix; - }); - } - - /** - * Sets the allowed and restricted products tables. - */ - ngOnInit() { - this.setAllowedProducts(); - this.setRestrictedProducts(); - } - - /** - * Initializes the data source, paginator and sorter for the allowed products table. - */ - setAllowedProducts() { - this.allowedProductsDatasource = new MatTableDataSource(this.productMixData.allowedProducts); - this.allowedProductsDatasource.paginator = this.allowedPaginator; - this.allowedProductsDatasource.sort = this.allowedSort; - } - - /** - * Initializes the data source, paginator and sorter for the restricted products table. - */ - setRestrictedProducts() { - this.restrictedProductsDatasource = new MatTableDataSource(this.productMixData.restrictedProducts); - this.restrictedProductsDatasource.paginator = this.restrictedPaginator; - this.restrictedProductsDatasource.sort = this.restrictedSort; - } - - /** - * Deletes the product mix - */ - delete() { - const deleteProductMixDialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: this.translateService.instant('labels.dialogContext.the productmix component with id') + ' ' + this.productMixData.productId} - }); - deleteProductMixDialogRef.afterClosed().subscribe((response: any) => { - if (response.delete) { - this.productsService.deleteProductMix(this.productMixData.productId) - .subscribe(() => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); - } - }); - } -} +/** Angular Imports */ +import { Component, OnInit, ViewChild } from '@angular/core'; +import { MatDialog } from '@angular/material/dialog'; +import { MatPaginator } from '@angular/material/paginator'; +import { MatSort } from '@angular/material/sort'; +import { MatTableDataSource } from '@angular/material/table'; +import { ActivatedRoute, Router } from '@angular/router'; +import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component'; + +/** Custom Services */ +import { TranslateService } from '@ngx-translate/core'; +import { ProductsService } from 'app/products/products.service'; + +/** + * View product mix component. + */ +@Component({ + selector: 'mifosx-view-product-mix', + templateUrl: './view-product-mix.component.html', + styleUrls: ['./view-product-mix.component.scss'] +}) +export class ViewProductMixComponent implements OnInit { + /** Product mix data. */ + productMixData: any; + /** Allowed products datasource. */ + allowedProductsDatasource: MatTableDataSource; + /** Restricted products datasource. */ + restrictedProductsDatasource: MatTableDataSource; + /** Columns to be displayed in allowed products table. */ + allowedProductsDisplayedColumns: string[] = ['name']; + /** Columns to be displayed in restricted products table. */ + restrictedProductsDisplayedColumns: string[] = ['name']; + + /** Paginator for allowed products table. */ + @ViewChild('allowed', { static: true }) allowedPaginator: MatPaginator; + /** Paginator for restricted products table. */ + @ViewChild('restricted', { static: true }) restrictedPaginator: MatPaginator; + /** Sorter for allowed products table. */ + @ViewChild(MatSort, { static: true }) allowedSort: MatSort; + /** Sorter for restricted products table. */ + @ViewChild(MatSort, { static: true }) restrictedSort: MatSort; + + /** + * Retrieves the product mix data from `resolve`. + * @param {ActivatedRoute} route Activated Route. + * @param {TranslateService} translateService Translate Service. + */ + constructor( + private route: ActivatedRoute, + private dialog: MatDialog, + private productsService: ProductsService, + private router: Router, + private translateService: TranslateService + ) { + this.route.data.subscribe((data: { productMix: any }) => { + this.productMixData = data.productMix; + }); + } + + /** + * Sets the allowed and restricted products tables. + */ + ngOnInit() { + this.setAllowedProducts(); + this.setRestrictedProducts(); + } + + /** + * Initializes the data source, paginator and sorter for the allowed products table. + */ + setAllowedProducts() { + this.allowedProductsDatasource = new MatTableDataSource(this.productMixData.allowedProducts); + this.allowedProductsDatasource.paginator = this.allowedPaginator; + this.allowedProductsDatasource.sort = this.allowedSort; + } + + /** + * Initializes the data source, paginator and sorter for the restricted products table. + */ + setRestrictedProducts() { + this.restrictedProductsDatasource = new MatTableDataSource(this.productMixData.restrictedProducts); + this.restrictedProductsDatasource.paginator = this.restrictedPaginator; + this.restrictedProductsDatasource.sort = this.restrictedSort; + } + + /** + * Deletes the product mix + */ + delete() { + const deleteProductMixDialogRef = this.dialog.open(DeleteDialogComponent, { + data: { + deleteContext: + this.translateService.instant('labels.dialogContext.the productmix component with id') + + ' ' + + this.productMixData.productId + } + }); + deleteProductMixDialogRef.afterClosed().subscribe((response: any) => { + if (response.delete) { + this.productsService.deleteProductMix(this.productMixData.productId).subscribe(() => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); + } + }); + } +} diff --git a/src/app/products/products-mix/view-product-mix/view-product-mix.resolver.ts b/src/app/products/products-mix/view-product-mix/view-product-mix.resolver.ts index 20dc0978c..be4997938 100644 --- a/src/app/products/products-mix/view-product-mix/view-product-mix.resolver.ts +++ b/src/app/products/products-mix/view-product-mix/view-product-mix.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../../products.service'; */ @Injectable() export class ViewProductMixResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ diff --git a/src/app/products/products-routing.module.ts b/src/app/products/products-routing.module.ts index a10467f0a..56a2279c7 100644 --- a/src/app/products/products-routing.module.ts +++ b/src/app/products/products-routing.module.ts @@ -177,18 +177,20 @@ const routes: Routes = [ component: GeneralTabComponent, resolve: { loanProduct: LoanProductResolver - }, + } }, { path: 'datatables', - children: [{ - path: ':datatableName', - component: DatatableTabComponent, - data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, - resolve: { - loanProductDatatable: LoanProductDatatableResolver + children: [ + { + path: ':datatableName', + component: DatatableTabComponent, + data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, + resolve: { + loanProductDatatable: LoanProductDatatableResolver + } } - }] + ] }, { path: 'edit', @@ -244,18 +246,20 @@ const routes: Routes = [ component: SavingProductGeneralTabComponent, resolve: { savingProduct: SavingProductResolver - }, + } }, { path: 'datatables', - children: [{ - path: ':datatableName', - component: SavingProductDatatableTabComponent, - data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, - resolve: { - savingProductDatatable: SavingProductDatatableResolver + children: [ + { + path: ':datatableName', + component: SavingProductDatatableTabComponent, + data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, + resolve: { + savingProductDatatable: SavingProductDatatableResolver + } } - }] + ] } ] }, @@ -268,7 +272,7 @@ const routes: Routes = [ } } ] - }, + } ] }, { @@ -312,18 +316,20 @@ const routes: Routes = [ component: ShareProductGeneralTabComponent, resolve: { shareProduct: ShareProductResolver - }, + } }, { path: 'datatables', - children: [{ - path: ':datatableName', - component: ShareProductDatatableTabComponent, - data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, - resolve: { - shareProductDatatable: ShareProductDatatableResolver + children: [ + { + path: ':datatableName', + component: ShareProductDatatableTabComponent, + data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, + resolve: { + shareProductDatatable: ShareProductDatatableResolver + } } - }] + ] } ] }, @@ -374,7 +380,7 @@ const routes: Routes = [ children: [ { path: '', - component: ManageTaxConfigurationsComponent, + component: ManageTaxConfigurationsComponent }, { path: 'tax-components', @@ -407,7 +413,7 @@ const routes: Routes = [ component: ViewTaxComponentComponent, resolve: { taxComponent: TaxComponentResolver - }, + } }, { path: 'edit', @@ -416,7 +422,7 @@ const routes: Routes = [ resolve: { taxComponent: TaxComponentResolver } - }, + } ] } ] @@ -452,7 +458,7 @@ const routes: Routes = [ component: ViewTaxGroupComponent, resolve: { taxGroup: TaxGroupResolver - }, + } }, { path: 'edit', @@ -461,20 +467,23 @@ const routes: Routes = [ resolve: { taxGroup: EditTaxGroupResolver } - }, + } ] } ] - }, + } ] }, { path: 'delinquency-bucket-configurations', - data: { title: 'Manage Delinquency Bucket Configurations', breadcrumb: 'Manage Delinquency Bucket Configurations' }, + data: { + title: 'Manage Delinquency Bucket Configurations', + breadcrumb: 'Manage Delinquency Bucket Configurations' + }, children: [ { path: '', - component: ManageDelinquencyBucketsComponent, + component: ManageDelinquencyBucketsComponent }, { path: 'ranges', @@ -504,7 +513,7 @@ const routes: Routes = [ component: ViewRangeComponent, resolve: { delinquencyRange: DelinquencyRangeComponentsResolver - }, + } }, { path: 'edit', @@ -513,7 +522,7 @@ const routes: Routes = [ resolve: { delinquencyRange: DelinquencyRangeComponentsResolver } - }, + } ] } ] @@ -549,7 +558,7 @@ const routes: Routes = [ component: ViewBucketComponent, resolve: { delinquencyBucket: DelinquencyBucketComponentsResolver - }, + } }, { path: 'edit', @@ -559,11 +568,11 @@ const routes: Routes = [ delinquencyBucket: DelinquencyBucketComponentsResolver, delinquencyRanges: DelinquencyRangeComponentsResolver } - }, + } ] } ] - }, + } ] }, { @@ -587,7 +596,11 @@ const routes: Routes = [ }, { path: ':productId', - data: { title: 'View Recurring Deposit Product', breadcrumb: 'productId', routeParamBreadcrumb: 'productId' }, + data: { + title: 'View Recurring Deposit Product', + breadcrumb: 'productId', + routeParamBreadcrumb: 'productId' + }, component: ViewRecurringDepositProductComponent, resolve: { recurringDepositDatatables: SavingProductDatatablesResolver @@ -607,14 +620,16 @@ const routes: Routes = [ }, { path: 'datatables', - children: [{ - path: ':datatableName', - component: RecurringDepositDatatableTabComponent, - data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, - resolve: { - recurringDepositDatatable: SavingProductDatatableResolver + children: [ + { + path: ':datatableName', + component: RecurringDepositDatatableTabComponent, + data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, + resolve: { + recurringDepositDatatable: SavingProductDatatableResolver + } } - }] + ] }, { path: 'edit', @@ -645,7 +660,7 @@ const routes: Routes = [ component: FixedDepositProductsComponent, resolve: { fixedDepositProducts: FixedDepositProductsResolver - }, + } }, { path: ':productId', @@ -669,14 +684,16 @@ const routes: Routes = [ }, { path: 'datatables', - children: [{ - path: ':datatableName', - component: FixedDepositDatatableTabComponent, - data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, - resolve: { - fixedDepositDatatable: SavingProductDatatableResolver + children: [ + { + path: ':datatableName', + component: FixedDepositDatatableTabComponent, + data: { title: 'Data Table View', routeParamBreadcrumb: 'datatableName' }, + resolve: { + fixedDepositDatatable: SavingProductDatatableResolver + } } - }] + ] }, { path: 'edit', @@ -707,7 +724,7 @@ const routes: Routes = [ component: ProductsMixComponent, resolve: { products: ProductsMixResolver - }, + } }, { path: ':id', @@ -721,7 +738,7 @@ const routes: Routes = [ component: ViewProductMixComponent, resolve: { productMix: ViewProductMixResolver - }, + } }, { path: 'edit', @@ -730,9 +747,9 @@ const routes: Routes = [ resolve: { productMix: ViewProductMixResolver } - }, + } ] - }, + } ] }, { @@ -763,7 +780,7 @@ const routes: Routes = [ component: ViewFloatingRateComponent, resolve: { floatingRate: FloatingRateResolver - }, + } }, { path: 'edit', @@ -808,7 +825,7 @@ const routes: Routes = [ component: ViewChargeComponent, resolve: { charge: ChargeResolver - }, + } }, { path: 'edit', @@ -817,9 +834,9 @@ const routes: Routes = [ resolve: { chargesTemplate: ChargesTemplateAndResolver } - }, + } ] - }, + } ] }, { @@ -853,7 +870,7 @@ const routes: Routes = [ component: ViewCollateralComponent, resolve: { collateral: CollateralResolver - }, + } }, { path: 'edit', @@ -863,15 +880,15 @@ const routes: Routes = [ collateralTemplate: CollateralTemplateResolver, collateral: CollateralResolver } - }, + } ] - }, + } ] } ] } - ] - ) + ]) + ]; /** @@ -930,4 +947,4 @@ const routes: Routes = [ DelinquencyBucketComponentsResolver ] }) -export class ProductsRoutingModule { } +export class ProductsRoutingModule {} diff --git a/src/app/products/products.component.ts b/src/app/products/products.component.ts index b86ee6b1f..e04c52131 100644 --- a/src/app/products/products.component.ts +++ b/src/app/products/products.component.ts @@ -15,7 +15,6 @@ import { PopoverService } from '../configuration-wizard/popover/popover.service' styleUrls: ['./products.component.scss'] }) export class ProductsComponent implements AfterViewInit { - /* Reference of charges */ @ViewChild('charges') charges: ElementRef; /* Template for popover on charges */ @@ -48,9 +47,11 @@ export class ProductsComponent implements AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { } + constructor( + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) {} /** * To show popover. @@ -83,7 +84,12 @@ export class ProductsComponent implements AfterViewInit { } if (this.configurationWizardService.showRecurringDepositProducts === true) { setTimeout(() => { - this.showPopover(this.templateRecurringDepositProducts, this.recurringDepositProducts.nativeElement, 'bottom', true); + this.showPopover( + this.templateRecurringDepositProducts, + this.recurringDepositProducts.nativeElement, + 'bottom', + true + ); }); } } @@ -96,7 +102,12 @@ export class ProductsComponent implements AfterViewInit { * @param backdrop Boolean. * @param arrowNumber - The index of the boolean value to toggle. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -208,7 +219,7 @@ export class ProductsComponent implements AfterViewInit { this.router.navigate(['/products/fixed-deposit-products']); } - arrowBooleansToggle(arrowNumber: number) { + arrowBooleansToggle(arrowNumber: number) { // Toggle the boolean value at the given index this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber]; } diff --git a/src/app/products/products.module.ts b/src/app/products/products.module.ts index c60f45903..a966df70b 100644 --- a/src/app/products/products.module.ts +++ b/src/app/products/products.module.ts @@ -128,128 +128,128 @@ import { LoanProductSummaryComponent } from './loan-products/common/loan-product * All components related to product functions should be declared here. */ @NgModule({ - imports: [ - SharedModule, - ProductsRoutingModule, - PipesModule, - DirectivesModule - ], - declarations: [ - ProductsComponent, - LoanProductsComponent, - LoanProductDetailsStepComponent, - LoanProductCurrencyStepComponent, - LoanProductInterestRefundStepComponent, - LoanProductTermsStepComponent, - LoanProductSettingsStepComponent, - LoanProductPaymentStrategyStepComponent, - LoanProductChargesStepComponent, - LoanProductAccountingStepComponent, - LoanProductPreviewStepComponent, - CreateLoanProductComponent, - ManageTaxConfigurationsComponent, - RecurringDepositProductsComponent, - ChargesComponent, - ViewChargeComponent, - FixedDepositProductsComponent, - ManageTaxComponentsComponent, - ProductsMixComponent, - FloatingRatesComponent, - CreateFloatingRateComponent, - ViewFloatingRateComponent, - EditFloatingRateComponent, - FloatingRatePeriodDialogComponent, - ViewProductMixComponent, - ManageTaxComponentsComponent, - ViewLoanProductComponent, - EditLoanProductComponent, - SavingProductsComponent, - SavingProductDetailsStepComponent, - SavingProductCurrencyStepComponent, - SavingProductTermsStepComponent, - SavingProductSettingsStepComponent, - SavingProductChargesStepComponent, - SavingProductAccountingStepComponent, - SavingProductPreviewStepComponent, - CreateSavingProductComponent, - ViewSavingProductComponent, - EditSavingProductComponent, - ShareProductsComponent, - ShareProductDetailsStepComponent, - ShareProductCurrencyStepComponent, - ShareProductTermsStepComponent, - ShareProductSettingsStepComponent, - ShareProductMarketPriceStepComponent, - ShareProductChargesStepComponent, - ShareProductAccountingStepComponent, - ShareProductPreviewStepComponent, - CreateShareProductComponent, - ViewShareProductComponent, - EditShareProductComponent, - CreateFixedDepositProductComponent, - FixedDepositProductDetailsStepComponent, - FixedDepositProductCurrencyStepComponent, - FixedDepositProductTermsStepComponent, - FixedDepositProductSettingsStepComponent, - FixedDepositProductInterestRateChartStepComponent, - FixedDepositProductChargesStepComponent, - FixedDepositProductAccountingStepComponent, - FixedDepositProductPreviewStepComponent, - ManageTaxGroupsComponent, - ViewTaxComponentComponent, - CreateTaxComponentComponent, - EditTaxComponentComponent, - EditChargeComponent, - ViewTaxGroupComponent, - ShareProductsDividendsComponent, - DepositProductIncentiveFormDialogComponent, - ViewRecurringDepositProductComponent, - CreateRecurringDepositProductComponent, - RecurringDepositProductAccountingStepComponent, - RecurringDepositProductChargesStepComponent, - RecurringDepositProductCurrencyStepComponent, - RecurringDepositProductDetailsStepComponent, - RecurringDepositProductInterestRateChartStepComponent, - RecurringDepositProductPreviewStepComponent, - RecurringDepositProductSettingsStepComponent, - RecurringDepositProductTermsStepComponent, - EditRecurringDepositProductComponent, - CreateDividendComponent, - ViewDividendComponent, - ViewFixedDepositProductComponent, - CreateTaxGroupComponent, - EditTaxGroupComponent, - CreateProductMixComponent, - EditProductMixComponent, - ManageTaxGroupsComponent, - CreateChargeComponent, - EditFixedDepositProductComponent, - CollateralsComponent, - CreateCollateralComponent, - EditCollateralComponent, - ViewCollateralComponent, - ManageDelinquencyBucketsComponent, - DelinquencyBucketComponent, - DelinquencyRangeComponent, - CreateRangeComponent, - ViewRangeComponent, - EditRangeComponent, - ViewBucketComponent, - CreateBucketComponent, - EditBucketComponent, - DatatableTabComponent, - GeneralTabComponent, - SavingProductGeneralTabComponent, - SavingProductDatatableTabComponent, - FixedDepositGeneralTabComponent, - FixedDepositDatatableTabComponent, - RecurringDepositDatatableTabComponent, - RecurringDepositGeneralTabComponent, - ShareProductGeneralTabComponent, - ShareProductDatatableTabComponent, - ViewAdvancePaymenyAllocationComponent, - AdvancePaymentAllocationTabComponent, - LoanProductSummaryComponent - ] + imports: [ + SharedModule, + ProductsRoutingModule, + PipesModule, + DirectivesModule + ], + declarations: [ + ProductsComponent, + LoanProductsComponent, + LoanProductDetailsStepComponent, + LoanProductCurrencyStepComponent, + LoanProductInterestRefundStepComponent, + LoanProductTermsStepComponent, + LoanProductSettingsStepComponent, + LoanProductPaymentStrategyStepComponent, + LoanProductChargesStepComponent, + LoanProductAccountingStepComponent, + LoanProductPreviewStepComponent, + CreateLoanProductComponent, + ManageTaxConfigurationsComponent, + RecurringDepositProductsComponent, + ChargesComponent, + ViewChargeComponent, + FixedDepositProductsComponent, + ManageTaxComponentsComponent, + ProductsMixComponent, + FloatingRatesComponent, + CreateFloatingRateComponent, + ViewFloatingRateComponent, + EditFloatingRateComponent, + FloatingRatePeriodDialogComponent, + ViewProductMixComponent, + ManageTaxComponentsComponent, + ViewLoanProductComponent, + EditLoanProductComponent, + SavingProductsComponent, + SavingProductDetailsStepComponent, + SavingProductCurrencyStepComponent, + SavingProductTermsStepComponent, + SavingProductSettingsStepComponent, + SavingProductChargesStepComponent, + SavingProductAccountingStepComponent, + SavingProductPreviewStepComponent, + CreateSavingProductComponent, + ViewSavingProductComponent, + EditSavingProductComponent, + ShareProductsComponent, + ShareProductDetailsStepComponent, + ShareProductCurrencyStepComponent, + ShareProductTermsStepComponent, + ShareProductSettingsStepComponent, + ShareProductMarketPriceStepComponent, + ShareProductChargesStepComponent, + ShareProductAccountingStepComponent, + ShareProductPreviewStepComponent, + CreateShareProductComponent, + ViewShareProductComponent, + EditShareProductComponent, + CreateFixedDepositProductComponent, + FixedDepositProductDetailsStepComponent, + FixedDepositProductCurrencyStepComponent, + FixedDepositProductTermsStepComponent, + FixedDepositProductSettingsStepComponent, + FixedDepositProductInterestRateChartStepComponent, + FixedDepositProductChargesStepComponent, + FixedDepositProductAccountingStepComponent, + FixedDepositProductPreviewStepComponent, + ManageTaxGroupsComponent, + ViewTaxComponentComponent, + CreateTaxComponentComponent, + EditTaxComponentComponent, + EditChargeComponent, + ViewTaxGroupComponent, + ShareProductsDividendsComponent, + DepositProductIncentiveFormDialogComponent, + ViewRecurringDepositProductComponent, + CreateRecurringDepositProductComponent, + RecurringDepositProductAccountingStepComponent, + RecurringDepositProductChargesStepComponent, + RecurringDepositProductCurrencyStepComponent, + RecurringDepositProductDetailsStepComponent, + RecurringDepositProductInterestRateChartStepComponent, + RecurringDepositProductPreviewStepComponent, + RecurringDepositProductSettingsStepComponent, + RecurringDepositProductTermsStepComponent, + EditRecurringDepositProductComponent, + CreateDividendComponent, + ViewDividendComponent, + ViewFixedDepositProductComponent, + CreateTaxGroupComponent, + EditTaxGroupComponent, + CreateProductMixComponent, + EditProductMixComponent, + ManageTaxGroupsComponent, + CreateChargeComponent, + EditFixedDepositProductComponent, + CollateralsComponent, + CreateCollateralComponent, + EditCollateralComponent, + ViewCollateralComponent, + ManageDelinquencyBucketsComponent, + DelinquencyBucketComponent, + DelinquencyRangeComponent, + CreateRangeComponent, + ViewRangeComponent, + EditRangeComponent, + ViewBucketComponent, + CreateBucketComponent, + EditBucketComponent, + DatatableTabComponent, + GeneralTabComponent, + SavingProductGeneralTabComponent, + SavingProductDatatableTabComponent, + FixedDepositGeneralTabComponent, + FixedDepositDatatableTabComponent, + RecurringDepositDatatableTabComponent, + RecurringDepositGeneralTabComponent, + ShareProductGeneralTabComponent, + ShareProductDatatableTabComponent, + ViewAdvancePaymenyAllocationComponent, + AdvancePaymentAllocationTabComponent, + LoanProductSummaryComponent + ] }) -export class ProductsModule { } +export class ProductsModule {} diff --git a/src/app/products/products.service.ts b/src/app/products/products.service.ts index 9d2b18172..0da88bf65 100644 --- a/src/app/products/products.service.ts +++ b/src/app/products/products.service.ts @@ -15,13 +15,14 @@ import { SettingsService } from 'app/settings/settings.service'; providedIn: 'root' }) export class ProductsService { - /** * @param {HttpClient} http Http Client to send requests. * @param {SettingsService} settingsService Settings Service. */ - constructor(private http: HttpClient, - private settingsService: SettingsService) { } + constructor( + private http: HttpClient, + private settingsService: SettingsService + ) {} /** * @returns {Observable} Loan products data @@ -110,17 +111,17 @@ export class ProductsService { } getDividendData(shareProductId: any, dividendId: any): Observable { - const httpParams = new HttpParams().set('dateFormat', this.settingsService.dateFormat) - .set('limit', '10') - .set('locale', this.settingsService.language.code) - .set('offset', '0'); + const httpParams = new HttpParams() + .set('dateFormat', this.settingsService.dateFormat) + .set('limit', '10') + .set('locale', this.settingsService.language.code) + .set('offset', '0'); return this.http.get(`/shareproduct/${shareProductId}/dividend/${dividendId}`, { params: httpParams }); } approveDividend(shareProductId: any, dividendId: any, data: any): Observable { const httpParams = new HttpParams().set('command', 'approve'); return this.http.put(`/shareproduct/${shareProductId}/dividend/${dividendId}`, data, { params: httpParams }); - } /** @@ -310,7 +311,7 @@ export class ProductsService { * @param {any} delinquencyRateId Delinquency Range Id. * @returns {Observable} Delinquency Range data. */ - getDelinquencyRange(delinquencyRateId: any): Observable { + getDelinquencyRange(delinquencyRateId: any): Observable { return this.http.get(`/delinquency/ranges/${delinquencyRateId}`); } @@ -318,7 +319,7 @@ export class ProductsService { * @param {any} payload Delinquency Range data * @returns {Observable} Delinquency Range Resource Id */ - createDelinquencyRange(payload: any): Observable { + createDelinquencyRange(payload: any): Observable { return this.http.post('/delinquency/ranges', payload); } @@ -591,5 +592,4 @@ export class ProductsService { const httpParams = new HttpParams().set('genericResultSet', 'true'); return this.http.delete(`/datatables/${datatableName}/${productId}`, { params: httpParams }); } - } diff --git a/src/app/products/recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component.spec.ts b/src/app/products/recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component.spec.ts index e8cf10b69..d6deb1037 100644 --- a/src/app/products/recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component.spec.ts +++ b/src/app/products/recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateRecurringDepositProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateRecurringDepositProductComponent ] - }) - .compileComponents(); + declarations: [CreateRecurringDepositProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component.ts b/src/app/products/recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component.ts index 516314203..037c774e0 100644 --- a/src/app/products/recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component.ts +++ b/src/app/products/recurring-deposit-products/create-recurring-deposit-product/create-recurring-deposit-product.component.ts @@ -22,14 +22,20 @@ import { Accounting } from 'app/core/utils/accounting'; styleUrls: ['./create-recurring-deposit-product.component.scss'] }) export class CreateRecurringDepositProductComponent { - - @ViewChild(RecurringDepositProductDetailsStepComponent, { static: true }) recurringDepositProductDetailsStep: RecurringDepositProductDetailsStepComponent; - @ViewChild(RecurringDepositProductCurrencyStepComponent, { static: true }) recurringDepositProductCurrencyStep: RecurringDepositProductCurrencyStepComponent; - @ViewChild(RecurringDepositProductTermsStepComponent, { static: true }) recurringDepositProductTermsStep: RecurringDepositProductTermsStepComponent; - @ViewChild(RecurringDepositProductSettingsStepComponent, { static: true }) recurringDepositProductSettingsStep: RecurringDepositProductSettingsStepComponent; - @ViewChild(RecurringDepositProductInterestRateChartStepComponent, { static: true }) recurringDepositProductInterestRateChartStep: RecurringDepositProductInterestRateChartStepComponent; - @ViewChild(RecurringDepositProductChargesStepComponent, { static: true }) recurringDepositProductChargesStep: RecurringDepositProductChargesStepComponent; - @ViewChild(RecurringDepositProductAccountingStepComponent, { static: true }) recurringDepositProductAccountingStep: RecurringDepositProductAccountingStepComponent; + @ViewChild(RecurringDepositProductDetailsStepComponent, { static: true }) + recurringDepositProductDetailsStep: RecurringDepositProductDetailsStepComponent; + @ViewChild(RecurringDepositProductCurrencyStepComponent, { static: true }) + recurringDepositProductCurrencyStep: RecurringDepositProductCurrencyStepComponent; + @ViewChild(RecurringDepositProductTermsStepComponent, { static: true }) + recurringDepositProductTermsStep: RecurringDepositProductTermsStepComponent; + @ViewChild(RecurringDepositProductSettingsStepComponent, { static: true }) + recurringDepositProductSettingsStep: RecurringDepositProductSettingsStepComponent; + @ViewChild(RecurringDepositProductInterestRateChartStepComponent, { static: true }) + recurringDepositProductInterestRateChartStep: RecurringDepositProductInterestRateChartStepComponent; + @ViewChild(RecurringDepositProductChargesStepComponent, { static: true }) + recurringDepositProductChargesStep: RecurringDepositProductChargesStepComponent; + @ViewChild(RecurringDepositProductAccountingStepComponent, { static: true }) + recurringDepositProductAccountingStep: RecurringDepositProductAccountingStepComponent; recurringDepositProductsTemplate: any; accountingRuleData: string[] = []; @@ -41,11 +47,13 @@ export class CreateRecurringDepositProductComponent { * @param {SettingsService} settingsService Settings Service. */ - constructor(private route: ActivatedRoute, - private productsService: ProductsService, - private router: Router, - private settingsService: SettingsService, - private accounting: Accounting) { + constructor( + private route: ActivatedRoute, + private productsService: ProductsService, + private router: Router, + private settingsService: SettingsService, + private accounting: Accounting + ) { this.route.data.subscribe((data: { recurringDepositProductsTemplate: any }) => { this.recurringDepositProductsTemplate = data.recurringDepositProductsTemplate; }); @@ -110,10 +118,14 @@ export class CreateRecurringDepositProductComponent { recurringDepositProduct.description = ''; } delete recurringDepositProduct.advancedAccountingRules; - this.productsService.createRecurringDepositProduct(recurringDepositProduct) - .subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); - }); + this.productsService.createRecurringDepositProduct(recurringDepositProduct).subscribe((response: any) => { + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); + }); } - } diff --git a/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.spec.ts b/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.spec.ts index 013928547..b4f172068 100644 --- a/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.spec.ts +++ b/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.spec.ts @@ -8,9 +8,8 @@ describe('EditRecurringDepositProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditRecurringDepositProductComponent ] - }) - .compileComponents(); + declarations: [EditRecurringDepositProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.ts b/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.ts index eb91e87ff..b03a4ad53 100644 --- a/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.ts +++ b/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/edit-recurring-deposit-product.component.ts @@ -22,14 +22,20 @@ import { Accounting } from 'app/core/utils/accounting'; styleUrls: ['./edit-recurring-deposit-product.component.scss'] }) export class EditRecurringDepositProductComponent { - - @ViewChild(RecurringDepositProductDetailsStepComponent, { static: true }) recurringDepositProductDetailsStep: RecurringDepositProductDetailsStepComponent; - @ViewChild(RecurringDepositProductCurrencyStepComponent, { static: true }) recurringDepositProductCurrencyStep: RecurringDepositProductCurrencyStepComponent; - @ViewChild(RecurringDepositProductTermsStepComponent, { static: true }) recurringDepositProductTermsStep: RecurringDepositProductTermsStepComponent; - @ViewChild(RecurringDepositProductSettingsStepComponent, { static: true }) recurringDepositProductSettingsStep: RecurringDepositProductSettingsStepComponent; - @ViewChild(RecurringDepositProductInterestRateChartStepComponent, { static: true }) recurringDepositProductInterestRateChartStep: RecurringDepositProductInterestRateChartStepComponent; - @ViewChild(RecurringDepositProductChargesStepComponent, { static: true }) recurringDepositProductChargesStep: RecurringDepositProductChargesStepComponent; - @ViewChild(RecurringDepositProductAccountingStepComponent, { static: true }) recurringDepositProductAccountingStep: RecurringDepositProductAccountingStepComponent; + @ViewChild(RecurringDepositProductDetailsStepComponent, { static: true }) + recurringDepositProductDetailsStep: RecurringDepositProductDetailsStepComponent; + @ViewChild(RecurringDepositProductCurrencyStepComponent, { static: true }) + recurringDepositProductCurrencyStep: RecurringDepositProductCurrencyStepComponent; + @ViewChild(RecurringDepositProductTermsStepComponent, { static: true }) + recurringDepositProductTermsStep: RecurringDepositProductTermsStepComponent; + @ViewChild(RecurringDepositProductSettingsStepComponent, { static: true }) + recurringDepositProductSettingsStep: RecurringDepositProductSettingsStepComponent; + @ViewChild(RecurringDepositProductInterestRateChartStepComponent, { static: true }) + recurringDepositProductInterestRateChartStep: RecurringDepositProductInterestRateChartStepComponent; + @ViewChild(RecurringDepositProductChargesStepComponent, { static: true }) + recurringDepositProductChargesStep: RecurringDepositProductChargesStepComponent; + @ViewChild(RecurringDepositProductAccountingStepComponent, { static: true }) + recurringDepositProductAccountingStep: RecurringDepositProductAccountingStepComponent; recurringDepositProductsTemplate: any; accountingRuleData: string[] = []; @@ -41,11 +47,13 @@ export class EditRecurringDepositProductComponent { * @param {SettingsService} settingsService Settings Service. */ - constructor(private route: ActivatedRoute, - private productsService: ProductsService, - private router: Router, - private settingsService: SettingsService, - private accounting: Accounting) { + constructor( + private route: ActivatedRoute, + private productsService: ProductsService, + private router: Router, + private settingsService: SettingsService, + private accounting: Accounting + ) { this.route.data.subscribe((data: { recurringDepositProductAndTemplate: any }) => { this.recurringDepositProductsTemplate = data.recurringDepositProductAndTemplate; }); @@ -84,14 +92,12 @@ export class EditRecurringDepositProductComponent { this.recurringDepositProductSettingsForm.valid && this.recurringDepositProductInterestRateChartForm.valid && this.recurringDepositProductAccountingForm.valid && - ( - this.recurringDepositProductDetailsForm.pristine || + (this.recurringDepositProductDetailsForm.pristine || this.recurringDepositProductCurrencyForm.pristine || this.recurringDepositProductTermsForm.pristine || this.recurringDepositProductSettingsForm.pristine || this.recurringDepositProductInterestRateChartForm.pristine || - this.recurringDepositProductAccountingForm.pristine - ) + this.recurringDepositProductAccountingForm.pristine) ); } @@ -118,10 +124,10 @@ export class EditRecurringDepositProductComponent { recurringDepositProduct.description = ''; } delete recurringDepositProduct.advancedAccountingRules; - this.productsService.updateRecurringDepositProduct(this.recurringDepositProductsTemplate.id, recurringDepositProduct) + this.productsService + .updateRecurringDepositProduct(this.recurringDepositProductsTemplate.id, recurringDepositProduct) .subscribe((response: any) => { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/recurring-deposit-product-and-template.resolver.ts b/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/recurring-deposit-product-and-template.resolver.ts index 3bbbbc703..73a4a4376 100644 --- a/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/recurring-deposit-product-and-template.resolver.ts +++ b/src/app/products/recurring-deposit-products/edit-recurring-deposit-product/recurring-deposit-product-and-template.resolver.ts @@ -13,20 +13,18 @@ import { ProductsService } from '../../products.service'; */ @Injectable() export class RecurringDepositProductAndTemplateResolver implements Resolve { + /** + * @param {ProductsService} productsService Products service. + */ + constructor(private productsService: ProductsService) {} - /** - * @param {ProductsService} productsService Products service. - */ - constructor(private productsService: ProductsService) { } - - /** - * Returns the Recurring Deposits Product and Template. - * @param {ActivatedRouteSnapshot} route Route Snapshot - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const productId = route.parent.paramMap.get('productId'); - return this.productsService.getRecurringDepositProductAndTemplate(productId); - } - + /** + * Returns the Recurring Deposits Product and Template. + * @param {ActivatedRouteSnapshot} route Route Snapshot + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const productId = route.parent.paramMap.get('productId'); + return this.productsService.getRecurringDepositProductAndTemplate(productId); + } } diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component.spec.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component.spec.ts index 0068e986d..74b8598ee 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component.spec.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositProductAccountingStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositProductAccountingStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositProductAccountingStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component.ts index 5694b72d0..93ce7b274 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component.ts @@ -16,7 +16,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./recurring-deposit-product-accounting-step.component.scss'] }) export class RecurringDepositProductAccountingStepComponent implements OnInit { - @Input() recurringDepositProductsTemplate: any; @Input() accountingRuleData: any; @Input() recurringDepositProductFormValid: boolean; @@ -31,13 +30,23 @@ export class RecurringDepositProductAccountingStepComponent implements OnInit { expenseAccountData: any; liabilityAccountData: any; - paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId', 'actions']; - feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId', 'actions']; + paymentFundSourceDisplayedColumns: string[] = [ + 'paymentTypeId', + 'fundSourceAccountId', + 'actions' + ]; + feesPenaltyIncomeDisplayedColumns: string[] = [ + 'chargeId', + 'incomeAccountId', + 'actions' + ]; - constructor(private formBuilder: UntypedFormBuilder, - private dialog: MatDialog, - private accounting: Accounting, - private translateService: TranslateService) { + constructor( + private formBuilder: UntypedFormBuilder, + private dialog: MatDialog, + private accounting: Accounting, + private translateService: TranslateService + ) { this.createrecurringDepositProductAccountingForm(); this.setConditionalControls(); } @@ -48,8 +57,10 @@ export class RecurringDepositProductAccountingStepComponent implements OnInit { this.paymentTypeData = this.recurringDepositProductsTemplate.paymentTypeOptions || []; this.assetAccountData = this.recurringDepositProductsTemplate.accountingMappingOptions.assetAccountOptions || []; this.incomeAccountData = this.recurringDepositProductsTemplate.accountingMappingOptions.incomeAccountOptions || []; - this.expenseAccountData = this.recurringDepositProductsTemplate.accountingMappingOptions.expenseAccountOptions || []; - this.liabilityAccountData = this.recurringDepositProductsTemplate.accountingMappingOptions.liabilityAccountOptions || []; + this.expenseAccountData = + this.recurringDepositProductsTemplate.accountingMappingOptions.expenseAccountOptions || []; + this.liabilityAccountData = + this.recurringDepositProductsTemplate.accountingMappingOptions.liabilityAccountOptions || []; if (!(this.recurringDepositProductsTemplate === undefined) && this.recurringDepositProductsTemplate.id) { this.assignAccountingStepData(); } @@ -57,122 +68,192 @@ export class RecurringDepositProductAccountingStepComponent implements OnInit { assignAccountingStepData() { this.recurringDepositProductAccountingForm.patchValue({ - 'accountingRule': this.recurringDepositProductsTemplate.accountingRule.id + accountingRule: this.recurringDepositProductsTemplate.accountingRule.id }); if (this.isCashOrAccrualAccounting()) { - this.recurringDepositProductAccountingForm.patchValue({ - 'savingsReferenceAccountId': this.recurringDepositProductsTemplate.accountingMappings.savingsReferenceAccount.id, - 'savingsControlAccountId': this.recurringDepositProductsTemplate.accountingMappings.savingsControlAccount.id, - 'transfersInSuspenseAccountId': this.recurringDepositProductsTemplate.accountingMappings.transfersInSuspenseAccount.id, - 'incomeFromFeeAccountId': this.recurringDepositProductsTemplate.accountingMappings.incomeFromFeeAccount.id, - 'incomeFromPenaltyAccountId': this.recurringDepositProductsTemplate.accountingMappings.incomeFromPenaltyAccount.id, - 'interestOnSavingsAccountId': this.recurringDepositProductsTemplate.accountingMappings.interestOnSavingsAccount.id + savingsReferenceAccountId: this.recurringDepositProductsTemplate.accountingMappings.savingsReferenceAccount.id, + savingsControlAccountId: this.recurringDepositProductsTemplate.accountingMappings.savingsControlAccount.id, + transfersInSuspenseAccountId: + this.recurringDepositProductsTemplate.accountingMappings.transfersInSuspenseAccount.id, + incomeFromFeeAccountId: this.recurringDepositProductsTemplate.accountingMappings.incomeFromFeeAccount.id, + incomeFromPenaltyAccountId: + this.recurringDepositProductsTemplate.accountingMappings.incomeFromPenaltyAccount.id, + interestOnSavingsAccountId: this.recurringDepositProductsTemplate.accountingMappings.interestOnSavingsAccount.id }); if (this.isAccrualAccounting()) { this.recurringDepositProductAccountingForm.patchValue({ - 'feesReceivableAccountId': this.recurringDepositProductsTemplate.accountingMappings.feeReceivableAccount.id, - 'penaltiesReceivableAccountId': this.recurringDepositProductsTemplate.accountingMappings.penaltyReceivableAccount.id, - 'interestPayableAccountId': this.recurringDepositProductsTemplate.accountingMappings.interestPayableAccount.id + feesReceivableAccountId: this.recurringDepositProductsTemplate.accountingMappings.feeReceivableAccount.id, + penaltiesReceivableAccountId: + this.recurringDepositProductsTemplate.accountingMappings.penaltyReceivableAccount.id, + interestPayableAccountId: this.recurringDepositProductsTemplate.accountingMappings.interestPayableAccount.id }); } - if (this.recurringDepositProductsTemplate.paymentChannelToFundSourceMappings || this.recurringDepositProductsTemplate.feeToIncomeAccountMappings || this.recurringDepositProductsTemplate.penaltyToIncomeAccountMappings) { + if ( + this.recurringDepositProductsTemplate.paymentChannelToFundSourceMappings || + this.recurringDepositProductsTemplate.feeToIncomeAccountMappings || + this.recurringDepositProductsTemplate.penaltyToIncomeAccountMappings + ) { this.recurringDepositProductAccountingForm.patchValue({ - 'advancedAccountingRules': true + advancedAccountingRules: true }); } if (this.recurringDepositProductsTemplate.paymentChannelToFundSourceMappings) { - this.recurringDepositProductsTemplate.paymentChannelToFundSourceMappings.forEach((paymentChannelToFundSourceMapping: any) => { - const paymentChannelToFundSourceMappingData = this.formBuilder.group({ - paymentTypeId: [paymentChannelToFundSourceMapping.paymentType.id, Validators.required], - fundSourceAccountId: [paymentChannelToFundSourceMapping.fundSourceAccount.id, Validators.required] - }); - const formArray = this.recurringDepositProductAccountingForm.controls['paymentChannelToFundSourceMappings'] as UntypedFormArray; - formArray.push(paymentChannelToFundSourceMappingData); - }); + this.recurringDepositProductsTemplate.paymentChannelToFundSourceMappings.forEach( + (paymentChannelToFundSourceMapping: any) => { + const paymentChannelToFundSourceMappingData = this.formBuilder.group({ + paymentTypeId: [ + paymentChannelToFundSourceMapping.paymentType.id, + Validators.required + ], + fundSourceAccountId: [ + paymentChannelToFundSourceMapping.fundSourceAccount.id, + Validators.required + ] + }); + const formArray = this.recurringDepositProductAccountingForm.controls[ + 'paymentChannelToFundSourceMappings' + ] as UntypedFormArray; + formArray.push(paymentChannelToFundSourceMappingData); + } + ); } if (this.recurringDepositProductsTemplate.feeToIncomeAccountMappings) { this.recurringDepositProductsTemplate.feeToIncomeAccountMappings.forEach((feeToIncomeAccountMapping: any) => { const feeToIncomeAccountMappingData = this.formBuilder.group({ - chargeId: [feeToIncomeAccountMapping.charge.id, Validators.required], - incomeAccountId: [feeToIncomeAccountMapping.incomeAccount.id, Validators.required] + chargeId: [ + feeToIncomeAccountMapping.charge.id, + Validators.required + ], + incomeAccountId: [ + feeToIncomeAccountMapping.incomeAccount.id, + Validators.required + ] }); - const formArray = this.recurringDepositProductAccountingForm.controls['feeToIncomeAccountMappings'] as UntypedFormArray; + const formArray = this.recurringDepositProductAccountingForm.controls[ + 'feeToIncomeAccountMappings' + ] as UntypedFormArray; formArray.push(feeToIncomeAccountMappingData); }); } if (this.recurringDepositProductsTemplate.penaltyToIncomeAccountMappings) { - this.recurringDepositProductsTemplate.penaltyToIncomeAccountMappings.forEach((penaltyToIncomeAccountMapping: any) => { - const penaltyToIncomeAccountMappingData = this.formBuilder.group({ - chargeId: [penaltyToIncomeAccountMapping.charge.id, Validators.required], - incomeAccountId: [penaltyToIncomeAccountMapping.incomeAccount.id, Validators.required] - }); - const formArray = this.recurringDepositProductAccountingForm.controls['penaltyToIncomeAccountMappings'] as UntypedFormArray; - formArray.push(penaltyToIncomeAccountMappingData); - }); + this.recurringDepositProductsTemplate.penaltyToIncomeAccountMappings.forEach( + (penaltyToIncomeAccountMapping: any) => { + const penaltyToIncomeAccountMappingData = this.formBuilder.group({ + chargeId: [ + penaltyToIncomeAccountMapping.charge.id, + Validators.required + ], + incomeAccountId: [ + penaltyToIncomeAccountMapping.incomeAccount.id, + Validators.required + ] + }); + const formArray = this.recurringDepositProductAccountingForm.controls[ + 'penaltyToIncomeAccountMappings' + ] as UntypedFormArray; + formArray.push(penaltyToIncomeAccountMappingData); + } + ); } } } createrecurringDepositProductAccountingForm() { this.recurringDepositProductAccountingForm = this.formBuilder.group({ - 'accountingRule': [1] + accountingRule: [1] }); } existCharges(): boolean { - return (this.chargeData.length > 0); + return this.chargeData.length > 0; } setConditionalControls() { - this.recurringDepositProductAccountingForm.get('accountingRule').valueChanges - .subscribe((accountingRule: any) => { - if (accountingRule === 2 || accountingRule === 3) { - this.recurringDepositProductAccountingForm.addControl('savingsReferenceAccountId', new UntypedFormControl('', Validators.required)); - this.recurringDepositProductAccountingForm.addControl('savingsControlAccountId', new UntypedFormControl('', Validators.required)); - this.recurringDepositProductAccountingForm.addControl('transfersInSuspenseAccountId', new UntypedFormControl('', Validators.required)); - this.recurringDepositProductAccountingForm.addControl('interestOnSavingsAccountId', new UntypedFormControl('', Validators.required)); - this.recurringDepositProductAccountingForm.addControl('incomeFromFeeAccountId', new UntypedFormControl('', Validators.required)); - this.recurringDepositProductAccountingForm.addControl('incomeFromPenaltyAccountId', new UntypedFormControl('', Validators.required)); - this.recurringDepositProductAccountingForm.addControl('advancedAccountingRules', new UntypedFormControl(false)); + this.recurringDepositProductAccountingForm.get('accountingRule').valueChanges.subscribe((accountingRule: any) => { + if (accountingRule === 2 || accountingRule === 3) { + this.recurringDepositProductAccountingForm.addControl( + 'savingsReferenceAccountId', + new UntypedFormControl('', Validators.required) + ); + this.recurringDepositProductAccountingForm.addControl( + 'savingsControlAccountId', + new UntypedFormControl('', Validators.required) + ); + this.recurringDepositProductAccountingForm.addControl( + 'transfersInSuspenseAccountId', + new UntypedFormControl('', Validators.required) + ); + this.recurringDepositProductAccountingForm.addControl( + 'interestOnSavingsAccountId', + new UntypedFormControl('', Validators.required) + ); + this.recurringDepositProductAccountingForm.addControl( + 'incomeFromFeeAccountId', + new UntypedFormControl('', Validators.required) + ); + this.recurringDepositProductAccountingForm.addControl( + 'incomeFromPenaltyAccountId', + new UntypedFormControl('', Validators.required) + ); + this.recurringDepositProductAccountingForm.addControl('advancedAccountingRules', new UntypedFormControl(false)); - if (accountingRule === 3) { - this.recurringDepositProductAccountingForm.addControl('feesReceivableAccountId', new UntypedFormControl('', Validators.required)); - this.recurringDepositProductAccountingForm.addControl('penaltiesReceivableAccountId', new UntypedFormControl('', Validators.required)); - this.recurringDepositProductAccountingForm.addControl('interestPayableAccountId', new UntypedFormControl('', Validators.required)); - } - - this.recurringDepositProductAccountingForm.get('advancedAccountingRules').valueChanges - .subscribe((advancedAccountingRules: boolean) => { - if (advancedAccountingRules) { - this.recurringDepositProductAccountingForm.addControl('paymentChannelToFundSourceMappings', this.formBuilder.array([])); - this.recurringDepositProductAccountingForm.addControl('feeToIncomeAccountMappings', this.formBuilder.array([])); - this.recurringDepositProductAccountingForm.addControl('penaltyToIncomeAccountMappings', this.formBuilder.array([])); - } else { - this.recurringDepositProductAccountingForm.removeControl('paymentChannelToFundSourceMappings'); - this.recurringDepositProductAccountingForm.removeControl('feeToIncomeAccountMappings'); - this.recurringDepositProductAccountingForm.removeControl('penaltyToIncomeAccountMappings'); - } - }); - } else { - this.recurringDepositProductAccountingForm.removeControl('savingsReferenceAccountId'); - this.recurringDepositProductAccountingForm.removeControl('overdraftPortfolioControlId'); - this.recurringDepositProductAccountingForm.removeControl('savingsControlAccountId'); - this.recurringDepositProductAccountingForm.removeControl('transfersInSuspenseAccountId'); - this.recurringDepositProductAccountingForm.removeControl('interestOnSavingsAccountId'); - this.recurringDepositProductAccountingForm.removeControl('writeOffAccountId'); - this.recurringDepositProductAccountingForm.removeControl('incomeFromFeeAccountId'); - this.recurringDepositProductAccountingForm.removeControl('incomeFromPenaltyAccountId'); - this.recurringDepositProductAccountingForm.removeControl('incomeFromInterestId'); - this.recurringDepositProductAccountingForm.removeControl('advancedAccountingRules'); - this.recurringDepositProductAccountingForm.removeControl('escheatLiabilityId'); - this.recurringDepositProductAccountingForm.removeControl('feesReceivableAccountId'); - this.recurringDepositProductAccountingForm.removeControl('penaltiesReceivableAccountId'); - this.recurringDepositProductAccountingForm.removeControl('interestPayableAccountId'); + if (accountingRule === 3) { + this.recurringDepositProductAccountingForm.addControl( + 'feesReceivableAccountId', + new UntypedFormControl('', Validators.required) + ); + this.recurringDepositProductAccountingForm.addControl( + 'penaltiesReceivableAccountId', + new UntypedFormControl('', Validators.required) + ); + this.recurringDepositProductAccountingForm.addControl( + 'interestPayableAccountId', + new UntypedFormControl('', Validators.required) + ); } - }); + + this.recurringDepositProductAccountingForm + .get('advancedAccountingRules') + .valueChanges.subscribe((advancedAccountingRules: boolean) => { + if (advancedAccountingRules) { + this.recurringDepositProductAccountingForm.addControl( + 'paymentChannelToFundSourceMappings', + this.formBuilder.array([]) + ); + this.recurringDepositProductAccountingForm.addControl( + 'feeToIncomeAccountMappings', + this.formBuilder.array([]) + ); + this.recurringDepositProductAccountingForm.addControl( + 'penaltyToIncomeAccountMappings', + this.formBuilder.array([]) + ); + } else { + this.recurringDepositProductAccountingForm.removeControl('paymentChannelToFundSourceMappings'); + this.recurringDepositProductAccountingForm.removeControl('feeToIncomeAccountMappings'); + this.recurringDepositProductAccountingForm.removeControl('penaltyToIncomeAccountMappings'); + } + }); + } else { + this.recurringDepositProductAccountingForm.removeControl('savingsReferenceAccountId'); + this.recurringDepositProductAccountingForm.removeControl('overdraftPortfolioControlId'); + this.recurringDepositProductAccountingForm.removeControl('savingsControlAccountId'); + this.recurringDepositProductAccountingForm.removeControl('transfersInSuspenseAccountId'); + this.recurringDepositProductAccountingForm.removeControl('interestOnSavingsAccountId'); + this.recurringDepositProductAccountingForm.removeControl('writeOffAccountId'); + this.recurringDepositProductAccountingForm.removeControl('incomeFromFeeAccountId'); + this.recurringDepositProductAccountingForm.removeControl('incomeFromPenaltyAccountId'); + this.recurringDepositProductAccountingForm.removeControl('incomeFromInterestId'); + this.recurringDepositProductAccountingForm.removeControl('advancedAccountingRules'); + this.recurringDepositProductAccountingForm.removeControl('escheatLiabilityId'); + this.recurringDepositProductAccountingForm.removeControl('feesReceivableAccountId'); + this.recurringDepositProductAccountingForm.removeControl('penaltiesReceivableAccountId'); + this.recurringDepositProductAccountingForm.removeControl('interestPayableAccountId'); + } + }); } get paymentChannelToFundSourceMappings(): UntypedFormArray { @@ -220,12 +301,21 @@ export class RecurringDepositProductAccountingStepComponent implements OnInit { getData(formType: string, values?: any) { switch (formType) { - case 'PaymentFundSource': return { title: this.translateService.instant('labels.heading.Configure Fund Sources for Payment Channels'), - formfields: this.getPaymentFundSourceFormfields(values) }; - case 'FeesIncome': return { title: this.translateService.instant('labels.heading.Map Fees to Specific Income Accounts'), - formfields: this.getFeesIncomeFormfields(values) }; - case 'PenaltyIncome': return { title: this.translateService.instant('labels.heading.Map Penalties to Specific Income Accounts'), - formfields: this.getPenaltyIncomeFormfields(values) }; + case 'PaymentFundSource': + return { + title: this.translateService.instant('labels.heading.Configure Fund Sources for Payment Channels'), + formfields: this.getPaymentFundSourceFormfields(values) + }; + case 'FeesIncome': + return { + title: this.translateService.instant('labels.heading.Map Fees to Specific Income Accounts'), + formfields: this.getFeesIncomeFormfields(values) + }; + case 'PenaltyIncome': + return { + title: this.translateService.instant('labels.heading.Map Penalties to Specific Income Accounts'), + formfields: this.getPenaltyIncomeFormfields(values) + }; } } @@ -247,6 +337,7 @@ export class RecurringDepositProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -269,6 +360,7 @@ export class RecurringDepositProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -291,6 +383,7 @@ export class RecurringDepositProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -300,11 +393,12 @@ export class RecurringDepositProductAccountingStepComponent implements OnInit { } isCashOrAccrualAccounting(): boolean { - return this.accounting.isCashOrAccrualAccountingRuleId(this.recurringDepositProductAccountingForm.value.accountingRule); + return this.accounting.isCashOrAccrualAccountingRuleId( + this.recurringDepositProductAccountingForm.value.accountingRule + ); } isAccrualAccounting(): boolean { return this.accounting.isAccrualAccountingRuleId(this.recurringDepositProductAccountingForm.value.accountingRule); } - } diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component.spec.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component.spec.ts index 48785e47a..78869d0b5 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component.spec.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositProductChargesStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositProductChargesStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositProductChargesStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component.ts index 993b26a84..bfac238b1 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component.ts @@ -11,18 +11,24 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./recurring-deposit-product-charges-step.component.scss'] }) export class RecurringDepositProductChargesStepComponent implements OnInit { - @Input() recurringDepositProductsTemplate: any; @Input() currencyCode: UntypedFormControl; chargeData: any; chargesDataSource: {}[]; - displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'action']; + displayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'action' + ]; - constructor(public dialog: MatDialog, - private translateService: TranslateService) { - } + constructor( + public dialog: MatDialog, + private translateService: TranslateService + ) {} ngOnInit() { this.chargeData = this.recurringDepositProductsTemplate.chargeOptions; @@ -31,7 +37,7 @@ export class RecurringDepositProductChargesStepComponent implements OnInit { } else { this.chargesDataSource = []; } - this.currencyCode.valueChanges.subscribe(() => this.chargesDataSource = []); + this.currencyCode.valueChanges.subscribe(() => (this.chargesDataSource = [])); } addCharge(charge: any) { @@ -41,7 +47,7 @@ export class RecurringDepositProductChargesStepComponent implements OnInit { deleteCharge(charge: any) { const deleteChargeDialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: this.translateService.instant('labels.inputs.Charge') + ' ' + charge.name } + data: { deleteContext: this.translateService.instant('labels.inputs.Charge') + ' ' + charge.name } }); deleteChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { @@ -56,5 +62,4 @@ export class RecurringDepositProductChargesStepComponent implements OnInit { charges: this.chargesDataSource }; } - } diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component.spec.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component.spec.ts index 794f5f9c2..d89feb6fc 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component.spec.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositProductCurrencyStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositProductCurrencyStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositProductCurrencyStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component.ts index 327cb99d9..36d6a9cb9 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component.ts @@ -7,7 +7,6 @@ import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms styleUrls: ['./recurring-deposit-product-currency-step.component.scss'] }) export class RecurringDepositProductCurrencyStepComponent implements OnInit { - @Input() recurringDepositProductsTemplate: any; recurringDepositProductCurrencyForm: UntypedFormGroup; @@ -22,29 +21,33 @@ export class RecurringDepositProductCurrencyStepComponent implements OnInit { this.currencyData = this.recurringDepositProductsTemplate.currencyOptions; if (!(this.recurringDepositProductsTemplate === undefined) && this.recurringDepositProductsTemplate.id) { this.recurringDepositProductCurrencyForm.patchValue({ - 'currencyCode': this.recurringDepositProductsTemplate.currency.code, - 'digitsAfterDecimal': this.recurringDepositProductsTemplate.currency.decimalPlaces, - 'inMultiplesOf': this.recurringDepositProductsTemplate.currency.inMultiplesOf + currencyCode: this.recurringDepositProductsTemplate.currency.code, + digitsAfterDecimal: this.recurringDepositProductsTemplate.currency.decimalPlaces, + inMultiplesOf: this.recurringDepositProductsTemplate.currency.inMultiplesOf }); } else { this.recurringDepositProductCurrencyForm.patchValue({ - 'currencyCode': this.currencyData[0].code, - 'digitsAfterDecimal': 2 + currencyCode: this.currencyData[0].code, + digitsAfterDecimal: 2 }); } - } createrecurringDepositProductCurrencyForm() { this.recurringDepositProductCurrencyForm = this.formBuilder.group({ - 'currencyCode': ['', Validators.required], - 'digitsAfterDecimal': ['', Validators.required], - 'inMultiplesOf': [''] + currencyCode: [ + '', + Validators.required + ], + digitsAfterDecimal: [ + '', + Validators.required + ], + inMultiplesOf: [''] }); } get recurringDepositProductCurrency() { return this.recurringDepositProductCurrencyForm.value; } - } diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-details-step/recurring-deposit-product-details-step.component.spec.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-details-step/recurring-deposit-product-details-step.component.spec.ts index 9aa3b7d4d..73c2e3483 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-details-step/recurring-deposit-product-details-step.component.spec.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-details-step/recurring-deposit-product-details-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositProductDetailsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositProductDetailsStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositProductDetailsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-details-step/recurring-deposit-product-details-step.component.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-details-step/recurring-deposit-product-details-step.component.ts index d1a86fb7b..163184ce2 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-details-step/recurring-deposit-product-details-step.component.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-details-step/recurring-deposit-product-details-step.component.ts @@ -7,7 +7,6 @@ import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms styleUrls: ['./recurring-deposit-product-details-step.component.scss'] }) export class RecurringDepositProductDetailsStepComponent implements OnInit { - @Input() recurringDepositProductsTemplate: any; recurringDepositProductDetailsForm: UntypedFormGroup; @@ -19,23 +18,31 @@ export class RecurringDepositProductDetailsStepComponent implements OnInit { ngOnInit() { if (!(this.recurringDepositProductsTemplate === undefined) && this.recurringDepositProductsTemplate.id) { this.recurringDepositProductDetailsForm.patchValue({ - 'name': this.recurringDepositProductsTemplate.name, - 'shortName': this.recurringDepositProductsTemplate.shortName, - 'description': this.recurringDepositProductsTemplate.description, + name: this.recurringDepositProductsTemplate.name, + shortName: this.recurringDepositProductsTemplate.shortName, + description: this.recurringDepositProductsTemplate.description }); } } createrecurringDepositProductDetailsForm() { this.recurringDepositProductDetailsForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'shortName': ['', Validators.required], - 'description': ['', Validators.required] + name: [ + '', + Validators.required + ], + shortName: [ + '', + Validators.required + ], + description: [ + '', + Validators.required + ] }); } get recurringDepositProductDetails() { return this.recurringDepositProductDetailsForm.value; } - } diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.spec.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.spec.ts index e8d817310..ca85d147f 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.spec.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositProductInterestRateChartStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositProductInterestRateChartStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositProductInterestRateChartStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.ts index 3a057d234..8b32812ec 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.ts @@ -14,7 +14,6 @@ import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield- import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base'; import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base'; - import { SettingsService } from 'app/settings/settings.service'; import { Dates } from 'app/core/utils/dates'; import { TranslateService } from '@ngx-translate/core'; @@ -27,12 +26,11 @@ import { TranslateService } from '@ngx-translate/core'; trigger('expandChartSlab', [ state('collapsed', style({ height: '0px', minHeight: '0' })), state('expanded', style({ height: '*' })), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')) - ]) + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + ] }) export class RecurringDepositProductInterestRateChartStepComponent implements OnInit { - @Input() recurringDepositProductsTemplate: any; recurringDepositProductInterestRateChartForm: UntypedFormGroup; @@ -48,7 +46,15 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On chartSlabsDisplayedColumns: any[] = []; chartSlabsIncentivesDisplayedColumns: string[] = ['incentives']; - incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount', 'actions']; + incentivesDisplayedColumns: string[] = [ + 'entityType', + 'attributeName', + 'conditionType', + 'attributeValue', + 'incentiveType', + 'amount', + 'actions' + ]; minDate = new Date(2000, 0, 1); maxDate = new Date(new Date().setFullYear(new Date().getFullYear() + 10)); @@ -64,11 +70,13 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On * @param {SettingsService} settingsService Settings Service. */ - constructor(private formBuilder: UntypedFormBuilder, - public dialog: MatDialog, - private dateUtils: Dates, - private settingsService: SettingsService, - private translateService: TranslateService) { + constructor( + private formBuilder: UntypedFormBuilder, + public dialog: MatDialog, + private dateUtils: Dates, + private settingsService: SettingsService, + private translateService: TranslateService + ) { this.createrecurringDepositProductInterestRateChartForm(); } @@ -104,23 +112,33 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On // Iterates for every chart in charts this.charts.controls.forEach((chartDetailControl: UntypedFormGroup, i: number) => { - if (!this.chartsDetail[i]) { return; } // Iterate for every chartSlab in chart this.chartsDetail[i].chartSlabs.forEach((chartSlabDetail: any, j: number) => { - const chartSlabInfo = this.formBuilder.group({ id: [chartSlabDetail.id], amountRangeFrom: [chartSlabDetail.amountRangeFrom], amountRangeTo: [chartSlabDetail.amountRangeTo], - annualInterestRate: [chartSlabDetail.annualInterestRate, Validators.required], - description: [chartSlabDetail.description, Validators.required], - fromPeriod: [chartSlabDetail.fromPeriod, Validators.required], + annualInterestRate: [ + chartSlabDetail.annualInterestRate, + Validators.required + ], + description: [ + chartSlabDetail.description, + Validators.required + ], + fromPeriod: [ + chartSlabDetail.fromPeriod, + Validators.required + ], toPeriod: [chartSlabDetail.toPeriod], - periodType: [chartSlabDetail.periodType, Validators.required], + periodType: [ + chartSlabDetail.periodType, + Validators.required + ], incentives: this.formBuilder.array([]) }); const formArray = chartDetailControl.controls['chartSlabs'] as UntypedFormArray; @@ -132,19 +150,35 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On // Iterate to input all the incentive for particular chart slab this.chartsDetail[i].chartSlabs[j].incentives.forEach((chartIncentiveDetail: any) => { const incentiveInfo = this.formBuilder.group({ - amount: [chartIncentiveDetail.amount, Validators.required], - attributeName: [chartIncentiveDetail.attributeName, Validators.required], - attribureValue: [chartIncentiveDetail.attribureValue, Validators.required], - conditionType: [chartIncentiveDetail.conditionType, Validators.required], - entityType: [chartIncentiveDetail.entityType, Validators.required], - incentiveType: [chartIncentiveDetail.incentiveType, Validators.required] + amount: [ + chartIncentiveDetail.amount, + Validators.required + ], + attributeName: [ + chartIncentiveDetail.attributeName, + Validators.required + ], + attribureValue: [ + chartIncentiveDetail.attribureValue, + Validators.required + ], + conditionType: [ + chartIncentiveDetail.conditionType, + Validators.required + ], + entityType: [ + chartIncentiveDetail.entityType, + Validators.required + ], + incentiveType: [ + chartIncentiveDetail.incentiveType, + Validators.required + ] }); const newFormArray = chartIncentiveControl['controls']['incentives'] as UntypedFormArray; newFormArray.push(incentiveInfo); }); - }); - }); } @@ -163,7 +197,7 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On this.chartsDetail.push(chart); }); this.recurringDepositProductInterestRateChartForm.patchValue({ - 'charts': this.chartsDetail + charts: this.chartsDetail }); } @@ -213,7 +247,7 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On attributeValue: incentiveData.attributeValue, conditionType: incentiveData.conditionType, entityType: incentiveData.entityType, - incentiveType: incentiveData.incentiveType, + incentiveType: incentiveData.incentiveType }; incentives.push(incentive); }); @@ -223,7 +257,7 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On createrecurringDepositProductInterestRateChartForm() { this.recurringDepositProductInterestRateChartForm = this.formBuilder.group({ - 'charts': this.formBuilder.array([]) + charts: this.formBuilder.array([]) }); } @@ -233,13 +267,16 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On createChartForm(): UntypedFormGroup { return this.formBuilder.group({ - 'id': [null], - 'name': [''], - 'description': [''], - 'fromDate': ['', Validators.required], - 'endDate': [''], - 'isPrimaryGroupingByAmount': [false], - 'chartSlabs': this.formBuilder.array([], Validators.required) + id: [null], + name: [''], + description: [''], + fromDate: [ + '', + Validators.required + ], + endDate: [''], + isPrimaryGroupingByAmount: [false], + chartSlabs: this.formBuilder.array([], Validators.required) }); } @@ -249,10 +286,24 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On } setConditionalControls(chartIndex: number) { - this.chartSlabsDisplayedColumns[chartIndex] = ['period', 'amountRange', 'annualInterestRate', 'description', 'actions']; - this.charts.at(chartIndex).get('isPrimaryGroupingByAmount').valueChanges - .subscribe((isPrimaryGroupingByAmount: boolean) => { - this.chartSlabsDisplayedColumns[chartIndex] = isPrimaryGroupingByAmount ? ['amountRange', 'period'] : ['period', 'amountRange']; + this.chartSlabsDisplayedColumns[chartIndex] = [ + 'period', + 'amountRange', + 'annualInterestRate', + 'description', + 'actions' + ]; + this.charts + .at(chartIndex) + .get('isPrimaryGroupingByAmount') + .valueChanges.subscribe((isPrimaryGroupingByAmount: boolean) => { + this.chartSlabsDisplayedColumns[chartIndex] = isPrimaryGroupingByAmount ? [ + 'amountRange', + 'period' + ] : [ + 'period', + 'amountRange' + ]; this.chartSlabsDisplayedColumns[chartIndex].push('annualInterestRate', 'description', 'actions'); }); } @@ -293,7 +344,10 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On } editIncentive(incentives: UntypedFormArray, incentiveIndex: number) { - const data = { ...this.getData('Incentive', incentives.at(incentiveIndex).value), layout: { addButtonText: 'Edit' } }; + const data = { + ...this.getData('Incentive', incentives.at(incentiveIndex).value), + layout: { addButtonText: 'Edit' } + }; const dialogRef = this.dialog.open(DepositProductIncentiveFormDialogComponent, { data }); dialogRef.afterClosed().subscribe((response: any) => { if (response.data) { @@ -315,8 +369,13 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On getData(formType: string, values?: any) { switch (formType) { - case 'Slab': return { title: this.translateService.instant('labels.inputs.Slab'), formfields: this.getSlabFormfields(values) }; - case 'Incentive': return { values, chartTemplate: this.recurringDepositProductsTemplate.chartTemplate }; + case 'Slab': + return { + title: this.translateService.instant('labels.inputs.Slab'), + formfields: this.getSlabFormfields(values) + }; + case 'Incentive': + return { values, chartTemplate: this.recurringDepositProductsTemplate.chartTemplate }; } } @@ -374,6 +433,7 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On required: true, order: 7 }) + ]; return formfields; } @@ -406,5 +466,4 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On } return recurringDepositProductInterestRateChart; } - } diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-preview-step/recurring-deposit-product-preview-step.component.spec.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-preview-step/recurring-deposit-product-preview-step.component.spec.ts index 45b771067..350c9dde6 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-preview-step/recurring-deposit-product-preview-step.component.spec.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-preview-step/recurring-deposit-product-preview-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositProductPreviewStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositProductPreviewStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositProductPreviewStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-preview-step/recurring-deposit-product-preview-step.component.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-preview-step/recurring-deposit-product-preview-step.component.ts index d0b232f54..e5c839e38 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-preview-step/recurring-deposit-product-preview-step.component.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-preview-step/recurring-deposit-product-preview-step.component.ts @@ -11,12 +11,11 @@ import { Accounting } from 'app/core/utils/accounting'; trigger('expandChartSlab', [ state('collapsed', style({ height: '0px', minHeight: '0' })), state('expanded', style({ height: '*' })), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')) - ]) + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + ] }) export class RecurringDepositProductPreviewStepComponent implements OnInit, OnChanges { - @Input() recurringDepositProductsTemplate: any; @Input() chartSlabsDisplayedColumns: any[]; @Input() accountingRuleData: any; @@ -24,17 +23,35 @@ export class RecurringDepositProductPreviewStepComponent implements OnInit, OnCh @Output() submitEvent = new EventEmitter(); chartSlabsIncentivesDisplayedColumns: string[] = ['incentives']; - incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount']; - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType']; - paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId']; - feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId']; + incentivesDisplayedColumns: string[] = [ + 'entityType', + 'attributeName', + 'conditionType', + 'attributeValue', + 'incentiveType', + 'amount' + ]; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType' + ]; + paymentFundSourceDisplayedColumns: string[] = [ + 'paymentTypeId', + 'fundSourceAccountId' + ]; + feesPenaltyIncomeDisplayedColumns: string[] = [ + 'chargeId', + 'incomeAccountId' + ]; expandChartSlabIndex: number[] = []; accountingMappings: any = {}; accountingRule: OptionData; - constructor(private accounting: Accounting) { } + constructor(private accounting: Accounting) {} ngOnInit() { this.setCurrentValues(); @@ -49,23 +66,53 @@ export class RecurringDepositProductPreviewStepComponent implements OnInit, OnCh this.accountingRule = this.accounting.getAccountingRuleFrom(this.recurringDepositProduct.accountingRule); const assetAccountData = this.recurringDepositProductsTemplate.accountingMappingOptions.assetAccountOptions || []; - const incomeAccountData = this.recurringDepositProductsTemplate.accountingMappingOptions.incomeAccountOptions || []; - const expenseAccountData = this.recurringDepositProductsTemplate.accountingMappingOptions.expenseAccountOptions || []; - const liabilityAccountData = this.recurringDepositProductsTemplate.accountingMappingOptions.liabilityAccountOptions || []; + const incomeAccountData = + this.recurringDepositProductsTemplate.accountingMappingOptions.incomeAccountOptions || []; + const expenseAccountData = + this.recurringDepositProductsTemplate.accountingMappingOptions.expenseAccountOptions || []; + const liabilityAccountData = + this.recurringDepositProductsTemplate.accountingMappingOptions.liabilityAccountOptions || []; this.accountingMappings = { - 'savingsReferenceAccount': this.accounting.glAccountLookUp(this.recurringDepositProduct.savingsReferenceAccountId, assetAccountData), - 'savingsControlAccount': this.accounting.glAccountLookUp(this.recurringDepositProduct.savingsControlAccountId, liabilityAccountData), - 'transfersInSuspenseAccount': this.accounting.glAccountLookUp(this.recurringDepositProduct.transfersInSuspenseAccountId, liabilityAccountData), - 'interestOnSavingsAccount': this.accounting.glAccountLookUp(this.recurringDepositProduct.interestOnSavingsAccountId, expenseAccountData), - 'incomeFromFeeAccount': this.accounting.glAccountLookUp(this.recurringDepositProduct.incomeFromFeeAccountId, incomeAccountData), - 'incomeFromPenaltyAccount': this.accounting.glAccountLookUp(this.recurringDepositProduct.incomeFromPenaltyAccountId, incomeAccountData) + savingsReferenceAccount: this.accounting.glAccountLookUp( + this.recurringDepositProduct.savingsReferenceAccountId, + assetAccountData + ), + savingsControlAccount: this.accounting.glAccountLookUp( + this.recurringDepositProduct.savingsControlAccountId, + liabilityAccountData + ), + transfersInSuspenseAccount: this.accounting.glAccountLookUp( + this.recurringDepositProduct.transfersInSuspenseAccountId, + liabilityAccountData + ), + interestOnSavingsAccount: this.accounting.glAccountLookUp( + this.recurringDepositProduct.interestOnSavingsAccountId, + expenseAccountData + ), + incomeFromFeeAccount: this.accounting.glAccountLookUp( + this.recurringDepositProduct.incomeFromFeeAccountId, + incomeAccountData + ), + incomeFromPenaltyAccount: this.accounting.glAccountLookUp( + this.recurringDepositProduct.incomeFromPenaltyAccountId, + incomeAccountData + ) }; if (this.isAccrualAccounting()) { - this.accountingMappings['feeReceivableAccount'] = this.accounting.glAccountLookUp(this.recurringDepositProduct.feesReceivableAccountId, assetAccountData); - this.accountingMappings['penaltyReceivableAccount'] = this.accounting.glAccountLookUp(this.recurringDepositProduct.penaltiesReceivableAccountId, assetAccountData); - this.accountingMappings['interestPayableAccount'] = this.accounting.glAccountLookUp(this.recurringDepositProduct.interestPayableAccountId, liabilityAccountData); + this.accountingMappings['feeReceivableAccount'] = this.accounting.glAccountLookUp( + this.recurringDepositProduct.feesReceivableAccountId, + assetAccountData + ); + this.accountingMappings['penaltyReceivableAccount'] = this.accounting.glAccountLookUp( + this.recurringDepositProduct.penaltiesReceivableAccountId, + assetAccountData + ); + this.accountingMappings['interestPayableAccount'] = this.accounting.glAccountLookUp( + this.recurringDepositProduct.interestPayableAccountId, + liabilityAccountData + ); } } } @@ -81,5 +128,4 @@ export class RecurringDepositProductPreviewStepComponent implements OnInit, OnCh isAccrualAccounting(): boolean { return this.accounting.isAccrualAccountingRuleId(this.recurringDepositProduct.accountingRule); } - } diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-settings-step/recurring-deposit-product-settings-step.component.spec.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-settings-step/recurring-deposit-product-settings-step.component.spec.ts index b00a32706..f4bbc19d2 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-settings-step/recurring-deposit-product-settings-step.component.spec.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-settings-step/recurring-deposit-product-settings-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositProductSettingsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositProductSettingsStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositProductSettingsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-settings-step/recurring-deposit-product-settings-step.component.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-settings-step/recurring-deposit-product-settings-step.component.ts index 17c938674..985d4a99a 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-settings-step/recurring-deposit-product-settings-step.component.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-settings-step/recurring-deposit-product-settings-step.component.ts @@ -7,7 +7,6 @@ import { UntypedFormGroup, UntypedFormBuilder, UntypedFormControl, Validators } styleUrls: ['./recurring-deposit-product-settings-step.component.scss'] }) export class RecurringDepositProductSettingsStepComponent implements OnInit { - @Input() recurringDepositProductsTemplate: any; recurringDepositProductSettingsForm: UntypedFormGroup; @@ -30,60 +29,80 @@ export class RecurringDepositProductSettingsStepComponent implements OnInit { if (!(this.recurringDepositProductsTemplate === undefined) && this.recurringDepositProductsTemplate.id) { this.recurringDepositProductSettingsForm.patchValue({ - 'isMandatoryDeposit': this.recurringDepositProductsTemplate.isMandatoryDeposit, - 'adjustAdvanceTowardsFuturePayments': this.recurringDepositProductsTemplate.adjustAdvanceTowardsFuturePayments, - 'allowWithdrawal': this.recurringDepositProductsTemplate.allowWithdrawal, - 'lockinPeriodFrequency': this.recurringDepositProductsTemplate.lockinPeriodFrequency, - 'lockinPeriodFrequencyType': this.recurringDepositProductsTemplate.lockinPeriodFrequencyType ? this.recurringDepositProductsTemplate.lockinPeriodFrequencyType.id : '', - 'minDepositTerm': this.recurringDepositProductsTemplate.minDepositTerm, - 'minDepositTermTypeId': this.recurringDepositProductsTemplate.minDepositTermType ? this.recurringDepositProductsTemplate.minDepositTermType.id : '', - 'inMultiplesOfDepositTerm': this.recurringDepositProductsTemplate.inMultiplesOfDepositTerm, - 'inMultiplesOfDepositTermTypeId': this.recurringDepositProductsTemplate.inMultiplesOfDepositTermType ? this.recurringDepositProductsTemplate.inMultiplesOfDepositTerm.id : '', - 'maxDepositTerm': this.recurringDepositProductsTemplate.maxDepositTerm, - 'maxDepositTermTypeId': this.recurringDepositProductsTemplate.maxDepositTermType ? this.recurringDepositProductsTemplate.minDepositTermType.id : '', - 'preClosurePenalApplicable': this.recurringDepositProductsTemplate.preClosurePenalApplicable, - 'preClosurePenalInterest': this.recurringDepositProductsTemplate.preClosurePenalInterest, - 'preClosurePenalInterestOnTypeId': this.recurringDepositProductsTemplate.preClosurePenalInterestOnType ? this.recurringDepositProductsTemplate.preClosurePenalInterestOnType.id : '', - 'withHoldTax': this.recurringDepositProductsTemplate.withHoldTax + isMandatoryDeposit: this.recurringDepositProductsTemplate.isMandatoryDeposit, + adjustAdvanceTowardsFuturePayments: this.recurringDepositProductsTemplate.adjustAdvanceTowardsFuturePayments, + allowWithdrawal: this.recurringDepositProductsTemplate.allowWithdrawal, + lockinPeriodFrequency: this.recurringDepositProductsTemplate.lockinPeriodFrequency, + lockinPeriodFrequencyType: this.recurringDepositProductsTemplate.lockinPeriodFrequencyType + ? this.recurringDepositProductsTemplate.lockinPeriodFrequencyType.id + : '', + minDepositTerm: this.recurringDepositProductsTemplate.minDepositTerm, + minDepositTermTypeId: this.recurringDepositProductsTemplate.minDepositTermType + ? this.recurringDepositProductsTemplate.minDepositTermType.id + : '', + inMultiplesOfDepositTerm: this.recurringDepositProductsTemplate.inMultiplesOfDepositTerm, + inMultiplesOfDepositTermTypeId: this.recurringDepositProductsTemplate.inMultiplesOfDepositTermType + ? this.recurringDepositProductsTemplate.inMultiplesOfDepositTerm.id + : '', + maxDepositTerm: this.recurringDepositProductsTemplate.maxDepositTerm, + maxDepositTermTypeId: this.recurringDepositProductsTemplate.maxDepositTermType + ? this.recurringDepositProductsTemplate.minDepositTermType.id + : '', + preClosurePenalApplicable: this.recurringDepositProductsTemplate.preClosurePenalApplicable, + preClosurePenalInterest: this.recurringDepositProductsTemplate.preClosurePenalInterest, + preClosurePenalInterestOnTypeId: this.recurringDepositProductsTemplate.preClosurePenalInterestOnType + ? this.recurringDepositProductsTemplate.preClosurePenalInterestOnType.id + : '', + withHoldTax: this.recurringDepositProductsTemplate.withHoldTax }); } if (this.recurringDepositProductsTemplate.withHoldTax) { this.recurringDepositProductSettingsForm.patchValue({ - 'taxGroupId': this.recurringDepositProductsTemplate.taxGroup ? this.recurringDepositProductsTemplate.taxGroup.id : '' + taxGroupId: this.recurringDepositProductsTemplate.taxGroup + ? this.recurringDepositProductsTemplate.taxGroup.id + : '' }); } } createrecurringDepositProductSettingsForm() { this.recurringDepositProductSettingsForm = this.formBuilder.group({ - 'isMandatoryDeposit': [false], - 'adjustAdvanceTowardsFuturePayments': [false], - 'allowWithdrawal': [false], - 'lockinPeriodFrequency': [''], - 'lockinPeriodFrequencyType': [''], - 'minDepositTerm': ['', Validators.required], - 'minDepositTermTypeId': ['', Validators.required], - 'inMultiplesOfDepositTerm': [''], - 'inMultiplesOfDepositTermTypeId': [''], - 'maxDepositTerm': [''], - 'maxDepositTermTypeId': [''], - 'preClosurePenalApplicable': [false], - 'preClosurePenalInterest': [''], - 'preClosurePenalInterestOnTypeId': [''], - 'withHoldTax': [false] + isMandatoryDeposit: [false], + adjustAdvanceTowardsFuturePayments: [false], + allowWithdrawal: [false], + lockinPeriodFrequency: [''], + lockinPeriodFrequencyType: [''], + minDepositTerm: [ + '', + Validators.required + ], + minDepositTermTypeId: [ + '', + Validators.required + ], + inMultiplesOfDepositTerm: [''], + inMultiplesOfDepositTermTypeId: [''], + maxDepositTerm: [''], + maxDepositTermTypeId: [''], + preClosurePenalApplicable: [false], + preClosurePenalInterest: [''], + preClosurePenalInterestOnTypeId: [''], + withHoldTax: [false] }); } setConditionalControls() { - this.recurringDepositProductSettingsForm.get('withHoldTax').valueChanges - .subscribe((withHoldTax: any) => { - if (withHoldTax) { - this.recurringDepositProductSettingsForm.addControl('taxGroupId', new UntypedFormControl('', Validators.required)); - } else { - this.recurringDepositProductSettingsForm.removeControl('taxGroupId'); - } - }); + this.recurringDepositProductSettingsForm.get('withHoldTax').valueChanges.subscribe((withHoldTax: any) => { + if (withHoldTax) { + this.recurringDepositProductSettingsForm.addControl( + 'taxGroupId', + new UntypedFormControl('', Validators.required) + ); + } else { + this.recurringDepositProductSettingsForm.removeControl('taxGroupId'); + } + }); } get recurringDepositProductSettings() { @@ -95,5 +114,4 @@ export class RecurringDepositProductSettingsStepComponent implements OnInit { } return recurringDepositProductSettings; } - } diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component.spec.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component.spec.ts index 53646e792..e29dc28b2 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component.spec.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositProductTermsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositProductTermsStepComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositProductTermsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component.ts index 13d3db828..705895d52 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component.ts @@ -7,7 +7,6 @@ import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms styleUrls: ['./recurring-deposit-product-terms-step.component.scss'] }) export class RecurringDepositProductTermsStepComponent implements OnInit { - @Input() recurringDepositProductsTemplate: any; recurringDepositProductTermsForm: UntypedFormGroup; @@ -25,31 +24,47 @@ export class RecurringDepositProductTermsStepComponent implements OnInit { this.interestCompoundingPeriodTypeData = this.recurringDepositProductsTemplate.interestCompoundingPeriodTypeOptions; this.interestPostingPeriodTypeData = this.recurringDepositProductsTemplate.interestPostingPeriodTypeOptions; this.interestCalculationTypeData = this.recurringDepositProductsTemplate.interestCalculationTypeOptions; - this.interestCalculationDaysInYearTypeData = this.recurringDepositProductsTemplate.interestCalculationDaysInYearTypeOptions; + this.interestCalculationDaysInYearTypeData = + this.recurringDepositProductsTemplate.interestCalculationDaysInYearTypeOptions; if (!(this.recurringDepositProductsTemplate === undefined) && this.recurringDepositProductsTemplate.id) { this.recurringDepositProductTermsForm.patchValue({ - 'minDepositAmount': this.recurringDepositProductsTemplate.minDepositAmount, - 'depositAmount': this.recurringDepositProductsTemplate.depositAmount, - 'maxDepositAmount': this.recurringDepositProductsTemplate.maxDepositAmount, + minDepositAmount: this.recurringDepositProductsTemplate.minDepositAmount, + depositAmount: this.recurringDepositProductsTemplate.depositAmount, + maxDepositAmount: this.recurringDepositProductsTemplate.maxDepositAmount }); } this.recurringDepositProductTermsForm.patchValue({ - 'interestCompoundingPeriodType': this.recurringDepositProductsTemplate.interestCompoundingPeriodType.id, - 'interestPostingPeriodType': this.recurringDepositProductsTemplate.interestPostingPeriodType.id, - 'interestCalculationType': this.recurringDepositProductsTemplate.interestCalculationType.id, - 'interestCalculationDaysInYearType': this.recurringDepositProductsTemplate.interestCalculationDaysInYearType.id + interestCompoundingPeriodType: this.recurringDepositProductsTemplate.interestCompoundingPeriodType.id, + interestPostingPeriodType: this.recurringDepositProductsTemplate.interestPostingPeriodType.id, + interestCalculationType: this.recurringDepositProductsTemplate.interestCalculationType.id, + interestCalculationDaysInYearType: this.recurringDepositProductsTemplate.interestCalculationDaysInYearType.id }); } createrecurringDepositProductTermsForm() { this.recurringDepositProductTermsForm = this.formBuilder.group({ - 'minDepositAmount': [''], - 'depositAmount': ['', Validators.required], - 'maxDepositAmount': [''], - 'interestCompoundingPeriodType': ['', Validators.required], - 'interestPostingPeriodType': ['', Validators.required], - 'interestCalculationType': ['', Validators.required], - 'interestCalculationDaysInYearType': ['', Validators.required] + minDepositAmount: [''], + depositAmount: [ + '', + Validators.required + ], + maxDepositAmount: [''], + interestCompoundingPeriodType: [ + '', + Validators.required + ], + interestPostingPeriodType: [ + '', + Validators.required + ], + interestCalculationType: [ + '', + Validators.required + ], + interestCalculationDaysInYearType: [ + '', + Validators.required + ] }); } @@ -62,5 +77,4 @@ export class RecurringDepositProductTermsStepComponent implements OnInit { } return recurringDepositProductTerms; } - } diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product.resolver.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product.resolver.ts index 0fd98693a..d29f9142e 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-product.resolver.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-product.resolver.ts @@ -13,11 +13,10 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class RecurringDepositProductResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ - constructor(private productsService: ProductsService) { } + constructor(private productsService: ProductsService) {} /** * Returns the recurring deposit product data. @@ -27,5 +26,4 @@ export class RecurringDepositProductResolver implements Resolve { const productId = route.parent.paramMap.get('productId'); return this.productsService.getRecurringDepositProduct(productId); } - } diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-products-template.resolver.ts b/src/app/products/recurring-deposit-products/recurring-deposit-products-template.resolver.ts index f11f9b10a..8fa7f98c3 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-products-template.resolver.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-products-template.resolver.ts @@ -10,8 +10,7 @@ import { ProductsService } from '../products.service'; @Injectable() export class RecurringDepositProductsTemplateResolver implements Resolve { - - constructor(private productsService: ProductsService) { } + constructor(private productsService: ProductsService) {} /** * Returns the recurring deposit products template data. @@ -20,5 +19,4 @@ export class RecurringDepositProductsTemplateResolver implements Resolve resolve(): Observable { return this.productsService.getRecurringDepositProductsTemplate(); } - } diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-products.component.spec.ts b/src/app/products/recurring-deposit-products/recurring-deposit-products.component.spec.ts index 6cb3ceae4..f856da36b 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-products.component.spec.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-products.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositProductsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RecurringDepositProductsComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositProductsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-products.component.ts b/src/app/products/recurring-deposit-products/recurring-deposit-products.component.ts index 88a60cca8..f21f00e54 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-products.component.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-products.component.ts @@ -25,11 +25,13 @@ import { NextStepDialogComponent } from '../../configuration-wizard/next-step-di styleUrls: ['./recurring-deposit-products.component.scss'] }) export class RecurringDepositProductsComponent implements OnInit, AfterViewInit { - /** Data table data. */ recurringDepositProductData: any; /** Columns to be displayed in recurring deposit products table. */ - displayedColumns: string[] = ['name', 'shortName']; + displayedColumns: string[] = [ + 'name', + 'shortName' + ]; /** Data source for recurring deposit products table. */ dataSource: MatTableDataSource; @@ -54,12 +56,14 @@ export class RecurringDepositProductsComponent implements OnInit, AfterViewInit * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private route: ActivatedRoute, - private router: Router, - private dialog: MatDialog, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { - this.route.data.subscribe(( data: { recurringDepositProducts: any }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private dialog: MatDialog, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { + this.route.data.subscribe((data: { recurringDepositProducts: any }) => { this.recurringDepositProductData = data.recurringDepositProducts; }); } @@ -94,7 +98,12 @@ export class RecurringDepositProductsComponent implements OnInit, AfterViewInit ngAfterViewInit() { if (this.configurationWizardService.showRecurringDepositProductsPage === true) { setTimeout(() => { - this.showPopover(this.templateButtonCreateRecurringProduct, this.buttonCreateRecurringProduct.nativeElement, 'bottom', true); + this.showPopover( + this.templateButtonCreateRecurringProduct, + this.buttonCreateRecurringProduct.nativeElement, + 'bottom', + true + ); }); } @@ -112,7 +121,12 @@ export class RecurringDepositProductsComponent implements OnInit, AfterViewInit * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -139,23 +153,23 @@ export class RecurringDepositProductsComponent implements OnInit, AfterViewInit * Next Step (Setup Funds and Manage Reports) Dialog Configuration Wizard. */ openNextStepDialog() { - const nextStepDialogRef = this.dialog.open( NextStepDialogComponent, { + const nextStepDialogRef = this.dialog.open(NextStepDialogComponent, { data: { nextStepName: 'Setup Funds and Manage Reports', previousStepName: 'Products', stepPercentage: 94 - }, + } }); nextStepDialogRef.afterClosed().subscribe((response: { nextStep: boolean }) => { - if (response.nextStep) { - this.configurationWizardService.showRecurringDepositProductsPage = false; - this.configurationWizardService.showRecurringDepositProductsList = false; - this.configurationWizardService.showManageFunds = true; - this.router.navigate(['/organization']); + if (response.nextStep) { + this.configurationWizardService.showRecurringDepositProductsPage = false; + this.configurationWizardService.showRecurringDepositProductsList = false; + this.configurationWizardService.showManageFunds = true; + this.router.navigate(['/organization']); } else { - this.configurationWizardService.showRecurringDepositProductsPage = false; - this.configurationWizardService.showRecurringDepositProductsList = false; - this.router.navigate(['/home']); + this.configurationWizardService.showRecurringDepositProductsPage = false; + this.configurationWizardService.showRecurringDepositProductsList = false; + this.router.navigate(['/home']); } }); } diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-products.resolver.ts b/src/app/products/recurring-deposit-products/recurring-deposit-products.resolver.ts index 8284adf83..738663771 100644 --- a/src/app/products/recurring-deposit-products/recurring-deposit-products.resolver.ts +++ b/src/app/products/recurring-deposit-products/recurring-deposit-products.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class RecurringDepositProductsResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -26,5 +25,4 @@ export class RecurringDepositProductsResolver implements Resolve { resolve(): Observable { return this.productsService.getRecurringDepositProducts(); } - } diff --git a/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-datatable-tab/recurring-deposit-datatable-tab.component.spec.ts b/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-datatable-tab/recurring-deposit-datatable-tab.component.spec.ts index 134d52a52..4e283b858 100644 --- a/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-datatable-tab/recurring-deposit-datatable-tab.component.spec.ts +++ b/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-datatable-tab/recurring-deposit-datatable-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositDatatableTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ RecurringDepositDatatableTabComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositDatatableTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-datatable-tab/recurring-deposit-datatable-tab.component.ts b/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-datatable-tab/recurring-deposit-datatable-tab.component.ts index f8195089b..5020799b4 100644 --- a/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-datatable-tab/recurring-deposit-datatable-tab.component.ts +++ b/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-datatable-tab/recurring-deposit-datatable-tab.component.ts @@ -7,7 +7,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./recurring-deposit-datatable-tab.component.scss'] }) export class RecurringDepositDatatableTabComponent { - entityId: string; entityDatatable: any; multiRowDatatableFlag: boolean; @@ -20,5 +19,4 @@ export class RecurringDepositDatatableTabComponent { this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); } - } diff --git a/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-general-tab/recurring-deposit-general-tab.component.spec.ts b/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-general-tab/recurring-deposit-general-tab.component.spec.ts index 8e934965e..27efa4516 100644 --- a/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-general-tab/recurring-deposit-general-tab.component.spec.ts +++ b/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-general-tab/recurring-deposit-general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('RecurringDepositGeneralTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ RecurringDepositGeneralTabComponent ] - }) - .compileComponents(); + declarations: [RecurringDepositGeneralTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-general-tab/recurring-deposit-general-tab.component.ts b/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-general-tab/recurring-deposit-general-tab.component.ts index f3432807b..3a4c61527 100644 --- a/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-general-tab/recurring-deposit-general-tab.component.ts +++ b/src/app/products/recurring-deposit-products/view-recurring-deposit-product/recurring-deposit-general-tab/recurring-deposit-general-tab.component.ts @@ -8,29 +8,51 @@ import { trigger, state, transition, animate, style } from '@angular/animations' styleUrls: ['./recurring-deposit-general-tab.component.scss'], animations: [ trigger('expandChartSlab', [ - state('collapsed', style({height: '0px', minHeight: '0'})), - state('expanded', style({height: '*'})), - transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')) - ]) + state('collapsed', style({ height: '0px', minHeight: '0' })), + state('expanded', style({ height: '*' })), + transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)'))]) + ] }) export class RecurringDepositGeneralTabComponent { - recurringDepositProduct: any; recurringDepositProductTemplate: any; chartSlabsIncentivesDisplayedColumns: string[] = ['incentives']; - chartSlabsDisplayedColumns: string[] = ['period', 'amountRange', 'annualInterestRate', 'description', 'actions']; - incentivesDisplayedColumns: string[] = ['entityType', 'attributeName', 'conditionType', 'attributeValue', 'incentiveType', 'amount']; - chargesDisplayedColumns: string[] = ['name', 'type', 'amount', 'collectedon']; - paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId']; - feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId']; + chartSlabsDisplayedColumns: string[] = [ + 'period', + 'amountRange', + 'annualInterestRate', + 'description', + 'actions' + ]; + incentivesDisplayedColumns: string[] = [ + 'entityType', + 'attributeName', + 'conditionType', + 'attributeValue', + 'incentiveType', + 'amount' + ]; + chargesDisplayedColumns: string[] = [ + 'name', + 'type', + 'amount', + 'collectedon' + ]; + paymentFundSourceDisplayedColumns: string[] = [ + 'paymentTypeId', + 'fundSourceAccountId' + ]; + feesPenaltyIncomeDisplayedColumns: string[] = [ + 'chargeId', + 'incomeAccountId' + ]; constructor(private route: ActivatedRoute) { - this.route.data.subscribe((data: { recurringDepositProduct: any, recurringDepositProductsTemplate: any}) => { + this.route.data.subscribe((data: { recurringDepositProduct: any; recurringDepositProductsTemplate: any }) => { this.recurringDepositProduct = data.recurringDepositProduct; this.recurringDepositProductTemplate = data.recurringDepositProductsTemplate; }); } - } diff --git a/src/app/products/recurring-deposit-products/view-recurring-deposit-product/view-recurring-deposit-product.component.spec.ts b/src/app/products/recurring-deposit-products/view-recurring-deposit-product/view-recurring-deposit-product.component.spec.ts index 48439e3ba..92213ee9d 100644 --- a/src/app/products/recurring-deposit-products/view-recurring-deposit-product/view-recurring-deposit-product.component.spec.ts +++ b/src/app/products/recurring-deposit-products/view-recurring-deposit-product/view-recurring-deposit-product.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewRecurringDepositProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewRecurringDepositProductComponent ] - }) - .compileComponents(); + declarations: [ViewRecurringDepositProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/recurring-deposit-products/view-recurring-deposit-product/view-recurring-deposit-product.component.ts b/src/app/products/recurring-deposit-products/view-recurring-deposit-product/view-recurring-deposit-product.component.ts index d1cc8bab1..376fbd2a9 100644 --- a/src/app/products/recurring-deposit-products/view-recurring-deposit-product/view-recurring-deposit-product.component.ts +++ b/src/app/products/recurring-deposit-products/view-recurring-deposit-product/view-recurring-deposit-product.component.ts @@ -7,7 +7,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-recurring-deposit-product.component.scss'] }) export class ViewRecurringDepositProductComponent { - recurringDepositDatatables: any = []; constructor(private route: ActivatedRoute) { @@ -20,5 +19,4 @@ export class ViewRecurringDepositProductComponent { }); }); } - } diff --git a/src/app/products/saving-products/create-saving-product/create-saving-product.component.spec.ts b/src/app/products/saving-products/create-saving-product/create-saving-product.component.spec.ts index ec15c3fcb..a43617a22 100644 --- a/src/app/products/saving-products/create-saving-product/create-saving-product.component.spec.ts +++ b/src/app/products/saving-products/create-saving-product/create-saving-product.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateSavingProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateSavingProductComponent ] - }) - .compileComponents(); + declarations: [CreateSavingProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/saving-products/create-saving-product/create-saving-product.component.ts b/src/app/products/saving-products/create-saving-product/create-saving-product.component.ts index 69ffcd248..95630df5c 100644 --- a/src/app/products/saving-products/create-saving-product/create-saving-product.component.ts +++ b/src/app/products/saving-products/create-saving-product/create-saving-product.component.ts @@ -21,13 +21,17 @@ import { Accounting } from 'app/core/utils/accounting'; styleUrls: ['./create-saving-product.component.scss'] }) export class CreateSavingProductComponent { - - @ViewChild(SavingProductDetailsStepComponent, { static: true }) savingProductDetailsStep: SavingProductDetailsStepComponent; - @ViewChild(SavingProductCurrencyStepComponent, { static: true }) savingProductCurrencyStep: SavingProductCurrencyStepComponent; + @ViewChild(SavingProductDetailsStepComponent, { static: true }) + savingProductDetailsStep: SavingProductDetailsStepComponent; + @ViewChild(SavingProductCurrencyStepComponent, { static: true }) + savingProductCurrencyStep: SavingProductCurrencyStepComponent; @ViewChild(SavingProductTermsStepComponent, { static: true }) savingProductTermsStep: SavingProductTermsStepComponent; - @ViewChild(SavingProductSettingsStepComponent, { static: true }) savingProductSettingsStep: SavingProductSettingsStepComponent; - @ViewChild(SavingProductChargesStepComponent, { static: true }) savingProductChargesStep: SavingProductChargesStepComponent; - @ViewChild(SavingProductAccountingStepComponent, { static: true }) savingProductAccountingStep: SavingProductAccountingStepComponent; + @ViewChild(SavingProductSettingsStepComponent, { static: true }) + savingProductSettingsStep: SavingProductSettingsStepComponent; + @ViewChild(SavingProductChargesStepComponent, { static: true }) + savingProductChargesStep: SavingProductChargesStepComponent; + @ViewChild(SavingProductAccountingStepComponent, { static: true }) + savingProductAccountingStep: SavingProductAccountingStepComponent; savingProductsTemplate: any; accountingRuleData: string[] = []; @@ -39,11 +43,13 @@ export class CreateSavingProductComponent { * @param {SettingsService} settingsService Settings Service. */ - constructor(private route: ActivatedRoute, - private productsService: ProductsService, - private router: Router, - private settingsService: SettingsService, - private accounting: Accounting) { + constructor( + private route: ActivatedRoute, + private productsService: ProductsService, + private router: Router, + private settingsService: SettingsService, + private accounting: Accounting + ) { this.route.data.subscribe((data: { savingProductsTemplate: any }) => { this.savingProductsTemplate = data.savingProductsTemplate; }); @@ -99,10 +105,14 @@ export class CreateSavingProductComponent { locale: this.settingsService.language.code // locale required for nominalAnnualInterestRate }; delete savingProduct.advancedAccountingRules; - this.productsService.createSavingProduct(savingProduct) - .subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); - }); + this.productsService.createSavingProduct(savingProduct).subscribe((response: any) => { + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); + }); } - } diff --git a/src/app/products/saving-products/edit-saving-product/edit-saving-product.component.spec.ts b/src/app/products/saving-products/edit-saving-product/edit-saving-product.component.spec.ts index ac4bd781a..7b5ced136 100644 --- a/src/app/products/saving-products/edit-saving-product/edit-saving-product.component.spec.ts +++ b/src/app/products/saving-products/edit-saving-product/edit-saving-product.component.spec.ts @@ -8,9 +8,8 @@ describe('EditSavingProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditSavingProductComponent ] - }) - .compileComponents(); + declarations: [EditSavingProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/saving-products/edit-saving-product/edit-saving-product.component.ts b/src/app/products/saving-products/edit-saving-product/edit-saving-product.component.ts index 99a6796b4..547130d58 100644 --- a/src/app/products/saving-products/edit-saving-product/edit-saving-product.component.ts +++ b/src/app/products/saving-products/edit-saving-product/edit-saving-product.component.ts @@ -15,20 +15,23 @@ import { ProductsService } from 'app/products/products.service'; import { SettingsService } from 'app/settings/settings.service'; import { Accounting } from 'app/core/utils/accounting'; - @Component({ selector: 'mifosx-edit-saving-product', templateUrl: './edit-saving-product.component.html', styleUrls: ['./edit-saving-product.component.scss'] }) export class EditSavingProductComponent { - - @ViewChild(SavingProductDetailsStepComponent, { static: true }) savingProductDetailsStep: SavingProductDetailsStepComponent; - @ViewChild(SavingProductCurrencyStepComponent, { static: true }) savingProductCurrencyStep: SavingProductCurrencyStepComponent; + @ViewChild(SavingProductDetailsStepComponent, { static: true }) + savingProductDetailsStep: SavingProductDetailsStepComponent; + @ViewChild(SavingProductCurrencyStepComponent, { static: true }) + savingProductCurrencyStep: SavingProductCurrencyStepComponent; @ViewChild(SavingProductTermsStepComponent, { static: true }) savingProductTermsStep: SavingProductTermsStepComponent; - @ViewChild(SavingProductSettingsStepComponent, { static: true }) savingProductSettingsStep: SavingProductSettingsStepComponent; - @ViewChild(SavingProductChargesStepComponent, { static: true }) savingProductChargesStep: SavingProductChargesStepComponent; - @ViewChild(SavingProductAccountingStepComponent, { static: true }) savingProductAccountingStep: SavingProductAccountingStepComponent; + @ViewChild(SavingProductSettingsStepComponent, { static: true }) + savingProductSettingsStep: SavingProductSettingsStepComponent; + @ViewChild(SavingProductChargesStepComponent, { static: true }) + savingProductChargesStep: SavingProductChargesStepComponent; + @ViewChild(SavingProductAccountingStepComponent, { static: true }) + savingProductAccountingStep: SavingProductAccountingStepComponent; savingProductAndTemplate: any; accountingRuleData: string[] = []; @@ -40,11 +43,13 @@ export class EditSavingProductComponent { * @param {SettingsService} settingsService Settings Service. */ - constructor(private route: ActivatedRoute, - private productsService: ProductsService, - private router: Router, - private settingsService: SettingsService, - private accounting: Accounting) { + constructor( + private route: ActivatedRoute, + private productsService: ProductsService, + private router: Router, + private settingsService: SettingsService, + private accounting: Accounting + ) { this.route.data.subscribe((data: { savingProductAndTemplate: any }) => { this.savingProductAndTemplate = data.savingProductAndTemplate; }); @@ -78,14 +83,12 @@ export class EditSavingProductComponent { this.savingProductTermsForm.valid && this.savingProductSettingsForm.valid && this.savingProductAccountingForm.valid && - ( - !this.savingProductDetailsForm.pristine || + (!this.savingProductDetailsForm.pristine || !this.savingProductCurrencyForm.pristine || !this.savingProductTermsForm.pristine || !this.savingProductSettingsForm.pristine || !this.savingProductChargesStep.pristine || - !this.savingProductAccountingForm.pristine - ) + !this.savingProductAccountingForm.pristine) ); } @@ -108,10 +111,16 @@ export class EditSavingProductComponent { locale: this.settingsService.language.code // locale required for nominalAnnualInterestRate }; delete savingProduct.advancedAccountingRules; - this.productsService.updateSavingProduct(this.savingProductAndTemplate.id, savingProduct) + this.productsService + .updateSavingProduct(this.savingProductAndTemplate.id, savingProduct) .subscribe((response: any) => { - this.router.navigate(['../../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/products/saving-products/edit-saving-product/saving-product-and-template.resolver.ts b/src/app/products/saving-products/edit-saving-product/saving-product-and-template.resolver.ts index 2e132da6a..b874c01f0 100644 --- a/src/app/products/saving-products/edit-saving-product/saving-product-and-template.resolver.ts +++ b/src/app/products/saving-products/edit-saving-product/saving-product-and-template.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../../products.service'; */ @Injectable() export class SavingProductAndTemplateResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -27,5 +26,4 @@ export class SavingProductAndTemplateResolver implements Resolve { const productId = route.paramMap.get('productId'); return this.productsService.getSavingProduct(productId, true); } - } diff --git a/src/app/products/saving-products/saving-product-datatable.resolver.ts b/src/app/products/saving-products/saving-product-datatable.resolver.ts index fa1faa8ba..a42268281 100644 --- a/src/app/products/saving-products/saving-product-datatable.resolver.ts +++ b/src/app/products/saving-products/saving-product-datatable.resolver.ts @@ -7,11 +7,10 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class SavingProductDatatableResolver implements Resolve { - /** * @param {SystemService} systemService Products service. */ - constructor(private systemService: SystemService) { } + constructor(private systemService: SystemService) {} /** * Returns the loan product data. @@ -22,5 +21,4 @@ export class SavingProductDatatableResolver implements Resolve { const datatableName = route.paramMap.get('datatableName'); return this.systemService.getEntityDatatable(productId, datatableName); } - } diff --git a/src/app/products/saving-products/saving-product-datatables.resolver.ts b/src/app/products/saving-products/saving-product-datatables.resolver.ts index 9af38bcd9..961a1b547 100644 --- a/src/app/products/saving-products/saving-product-datatables.resolver.ts +++ b/src/app/products/saving-products/saving-product-datatables.resolver.ts @@ -1,9 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Router, Resolve, - RouterStateSnapshot, - ActivatedRouteSnapshot -} from '@angular/router'; +import { Router, Resolve, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router'; import { SystemService } from 'app/system/system.service'; import { Observable, of } from 'rxjs'; @@ -11,11 +7,10 @@ import { Observable, of } from 'rxjs'; providedIn: 'root' }) export class SavingProductDatatablesResolver implements Resolve { - /** * @param {SystemService} systemService Products service. */ - constructor(private systemService: SystemService) { } + constructor(private systemService: SystemService) {} /** * Returns the loan product data. diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-accounting-step/saving-product-accounting-step.component.spec.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-accounting-step/saving-product-accounting-step.component.spec.ts index a66239f20..90447a8cc 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-accounting-step/saving-product-accounting-step.component.spec.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-accounting-step/saving-product-accounting-step.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingProductAccountingStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingProductAccountingStepComponent ] - }) - .compileComponents(); + declarations: [SavingProductAccountingStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-accounting-step/saving-product-accounting-step.component.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-accounting-step/saving-product-accounting-step.component.ts index 8a0d9b5d2..17010c77f 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-accounting-step/saving-product-accounting-step.component.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-accounting-step/saving-product-accounting-step.component.ts @@ -15,7 +15,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./saving-product-accounting-step.component.scss'] }) export class SavingProductAccountingStepComponent implements OnInit { - @Input() savingProductsTemplate: any; @Input() accountingRuleData: any; @Input() isDormancyTrackingActive: UntypedFormControl; @@ -33,12 +32,22 @@ export class SavingProductAccountingStepComponent implements OnInit { incomeAndLiabilityAccountData: any; combinedAccountData: any[]; - paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId', 'actions']; - feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId', 'actions']; + paymentFundSourceDisplayedColumns: string[] = [ + 'paymentTypeId', + 'fundSourceAccountId', + 'actions' + ]; + feesPenaltyIncomeDisplayedColumns: string[] = [ + 'chargeId', + 'incomeAccountId', + 'actions' + ]; - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private dialog: MatDialog, - private translateService: TranslateService) { + private translateService: TranslateService + ) { this.createsavingProductAccountingForm(); this.setConditionalControls(); } @@ -70,118 +79,185 @@ export class SavingProductAccountingStepComponent implements OnInit { }); this.savingProductAccountingForm.patchValue({ - 'accountingRule': this.savingProductsTemplate.accountingRule.id + accountingRule: this.savingProductsTemplate.accountingRule.id }); if (this.isCashOrAccrualAccounting()) { this.savingProductAccountingForm.patchValue({ - 'savingsReferenceAccountId': this.savingProductsTemplate.accountingMappings.savingsReferenceAccount.id, - 'overdraftPortfolioControlId': this.savingProductsTemplate.accountingMappings.overdraftPortfolioControl.id, - 'savingsControlAccountId': this.savingProductsTemplate.accountingMappings.savingsControlAccount.id, - 'transfersInSuspenseAccountId': this.savingProductsTemplate.accountingMappings.transfersInSuspenseAccount.id, - 'interestOnSavingsAccountId': this.savingProductsTemplate.accountingMappings.interestOnSavingsAccount.id, - 'writeOffAccountId': this.savingProductsTemplate.accountingMappings.writeOffAccount.id, - 'incomeFromFeeAccountId': this.savingProductsTemplate.accountingMappings.incomeFromFeeAccount.id, - 'incomeFromPenaltyAccountId': this.savingProductsTemplate.accountingMappings.incomeFromPenaltyAccount.id, - 'incomeFromInterestId': this.savingProductsTemplate.accountingMappings.incomeFromInterest.id, - 'advancedAccountingRules': (this.savingProductsTemplate.paymentChannelToFundSourceMappings || this.savingProductsTemplate.feeToIncomeAccountMappings - || this.savingProductsTemplate.penaltyToIncomeAccountMappings || this.savingProductsTemplate.accrualCharges) ? true : false + savingsReferenceAccountId: this.savingProductsTemplate.accountingMappings.savingsReferenceAccount.id, + overdraftPortfolioControlId: this.savingProductsTemplate.accountingMappings.overdraftPortfolioControl.id, + savingsControlAccountId: this.savingProductsTemplate.accountingMappings.savingsControlAccount.id, + transfersInSuspenseAccountId: this.savingProductsTemplate.accountingMappings.transfersInSuspenseAccount.id, + interestOnSavingsAccountId: this.savingProductsTemplate.accountingMappings.interestOnSavingsAccount.id, + writeOffAccountId: this.savingProductsTemplate.accountingMappings.writeOffAccount.id, + incomeFromFeeAccountId: this.savingProductsTemplate.accountingMappings.incomeFromFeeAccount.id, + incomeFromPenaltyAccountId: this.savingProductsTemplate.accountingMappings.incomeFromPenaltyAccount.id, + incomeFromInterestId: this.savingProductsTemplate.accountingMappings.incomeFromInterest.id, + advancedAccountingRules: + this.savingProductsTemplate.paymentChannelToFundSourceMappings || + this.savingProductsTemplate.feeToIncomeAccountMappings || + this.savingProductsTemplate.penaltyToIncomeAccountMappings || + this.savingProductsTemplate.accrualCharges + ? true + : false }); if (this.isAccrualAccounting()) { this.savingProductAccountingForm.patchValue({ - 'feesReceivableAccountId': this.savingProductsTemplate.accountingMappings.feeReceivableAccount.id, - 'penaltiesReceivableAccountId': this.savingProductsTemplate.accountingMappings.penaltyReceivableAccount.id, - 'interestPayableAccountId': this.savingProductsTemplate.accountingMappings.interestPayableAccount.id + feesReceivableAccountId: this.savingProductsTemplate.accountingMappings.feeReceivableAccount.id, + penaltiesReceivableAccountId: this.savingProductsTemplate.accountingMappings.penaltyReceivableAccount.id, + interestPayableAccountId: this.savingProductsTemplate.accountingMappings.interestPayableAccount.id }); } if (this.isDormancyTrackingActive.value) { this.savingProductAccountingForm.patchValue({ - 'escheatLiabilityId': this.savingProductsTemplate.accountingMappings.escheatLiabilityAccount.id, + escheatLiabilityId: this.savingProductsTemplate.accountingMappings.escheatLiabilityAccount.id }); } - this.savingProductAccountingForm.setControl('paymentChannelToFundSourceMappings', - this.formBuilder.array((this.savingProductsTemplate.paymentChannelToFundSourceMappings || []).map((paymentFundSource: any) => - ({ paymentTypeId: paymentFundSource.paymentType.id, fundSourceAccountId: paymentFundSource.fundSourceAccount.id })))); - this.savingProductAccountingForm.setControl('feeToIncomeAccountMappings', - this.formBuilder.array((this.savingProductsTemplate.feeToIncomeAccountMappings || []).map((feesIncome: any) => - ({ chargeId: feesIncome.charge.id, incomeAccountId: feesIncome.incomeAccount.id })))); - this.savingProductAccountingForm.setControl('penaltyToIncomeAccountMappings', - this.formBuilder.array((this.savingProductsTemplate.penaltyToIncomeAccountMappings || []).map((penaltyIncome: any) => - ({ chargeId: penaltyIncome.charge.id, incomeAccountId: penaltyIncome.incomeAccount.id })))); + this.savingProductAccountingForm.setControl( + 'paymentChannelToFundSourceMappings', + this.formBuilder.array( + (this.savingProductsTemplate.paymentChannelToFundSourceMappings || []).map((paymentFundSource: any) => ({ + paymentTypeId: paymentFundSource.paymentType.id, + fundSourceAccountId: paymentFundSource.fundSourceAccount.id + })) + ) + ); + this.savingProductAccountingForm.setControl( + 'feeToIncomeAccountMappings', + this.formBuilder.array( + (this.savingProductsTemplate.feeToIncomeAccountMappings || []).map((feesIncome: any) => ({ + chargeId: feesIncome.charge.id, + incomeAccountId: feesIncome.incomeAccount.id + })) + ) + ); + this.savingProductAccountingForm.setControl( + 'penaltyToIncomeAccountMappings', + this.formBuilder.array( + (this.savingProductsTemplate.penaltyToIncomeAccountMappings || []).map((penaltyIncome: any) => ({ + chargeId: penaltyIncome.charge.id, + incomeAccountId: penaltyIncome.incomeAccount.id + })) + ) + ); } } createsavingProductAccountingForm() { this.savingProductAccountingForm = this.formBuilder.group({ - 'accountingRule': [1] + accountingRule: [1] }); } setConditionalControls() { - this.savingProductAccountingForm.get('accountingRule').valueChanges - .subscribe((accountingRule: any) => { - if (accountingRule === 2 || accountingRule === 3) { - this.savingProductAccountingForm.addControl('savingsReferenceAccountId', new UntypedFormControl('', Validators.required)); - this.savingProductAccountingForm.addControl('overdraftPortfolioControlId', new UntypedFormControl('', Validators.required)); - this.savingProductAccountingForm.addControl('savingsControlAccountId', new UntypedFormControl('', Validators.required)); - this.savingProductAccountingForm.addControl('transfersInSuspenseAccountId', new UntypedFormControl('', Validators.required)); - this.savingProductAccountingForm.addControl('interestOnSavingsAccountId', new UntypedFormControl('', Validators.required)); - this.savingProductAccountingForm.addControl('writeOffAccountId', new UntypedFormControl('', Validators.required)); - this.savingProductAccountingForm.addControl('incomeFromFeeAccountId', new UntypedFormControl('', Validators.required)); - this.savingProductAccountingForm.addControl('incomeFromPenaltyAccountId', new UntypedFormControl('', Validators.required)); - this.savingProductAccountingForm.addControl('incomeFromInterestId', new UntypedFormControl('', Validators.required)); - this.savingProductAccountingForm.addControl('advancedAccountingRules', new UntypedFormControl(false)); + this.savingProductAccountingForm.get('accountingRule').valueChanges.subscribe((accountingRule: any) => { + if (accountingRule === 2 || accountingRule === 3) { + this.savingProductAccountingForm.addControl( + 'savingsReferenceAccountId', + new UntypedFormControl('', Validators.required) + ); + this.savingProductAccountingForm.addControl( + 'overdraftPortfolioControlId', + new UntypedFormControl('', Validators.required) + ); + this.savingProductAccountingForm.addControl( + 'savingsControlAccountId', + new UntypedFormControl('', Validators.required) + ); + this.savingProductAccountingForm.addControl( + 'transfersInSuspenseAccountId', + new UntypedFormControl('', Validators.required) + ); + this.savingProductAccountingForm.addControl( + 'interestOnSavingsAccountId', + new UntypedFormControl('', Validators.required) + ); + this.savingProductAccountingForm.addControl( + 'writeOffAccountId', + new UntypedFormControl('', Validators.required) + ); + this.savingProductAccountingForm.addControl( + 'incomeFromFeeAccountId', + new UntypedFormControl('', Validators.required) + ); + this.savingProductAccountingForm.addControl( + 'incomeFromPenaltyAccountId', + new UntypedFormControl('', Validators.required) + ); + this.savingProductAccountingForm.addControl( + 'incomeFromInterestId', + new UntypedFormControl('', Validators.required) + ); + this.savingProductAccountingForm.addControl('advancedAccountingRules', new UntypedFormControl(false)); - if (accountingRule === 3) { - this.savingProductAccountingForm.addControl('feesReceivableAccountId', new UntypedFormControl('', Validators.required)); - this.savingProductAccountingForm.addControl('penaltiesReceivableAccountId', new UntypedFormControl('', Validators.required)); - this.savingProductAccountingForm.addControl('interestPayableAccountId', new UntypedFormControl('', Validators.required)); - } - - if (this.isDormancyTrackingActive.value) { - this.savingProductAccountingForm.addControl('escheatLiabilityId', new UntypedFormControl('', Validators.required)); - } - - this.isDormancyTrackingActive.valueChanges - .subscribe((isDormancyTrackingActive: boolean) => { - if (isDormancyTrackingActive) { - this.savingProductAccountingForm.addControl('escheatLiabilityId', new UntypedFormControl('', Validators.required)); - } else { - this.savingProductAccountingForm.removeControl('escheatLiabilityId'); - } - }); - - this.savingProductAccountingForm.get('advancedAccountingRules').valueChanges - .subscribe((advancedAccountingRules: boolean) => { - if (advancedAccountingRules) { - this.savingProductAccountingForm.addControl('paymentChannelToFundSourceMappings', this.formBuilder.array([])); - this.savingProductAccountingForm.addControl('feeToIncomeAccountMappings', this.formBuilder.array([])); - this.savingProductAccountingForm.addControl('penaltyToIncomeAccountMappings', this.formBuilder.array([])); - } else { - this.savingProductAccountingForm.removeControl('paymentChannelToFundSourceMappings'); - this.savingProductAccountingForm.removeControl('feeToIncomeAccountMappings'); - this.savingProductAccountingForm.removeControl('penaltyToIncomeAccountMappings'); - } - }); - } else { - this.savingProductAccountingForm.removeControl('savingsReferenceAccountId'); - this.savingProductAccountingForm.removeControl('overdraftPortfolioControlId'); - this.savingProductAccountingForm.removeControl('savingsControlAccountId'); - this.savingProductAccountingForm.removeControl('transfersInSuspenseAccountId'); - this.savingProductAccountingForm.removeControl('interestOnSavingsAccountId'); - this.savingProductAccountingForm.removeControl('writeOffAccountId'); - this.savingProductAccountingForm.removeControl('incomeFromFeeAccountId'); - this.savingProductAccountingForm.removeControl('incomeFromPenaltyAccountId'); - this.savingProductAccountingForm.removeControl('incomeFromInterestId'); - this.savingProductAccountingForm.removeControl('advancedAccountingRules'); - this.savingProductAccountingForm.removeControl('escheatLiabilityId'); - this.savingProductAccountingForm.removeControl('feesReceivableAccountId'); - this.savingProductAccountingForm.removeControl('penaltiesReceivableAccountId'); - this.savingProductAccountingForm.removeControl('interestPayableAccountId'); + if (accountingRule === 3) { + this.savingProductAccountingForm.addControl( + 'feesReceivableAccountId', + new UntypedFormControl('', Validators.required) + ); + this.savingProductAccountingForm.addControl( + 'penaltiesReceivableAccountId', + new UntypedFormControl('', Validators.required) + ); + this.savingProductAccountingForm.addControl( + 'interestPayableAccountId', + new UntypedFormControl('', Validators.required) + ); } - }); + + if (this.isDormancyTrackingActive.value) { + this.savingProductAccountingForm.addControl( + 'escheatLiabilityId', + new UntypedFormControl('', Validators.required) + ); + } + + this.isDormancyTrackingActive.valueChanges.subscribe((isDormancyTrackingActive: boolean) => { + if (isDormancyTrackingActive) { + this.savingProductAccountingForm.addControl( + 'escheatLiabilityId', + new UntypedFormControl('', Validators.required) + ); + } else { + this.savingProductAccountingForm.removeControl('escheatLiabilityId'); + } + }); + + this.savingProductAccountingForm + .get('advancedAccountingRules') + .valueChanges.subscribe((advancedAccountingRules: boolean) => { + if (advancedAccountingRules) { + this.savingProductAccountingForm.addControl( + 'paymentChannelToFundSourceMappings', + this.formBuilder.array([]) + ); + this.savingProductAccountingForm.addControl('feeToIncomeAccountMappings', this.formBuilder.array([])); + this.savingProductAccountingForm.addControl('penaltyToIncomeAccountMappings', this.formBuilder.array([])); + } else { + this.savingProductAccountingForm.removeControl('paymentChannelToFundSourceMappings'); + this.savingProductAccountingForm.removeControl('feeToIncomeAccountMappings'); + this.savingProductAccountingForm.removeControl('penaltyToIncomeAccountMappings'); + } + }); + } else { + this.savingProductAccountingForm.removeControl('savingsReferenceAccountId'); + this.savingProductAccountingForm.removeControl('overdraftPortfolioControlId'); + this.savingProductAccountingForm.removeControl('savingsControlAccountId'); + this.savingProductAccountingForm.removeControl('transfersInSuspenseAccountId'); + this.savingProductAccountingForm.removeControl('interestOnSavingsAccountId'); + this.savingProductAccountingForm.removeControl('writeOffAccountId'); + this.savingProductAccountingForm.removeControl('incomeFromFeeAccountId'); + this.savingProductAccountingForm.removeControl('incomeFromPenaltyAccountId'); + this.savingProductAccountingForm.removeControl('incomeFromInterestId'); + this.savingProductAccountingForm.removeControl('advancedAccountingRules'); + this.savingProductAccountingForm.removeControl('escheatLiabilityId'); + this.savingProductAccountingForm.removeControl('feesReceivableAccountId'); + this.savingProductAccountingForm.removeControl('penaltiesReceivableAccountId'); + this.savingProductAccountingForm.removeControl('interestPayableAccountId'); + } + }); } get paymentChannelToFundSourceMappings(): UntypedFormArray { @@ -203,7 +279,7 @@ export class SavingProductAccountingStepComponent implements OnInit { } existCharges(): boolean { - return (this.chargeData.length > 0); + return this.chargeData.length > 0; } add(formType: string, formArray: UntypedFormArray) { @@ -242,12 +318,21 @@ export class SavingProductAccountingStepComponent implements OnInit { getData(formType: string, values?: any) { switch (formType) { - case 'PaymentFundSource': return { title: this.translateService.instant('labels.heading.Configure Fund Sources for Payment Channels'), - formfields: this.getPaymentFundSourceFormfields(values) }; - case 'FeesIncome': return { title: this.translateService.instant('labels.heading.Map Fees to Specific Income Accounts'), - formfields: this.getFeesIncomeFormfields(values) }; - case 'PenaltyIncome': return { title: this.translateService.instant('labels.heading.Map Penalties to Specific Income Accounts'), - formfields: this.getPenaltyIncomeFormfields(values) }; + case 'PaymentFundSource': + return { + title: this.translateService.instant('labels.heading.Configure Fund Sources for Payment Channels'), + formfields: this.getPaymentFundSourceFormfields(values) + }; + case 'FeesIncome': + return { + title: this.translateService.instant('labels.heading.Map Fees to Specific Income Accounts'), + formfields: this.getFeesIncomeFormfields(values) + }; + case 'PenaltyIncome': + return { + title: this.translateService.instant('labels.heading.Map Penalties to Specific Income Accounts'), + formfields: this.getPenaltyIncomeFormfields(values) + }; } } @@ -269,6 +354,7 @@ export class SavingProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -291,6 +377,7 @@ export class SavingProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -313,6 +400,7 @@ export class SavingProductAccountingStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -322,12 +410,13 @@ export class SavingProductAccountingStepComponent implements OnInit { } isCashOrAccrualAccounting(): boolean { - return ((this.savingProductAccountingForm.value.accountingRule === 2) || - (this.savingProductAccountingForm.value.accountingRule === 3)); + return ( + this.savingProductAccountingForm.value.accountingRule === 2 || + this.savingProductAccountingForm.value.accountingRule === 3 + ); } isAccrualAccounting(): boolean { - return (this.savingProductAccountingForm.value.accountingRule === 3); + return this.savingProductAccountingForm.value.accountingRule === 3; } - } diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-charges-step/saving-product-charges-step.component.spec.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-charges-step/saving-product-charges-step.component.spec.ts index 6df886f77..597257b59 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-charges-step/saving-product-charges-step.component.spec.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-charges-step/saving-product-charges-step.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingProductChargesStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingProductChargesStepComponent ] - }) - .compileComponents(); + declarations: [SavingProductChargesStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-charges-step/saving-product-charges-step.component.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-charges-step/saving-product-charges-step.component.ts index 4b3291c5b..9c3b2d1bd 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-charges-step/saving-product-charges-step.component.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-charges-step/saving-product-charges-step.component.ts @@ -11,19 +11,26 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./saving-product-charges-step.component.scss'] }) export class SavingProductChargesStepComponent implements OnInit { - @Input() savingProductsTemplate: any; @Input() currencyCode: UntypedFormControl; chargeData: any; chargesDataSource: {}[]; - displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'action']; + displayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'action' + ]; pristine = true; - constructor(public dialog: MatDialog, private translateService: TranslateService) { - } + constructor( + public dialog: MatDialog, + private translateService: TranslateService + ) {} ngOnInit() { this.chargeData = this.savingProductsTemplate.chargeOptions; @@ -31,7 +38,7 @@ export class SavingProductChargesStepComponent implements OnInit { this.chargesDataSource = this.savingProductsTemplate.charges || []; this.pristine = true; - this.currencyCode.valueChanges.subscribe(() => this.chargesDataSource = []); + this.currencyCode.valueChanges.subscribe(() => (this.chargesDataSource = [])); } addCharge(charge: any) { @@ -58,5 +65,4 @@ export class SavingProductChargesStepComponent implements OnInit { charges: this.chargesDataSource }; } - } diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-currency-step/saving-product-currency-step.component.spec.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-currency-step/saving-product-currency-step.component.spec.ts index c6bffa51f..7932908fb 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-currency-step/saving-product-currency-step.component.spec.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-currency-step/saving-product-currency-step.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingProductCurrencyStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingProductCurrencyStepComponent ] - }) - .compileComponents(); + declarations: [SavingProductCurrencyStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-currency-step/saving-product-currency-step.component.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-currency-step/saving-product-currency-step.component.ts index ef714b640..342b04164 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-currency-step/saving-product-currency-step.component.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-currency-step/saving-product-currency-step.component.ts @@ -8,7 +8,6 @@ import { TooltipPosition } from '@angular/material/tooltip'; styleUrls: ['./saving-product-currency-step.component.scss'] }) export class SavingProductCurrencyStepComponent implements OnInit { - @Input() savingProductsTemplate: any; savingProductCurrencyForm: UntypedFormGroup; @@ -23,22 +22,29 @@ export class SavingProductCurrencyStepComponent implements OnInit { this.currencyData = this.savingProductsTemplate.currencyOptions; this.savingProductCurrencyForm.patchValue({ - 'currencyCode': this.savingProductsTemplate.currency.code || this.currencyData[0].code, - 'digitsAfterDecimal': this.savingProductsTemplate.currency.code ? this.savingProductsTemplate.currency.decimalPlaces : 2, - 'inMultiplesOf': this.savingProductsTemplate.currency.inMultiplesOf || '' + currencyCode: this.savingProductsTemplate.currency.code || this.currencyData[0].code, + digitsAfterDecimal: this.savingProductsTemplate.currency.code + ? this.savingProductsTemplate.currency.decimalPlaces + : 2, + inMultiplesOf: this.savingProductsTemplate.currency.inMultiplesOf || '' }); } createSavingProductCurrencyForm() { this.savingProductCurrencyForm = this.formBuilder.group({ - 'currencyCode': ['', Validators.required], - 'digitsAfterDecimal': ['', Validators.required], - 'inMultiplesOf': [''] + currencyCode: [ + '', + Validators.required + ], + digitsAfterDecimal: [ + '', + Validators.required + ], + inMultiplesOf: [''] }); } get savingProductCurrency() { return this.savingProductCurrencyForm.value; } - } diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-details-step/saving-product-details-step.component.spec.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-details-step/saving-product-details-step.component.spec.ts index db50d1881..8b6f88df0 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-details-step/saving-product-details-step.component.spec.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-details-step/saving-product-details-step.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingProductDetailsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingProductDetailsStepComponent ] - }) - .compileComponents(); + declarations: [SavingProductDetailsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-details-step/saving-product-details-step.component.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-details-step/saving-product-details-step.component.ts index cc8c6c485..99423c97a 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-details-step/saving-product-details-step.component.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-details-step/saving-product-details-step.component.ts @@ -8,7 +8,6 @@ import { TooltipPosition } from '@angular/material/tooltip'; styleUrls: ['./saving-product-details-step.component.scss'] }) export class SavingProductDetailsStepComponent implements OnInit { - @Input() savingProductsTemplate: any; savingProductDetailsForm: UntypedFormGroup; @@ -20,23 +19,28 @@ export class SavingProductDetailsStepComponent implements OnInit { ngOnInit() { if (this.savingProductsTemplate) { this.savingProductDetailsForm.patchValue({ - 'name': this.savingProductsTemplate.name, - 'shortName': this.savingProductsTemplate.shortName, - 'description': this.savingProductsTemplate.description + name: this.savingProductsTemplate.name, + shortName: this.savingProductsTemplate.shortName, + description: this.savingProductsTemplate.description }); } } createSavingProductDetailsForm() { this.savingProductDetailsForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'shortName': ['', Validators.required], - 'description': [''] + name: [ + '', + Validators.required + ], + shortName: [ + '', + Validators.required + ], + description: [''] }); } get savingProductDetails() { return this.savingProductDetailsForm.value; } - } diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-preview-step/saving-product-preview-step.component.spec.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-preview-step/saving-product-preview-step.component.spec.ts index df6107a94..cae4ed2ce 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-preview-step/saving-product-preview-step.component.spec.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-preview-step/saving-product-preview-step.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingProductPreviewStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingProductPreviewStepComponent ] - }) - .compileComponents(); + declarations: [SavingProductPreviewStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-preview-step/saving-product-preview-step.component.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-preview-step/saving-product-preview-step.component.ts index 7ba8e7146..8279456ae 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-preview-step/saving-product-preview-step.component.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-preview-step/saving-product-preview-step.component.ts @@ -8,21 +8,31 @@ import { OptionData } from 'app/shared/models/option-data.model'; styleUrls: ['./saving-product-preview-step.component.scss'] }) export class SavingProductPreviewStepComponent implements OnInit, OnChanges { - @Input() savingProductsTemplate: any; @Input() accountingRuleData: any; @Input() savingProduct: any; @Input() taskPermission: string; @Output() submitEvent = new EventEmitter(); - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType']; - paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId']; - feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId']; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType' + ]; + paymentFundSourceDisplayedColumns: string[] = [ + 'paymentTypeId', + 'fundSourceAccountId' + ]; + feesPenaltyIncomeDisplayedColumns: string[] = [ + 'chargeId', + 'incomeAccountId' + ]; accountingMappings: any = {}; accountingRule: OptionData; - constructor(private accounting: Accounting) { } + constructor(private accounting: Accounting) {} ngOnInit() { this.setCurrentValues(); @@ -35,29 +45,58 @@ export class SavingProductPreviewStepComponent implements OnInit, OnChanges { setCurrentValues(): void { this.accountingRule = this.accounting.getAccountingRuleFrom(this.savingProduct.accountingRule); if (this.isCashOrAccrualAccounting()) { - const assetAccountData = this.savingProductsTemplate.accountingMappingOptions.assetAccountOptions || []; const incomeAccountData = this.savingProductsTemplate.accountingMappingOptions.incomeAccountOptions || []; const expenseAccountData = this.savingProductsTemplate.accountingMappingOptions.expenseAccountOptions || []; const liabilityAccountData = this.savingProductsTemplate.accountingMappingOptions.liabilityAccountOptions || []; this.accountingMappings = { - 'savingsReferenceAccount': this.accounting.glAccountLookUp(this.savingProduct.savingsReferenceAccountId, assetAccountData), - 'overdraftPortfolioControl': this.accounting.glAccountLookUp(this.savingProduct.overdraftPortfolioControlId, assetAccountData), - 'savingsControlAccount': this.accounting.glAccountLookUp(this.savingProduct.savingsControlAccountId, liabilityAccountData), - 'transfersInSuspenseAccount': this.accounting.glAccountLookUp(this.savingProduct.transfersInSuspenseAccountId, liabilityAccountData), - 'escheatLiability': this.accounting.glAccountLookUp(this.savingProduct.escheatLiabilityId, liabilityAccountData), - 'interestOnSavingsAccount': this.accounting.glAccountLookUp(this.savingProduct.interestOnSavingsAccountId, expenseAccountData), - 'writeOffAccount': this.accounting.glAccountLookUp(this.savingProduct.writeOffAccountId, expenseAccountData), - 'incomeFromFeeAccount': this.accounting.glAccountLookUp(this.savingProduct.incomeFromFeeAccountId, incomeAccountData), - 'incomeFromPenaltyAccount': this.accounting.glAccountLookUp(this.savingProduct.incomeFromPenaltyAccountId, incomeAccountData), - 'incomeFromInterest': this.accounting.glAccountLookUp(this.savingProduct.incomeFromInterestId, incomeAccountData) + savingsReferenceAccount: this.accounting.glAccountLookUp( + this.savingProduct.savingsReferenceAccountId, + assetAccountData + ), + overdraftPortfolioControl: this.accounting.glAccountLookUp( + this.savingProduct.overdraftPortfolioControlId, + assetAccountData + ), + savingsControlAccount: this.accounting.glAccountLookUp( + this.savingProduct.savingsControlAccountId, + liabilityAccountData + ), + transfersInSuspenseAccount: this.accounting.glAccountLookUp( + this.savingProduct.transfersInSuspenseAccountId, + liabilityAccountData + ), + escheatLiability: this.accounting.glAccountLookUp(this.savingProduct.escheatLiabilityId, liabilityAccountData), + interestOnSavingsAccount: this.accounting.glAccountLookUp( + this.savingProduct.interestOnSavingsAccountId, + expenseAccountData + ), + writeOffAccount: this.accounting.glAccountLookUp(this.savingProduct.writeOffAccountId, expenseAccountData), + incomeFromFeeAccount: this.accounting.glAccountLookUp( + this.savingProduct.incomeFromFeeAccountId, + incomeAccountData + ), + incomeFromPenaltyAccount: this.accounting.glAccountLookUp( + this.savingProduct.incomeFromPenaltyAccountId, + incomeAccountData + ), + incomeFromInterest: this.accounting.glAccountLookUp(this.savingProduct.incomeFromInterestId, incomeAccountData) }; if (this.isAccrualAccounting()) { - this.accountingMappings['feesReceivableAccount'] = this.accounting.glAccountLookUp(this.savingProduct.feesReceivableAccountId, assetAccountData); - this.accountingMappings['penaltiesReceivableAccount'] = this.accounting.glAccountLookUp(this.savingProduct.penaltiesReceivableAccountId, assetAccountData); - this.accountingMappings['interestPayableAccount'] = this.accounting.glAccountLookUp(this.savingProduct.interestPayableAccountId, liabilityAccountData); + this.accountingMappings['feesReceivableAccount'] = this.accounting.glAccountLookUp( + this.savingProduct.feesReceivableAccountId, + assetAccountData + ); + this.accountingMappings['penaltiesReceivableAccount'] = this.accounting.glAccountLookUp( + this.savingProduct.penaltiesReceivableAccountId, + assetAccountData + ); + this.accountingMappings['interestPayableAccount'] = this.accounting.glAccountLookUp( + this.savingProduct.interestPayableAccountId, + liabilityAccountData + ); } } } @@ -69,5 +108,4 @@ export class SavingProductPreviewStepComponent implements OnInit, OnChanges { isAccrualAccounting(): boolean { return this.accounting.isAccrualAccounting(this.savingProduct.accountingRule); } - } diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-settings-step/saving-product-settings-step.component.spec.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-settings-step/saving-product-settings-step.component.spec.ts index f0a0099b6..d375c374e 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-settings-step/saving-product-settings-step.component.spec.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-settings-step/saving-product-settings-step.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingProductSettingsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingProductSettingsStepComponent ] - }) - .compileComponents(); + declarations: [SavingProductSettingsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-settings-step/saving-product-settings-step.component.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-settings-step/saving-product-settings-step.component.ts index fd571aede..3cceaaa05 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-settings-step/saving-product-settings-step.component.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-settings-step/saving-product-settings-step.component.ts @@ -8,7 +8,6 @@ import { TooltipPosition } from '@angular/material/tooltip'; styleUrls: ['./saving-product-settings-step.component.scss'] }) export class SavingProductSettingsStepComponent implements OnInit { - @Input() savingProductsTemplate: any; savingProductSettingsForm: UntypedFormGroup; @@ -26,66 +25,67 @@ export class SavingProductSettingsStepComponent implements OnInit { this.taxGroupData = this.savingProductsTemplate.taxGroupOptions; this.savingProductSettingsForm.patchValue({ - 'minRequiredOpeningBalance': this.savingProductsTemplate.minRequiredOpeningBalance, - 'lockinPeriodFrequency': this.savingProductsTemplate.lockinPeriodFrequency, - 'lockinPeriodFrequencyType': this.savingProductsTemplate.lockinPeriodFrequencyType && this.savingProductsTemplate.lockinPeriodFrequencyType.id, - 'withdrawalFeeForTransfers': this.savingProductsTemplate.withdrawalFeeForTransfers, - 'minBalanceForInterestCalculation': this.savingProductsTemplate.minBalanceForInterestCalculation, - 'enforceMinRequiredBalance': this.savingProductsTemplate.enforceMinRequiredBalance, - 'minRequiredBalance': this.savingProductsTemplate.minRequiredBalance, - 'allowOverdraft': this.savingProductsTemplate.allowOverdraft, - 'minOverdraftForInterestCalculation': this.savingProductsTemplate.minOverdraftForInterestCalculation, - 'nominalAnnualInterestRateOverdraft': this.savingProductsTemplate.nominalAnnualInterestRateOverdraft, - 'overdraftLimit': this.savingProductsTemplate.overdraftLimit, - 'withHoldTax': this.savingProductsTemplate.withHoldTax, - 'taxGroupId': this.savingProductsTemplate.taxGroup && this.savingProductsTemplate.taxGroup.id, - 'isDormancyTrackingActive': this.savingProductsTemplate.isDormancyTrackingActive, - 'daysToInactive': this.savingProductsTemplate.daysToInactive, - 'daysToDormancy': this.savingProductsTemplate.daysToDormancy, - 'daysToEscheat': this.savingProductsTemplate.daysToEscheat + minRequiredOpeningBalance: this.savingProductsTemplate.minRequiredOpeningBalance, + lockinPeriodFrequency: this.savingProductsTemplate.lockinPeriodFrequency, + lockinPeriodFrequencyType: + this.savingProductsTemplate.lockinPeriodFrequencyType && + this.savingProductsTemplate.lockinPeriodFrequencyType.id, + withdrawalFeeForTransfers: this.savingProductsTemplate.withdrawalFeeForTransfers, + minBalanceForInterestCalculation: this.savingProductsTemplate.minBalanceForInterestCalculation, + enforceMinRequiredBalance: this.savingProductsTemplate.enforceMinRequiredBalance, + minRequiredBalance: this.savingProductsTemplate.minRequiredBalance, + allowOverdraft: this.savingProductsTemplate.allowOverdraft, + minOverdraftForInterestCalculation: this.savingProductsTemplate.minOverdraftForInterestCalculation, + nominalAnnualInterestRateOverdraft: this.savingProductsTemplate.nominalAnnualInterestRateOverdraft, + overdraftLimit: this.savingProductsTemplate.overdraftLimit, + withHoldTax: this.savingProductsTemplate.withHoldTax, + taxGroupId: this.savingProductsTemplate.taxGroup && this.savingProductsTemplate.taxGroup.id, + isDormancyTrackingActive: this.savingProductsTemplate.isDormancyTrackingActive, + daysToInactive: this.savingProductsTemplate.daysToInactive, + daysToDormancy: this.savingProductsTemplate.daysToDormancy, + daysToEscheat: this.savingProductsTemplate.daysToEscheat }); } createSavingProductSettingsForm() { this.savingProductSettingsForm = this.formBuilder.group({ - 'minRequiredOpeningBalance': [''], - 'lockinPeriodFrequency': [''], - 'lockinPeriodFrequencyType': [''], - 'withdrawalFeeForTransfers': [false], - 'minBalanceForInterestCalculation': [''], - 'enforceMinRequiredBalance': [false], - 'minRequiredBalance': [''], - 'allowOverdraft': [false], - 'withHoldTax': [false], - 'isDormancyTrackingActive': [false] + minRequiredOpeningBalance: [''], + lockinPeriodFrequency: [''], + lockinPeriodFrequencyType: [''], + withdrawalFeeForTransfers: [false], + minBalanceForInterestCalculation: [''], + enforceMinRequiredBalance: [false], + minRequiredBalance: [''], + allowOverdraft: [false], + withHoldTax: [false], + isDormancyTrackingActive: [false] }); } setConditionalControls() { - this.savingProductSettingsForm.get('allowOverdraft').valueChanges - .subscribe((allowOverdraft: any) => { - if (allowOverdraft) { - this.savingProductSettingsForm.addControl('minOverdraftForInterestCalculation', new UntypedFormControl('')); - this.savingProductSettingsForm.addControl('nominalAnnualInterestRateOverdraft', new UntypedFormControl('')); - this.savingProductSettingsForm.addControl('overdraftLimit', new UntypedFormControl('')); - } else { - this.savingProductSettingsForm.removeControl('minOverdraftForInterestCalculation'); - this.savingProductSettingsForm.removeControl('nominalAnnualInterestRateOverdraft'); - this.savingProductSettingsForm.removeControl('overdraftLimit'); - } - }); + this.savingProductSettingsForm.get('allowOverdraft').valueChanges.subscribe((allowOverdraft: any) => { + if (allowOverdraft) { + this.savingProductSettingsForm.addControl('minOverdraftForInterestCalculation', new UntypedFormControl('')); + this.savingProductSettingsForm.addControl('nominalAnnualInterestRateOverdraft', new UntypedFormControl('')); + this.savingProductSettingsForm.addControl('overdraftLimit', new UntypedFormControl('')); + } else { + this.savingProductSettingsForm.removeControl('minOverdraftForInterestCalculation'); + this.savingProductSettingsForm.removeControl('nominalAnnualInterestRateOverdraft'); + this.savingProductSettingsForm.removeControl('overdraftLimit'); + } + }); - this.savingProductSettingsForm.get('withHoldTax').valueChanges - .subscribe((withHoldTax: any) => { - if (withHoldTax) { - this.savingProductSettingsForm.addControl('taxGroupId', new UntypedFormControl('', Validators.required)); - } else { - this.savingProductSettingsForm.removeControl('taxGroupId'); - } - }); + this.savingProductSettingsForm.get('withHoldTax').valueChanges.subscribe((withHoldTax: any) => { + if (withHoldTax) { + this.savingProductSettingsForm.addControl('taxGroupId', new UntypedFormControl('', Validators.required)); + } else { + this.savingProductSettingsForm.removeControl('taxGroupId'); + } + }); - this.savingProductSettingsForm.get('isDormancyTrackingActive').valueChanges - .subscribe((isDormancyTrackingActive: any) => { + this.savingProductSettingsForm + .get('isDormancyTrackingActive') + .valueChanges.subscribe((isDormancyTrackingActive: any) => { if (isDormancyTrackingActive) { this.savingProductSettingsForm.addControl('daysToInactive', new UntypedFormControl('', Validators.required)); this.savingProductSettingsForm.addControl('daysToDormancy', new UntypedFormControl('', Validators.required)); @@ -101,5 +101,4 @@ export class SavingProductSettingsStepComponent implements OnInit { get savingProductSettings() { return this.savingProductSettingsForm.value; } - } diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component.spec.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component.spec.ts index 3976d5507..1dcbf3bdf 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component.spec.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingProductTermsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingProductTermsStepComponent ] - }) - .compileComponents(); + declarations: [SavingProductTermsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/saving-products/saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component.ts b/src/app/products/saving-products/saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component.ts index 5ac59351c..60131a2f7 100644 --- a/src/app/products/saving-products/saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component.ts +++ b/src/app/products/saving-products/saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component.ts @@ -8,7 +8,6 @@ import { TooltipPosition } from '@angular/material/tooltip'; styleUrls: ['./saving-product-terms-step.component.scss'] }) export class SavingProductTermsStepComponent implements OnInit { - @Input() savingProductsTemplate: any; savingProductTermsForm: UntypedFormGroup; @@ -29,26 +28,40 @@ export class SavingProductTermsStepComponent implements OnInit { this.interestCalculationDaysInYearTypeData = this.savingProductsTemplate.interestCalculationDaysInYearTypeOptions; this.savingProductTermsForm.patchValue({ - 'nominalAnnualInterestRate': this.savingProductsTemplate.nominalAnnualInterestRate, - 'interestCompoundingPeriodType': this.savingProductsTemplate.interestCompoundingPeriodType.id, - 'interestPostingPeriodType': this.savingProductsTemplate.interestPostingPeriodType.id, - 'interestCalculationType': this.savingProductsTemplate.interestCalculationType.id, - 'interestCalculationDaysInYearType': this.savingProductsTemplate.interestCalculationDaysInYearType.id + nominalAnnualInterestRate: this.savingProductsTemplate.nominalAnnualInterestRate, + interestCompoundingPeriodType: this.savingProductsTemplate.interestCompoundingPeriodType.id, + interestPostingPeriodType: this.savingProductsTemplate.interestPostingPeriodType.id, + interestCalculationType: this.savingProductsTemplate.interestCalculationType.id, + interestCalculationDaysInYearType: this.savingProductsTemplate.interestCalculationDaysInYearType.id }); } createSavingProductTermsForm() { this.savingProductTermsForm = this.formBuilder.group({ - 'nominalAnnualInterestRate': ['', Validators.required], - 'interestCompoundingPeriodType': ['', Validators.required], - 'interestPostingPeriodType': ['', Validators.required], - 'interestCalculationType': ['', Validators.required], - 'interestCalculationDaysInYearType': ['', Validators.required] + nominalAnnualInterestRate: [ + '', + Validators.required + ], + interestCompoundingPeriodType: [ + '', + Validators.required + ], + interestPostingPeriodType: [ + '', + Validators.required + ], + interestCalculationType: [ + '', + Validators.required + ], + interestCalculationDaysInYearType: [ + '', + Validators.required + ] }); } get savingProductTerms() { return this.savingProductTermsForm.value; } - } diff --git a/src/app/products/saving-products/saving-product.resolver.ts b/src/app/products/saving-products/saving-product.resolver.ts index fba567eff..b20e762e8 100644 --- a/src/app/products/saving-products/saving-product.resolver.ts +++ b/src/app/products/saving-products/saving-product.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class SavingProductResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -27,5 +26,4 @@ export class SavingProductResolver implements Resolve { const productId = route.parent.paramMap.get('productId'); return this.productsService.getSavingProduct(productId); } - } diff --git a/src/app/products/saving-products/saving-products-template.resolver.ts b/src/app/products/saving-products/saving-products-template.resolver.ts index e7e937f12..c1277cc1c 100644 --- a/src/app/products/saving-products/saving-products-template.resolver.ts +++ b/src/app/products/saving-products/saving-products-template.resolver.ts @@ -10,7 +10,6 @@ import { ProductsService } from '../products.service'; @Injectable() export class SavingProductsTemplateResolver implements Resolve { - constructor(private productsService: ProductsService) {} /** @@ -20,5 +19,4 @@ export class SavingProductsTemplateResolver implements Resolve { resolve(): Observable { return this.productsService.getSavingProductsTemplate(); } - } diff --git a/src/app/products/saving-products/saving-products.component.spec.ts b/src/app/products/saving-products/saving-products.component.spec.ts index 76f27f73a..aec8cc304 100644 --- a/src/app/products/saving-products/saving-products.component.spec.ts +++ b/src/app/products/saving-products/saving-products.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingProductsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingProductsComponent ] - }) - .compileComponents(); + declarations: [SavingProductsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/saving-products/saving-products.component.ts b/src/app/products/saving-products/saving-products.component.ts index da0c2670e..57039022d 100644 --- a/src/app/products/saving-products/saving-products.component.ts +++ b/src/app/products/saving-products/saving-products.component.ts @@ -15,9 +15,11 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura styleUrls: ['./saving-products.component.scss'] }) export class SavingProductsComponent implements OnInit, AfterViewInit { - savingProductsData: any; - displayedColumns: string[] = ['name', 'shortName']; + displayedColumns: string[] = [ + 'name', + 'shortName' + ]; dataSource: MatTableDataSource; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @@ -38,10 +40,12 @@ export class SavingProductsComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private route: ActivatedRoute, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { + constructor( + private route: ActivatedRoute, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { this.route.data.subscribe((data: { savingProducts: any }) => { this.savingProductsData = data.savingProducts; }); @@ -81,7 +85,12 @@ export class SavingProductsComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } diff --git a/src/app/products/saving-products/saving-products.resolver.ts b/src/app/products/saving-products/saving-products.resolver.ts index 55858e585..af3f5f5d8 100644 --- a/src/app/products/saving-products/saving-products.resolver.ts +++ b/src/app/products/saving-products/saving-products.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class SavingProductsResolver implements Resolve { - /** * * @param {ProductsService} productsService Products service. @@ -27,5 +26,4 @@ export class SavingProductsResolver implements Resolve { resolve(): Observable { return this.productsService.getSavingProducts(); } - } diff --git a/src/app/products/saving-products/view-saving-product/saving-product-datatable-tab/saving-product-datatable-tab.component.spec.ts b/src/app/products/saving-products/view-saving-product/saving-product-datatable-tab/saving-product-datatable-tab.component.spec.ts index 1daae4466..62b6951e3 100644 --- a/src/app/products/saving-products/view-saving-product/saving-product-datatable-tab/saving-product-datatable-tab.component.spec.ts +++ b/src/app/products/saving-products/view-saving-product/saving-product-datatable-tab/saving-product-datatable-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingProductDatatableTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ SavingProductDatatableTabComponent ] - }) - .compileComponents(); + declarations: [SavingProductDatatableTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/saving-products/view-saving-product/saving-product-datatable-tab/saving-product-datatable-tab.component.ts b/src/app/products/saving-products/view-saving-product/saving-product-datatable-tab/saving-product-datatable-tab.component.ts index e57ac2f83..ee354bde8 100644 --- a/src/app/products/saving-products/view-saving-product/saving-product-datatable-tab/saving-product-datatable-tab.component.ts +++ b/src/app/products/saving-products/view-saving-product/saving-product-datatable-tab/saving-product-datatable-tab.component.ts @@ -19,5 +19,4 @@ export class SavingProductDatatableTabComponent { this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); } - } diff --git a/src/app/products/saving-products/view-saving-product/saving-product-general-tab/saving-product-general-tab.component.spec.ts b/src/app/products/saving-products/view-saving-product/saving-product-general-tab/saving-product-general-tab.component.spec.ts index 20e486d89..7758f142c 100644 --- a/src/app/products/saving-products/view-saving-product/saving-product-general-tab/saving-product-general-tab.component.spec.ts +++ b/src/app/products/saving-products/view-saving-product/saving-product-general-tab/saving-product-general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingProductGeneralTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ SavingProductGeneralTabComponent ] - }) - .compileComponents(); + declarations: [SavingProductGeneralTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/saving-products/view-saving-product/saving-product-general-tab/saving-product-general-tab.component.ts b/src/app/products/saving-products/view-saving-product/saving-product-general-tab/saving-product-general-tab.component.ts index f411ab37c..9f59bbf79 100644 --- a/src/app/products/saving-products/view-saving-product/saving-product-general-tab/saving-product-general-tab.component.ts +++ b/src/app/products/saving-products/view-saving-product/saving-product-general-tab/saving-product-general-tab.component.ts @@ -10,12 +10,25 @@ import { Accounting } from 'app/core/utils/accounting'; export class SavingProductGeneralTabComponent { savingProduct: any; - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType']; - paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId']; - feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId']; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType' + ]; + paymentFundSourceDisplayedColumns: string[] = [ + 'paymentTypeId', + 'fundSourceAccountId' + ]; + feesPenaltyIncomeDisplayedColumns: string[] = [ + 'chargeId', + 'incomeAccountId' + ]; - constructor(private route: ActivatedRoute, - private accounting: Accounting) { + constructor( + private route: ActivatedRoute, + private accounting: Accounting + ) { this.route.data.subscribe((data: { savingProduct: any }) => { this.savingProduct = data.savingProduct; }); @@ -28,5 +41,4 @@ export class SavingProductGeneralTabComponent { isAccrualAccounting(): boolean { return this.accounting.isAccrualAccounting(this.savingProduct.accountingRule); } - } diff --git a/src/app/products/saving-products/view-saving-product/view-saving-product.component.spec.ts b/src/app/products/saving-products/view-saving-product/view-saving-product.component.spec.ts index 7dc3ec052..61082455f 100644 --- a/src/app/products/saving-products/view-saving-product/view-saving-product.component.spec.ts +++ b/src/app/products/saving-products/view-saving-product/view-saving-product.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewSavingProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewSavingProductComponent ] - }) - .compileComponents(); + declarations: [ViewSavingProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/saving-products/view-saving-product/view-saving-product.component.ts b/src/app/products/saving-products/view-saving-product/view-saving-product.component.ts index a276fd1c6..804577300 100644 --- a/src/app/products/saving-products/view-saving-product/view-saving-product.component.ts +++ b/src/app/products/saving-products/view-saving-product/view-saving-product.component.ts @@ -7,7 +7,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-saving-product.component.scss'] }) export class ViewSavingProductComponent { - savingProductDatatables: any = []; constructor(private route: ActivatedRoute) { @@ -20,5 +19,4 @@ export class ViewSavingProductComponent { }); }); } - } diff --git a/src/app/products/share-products/create-dividend/create-dividend.component.spec.ts b/src/app/products/share-products/create-dividend/create-dividend.component.spec.ts index b181c7cb6..92bd99fa5 100644 --- a/src/app/products/share-products/create-dividend/create-dividend.component.spec.ts +++ b/src/app/products/share-products/create-dividend/create-dividend.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateDividendComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateDividendComponent ] - }) - .compileComponents(); + declarations: [CreateDividendComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/create-dividend/create-dividend.component.ts b/src/app/products/share-products/create-dividend/create-dividend.component.ts index a3940e9d5..f9f239353 100644 --- a/src/app/products/share-products/create-dividend/create-dividend.component.ts +++ b/src/app/products/share-products/create-dividend/create-dividend.component.ts @@ -8,7 +8,6 @@ import { Dates } from 'app/core/utils/dates'; import { ProductsService } from 'app/products/products.service'; import { SettingsService } from 'app/settings/settings.service'; - /** * Create Dividend component. */ @@ -18,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./create-dividend.component.scss'] }) export class CreateDividendComponent implements OnInit { - /** Create Dividend Form. */ createDividendForm: UntypedFormGroup; /** Share Product data. */ @@ -37,12 +35,14 @@ export class CreateDividendComponent implements OnInit { * @param {Router} router Router. * @param {SettingsService} settingsService Settings Service. */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private dateUtils: Dates, - private productService: ProductsService, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private dateUtils: Dates, + private productService: ProductsService, + private router: Router, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { shareProduct: any }) => { this.shareProductData = data.shareProduct; }); @@ -58,9 +58,18 @@ export class CreateDividendComponent implements OnInit { */ setDividendForm() { this.createDividendForm = this.formBuilder.group({ - 'dividendPeriodStartDate': ['', Validators.required], - 'dividendPeriodEndDate': ['', Validators.required], - 'dividendAmount': ['', Validators.required] + dividendPeriodStartDate: [ + '', + Validators.required + ], + dividendPeriodEndDate: [ + '', + Validators.required + ], + dividendAmount: [ + '', + Validators.required + ] }); } @@ -88,5 +97,4 @@ export class CreateDividendComponent implements OnInit { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/products/share-products/create-share-product/create-share-product.component.spec.ts b/src/app/products/share-products/create-share-product/create-share-product.component.spec.ts index 9b46b75af..98f6eda1f 100644 --- a/src/app/products/share-products/create-share-product/create-share-product.component.spec.ts +++ b/src/app/products/share-products/create-share-product/create-share-product.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateShareProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateShareProductComponent ] - }) - .compileComponents(); + declarations: [CreateShareProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/create-share-product/create-share-product.component.ts b/src/app/products/share-products/create-share-product/create-share-product.component.ts index 40d6c4037..e013ef557 100644 --- a/src/app/products/share-products/create-share-product/create-share-product.component.ts +++ b/src/app/products/share-products/create-share-product/create-share-product.component.ts @@ -22,14 +22,19 @@ import { Accounting } from 'app/core/utils/accounting'; styleUrls: ['./create-share-product.component.scss'] }) export class CreateShareProductComponent { - - @ViewChild(ShareProductDetailsStepComponent, { static: true }) shareProductDetailsStep: ShareProductDetailsStepComponent; - @ViewChild(ShareProductCurrencyStepComponent, { static: true }) shareProductCurrencyStep: ShareProductCurrencyStepComponent; + @ViewChild(ShareProductDetailsStepComponent, { static: true }) + shareProductDetailsStep: ShareProductDetailsStepComponent; + @ViewChild(ShareProductCurrencyStepComponent, { static: true }) + shareProductCurrencyStep: ShareProductCurrencyStepComponent; @ViewChild(ShareProductTermsStepComponent, { static: true }) shareProductTermsStep: ShareProductTermsStepComponent; - @ViewChild(ShareProductSettingsStepComponent, { static: true }) shareProductSettingsStep: ShareProductSettingsStepComponent; - @ViewChild(ShareProductMarketPriceStepComponent, { static: true }) shareProductMarketPriceStep: ShareProductMarketPriceStepComponent; - @ViewChild(ShareProductChargesStepComponent, { static: true }) shareProductChargesStep: ShareProductChargesStepComponent; - @ViewChild(ShareProductAccountingStepComponent, { static: true }) shareProductAccountingStep: ShareProductAccountingStepComponent; + @ViewChild(ShareProductSettingsStepComponent, { static: true }) + shareProductSettingsStep: ShareProductSettingsStepComponent; + @ViewChild(ShareProductMarketPriceStepComponent, { static: true }) + shareProductMarketPriceStep: ShareProductMarketPriceStepComponent; + @ViewChild(ShareProductChargesStepComponent, { static: true }) + shareProductChargesStep: ShareProductChargesStepComponent; + @ViewChild(ShareProductAccountingStepComponent, { static: true }) + shareProductAccountingStep: ShareProductAccountingStepComponent; shareProductsTemplate: any; accountingRuleData: string[] = []; @@ -41,11 +46,13 @@ export class CreateShareProductComponent { * @param {SettingsService} settingsService Settings Service. */ - constructor(private route: ActivatedRoute, - private productsService: ProductsService, - private router: Router, - private settingsService: SettingsService, - private accounting: Accounting) { + constructor( + private route: ActivatedRoute, + private productsService: ProductsService, + private router: Router, + private settingsService: SettingsService, + private accounting: Accounting + ) { this.route.data.subscribe((data: { shareProductsTemplate: any }) => { this.shareProductsTemplate = data.shareProductsTemplate; }); @@ -106,10 +113,14 @@ export class CreateShareProductComponent { chargesSelected: this.shareProduct.chargesSelected.map((charge: any) => ({ id: charge.id })), locale: this.settingsService.language.code // locale required for digitsAfterDecimal }; - this.productsService.createShareProduct(shareProduct) - .subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); - }); + this.productsService.createShareProduct(shareProduct).subscribe((response: any) => { + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); + }); } - } diff --git a/src/app/products/share-products/dividends-share-product/dividends.component.spec.ts b/src/app/products/share-products/dividends-share-product/dividends.component.spec.ts index 1ac1c2264..a9609e3e0 100644 --- a/src/app/products/share-products/dividends-share-product/dividends.component.spec.ts +++ b/src/app/products/share-products/dividends-share-product/dividends.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareProductsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ShareProductsDividendsComponent ] - }) - .compileComponents(); + declarations: [ShareProductsDividendsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/dividends-share-product/dividends.components.ts b/src/app/products/share-products/dividends-share-product/dividends.components.ts index 951730906..f3cd33c70 100644 --- a/src/app/products/share-products/dividends-share-product/dividends.components.ts +++ b/src/app/products/share-products/dividends-share-product/dividends.components.ts @@ -1,4 +1,4 @@ - /** Angular Imports */ +/** Angular Imports */ import { Component, OnInit, ViewChild } from '@angular/core'; import { MatPaginator } from '@angular/material/paginator'; import { MatSort } from '@angular/material/sort'; @@ -14,11 +14,16 @@ import { ActivatedRoute, Router } from '@angular/router'; styleUrls: ['./dividends.component.scss'] }) export class ShareProductsDividendsComponent implements OnInit { - /** Dividends data. */ dividendData: any; /** Columns to be displayed in dividends table. */ - displayedColumns: string[] = ['name', 'dividendPeriodStartDate', 'dividendPeriodEndDate', 'amount', 'status']; + displayedColumns: string[] = [ + 'name', + 'dividendPeriodStartDate', + 'dividendPeriodEndDate', + 'amount', + 'status' + ]; /** Data source for accounting rules table. */ dataSource: MatTableDataSource; @@ -31,12 +36,14 @@ export class ShareProductsDividendsComponent implements OnInit { * Retrieves the dividends data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ - constructor(private route: ActivatedRoute, - private router: Router) { - this.route.data.subscribe((data: {dividends: any}) => { + constructor( + private route: ActivatedRoute, + private router: Router + ) { + this.route.data.subscribe((data: { dividends: any }) => { this.dividendData = data.dividends.pageItems; }); - } + } /** * Sets the dividends table. @@ -66,5 +73,4 @@ export class ShareProductsDividendsComponent implements OnInit { applyFilter(filterValue: string) { this.dataSource.filter = filterValue.trim().toLowerCase(); } - } diff --git a/src/app/products/share-products/dividends-share-product/dividends.resolver.ts b/src/app/products/share-products/dividends-share-product/dividends.resolver.ts index ffceacc03..41c882ddc 100644 --- a/src/app/products/share-products/dividends-share-product/dividends.resolver.ts +++ b/src/app/products/share-products/dividends-share-product/dividends.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../../products.service'; */ @Injectable() export class DividendsResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -27,5 +26,4 @@ export class DividendsResolver implements Resolve { const id = route.paramMap.get('productId'); return this.productsService.getDividends(id); } - } diff --git a/src/app/products/share-products/edit-share-product/edit-share-product.component.spec.ts b/src/app/products/share-products/edit-share-product/edit-share-product.component.spec.ts index 700500880..705848201 100644 --- a/src/app/products/share-products/edit-share-product/edit-share-product.component.spec.ts +++ b/src/app/products/share-products/edit-share-product/edit-share-product.component.spec.ts @@ -8,9 +8,8 @@ describe('EditShareProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditShareProductComponent ] - }) - .compileComponents(); + declarations: [EditShareProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/edit-share-product/edit-share-product.component.ts b/src/app/products/share-products/edit-share-product/edit-share-product.component.ts index 8f4c8b952..4619c7a8e 100644 --- a/src/app/products/share-products/edit-share-product/edit-share-product.component.ts +++ b/src/app/products/share-products/edit-share-product/edit-share-product.component.ts @@ -22,14 +22,19 @@ import { Accounting } from 'app/core/utils/accounting'; styleUrls: ['./edit-share-product.component.scss'] }) export class EditShareProductComponent { - - @ViewChild(ShareProductDetailsStepComponent, { static: true }) shareProductDetailsStep: ShareProductDetailsStepComponent; - @ViewChild(ShareProductCurrencyStepComponent, { static: true }) shareProductCurrencyStep: ShareProductCurrencyStepComponent; + @ViewChild(ShareProductDetailsStepComponent, { static: true }) + shareProductDetailsStep: ShareProductDetailsStepComponent; + @ViewChild(ShareProductCurrencyStepComponent, { static: true }) + shareProductCurrencyStep: ShareProductCurrencyStepComponent; @ViewChild(ShareProductTermsStepComponent, { static: true }) shareProductTermsStep: ShareProductTermsStepComponent; - @ViewChild(ShareProductSettingsStepComponent, { static: true }) shareProductSettingsStep: ShareProductSettingsStepComponent; - @ViewChild(ShareProductMarketPriceStepComponent, { static: true }) shareProductMarketPriceStep: ShareProductMarketPriceStepComponent; - @ViewChild(ShareProductChargesStepComponent, { static: true }) shareProductChargesStep: ShareProductChargesStepComponent; - @ViewChild(ShareProductAccountingStepComponent, { static: true }) shareProductAccountingStep: ShareProductAccountingStepComponent; + @ViewChild(ShareProductSettingsStepComponent, { static: true }) + shareProductSettingsStep: ShareProductSettingsStepComponent; + @ViewChild(ShareProductMarketPriceStepComponent, { static: true }) + shareProductMarketPriceStep: ShareProductMarketPriceStepComponent; + @ViewChild(ShareProductChargesStepComponent, { static: true }) + shareProductChargesStep: ShareProductChargesStepComponent; + @ViewChild(ShareProductAccountingStepComponent, { static: true }) + shareProductAccountingStep: ShareProductAccountingStepComponent; shareProductAndTemplate: any; accountingRuleData: string[] = []; @@ -41,11 +46,13 @@ export class EditShareProductComponent { * @param {SettingsService} settingsService Settings Service. */ - constructor(private route: ActivatedRoute, - private productsService: ProductsService, - private router: Router, - private settingsService: SettingsService, - private accounting: Accounting) { + constructor( + private route: ActivatedRoute, + private productsService: ProductsService, + private router: Router, + private settingsService: SettingsService, + private accounting: Accounting + ) { this.route.data.subscribe((data: { shareProductAndTemplate: any }) => { this.shareProductAndTemplate = data.shareProductAndTemplate; }); @@ -84,15 +91,13 @@ export class EditShareProductComponent { this.shareProductSettingsForm.valid && this.shareProductMarketPriceForm.valid && this.shareProductAccountingForm.valid && - ( - !this.shareProductDetailsForm.pristine || + (!this.shareProductDetailsForm.pristine || !this.shareProductCurrencyForm.pristine || !this.shareProductTermsForm.pristine || !this.shareProductSettingsForm.pristine || !this.shareProductMarketPriceForm.pristine || !this.shareProductChargesStep.pristine || - !this.shareProductAccountingForm.pristine - ) + !this.shareProductAccountingForm.pristine) ); } @@ -115,10 +120,16 @@ export class EditShareProductComponent { chargesSelected: this.shareProduct.chargesSelected.map((charge: any) => ({ id: charge.id })), locale: this.settingsService.language.code // locale required for digitsAfterDecimal }; - this.productsService.updateShareProduct(this.shareProductAndTemplate.id, shareProduct) + this.productsService + .updateShareProduct(this.shareProductAndTemplate.id, shareProduct) .subscribe((response: any) => { - this.router.navigate(['../../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/products/share-products/edit-share-product/share-product-and-template.resolver.ts b/src/app/products/share-products/edit-share-product/share-product-and-template.resolver.ts index 771cfb568..093e16943 100644 --- a/src/app/products/share-products/edit-share-product/share-product-and-template.resolver.ts +++ b/src/app/products/share-products/edit-share-product/share-product-and-template.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../../products.service'; */ @Injectable() export class ShareProductAndTemplateResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -27,5 +26,4 @@ export class ShareProductAndTemplateResolver implements Resolve { const productId = route.parent.paramMap.get('productId'); return this.productsService.getShareProduct(productId, true); } - } diff --git a/src/app/products/share-products/share-product-datatable.resolver.ts b/src/app/products/share-products/share-product-datatable.resolver.ts index 5a553cb88..60bb6c84f 100644 --- a/src/app/products/share-products/share-product-datatable.resolver.ts +++ b/src/app/products/share-products/share-product-datatable.resolver.ts @@ -1,9 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Router, Resolve, - RouterStateSnapshot, - ActivatedRouteSnapshot -} from '@angular/router'; +import { Router, Resolve, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router'; import { SystemService } from 'app/system/system.service'; import { Observable, of } from 'rxjs'; @@ -11,11 +7,10 @@ import { Observable, of } from 'rxjs'; providedIn: 'root' }) export class ShareProductDatatableResolver implements Resolve { - /** * @param {SystemService} systemService Products service. */ - constructor(private systemService: SystemService) { } + constructor(private systemService: SystemService) {} /** * Returns the loan product data. @@ -26,5 +21,4 @@ export class ShareProductDatatableResolver implements Resolve { const datatableName = route.paramMap.get('datatableName'); return this.systemService.getEntityDatatable(productId, datatableName); } - } diff --git a/src/app/products/share-products/share-product-datatables.resolver.ts b/src/app/products/share-products/share-product-datatables.resolver.ts index 7bc452029..bfbc07417 100644 --- a/src/app/products/share-products/share-product-datatables.resolver.ts +++ b/src/app/products/share-products/share-product-datatables.resolver.ts @@ -1,9 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Router, Resolve, - RouterStateSnapshot, - ActivatedRouteSnapshot -} from '@angular/router'; +import { Router, Resolve, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router'; import { SystemService } from 'app/system/system.service'; import { Observable, of } from 'rxjs'; @@ -11,11 +7,10 @@ import { Observable, of } from 'rxjs'; providedIn: 'root' }) export class ShareProductDatatablesResolver implements Resolve { - /** * @param {SystemService} systemService Products service. */ - constructor(private systemService: SystemService) { } + constructor(private systemService: SystemService) {} /** * Returns the loan product data. diff --git a/src/app/products/share-products/share-product-resolver.ts b/src/app/products/share-products/share-product-resolver.ts index 76c863360..588a11ba1 100644 --- a/src/app/products/share-products/share-product-resolver.ts +++ b/src/app/products/share-products/share-product-resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class ShareProductResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -27,5 +26,4 @@ export class ShareProductResolver implements Resolve { const productId = route.parent.paramMap.get('productId'); return this.productsService.getShareProduct(productId); } - } diff --git a/src/app/products/share-products/share-product-stepper/share-product-accounting-step/share-product-accounting-step.component.spec.ts b/src/app/products/share-products/share-product-stepper/share-product-accounting-step/share-product-accounting-step.component.spec.ts index be929b5a4..c0eae4635 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-accounting-step/share-product-accounting-step.component.spec.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-accounting-step/share-product-accounting-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareProductAccountingStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ShareProductAccountingStepComponent ] - }) - .compileComponents(); + declarations: [ShareProductAccountingStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/share-product-stepper/share-product-accounting-step/share-product-accounting-step.component.ts b/src/app/products/share-products/share-product-stepper/share-product-accounting-step/share-product-accounting-step.component.ts index b00830cfc..5a7056fbf 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-accounting-step/share-product-accounting-step.component.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-accounting-step/share-product-accounting-step.component.ts @@ -8,7 +8,6 @@ import { TooltipPosition } from '@angular/material/tooltip'; styleUrls: ['./share-product-accounting-step.component.scss'] }) export class ShareProductAccountingStepComponent implements OnInit { - @Input() shareProductsTemplate: any; @Input() accountingRuleData: any; @Input() shareProductFormValid: boolean; @@ -33,15 +32,15 @@ export class ShareProductAccountingStepComponent implements OnInit { if (this.shareProductsTemplate.accountingRule) { this.shareProductAccountingForm.patchValue({ - 'accountingRule': this.shareProductsTemplate.accountingRule.id + accountingRule: this.shareProductsTemplate.accountingRule.id }); if (this.shareProductsTemplate.accountingRule.id === 2) { this.shareProductAccountingForm.patchValue({ - 'shareReferenceId': this.shareProductsTemplate.accountingMappings.shareReferenceId.id, - 'shareSuspenseId': this.shareProductsTemplate.accountingMappings.shareSuspenseId.id, - 'shareEquityId': this.shareProductsTemplate.accountingMappings.shareEquityId.id, - 'incomeFromFeeAccountId': this.shareProductsTemplate.accountingMappings.incomeFromFeeAccountId.id + shareReferenceId: this.shareProductsTemplate.accountingMappings.shareReferenceId.id, + shareSuspenseId: this.shareProductsTemplate.accountingMappings.shareSuspenseId.id, + shareEquityId: this.shareProductsTemplate.accountingMappings.shareEquityId.id, + incomeFromFeeAccountId: this.shareProductsTemplate.accountingMappings.incomeFromFeeAccountId.id }); } } @@ -49,29 +48,30 @@ export class ShareProductAccountingStepComponent implements OnInit { createShareProductAccountingForm() { this.shareProductAccountingForm = this.formBuilder.group({ - 'accountingRule': [1] + accountingRule: [1] }); } setConditionalControls() { - this.shareProductAccountingForm.get('accountingRule').valueChanges - .subscribe((accountingRule: any) => { - if (accountingRule === 2) { - this.shareProductAccountingForm.addControl('shareReferenceId', new UntypedFormControl('', Validators.required)); - this.shareProductAccountingForm.addControl('shareSuspenseId', new UntypedFormControl('', Validators.required)); - this.shareProductAccountingForm.addControl('shareEquityId', new UntypedFormControl('', Validators.required)); - this.shareProductAccountingForm.addControl('incomeFromFeeAccountId', new UntypedFormControl('', Validators.required)); - } else { - this.shareProductAccountingForm.removeControl('shareReferenceId'); - this.shareProductAccountingForm.removeControl('shareSuspenseId'); - this.shareProductAccountingForm.removeControl('shareEquityId'); - this.shareProductAccountingForm.removeControl('incomeFromFeeAccountId'); - } - }); + this.shareProductAccountingForm.get('accountingRule').valueChanges.subscribe((accountingRule: any) => { + if (accountingRule === 2) { + this.shareProductAccountingForm.addControl('shareReferenceId', new UntypedFormControl('', Validators.required)); + this.shareProductAccountingForm.addControl('shareSuspenseId', new UntypedFormControl('', Validators.required)); + this.shareProductAccountingForm.addControl('shareEquityId', new UntypedFormControl('', Validators.required)); + this.shareProductAccountingForm.addControl( + 'incomeFromFeeAccountId', + new UntypedFormControl('', Validators.required) + ); + } else { + this.shareProductAccountingForm.removeControl('shareReferenceId'); + this.shareProductAccountingForm.removeControl('shareSuspenseId'); + this.shareProductAccountingForm.removeControl('shareEquityId'); + this.shareProductAccountingForm.removeControl('incomeFromFeeAccountId'); + } + }); } get shareProductAccounting() { return this.shareProductAccountingForm.value; } - } diff --git a/src/app/products/share-products/share-product-stepper/share-product-charges-step/share-product-charges-step.component.spec.ts b/src/app/products/share-products/share-product-stepper/share-product-charges-step/share-product-charges-step.component.spec.ts index 65f7cfde0..2fe854600 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-charges-step/share-product-charges-step.component.spec.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-charges-step/share-product-charges-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareProductChargesStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ShareProductChargesStepComponent ] - }) - .compileComponents(); + declarations: [ShareProductChargesStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/share-product-stepper/share-product-charges-step/share-product-charges-step.component.ts b/src/app/products/share-products/share-product-stepper/share-product-charges-step/share-product-charges-step.component.ts index ad7ceab56..2d6406273 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-charges-step/share-product-charges-step.component.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-charges-step/share-product-charges-step.component.ts @@ -11,20 +11,26 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./share-product-charges-step.component.scss'] }) export class ShareProductChargesStepComponent implements OnInit { - @Input() shareProductsTemplate: any; @Input() currencyCode: UntypedFormControl; chargeData: any; chargesDataSource: {}[]; - displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'action']; + displayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'action' + ]; pristine = true; - constructor(public dialog: MatDialog, - private translateService: TranslateService) { - } + constructor( + public dialog: MatDialog, + private translateService: TranslateService + ) {} ngOnInit() { this.chargeData = this.shareProductsTemplate.chargeOptions; @@ -32,7 +38,7 @@ export class ShareProductChargesStepComponent implements OnInit { this.chargesDataSource = this.shareProductsTemplate.charges || []; this.pristine = true; - this.currencyCode.valueChanges.subscribe(() => this.chargesDataSource = []); + this.currencyCode.valueChanges.subscribe(() => (this.chargesDataSource = [])); } addCharge(charge: any) { @@ -43,7 +49,7 @@ export class ShareProductChargesStepComponent implements OnInit { deleteCharge(charge: any) { const deleteChargeDialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: this.translateService.instant('labels.inputs.Charge') + ' ' + charge.name } + data: { deleteContext: this.translateService.instant('labels.inputs.Charge') + ' ' + charge.name } }); deleteChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { @@ -59,5 +65,4 @@ export class ShareProductChargesStepComponent implements OnInit { chargesSelected: this.chargesDataSource }; } - } diff --git a/src/app/products/share-products/share-product-stepper/share-product-currency-step/share-product-currency-step.component.spec.ts b/src/app/products/share-products/share-product-stepper/share-product-currency-step/share-product-currency-step.component.spec.ts index b5a4edd45..08bcbf8ca 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-currency-step/share-product-currency-step.component.spec.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-currency-step/share-product-currency-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareProductCurrencyStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ShareProductCurrencyStepComponent ] - }) - .compileComponents(); + declarations: [ShareProductCurrencyStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/share-product-stepper/share-product-currency-step/share-product-currency-step.component.ts b/src/app/products/share-products/share-product-stepper/share-product-currency-step/share-product-currency-step.component.ts index 5027da283..fe1e5c89d 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-currency-step/share-product-currency-step.component.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-currency-step/share-product-currency-step.component.ts @@ -8,7 +8,6 @@ import { TooltipPosition } from '@angular/material/tooltip'; styleUrls: ['./share-product-currency-step.component.scss'] }) export class ShareProductCurrencyStepComponent implements OnInit { - @Input() shareProductsTemplate: any; shareProductCurrencyForm: UntypedFormGroup; @@ -24,28 +23,36 @@ export class ShareProductCurrencyStepComponent implements OnInit { if (this.shareProductsTemplate.currency) { this.shareProductCurrencyForm.patchValue({ - 'currencyCode': this.shareProductsTemplate.currency.code, - 'digitsAfterDecimal': this.shareProductsTemplate.currency.decimalPlaces, - 'inMultiplesOf': this.shareProductsTemplate.currency.inMultiplesOf + currencyCode: this.shareProductsTemplate.currency.code, + digitsAfterDecimal: this.shareProductsTemplate.currency.decimalPlaces, + inMultiplesOf: this.shareProductsTemplate.currency.inMultiplesOf }); } else { this.shareProductCurrencyForm.patchValue({ - 'currencyCode': this.currencyData[0].code, - 'digitsAfterDecimal': 2 + currencyCode: this.currencyData[0].code, + digitsAfterDecimal: 2 }); } } createShareProductCurrencyForm() { this.shareProductCurrencyForm = this.formBuilder.group({ - 'currencyCode': ['', Validators.required], - 'digitsAfterDecimal': ['', Validators.required], - 'inMultiplesOf': ['', Validators.required] + currencyCode: [ + '', + Validators.required + ], + digitsAfterDecimal: [ + '', + Validators.required + ], + inMultiplesOf: [ + '', + Validators.required + ] }); } get shareProductCurrency() { return this.shareProductCurrencyForm.value; } - } diff --git a/src/app/products/share-products/share-product-stepper/share-product-details-step/share-product-details-step.component.spec.ts b/src/app/products/share-products/share-product-stepper/share-product-details-step/share-product-details-step.component.spec.ts index ea2f6d96b..a4b844847 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-details-step/share-product-details-step.component.spec.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-details-step/share-product-details-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareProductDetailsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ShareProductDetailsStepComponent ] - }) - .compileComponents(); + declarations: [ShareProductDetailsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/share-product-stepper/share-product-details-step/share-product-details-step.component.ts b/src/app/products/share-products/share-product-stepper/share-product-details-step/share-product-details-step.component.ts index e2e30082c..e3e9c9aa2 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-details-step/share-product-details-step.component.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-details-step/share-product-details-step.component.ts @@ -8,7 +8,6 @@ import { TooltipPosition } from '@angular/material/tooltip'; styleUrls: ['./share-product-details-step.component.scss'] }) export class ShareProductDetailsStepComponent implements OnInit { - @Input() shareProductsTemplate: any; shareProductDetailsForm: UntypedFormGroup; @@ -20,23 +19,31 @@ export class ShareProductDetailsStepComponent implements OnInit { ngOnInit() { if (this.shareProductsTemplate) { this.shareProductDetailsForm.patchValue({ - 'name': this.shareProductsTemplate.name, - 'shortName': this.shareProductsTemplate.shortName, - 'description': this.shareProductsTemplate.description + name: this.shareProductsTemplate.name, + shortName: this.shareProductsTemplate.shortName, + description: this.shareProductsTemplate.description }); } } createShareProductDetailsForm() { this.shareProductDetailsForm = this.formBuilder.group({ - 'name': ['', Validators.required], - 'shortName': ['', Validators.required], - 'description': ['', Validators.required] + name: [ + '', + Validators.required + ], + shortName: [ + '', + Validators.required + ], + description: [ + '', + Validators.required + ] }); } get shareProductDetails() { return this.shareProductDetailsForm.value; } - } diff --git a/src/app/products/share-products/share-product-stepper/share-product-market-price-step/share-product-market-price-step.component.spec.ts b/src/app/products/share-products/share-product-stepper/share-product-market-price-step/share-product-market-price-step.component.spec.ts index bf58fea17..5a53707ff 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-market-price-step/share-product-market-price-step.component.spec.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-market-price-step/share-product-market-price-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareProductMarketPriceStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ShareProductMarketPriceStepComponent ] - }) - .compileComponents(); + declarations: [ShareProductMarketPriceStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/share-product-stepper/share-product-market-price-step/share-product-market-price-step.component.ts b/src/app/products/share-products/share-product-stepper/share-product-market-price-step/share-product-market-price-step.component.ts index 00c04cf14..82d575d53 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-market-price-step/share-product-market-price-step.component.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-market-price-step/share-product-market-price-step.component.ts @@ -22,13 +22,16 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./share-product-market-price-step.component.scss'] }) export class ShareProductMarketPriceStepComponent implements OnInit { - @Input() shareProductsTemplate: any; shareProductMarketPriceForm: UntypedFormGroup; /** For displaying required columns */ - displayedColumns: string[] = ['fromDate', 'shareValue', 'actions']; + displayedColumns: string[] = [ + 'fromDate', + 'shareValue', + 'actions' + ]; /** * @param {FormBuilder} formBuilder Form Builder. @@ -36,23 +39,28 @@ export class ShareProductMarketPriceStepComponent implements OnInit { * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - public dialog: MatDialog, - private dateUtils: Dates, - private settingsService: SettingsService, - private translateService: TranslateService) { + constructor( + private formBuilder: UntypedFormBuilder, + public dialog: MatDialog, + private dateUtils: Dates, + private settingsService: SettingsService, + private translateService: TranslateService + ) { this.createShareProductMarketPriceForm(); } ngOnInit() { if (this.shareProductsTemplate) { - this.shareProductMarketPriceForm.setControl('marketPricePeriods', this.formBuilder.array((this.shareProductsTemplate.marketPrice))); + this.shareProductMarketPriceForm.setControl( + 'marketPricePeriods', + this.formBuilder.array(this.shareProductsTemplate.marketPrice) + ); } } createShareProductMarketPriceForm() { this.shareProductMarketPriceForm = this.formBuilder.group({ - 'marketPricePeriods': this.formBuilder.array([]) + marketPricePeriods: this.formBuilder.array([]) }); } @@ -101,7 +109,10 @@ export class ShareProductMarketPriceStepComponent implements OnInit { } getData(values?: any) { - return { title: this.translateService.instant('labels.inputs.Market Price Period'), formfields: this.getFormfields(values) }; + return { + title: this.translateService.instant('labels.inputs.Market Price Period'), + formfields: this.getFormfields(values) + }; } getFormfields(values?: any) { @@ -122,6 +133,7 @@ export class ShareProductMarketPriceStepComponent implements OnInit { required: true, order: 2 }) + ]; return formfields; } @@ -141,5 +153,4 @@ export class ShareProductMarketPriceStepComponent implements OnInit { } return { marketPricePeriods }; } - } diff --git a/src/app/products/share-products/share-product-stepper/share-product-preview-step/share-product-preview-step.component.spec.ts b/src/app/products/share-products/share-product-stepper/share-product-preview-step/share-product-preview-step.component.spec.ts index c2c56bb98..3aa2aa90f 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-preview-step/share-product-preview-step.component.spec.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-preview-step/share-product-preview-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareProductPreviewStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ShareProductPreviewStepComponent ] - }) - .compileComponents(); + declarations: [ShareProductPreviewStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/share-product-stepper/share-product-preview-step/share-product-preview-step.component.ts b/src/app/products/share-products/share-product-stepper/share-product-preview-step/share-product-preview-step.component.ts index fff9ea4d2..8d3d96659 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-preview-step/share-product-preview-step.component.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-preview-step/share-product-preview-step.component.ts @@ -6,16 +6,22 @@ import { Component, Input, Output, EventEmitter } from '@angular/core'; styleUrls: ['./share-product-preview-step.component.scss'] }) export class ShareProductPreviewStepComponent { - @Input() shareProductsTemplate: any; @Input() accountingRuleData: any; @Input() shareProduct: any; @Input() taskPermission: string; @Output() submitEvent = new EventEmitter(); - marketPriceDisplayedColumns: string[] = ['fromDate', 'shareValue']; - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType']; - - constructor() { } + marketPriceDisplayedColumns: string[] = [ + 'fromDate', + 'shareValue' + ]; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType' + ]; + constructor() {} } diff --git a/src/app/products/share-products/share-product-stepper/share-product-settings-step/share-product-settings-step.component.spec.ts b/src/app/products/share-products/share-product-stepper/share-product-settings-step/share-product-settings-step.component.spec.ts index 27116348e..17d5a4693 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-settings-step/share-product-settings-step.component.spec.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-settings-step/share-product-settings-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareProductSettingsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ShareProductSettingsStepComponent ] - }) - .compileComponents(); + declarations: [ShareProductSettingsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/share-product-stepper/share-product-settings-step/share-product-settings-step.component.ts b/src/app/products/share-products/share-product-stepper/share-product-settings-step/share-product-settings-step.component.ts index 53d9f63db..2f759821b 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-settings-step/share-product-settings-step.component.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-settings-step/share-product-settings-step.component.ts @@ -8,7 +8,6 @@ import { TooltipPosition } from '@angular/material/tooltip'; styleUrls: ['./share-product-settings-step.component.scss'] }) export class ShareProductSettingsStepComponent implements OnInit { - @Input() shareProductsTemplate: any; shareProductSettingsForm: UntypedFormGroup; @@ -25,32 +24,37 @@ export class ShareProductSettingsStepComponent implements OnInit { this.lockinPeriodFrequencyTypeData = this.shareProductsTemplate.lockinPeriodFrequencyTypeOptions; this.shareProductSettingsForm.patchValue({ - 'minimumShares': this.shareProductsTemplate.minimumShares, - 'nominalShares': this.shareProductsTemplate.nominalShares, - 'maximumShares': this.shareProductsTemplate.maximumShares, - 'minimumActivePeriodForDividends': this.shareProductsTemplate.minimumActivePeriod, - 'minimumactiveperiodFrequencyType': this.shareProductsTemplate.minimumActivePeriodForDividendsTypeEnum && this.shareProductsTemplate.minimumActivePeriodForDividendsTypeEnum.id, - 'lockinPeriodFrequency': this.shareProductsTemplate.lockinPeriod, - 'lockinPeriodFrequencyType': this.shareProductsTemplate.lockPeriodTypeEnum && this.shareProductsTemplate.lockPeriodTypeEnum.id, - 'allowDividendCalculationForInactiveClients': this.shareProductsTemplate.allowDividendCalculationForInactiveClients + minimumShares: this.shareProductsTemplate.minimumShares, + nominalShares: this.shareProductsTemplate.nominalShares, + maximumShares: this.shareProductsTemplate.maximumShares, + minimumActivePeriodForDividends: this.shareProductsTemplate.minimumActivePeriod, + minimumactiveperiodFrequencyType: + this.shareProductsTemplate.minimumActivePeriodForDividendsTypeEnum && + this.shareProductsTemplate.minimumActivePeriodForDividendsTypeEnum.id, + lockinPeriodFrequency: this.shareProductsTemplate.lockinPeriod, + lockinPeriodFrequencyType: + this.shareProductsTemplate.lockPeriodTypeEnum && this.shareProductsTemplate.lockPeriodTypeEnum.id, + allowDividendCalculationForInactiveClients: this.shareProductsTemplate.allowDividendCalculationForInactiveClients }); } createShareProductSettingsForm() { this.shareProductSettingsForm = this.formBuilder.group({ - 'minimumShares': [''], - 'nominalShares': ['', Validators.required], - 'maximumShares': [''], - 'minimumActivePeriodForDividends': [''], - 'minimumactiveperiodFrequencyType': [''], - 'lockinPeriodFrequency': [''], - 'lockinPeriodFrequencyType': [''], - 'allowDividendCalculationForInactiveClients': [false] + minimumShares: [''], + nominalShares: [ + '', + Validators.required + ], + maximumShares: [''], + minimumActivePeriodForDividends: [''], + minimumactiveperiodFrequencyType: [''], + lockinPeriodFrequency: [''], + lockinPeriodFrequencyType: [''], + allowDividendCalculationForInactiveClients: [false] }); } get shareProductSettings() { return this.shareProductSettingsForm.value; } - } diff --git a/src/app/products/share-products/share-product-stepper/share-product-terms-step/share-product-terms-step.component.spec.ts b/src/app/products/share-products/share-product-stepper/share-product-terms-step/share-product-terms-step.component.spec.ts index 4720695fd..26dbc02fd 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-terms-step/share-product-terms-step.component.spec.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-terms-step/share-product-terms-step.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareProductTermsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ShareProductTermsStepComponent ] - }) - .compileComponents(); + declarations: [ShareProductTermsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/share-product-stepper/share-product-terms-step/share-product-terms-step.component.ts b/src/app/products/share-products/share-product-stepper/share-product-terms-step/share-product-terms-step.component.ts index 2b1d1c3ab..83328be4c 100644 --- a/src/app/products/share-products/share-product-stepper/share-product-terms-step/share-product-terms-step.component.ts +++ b/src/app/products/share-products/share-product-stepper/share-product-terms-step/share-product-terms-step.component.ts @@ -9,7 +9,6 @@ import { TooltipPosition } from '@angular/material/tooltip'; styleUrls: ['./share-product-terms-step.component.scss'] }) export class ShareProductTermsStepComponent implements OnInit { - @Input() shareProductsTemplate: any; shareProductTermsForm: UntypedFormGroup; @@ -22,31 +21,44 @@ export class ShareProductTermsStepComponent implements OnInit { combineLatest([ this.shareProductTermsForm.get('sharesIssued').valueChanges, this.shareProductTermsForm.get('unitPrice').valueChanges - ]).subscribe(([sharesIssued, unitPrice]: number[]) => { - this.shareProductTermsForm.get('shareCapital').setValue(sharesIssued * unitPrice); - }); + ]).subscribe( + ([ + sharesIssued, + unitPrice + ]: number[]) => { + this.shareProductTermsForm.get('shareCapital').setValue(sharesIssued * unitPrice); + } + ); if (this.shareProductsTemplate) { this.shareProductTermsForm.patchValue({ - 'totalShares': this.shareProductsTemplate.totalShares, - 'sharesIssued': this.shareProductsTemplate.totalSharesIssued, - 'unitPrice': this.shareProductsTemplate.unitPrice, - 'shareCapital': this.shareProductsTemplate.shareCapital + totalShares: this.shareProductsTemplate.totalShares, + sharesIssued: this.shareProductsTemplate.totalSharesIssued, + unitPrice: this.shareProductsTemplate.unitPrice, + shareCapital: this.shareProductsTemplate.shareCapital }); } } createShareProductTermsForm() { this.shareProductTermsForm = this.formBuilder.group({ - 'totalShares': ['', Validators.required], - 'sharesIssued': ['', Validators.required], - 'unitPrice': ['', Validators.required], - 'shareCapital': [''] + totalShares: [ + '', + Validators.required + ], + sharesIssued: [ + '', + Validators.required + ], + unitPrice: [ + '', + Validators.required + ], + shareCapital: [''] }); } get shareProductTerms() { return this.shareProductTermsForm.value; } - } diff --git a/src/app/products/share-products/share-products-template.resolver.ts b/src/app/products/share-products/share-products-template.resolver.ts index 3da6a495a..4d9936777 100644 --- a/src/app/products/share-products/share-products-template.resolver.ts +++ b/src/app/products/share-products/share-products-template.resolver.ts @@ -10,7 +10,6 @@ import { ProductsService } from '../products.service'; @Injectable() export class ShareProductsTemplateResolver implements Resolve { - constructor(private productsService: ProductsService) {} /** @@ -20,5 +19,4 @@ export class ShareProductsTemplateResolver implements Resolve { resolve(): Observable { return this.productsService.getShareProductsTemplate(); } - } diff --git a/src/app/products/share-products/share-products.component.spec.ts b/src/app/products/share-products/share-products.component.spec.ts index ec64f768c..657043a21 100644 --- a/src/app/products/share-products/share-products.component.spec.ts +++ b/src/app/products/share-products/share-products.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareProductsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ShareProductsComponent ] - }) - .compileComponents(); + declarations: [ShareProductsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/share-products.component.ts b/src/app/products/share-products/share-products.component.ts index 06730c43b..0809f765f 100644 --- a/src/app/products/share-products/share-products.component.ts +++ b/src/app/products/share-products/share-products.component.ts @@ -15,9 +15,12 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura styleUrls: ['./share-products.component.scss'] }) export class ShareProductsComponent implements OnInit, AfterViewInit { - shareProductsData: any; - displayedColumns: string[] = ['name', 'shortName', 'totalShares']; + displayedColumns: string[] = [ + 'name', + 'shortName', + 'totalShares' + ]; dataSource: MatTableDataSource; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @@ -38,10 +41,12 @@ export class ShareProductsComponent implements OnInit, AfterViewInit { * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service. * @param {PopoverService} popoverService PopoverService. */ - constructor(private route: ActivatedRoute, - private router: Router, - private configurationWizardService: ConfigurationWizardService, - private popoverService: PopoverService) { + constructor( + private route: ActivatedRoute, + private router: Router, + private configurationWizardService: ConfigurationWizardService, + private popoverService: PopoverService + ) { this.route.data.subscribe((data: { shareProducts: any }) => { this.shareProductsData = data.shareProducts.pageItems; }); @@ -63,7 +68,12 @@ export class ShareProductsComponent implements OnInit, AfterViewInit { ngAfterViewInit() { if (this.configurationWizardService.showShareProductsPage === true) { setTimeout(() => { - this.showPopover(this.templateButtonCreateShareProduct, this.buttonCreateShareProduct.nativeElement, 'bottom', true); + this.showPopover( + this.templateButtonCreateShareProduct, + this.buttonCreateShareProduct.nativeElement, + 'bottom', + true + ); }); } @@ -81,7 +91,12 @@ export class ShareProductsComponent implements OnInit, AfterViewInit { * @param position String. * @param backdrop Boolean. */ - showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void { + showPopover( + template: TemplateRef, + target: HTMLElement | ElementRef, + position: string, + backdrop: boolean + ): void { setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200); } @@ -104,5 +119,4 @@ export class ShareProductsComponent implements OnInit, AfterViewInit { this.configurationWizardService.showShareProducts = true; this.router.navigate(['/products']); } - } diff --git a/src/app/products/share-products/share-products.resolver.ts b/src/app/products/share-products/share-products.resolver.ts index bf44229f8..fd7c2c5ca 100644 --- a/src/app/products/share-products/share-products.resolver.ts +++ b/src/app/products/share-products/share-products.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../products.service'; */ @Injectable() export class ShareProductsResolver implements Resolve { - /** * * @param {ProductsService} productsService Products service. @@ -27,5 +26,4 @@ export class ShareProductsResolver implements Resolve { resolve(): Observable { return this.productsService.getShareProducts(); } - } diff --git a/src/app/products/share-products/view-dividend/view-dividend-data.resolver.ts b/src/app/products/share-products/view-dividend/view-dividend-data.resolver.ts index 9788774a5..5066061e0 100644 --- a/src/app/products/share-products/view-dividend/view-dividend-data.resolver.ts +++ b/src/app/products/share-products/view-dividend/view-dividend-data.resolver.ts @@ -13,7 +13,6 @@ import { ProductsService } from '../../products.service'; */ @Injectable() export class ViewDividendDataResolver implements Resolve { - /** * @param {ProductsService} productsService Products service. */ @@ -28,5 +27,4 @@ export class ViewDividendDataResolver implements Resolve { const shareProductId = route.parent.parent.paramMap.get('productId'); return this.productsService.getDividendData(shareProductId, dividendId); } - } diff --git a/src/app/products/share-products/view-dividend/view-dividend.component.spec.ts b/src/app/products/share-products/view-dividend/view-dividend.component.spec.ts index 776ea2b72..3e390c09a 100644 --- a/src/app/products/share-products/view-dividend/view-dividend.component.spec.ts +++ b/src/app/products/share-products/view-dividend/view-dividend.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewDividendComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewDividendComponent ] - }) - .compileComponents(); + declarations: [ViewDividendComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/view-dividend/view-dividend.component.ts b/src/app/products/share-products/view-dividend/view-dividend.component.ts index cafd8bd70..9acfee9b5 100644 --- a/src/app/products/share-products/view-dividend/view-dividend.component.ts +++ b/src/app/products/share-products/view-dividend/view-dividend.component.ts @@ -11,19 +11,25 @@ import { ProductsService } from 'app/products/products.service'; styleUrls: ['./view-dividend.component.scss'] }) export class ViewDividendComponent implements OnInit { - dividendData: any; status: any; isdividendPosted = false; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @ViewChild(MatSort, { static: true }) sort: MatSort; - displayedColumns: string[] = ['clientName', 'shareAccount', 'dividendAmount', 'status']; + displayedColumns: string[] = [ + 'clientName', + 'shareAccount', + 'dividendAmount', + 'status' + ]; dataSource: MatTableDataSource; - constructor(private route: ActivatedRoute, - private productsService: ProductsService, - private router: Router) { + constructor( + private route: ActivatedRoute, + private productsService: ProductsService, + private router: Router + ) { this.route.data.subscribe((data: { dividendData: any }) => { this.dividendData = data.dividendData; }); @@ -42,13 +48,14 @@ export class ViewDividendComponent implements OnInit { postDividends() { const shareProductId = this.route.parent.parent.snapshot.paramMap.get('productId'); const dividendId = this.route.snapshot.paramMap.get('dividendId'); - this.productsService.approveDividend(shareProductId, dividendId, { productId: shareProductId, dividendId: dividendId}).subscribe(() => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.productsService + .approveDividend(shareProductId, dividendId, { productId: shareProductId, dividendId: dividendId }) + .subscribe(() => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } applyFilter(filterValue: string) { this.dataSource.filter = filterValue.trim().toLowerCase(); } - } diff --git a/src/app/products/share-products/view-share-product/share-product-datatable-tab/share-product-datatable-tab.component.spec.ts b/src/app/products/share-products/view-share-product/share-product-datatable-tab/share-product-datatable-tab.component.spec.ts index 969bd668a..5626cfcdb 100644 --- a/src/app/products/share-products/view-share-product/share-product-datatable-tab/share-product-datatable-tab.component.spec.ts +++ b/src/app/products/share-products/view-share-product/share-product-datatable-tab/share-product-datatable-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareProductDatatableTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ShareProductDatatableTabComponent ] - }) - .compileComponents(); + declarations: [ShareProductDatatableTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/share-products/view-share-product/share-product-datatable-tab/share-product-datatable-tab.component.ts b/src/app/products/share-products/view-share-product/share-product-datatable-tab/share-product-datatable-tab.component.ts index bf01169b7..80ee1edbf 100644 --- a/src/app/products/share-products/view-share-product/share-product-datatable-tab/share-product-datatable-tab.component.ts +++ b/src/app/products/share-products/view-share-product/share-product-datatable-tab/share-product-datatable-tab.component.ts @@ -7,7 +7,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./share-product-datatable-tab.component.scss'] }) export class ShareProductDatatableTabComponent { - entityId: string; entityDatatable: any; multiRowDatatableFlag: boolean; @@ -20,5 +19,4 @@ export class ShareProductDatatableTabComponent { this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); } - } diff --git a/src/app/products/share-products/view-share-product/share-product-general-tab/share-product-general-tab.component.spec.ts b/src/app/products/share-products/view-share-product/share-product-general-tab/share-product-general-tab.component.spec.ts index 96b21378e..0a5fd5ffb 100644 --- a/src/app/products/share-products/view-share-product/share-product-general-tab/share-product-general-tab.component.spec.ts +++ b/src/app/products/share-products/view-share-product/share-product-general-tab/share-product-general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('ShareProductGeneralTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ShareProductGeneralTabComponent ] - }) - .compileComponents(); + declarations: [ShareProductGeneralTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/products/share-products/view-share-product/share-product-general-tab/share-product-general-tab.component.ts b/src/app/products/share-products/view-share-product/share-product-general-tab/share-product-general-tab.component.ts index 1a51f477e..637bbb3ee 100644 --- a/src/app/products/share-products/view-share-product/share-product-general-tab/share-product-general-tab.component.ts +++ b/src/app/products/share-products/view-share-product/share-product-general-tab/share-product-general-tab.component.ts @@ -8,14 +8,23 @@ import { Accounting } from 'app/core/utils/accounting'; styleUrls: ['./share-product-general-tab.component.scss'] }) export class ShareProductGeneralTabComponent { - shareProduct: any; - marketPriceDisplayedColumns: string[] = ['fromDate', 'shareValue']; - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType']; + marketPriceDisplayedColumns: string[] = [ + 'fromDate', + 'shareValue' + ]; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType' + ]; - constructor(private route: ActivatedRoute, - private accounting: Accounting) { + constructor( + private route: ActivatedRoute, + private accounting: Accounting + ) { this.route.data.subscribe((data: { shareProduct: any }) => { this.shareProduct = data.shareProduct; }); @@ -24,5 +33,4 @@ export class ShareProductGeneralTabComponent { getAccountingRuleName(value: string): string { return this.accounting.getAccountRuleName(value.toUpperCase()); } - } diff --git a/src/app/products/share-products/view-share-product/view-share-product.component.spec.ts b/src/app/products/share-products/view-share-product/view-share-product.component.spec.ts index b8c588060..59d53598a 100644 --- a/src/app/products/share-products/view-share-product/view-share-product.component.spec.ts +++ b/src/app/products/share-products/view-share-product/view-share-product.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewShareProductComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewShareProductComponent ] - }) - .compileComponents(); + declarations: [ViewShareProductComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/products/share-products/view-share-product/view-share-product.component.ts b/src/app/products/share-products/view-share-product/view-share-product.component.ts index dae766946..729b5dac5 100644 --- a/src/app/products/share-products/view-share-product/view-share-product.component.ts +++ b/src/app/products/share-products/view-share-product/view-share-product.component.ts @@ -7,7 +7,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-share-product.component.scss'] }) export class ViewShareProductComponent { - shareProductDatatables: any = []; constructor(private route: ActivatedRoute) { @@ -18,5 +17,4 @@ export class ViewShareProductComponent { }); }); } - } diff --git a/src/app/profile/profile-routing.module.ts b/src/app/profile/profile-routing.module.ts index 89984ee0f..cfdda83e8 100644 --- a/src/app/profile/profile-routing.module.ts +++ b/src/app/profile/profile-routing.module.ts @@ -13,10 +13,11 @@ const routes: Routes = [ Route.withShell([ { path: 'profile', - component: ProfileComponent, - data: { title: 'Profile', breadcrumb: 'Profile' }, + component: ProfileComponent, + data: { title: 'Profile', breadcrumb: 'Profile' } } ]) + ]; /** @@ -27,4 +28,4 @@ const routes: Routes = [ exports: [RouterModule], providers: [] }) -export class ProfileRoutingModule { } +export class ProfileRoutingModule {} diff --git a/src/app/profile/profile.component.spec.ts b/src/app/profile/profile.component.spec.ts index 692b2340e..ffb31b7c7 100644 --- a/src/app/profile/profile.component.spec.ts +++ b/src/app/profile/profile.component.spec.ts @@ -8,9 +8,8 @@ describe('ProfileComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ProfileComponent ] - }) - .compileComponents(); + declarations: [ProfileComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/profile/profile.component.ts b/src/app/profile/profile.component.ts index f4e28c05a..94e9adeae 100644 --- a/src/app/profile/profile.component.ts +++ b/src/app/profile/profile.component.ts @@ -19,7 +19,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./profile.component.scss'] }) export class ProfileComponent implements OnInit { - /** Profile Data */ profileData: any; /** Language, TODO: Update when df, locale settings are setup */ @@ -28,7 +27,10 @@ export class ProfileComponent implements OnInit { /** Roles Table Datasource */ dataSource = new MatTableDataSource(); /** Columns to be displayed in user roles table. */ - displayedColumns: string[] = ['role', 'description']; + displayedColumns: string[] = [ + 'role', + 'description' + ]; /** * @param {AuthenticationService} authenticationService Authentication Service @@ -36,11 +38,13 @@ export class ProfileComponent implements OnInit { * @param {Router} router Router * @param {MatDialog} dialog Mat Dialog */ - constructor(private authenticationService: AuthenticationService, - private settingsService: SettingsService, - private userService: UserService, - private router: Router, - public dialog: MatDialog) { + constructor( + private authenticationService: AuthenticationService, + private settingsService: SettingsService, + private userService: UserService, + private router: Router, + public dialog: MatDialog + ) { this.profileData = authenticationService.getCredentials(); } @@ -60,7 +64,7 @@ export class ProfileComponent implements OnInit { if (response.password && response.repeatPassword) { const password = response.password; const repeatPassword = response.repeatPassword; - const data = {password: password, repeatPassword: repeatPassword}; + const data = { password: password, repeatPassword: repeatPassword }; this.userService.changePassword(this.profileData.userId, data).subscribe(() => { this.router.navigate(['/home']); }); @@ -71,5 +75,4 @@ export class ProfileComponent implements OnInit { get tenantIdentifier(): string { return this.settingsService.tenantIdentifier || 'default'; } - } diff --git a/src/app/profile/profile.module.ts b/src/app/profile/profile.module.ts index bb5c18de0..8d6b0bdaf 100644 --- a/src/app/profile/profile.module.ts +++ b/src/app/profile/profile.module.ts @@ -18,4 +18,4 @@ import { ProfileComponent } from './profile.component'; ProfileRoutingModule ] }) -export class ProfileModule { } +export class ProfileModule {} diff --git a/src/app/reports/common-models/chart-data.model.ts b/src/app/reports/common-models/chart-data.model.ts index d2a89616c..899a6ec09 100644 --- a/src/app/reports/common-models/chart-data.model.ts +++ b/src/app/reports/common-models/chart-data.model.ts @@ -1,6 +1,5 @@ /** Chart Data Model */ export class ChartData { - keysLabel: string; valuesLabel: string; keys: string[]; @@ -12,5 +11,4 @@ export class ChartData { this.keys = response.data.map((object: any) => object.row[0]); this.values = response.data.map((object: any) => object.row[1]); } - } diff --git a/src/app/reports/common-models/report-parameter.model.ts b/src/app/reports/common-models/report-parameter.model.ts index 904fa7565..9b2460841 100644 --- a/src/app/reports/common-models/report-parameter.model.ts +++ b/src/app/reports/common-models/report-parameter.model.ts @@ -1,31 +1,29 @@ /** Report Parameter Model */ export class ReportParameter { + name: string; + variable: string; + label: string; + displayType: string; + formatType: string; + defaultVal: any; + selectOne: any; + selectAll: any; + parentParameterName: string; + inputName: string; + selectOptions: any[] = []; + childParameters: any[] = []; + pentahoName: any; - name: string; - variable: string; - label: string; - displayType: string; - formatType: string; - defaultVal: any; - selectOne: any; - selectAll: any; - parentParameterName: string; - inputName: string; - selectOptions: any[] = []; - childParameters: any[] = []; - pentahoName: any; - - constructor(options: any[]) { - this.name = options[0]; - this.variable = options[1]; - this.label = options[2]; - this.displayType = options[3]; - this.formatType = options[4]; - this.defaultVal = options[5]; - this.selectOne = options[6]; - this.selectAll = options[7]; - this.parentParameterName = options[8]; - this.inputName = `R_${options[1]}`; - } - + constructor(options: any[]) { + this.name = options[0]; + this.variable = options[1]; + this.label = options[2]; + this.displayType = options[3]; + this.formatType = options[4]; + this.defaultVal = options[5]; + this.selectOne = options[6]; + this.selectAll = options[7]; + this.parentParameterName = options[8]; + this.inputName = `R_${options[1]}`; + } } diff --git a/src/app/reports/common-models/select-option.model.ts b/src/app/reports/common-models/select-option.model.ts index d6520cc19..9ac1ff5ce 100644 --- a/src/app/reports/common-models/select-option.model.ts +++ b/src/app/reports/common-models/select-option.model.ts @@ -1,11 +1,9 @@ /** Select Option model */ export class SelectOption { + id: number; + name: string; - id: number; - name: string; - - constructor(options: any[]) { - this.id = options[0], - this.name = options[1]; - } + constructor(options: any[]) { + (this.id = options[0]), (this.name = options[1]); + } } diff --git a/src/app/reports/common-resolvers/mixmappings.resolver.ts b/src/app/reports/common-resolvers/mixmappings.resolver.ts index 9de7110db..84df0e351 100644 --- a/src/app/reports/common-resolvers/mixmappings.resolver.ts +++ b/src/app/reports/common-resolvers/mixmappings.resolver.ts @@ -13,7 +13,6 @@ import { ReportsService } from '../reports.service'; */ @Injectable() export class MixMappingsResolver implements Resolve { - /** * @param {ReportsService} reportsService Reports service. */ @@ -26,5 +25,4 @@ export class MixMappingsResolver implements Resolve { resolve(): Observable { return this.reportsService.getMixMappings(); } - } diff --git a/src/app/reports/common-resolvers/mixtaxonomy.resolver.ts b/src/app/reports/common-resolvers/mixtaxonomy.resolver.ts index 967b2c100..ef7080b15 100644 --- a/src/app/reports/common-resolvers/mixtaxonomy.resolver.ts +++ b/src/app/reports/common-resolvers/mixtaxonomy.resolver.ts @@ -13,7 +13,6 @@ import { ReportsService } from '../reports.service'; */ @Injectable() export class MixTaxonomyResolver implements Resolve { - /** * @param {ReportsService} reportsService Reports service. */ @@ -26,5 +25,4 @@ export class MixTaxonomyResolver implements Resolve { resolve(): Observable { return this.reportsService.getMixTaxonomyArray(); } - } diff --git a/src/app/reports/common-resolvers/reports.resolver.ts b/src/app/reports/common-resolvers/reports.resolver.ts index 91bc28f99..295088304 100644 --- a/src/app/reports/common-resolvers/reports.resolver.ts +++ b/src/app/reports/common-resolvers/reports.resolver.ts @@ -13,7 +13,6 @@ import { ReportsService } from '../reports.service'; */ @Injectable() export class ReportsResolver implements Resolve { - /** * @param {ReportsService} reportsService Reports service. */ @@ -26,5 +25,4 @@ export class ReportsResolver implements Resolve { resolve(): Observable { return this.reportsService.getReports(); } - } diff --git a/src/app/reports/common-resolvers/run-report.resolver.ts b/src/app/reports/common-resolvers/run-report.resolver.ts index 4a800e849..d78d30238 100644 --- a/src/app/reports/common-resolvers/run-report.resolver.ts +++ b/src/app/reports/common-resolvers/run-report.resolver.ts @@ -13,7 +13,6 @@ import { ReportsService } from '../reports.service'; */ @Injectable() export class RunReportResolver implements Resolve { - /** * @param {ReportsService} reportsService Reports service. */ @@ -26,5 +25,4 @@ export class RunReportResolver implements Resolve { resolve(route: ActivatedRouteSnapshot): Observable { return this.reportsService.getReportParams(route.params['name']); } - } diff --git a/src/app/reports/reports-routing.module.ts b/src/app/reports/reports-routing.module.ts index 1615819ed..495e09509 100644 --- a/src/app/reports/reports-routing.module.ts +++ b/src/app/reports/reports-routing.module.ts @@ -70,6 +70,7 @@ const routes: Routes = [ ] } ]) + ]; /** @@ -88,4 +89,4 @@ const routes: Routes = [ GlAccountsResolver ] }) -export class ReportsRoutingModule { } +export class ReportsRoutingModule {} diff --git a/src/app/reports/reports.component.ts b/src/app/reports/reports.component.ts index 4c64b20c9..f09cea59b 100644 --- a/src/app/reports/reports.component.ts +++ b/src/app/reports/reports.component.ts @@ -14,13 +14,16 @@ import { ActivatedRoute, Router } from '@angular/router'; styleUrls: ['./reports.component.scss'] }) export class ReportsComponent implements OnInit { - /** Reports data. */ reportsData: any; /** Report category filter. */ filter: string; /** Columns to be displayed in reports table. */ - displayedColumns: string[] = ['reportName', 'reportType', 'reportCategory']; + displayedColumns: string[] = [ + 'reportName', + 'reportType', + 'reportCategory' + ]; /** Data source for reports table. */ dataSource = new MatTableDataSource(); @@ -35,10 +38,12 @@ export class ReportsComponent implements OnInit { * Prevents reuse of route parameter `filter`. * @param {Router} router: Router. */ - constructor(private route: ActivatedRoute, - private router: Router) { + constructor( + private route: ActivatedRoute, + private router: Router + ) { this.router.routeReuseStrategy.shouldReuseRoute = () => false; - this.route.data.subscribe(( data: { reports: any }) => { + this.route.data.subscribe((data: { reports: any }) => { this.reportsData = data.reports; }); this.filter = this.route.snapshot.params['filter']; @@ -58,8 +63,8 @@ export class ReportsComponent implements OnInit { */ applyFilter(filterValue: string) { if (filterValue.length) { - this.setCustomFilterPredicate(); - this.dataSource.filter = filterValue.trim().toLowerCase(); + this.setCustomFilterPredicate(); + this.dataSource.filter = filterValue.trim().toLowerCase(); } else { this.filterReportsByCategory(); } @@ -89,22 +94,23 @@ export class ReportsComponent implements OnInit { */ setCustomFilterPredicate() { this.dataSource.filterPredicate = (data: any, filter: string) => { - /** Transform the data into a lowercase string of all property values. */ - const dataStr = Object.keys(data).reduce(function (currentTerm: string, key: string) { - /** Use an obscure Unicode character to delimit the words in the concatenated string. - * This avoids matches where the values of two columns combined will match the user's query - */ - return currentTerm + ((/** @type {any} */ (data)))[key] + 'â—¬'; - }, '').toLowerCase(); - /** Transform the filter by converting it to lowercase and removing whitespace. */ - const transformedFilter = filter.trim().toLowerCase(); - /* Seperates filter for All reports page.*/ - if (this.filter) { - return dataStr.indexOf(transformedFilter) !== -1 && data.reportCategory === this.filter; - } else { - return dataStr.indexOf(transformedFilter) !== -1; - } + /** Transform the data into a lowercase string of all property values. */ + const dataStr = Object.keys(data) + .reduce(function (currentTerm: string, key: string) { + /** Use an obscure Unicode character to delimit the words in the concatenated string. + * This avoids matches where the values of two columns combined will match the user's query + */ + return currentTerm + /** @type {any} */ data[key] + 'â—¬'; + }, '') + .toLowerCase(); + /** Transform the filter by converting it to lowercase and removing whitespace. */ + const transformedFilter = filter.trim().toLowerCase(); + /* Seperates filter for All reports page.*/ + if (this.filter) { + return dataStr.indexOf(transformedFilter) !== -1 && data.reportCategory === this.filter; + } else { + return dataStr.indexOf(transformedFilter) !== -1; + } }; } - } diff --git a/src/app/reports/reports.module.ts b/src/app/reports/reports.module.ts index 836f3f900..0439f202e 100644 --- a/src/app/reports/reports.module.ts +++ b/src/app/reports/reports.module.ts @@ -34,6 +34,6 @@ import { XBRLReportComponent } from './xbrl-report/xbrl-report.component'; XBRLComponent, XBRLReportComponent ], - providers: [ DecimalPipe ] + providers: [DecimalPipe] }) -export class ReportsModule { } +export class ReportsModule {} diff --git a/src/app/reports/reports.service.ts b/src/app/reports/reports.service.ts index 7f389aa76..fe5fd1341 100644 --- a/src/app/reports/reports.service.ts +++ b/src/app/reports/reports.service.ts @@ -18,11 +18,10 @@ import { ChartData } from './common-models/chart-data.model'; providedIn: 'root' }) export class ReportsService { - /** * @param {HttpClient} http Http Client to send requests. */ - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * @returns {Observable} Reports data @@ -58,9 +57,7 @@ export class ReportsService { * @returns {Observable} Mix Report */ getMixReport(dates: any): Observable { - const httpParams = new HttpParams() - .set('startDate', dates.startDate) - .set('endDate', dates.endDate); + const httpParams = new HttpParams().set('startDate', dates.startDate).set('endDate', dates.endDate); return this.http.get('/mixreport', { params: httpParams, responseType: 'text' }); } @@ -69,11 +66,10 @@ export class ReportsService { * @returns {Observable} */ getReportParams(reportName: string): Observable { - const httpParams = new HttpParams() - .set('R_reportListing', `'${reportName}'`) - .set('parameterType', 'true'); - return this.http.get(`/runreports/FullParameterList`, {params: httpParams}) - .pipe(map((response: any) => response.data.map((entry: any) => new ReportParameter(entry.row)) )); + const httpParams = new HttpParams().set('R_reportListing', `'${reportName}'`).set('parameterType', 'true'); + return this.http + .get(`/runreports/FullParameterList`, { params: httpParams }) + .pipe(map((response: any) => response.data.map((entry: any) => new ReportParameter(entry.row)))); } /** @@ -82,8 +78,9 @@ export class ReportsService { */ getSelectOptions(inputString: string): Observable { const httpParams = new HttpParams().set('parameterType', 'true'); - return this.http.get(`/runreports/${inputString}`, {params: httpParams}) - .pipe(map((response: any) => response.data.map((entry: any) => new SelectOption(entry.row)) )); + return this.http + .get(`/runreports/${inputString}`, { params: httpParams }) + .pipe(map((response: any) => response.data.map((entry: any) => new SelectOption(entry.row)))); } /** @@ -92,7 +89,8 @@ export class ReportsService { */ getPentahoParams(reportId: number): Observable { const httpParams = new HttpParams().set('fields', 'reportParameters'); - return this.http.get(`/reports/${reportId}`, {params: httpParams}) + return this.http + .get(`/reports/${reportId}`, { params: httpParams }) .pipe(map((response: any) => response.reportParameters)); } @@ -104,10 +102,13 @@ export class ReportsService { */ getRunReportData(reportName: string, formData: object): Observable { let httpParams = new HttpParams(); - for (const [key, value] of Object.entries(formData)) { + for (const [ + key, + value + ] of Object.entries(formData)) { httpParams = httpParams.set(key, value); } - return this.http.get(`/runreports/${reportName}`, {params: httpParams}); + return this.http.get(`/runreports/${reportName}`, { params: httpParams }); } /** @@ -118,11 +119,15 @@ export class ReportsService { */ getChartRunReportData(reportName: string, formData: object): Observable { let httpParams = new HttpParams(); - for (const [key, value] of Object.entries(formData)) { + for (const [ + key, + value + ] of Object.entries(formData)) { httpParams = httpParams.set(key, value); } - return this.http.get(`/runreports/${reportName}`, {params: httpParams}) - .pipe(map((response: any) => new ChartData(response))); + return this.http + .get(`/runreports/${reportName}`, { params: httpParams }) + .pipe(map((response: any) => new ChartData(response))); } /** @@ -131,15 +136,27 @@ export class ReportsService { * @param {object} formData Form Data. * @returns {Observable} */ - getPentahoRunReportData(reportName: string, formData: object, tenantIdentifier: string, locale: string, dateFormat: string): Observable { + getPentahoRunReportData( + reportName: string, + formData: object, + tenantIdentifier: string, + locale: string, + dateFormat: string + ): Observable { let httpParams = new HttpParams() - .set('tenantIdentifier', tenantIdentifier) - .set('locale', locale) - .set('dateFormat', dateFormat); - for (const [key, value] of Object.entries(formData)) { + .set('tenantIdentifier', tenantIdentifier) + .set('locale', locale) + .set('dateFormat', dateFormat); + for (const [ + key, + value + ] of Object.entries(formData)) { httpParams = httpParams.set(key, value); } - return this.http.get(`/runreports/${reportName}`, {responseType: 'arraybuffer', observe: 'response', params: httpParams}); + return this.http.get(`/runreports/${reportName}`, { + responseType: 'arraybuffer', + observe: 'response', + params: httpParams + }); } - } diff --git a/src/app/reports/run-report/chart/chart.component.spec.ts b/src/app/reports/run-report/chart/chart.component.spec.ts index 4bfa61135..3e0b4615b 100644 --- a/src/app/reports/run-report/chart/chart.component.spec.ts +++ b/src/app/reports/run-report/chart/chart.component.spec.ts @@ -8,9 +8,8 @@ describe('ChartComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChartComponent ] - }) - .compileComponents(); + declarations: [ChartComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/reports/run-report/chart/chart.component.ts b/src/app/reports/run-report/chart/chart.component.ts index 44f05c76b..dbdd4b134 100644 --- a/src/app/reports/run-report/chart/chart.component.ts +++ b/src/app/reports/run-report/chart/chart.component.ts @@ -16,10 +16,9 @@ import Chart from 'chart.js'; @Component({ selector: 'mifosx-chart', templateUrl: './chart.component.html', - styleUrls: ['./chart.component.scss' ] + styleUrls: ['./chart.component.scss'] }) export class ChartComponent implements OnChanges { - /** Run Report Data */ @Input() dataObject: any; @@ -33,7 +32,7 @@ export class ChartComponent implements OnChanges { /** * @param {ReportsService} reportsService Reports Service */ - constructor(private reportsService: ReportsService) { } + constructor(private reportsService: ReportsService) {} /** * Fetches run report data post changes in run report form. @@ -43,12 +42,13 @@ export class ChartComponent implements OnChanges { } getRunReportData() { - this.reportsService.getChartRunReportData(this.dataObject.report.name, this.dataObject.formData) - .subscribe((response: ChartData) => { - this.inputData = response; - this.setPieChart(this.inputData); - this.hideOutput = false; - }); + this.reportsService + .getChartRunReportData(this.dataObject.report.name, this.dataObject.formData) + .subscribe((response: ChartData) => { + this.inputData = response; + this.setPieChart(this.inputData); + this.hideOutput = false; + }); } /** @@ -62,12 +62,14 @@ export class ChartComponent implements OnChanges { this.chart = new Chart('output', { type: 'pie', data: { - labels: inputData.keys, - datasets: [{ - label: inputData.valuesLabel, - data: inputData.values, - backgroundColor: this.randomColorArray(inputData.values.length) - }] + labels: inputData.keys, + datasets: [ + { + label: inputData.valuesLabel, + data: inputData.values, + backgroundColor: this.randomColorArray(inputData.values.length) + } + ] }, options: { title: { @@ -90,24 +92,28 @@ export class ChartComponent implements OnChanges { type: 'bar', data: { labels: inputData.keys, - datasets: [{ + datasets: [ + { label: inputData.valuesLabel, data: inputData.values, backgroundColor: this.randomColorArray(inputData.values.length) - }] + } + ] }, options: { legend: { display: false }, scales: { - xAxes: [{ - scaleLabel: { - display: true, - labelString: inputData.keysLabel - }, - ticks: { - beginAtZero: true + xAxes: [ + { + scaleLabel: { + display: true, + labelString: inputData.keysLabel + }, + ticks: { + beginAtZero: true + } } - }] + ] } } }); @@ -135,5 +141,4 @@ export class ChartComponent implements OnChanges { const b = Math.floor(Math.random() * 255); return `rgb(${r},${g},${b},0.6)`; } - } diff --git a/src/app/reports/run-report/pentaho/pentaho.component.spec.ts b/src/app/reports/run-report/pentaho/pentaho.component.spec.ts index 2b84baca4..5ff1aedc8 100644 --- a/src/app/reports/run-report/pentaho/pentaho.component.spec.ts +++ b/src/app/reports/run-report/pentaho/pentaho.component.spec.ts @@ -8,9 +8,8 @@ describe('PentahoComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PentahoComponent ] - }) - .compileComponents(); + declarations: [PentahoComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/reports/run-report/pentaho/pentaho.component.ts b/src/app/reports/run-report/pentaho/pentaho.component.ts index ffc48b070..3878d8399 100644 --- a/src/app/reports/run-report/pentaho/pentaho.component.ts +++ b/src/app/reports/run-report/pentaho/pentaho.component.ts @@ -16,7 +16,6 @@ import { ProgressBarService } from 'app/core/progress-bar/progress-bar.service'; styleUrls: ['./pentaho.component.scss'] }) export class PentahoComponent implements OnChanges { - /** Run Report Data */ @Input() dataObject: any; @@ -30,10 +29,12 @@ export class PentahoComponent implements OnChanges { * @param {ReportsService} reportsService Reports Service * @param {SettingsService} settingsService Settings Service */ - constructor(private sanitizer: DomSanitizer, - private reportsService: ReportsService, - private settingsService: SettingsService, - private progressBarService: ProgressBarService) { } + constructor( + private sanitizer: DomSanitizer, + private reportsService: ReportsService, + private settingsService: SettingsService, + private progressBarService: ProgressBarService + ) {} /** * Fetches run report data post changes in run report form. @@ -44,15 +45,21 @@ export class PentahoComponent implements OnChanges { } getRunReportData() { - this.reportsService.getPentahoRunReportData(this.dataObject.report.name, this.dataObject.formData, 'default', this.settingsService.language.code, this.settingsService.dateFormat) - .subscribe( (res: any) => { + this.reportsService + .getPentahoRunReportData( + this.dataObject.report.name, + this.dataObject.formData, + 'default', + this.settingsService.language.code, + this.settingsService.dateFormat + ) + .subscribe((res: any) => { const contentType = res.headers.get('Content-Type'); - const file = new Blob([res.body], {type: contentType}); + const file = new Blob([res.body], { type: contentType }); const filecontent = URL.createObjectURL(file); this.pentahoUrl = this.sanitizer.bypassSecurityTrustResourceUrl(filecontent); this.hideOutput = false; this.progressBarService.decrease(); }); } - } diff --git a/src/app/reports/run-report/run-report.component.spec.ts b/src/app/reports/run-report/run-report.component.spec.ts index b6d4de470..ece6566fb 100644 --- a/src/app/reports/run-report/run-report.component.spec.ts +++ b/src/app/reports/run-report/run-report.component.spec.ts @@ -8,9 +8,8 @@ describe('RunReportComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RunReportComponent ] - }) - .compileComponents(); + declarations: [RunReportComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/reports/run-report/run-report.component.ts b/src/app/reports/run-report/run-report.component.ts index 8c63fe2f5..5289af67d 100644 --- a/src/app/reports/run-report/run-report.component.ts +++ b/src/app/reports/run-report/run-report.component.ts @@ -25,7 +25,6 @@ import { AlertService } from 'app/core/alert/alert.service'; styleUrls: ['./run-report.component.scss'] }) export class RunReportComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -51,9 +50,9 @@ export class RunReportComponent implements OnInit { isCollapsed = false; /** Toggles Table output. */ hideTable = true; - /** Toggles Chart output */ + /** Toggles Chart output */ hideChart = true; - /** Toggles Pentaho output */ + /** Toggles Pentaho output */ hidePentaho = true; /** Report uses dates */ reportUsesDates = false; @@ -71,17 +70,19 @@ export class RunReportComponent implements OnInit { * @param {SettingsService} settingsService Settings Service * @param {Dates} dateUtils Date Utils */ - constructor(private route: ActivatedRoute, - private reportsService: ReportsService, - private settingsService: SettingsService, - private alertService: AlertService, - private dateUtils: Dates) { + constructor( + private route: ActivatedRoute, + private reportsService: ReportsService, + private settingsService: SettingsService, + private alertService: AlertService, + private dateUtils: Dates + ) { this.report.name = this.route.snapshot.params['name']; - this.route.queryParams.subscribe((queryParams: { type: any, id: any }) => { + this.route.queryParams.subscribe((queryParams: { type: any; id: any }) => { this.report.type = queryParams.type; this.report.id = queryParams.id; }); - this.route.data.subscribe((data: { reportParameters: ReportParameter[], configurations: any }) => { + this.route.data.subscribe((data: { reportParameters: ReportParameter[]; configurations: any }) => { this.paramData = data.reportParameters; if (this.isTableReport()) { data.configurations.globalConfiguration.forEach((config: GlobalConfiguration) => { @@ -95,11 +96,11 @@ export class RunReportComponent implements OnInit { } isTableReport(): boolean { - return (this.report.type === 'Table'); + return this.report.type === 'Table'; } isPentahoReport(): boolean { - return (this.report.type === 'Pentaho'); + return this.report.type === 'Pentaho'; } /** @@ -115,30 +116,30 @@ export class RunReportComponent implements OnInit { * Fetches dropdown options and builds child dependencies. */ createRunReportForm() { - this.paramData.forEach( - (param: ReportParameter) => { - if (!param.parentParameterName) { // Non Child Parameter - this.reportForm.addControl(param.name, new UntypedFormControl('', Validators.required)); - if (param.displayType === 'select') { - this.fetchSelectOptions(param, param.name); - } - } else { // Child Parameter - const parent: ReportParameter = this.paramData - .find((entry: any) => entry.name === param.parentParameterName); - if (parent != null) { - parent.childParameters.push(param); - this.updateParentParameters(parent); - } + this.paramData.forEach((param: ReportParameter) => { + if (!param.parentParameterName) { + // Non Child Parameter + this.reportForm.addControl(param.name, new UntypedFormControl('', Validators.required)); + if (param.displayType === 'select') { + this.fetchSelectOptions(param, param.name); } - }); + } else { + // Child Parameter + const parent: ReportParameter = this.paramData.find((entry: any) => entry.name === param.parentParameterName); + if (parent != null) { + parent.childParameters.push(param); + this.updateParentParameters(parent); + } + } + }); if (this.isPentahoReport()) { this.reportForm.addControl('outputType', new UntypedFormControl('', Validators.required)); this.outputTypeOptions = [ - { 'name': 'PDF format', 'value': 'PDF' }, - { 'name': 'Normal format', 'value': 'HTML' }, - { 'name': 'Excel format', 'value': 'XLS' }, - { 'name': 'Excel 2007 format', 'value': 'XLSX' }, - { 'name': 'CSV format', 'value': 'CSV' } + { name: 'PDF format', value: 'PDF' }, + { name: 'Normal format', value: 'HTML' }, + { name: 'Excel format', value: 'XLS' }, + { name: 'Excel 2007 format', value: 'XLSX' }, + { name: 'CSV format', value: 'CSV' } ]; this.mapPentahoParams(); } @@ -154,10 +155,12 @@ export class RunReportComponent implements OnInit { * @param {ReportParameter} parent Parent report parameter */ updateParentParameters(parent: ReportParameter) { - const parentNames = this.parentParameters.map(parameter => parameter.name); - if (!parentNames.includes(parent.name)) { // Parent's first child. + const parentNames = this.parentParameters.map((parameter) => parameter.name); + if (!parentNames.includes(parent.name)) { + // Parent's first child. this.parentParameters.push(parent); - } else { // Parent already has a child + } else { + // Parent already has a child const index = parentNames.indexOf(parent.name); this.parentParameters[index] = parent; } @@ -169,8 +172,7 @@ export class RunReportComponent implements OnInit { mapPentahoParams() { this.reportsService.getPentahoParams(this.report.id).subscribe((data: any) => { data.forEach((entry: any) => { - const param: ReportParameter = this.paramData - .find((_entry: any) => _entry.name === entry.parameterName); + const param: ReportParameter = this.paramData.find((_entry: any) => _entry.name === entry.parameterName); param.pentahoName = `R_${entry.reportParameterName}`; }); }); @@ -206,7 +208,7 @@ export class RunReportComponent implements OnInit { this.reportsService.getSelectOptions(inputstring).subscribe((options: SelectOption[]) => { param.selectOptions = options; if (param.selectAll === 'Y') { - param.selectOptions.push({id: '-1', name: 'All'}); + param.selectOptions.push({ id: '-1', name: 'All' }); } }); } @@ -219,7 +221,10 @@ export class RunReportComponent implements OnInit { const formattedResponse: any = {}; let newKey: string; this.reportToBeExportedInRepository = false; - for (const [key, value] of Object.entries(response)) { + for (const [ + key, + value + ] of Object.entries(response)) { if (key === 'outputType') { formattedResponse['output-type'] = value; continue; @@ -228,8 +233,7 @@ export class RunReportComponent implements OnInit { continue; } - const param: ReportParameter = this.paramData - .find((_entry: any) => _entry.name === key); + const param: ReportParameter = this.paramData.find((_entry: any) => _entry.name === key); newKey = this.isPentahoReport() ? param.pentahoName : param.inputName; switch (param.displayType) { case 'text': @@ -261,7 +265,7 @@ export class RunReportComponent implements OnInit { this.isCollapsed = true; const userResponseValues = this.formatUserResponse(this.reportForm.value); let formData = { - ...userResponseValues, + ...userResponseValues }; if (this.reportUsesDates) { let dateFormat = this.settingsService.dateFormat; @@ -286,13 +290,13 @@ export class RunReportComponent implements OnInit { case 'SMS': case 'Table': this.hideTable = false; - break; + break; case 'Chart': this.hideChart = false; - break; + break; case 'Pentaho': this.hidePentaho = false; - break; + break; } } @@ -304,13 +308,12 @@ export class RunReportComponent implements OnInit { const reportName = this.report.name; const payload = { ...userResponseValues, - decimalChoice: this.decimalChoice.value, + decimalChoice: this.decimalChoice.value // exportCSV: true }; - this.reportsService.getRunReportData(reportName, payload) - .subscribe( (res: any) => { + this.reportsService.getRunReportData(reportName, payload).subscribe((res: any) => { if (res.data.length > 0) { - this.alertService.alert({type: 'Report generation', message: `Report: ${reportName} data generated`}); + this.alertService.alert({ type: 'Report generation', message: `Report: ${reportName} data generated` }); const displayedColumns: string[] = []; res.columnHeaders.forEach((header: any) => { @@ -319,7 +322,7 @@ export class RunReportComponent implements OnInit { this.exportToXLS(reportName, res.data, displayedColumns); } else { - this.alertService.alert({type: 'Report generation', message: `Report: ${reportName} without data generated`}); + this.alertService.alert({ type: 'Report generation', message: `Report: ${reportName} without data generated` }); } this.isProcessing = false; }); @@ -334,10 +337,9 @@ export class RunReportComponent implements OnInit { } return row; }); - const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet(data, {header: displayedColumns}); + const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet(data, { header: displayedColumns }); const wb: XLSX.WorkBook = XLSX.utils.book_new(); XLSX.utils.book_append_sheet(wb, ws, 'report'); XLSX.writeFile(wb, fileName); } - } diff --git a/src/app/reports/run-report/table-and-sms/table-and-sms.component.spec.ts b/src/app/reports/run-report/table-and-sms/table-and-sms.component.spec.ts index cee38749b..12ffc50e9 100644 --- a/src/app/reports/run-report/table-and-sms/table-and-sms.component.spec.ts +++ b/src/app/reports/run-report/table-and-sms/table-and-sms.component.spec.ts @@ -8,9 +8,8 @@ describe('TableAndSmsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ TableAndSmsComponent ] - }) - .compileComponents(); + declarations: [TableAndSmsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/reports/run-report/table-and-sms/table-and-sms.component.ts b/src/app/reports/run-report/table-and-sms/table-and-sms.component.ts index a76c8df0f..65017e395 100644 --- a/src/app/reports/run-report/table-and-sms/table-and-sms.component.ts +++ b/src/app/reports/run-report/table-and-sms/table-and-sms.component.ts @@ -25,7 +25,6 @@ import * as XLSX from 'xlsx'; styleUrls: ['./table-and-sms.component.scss'] }) export class TableAndSmsComponent implements OnChanges { - /** Run Report Data */ @Input() dataObject: any; @@ -49,10 +48,12 @@ export class TableAndSmsComponent implements OnChanges { * @param {ReportsService} reportsService Reports Service * @param {DecimalPipe} decimalPipe Decimal Pipe */ - constructor(private reportsService: ReportsService, - public dialog: MatDialog, - private decimalPipe: DecimalPipe, - private progressBarService: ProgressBarService) { } + constructor( + private reportsService: ReportsService, + public dialog: MatDialog, + private decimalPipe: DecimalPipe, + private progressBarService: ProgressBarService + ) {} /** * Fetches run report data post changes in run report form. @@ -66,21 +67,22 @@ export class TableAndSmsComponent implements OnChanges { getRunReportData() { const exportS3 = this.dataObject.formData.exportS3; - this.reportsService.getRunReportData(this.dataObject.report.name, this.dataObject.formData) - .subscribe( (res: any) => { - this.toBeExportedToRepo = exportS3; - if (!this.toBeExportedToRepo) { - this.csvData = res.data; - this.notExistsReportData = (res.data.length === 0); - this.setOutputTable(res.data); - res.columnHeaders.forEach((header: any) => { - this.columnTypes.push(header.columnDisplayType); - this.displayedColumns.push(header.columnName); - }); - } - this.hideOutput = false; - this.progressBarService.decrease(); - }); + this.reportsService + .getRunReportData(this.dataObject.report.name, this.dataObject.formData) + .subscribe((res: any) => { + this.toBeExportedToRepo = exportS3; + if (!this.toBeExportedToRepo) { + this.csvData = res.data; + this.notExistsReportData = res.data.length === 0; + this.setOutputTable(res.data); + res.columnHeaders.forEach((header: any) => { + this.columnTypes.push(header.columnDisplayType); + this.displayedColumns.push(header.columnName); + }); + } + this.hideOutput = false; + this.progressBarService.decrease(); + }); } /** @@ -99,11 +101,11 @@ export class TableAndSmsComponent implements OnChanges { */ exportFile() { const delimiterOptions: any[] = [ - {name: 'Comma (,)', char: ','}, - {name: 'Colon (:)', char: ':'}, - {name: 'SemiColon (;)', char: ';'}, - {name: 'Pipe (|)', char: '|'}, - {name: 'Space ( )', char: ' '}, + { name: 'Comma (,)', char: ',' }, + { name: 'Colon (:)', char: ':' }, + { name: 'SemiColon (;)', char: ';' }, + { name: 'Pipe (|)', char: '|' }, + { name: 'Space ( )', char: ' ' } ]; const fileName = `${this.dataObject.report.name}.csv`; const formfields: FormfieldBase[] = [ @@ -123,6 +125,7 @@ export class TableAndSmsComponent implements OnChanges { required: true, order: 2 }) + ]; const data = { title: 'Export data to File', @@ -146,7 +149,7 @@ export class TableAndSmsComponent implements OnChanges { } return row; }); - const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet(data, {header: this.displayedColumns}); + const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet(data, { header: this.displayedColumns }); const wb: XLSX.WorkBook = XLSX.utils.book_new(); XLSX.utils.book_append_sheet(wb, ws, 'Report'); XLSX.writeFile(wb, fileName); @@ -184,5 +187,4 @@ export class TableAndSmsComponent implements OnChanges { isDecimal(index: number) { return this.columnTypes[index] === 'DECIMAL'; } - } diff --git a/src/app/reports/xbrl-report/xbrl-report.component.spec.ts b/src/app/reports/xbrl-report/xbrl-report.component.spec.ts index 4838c85dc..a5bb55f13 100644 --- a/src/app/reports/xbrl-report/xbrl-report.component.spec.ts +++ b/src/app/reports/xbrl-report/xbrl-report.component.spec.ts @@ -8,9 +8,8 @@ describe('XBRLReportComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ XBRLReportComponent ] - }) - .compileComponents(); + declarations: [XBRLReportComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/reports/xbrl-report/xbrl-report.component.ts b/src/app/reports/xbrl-report/xbrl-report.component.ts index 83f9b6319..0a7407ce4 100644 --- a/src/app/reports/xbrl-report/xbrl-report.component.ts +++ b/src/app/reports/xbrl-report/xbrl-report.component.ts @@ -1,6 +1,6 @@ /** Angular Imports */ import { Component, OnInit } from '@angular/core'; -import { UntypedFormGroup, UntypedFormBuilder, Validators, UntypedFormControl} from '@angular/forms'; +import { UntypedFormGroup, UntypedFormBuilder, Validators, UntypedFormControl } from '@angular/forms'; import { MatTableDataSource } from '@angular/material/table'; import { DomSanitizer } from '@angular/platform-browser'; @@ -18,7 +18,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./xbrl-report.component.scss'] }) export class XBRLReportComponent implements OnInit { - /** Minimum Due Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Due Date allowed. */ @@ -34,7 +33,11 @@ export class XBRLReportComponent implements OnInit { /** Trusted url resource for xml download */ fileUrl: any; /** Columns to be displayed in XBRL reports table */ - displayedColumns: string[] = ['name', 'dimension', 'value']; + displayedColumns: string[] = [ + 'name', + 'dimension', + 'value' + ]; /** Data source for XBRL reports table */ dataSource = new MatTableDataSource(); @@ -44,15 +47,17 @@ export class XBRLReportComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private reportService: ReportsService, - private formBuilder: UntypedFormBuilder, - private settingsService: SettingsService, - private dateUtils: Dates, - private sanitizer: DomSanitizer) {} + constructor( + private reportService: ReportsService, + private formBuilder: UntypedFormBuilder, + private settingsService: SettingsService, + private dateUtils: Dates, + private sanitizer: DomSanitizer + ) {} - /** - * Creates the XBRL form. - */ + /** + * Creates the XBRL form. + */ ngOnInit() { this.maxDate = this.settingsService.businessDate; this.createXbrlForm(); @@ -60,8 +65,14 @@ export class XBRLReportComponent implements OnInit { createXbrlForm() { this.xbrlForm = this.formBuilder.group({ - 'startDate': ['', Validators.required], - 'endDate': ['', Validators.required], + startDate: [ + '', + Validators.required + ], + endDate: [ + '', + Validators.required + ] }); } @@ -72,7 +83,7 @@ export class XBRLReportComponent implements OnInit { buildXMLTable(response: any) { const parser = new DOMParser(); const xml = parser.parseFromString(response, 'text/xml'); - xml.querySelectorAll('[contextRef]').forEach( (element: HTMLElement) => { + xml.querySelectorAll('[contextRef]').forEach((element: HTMLElement) => { const contextId = element.getAttribute('contextRef'); const scenario = xml.querySelector(`#${contextId}`).querySelector('scenario'); const context = scenario ? scenario.textContent : undefined; @@ -113,8 +124,8 @@ export class XBRLReportComponent implements OnInit { submit() { const parser = new DOMParser(); const xmlDOM = parser.parseFromString(this.rawXml, 'text/xml'); - xmlDOM.querySelectorAll('[contextRef]').forEach( (element: HTMLElement) => { - this.xmlData.forEach( (entry: any) => { + xmlDOM.querySelectorAll('[contextRef]').forEach((element: HTMLElement) => { + this.xmlData.forEach((entry: any) => { if (entry.name === element.tagName) { element.textContent = entry.value.value; } @@ -126,6 +137,4 @@ export class XBRLReportComponent implements OnInit { this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(window.URL.createObjectURL(blob)); return this.fileUrl; } - } - diff --git a/src/app/reports/xbrl/xbrl.component.spec.ts b/src/app/reports/xbrl/xbrl.component.spec.ts index 9ef206092..faf524a0f 100644 --- a/src/app/reports/xbrl/xbrl.component.spec.ts +++ b/src/app/reports/xbrl/xbrl.component.spec.ts @@ -8,9 +8,8 @@ describe('XBRLComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ XBRLComponent ] - }) - .compileComponents(); + declarations: [XBRLComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/reports/xbrl/xbrl.component.ts b/src/app/reports/xbrl/xbrl.component.ts index 0f0f385d9..2fdd60add 100644 --- a/src/app/reports/xbrl/xbrl.component.ts +++ b/src/app/reports/xbrl/xbrl.component.ts @@ -16,7 +16,6 @@ import { ReportsService } from '../reports.service'; styleUrls: ['./xbrl.component.scss'] }) export class XBRLComponent implements OnInit, AfterViewInit { - /** Mix Taxonomy Array */ mixtaxonomyArray: any = []; /** Mix Mappings */ @@ -26,7 +25,12 @@ export class XBRLComponent implements OnInit, AfterViewInit { /** Filtered GL Accounts */ filteredGlAccounts: any; /** Columns to be displayed in reports table. */ - displayedColumns: string[] = ['info', 'name', 'dimension', 'mapping']; + displayedColumns: string[] = [ + 'info', + 'name', + 'dimension', + 'mapping' + ]; /** Data source for reports table. */ dataSource = new MatTableDataSource(); /** XBRL save status */ @@ -39,10 +43,12 @@ export class XBRLComponent implements OnInit, AfterViewInit { * @param {Router} router: Route. * @param {ReportService} reportService ReportService */ - constructor(private route: ActivatedRoute, - private router: Router, - private reportService: ReportsService) { - this.route.data.subscribe(( data: { mixtaxonomy: any, mixmapping: any, glAccounts: any }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private reportService: ReportsService + ) { + this.route.data.subscribe((data: { mixtaxonomy: any; mixmapping: any; glAccounts: any }) => { this.mixtaxonomyArray = data.mixtaxonomy; this.mixMappingJson = data.mixmapping.config || JSON.stringify({}); this.glAccounts = data.glAccounts; @@ -56,19 +62,21 @@ export class XBRLComponent implements OnInit, AfterViewInit { if (localStorage.getItem('XbrlReportSaveSuccess')) { localStorage.removeItem('XbrlReportSaveSuccess'); this.XBRLSuccess = true; - setTimeout(() => { this.XBRLSuccess = false; }, 3000); + setTimeout(() => { + this.XBRLSuccess = false; + }, 3000); } this.createMappings(); this.dataSource = new MatTableDataSource(this.mixtaxonomyArray); this.setDatasourceFilter(); } - /** - * Subscribe to taxonomy's value changes and filters options accordingly. - */ + /** + * Subscribe to taxonomy's value changes and filters options accordingly. + */ ngAfterViewInit() { this.mixtaxonomyArray.forEach((taxonomy: any) => { - taxonomy.mapping?.valueChanges.subscribe( (value: string) => { + taxonomy.mapping?.valueChanges.subscribe((value: string) => { this.filteredGlAccounts = this.applyFilter(value); }); }); @@ -80,8 +88,8 @@ export class XBRLComponent implements OnInit, AfterViewInit { createMappings() { this.mixtaxonomyArray.forEach((taxonomy: any) => { const mapping = JSON.parse(this.mixMappingJson)[taxonomy.id]; - taxonomy.mapping = new UntypedFormControl(''); - taxonomy.mapping.value = mapping || ''; + taxonomy.mapping = new UntypedFormControl(''); + taxonomy.mapping.value = mapping || ''; }); } @@ -120,8 +128,8 @@ export class XBRLComponent implements OnInit, AfterViewInit { * @returns {string} Gl Account name if valid otherwise undefined. */ displayGLAccount(glAccount?: any): string | undefined { - if (typeof(glAccount) === 'object') { - return glAccount ? glAccount.name + ' (' + glAccount.glCode + ')' : undefined; + if (typeof glAccount === 'object') { + return glAccount ? glAccount.name + ' (' + glAccount.glCode + ')' : undefined; } else { return glAccount; } @@ -142,7 +150,7 @@ export class XBRLComponent implements OnInit, AfterViewInit { submit() { const config: any = {}; const serialObject: any = {}; - this.mixtaxonomyArray.forEach( (taxonomy: any) => { + this.mixtaxonomyArray.forEach((taxonomy: any) => { config[taxonomy.id] = taxonomy.mapping.value; }); serialObject['config'] = JSON.stringify(config); @@ -152,5 +160,4 @@ export class XBRLComponent implements OnInit, AfterViewInit { this.reloadComponent(); }); } - } diff --git a/src/app/savings/common-resolvers/saving-documents.resolver.ts b/src/app/savings/common-resolvers/saving-documents.resolver.ts index 519c7910b..d2e5fabe8 100644 --- a/src/app/savings/common-resolvers/saving-documents.resolver.ts +++ b/src/app/savings/common-resolvers/saving-documents.resolver.ts @@ -1,8 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Resolve, - ActivatedRouteSnapshot -} from '@angular/router'; +import { Resolve, ActivatedRouteSnapshot } from '@angular/router'; import { Observable } from 'rxjs'; import { SavingsService } from '../savings.service'; @@ -10,18 +7,17 @@ import { SavingsService } from '../savings.service'; providedIn: 'root' }) export class SavingDocumentsResolver implements Resolve { + /** + * @param {SavingsService} savingsService Savings service. + */ + constructor(private savingsService: SavingsService) {} - /** - * @param {SavingsService} savingsService Savings service. - */ - constructor(private savingsService: SavingsService) { } - - /** - * Returns the Savings data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const savingAccountId = route.parent.paramMap.get('savingAccountId'); - return this.savingsService.getSavingsDocuments(savingAccountId); - } + /** + * Returns the Savings data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const savingAccountId = route.parent.paramMap.get('savingAccountId'); + return this.savingsService.getSavingsDocuments(savingAccountId); + } } diff --git a/src/app/savings/common-resolvers/saving-notes.resolver.ts b/src/app/savings/common-resolvers/saving-notes.resolver.ts index a418126de..a0ce089ad 100644 --- a/src/app/savings/common-resolvers/saving-notes.resolver.ts +++ b/src/app/savings/common-resolvers/saving-notes.resolver.ts @@ -1,8 +1,5 @@ import { Injectable } from '@angular/core'; -import { - Resolve, - ActivatedRouteSnapshot -} from '@angular/router'; +import { Resolve, ActivatedRouteSnapshot } from '@angular/router'; import { Observable } from 'rxjs'; import { SavingsService } from '../savings.service'; @@ -10,18 +7,17 @@ import { SavingsService } from '../savings.service'; providedIn: 'root' }) export class SavingNotesResolver implements Resolve { + /** + * @param {SavingsService} savingsService Savings service. + */ + constructor(private savingsService: SavingsService) {} - /** - * @param {SavingsService} savingsService Savings service. - */ - constructor(private savingsService: SavingsService) { } - - /** - * Returns the Savings data. - * @returns {Observable} - */ - resolve(route: ActivatedRouteSnapshot): Observable { - const savingAccountId = route.parent.paramMap.get('savingAccountId'); - return this.savingsService.getSavingsNotes(savingAccountId); - } + /** + * Returns the Savings data. + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const savingAccountId = route.parent.paramMap.get('savingAccountId'); + return this.savingsService.getSavingsNotes(savingAccountId); + } } diff --git a/src/app/savings/common-resolvers/savings-account-actions.resolver.ts b/src/app/savings/common-resolvers/savings-account-actions.resolver.ts index 689e0d4cd..d5cf7e058 100644 --- a/src/app/savings/common-resolvers/savings-account-actions.resolver.ts +++ b/src/app/savings/common-resolvers/savings-account-actions.resolver.ts @@ -13,11 +13,10 @@ import { SavingsService } from '../savings.service'; */ @Injectable() export class SavingsAccountActionsResolver implements Resolve { - /** * @param {SavingsService} SavingsService Savings service. */ - constructor(private savingsService: SavingsService) { } + constructor(private savingsService: SavingsService) {} /** * Returns the Savings account actions data. @@ -26,7 +25,8 @@ export class SavingsAccountActionsResolver implements Resolve { */ resolve(route: ActivatedRouteSnapshot): Observable { const actionName = route.paramMap.get('name'); - const savingAccountId = route.paramMap.get('savingAccountId') || route.parent.parent.paramMap.get('savingAccountId'); + const savingAccountId = + route.paramMap.get('savingAccountId') || route.parent.parent.paramMap.get('savingAccountId'); switch (actionName) { case 'Assign Staff': return this.savingsService.getSavingsAccountAndTemplate(savingAccountId, true); @@ -39,13 +39,11 @@ export class SavingsAccountActionsResolver implements Resolve { case 'Close': return forkJoin([ this.savingsService.getSavingsTransactionTemplateResource(savingAccountId), - this.savingsService.getSavingsAccountData(savingAccountId) - ]); + this.savingsService.getSavingsAccountData(savingAccountId)]); case 'Apply Annual Fees': return this.savingsService.getSavingsAccountData(savingAccountId); default: return undefined; } } - } diff --git a/src/app/savings/common-resolvers/savings-account-and-template.resolver.ts b/src/app/savings/common-resolvers/savings-account-and-template.resolver.ts index b7b95fc9b..97898f641 100644 --- a/src/app/savings/common-resolvers/savings-account-and-template.resolver.ts +++ b/src/app/savings/common-resolvers/savings-account-and-template.resolver.ts @@ -13,11 +13,10 @@ import { SavingsService } from '../savings.service'; */ @Injectable() export class SavingsAccountAndTemplateResolver implements Resolve { - /** * @param {SavingsService} SavingsService Savings service. */ - constructor(private savingsService: SavingsService) { } + constructor(private savingsService: SavingsService) {} /** * Returns the Savings Account data and template. @@ -28,5 +27,4 @@ export class SavingsAccountAndTemplateResolver implements Resolve { const savingAccountId = route.paramMap.get('savingAccountId'); return this.savingsService.getSavingsAccountAndTemplate(savingAccountId, true); } - } diff --git a/src/app/savings/common-resolvers/savings-account-charge.resolver.ts b/src/app/savings/common-resolvers/savings-account-charge.resolver.ts index 751320825..87037de3f 100644 --- a/src/app/savings/common-resolvers/savings-account-charge.resolver.ts +++ b/src/app/savings/common-resolvers/savings-account-charge.resolver.ts @@ -13,11 +13,10 @@ import { SavingsService } from '../savings.service'; */ @Injectable() export class SavingsAccountChargeResolver implements Resolve { - /** * @param {SavingsService} SavingsService Savings service. */ - constructor(private savingsService: SavingsService) { } + constructor(private savingsService: SavingsService) {} /** * Returns the Savings Account Charge data. @@ -29,5 +28,4 @@ export class SavingsAccountChargeResolver implements Resolve { const chargeId = route.paramMap.get('id'); return this.savingsService.getSavingsAccountCharge(savingAccountId, chargeId); } - } diff --git a/src/app/savings/common-resolvers/savings-account-template.resolver.ts b/src/app/savings/common-resolvers/savings-account-template.resolver.ts index bb5f9638e..23d091a57 100644 --- a/src/app/savings/common-resolvers/savings-account-template.resolver.ts +++ b/src/app/savings/common-resolvers/savings-account-template.resolver.ts @@ -13,11 +13,10 @@ import { SavingsService } from '../savings.service'; */ @Injectable() export class SavingsAccountTemplateResolver implements Resolve { - /** * @param {savingsService} SavingsService Savings service. */ - constructor(private savingsService: SavingsService) { } + constructor(private savingsService: SavingsService) {} /** * Returns the Shares Account Template. @@ -26,8 +25,7 @@ export class SavingsAccountTemplateResolver implements Resolve { */ resolve(route: ActivatedRouteSnapshot): Observable { const entityId = route.paramMap.get('clientId') || route.paramMap.get('groupId') || route.paramMap.get('centerId'); - const isGroup = (route.paramMap.get('groupId') || route.paramMap.get('centerId')) ? true : false; + const isGroup = route.paramMap.get('groupId') || route.paramMap.get('centerId') ? true : false; return this.savingsService.getSavingsAccountTemplate(entityId, undefined, isGroup); } - } diff --git a/src/app/savings/common-resolvers/savings-account-transaction-template.resolver.ts b/src/app/savings/common-resolvers/savings-account-transaction-template.resolver.ts index d449f9208..a30728398 100644 --- a/src/app/savings/common-resolvers/savings-account-transaction-template.resolver.ts +++ b/src/app/savings/common-resolvers/savings-account-transaction-template.resolver.ts @@ -13,11 +13,10 @@ import { SavingsService } from '../savings.service'; */ @Injectable() export class SavingsAccountTransactionTemplateResolver implements Resolve { - /** * @param {SavingsService} SavingsService Savings service. */ - constructor(private savingsService: SavingsService) { } + constructor(private savingsService: SavingsService) {} /** * Returns the Savings Account Transaction Template data. @@ -29,5 +28,4 @@ export class SavingsAccountTransactionTemplateResolver implements Resolve { - /** * @param {SavingsService} SavingsService Savings service. */ - constructor(private savingsService: SavingsService) { } + constructor(private savingsService: SavingsService) {} /** * Returns the Savings Account Transaction data. @@ -29,5 +28,4 @@ export class SavingsAccountTransactionResolver implements Resolve { const transactionId = route.parent.paramMap.get('id'); return this.savingsService.getSavingsAccountTransaction(savingAccountId, transactionId); } - } diff --git a/src/app/savings/common-resolvers/savings-account-view.resolver.ts b/src/app/savings/common-resolvers/savings-account-view.resolver.ts index b01f4346c..076455a7b 100644 --- a/src/app/savings/common-resolvers/savings-account-view.resolver.ts +++ b/src/app/savings/common-resolvers/savings-account-view.resolver.ts @@ -13,11 +13,10 @@ import { SavingsService } from '../savings.service'; */ @Injectable() export class SavingsAccountViewResolver implements Resolve { - /** * @param {SavingsService} SavingsService Savings service. */ - constructor(private savingsService: SavingsService) { } + constructor(private savingsService: SavingsService) {} /** * Returns the Savings Account data. @@ -28,5 +27,4 @@ export class SavingsAccountViewResolver implements Resolve { const savingAccountId = route.paramMap.get('savingAccountId'); return this.savingsService.getSavingsAccountData(savingAccountId); } - } diff --git a/src/app/savings/common-resolvers/savings-datatable.resolver.ts b/src/app/savings/common-resolvers/savings-datatable.resolver.ts index c0eaf97df..e17acff58 100644 --- a/src/app/savings/common-resolvers/savings-datatable.resolver.ts +++ b/src/app/savings/common-resolvers/savings-datatable.resolver.ts @@ -13,20 +13,21 @@ import { SavingsService } from '../savings.service'; */ @Injectable() export class SavingsDatatableResolver implements Resolve { - /** * @param {SavingsService} SavingsService Savings service. */ - constructor(private savingsService: SavingsService) { } + constructor(private savingsService: SavingsService) {} /** * Returns the Savings Account's Datatable data. * @returns {Observable} */ resolve(route: ActivatedRouteSnapshot): Observable { - const accountId = route.parent.parent.paramMap.get('savingAccountId') || route.parent.parent.paramMap.get('fixedDepositAccountId') || route.parent.parent.paramMap.get('recurringDepositAccountId'); + const accountId = + route.parent.parent.paramMap.get('savingAccountId') || + route.parent.parent.paramMap.get('fixedDepositAccountId') || + route.parent.parent.paramMap.get('recurringDepositAccountId'); const datatableName = route.paramMap.get('datatableName'); return this.savingsService.getSavingsDatatable(accountId, datatableName); } - } diff --git a/src/app/savings/common-resolvers/savings-datatables.resolver.ts b/src/app/savings/common-resolvers/savings-datatables.resolver.ts index f3d4b7d3f..a78895ea1 100644 --- a/src/app/savings/common-resolvers/savings-datatables.resolver.ts +++ b/src/app/savings/common-resolvers/savings-datatables.resolver.ts @@ -13,11 +13,10 @@ import { SavingsService } from '../savings.service'; */ @Injectable() export class SavingsDatatablesResolver implements Resolve { - /** * @param {SavingsService} SavingsService Savings service. */ - constructor(private savingsService: SavingsService) { } + constructor(private savingsService: SavingsService) {} /** * Returns the Saving Account's Datatables data. @@ -26,5 +25,4 @@ export class SavingsDatatablesResolver implements Resolve { resolve(): Observable { return this.savingsService.getSavingsDatatables(); } - } diff --git a/src/app/savings/common-resolvers/savings-transaction-reciept.resolver.ts b/src/app/savings/common-resolvers/savings-transaction-reciept.resolver.ts index 599afabf1..9d4db3c51 100644 --- a/src/app/savings/common-resolvers/savings-transaction-reciept.resolver.ts +++ b/src/app/savings/common-resolvers/savings-transaction-reciept.resolver.ts @@ -14,13 +14,14 @@ import { SettingsService } from 'app/settings/settings.service'; */ @Injectable() export class SavingsTransactionRecieptResolver implements Resolve { - /** * @param {ReportsService} reportsService Reports service. * @param {SettingsService} settingsService Settings Service. */ - constructor(private reportsService: ReportsService, - private settingsService: SettingsService) { } + constructor( + private reportsService: ReportsService, + private settingsService: SettingsService + ) {} /** * Returns the Savings Transaction Reciept @@ -30,10 +31,15 @@ export class SavingsTransactionRecieptResolver implements Resolve { resolve(route: ActivatedRouteSnapshot): Observable { const transactionId = route.paramMap.get('id'); const data = { - 'output-type': 'PDF', - R_transactionId: transactionId + 'output-type': 'PDF', + R_transactionId: transactionId }; - return this.reportsService.getPentahoRunReportData('Savings Transaction Receipt', data, 'default', this.settingsService.language.code, this.settingsService.dateFormat); + return this.reportsService.getPentahoRunReportData( + 'Savings Transaction Receipt', + data, + 'default', + this.settingsService.language.code, + this.settingsService.dateFormat + ); } - } diff --git a/src/app/savings/common-resolvers/transaction-datatable.resolver.ts b/src/app/savings/common-resolvers/transaction-datatable.resolver.ts index deb0aae3a..3e27759f5 100644 --- a/src/app/savings/common-resolvers/transaction-datatable.resolver.ts +++ b/src/app/savings/common-resolvers/transaction-datatable.resolver.ts @@ -14,7 +14,7 @@ export class TransactionDatatableResolver implements Resolve { * * @param {SavingsService} savingsService */ - constructor(private savingsService: SavingsService) { } + constructor(private savingsService: SavingsService) {} /** * Returns the Transactions Account's Datatable data. * @returns {Observable} diff --git a/src/app/savings/common-resolvers/transaction-datatables.resolver.ts b/src/app/savings/common-resolvers/transaction-datatables.resolver.ts index 0a6183ec5..d03d2fb7c 100644 --- a/src/app/savings/common-resolvers/transaction-datatables.resolver.ts +++ b/src/app/savings/common-resolvers/transaction-datatables.resolver.ts @@ -10,12 +10,11 @@ import { SavingsService } from '../savings.service'; @Injectable() export class TransactionDatatablesResolver implements Resolve { - /** * * @param savingsService Savings Service */ - constructor(private savingsService: SavingsService) { } + constructor(private savingsService: SavingsService) {} /** * * @param route diff --git a/src/app/savings/create-savings-account/create-savings-account.component.spec.ts b/src/app/savings/create-savings-account/create-savings-account.component.spec.ts index f644e2e4b..e5138437d 100644 --- a/src/app/savings/create-savings-account/create-savings-account.component.spec.ts +++ b/src/app/savings/create-savings-account/create-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateSavingsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [CreateSavingsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/create-savings-account/create-savings-account.component.ts b/src/app/savings/create-savings-account/create-savings-account.component.ts index a562a5110..30426e665 100644 --- a/src/app/savings/create-savings-account/create-savings-account.component.ts +++ b/src/app/savings/create-savings-account/create-savings-account.component.ts @@ -21,18 +21,20 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./create-savings-account.component.scss'] }) export class CreateSavingsAccountComponent { - /** Savings Account Template */ savingsAccountTemplate: any; /** Savings Account Product Template */ savingsAccountProductTemplate: any; /** Savings Account Details Step */ - @ViewChild(SavingsAccountDetailsStepComponent, { static: true }) savingsAccountDetailsStep: SavingsAccountDetailsStepComponent; + @ViewChild(SavingsAccountDetailsStepComponent, { static: true }) + savingsAccountDetailsStep: SavingsAccountDetailsStepComponent; /** Savings Account Terms Step */ - @ViewChild(SavingsAccountTermsStepComponent, { static: true }) savingsAccountTermsStep: SavingsAccountTermsStepComponent; + @ViewChild(SavingsAccountTermsStepComponent, { static: true }) + savingsAccountTermsStep: SavingsAccountTermsStepComponent; /** Savings Account Charges Step */ - @ViewChild(SavingsAccountChargesStepComponent, { static: true }) savingsAccountChargesStep: SavingsAccountChargesStepComponent; + @ViewChild(SavingsAccountChargesStepComponent, { static: true }) + savingsAccountChargesStep: SavingsAccountChargesStepComponent; /** * Fetches savings account template from `resolve` @@ -42,12 +44,13 @@ export class CreateSavingsAccountComponent { * @param {SavingsService} savingsService Savings Service * @param {SettingsService} settingsService Settings Service */ - constructor(private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private savingsService: SavingsService, - private settingsService: SettingsService - ) { + constructor( + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private savingsService: SavingsService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { savingsAccountTemplate: any }) => { this.savingsAccountTemplate = data.savingsAccountTemplate; }); @@ -79,10 +82,7 @@ export class CreateSavingsAccountComponent { * Checks validity of overall savings account form. */ get savingsAccountFormValid() { - return ( - this.savingsAccountDetailsForm.valid && - this.savingsAccountTermsForm.valid - ); + return this.savingsAccountDetailsForm.valid && this.savingsAccountTermsForm.valid; } /** @@ -124,8 +124,13 @@ export class CreateSavingsAccountComponent { savingsAccount.groupId = this.savingsAccountTemplate.groupId; } this.savingsService.createSavingsAccount(savingsAccount).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/savings/edit-savings-account/edit-savings-account.component.spec.ts b/src/app/savings/edit-savings-account/edit-savings-account.component.spec.ts index 0e1eb0a76..758a5b5ee 100644 --- a/src/app/savings/edit-savings-account/edit-savings-account.component.spec.ts +++ b/src/app/savings/edit-savings-account/edit-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('EditSavingsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [EditSavingsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/edit-savings-account/edit-savings-account.component.ts b/src/app/savings/edit-savings-account/edit-savings-account.component.ts index 5a22f8e43..c3bee9384 100644 --- a/src/app/savings/edit-savings-account/edit-savings-account.component.ts +++ b/src/app/savings/edit-savings-account/edit-savings-account.component.ts @@ -21,18 +21,20 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./edit-savings-account.component.scss'] }) export class EditSavingsAccountComponent { - /** Savings Account Template */ savingsAccountAndTemplate: any; /** Savings Account Product Template */ savingsAccountProductTemplate: any; /** Savings Account Details Step */ - @ViewChild(SavingsAccountDetailsStepComponent, { static: true }) savingsAccountDetailsStep: SavingsAccountDetailsStepComponent; + @ViewChild(SavingsAccountDetailsStepComponent, { static: true }) + savingsAccountDetailsStep: SavingsAccountDetailsStepComponent; /** Savings Account Terms Step */ - @ViewChild(SavingsAccountTermsStepComponent, { static: true }) savingsAccountTermsStep: SavingsAccountTermsStepComponent; + @ViewChild(SavingsAccountTermsStepComponent, { static: true }) + savingsAccountTermsStep: SavingsAccountTermsStepComponent; /** Savings Account Charges Step */ - @ViewChild(SavingsAccountChargesStepComponent, { static: true }) savingsAccountChargesStep: SavingsAccountChargesStepComponent; + @ViewChild(SavingsAccountChargesStepComponent, { static: true }) + savingsAccountChargesStep: SavingsAccountChargesStepComponent; /** * Fetches savings account template from `resolve` @@ -42,12 +44,13 @@ export class EditSavingsAccountComponent { * @param {SavingsService} savingsService Savings Service * @param {SettingsService} settingsService Settings Service */ - constructor(private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private savingsService: SavingsService, - private settingsService: SettingsService - ) { + constructor( + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private savingsService: SavingsService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { savingsAccountAndTemplate: any }) => { this.savingsAccountAndTemplate = data.savingsAccountAndTemplate; }); @@ -82,11 +85,9 @@ export class EditSavingsAccountComponent { return ( this.savingsAccountDetailsForm.valid && this.savingsAccountTermsForm.valid && - ( - !this.savingsAccountDetailsForm.pristine || + (!this.savingsAccountDetailsForm.pristine || !this.savingsAccountTermsForm.pristine || - !this.savingsAccountChargesStep.pristine - ) + !this.savingsAccountChargesStep.pristine) ); } @@ -128,9 +129,10 @@ export class EditSavingsAccountComponent { } else { savingsAccount.groupId = this.savingsAccountAndTemplate.groupId; } - this.savingsService.updateSavingsAccount(this.savingsAccountAndTemplate.id, savingsAccount).subscribe((response: any) => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); + this.savingsService + .updateSavingsAccount(this.savingsAccountAndTemplate.id, savingsAccount) + .subscribe((response: any) => { + this.router.navigate(['../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/savings/gsim-account/create-gsim-account/create-gsim-account.component.spec.ts b/src/app/savings/gsim-account/create-gsim-account/create-gsim-account.component.spec.ts index 71729de01..2e28bae4e 100644 --- a/src/app/savings/gsim-account/create-gsim-account/create-gsim-account.component.spec.ts +++ b/src/app/savings/gsim-account/create-gsim-account/create-gsim-account.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateGsimAccountComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ CreateGsimAccountComponent ] - }) - .compileComponents(); + declarations: [CreateGsimAccountComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/savings/gsim-account/create-gsim-account/create-gsim-account.component.ts b/src/app/savings/gsim-account/create-gsim-account/create-gsim-account.component.ts index 05ad1cf4e..96afec1d1 100644 --- a/src/app/savings/gsim-account/create-gsim-account/create-gsim-account.component.ts +++ b/src/app/savings/gsim-account/create-gsim-account/create-gsim-account.component.ts @@ -20,9 +20,7 @@ import { Dates } from 'app/core/utils/dates'; templateUrl: './create-gsim-account.component.html', styleUrls: ['./create-gsim-account.component.scss'] }) - export class CreateGsimAccountComponent { - /** Savings Account Template */ savingsAccountTemplate: any; /** Savings Account Product Template */ @@ -33,11 +31,14 @@ export class CreateGsimAccountComponent { selectedMembers: any; /** Savings Account Details Step */ - @ViewChild(SavingsAccountDetailsStepComponent, { static: true }) savingsAccountDetailsStep: SavingsAccountDetailsStepComponent; + @ViewChild(SavingsAccountDetailsStepComponent, { static: true }) + savingsAccountDetailsStep: SavingsAccountDetailsStepComponent; /** Savings Account Terms Step */ - @ViewChild(SavingsAccountTermsStepComponent, { static: true }) savingsAccountTermsStep: SavingsAccountTermsStepComponent; + @ViewChild(SavingsAccountTermsStepComponent, { static: true }) + savingsAccountTermsStep: SavingsAccountTermsStepComponent; /** Savings Account Charges Step */ - @ViewChild(SavingsAccountChargesStepComponent, { static: true }) savingsAccountChargesStep: SavingsAccountChargesStepComponent; + @ViewChild(SavingsAccountChargesStepComponent, { static: true }) + savingsAccountChargesStep: SavingsAccountChargesStepComponent; /** * Fetches savings account template from `resolve` @@ -47,13 +48,14 @@ export class CreateGsimAccountComponent { * @param {SavingsService} savingsService Savings Service * @param {SettingsService} settingsService Settings Service */ - constructor(private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private savingsService: SavingsService, - private settingsService: SettingsService - ) { - this.route.data.subscribe((data: { savingsAccountTemplate: any, groupsData: any }) => { + constructor( + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private savingsService: SavingsService, + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { savingsAccountTemplate: any; groupsData: any }) => { this.savingsAccountTemplate = data.savingsAccountTemplate; this.dataSource = data.groupsData.activeClientMembers; }); @@ -63,7 +65,7 @@ export class CreateGsimAccountComponent { * Sets savings account product template. * @param {any} $event API response */ - setTemplate($event: any) { + setTemplate($event: any) { this.savingsAccountProductTemplate = $event; } @@ -84,7 +86,7 @@ export class CreateGsimAccountComponent { /** * Retrieves savings account terms form. */ - get activeClientMembers() { + get activeClientMembers() { return this.dataSource; } @@ -92,10 +94,7 @@ export class CreateGsimAccountComponent { * Checks validity of overall savings account form. */ get savingsAccountFormValid() { - return ( - this.savingsAccountDetailsForm.valid && - this.savingsAccountTermsForm.valid - ); + return this.savingsAccountDetailsForm.valid && this.savingsAccountTermsForm.valid; } /** @@ -119,7 +118,7 @@ export class CreateGsimAccountComponent { ...this.savingsAccount, charges: this.savingsAccount.charges.map((charge: any) => ({ chargeId: charge.id, - amount: charge.amount, + amount: charge.amount })), clientId: client.id, isGSIM: true, @@ -132,7 +131,6 @@ export class CreateGsimAccountComponent { data.groupId = this.savingsAccountTemplate.groupId; return data; - } /** Request Body Data */ @@ -140,9 +138,7 @@ export class CreateGsimAccountComponent { const requestData = []; const memberSelected = this.selectedMembers.selectedMembers; for (let index = 0; index < 1; index++) { - requestData.push( - this.setData( memberSelected[ index ] ), - ); + requestData.push(this.setData(memberSelected[index])); } return requestData; } @@ -153,11 +149,16 @@ export class CreateGsimAccountComponent { submit() { const data = this.buildRequestData(); const gsimData = { - clientArray: data, + clientArray: data }; this.savingsService.createGsimAcccount(gsimData).subscribe((response: any) => { - this.router.navigate(['../', response.resourceId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + response.resourceId + ], + { relativeTo: this.route } + ); }); } - } diff --git a/src/app/savings/gsim-account/gsim-account.component.spec.ts b/src/app/savings/gsim-account/gsim-account.component.spec.ts index 9f1b2a155..24652f537 100644 --- a/src/app/savings/gsim-account/gsim-account.component.spec.ts +++ b/src/app/savings/gsim-account/gsim-account.component.spec.ts @@ -8,9 +8,8 @@ describe('GsimAccountComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GsimAccountComponent ] - }) - .compileComponents(); + declarations: [GsimAccountComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/savings/gsim-account/gsim-account.component.ts b/src/app/savings/gsim-account/gsim-account.component.ts index 38dcbaf94..c76019c5f 100644 --- a/src/app/savings/gsim-account/gsim-account.component.ts +++ b/src/app/savings/gsim-account/gsim-account.component.ts @@ -13,9 +13,14 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./gsim-account.component.scss'] }) export class GsimAccountComponent implements OnInit { - /** Columns to be displayed in charge overview table. */ - displayedColumns: string[] = ['clientDetails', 'savingsAccount', 'products', 'balance', 'Actions']; + displayedColumns: string[] = [ + 'clientDetails', + 'savingsAccount', + 'products', + 'balance', + 'Actions' + ]; /** Data source for charge overview table. */ dataSource: MatTableDataSource; /** Charge Overview data */ @@ -33,9 +38,11 @@ export class GsimAccountComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {MatDialog} dialog Dialog reference. */ - constructor(private route: ActivatedRoute, - public dialog: MatDialog) { - this.route.data.subscribe((data: { gsimData: any, savingAccountData: any, groupsData: any }) => { + constructor( + private route: ActivatedRoute, + public dialog: MatDialog + ) { + this.route.data.subscribe((data: { gsimData: any; savingAccountData: any; groupsData: any }) => { this.gsimOverviewData = data.gsimData[0].childGSIMAccounts; this.savingAccountData = data.savingAccountData; this.groupsData = data.groupsData; @@ -49,7 +56,7 @@ export class GsimAccountComponent implements OnInit { /** * Set Client Charge Overview. */ - setLoanClientChargeOverview() { + setLoanClientChargeOverview() { this.dataSource = new MatTableDataSource(this.gsimOverviewData); // this.dataSource.paginator = this.paginator; } @@ -58,8 +65,7 @@ export class GsimAccountComponent implements OnInit { * Stops the propagation to view pages. * @param $event Mouse Event */ - routeEdit($event: MouseEvent) { + routeEdit($event: MouseEvent) { $event.stopPropagation(); } - } diff --git a/src/app/savings/gsim-account/gsim-account.resolver.ts b/src/app/savings/gsim-account/gsim-account.resolver.ts index 2b87639c8..38fcf8134 100644 --- a/src/app/savings/gsim-account/gsim-account.resolver.ts +++ b/src/app/savings/gsim-account/gsim-account.resolver.ts @@ -13,11 +13,10 @@ import { SavingsService } from '../savings.service'; */ @Injectable() export class GSIMViewResolver implements Resolve { - /** * @param {SavingsService} savingsService Savings service. */ - constructor(private savingsService: SavingsService) { } + constructor(private savingsService: SavingsService) {} /** * Returns the Savings Account data. @@ -29,5 +28,4 @@ export class GSIMViewResolver implements Resolve { const savingAccountId = route.paramMap.get('savingAccountId'); return this.savingsService.getGSIMAccountData(savingAccountId, groupId); } - } diff --git a/src/app/savings/models/savings-account-transaction.model.ts b/src/app/savings/models/savings-account-transaction.model.ts index 33f6d883a..b03634eff 100644 --- a/src/app/savings/models/savings-account-transaction.model.ts +++ b/src/app/savings/models/savings-account-transaction.model.ts @@ -1,57 +1,56 @@ import { Currency } from 'app/shared/models/general.model'; export interface SavingsAccountTransaction { - id: number; - transactionType: SavingsAccountTransactionType; - entryType: string; - accountId: number; - accountNo: string; - date: number[]; - currency: Currency; - amount: number; - runningBalance: number; - reversed: boolean; - transfer: Transfer; - submittedOnDate: number[]; - interestedPostedAsOn: boolean; - submittedByUsername: string; - isManualTransaction: boolean; - isReversal: boolean; - originalTransactionId: number; - lienTransaction: boolean; - releaseTransactionId: number; - chargesPaidByData: any[]; + id: number; + transactionType: SavingsAccountTransactionType; + entryType: string; + accountId: number; + accountNo: string; + date: number[]; + currency: Currency; + amount: number; + runningBalance: number; + reversed: boolean; + transfer: Transfer; + submittedOnDate: number[]; + interestedPostedAsOn: boolean; + submittedByUsername: string; + isManualTransaction: boolean; + isReversal: boolean; + originalTransactionId: number; + lienTransaction: boolean; + releaseTransactionId: number; + chargesPaidByData: any[]; } - export interface SavingsAccountTransactionType { - id: number; - code: string; - value: string; - deposit: boolean; - dividendPayout: boolean; - withdrawal: boolean; - interestPosting: boolean; - feeDeduction: boolean; - initiateTransfer: boolean; - approveTransfer: boolean; - withdrawTransfer: boolean; - rejectTransfer: boolean; - overdraftInterest: boolean; - writtenoff: boolean; - overdraftFee: boolean; - withholdTax: boolean; - escheat: boolean; - amountHold: boolean; - amountRelease: boolean; - accrual: boolean; + id: number; + code: string; + value: string; + deposit: boolean; + dividendPayout: boolean; + withdrawal: boolean; + interestPosting: boolean; + feeDeduction: boolean; + initiateTransfer: boolean; + approveTransfer: boolean; + withdrawTransfer: boolean; + rejectTransfer: boolean; + overdraftInterest: boolean; + writtenoff: boolean; + overdraftFee: boolean; + withholdTax: boolean; + escheat: boolean; + amountHold: boolean; + amountRelease: boolean; + accrual: boolean; } export interface Transfer { - id: number; - reversed: boolean; - currency: Currency; - transferAmount: number; - transferDate: number[]; - transferDescription: string; + id: number; + reversed: boolean; + currency: Currency; + transferAmount: number; + transferDate: number[]; + transferDescription: string; } diff --git a/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.spec.ts b/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.spec.ts index b89477bbf..bc75d7694 100644 --- a/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.spec.ts +++ b/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('ActivateSavingsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ActivateSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [ActivateSavingsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.ts b/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.ts index 423df2bce..6e1e48221 100644 --- a/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./activate-savings-account.component.scss'] }) export class ActivateSavingsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class ActivateSavingsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.accountId = this.route.snapshot.params['savingAccountId']; } @@ -57,7 +58,10 @@ export class ActivateSavingsAccountComponent implements OnInit { */ createActivateSavingsAccountForm() { this.activateSavingsAccountForm = this.formBuilder.group({ - 'activatedOnDate': ['', Validators.required] + activatedOnDate: [ + '', + Validators.required + ] }); } @@ -82,5 +86,4 @@ export class ActivateSavingsAccountComponent implements OnInit { this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - } diff --git a/src/app/savings/saving-account-actions/add-charge-savings-account/add-charge-savings-account.component.spec.ts b/src/app/savings/saving-account-actions/add-charge-savings-account/add-charge-savings-account.component.spec.ts index df3c99d52..3b2cbd5f6 100644 --- a/src/app/savings/saving-account-actions/add-charge-savings-account/add-charge-savings-account.component.spec.ts +++ b/src/app/savings/saving-account-actions/add-charge-savings-account/add-charge-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('AddChargeSavingsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AddChargeSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [AddChargeSavingsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/add-charge-savings-account/add-charge-savings-account.component.ts b/src/app/savings/saving-account-actions/add-charge-savings-account/add-charge-savings-account.component.ts index afe8771c1..07dd9c033 100644 --- a/src/app/savings/saving-account-actions/add-charge-savings-account/add-charge-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/add-charge-savings-account/add-charge-savings-account.component.ts @@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./add-charge-savings-account.component.scss'] }) export class AddChargeSavingsAccountComponent implements OnInit { - /** Minimum Due Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Due Date allowed. */ @@ -40,12 +39,14 @@ export class AddChargeSavingsAccountComponent implements OnInit { * @param {SavingsService} savingsService Savings Service * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private savingsService: SavingsService, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private savingsService: SavingsService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { savingsAccountActionData: any }) => { this.savingsChargeOptions = data.savingsAccountActionData.chargeOptions; }); @@ -62,7 +63,7 @@ export class AddChargeSavingsAccountComponent implements OnInit { } buildDependencies() { - this.savingsChargeForm.controls.chargeId.valueChanges.subscribe(chargeId => { + this.savingsChargeForm.controls.chargeId.valueChanges.subscribe((chargeId) => { this.savingsService.getChargeTemplate(chargeId).subscribe((data: any) => { this.chargeDetails = data; const chargeTimeType = data.chargeTimeType.id; @@ -83,14 +84,17 @@ export class AddChargeSavingsAccountComponent implements OnInit { this.savingsChargeForm.removeControl('feeOnMonthDay'); } if (chargeTimeType.value === 'Monthly Fee') { - this.savingsChargeForm.addControl('feeInterval', new UntypedFormControl(data.feeInterval, Validators.required)); + this.savingsChargeForm.addControl( + 'feeInterval', + new UntypedFormControl(data.feeInterval, Validators.required) + ); } else { this.savingsChargeForm.removeControl('feeInterval'); } this.savingsChargeForm.patchValue({ - 'amount': data.amount, - 'chargeCalculationType': data.chargeCalculationType.id, - 'chargeTimeType': data.chargeTimeType.id + amount: data.amount, + chargeCalculationType: data.chargeCalculationType.id, + chargeTimeType: data.chargeTimeType.id }); }); }); @@ -101,10 +105,16 @@ export class AddChargeSavingsAccountComponent implements OnInit { */ createSavingsChargeForm() { this.savingsChargeForm = this.formBuilder.group({ - 'chargeId': ['', Validators.required], - 'amount': ['', Validators.required], - 'chargeCalculationType': [{ value: '', disabled: true }], - 'chargeTimeType': [{ value: '', disabled: true }] + chargeId: [ + '', + Validators.required + ], + amount: [ + '', + Validators.required + ], + chargeCalculationType: [{ value: '', disabled: true }], + chargeTimeType: [{ value: '', disabled: true }] }); } @@ -134,9 +144,8 @@ export class AddChargeSavingsAccountComponent implements OnInit { } } } - this.savingsService.createSavingsCharge(this.savingAccountId, 'charges', savingsCharge).subscribe( () => { + this.savingsService.createSavingsCharge(this.savingAccountId, 'charges', savingsCharge).subscribe(() => { this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - } diff --git a/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.spec.ts b/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.spec.ts index 04425aa9b..716fa3a90 100644 --- a/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.spec.ts +++ b/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('ApplyAnnualFeesSavingsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ApplyAnnualFeesSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [ApplyAnnualFeesSavingsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts b/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts index 285db1faa..e54a9feea 100644 --- a/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./apply-annual-fees-savings-account.component.scss'] }) export class ApplyAnnualFeesSavingsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -39,12 +38,14 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.accountId = this.route.snapshot.params['savingAccountId']; this.route.data.subscribe((data: { savingsAccountActionData: any }) => { this.savingsAccountData = data.savingsAccountActionData; @@ -65,8 +66,11 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit { */ createApplyAnnualFeesForm() { this.applyAnnualFeesForm = this.formBuilder.group({ - 'dueDate': ['', Validators.required], - 'amount': [''] + dueDate: [ + '', + Validators.required + ], + amount: [''] }); } @@ -75,12 +79,12 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit { */ applyCharge() { const charges: any[] = this.savingsAccountData.charges; - charges.forEach((charge: any) => { - if (charge.name === 'Annual fee - INR') { - this.chargeId = charge.id; - this.applyAnnualFeesForm.get('amount').patchValue(charge.amount); - } - }); + charges.forEach((charge: any) => { + if (charge.name === 'Annual fee - INR') { + this.chargeId = charge.id; + this.applyAnnualFeesForm.get('amount').patchValue(charge.amount); + } + }); } /** @@ -100,9 +104,10 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit { dateFormat, locale }; - this.savingsService.executeSavingsAccountChargesCommand(this.accountId, 'paycharge', data, this.chargeId).subscribe(() => { - this.router.navigate(['../../'], { relativeTo: this.route }); - }); + this.savingsService + .executeSavingsAccountChargesCommand(this.accountId, 'paycharge', data, this.chargeId) + .subscribe(() => { + this.router.navigate(['../../'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.spec.ts b/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.spec.ts index f14e30096..f45f68af2 100644 --- a/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.spec.ts +++ b/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('ApproveSavingsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ApproveSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [ApproveSavingsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.ts b/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.ts index 8e3391483..89965d230 100644 --- a/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./approve-savings-account.component.scss'] }) export class ApproveSavingsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class ApproveSavingsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.accountId = this.route.snapshot.params['savingAccountId']; } @@ -57,8 +58,11 @@ export class ApproveSavingsAccountComponent implements OnInit { */ createApproveSavingsAccountForm() { this.approveSavingsAccountForm = this.formBuilder.group({ - 'approvedOnDate': ['', Validators.required], - 'note': [''] + approvedOnDate: [ + '', + Validators.required + ], + note: [''] }); } @@ -83,5 +87,4 @@ export class ApproveSavingsAccountComponent implements OnInit { this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - } diff --git a/src/app/savings/saving-account-actions/close-savings-account/close-savings-account.component.spec.ts b/src/app/savings/saving-account-actions/close-savings-account/close-savings-account.component.spec.ts index 9fb323a67..04ccc302a 100644 --- a/src/app/savings/saving-account-actions/close-savings-account/close-savings-account.component.spec.ts +++ b/src/app/savings/saving-account-actions/close-savings-account/close-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('CloseSavingsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CloseSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [CloseSavingsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/close-savings-account/close-savings-account.component.ts b/src/app/savings/saving-account-actions/close-savings-account/close-savings-account.component.ts index 092771b43..dc965dc25 100644 --- a/src/app/savings/saving-account-actions/close-savings-account/close-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/close-savings-account/close-savings-account.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./close-savings-account.component.scss'] }) export class CloseSavingsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -41,12 +40,14 @@ export class CloseSavingsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { savingsAccountActionData: any }) => { this.paymentTypeOptions = data.savingsAccountActionData[0].paymentTypeOptions; this.transactionAmount = data.savingsAccountActionData[1].summary.accountBalance; @@ -68,10 +69,13 @@ export class CloseSavingsAccountComponent implements OnInit { */ createCloseSavingsAccountForm() { this.closeSavingsAccountForm = this.formBuilder.group({ - 'closedOnDate': ['', Validators.required], - 'withdrawBalance': [false], - 'postInterestValidationOnClosure': [false], - 'note': [''] + closedOnDate: [ + '', + Validators.required + ], + withdrawBalance: [false], + postInterestValidationOnClosure: [false], + note: [''] }); } @@ -81,7 +85,10 @@ export class CloseSavingsAccountComponent implements OnInit { buildDependencies() { this.closeSavingsAccountForm.get('withdrawBalance').valueChanges.subscribe((value: boolean) => { if (value) { - this.closeSavingsAccountForm.addControl('amount', new UntypedFormControl({value: this.transactionAmount, disabled: true})); + this.closeSavingsAccountForm.addControl( + 'amount', + new UntypedFormControl({ value: this.transactionAmount, disabled: true }) + ); this.closeSavingsAccountForm.addControl('paymentTypeId', new UntypedFormControl('')); } else { this.closeSavingsAccountForm.removeControl('amount'); @@ -131,5 +138,4 @@ export class CloseSavingsAccountComponent implements OnInit { this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - } diff --git a/src/app/savings/saving-account-actions/manage-savings-account/manage-savings-account.component.spec.ts b/src/app/savings/saving-account-actions/manage-savings-account/manage-savings-account.component.spec.ts index 899cc1ca4..a8b46cb3d 100644 --- a/src/app/savings/saving-account-actions/manage-savings-account/manage-savings-account.component.spec.ts +++ b/src/app/savings/saving-account-actions/manage-savings-account/manage-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('ManageSavingsAccountComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ManageSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [ManageSavingsAccountComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/manage-savings-account/manage-savings-account.component.ts b/src/app/savings/saving-account-actions/manage-savings-account/manage-savings-account.component.ts index 070ce2888..6748c9e01 100644 --- a/src/app/savings/saving-account-actions/manage-savings-account/manage-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/manage-savings-account/manage-savings-account.component.ts @@ -13,7 +13,6 @@ import { SystemService } from 'app/system/system.service'; styleUrls: ['./manage-savings-account.component.scss'] }) export class ManageSavingsAccountComponent implements OnInit { - @Input() currency: Currency; /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); @@ -28,16 +27,16 @@ export class ManageSavingsAccountComponent implements OnInit { reasonOptions: any = []; transactionType: { - holdamount: boolean, - blockaccount: boolean, - blockdeposit: boolean, - blockwithdrawal: boolean + holdamount: boolean; + blockaccount: boolean; + blockdeposit: boolean; + blockwithdrawal: boolean; } = { - holdamount: false, - blockaccount: false, - blockdeposit: false, - blockwithdrawal: false - }; + holdamount: false, + blockaccount: false, + blockdeposit: false, + blockwithdrawal: false + }; /** * @param {FormBuilder} formBuilder Form Builder @@ -47,13 +46,15 @@ export class ManageSavingsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private savingsService: SavingsService, private dateUtils: Dates, private route: ActivatedRoute, private router: Router, private systemService: SystemService, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.transactionCommand = this.route.snapshot.params['name'].toLowerCase().replaceAll(' ', ''); this.transactionType[this.transactionCommand] = true; this.savingAccountId = this.route.snapshot.params['savingAccountId']; @@ -65,8 +66,12 @@ export class ManageSavingsAccountComponent implements OnInit { ngOnInit() { this.maxDate = this.settingsService.businessDate; this.createManageSavingsAccountForm(); - if (this.transactionType.holdamount || this.transactionType.blockaccount - || this.transactionType.blockdeposit || this.transactionType.blockwithdrawal) { + if ( + this.transactionType.holdamount || + this.transactionType.blockaccount || + this.transactionType.blockdeposit || + this.transactionType.blockwithdrawal + ) { this.getCodeValues(); } } @@ -100,13 +105,25 @@ export class ManageSavingsAccountComponent implements OnInit { createManageSavingsAccountForm() { if (this.transactionType.holdamount) { this.manageSavingsAccountForm = this.formBuilder.group({ - 'reasonForBlock': ['', Validators.required], - 'transactionDate': ['', Validators.required], - 'transactionAmount': [0.0, Validators.required] + reasonForBlock: [ + '', + Validators.required + ], + transactionDate: [ + '', + Validators.required + ], + transactionAmount: [ + 0.0, + Validators.required + ] }); } else { this.manageSavingsAccountForm = this.formBuilder.group({ - 'reasonForBlock': ['', Validators.required] + reasonForBlock: [ + '', + Validators.required + ] }); } } @@ -131,12 +148,14 @@ export class ManageSavingsAccountComponent implements OnInit { command = 'holdAmount'; payload['transactionAmount'] = payload['transactionAmount'] * 1; - this.savingsService.executeSavingsAccountTransactionsCommand(this.savingAccountId, command, payload).subscribe((response: any) => { - this.router.navigate(['../../transactions'], { relativeTo: this.route }); - }); + this.savingsService + .executeSavingsAccountTransactionsCommand(this.savingAccountId, command, payload) + .subscribe((response: any) => { + this.router.navigate(['../../transactions'], { relativeTo: this.route }); + }); } else { payload = { - ... this.manageSavingsAccountForm.value + ...this.manageSavingsAccountForm.value }; command = 'block'; if (this.transactionType.blockdeposit) { @@ -145,10 +164,11 @@ export class ManageSavingsAccountComponent implements OnInit { command = 'blockDebit'; } - this.savingsService.executeSavingsAccountCommand(this.savingAccountId, command, payload).subscribe((response: any) => { - this.router.navigate(['../../transactions'], { relativeTo: this.route }); - }); + this.savingsService + .executeSavingsAccountCommand(this.savingAccountId, command, payload) + .subscribe((response: any) => { + this.router.navigate(['../../transactions'], { relativeTo: this.route }); + }); } } - } diff --git a/src/app/savings/saving-account-actions/post-interest-as-on-savings-account/post-interest-as-on-savings-account.component.spec.ts b/src/app/savings/saving-account-actions/post-interest-as-on-savings-account/post-interest-as-on-savings-account.component.spec.ts index 0d1d6580d..1797838fa 100644 --- a/src/app/savings/saving-account-actions/post-interest-as-on-savings-account/post-interest-as-on-savings-account.component.spec.ts +++ b/src/app/savings/saving-account-actions/post-interest-as-on-savings-account/post-interest-as-on-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('PostInterestAsOnSavingsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PostInterestAsOnSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [PostInterestAsOnSavingsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/post-interest-as-on-savings-account/post-interest-as-on-savings-account.component.ts b/src/app/savings/saving-account-actions/post-interest-as-on-savings-account/post-interest-as-on-savings-account.component.ts index 6c380048f..48b979da9 100644 --- a/src/app/savings/saving-account-actions/post-interest-as-on-savings-account/post-interest-as-on-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/post-interest-as-on-savings-account/post-interest-as-on-savings-account.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./post-interest-as-on-savings-account.component.scss'] }) export class PostInterestAsOnSavingsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class PostInterestAsOnSavingsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.accountId = this.route.snapshot.params['savingAccountId']; } @@ -57,7 +58,10 @@ export class PostInterestAsOnSavingsAccountComponent implements OnInit { */ createPostInterestSavingsAccountForm() { this.postInterestSavingsAccountForm = this.formBuilder.group({ - 'transactionDate': ['', Validators.required] + transactionDate: [ + '', + Validators.required + ] }); } @@ -79,9 +83,10 @@ export class PostInterestAsOnSavingsAccountComponent implements OnInit { dateFormat, locale }; - this.savingsService.executeSavingsAccountTransactionsCommand(this.accountId, 'postInterestAsOn', data).subscribe(() => { - this.router.navigate(['../../transactions'], { relativeTo: this.route }); - }); + this.savingsService + .executeSavingsAccountTransactionsCommand(this.accountId, 'postInterestAsOn', data) + .subscribe(() => { + this.router.navigate(['../../transactions'], { relativeTo: this.route }); + }); } - } diff --git a/src/app/savings/saving-account-actions/reject-savings-account/reject-savings-account.component.spec.ts b/src/app/savings/saving-account-actions/reject-savings-account/reject-savings-account.component.spec.ts index bdb24ed5e..02b3a6c38 100644 --- a/src/app/savings/saving-account-actions/reject-savings-account/reject-savings-account.component.spec.ts +++ b/src/app/savings/saving-account-actions/reject-savings-account/reject-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('RejectSavingsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ RejectSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [RejectSavingsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/reject-savings-account/reject-savings-account.component.ts b/src/app/savings/saving-account-actions/reject-savings-account/reject-savings-account.component.ts index 5b47e7c80..fc07b1ee9 100644 --- a/src/app/savings/saving-account-actions/reject-savings-account/reject-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/reject-savings-account/reject-savings-account.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./reject-savings-account.component.scss'] }) export class RejectSavingsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class RejectSavingsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.accountId = this.route.snapshot.params['savingAccountId']; } @@ -57,8 +58,11 @@ export class RejectSavingsAccountComponent implements OnInit { */ createRejectSavingsAccountForm() { this.rejectSavingsAccountForm = this.formBuilder.group({ - 'rejectedOnDate': ['', Validators.required], - 'note': [''] + rejectedOnDate: [ + '', + Validators.required + ], + note: [''] }); } @@ -83,5 +87,4 @@ export class RejectSavingsAccountComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/savings/saving-account-actions/saving-account-actions.component.spec.ts b/src/app/savings/saving-account-actions/saving-account-actions.component.spec.ts index efd0c542f..06c99f4e5 100644 --- a/src/app/savings/saving-account-actions/saving-account-actions.component.spec.ts +++ b/src/app/savings/saving-account-actions/saving-account-actions.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingAccountActionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingAccountActionsComponent ] - }) - .compileComponents(); + declarations: [SavingAccountActionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/saving-account-actions.component.ts b/src/app/savings/saving-account-actions/saving-account-actions.component.ts index caa5bf825..91b666437 100644 --- a/src/app/savings/saving-account-actions/saving-account-actions.component.ts +++ b/src/app/savings/saving-account-actions/saving-account-actions.component.ts @@ -12,36 +12,35 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./saving-account-actions.component.scss'] }) export class SavingAccountActionsComponent { - /** Flag object to store possible actions and render appropriate UI to the user */ actions: { - 'Approve': boolean - 'Reject': boolean - 'Withdrawal': boolean - 'Deposit': boolean - 'Activate': boolean - 'Close': boolean - 'Undo Approval': boolean - 'Post Interest As On': boolean - 'Assign Staff': boolean - 'Add Charge': boolean - 'Unassign Staff': boolean - 'Withdrawn by Client': boolean - 'Apply Annual Fees': boolean - 'Hold Amount': boolean - 'Block Account': boolean - 'Unblock Account': boolean - 'Block Deposit': boolean - 'Unblock Deposit': boolean - 'Block Withdrawal': boolean - 'Unblock Withdrawal': boolean + Approve: boolean; + Reject: boolean; + Withdrawal: boolean; + Deposit: boolean; + Activate: boolean; + Close: boolean; + 'Undo Approval': boolean; + 'Post Interest As On': boolean; + 'Assign Staff': boolean; + 'Add Charge': boolean; + 'Unassign Staff': boolean; + 'Withdrawn by Client': boolean; + 'Apply Annual Fees': boolean; + 'Hold Amount': boolean; + 'Block Account': boolean; + 'Unblock Account': boolean; + 'Block Deposit': boolean; + 'Unblock Deposit': boolean; + 'Block Withdrawal': boolean; + 'Unblock Withdrawal': boolean; } = { - 'Approve': false, - 'Reject': false, - 'Withdrawal': false, - 'Deposit': false, - 'Activate': false, - 'Close': false, + Approve: false, + Reject: false, + Withdrawal: false, + Deposit: false, + Activate: false, + Close: false, 'Undo Approval': false, 'Post Interest As On': false, 'Assign Staff': false, @@ -72,5 +71,4 @@ export class SavingAccountActionsComponent { const name = this.route.snapshot.params['name']; this.actions[name] = true; } - } diff --git a/src/app/savings/saving-account-actions/savings-account-assign-staff/savings-account-assign-staff.component.spec.ts b/src/app/savings/saving-account-actions/savings-account-assign-staff/savings-account-assign-staff.component.spec.ts index 887378fa8..e20bed08d 100644 --- a/src/app/savings/saving-account-actions/savings-account-assign-staff/savings-account-assign-staff.component.spec.ts +++ b/src/app/savings/saving-account-actions/savings-account-assign-staff/savings-account-assign-staff.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingsAccountAssignStaffComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingsAccountAssignStaffComponent ] - }) - .compileComponents(); + declarations: [SavingsAccountAssignStaffComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/savings-account-assign-staff/savings-account-assign-staff.component.ts b/src/app/savings/saving-account-actions/savings-account-assign-staff/savings-account-assign-staff.component.ts index 8b2e27e31..9120f9bd2 100644 --- a/src/app/savings/saving-account-actions/savings-account-assign-staff/savings-account-assign-staff.component.ts +++ b/src/app/savings/saving-account-actions/savings-account-assign-staff/savings-account-assign-staff.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./savings-account-assign-staff.component.scss'] }) export class SavingsAccountAssignStaffComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -39,12 +38,14 @@ export class SavingsAccountAssignStaffComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.accountId = this.route.snapshot.params['savingAccountId']; this.route.data.subscribe((data: { savingsAccountActionData: any }) => { this.savingsAccountData = data.savingsAccountActionData; @@ -65,8 +66,11 @@ export class SavingsAccountAssignStaffComponent implements OnInit { */ createSavingsAssignStaffForm() { this.savingsAssignStaffForm = this.formBuilder.group({ - 'toSavingsOfficerId': [''], - 'assignmentDate': ['', Validators.required] + toSavingsOfficerId: [''], + assignmentDate: [ + '', + Validators.required + ] }); } @@ -92,5 +96,4 @@ export class SavingsAccountAssignStaffComponent implements OnInit { this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - } diff --git a/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.spec.ts b/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.spec.ts index 10846aba5..758cdc5c9 100644 --- a/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.spec.ts +++ b/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.spec.ts @@ -8,9 +8,8 @@ describe('TransactionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingsAccountTransactionsComponent ] - }) - .compileComponents(); + declarations: [SavingsAccountTransactionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.ts b/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.ts index 83cda4648..388baf9b8 100644 --- a/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.ts +++ b/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.ts @@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./savings-account-transactions.component.scss'] }) export class SavingsAccountTransactionsComponent implements OnInit { - /** Minimum Due Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Due Date allowed. */ @@ -27,16 +26,16 @@ export class SavingsAccountTransactionsComponent implements OnInit { savingAccountTransactionForm: UntypedFormGroup; /** savings account transaction payment options. */ paymentTypeOptions: { - id: number, - name: string, - description: string, - isCashPayment: boolean, - position: number + id: number; + name: string; + description: string; + isCashPayment: boolean; + position: number; }[]; /** Flag to enable payment details fields. */ addPaymentDetailsFlag: Boolean = false; /** transaction type flag to render required UI */ - transactionType: { deposit: boolean, withdrawal: boolean } = { deposit: false, withdrawal: false }; + transactionType: { deposit: boolean; withdrawal: boolean } = { deposit: false, withdrawal: false }; /** transaction command for submit request */ transactionCommand: string; /** saving account's Id */ @@ -52,12 +51,14 @@ export class SavingsAccountTransactionsComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private savingsService: SavingsService, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private savingsService: SavingsService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { savingsAccountActionData: any }) => { this.paymentTypeOptions = data.savingsAccountActionData.paymentTypeOptions; if (data.savingsAccountActionData.currency) { @@ -82,10 +83,16 @@ export class SavingsAccountTransactionsComponent implements OnInit { */ createSavingAccountTransactionForm() { this.savingAccountTransactionForm = this.formBuilder.group({ - 'transactionDate': [this.settingsService.businessDate, Validators.required], - 'transactionAmount': [0, Validators.required], - 'paymentTypeId': [''], - 'note': [''] + transactionDate: [ + this.settingsService.businessDate, + Validators.required + ], + transactionAmount: [ + 0, + Validators.required + ], + paymentTypeId: [''], + note: [''] }); } @@ -126,8 +133,10 @@ export class SavingsAccountTransactionsComponent implements OnInit { locale }; data['transactionAmount'] = data['transactionAmount'] * 1; - this.savingsService.executeSavingsAccountTransactionsCommand(this.savingAccountId, this.transactionCommand, data).subscribe(res => { - this.router.navigate(['../../transactions'], { relativeTo: this.route }); - }); + this.savingsService + .executeSavingsAccountTransactionsCommand(this.savingAccountId, this.transactionCommand, data) + .subscribe((res) => { + this.router.navigate(['../../transactions'], { relativeTo: this.route }); + }); } } diff --git a/src/app/savings/saving-account-actions/savings-account-unassign-staff/savings-account-unassign-staff.component.spec.ts b/src/app/savings/saving-account-actions/savings-account-unassign-staff/savings-account-unassign-staff.component.spec.ts index de775a8ea..135a1c762 100644 --- a/src/app/savings/saving-account-actions/savings-account-unassign-staff/savings-account-unassign-staff.component.spec.ts +++ b/src/app/savings/saving-account-actions/savings-account-unassign-staff/savings-account-unassign-staff.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingsAccountUnassignStaffComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingsAccountUnassignStaffComponent ] - }) - .compileComponents(); + declarations: [SavingsAccountUnassignStaffComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/savings-account-unassign-staff/savings-account-unassign-staff.component.ts b/src/app/savings/saving-account-actions/savings-account-unassign-staff/savings-account-unassign-staff.component.ts index 2eade8151..b880c9ffc 100644 --- a/src/app/savings/saving-account-actions/savings-account-unassign-staff/savings-account-unassign-staff.component.ts +++ b/src/app/savings/saving-account-actions/savings-account-unassign-staff/savings-account-unassign-staff.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./savings-account-unassign-staff.component.scss'] }) export class SavingsAccountUnassignStaffComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class SavingsAccountUnassignStaffComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.accountId = this.route.snapshot.params['savingAccountId']; } @@ -57,7 +58,10 @@ export class SavingsAccountUnassignStaffComponent implements OnInit { */ createSavingsUnassignStaffForm() { this.savingsUnassignStaffForm = this.formBuilder.group({ - 'unassignedDate': ['', Validators.required] + unassignedDate: [ + '', + Validators.required + ] }); } @@ -82,5 +86,4 @@ export class SavingsAccountUnassignStaffComponent implements OnInit { this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - } diff --git a/src/app/savings/saving-account-actions/undo-approval-savings-account/undo-approval-savings-account.component.spec.ts b/src/app/savings/saving-account-actions/undo-approval-savings-account/undo-approval-savings-account.component.spec.ts index 24b89a5aa..663eb3314 100644 --- a/src/app/savings/saving-account-actions/undo-approval-savings-account/undo-approval-savings-account.component.spec.ts +++ b/src/app/savings/saving-account-actions/undo-approval-savings-account/undo-approval-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('UndoApprovalSavingsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UndoApprovalSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [UndoApprovalSavingsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/undo-approval-savings-account/undo-approval-savings-account.component.ts b/src/app/savings/saving-account-actions/undo-approval-savings-account/undo-approval-savings-account.component.ts index 01116e115..376a22706 100644 --- a/src/app/savings/saving-account-actions/undo-approval-savings-account/undo-approval-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/undo-approval-savings-account/undo-approval-savings-account.component.ts @@ -15,7 +15,6 @@ import { SavingsService } from 'app/savings/savings.service'; styleUrls: ['./undo-approval-savings-account.component.scss'] }) export class UndoApprovalSavingsAccountComponent implements OnInit { - /** Undo Approval Savings Account form. */ undoApprovalSavingsAccountForm: UntypedFormGroup; /** Savings Account Id */ @@ -27,10 +26,12 @@ export class UndoApprovalSavingsAccountComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private route: ActivatedRoute, - private router: Router) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private route: ActivatedRoute, + private router: Router + ) { this.accountId = this.route.snapshot.params['savingAccountId']; } @@ -46,7 +47,7 @@ export class UndoApprovalSavingsAccountComponent implements OnInit { */ createUndoApprovalSavingsAccountForm() { this.undoApprovalSavingsAccountForm = this.formBuilder.group({ - 'note': [''] + note: [''] }); } @@ -56,11 +57,10 @@ export class UndoApprovalSavingsAccountComponent implements OnInit { */ submit() { const data = { - ...this.undoApprovalSavingsAccountForm.value, + ...this.undoApprovalSavingsAccountForm.value }; this.savingsService.executeSavingsAccountCommand(this.accountId, 'undoapproval', data).subscribe(() => { this.router.navigate(['../../transactions'], { relativeTo: this.route }); }); } - } diff --git a/src/app/savings/saving-account-actions/withdraw-by-client-savings-account/withdraw-by-client-savings-account.component.spec.ts b/src/app/savings/saving-account-actions/withdraw-by-client-savings-account/withdraw-by-client-savings-account.component.spec.ts index 17287ae32..385b4636b 100644 --- a/src/app/savings/saving-account-actions/withdraw-by-client-savings-account/withdraw-by-client-savings-account.component.spec.ts +++ b/src/app/savings/saving-account-actions/withdraw-by-client-savings-account/withdraw-by-client-savings-account.component.spec.ts @@ -8,9 +8,8 @@ describe('WithdrawByClientSavingsAccountComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WithdrawByClientSavingsAccountComponent ] - }) - .compileComponents(); + declarations: [WithdrawByClientSavingsAccountComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/saving-account-actions/withdraw-by-client-savings-account/withdraw-by-client-savings-account.component.ts b/src/app/savings/saving-account-actions/withdraw-by-client-savings-account/withdraw-by-client-savings-account.component.ts index b200ad1bb..c3f901843 100644 --- a/src/app/savings/saving-account-actions/withdraw-by-client-savings-account/withdraw-by-client-savings-account.component.ts +++ b/src/app/savings/saving-account-actions/withdraw-by-client-savings-account/withdraw-by-client-savings-account.component.ts @@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./withdraw-by-client-savings-account.component.scss'] }) export class WithdrawByClientSavingsAccountComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -35,12 +34,14 @@ export class WithdrawByClientSavingsAccountComponent implements OnInit { * @param {Router} router Router * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private dateUtils: Dates, - private route: ActivatedRoute, - private router: Router, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private dateUtils: Dates, + private route: ActivatedRoute, + private router: Router, + private settingsService: SettingsService + ) { this.accountId = this.route.snapshot.params['savingAccountId']; } @@ -57,8 +58,11 @@ export class WithdrawByClientSavingsAccountComponent implements OnInit { */ createWithdrawSavingsAccountForm() { this.withdrawSavingsAccountForm = this.formBuilder.group({ - 'withdrawnOnDate': ['', Validators.required], - 'note': [''] + withdrawnOnDate: [ + '', + Validators.required + ], + note: [''] }); } @@ -83,5 +87,4 @@ export class WithdrawByClientSavingsAccountComponent implements OnInit { this.router.navigate(['../../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/savings/savings-account-stepper/savings-account-charges-step/savings-account-charges-step.component.spec.ts b/src/app/savings/savings-account-stepper/savings-account-charges-step/savings-account-charges-step.component.spec.ts index abf858e0e..32d6da128 100644 --- a/src/app/savings/savings-account-stepper/savings-account-charges-step/savings-account-charges-step.component.spec.ts +++ b/src/app/savings/savings-account-stepper/savings-account-charges-step/savings-account-charges-step.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingsAccountChargesStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingsAccountChargesStepComponent ] - }) - .compileComponents(); + declarations: [SavingsAccountChargesStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-stepper/savings-account-charges-step/savings-account-charges-step.component.ts b/src/app/savings/savings-account-stepper/savings-account-charges-step/savings-account-charges-step.component.ts index 7444b6c46..91c1394fd 100644 --- a/src/app/savings/savings-account-stepper/savings-account-charges-step/savings-account-charges-step.component.ts +++ b/src/app/savings/savings-account-stepper/savings-account-charges-step/savings-account-charges-step.component.ts @@ -23,7 +23,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./savings-account-charges-step.component.scss'] }) export class SavingsAccountChargesStepComponent implements OnInit, OnChanges { - /** Savings Account Product Template */ @Input() savingsAccountProductTemplate: any; /** Savings Account Template */ @@ -42,7 +41,15 @@ export class SavingsAccountChargesStepComponent implements OnInit, OnChanges { /** For Edit Savings Account Form */ isChargesPatched = false; /** Display columns for charges table */ - displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'repaymentsEvery', 'action']; + displayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'date', + 'repaymentsEvery', + 'action' + ]; /** Table Data Source */ dataSource: any; /** Check for select all the Clients List */ @@ -50,34 +57,41 @@ export class SavingsAccountChargesStepComponent implements OnInit, OnChanges { /** Loan Purpose Options */ loanPurposeOptions: string[] = []; /** Table Displayed Columns */ - displayedColumn: string[] = ['check', 'id', 'name']; - + displayedColumn: string[] = [ + 'check', + 'id', + 'name' + ]; /** * @param {MatDialog} dialog Mat Dialog */ - constructor(private dialog: MatDialog, - private dateUtils: Dates, - private translateService: TranslateService) {} + constructor( + private dialog: MatDialog, + private dateUtils: Dates, + private translateService: TranslateService + ) {} - ngOnInit() { + ngOnInit() { if (this.savingsAccountTemplate) { if (!this.isChargesPatched && this.savingsAccountTemplate.charges) { - this.chargesDataSource = this.savingsAccountProductTemplate.charges.map((charge: any) => ({...charge, id: charge.chargeId})) || []; + this.chargesDataSource = + this.savingsAccountProductTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || []; this.isChargesPatched = true; } else { this.chargesDataSource = []; } this.dataSource = new MatTableDataSource(this.activeClientMembers); } - } + } - ngOnChanges() { + ngOnChanges() { if (this.savingsAccountProductTemplate) { this.chargeData = this.savingsAccountProductTemplate.chargeOptions; - this.chargesDataSource = this.savingsAccountProductTemplate.charges.map((charge: any) => ({...charge, id: charge.chargeId})) || []; + this.chargesDataSource = + this.savingsAccountProductTemplate.charges.map((charge: any) => ({ ...charge, id: charge.chargeId })) || []; } - } + } /** * Adds the charge to charges table @@ -101,7 +115,8 @@ export class SavingsAccountChargesStepComponent implements OnInit, OnChanges { value: charge.amount, type: 'number', required: false - }), + }) + ]; const data = { title: this.translateService.instant('labels.heading.Edit Charge Amount'), @@ -131,7 +146,8 @@ export class SavingsAccountChargesStepComponent implements OnInit, OnChanges { value: charge.dueDate || charge.feeOnMonthDay || '', type: 'datetime-local', required: false - }), + }) + ]; const data = { title: this.translateService.instant('labels.heading.Edit Charge Date'), @@ -148,12 +164,12 @@ export class SavingsAccountChargesStepComponent implements OnInit, OnChanges { case 'Specified due date': case 'Weekly Fee': newCharge = { ...charge, dueDate: date }; - break; + break; case 'Annual Fee': case 'Monthly Fee': const dateMonthDay = this.dateUtils.formatDate(response.data.value.date, 'dd MMMM'); newCharge = { ...charge, feeOnMonthDay: dateMonthDay }; - break; + break; } console.log(newCharge); this.chargesDataSource.splice(this.chargesDataSource.indexOf(charge), 1, newCharge); @@ -175,7 +191,8 @@ export class SavingsAccountChargesStepComponent implements OnInit, OnChanges { value: charge.feeInterval, type: 'text', required: false - }), + }) + ]; const data = { title: 'Edit Charge Fee Interval', @@ -211,7 +228,7 @@ export class SavingsAccountChargesStepComponent implements OnInit, OnChanges { } get selectedClientMembers() { - return { selectedMembers: this.activeClientMembers.filter( (item: any) => item.selected ) }; + return { selectedMembers: this.activeClientMembers.filter((item: any) => item.selected) }; } /** Toggle all checks */ @@ -224,7 +241,7 @@ export class SavingsAccountChargesStepComponent implements OnInit, OnChanges { /** Check if all the checks are selected */ toggleSelect() { const len = this.activeClientMembers.length; - this.selectAllItems = len === 0 ? false : this.activeClientMembers.filter( (item: any) => item.selected ).length === len; + this.selectAllItems = + len === 0 ? false : this.activeClientMembers.filter((item: any) => item.selected).length === len; } - } diff --git a/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.spec.ts b/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.spec.ts index 617d1aca2..0306da95c 100644 --- a/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.spec.ts +++ b/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingsAccountDetailsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingsAccountDetailsStepComponent ] - }) - .compileComponents(); + declarations: [SavingsAccountDetailsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts b/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts index b8e257143..d5fbc51ea 100644 --- a/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts +++ b/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts @@ -15,7 +15,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./savings-account-details-step.component.scss'] }) export class SavingsAccountDetailsStepComponent implements OnInit { - /** Savings Account Template */ @Input() savingsAccountTemplate: any; @@ -43,9 +42,11 @@ export class SavingsAccountDetailsStepComponent implements OnInit { * @param {SavingsService} savingsService Savings Service. * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private savingsService: SavingsService, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private savingsService: SavingsService, + private settingsService: SettingsService + ) { this.createSavingsAccountDetailsForm(); } @@ -56,13 +57,15 @@ export class SavingsAccountDetailsStepComponent implements OnInit { this.productData = this.savingsAccountTemplate.productOptions; if (this.savingsAccountTemplate.savingsProductId) { this.savingsAccountDetailsForm.patchValue({ - 'productId': this.savingsAccountTemplate.savingsProductId, - 'submittedOnDate': this.savingsAccountTemplate.timeline.submittedOnDate && new Date(this.savingsAccountTemplate.timeline.submittedOnDate), - 'externalId': this.savingsAccountTemplate.externalId + productId: this.savingsAccountTemplate.savingsProductId, + submittedOnDate: + this.savingsAccountTemplate.timeline.submittedOnDate && + new Date(this.savingsAccountTemplate.timeline.submittedOnDate), + externalId: this.savingsAccountTemplate.externalId }); } else { this.savingsAccountDetailsForm.patchValue({ - 'submittedOnDate': new Date() + submittedOnDate: new Date() }); } } @@ -73,10 +76,16 @@ export class SavingsAccountDetailsStepComponent implements OnInit { */ createSavingsAccountDetailsForm() { this.savingsAccountDetailsForm = this.formBuilder.group({ - 'productId': ['', Validators.required], - 'submittedOnDate': ['', Validators.required], - 'fieldOfficerId': [''], - 'externalId': [''] + productId: [ + '', + Validators.required + ], + submittedOnDate: [ + '', + Validators.required + ], + fieldOfficerId: [''], + externalId: [''] }); } @@ -86,18 +95,19 @@ export class SavingsAccountDetailsStepComponent implements OnInit { buildDependencies() { const entityId = this.savingsAccountTemplate.clientId || this.savingsAccountTemplate.groupId; this.savingsAccountDetailsForm.get('productId').valueChanges.subscribe((productId: string) => { - this.savingsService.getSavingsAccountTemplate(entityId, productId, this.savingsAccountTemplate.groupId ? true : false) - .subscribe((response: any) => { - this.savingsAccountProductTemplate.emit(response); - this.fieldOfficerData = response.fieldOfficerOptions; - this.savingsProductSelected = true; - if (!this.isFieldOfficerPatched && this.savingsAccountTemplate.fieldOfficerId) { - this.savingsAccountDetailsForm.get('fieldOfficerId').patchValue(this.savingsAccountTemplate.fieldOfficerId); - this.isFieldOfficerPatched = true; - } else { - this.savingsAccountDetailsForm.get('fieldOfficerId').patchValue(''); - } - }); + this.savingsService + .getSavingsAccountTemplate(entityId, productId, this.savingsAccountTemplate.groupId ? true : false) + .subscribe((response: any) => { + this.savingsAccountProductTemplate.emit(response); + this.fieldOfficerData = response.fieldOfficerOptions; + this.savingsProductSelected = true; + if (!this.isFieldOfficerPatched && this.savingsAccountTemplate.fieldOfficerId) { + this.savingsAccountDetailsForm.get('fieldOfficerId').patchValue(this.savingsAccountTemplate.fieldOfficerId); + this.isFieldOfficerPatched = true; + } else { + this.savingsAccountDetailsForm.get('fieldOfficerId').patchValue(''); + } + }); }); } @@ -107,5 +117,4 @@ export class SavingsAccountDetailsStepComponent implements OnInit { get savingsAccountDetails() { return this.savingsAccountDetailsForm.getRawValue(); } - } diff --git a/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.spec.ts b/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.spec.ts index bc397e0c0..19d5ff3f1 100644 --- a/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.spec.ts +++ b/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingsAccountPreviewStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingsAccountPreviewStepComponent ] - }) - .compileComponents(); + declarations: [SavingsAccountPreviewStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.ts b/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.ts index 9e184f7a6..ce5e40909 100644 --- a/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.ts +++ b/src/app/savings/savings-account-stepper/savings-account-preview-step/savings-account-preview-step.component.ts @@ -11,7 +11,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./savings-account-preview-step.component.scss'] }) export class SavingsAccountPreviewStepComponent { - /** Savings Account Product Template */ @Input() savingsAccountProductTemplate: any; /** Savings Account Template */ @@ -22,12 +21,19 @@ export class SavingsAccountPreviewStepComponent { @Input() savingsAccount: any; /** Display columns for charges table */ - chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date', 'repaymentsEvery']; + chargesDisplayedColumns: string[] = [ + 'name', + 'chargeCalculationType', + 'amount', + 'chargeTimeType', + 'date', + 'repaymentsEvery' + ]; /** Form submission event */ @Output() submitEvent = new EventEmitter(); - constructor(private translateService: TranslateService) { } + constructor(private translateService: TranslateService) {} getCatalogTranslation(text: string): string { return this.translateService.instant('labels.catalogs.' + text); diff --git a/src/app/savings/savings-account-stepper/savings-account-terms-step/savings-account-terms-step.component.spec.ts b/src/app/savings/savings-account-stepper/savings-account-terms-step/savings-account-terms-step.component.spec.ts index c299ed0d2..bed831cad 100644 --- a/src/app/savings/savings-account-stepper/savings-account-terms-step/savings-account-terms-step.component.spec.ts +++ b/src/app/savings/savings-account-stepper/savings-account-terms-step/savings-account-terms-step.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingsAccountTermsStepComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingsAccountTermsStepComponent ] - }) - .compileComponents(); + declarations: [SavingsAccountTermsStepComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-stepper/savings-account-terms-step/savings-account-terms-step.component.ts b/src/app/savings/savings-account-stepper/savings-account-terms-step/savings-account-terms-step.component.ts index 3afaccb7b..5dc773f4b 100644 --- a/src/app/savings/savings-account-stepper/savings-account-terms-step/savings-account-terms-step.component.ts +++ b/src/app/savings/savings-account-stepper/savings-account-terms-step/savings-account-terms-step.component.ts @@ -12,7 +12,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./savings-account-terms-step.component.scss'] }) export class SavingsAccountTermsStepComponent implements OnChanges, OnInit { - /** Savings Account and Product Template */ @Input() savingsAccountProductTemplate: any; /** Savings Account Template */ @@ -39,8 +38,10 @@ export class SavingsAccountTermsStepComponent implements OnChanges, OnInit { * @param {FormBuilder} formBuilder Form Builder * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private settingsService: SettingsService + ) { this.createSavingsAccountTermsForm(); this.buildDependencies(); } @@ -48,22 +49,22 @@ export class SavingsAccountTermsStepComponent implements OnChanges, OnInit { ngOnChanges() { if (this.savingsAccountProductTemplate) { this.savingsAccountTermsForm.patchValue({ - 'currencyCode': this.savingsAccountProductTemplate.currency.code, - 'decimal': this.savingsAccountProductTemplate.currency.decimalPlaces, - 'minBalanceForInterestCalculation': this.savingsAccountProductTemplate.minBalanceForInterestCalculation, - 'nominalAnnualInterestRate': this.savingsAccountProductTemplate.nominalAnnualInterestRate, - 'interestCompoundingPeriodType': this.savingsAccountProductTemplate.interestCompoundingPeriodType.id, - 'interestPostingPeriodType': this.savingsAccountProductTemplate.interestPostingPeriodType.id, - 'interestCalculationType': this.savingsAccountProductTemplate.interestCalculationType.id, - 'interestCalculationDaysInYearType': this.savingsAccountProductTemplate.interestCalculationDaysInYearType.id, - 'minRequiredOpeningBalance': this.savingsAccountProductTemplate.minRequiredOpeningBalance, - 'allowOverdraft': this.savingsAccountProductTemplate.allowOverdraft, - 'overdraftLimit': this.savingsAccountProductTemplate.overdraftLimit, - 'enforceMinRequiredBalance': this.savingsAccountProductTemplate.enforceMinRequiredBalance, - 'minOverdraftForInterestCalculation': this.savingsAccountProductTemplate.minOverdraftForInterestCalculation, - 'nominalAnnualInterestRateOverdraft': this.savingsAccountProductTemplate.nominalAnnualInterestRateOverdraft, - 'minRequiredBalance': this.savingsAccountProductTemplate.minRequiredBalance, - 'withdrawalFeeForTransfers': this.savingsAccountProductTemplate.withdrawalFeeForTransfers + currencyCode: this.savingsAccountProductTemplate.currency.code, + decimal: this.savingsAccountProductTemplate.currency.decimalPlaces, + minBalanceForInterestCalculation: this.savingsAccountProductTemplate.minBalanceForInterestCalculation, + nominalAnnualInterestRate: this.savingsAccountProductTemplate.nominalAnnualInterestRate, + interestCompoundingPeriodType: this.savingsAccountProductTemplate.interestCompoundingPeriodType.id, + interestPostingPeriodType: this.savingsAccountProductTemplate.interestPostingPeriodType.id, + interestCalculationType: this.savingsAccountProductTemplate.interestCalculationType.id, + interestCalculationDaysInYearType: this.savingsAccountProductTemplate.interestCalculationDaysInYearType.id, + minRequiredOpeningBalance: this.savingsAccountProductTemplate.minRequiredOpeningBalance, + allowOverdraft: this.savingsAccountProductTemplate.allowOverdraft, + overdraftLimit: this.savingsAccountProductTemplate.overdraftLimit, + enforceMinRequiredBalance: this.savingsAccountProductTemplate.enforceMinRequiredBalance, + minOverdraftForInterestCalculation: this.savingsAccountProductTemplate.minOverdraftForInterestCalculation, + nominalAnnualInterestRateOverdraft: this.savingsAccountProductTemplate.nominalAnnualInterestRateOverdraft, + minRequiredBalance: this.savingsAccountProductTemplate.minRequiredBalance, + withdrawalFeeForTransfers: this.savingsAccountProductTemplate.withdrawalFeeForTransfers }); this.setOptions(); } @@ -73,18 +74,20 @@ export class SavingsAccountTermsStepComponent implements OnChanges, OnInit { this.maxDate = this.settingsService.businessDate; if (this.savingsAccountTemplate) { this.savingsAccountTermsForm.patchValue({ - 'nominalAnnualInterestRate': this.savingsAccountTemplate.nominalAnnualInterestRate, - 'interestCompoundingPeriodType': this.savingsAccountTemplate.interestCompoundingPeriodType.id, - 'interestPostingPeriodType': this.savingsAccountTemplate.interestPostingPeriodType.id, - 'interestCalculationType': this.savingsAccountTemplate.interestCalculationType.id, - 'interestCalculationDaysInYearType': this.savingsAccountTemplate.interestCalculationDaysInYearType.id, - 'minRequiredOpeningBalance': this.savingsAccountTemplate.minRequiredOpeningBalance, - 'withdrawalFeeForTransfers': this.savingsAccountTemplate.withdrawalFeeForTransfers, - 'lockinPeriodFrequency': this.savingsAccountTemplate.lockinPeriodFrequency, - 'lockinPeriodFrequencyType': this.savingsAccountTemplate.lockinPeriodFrequencyType && this.savingsAccountTemplate.lockinPeriodFrequencyType.id, - 'allowOverdraft': this.savingsAccountTemplate.allowOverdraft, - 'enforceMinRequiredBalance': this.savingsAccountTemplate.enforceMinRequiredBalance, - 'minRequiredBalance': this.savingsAccountTemplate.minRequiredBalance, + nominalAnnualInterestRate: this.savingsAccountTemplate.nominalAnnualInterestRate, + interestCompoundingPeriodType: this.savingsAccountTemplate.interestCompoundingPeriodType.id, + interestPostingPeriodType: this.savingsAccountTemplate.interestPostingPeriodType.id, + interestCalculationType: this.savingsAccountTemplate.interestCalculationType.id, + interestCalculationDaysInYearType: this.savingsAccountTemplate.interestCalculationDaysInYearType.id, + minRequiredOpeningBalance: this.savingsAccountTemplate.minRequiredOpeningBalance, + withdrawalFeeForTransfers: this.savingsAccountTemplate.withdrawalFeeForTransfers, + lockinPeriodFrequency: this.savingsAccountTemplate.lockinPeriodFrequency, + lockinPeriodFrequencyType: + this.savingsAccountTemplate.lockinPeriodFrequencyType && + this.savingsAccountTemplate.lockinPeriodFrequencyType.id, + allowOverdraft: this.savingsAccountTemplate.allowOverdraft, + enforceMinRequiredBalance: this.savingsAccountTemplate.enforceMinRequiredBalance, + minRequiredBalance: this.savingsAccountTemplate.minRequiredBalance }); } } @@ -94,21 +97,36 @@ export class SavingsAccountTermsStepComponent implements OnChanges, OnInit { */ createSavingsAccountTermsForm() { this.savingsAccountTermsForm = this.formBuilder.group({ - 'currencyCode': [{value: '', disabled: true}], - 'decimal': [{value: '', disabled: true}], - 'nominalAnnualInterestRate': ['', Validators.required], - 'interestCompoundingPeriodType': ['', Validators.required], - 'interestPostingPeriodType': ['', Validators.required], - 'interestCalculationType': ['', Validators.required], - 'interestCalculationDaysInYearType': ['', Validators.required], - 'minRequiredOpeningBalance': [''], - 'withdrawalFeeForTransfers': [false], - 'lockinPeriodFrequency': [''], - 'lockinPeriodFrequencyType': [''], - 'allowOverdraft': [false], - 'enforceMinRequiredBalance': [false], - 'minRequiredBalance': [''], - 'minBalanceForInterestCalculation': [{value: '', disabled: true}] + currencyCode: [{ value: '', disabled: true }], + decimal: [{ value: '', disabled: true }], + nominalAnnualInterestRate: [ + '', + Validators.required + ], + interestCompoundingPeriodType: [ + '', + Validators.required + ], + interestPostingPeriodType: [ + '', + Validators.required + ], + interestCalculationType: [ + '', + Validators.required + ], + interestCalculationDaysInYearType: [ + '', + Validators.required + ], + minRequiredOpeningBalance: [''], + withdrawalFeeForTransfers: [false], + lockinPeriodFrequency: [''], + lockinPeriodFrequencyType: [''], + allowOverdraft: [false], + enforceMinRequiredBalance: [false], + minRequiredBalance: [''], + minBalanceForInterestCalculation: [{ value: '', disabled: true }] }); } @@ -120,7 +138,8 @@ export class SavingsAccountTermsStepComponent implements OnChanges, OnInit { this.interestCompoundingPeriodTypeData = this.savingsAccountProductTemplate.interestCompoundingPeriodTypeOptions; this.interestPostingPeriodTypeData = this.savingsAccountProductTemplate.interestPostingPeriodTypeOptions; this.interestCalculationTypeData = this.savingsAccountProductTemplate.interestCalculationTypeOptions; - this.interestCalculationDaysInYearTypeData = this.savingsAccountProductTemplate.interestCalculationDaysInYearTypeOptions; + this.interestCalculationDaysInYearTypeData = + this.savingsAccountProductTemplate.interestCalculationDaysInYearTypeOptions; } /** @@ -150,5 +169,4 @@ export class SavingsAccountTermsStepComponent implements OnChanges, OnInit { delete payload.minBalanceForInterestCalculation; // Backend is not accepting minBalanceForInterestCalculation value return payload; } - } diff --git a/src/app/savings/savings-account-view/charges-tab/charges-tab.component.spec.ts b/src/app/savings/savings-account-view/charges-tab/charges-tab.component.spec.ts index 1ef118215..0733958ac 100644 --- a/src/app/savings/savings-account-view/charges-tab/charges-tab.component.spec.ts +++ b/src/app/savings/savings-account-view/charges-tab/charges-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('ChargesTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChargesTabComponent ] - }) - .compileComponents(); + declarations: [ChargesTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/charges-tab/charges-tab.component.ts b/src/app/savings/savings-account-view/charges-tab/charges-tab.component.ts index 540b5a376..5307d1be3 100644 --- a/src/app/savings/savings-account-view/charges-tab/charges-tab.component.ts +++ b/src/app/savings/savings-account-view/charges-tab/charges-tab.component.ts @@ -30,7 +30,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./charges-tab.component.scss'] }) export class ChargesTabComponent implements OnInit { - /** Savings Account Data */ savingsAccountData: any; /** Charges Data */ @@ -66,13 +65,15 @@ export class ChargesTabComponent implements OnInit { * @param {Dates} dateUtils Date Utils. * @param {SettingsService} settingsService Setting service */ - constructor(private savingsService: SavingsService, - private route: ActivatedRoute, - private dateUtils: Dates, - private router: Router, - private dialog: MatDialog, - private settingsService: SettingsService, - private translateService: TranslateService) { + constructor( + private savingsService: SavingsService, + private route: ActivatedRoute, + private dateUtils: Dates, + private router: Router, + private dialog: MatDialog, + private settingsService: SettingsService, + private translateService: TranslateService + ) { this.route.parent.data.subscribe((data: { savingsAccountData: any }) => { this.savingsAccountData = data.savingsAccountData; this.chargesData = this.savingsAccountData.charges; @@ -80,7 +81,7 @@ export class ChargesTabComponent implements OnInit { } ngOnInit() { - const activeCharges = this.chargesData ? this.chargesData.filter(charge => charge.isActive) : []; + const activeCharges = this.chargesData ? this.chargesData.filter((charge) => charge.isActive) : []; this.dataSource = new MatTableDataSource(activeCharges); } @@ -90,16 +91,15 @@ export class ChargesTabComponent implements OnInit { toggleCharges() { this.showInactiveCharges = !this.showInactiveCharges; if (!this.showInactiveCharges) { - const activeCharges = this.chargesData.filter(charge => charge.isActive); + const activeCharges = this.chargesData.filter((charge) => charge.isActive); this.dataSource.data = activeCharges; } else { - const inActiveCharges = this.chargesData.filter(charge => !charge.isActive); + const inActiveCharges = this.chargesData.filter((charge) => !charge.isActive); this.dataSource.data = inActiveCharges; } this.chargesTableRef.renderRows(); } - /** * Pays the charge. * @param {any} chargeId Charge Id @@ -120,6 +120,7 @@ export class ChargesTabComponent implements OnInit { type: 'date', required: true }) + ]; const data = { title: `Pay Charge ${chargeId}`, @@ -137,7 +138,8 @@ export class ChargesTabComponent implements OnInit { dateFormat, locale }; - this.savingsService.executeSavingsAccountChargesCommand(this.savingsAccountData.id, 'paycharge', dataObject, chargeId) + this.savingsService + .executeSavingsAccountChargesCommand(this.savingsAccountData.id, 'paycharge', dataObject, chargeId) .subscribe(() => { this.reload(); }); @@ -153,7 +155,8 @@ export class ChargesTabComponent implements OnInit { const waiveChargeDialogRef = this.dialog.open(WaiveChargeDialogComponent, { data: { id: chargeId } }); waiveChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountChargesCommand(this.savingsAccountData.id, 'waive', {}, chargeId) + this.savingsService + .executeSavingsAccountChargesCommand(this.savingsAccountData.id, 'waive', {}, chargeId) .subscribe(() => { this.reload(); }); @@ -169,7 +172,8 @@ export class ChargesTabComponent implements OnInit { const inactivateChargeDialogRef = this.dialog.open(InactivateChargeDialogComponent, { data: { id: chargeId } }); inactivateChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountChargesCommand(this.savingsAccountData.id, 'inactivate', {}, chargeId) + this.savingsService + .executeSavingsAccountChargesCommand(this.savingsAccountData.id, 'inactivate', {}, chargeId) .subscribe(() => { this.reload(); }); @@ -190,6 +194,7 @@ export class ChargesTabComponent implements OnInit { type: 'number', required: true }) + ]; const data = { title: `Edit Charge ${charge.id}`, @@ -206,7 +211,8 @@ export class ChargesTabComponent implements OnInit { dateFormat, locale }; - this.savingsService.editSavingsAccountCharge(this.savingsAccountData.id, dataObject, charge.id) + this.savingsService + .editSavingsAccountCharge(this.savingsAccountData.id, dataObject, charge.id) .subscribe(() => { this.reload(); }); @@ -224,10 +230,9 @@ export class ChargesTabComponent implements OnInit { }); deleteChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.savingsService.deleteSavingsAccountCharge(this.savingsAccountData.id, chargeId) - .subscribe(() => { - this.reload(); - }); + this.savingsService.deleteSavingsAccountCharge(this.savingsAccountData.id, chargeId).subscribe(() => { + this.reload(); + }); } }); } @@ -237,7 +242,11 @@ export class ChargesTabComponent implements OnInit { * @param {any} charge Charge */ isRecurringCharge(charge: any) { - return charge.chargeTimeType.value === 'Monthly Fee' || charge.chargeTimeType.value === 'Annual Fee' || charge.chargeTimeType.value === 'Weekly Fee'; + return ( + charge.chargeTimeType.value === 'Monthly Fee' || + charge.chargeTimeType.value === 'Annual Fee' || + charge.chargeTimeType.value === 'Weekly Fee' + ); } /** @@ -254,13 +263,14 @@ export class ChargesTabComponent implements OnInit { */ private reload() { const url: string = this.router.url; - const refreshUrl: string = this.router.url.slice(0, this.router.url.indexOf('savings-accounts') + 'savings-accounts'.length); - this.router.navigateByUrl(refreshUrl, {skipLocationChange: true}) - .then(() => this.router.navigate([url])); + const refreshUrl: string = this.router.url.slice( + 0, + this.router.url.indexOf('savings-accounts') + 'savings-accounts'.length + ); + this.router.navigateByUrl(refreshUrl, { skipLocationChange: true }).then(() => this.router.navigate([url])); } viewAllChargeButtons(text: string): string { return this.translateService.instant('labels.buttons.' + text); } - } diff --git a/src/app/savings/savings-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.spec.ts b/src/app/savings/savings-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.spec.ts index 56e05d8a5..ea1d30a51 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.spec.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('CalculateInterestDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CalculateInterestDialogComponent ] - }) - .compileComponents(); + declarations: [CalculateInterestDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.ts b/src/app/savings/savings-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.ts index 8dbf9b28a..228b51f6f 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/calculate-interest-dialog/calculate-interest-dialog.component.ts @@ -11,10 +11,8 @@ import { MatDialogRef } from '@angular/material/dialog'; styleUrls: ['./calculate-interest-dialog.component.scss'] }) export class CalculateInterestDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. */ - constructor(public dialogRef: MatDialogRef) { } - + constructor(public dialogRef: MatDialogRef) {} } diff --git a/src/app/savings/savings-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.spec.ts b/src/app/savings/savings-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.spec.ts index 6bf5313f2..a81ed7183 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.spec.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('InactivateChargeDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ InactivateChargeDialogComponent ] - }) - .compileComponents(); + declarations: [InactivateChargeDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.ts b/src/app/savings/savings-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.ts index c07074533..c4e8420f2 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.ts @@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./inactivate-charge-dialog.component.scss'] }) export class InactivateChargeDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/savings/savings-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.spec.ts b/src/app/savings/savings-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.spec.ts index f8acdff28..d764a3da8 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.spec.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('PostInterestDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ PostInterestDialogComponent ] - }) - .compileComponents(); + declarations: [PostInterestDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.ts b/src/app/savings/savings-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.ts index 530ba8f5b..4cf7d3c3a 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/post-interest-dialog/post-interest-dialog.component.ts @@ -11,10 +11,8 @@ import { MatDialogRef } from '@angular/material/dialog'; styleUrls: ['./post-interest-dialog.component.scss'] }) export class PostInterestDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. */ - constructor(public dialogRef: MatDialogRef) { } - + constructor(public dialogRef: MatDialogRef) {} } diff --git a/src/app/savings/savings-account-view/custom-dialogs/release-amount-dialog/release-amount-dialog.component.spec.ts b/src/app/savings/savings-account-view/custom-dialogs/release-amount-dialog/release-amount-dialog.component.spec.ts index debb7b76d..14a92cb1d 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/release-amount-dialog/release-amount-dialog.component.spec.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/release-amount-dialog/release-amount-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('ReleaseAmountDialogComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ReleaseAmountDialogComponent ] - }) - .compileComponents(); + declarations: [ReleaseAmountDialogComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/custom-dialogs/release-amount-dialog/release-amount-dialog.component.ts b/src/app/savings/savings-account-view/custom-dialogs/release-amount-dialog/release-amount-dialog.component.ts index 61cdc6554..5dfa7957d 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/release-amount-dialog/release-amount-dialog.component.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/release-amount-dialog/release-amount-dialog.component.ts @@ -7,10 +7,8 @@ import { MatDialogRef } from '@angular/material/dialog'; styleUrls: ['./release-amount-dialog.component.scss'] }) export class ReleaseAmountDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. */ - constructor(public dialogRef: MatDialogRef) { } - + constructor(public dialogRef: MatDialogRef) {} } diff --git a/src/app/savings/savings-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.spec.ts b/src/app/savings/savings-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.spec.ts index f0214dca7..4ddd92200 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.spec.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('ToggleWithholdTaxDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ToggleWithholdTaxDialogComponent ] - }) - .compileComponents(); + declarations: [ToggleWithholdTaxDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.ts b/src/app/savings/savings-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.ts index 5979f2946..7ad9b6505 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/toggle-withhold-tax-dialog/toggle-withhold-tax-dialog.component.ts @@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./toggle-withhold-tax-dialog.component.scss'] }) export class ToggleWithholdTaxDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/savings/savings-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.spec.ts b/src/app/savings/savings-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.spec.ts index dbc966965..d279d4502 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.spec.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('UndoTransactionDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UndoTransactionDialogComponent ] - }) - .compileComponents(); + declarations: [UndoTransactionDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.ts b/src/app/savings/savings-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.ts index e25bcf103..94423a123 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.ts @@ -11,10 +11,8 @@ import { MatDialogRef } from '@angular/material/dialog'; styleUrls: ['./undo-transaction-dialog.component.scss'] }) export class UndoTransactionDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. */ - constructor(public dialogRef: MatDialogRef) { } - + constructor(public dialogRef: MatDialogRef) {} } diff --git a/src/app/savings/savings-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.spec.ts b/src/app/savings/savings-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.spec.ts index 7d9bbd5ae..a9dfd1dcd 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.spec.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('WaiveChargeDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ WaiveChargeDialogComponent ] - }) - .compileComponents(); + declarations: [WaiveChargeDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.ts b/src/app/savings/savings-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.ts index 460d71874..2d7577ba7 100644 --- a/src/app/savings/savings-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.ts +++ b/src/app/savings/savings-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.ts @@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./waive-charge-dialog.component.scss'] }) export class WaiveChargeDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/savings/savings-account-view/datatable-tabs/datatable-tabs.component.spec.ts b/src/app/savings/savings-account-view/datatable-tabs/datatable-tabs.component.spec.ts index 0f1dfa604..571f3ae93 100644 --- a/src/app/savings/savings-account-view/datatable-tabs/datatable-tabs.component.spec.ts +++ b/src/app/savings/savings-account-view/datatable-tabs/datatable-tabs.component.spec.ts @@ -8,9 +8,8 @@ describe('DatatableTabsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DatatableTabsComponent ] - }) - .compileComponents(); + declarations: [DatatableTabsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/datatable-tabs/datatable-tabs.component.ts b/src/app/savings/savings-account-view/datatable-tabs/datatable-tabs.component.ts index aa665be93..77a7434c9 100644 --- a/src/app/savings/savings-account-view/datatable-tabs/datatable-tabs.component.ts +++ b/src/app/savings/savings-account-view/datatable-tabs/datatable-tabs.component.ts @@ -29,5 +29,4 @@ export class DatatableTabsComponent { this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false; }); } - } diff --git a/src/app/savings/savings-account-view/general-tab/general-tab.component.spec.ts b/src/app/savings/savings-account-view/general-tab/general-tab.component.spec.ts index 23d4dfb2b..c0c1ba0aa 100644 --- a/src/app/savings/savings-account-view/general-tab/general-tab.component.spec.ts +++ b/src/app/savings/savings-account-view/general-tab/general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GeneralTabComponent ] - }) - .compileComponents(); + declarations: [GeneralTabComponent] + }).compileComponents(); fixture = TestBed.createComponent(GeneralTabComponent); component = fixture.componentInstance; diff --git a/src/app/savings/savings-account-view/general-tab/general-tab.component.ts b/src/app/savings/savings-account-view/general-tab/general-tab.component.ts index 2c7fe106e..3f10d83e9 100644 --- a/src/app/savings/savings-account-view/general-tab/general-tab.component.ts +++ b/src/app/savings/savings-account-view/general-tab/general-tab.component.ts @@ -15,14 +15,16 @@ export class GeneralTabComponent { savingsAccountData: any; currency: Currency; - constructor(private route: ActivatedRoute, - private router: Router) { + constructor( + private route: ActivatedRoute, + private router: Router + ) { this.route.parent.parent.data.subscribe((data: { savingsAccountData: any }) => { this.savingsAccountData = data.savingsAccountData; this.currency = this.savingsAccountData.currency; this.isLoading = false; const status = this.savingsAccountData.status.value; - this.isActive = (status === 'Active'); + this.isActive = status === 'Active'; }); if (this.router.url.includes('clients')) { this.entityType = 'Client'; @@ -32,5 +34,4 @@ export class GeneralTabComponent { this.entityType = 'Center'; } } - } diff --git a/src/app/savings/savings-account-view/notes-tab/notes-tab.component.spec.ts b/src/app/savings/savings-account-view/notes-tab/notes-tab.component.spec.ts index 017254b1f..27466781e 100644 --- a/src/app/savings/savings-account-view/notes-tab/notes-tab.component.spec.ts +++ b/src/app/savings/savings-account-view/notes-tab/notes-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('NotesTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ NotesTabComponent ] - }) - .compileComponents(); + declarations: [NotesTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/notes-tab/notes-tab.component.ts b/src/app/savings/savings-account-view/notes-tab/notes-tab.component.ts index 69a0aafd8..e348575db 100644 --- a/src/app/savings/savings-account-view/notes-tab/notes-tab.component.ts +++ b/src/app/savings/savings-account-view/notes-tab/notes-tab.component.ts @@ -9,14 +9,15 @@ import { SavingsService } from 'app/savings/savings.service'; styleUrls: ['./notes-tab.component.scss'] }) export class NotesTabComponent { - entityId: string; username: string; entityNotes: any; - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private savingsService: SavingsService, - private authenticationService: AuthenticationService) { + private authenticationService: AuthenticationService + ) { const savedCredentials = this.authenticationService.getCredentials(); this.username = savedCredentials.username; this.entityId = this.route.parent.snapshot.params['savingAccountId']; @@ -37,16 +38,14 @@ export class NotesTabComponent { } editNote(noteId: string, noteContent: any, index: number) { - this.savingsService.editSavingsNote(this.entityId, noteId, noteContent).subscribe(() => { - this.entityNotes[index].note = noteContent.note; - }); + this.savingsService.editSavingsNote(this.entityId, noteId, noteContent).subscribe(() => { + this.entityNotes[index].note = noteContent.note; + }); } deleteNote(noteId: string, index: number) { - this.savingsService.deleteSavingsNote(this.entityId, noteId) - .subscribe(() => { - this.entityNotes.splice(index, 1); - }); + this.savingsService.deleteSavingsNote(this.entityId, noteId).subscribe(() => { + this.entityNotes.splice(index, 1); + }); } - } diff --git a/src/app/savings/savings-account-view/savings-account-view.component.spec.ts b/src/app/savings/savings-account-view/savings-account-view.component.spec.ts index 74fa6f85d..2763e7848 100644 --- a/src/app/savings/savings-account-view/savings-account-view.component.spec.ts +++ b/src/app/savings/savings-account-view/savings-account-view.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingsAccountViewComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SavingsAccountViewComponent ] - }) - .compileComponents(); + declarations: [SavingsAccountViewComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/savings-account-view.component.ts b/src/app/savings/savings-account-view/savings-account-view.component.ts index 56c99abe2..2d390019f 100644 --- a/src/app/savings/savings-account-view/savings-account-view.component.ts +++ b/src/app/savings/savings-account-view/savings-account-view.component.ts @@ -25,7 +25,6 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./savings-account-view.component.scss'] }) export class SavingsAccountViewComponent implements OnInit { - /** Savings Account Data */ savingsAccountData: any; /** Savings Data Tables */ @@ -44,12 +43,14 @@ export class SavingsAccountViewComponent implements OnInit { * @param {Router} router Router * @param {SavingsService} savingsService Savings Service */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private router: Router, private savingsService: SavingsService, private translateService: TranslateService, - public dialog: MatDialog) { - this.route.data.subscribe((data: { savingsAccountData: any, savingsDatatables: any }) => { + public dialog: MatDialog + ) { + this.route.data.subscribe((data: { savingsAccountData: any; savingsDatatables: any }) => { this.savingsAccountData = data.savingsAccountData; this.currency = this.savingsAccountData.currency; this.savingsDatatables = data.savingsDatatables; @@ -72,7 +73,7 @@ export class SavingsAccountViewComponent implements OnInit { */ setConditionalButtons() { const status = this.savingsAccountData.status.value; - this.isActive = (status === 'Active'); + this.isActive = status === 'Active'; const subStatus = this.savingsAccountData.subStatus; this.buttonConfig = new SavingsButtonsConfiguration(status, subStatus); if (this.savingsAccountData.clientId) { @@ -124,9 +125,11 @@ export class SavingsAccountViewComponent implements OnInit { */ private reload() { const url: string = this.router.url; - const refreshUrl: string = this.router.url.slice(0, this.router.url.indexOf('savings-accounts') + 'savings-accounts'.length); - this.router.navigateByUrl(refreshUrl, { skipLocationChange: true }) - .then(() => this.router.navigate([url])); + const refreshUrl: string = this.router.url.slice( + 0, + this.router.url.indexOf('savings-accounts') + 'savings-accounts'.length + ); + this.router.navigateByUrl(refreshUrl, { skipLocationChange: true }).then(() => this.router.navigate([url])); } /** @@ -176,7 +179,10 @@ export class SavingsAccountViewComponent implements OnInit { break; case 'Transfer Funds': const queryParams: any = { savingsId: this.savingsAccountData.id, accountType: 'fromsavings' }; - this.router.navigate(['transfer-funds/make-account-transfer'], { relativeTo: this.route, queryParams: queryParams }); + this.router.navigate(['transfer-funds/make-account-transfer'], { + relativeTo: this.route, + queryParams: queryParams + }); break; case 'Unblock Account': case 'Unblock Deposit': @@ -209,9 +215,11 @@ export class SavingsAccountViewComponent implements OnInit { const calculateInterestAccountDialogRef = this.dialog.open(CalculateInterestDialogComponent); calculateInterestAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountCommand(this.savingsAccountData.id, 'calculateInterest', {}).subscribe(() => { - this.reload(); - }); + this.savingsService + .executeSavingsAccountCommand(this.savingsAccountData.id, 'calculateInterest', {}) + .subscribe(() => { + this.reload(); + }); } }); } @@ -223,9 +231,11 @@ export class SavingsAccountViewComponent implements OnInit { const postInterestAccountDialogRef = this.dialog.open(PostInterestDialogComponent); postInterestAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountCommand(this.savingsAccountData.id, 'postInterest', {}).subscribe(() => { - this.reload(); - }); + this.savingsService + .executeSavingsAccountCommand(this.savingsAccountData.id, 'postInterest', {}) + .subscribe(() => { + this.reload(); + }); } }); } @@ -239,7 +249,8 @@ export class SavingsAccountViewComponent implements OnInit { }); deleteSavingsAccountDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountUpdateCommand(this.savingsAccountData.id, 'updateWithHoldTax', { withHoldTax: true }) + this.savingsService + .executeSavingsAccountUpdateCommand(this.savingsAccountData.id, 'updateWithHoldTax', { withHoldTax: true }) .subscribe(() => { this.reload(); }); @@ -256,7 +267,8 @@ export class SavingsAccountViewComponent implements OnInit { }); disableWithHoldTaxDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountUpdateCommand(this.savingsAccountData.id, 'updateWithHoldTax', { withHoldTax: false }) + this.savingsService + .executeSavingsAccountUpdateCommand(this.savingsAccountData.id, 'updateWithHoldTax', { withHoldTax: false }) .subscribe(() => { this.reload(); }); @@ -269,7 +281,13 @@ export class SavingsAccountViewComponent implements OnInit { */ private unblockSavingsAccount(action: string) { const unblockSavingsAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, { - data: { heading: this.translateService.instant('labels.heading.Savings Account'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want') + action + this.translateService.instant('this Savings Account') } + data: { + heading: this.translateService.instant('labels.heading.Savings Account'), + dialogContext: + this.translateService.instant('labels.dialogContext.Are you sure you want') + + action + + this.translateService.instant('this Savings Account') + } }); let command = 'unblock'; if (action === 'Unblock Deposit') { @@ -280,10 +298,9 @@ export class SavingsAccountViewComponent implements OnInit { } unblockSavingsAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => { if (response.confirm) { - this.savingsService.executeSavingsAccountCommand(this.savingsAccountData.id, command, {}) - .subscribe(() => { - this.reload(); - }); + this.savingsService.executeSavingsAccountCommand(this.savingsAccountData.id, command, {}).subscribe(() => { + this.reload(); + }); } }); } diff --git a/src/app/savings/savings-account-view/savings-buttons.config.ts b/src/app/savings/savings-account-view/savings-buttons.config.ts index 8b394b527..0e8bb169d 100644 --- a/src/app/savings/savings-account-view/savings-buttons.config.ts +++ b/src/app/savings/savings-account-view/savings-buttons.config.ts @@ -1,15 +1,14 @@ /** Savings Account Buttons Configuration */ export class SavingsButtonsConfiguration { - optionArray: { - name: string, - taskPermissionName: string, + name: string; + taskPermissionName: string; }[]; buttonsArray: { - name: string, - icon: string, - taskPermissionName: string, + name: string; + icon: string; + taskPermissionName: string; }[]; constructor(status: string, substatus: any) { @@ -44,13 +43,11 @@ export class SavingsButtonsConfiguration { } ); } else { - this.buttonsArray.push( - { - name: 'Unblock Deposit', - icon: 'lock-open', - taskPermissionName: 'UNBLOCKDEPOSIT_SAVINGSACCOUNT' - } - ); + this.buttonsArray.push({ + name: 'Unblock Deposit', + icon: 'lock-open', + taskPermissionName: 'UNBLOCKDEPOSIT_SAVINGSACCOUNT' + }); } if (!substatus.blockDebit) { this.buttonsArray.push( @@ -66,13 +63,11 @@ export class SavingsButtonsConfiguration { } ); } else { - this.buttonsArray.push( - { - name: 'Unblock Withdrawal', - icon: 'lock-open', - taskPermissionName: 'UNBLOCKWITHDRAWAL_SAVINGSACCOUNT' - } - ); + this.buttonsArray.push({ + name: 'Unblock Withdrawal', + icon: 'lock-open', + taskPermissionName: 'UNBLOCKWITHDRAWAL_SAVINGSACCOUNT' + }); } this.buttonsArray = this.buttonsArray.concat([ { @@ -93,16 +88,16 @@ export class SavingsButtonsConfiguration { { name: 'Post Interest As On', icon: 'arrow-right', - taskPermissionName: 'POSTINTEREST_SAVINGSACCOUNT', - }, + taskPermissionName: 'POSTINTEREST_SAVINGSACCOUNT' + } ]); } else { this.buttonsArray = [ - { - name: 'Unblock Account', - icon: 'lock-open', - taskPermissionName: 'UNBLOCK_SAVINGSACCOUNT' - } + { + name: 'Unblock Account', + icon: 'lock-open', + taskPermissionName: 'UNBLOCK_SAVINGSACCOUNT' + } ]; } break; @@ -138,7 +133,7 @@ export class SavingsButtonsConfiguration { taskPermissionName: 'CREATE_SAVINGSACCOUNTCHARGE' } ]; - break; + break; default: this.buttonsArray = []; } @@ -188,8 +183,7 @@ export class SavingsButtonsConfiguration { } } - addOption(option: {name: string, taskPermissionName: string}) { + addOption(option: { name: string; taskPermissionName: string }) { this.optionArray.push(option); } - } diff --git a/src/app/savings/savings-account-view/savings-documents-tab/savings-documents-tab.component.spec.ts b/src/app/savings/savings-account-view/savings-documents-tab/savings-documents-tab.component.spec.ts index 80b91a7fe..637e46546 100644 --- a/src/app/savings/savings-account-view/savings-documents-tab/savings-documents-tab.component.spec.ts +++ b/src/app/savings/savings-account-view/savings-documents-tab/savings-documents-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingsDocumentsTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ SavingsDocumentsTabComponent ] - }) - .compileComponents(); + declarations: [SavingsDocumentsTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/savings-documents-tab/savings-documents-tab.component.ts b/src/app/savings/savings-account-view/savings-documents-tab/savings-documents-tab.component.ts index f96f7d29c..820e4a7f3 100644 --- a/src/app/savings/savings-account-view/savings-documents-tab/savings-documents-tab.component.ts +++ b/src/app/savings/savings-account-view/savings-documents-tab/savings-documents-tab.component.ts @@ -11,7 +11,6 @@ import { environment } from 'environments/environment'; styleUrls: ['./savings-documents-tab.component.scss'] }) export class SavingsDocumentsTabComponent { - /** Stores the resolved savings documents data */ entityDocuments: any; /** Stores the saving Account Id */ @@ -22,10 +21,12 @@ export class SavingsDocumentsTabComponent { * Retrieves the savings data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ - constructor(private route: ActivatedRoute, + constructor( + private route: ActivatedRoute, private savingsService: SavingsService, private settingsService: SettingsService, - public dialog: MatDialog) { + public dialog: MatDialog + ) { this.route.data.subscribe((data: { savingsDocuments: any }) => { this.setSavingsDocumentsData(data.savingsDocuments); }); @@ -34,9 +35,20 @@ export class SavingsDocumentsTabComponent { setSavingsDocumentsData(data: any) { data.forEach((ele: any) => { - ele.docUrl = this.settingsService.serverUrl + '/savings/' + ele.parentEntityId + '/documents/' + ele.id + '/attachment?tenantIdentifier=' + environment.fineractPlatformTenantId; + ele.docUrl = + this.settingsService.serverUrl + + '/savings/' + + ele.parentEntityId + + '/documents/' + + ele.id + + '/attachment?tenantIdentifier=' + + environment.fineractPlatformTenantId; if (ele.fileName) { - if (ele.fileName.toLowerCase().indexOf('.jpg') !== -1 || ele.fileName.toLowerCase().indexOf('.jpeg') !== -1 || ele.fileName.toLowerCase().indexOf('.png') !== -1) { + if ( + ele.fileName.toLowerCase().indexOf('.jpg') !== -1 || + ele.fileName.toLowerCase().indexOf('.jpeg') !== -1 || + ele.fileName.toLowerCase().indexOf('.png') !== -1 + ) { ele.fileIsImage = true; } } @@ -50,7 +62,7 @@ export class SavingsDocumentsTabComponent { } downloadDocument(documentId: string) { - this.savingsService.downloadSavingsDocument(this.entityId, documentId).subscribe(res => { + this.savingsService.downloadSavingsDocument(this.entityId, documentId).subscribe((res) => { const url = window.URL.createObjectURL(res); window.open(url); }); @@ -63,5 +75,4 @@ export class SavingsDocumentsTabComponent { deleteDocument(documentId: any) { this.savingsService.deleteSavingsDocument(this.entityId, documentId).subscribe((res: any) => {}); } - } diff --git a/src/app/savings/savings-account-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts b/src/app/savings/savings-account-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts index f3997e094..5a482658c 100644 --- a/src/app/savings/savings-account-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts +++ b/src/app/savings/savings-account-view/standing-instructions-tab/standing-instructions-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('StandingInstructionsTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ StandingInstructionsTabComponent ] - }) - .compileComponents(); + declarations: [StandingInstructionsTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/standing-instructions-tab/standing-instructions-tab.component.ts b/src/app/savings/savings-account-view/standing-instructions-tab/standing-instructions-tab.component.ts index 28593ba49..30dcf416d 100644 --- a/src/app/savings/savings-account-view/standing-instructions-tab/standing-instructions-tab.component.ts +++ b/src/app/savings/savings-account-view/standing-instructions-tab/standing-instructions-tab.component.ts @@ -21,7 +21,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co styleUrls: ['./standing-instructions-tab.component.scss'] }) export class StandingInstructionsTabComponent implements OnInit { - /** Savings Data */ savingsData: any; /** Instructions Data */ @@ -47,11 +46,13 @@ export class StandingInstructionsTabComponent implements OnInit { * @param {ActivatedRoute} route Activated Route. * @param {SettingsService} settingsService Setting service */ - constructor(private route: ActivatedRoute, - private savingsService: SavingsService, - private dialog: MatDialog, - private accountTransfersService: AccountTransfersService, - private settingsService: SettingsService) { + constructor( + private route: ActivatedRoute, + private savingsService: SavingsService, + private dialog: MatDialog, + private accountTransfersService: AccountTransfersService, + private settingsService: SettingsService + ) { this.route.parent.data.subscribe((data: { savingsAccountData: any }) => { this.savingsData = data.savingsAccountData; }); @@ -70,11 +71,13 @@ export class StandingInstructionsTabComponent implements OnInit { const accountId = this.savingsData.id; const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; - this.savingsService.getStandingInstructions(clientId, clientName, accountId, locale, dateFormat).subscribe((response: any) => { - this.instructionsData = response.pageItems; - this.dataSource.data = this.instructionsData; - this.instructionTableRef.renderRows(); - }); + this.savingsService + .getStandingInstructions(clientId, clientName, accountId, locale, dateFormat) + .subscribe((response: any) => { + this.instructionsData = response.pageItems; + this.dataSource.data = this.instructionsData; + this.instructionTableRef.renderRows(); + }); } deleteStandingInstruction(instructionId: any) { @@ -83,10 +86,8 @@ export class StandingInstructionsTabComponent implements OnInit { }); deleteStandingInstructionDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.accountTransfersService.deleteStandingInstrucions(instructionId) - .subscribe(() => { }); + this.accountTransfersService.deleteStandingInstrucions(instructionId).subscribe(() => {}); } }); } - } diff --git a/src/app/savings/savings-account-view/transactions-tab/export-transactions/export-transactions.component.spec.ts b/src/app/savings/savings-account-view/transactions-tab/export-transactions/export-transactions.component.spec.ts index 9965db862..95f792263 100644 --- a/src/app/savings/savings-account-view/transactions-tab/export-transactions/export-transactions.component.spec.ts +++ b/src/app/savings/savings-account-view/transactions-tab/export-transactions/export-transactions.component.spec.ts @@ -8,9 +8,8 @@ describe('ExportTransactionsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ExportTransactionsComponent ] - }) - .compileComponents(); + declarations: [ExportTransactionsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/transactions-tab/export-transactions/export-transactions.component.ts b/src/app/savings/savings-account-view/transactions-tab/export-transactions/export-transactions.component.ts index dc95b9e52..ad65d8ce9 100644 --- a/src/app/savings/savings-account-view/transactions-tab/export-transactions/export-transactions.component.ts +++ b/src/app/savings/savings-account-view/transactions-tab/export-transactions/export-transactions.component.ts @@ -18,7 +18,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./export-transactions.component.scss'] }) export class ExportTransactionsComponent implements OnInit { - /** Minimum date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum date allowed. */ @@ -41,18 +40,19 @@ export class ExportTransactionsComponent implements OnInit { * @param {ActivatedRoute} route Activated Route * @param {SettingsService} settingsService Settings Service */ - constructor(private sanitizer: DomSanitizer, - private reportsService: ReportsService, - private formBuilder: UntypedFormBuilder, - private dateUtils: Dates, - private route: ActivatedRoute, - private settingsService: SettingsService) { + constructor( + private sanitizer: DomSanitizer, + private reportsService: ReportsService, + private formBuilder: UntypedFormBuilder, + private dateUtils: Dates, + private route: ActivatedRoute, + private settingsService: SettingsService + ) { this.route.parent.parent.data.subscribe((data: { savingsAccountData: any }) => { this.savingsAccountId = data.savingsAccountData.accountNo; }); } - ngOnInit() { this.maxDate = this.settingsService.businessDate; this.createTransactionsReportForm(); @@ -63,8 +63,14 @@ export class ExportTransactionsComponent implements OnInit { */ createTransactionsReportForm() { this.transactionsReportForm = this.formBuilder.group({ - 'fromDate': ['', Validators.required], - 'toDate': ['', Validators.required], + fromDate: [ + '', + Validators.required + ], + toDate: [ + '', + Validators.required + ] }); } @@ -73,19 +79,28 @@ export class ExportTransactionsComponent implements OnInit { */ generate() { const data = { - 'output-type': 'PDF', - R_startDate: this.dateUtils.formatDate(this.transactionsReportForm.value.fromDate, this.settingsService.dateFormat), - R_endDate: this.dateUtils.formatDate(this.transactionsReportForm.value.toDate, this.settingsService.dateFormat), - R_savingsAccountId: this.savingsAccountId + 'output-type': 'PDF', + R_startDate: this.dateUtils.formatDate( + this.transactionsReportForm.value.fromDate, + this.settingsService.dateFormat + ), + R_endDate: this.dateUtils.formatDate(this.transactionsReportForm.value.toDate, this.settingsService.dateFormat), + R_savingsAccountId: this.savingsAccountId }; - this.reportsService.getPentahoRunReportData('Client Saving Transactions', data, 'default', this.settingsService.language.code, this.settingsService.dateFormat) - .subscribe( (res: any) => { + this.reportsService + .getPentahoRunReportData( + 'Client Saving Transactions', + data, + 'default', + this.settingsService.language.code, + this.settingsService.dateFormat + ) + .subscribe((res: any) => { const contentType = res.headers.get('Content-Type'); - const file = new Blob([res.body], {type: contentType}); + const file = new Blob([res.body], { type: contentType }); const filecontent = URL.createObjectURL(file); this.pentahoUrl = this.sanitizer.bypassSecurityTrustResourceUrl(filecontent); this.hideOutput = false; }); } - } diff --git a/src/app/savings/savings-account-view/transactions-tab/transactions-tab.component.spec.ts b/src/app/savings/savings-account-view/transactions-tab/transactions-tab.component.spec.ts index a67fc2279..0175d84c6 100644 --- a/src/app/savings/savings-account-view/transactions-tab/transactions-tab.component.spec.ts +++ b/src/app/savings/savings-account-view/transactions-tab/transactions-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('TransactionsTabComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ TransactionsTabComponent ] - }) - .compileComponents(); + declarations: [TransactionsTabComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/transactions-tab/transactions-tab.component.ts b/src/app/savings/savings-account-view/transactions-tab/transactions-tab.component.ts index 81311776b..614ab5757 100644 --- a/src/app/savings/savings-account-view/transactions-tab/transactions-tab.component.ts +++ b/src/app/savings/savings-account-view/transactions-tab/transactions-tab.component.ts @@ -6,7 +6,10 @@ import { MatSort } from '@angular/material/sort'; import { MatTableDataSource } from '@angular/material/table'; import { ActivatedRoute, Router } from '@angular/router'; import { Dates } from 'app/core/utils/dates'; -import { SavingsAccountTransaction, SavingsAccountTransactionType } from 'app/savings/models/savings-account-transaction.model'; +import { + SavingsAccountTransaction, + SavingsAccountTransactionType +} from 'app/savings/models/savings-account-transaction.model'; import { SavingsService } from 'app/savings/savings.service'; import { SettingsService } from 'app/settings/settings.service'; import { UndoTransactionDialogComponent } from '../custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component'; @@ -21,7 +24,6 @@ import { MatDialog } from '@angular/material/dialog'; styleUrls: ['./transactions-tab.component.scss'] }) export class TransactionsTabComponent implements OnInit { - /** Savings Account Status */ status: any; /** Transactions Data */ @@ -30,7 +32,17 @@ export class TransactionsTabComponent implements OnInit { hideAccrualsParam: UntypedFormControl; hideReversedParam: UntypedFormControl; /** Columns to be displayed in transactions table. */ - displayedColumns: string[] = ['row', 'id', 'date', 'externalId', 'transactionType', 'debit', 'credit', 'balance', 'actions']; + displayedColumns: string[] = [ + 'row', + 'id', + 'date', + 'externalId', + 'transactionType', + 'debit', + 'credit', + 'balance', + 'actions' + ]; /** Data source for transactions table. */ dataSource: MatTableDataSource; @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @@ -44,12 +56,14 @@ export class TransactionsTabComponent implements OnInit { * Retrieves savings account data from `resolve`. * @param {ActivatedRoute} route Activated Route. */ - constructor(private route: ActivatedRoute, - private router: Router, - private savingsService: SavingsService, - private settingsService: SettingsService, - private dialog: MatDialog, - private dateUtils: Dates) { + constructor( + private route: ActivatedRoute, + private router: Router, + private savingsService: SavingsService, + private settingsService: SettingsService, + private dialog: MatDialog, + private dateUtils: Dates + ) { this.route.parent.parent.data.subscribe((data: { savingsAccountData: any }) => { this.transactionsData = data.savingsAccountData.transactions; this.status = data.savingsAccountData.status.value; @@ -65,7 +79,7 @@ export class TransactionsTabComponent implements OnInit { setTransactions(): void { this.dataSource = new MatTableDataSource(this.transactionsData); - this.accountWithTransactions = (this.transactionsData && this.transactionsData.length > 0); + this.accountWithTransactions = this.transactionsData && this.transactionsData.length > 0; this.dataSource.paginator = this.paginator; this.dataSource.sort = this.sort; } @@ -75,20 +89,30 @@ export class TransactionsTabComponent implements OnInit { * @param {any} transactionType Transaction Type */ isDebit(transactionType: SavingsAccountTransactionType) { - return transactionType.withdrawal === true || transactionType.feeDeduction === true - || transactionType.overdraftInterest === true || transactionType.withholdTax === true; + return ( + transactionType.withdrawal === true || + transactionType.feeDeduction === true || + transactionType.overdraftInterest === true || + transactionType.withholdTax === true + ); } isAccrual(transactionType: SavingsAccountTransactionType): boolean { - return (transactionType.accrual || transactionType.code === 'savingsAccountTransactionType.accrual'); + return transactionType.accrual || transactionType.code === 'savingsAccountTransactionType.accrual'; } /** * Checks transaction status. */ checkStatus() { - if (this.status === 'Active' || this.status === 'Closed' || this.status === 'Transfer in progress' || - this.status === 'Transfer on hold' || this.status === 'Premature Closed' || this.status === 'Matured') { + if ( + this.status === 'Active' || + this.status === 'Closed' || + this.status === 'Transfer in progress' || + this.status === 'Transfer on hold' || + this.status === 'Premature Closed' || + this.status === 'Matured' + ) { return true; } return false; @@ -100,9 +124,17 @@ export class TransactionsTabComponent implements OnInit { */ showTransactions(transactionsData: SavingsAccountTransaction) { if (transactionsData.transfer) { - this.router.navigate([`../transfer-funds/account-transfers/${transactionsData.transfer.id}`], { relativeTo: this.route }); + this.router.navigate([`../transfer-funds/account-transfers/${transactionsData.transfer.id}`], { + relativeTo: this.route + }); } else { - this.router.navigate([transactionsData.id, 'general'], { relativeTo: this.route }); + this.router.navigate( + [ + transactionsData.id, + 'general' + ], + { relativeTo: this.route } + ); } } @@ -127,7 +159,7 @@ export class TransactionsTabComponent implements OnInit { if (hideAccrual || hideReversed) { transactions = this.transactionsData.filter((t: SavingsAccountTransaction) => { - return (!(hideReversed && t.reversed) && !(hideAccrual && t.transactionType.accrual)); + return !(hideReversed && t.reversed) && !(hideAccrual && t.transactionType.accrual); }); } this.dataSource = new MatTableDataSource(transactions); @@ -159,9 +191,11 @@ export class TransactionsTabComponent implements OnInit { dateFormat, locale }; - this.savingsService.executeSavingsAccountTransactionsCommand(this.accountId, 'undo', data, transactionData.id).subscribe(() => { - this.reload(); - }); + this.savingsService + .executeSavingsAccountTransactionsCommand(this.accountId, 'undo', data, transactionData.id) + .subscribe(() => { + this.reload(); + }); } }); } @@ -169,7 +203,8 @@ export class TransactionsTabComponent implements OnInit { private reload() { const clientId = this.route.parent.parent.snapshot.params['clientId']; const url: string = this.router.url; - this.router.navigateByUrl(`/clients/${clientId}/savings-accounts`, { skipLocationChange: true }) + this.router + .navigateByUrl(`/clients/${clientId}/savings-accounts`, { skipLocationChange: true }) .then(() => this.router.navigate([url])); } } diff --git a/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.spec.ts b/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.spec.ts index abea649f7..7e486c2ea 100644 --- a/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.spec.ts +++ b/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.spec.ts @@ -8,9 +8,8 @@ describe('EditTransactionComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditTransactionComponent ] - }) - .compileComponents(); + declarations: [EditTransactionComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.ts b/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.ts index d6f678afe..a8bf89203 100644 --- a/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.ts +++ b/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.ts @@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model'; styleUrls: ['./edit-transaction.component.scss'] }) export class EditTransactionComponent implements OnInit { - /** Minimum Due Date allowed. */ minDate = new Date(2000, 0, 1); /** Maximum Due Date allowed. */ @@ -27,11 +26,11 @@ export class EditTransactionComponent implements OnInit { editTransactionForm: UntypedFormGroup; /** savings account transaction payment options. */ paymentTypeOptions: { - id: number, - name: string, - description: string, - isCashPayment: boolean, - position: number + id: number; + name: string; + description: string; + isCashPayment: boolean; + position: number; }[]; /** Flag to enable payment details fields. */ showPaymentDetails: Boolean = false; @@ -50,12 +49,14 @@ export class EditTransactionComponent implements OnInit { * @param {Router} router Router for navigation. * @param {SettingsService} settingsService Setting service */ - constructor(private formBuilder: UntypedFormBuilder, - private route: ActivatedRoute, - private router: Router, - private dateUtils: Dates, - private savingsService: SavingsService, - private settingsService: SettingsService) { + constructor( + private formBuilder: UntypedFormBuilder, + private route: ActivatedRoute, + private router: Router, + private dateUtils: Dates, + private savingsService: SavingsService, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { savingsAccountTransactionTemplate: any }) => { this.transactionTemplateData = data.savingsAccountTransactionTemplate; if (data.savingsAccountTransactionTemplate.currency) { @@ -73,9 +74,9 @@ export class EditTransactionComponent implements OnInit { this.maxDate = this.settingsService.businessDate; this.createEditTransactionForm(); this.editTransactionForm.patchValue({ - 'transactionDate': this.transactionTemplateData.date && new Date(this.transactionTemplateData.date), - 'transactionAmount': this.transactionTemplateData.amount, - 'paymentTypeId': this.transactionTemplateData.paymentTypeId + transactionDate: this.transactionTemplateData.date && new Date(this.transactionTemplateData.date), + transactionAmount: this.transactionTemplateData.amount, + paymentTypeId: this.transactionTemplateData.paymentTypeId }); } @@ -84,9 +85,15 @@ export class EditTransactionComponent implements OnInit { */ createEditTransactionForm() { this.editTransactionForm = this.formBuilder.group({ - 'transactionDate': ['', Validators.required], - 'transactionAmount': ['', Validators.required], - 'paymentTypeId': [''], + transactionDate: [ + '', + Validators.required + ], + transactionAmount: [ + '', + Validators.required + ], + paymentTypeId: [''] }); } @@ -126,10 +133,10 @@ export class EditTransactionComponent implements OnInit { dateFormat, locale }; - this.savingsService.executeSavingsAccountTransactionsCommand(this.savingAccountId, 'modify', data, this.transactionTemplateData.id) - .subscribe(res => { + this.savingsService + .executeSavingsAccountTransactionsCommand(this.savingAccountId, 'modify', data, this.transactionTemplateData.id) + .subscribe((res) => { this.router.navigate(['../'], { relativeTo: this.route }); }); } - } diff --git a/src/app/savings/savings-account-view/transactions/view-reciept/view-reciept.component.spec.ts b/src/app/savings/savings-account-view/transactions/view-reciept/view-reciept.component.spec.ts index a831d071f..c4cce096a 100644 --- a/src/app/savings/savings-account-view/transactions/view-reciept/view-reciept.component.spec.ts +++ b/src/app/savings/savings-account-view/transactions/view-reciept/view-reciept.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewRecieptComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewRecieptComponent ] - }) - .compileComponents(); + declarations: [ViewRecieptComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/transactions/view-reciept/view-reciept.component.ts b/src/app/savings/savings-account-view/transactions/view-reciept/view-reciept.component.ts index 7905ae259..443a0550b 100644 --- a/src/app/savings/savings-account-view/transactions/view-reciept/view-reciept.component.ts +++ b/src/app/savings/savings-account-view/transactions/view-reciept/view-reciept.component.ts @@ -12,7 +12,6 @@ import { ActivatedRoute } from '@angular/router'; styleUrls: ['./view-reciept.component.scss'] }) export class ViewRecieptComponent implements OnInit { - /** trusted resource url for pentaho output */ pentahoUrl: any; /** Transaction Reciept Data */ @@ -23,8 +22,10 @@ export class ViewRecieptComponent implements OnInit { * @param {DomSanitizer} sanitizer DOM Sanitizer * @param {ActivatedRoute} route Activated Route */ - constructor(private sanitizer: DomSanitizer, - private route: ActivatedRoute) { + constructor( + private sanitizer: DomSanitizer, + private route: ActivatedRoute + ) { this.route.data.subscribe((data: { savingsTransactionReciept: any }) => { this.transactionRecieptData = data.savingsTransactionReciept; }); @@ -32,9 +33,8 @@ export class ViewRecieptComponent implements OnInit { ngOnInit() { const contentType = this.transactionRecieptData.headers.get('Content-Type'); - const file = new Blob([this.transactionRecieptData.body], {type: contentType}); + const file = new Blob([this.transactionRecieptData.body], { type: contentType }); const filecontent = URL.createObjectURL(file); this.pentahoUrl = this.sanitizer.bypassSecurityTrustResourceUrl(filecontent); } - } diff --git a/src/app/savings/savings-account-view/transactions/view-transaction/datatable-transaction-tab/datatable-transaction-tab.component.spec.ts b/src/app/savings/savings-account-view/transactions/view-transaction/datatable-transaction-tab/datatable-transaction-tab.component.spec.ts index 2b5510c21..d784694fb 100644 --- a/src/app/savings/savings-account-view/transactions/view-transaction/datatable-transaction-tab/datatable-transaction-tab.component.spec.ts +++ b/src/app/savings/savings-account-view/transactions/view-transaction/datatable-transaction-tab/datatable-transaction-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('DatatableTransactionTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ DatatableTransactionTabComponent ] - }) - .compileComponents(); + declarations: [DatatableTransactionTabComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/transactions/view-transaction/datatable-transaction-tab/datatable-transaction-tab.component.ts b/src/app/savings/savings-account-view/transactions/view-transaction/datatable-transaction-tab/datatable-transaction-tab.component.ts index 78c9a421f..a37f14771 100644 --- a/src/app/savings/savings-account-view/transactions/view-transaction/datatable-transaction-tab/datatable-transaction-tab.component.ts +++ b/src/app/savings/savings-account-view/transactions/view-transaction/datatable-transaction-tab/datatable-transaction-tab.component.ts @@ -6,7 +6,6 @@ import { ActivatedRoute } from '@angular/router'; templateUrl: './datatable-transaction-tab.component.html', styleUrls: ['./datatable-transaction-tab.component.scss'] }) - export class DatatableTransactionTabComponent { /** Transaction Id */ entityId: string; diff --git a/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-datatable-tab/savings-transaction-datatable-tab.component.spec.ts b/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-datatable-tab/savings-transaction-datatable-tab.component.spec.ts index 5ed60eb5b..76901b510 100644 --- a/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-datatable-tab/savings-transaction-datatable-tab.component.spec.ts +++ b/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-datatable-tab/savings-transaction-datatable-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingsTransactionDatatableTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ SavingsTransactionDatatableTabComponent ] - }) - .compileComponents(); + declarations: [SavingsTransactionDatatableTabComponent] + }).compileComponents(); fixture = TestBed.createComponent(SavingsTransactionDatatableTabComponent); component = fixture.componentInstance; diff --git a/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-datatable-tab/savings-transaction-datatable-tab.component.ts b/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-datatable-tab/savings-transaction-datatable-tab.component.ts index c76faf1e1..737017f7b 100644 --- a/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-datatable-tab/savings-transaction-datatable-tab.component.ts +++ b/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-datatable-tab/savings-transaction-datatable-tab.component.ts @@ -6,7 +6,5 @@ import { Component } from '@angular/core'; styleUrls: ['./savings-transaction-datatable-tab.component.scss'] }) export class SavingsTransactionDatatableTabComponent { - - constructor() { } - + constructor() {} } diff --git a/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-general-tab/savings-transaction-general-tab.component.spec.ts b/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-general-tab/savings-transaction-general-tab.component.spec.ts index 410f95fe9..16c7a2097 100644 --- a/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-general-tab/savings-transaction-general-tab.component.spec.ts +++ b/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-general-tab/savings-transaction-general-tab.component.spec.ts @@ -8,9 +8,8 @@ describe('SavingsTransactionGeneralTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ SavingsTransactionGeneralTabComponent ] - }) - .compileComponents(); + declarations: [SavingsTransactionGeneralTabComponent] + }).compileComponents(); fixture = TestBed.createComponent(SavingsTransactionGeneralTabComponent); component = fixture.componentInstance; diff --git a/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-general-tab/savings-transaction-general-tab.component.ts b/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-general-tab/savings-transaction-general-tab.component.ts index abab986e4..1ef102231 100644 --- a/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-general-tab/savings-transaction-general-tab.component.ts +++ b/src/app/savings/savings-account-view/transactions/view-transaction/savings-transaction-general-tab/savings-transaction-general-tab.component.ts @@ -13,22 +13,23 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./savings-transaction-general-tab.component.scss'] }) export class SavingsTransactionGeneralTabComponent { - accountId: string; transactionId: string; transactionData: any; - constructor(private savingsService: SavingsService, + constructor( + private savingsService: SavingsService, private route: ActivatedRoute, private dateUtils: Dates, private router: Router, public dialog: MatDialog, - private settingsService: SettingsService) { - this.route.data.subscribe((data: { savingsAccountTransaction: any }) => { - this.accountId = this.route.parent.snapshot.params['savingAccountId']; - this.transactionData = data.savingsAccountTransaction; - }); - } + private settingsService: SettingsService + ) { + this.route.data.subscribe((data: { savingsAccountTransaction: any }) => { + this.accountId = this.route.parent.snapshot.params['savingAccountId']; + this.transactionData = data.savingsAccountTransaction; + }); + } allowUndo(): boolean { if (this.transactionData.reversed && this.transactionData.transactionType.amountHold) { @@ -42,9 +43,11 @@ export class SavingsTransactionGeneralTabComponent { releaseAmountDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { const data = {}; - this.savingsService.executeSavingsAccountTransactionsCommand(this.accountId, 'releaseAmount', data, this.transactionData.id).subscribe(() => { - this.router.navigate(['../..'], { relativeTo: this.route }); - }); + this.savingsService + .executeSavingsAccountTransactionsCommand(this.accountId, 'releaseAmount', data, this.transactionData.id) + .subscribe(() => { + this.router.navigate(['../..'], { relativeTo: this.route }); + }); } }); } @@ -56,14 +59,19 @@ export class SavingsTransactionGeneralTabComponent { const locale = this.settingsService.language.code; const dateFormat = this.settingsService.dateFormat; const data = { - transactionDate: this.dateUtils.formatDate(this.transactionData.date && new Date(this.transactionData.date), dateFormat), + transactionDate: this.dateUtils.formatDate( + this.transactionData.date && new Date(this.transactionData.date), + dateFormat + ), transactionAmount: 0, dateFormat, locale }; - this.savingsService.executeSavingsAccountTransactionsCommand(this.accountId, 'undo', data, this.transactionData.id).subscribe(() => { - this.router.navigate(['../..'], { relativeTo: this.route }); - }); + this.savingsService + .executeSavingsAccountTransactionsCommand(this.accountId, 'undo', data, this.transactionData.id) + .subscribe(() => { + this.router.navigate(['../..'], { relativeTo: this.route }); + }); } }); } diff --git a/src/app/savings/savings-account-view/transactions/view-transaction/view-transaction.component.spec.ts b/src/app/savings/savings-account-view/transactions/view-transaction/view-transaction.component.spec.ts index bbff0d11b..bed3c6ae6 100644 --- a/src/app/savings/savings-account-view/transactions/view-transaction/view-transaction.component.spec.ts +++ b/src/app/savings/savings-account-view/transactions/view-transaction/view-transaction.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewTransactionComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewTransactionComponent ] - }) - .compileComponents(); + declarations: [ViewTransactionComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/transactions/view-transaction/view-transaction.component.ts b/src/app/savings/savings-account-view/transactions/view-transaction/view-transaction.component.ts index dba17966e..8d61cacf0 100644 --- a/src/app/savings/savings-account-view/transactions/view-transaction/view-transaction.component.ts +++ b/src/app/savings/savings-account-view/transactions/view-transaction/view-transaction.component.ts @@ -9,7 +9,6 @@ import { MatDialog } from '@angular/material/dialog'; styleUrls: ['./view-transaction.component.scss'] }) export class ViewTransactionComponent { - /** Transaction data. */ transactionData: any; @@ -21,11 +20,13 @@ export class ViewTransactionComponent { * @param {Router} router Router for navigation. * @param {MatDialog} dialog Dialog reference. */ - constructor(private route: ActivatedRoute, - public dialog: MatDialog) { - this.route.data.subscribe((data: { transactionDatatables: any}) => { - this.accountId = this.route.snapshot.params['savingAccountId']; - this.entityDatatables = data.transactionDatatables; - }); + constructor( + private route: ActivatedRoute, + public dialog: MatDialog + ) { + this.route.data.subscribe((data: { transactionDatatables: any }) => { + this.accountId = this.route.snapshot.params['savingAccountId']; + this.entityDatatables = data.transactionDatatables; + }); } } diff --git a/src/app/savings/savings-account-view/view-charge/view-charge.component.spec.ts b/src/app/savings/savings-account-view/view-charge/view-charge.component.spec.ts index 6c6e3739c..d40f3ae62 100644 --- a/src/app/savings/savings-account-view/view-charge/view-charge.component.spec.ts +++ b/src/app/savings/savings-account-view/view-charge/view-charge.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewChargeComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewChargeComponent ] - }) - .compileComponents(); + declarations: [ViewChargeComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/savings/savings-account-view/view-charge/view-charge.component.ts b/src/app/savings/savings-account-view/view-charge/view-charge.component.ts index 23bdb777e..08812bbdf 100644 --- a/src/app/savings/savings-account-view/view-charge/view-charge.component.ts +++ b/src/app/savings/savings-account-view/view-charge/view-charge.component.ts @@ -28,7 +28,6 @@ import { Dates } from 'app/core/utils/dates'; styleUrls: ['./view-charge.component.scss'] }) export class ViewChargeComponent { - /** Charge data. */ chargeData: any; /** Savings Account Data */ @@ -43,12 +42,14 @@ export class ViewChargeComponent { * @param {Dates} dateUtils Date Utils. * @param {SettingsService} settingsService Setting service */ - constructor(private savingsService: SavingsService, - private route: ActivatedRoute, - private dateUtils: Dates, - private router: Router, - public dialog: MatDialog, - private settingsService: SettingsService) { + constructor( + private savingsService: SavingsService, + private route: ActivatedRoute, + private dateUtils: Dates, + private router: Router, + public dialog: MatDialog, + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { savingsAccountCharge: any }) => { this.chargeData = data.savingsAccountCharge; }); @@ -76,6 +77,7 @@ export class ViewChargeComponent { type: 'date', required: true }) + ]; const data = { title: 'Pay Charge', @@ -93,7 +95,8 @@ export class ViewChargeComponent { dateFormat, locale }; - this.savingsService.executeSavingsAccountChargesCommand(this.chargeData.accountId, 'pay', dataObject, this.chargeData.id) + this.savingsService + .executeSavingsAccountChargesCommand(this.chargeData.accountId, 'pay', dataObject, this.chargeData.id) .subscribe(() => { this.reload(); }); @@ -108,7 +111,8 @@ export class ViewChargeComponent { const waiveChargeDialogRef = this.dialog.open(WaiveChargeDialogComponent, { data: { id: this.chargeData.id } }); waiveChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountChargesCommand(this.chargeData.accountId, 'waive', {}, this.chargeData.id) + this.savingsService + .executeSavingsAccountChargesCommand(this.chargeData.accountId, 'waive', {}, this.chargeData.id) .subscribe(() => { this.reload(); }); @@ -120,10 +124,13 @@ export class ViewChargeComponent { * Inactivate's the charge */ inactivateCharge() { - const inactivateChargeDialogRef = this.dialog.open(InactivateChargeDialogComponent, { data: { id: this.chargeData.id } }); + const inactivateChargeDialogRef = this.dialog.open(InactivateChargeDialogComponent, { + data: { id: this.chargeData.id } + }); inactivateChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.confirm) { - this.savingsService.executeSavingsAccountChargesCommand(this.chargeData.accountId, 'inactivate', {}, this.chargeData.id) + this.savingsService + .executeSavingsAccountChargesCommand(this.chargeData.accountId, 'inactivate', {}, this.chargeData.id) .subscribe(() => { this.reload(); }); @@ -143,6 +150,7 @@ export class ViewChargeComponent { type: 'number', required: true }) + ]; const data = { title: 'Edit Charge', @@ -159,7 +167,8 @@ export class ViewChargeComponent { dateFormat, locale }; - this.savingsService.editSavingsAccountCharge(this.chargeData.accountId, dataObject, this.chargeData.id) + this.savingsService + .editSavingsAccountCharge(this.chargeData.accountId, dataObject, this.chargeData.id) .subscribe(() => { this.reload(); }); @@ -176,10 +185,9 @@ export class ViewChargeComponent { }); deleteChargeDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { - this.savingsService.deleteSavingsAccountCharge(this.chargeData.accountId, this.chargeData.id) - .subscribe(() => { - this.reload(); - }); + this.savingsService.deleteSavingsAccountCharge(this.chargeData.accountId, this.chargeData.id).subscribe(() => { + this.reload(); + }); } }); } @@ -198,9 +206,10 @@ export class ViewChargeComponent { */ private reload() { const url: string = this.router.url.replace(`/${this.chargeData.id}`, ''); - const refreshUrl: string = this.router.url.slice(0, this.router.url.indexOf('savings-accounts') + 'savings-accounts'.length); - this.router.navigateByUrl(refreshUrl, {skipLocationChange: true}) - .then(() => this.router.navigate([url])); + const refreshUrl: string = this.router.url.slice( + 0, + this.router.url.indexOf('savings-accounts') + 'savings-accounts'.length + ); + this.router.navigateByUrl(refreshUrl, { skipLocationChange: true }).then(() => this.router.navigate([url])); } - } diff --git a/src/app/savings/savings-routing.module.ts b/src/app/savings/savings-routing.module.ts index 5bdb908e0..e3f38cd8e 100644 --- a/src/app/savings/savings-routing.module.ts +++ b/src/app/savings/savings-routing.module.ts @@ -165,7 +165,7 @@ const routes: Routes = [ path: 'general', component: SavingsTransactionGeneralTabComponent, resolve: { - savingsAccountTransaction: SavingsAccountTransactionResolver, + savingsAccountTransaction: SavingsAccountTransactionResolver } }, { @@ -207,7 +207,8 @@ const routes: Routes = [ children: [ { path: '', - redirectTo: '../charges', pathMatch: 'prefix' + redirectTo: '../charges', + pathMatch: 'prefix' }, { path: ':id', @@ -230,7 +231,8 @@ const routes: Routes = [ }, { path: ':savingAccountId/transfer-funds', - loadChildren: () => import('../account-transfers/account-transfers.module').then(m => m.AccountTransfersModule) + loadChildren: () => + import('../account-transfers/account-transfers.module').then((m) => m.AccountTransfersModule) }, { path: 'gsim-account', @@ -242,7 +244,7 @@ const routes: Routes = [ resolve: { groupsData: GroupViewResolver, savingsAccountTemplate: SavingsAccountTemplateResolver - }, + } }, { path: ':savingAccountId', @@ -255,20 +257,21 @@ const routes: Routes = [ gsimData: GSIMViewResolver, savingAccountData: SavingsAccountViewResolver, groupsData: GroupAccountsResolver - }, - }, + } + } ] - }, + } ] } ] - }, + } ]; @NgModule({ imports: [RouterModule.forChild(routes)], exports: [RouterModule], declarations: [], - providers: [SavingsAccountViewResolver, + providers: [ + SavingsAccountViewResolver, SavingsDatatablesResolver, SavingsDatatableResolver, TransactionDatatableResolver, @@ -282,6 +285,7 @@ const routes: Routes = [ SavingsAccountTransactionTemplateResolver, GSIMAccountsResolver, GroupAccountsResolver, - GSIMViewResolver] + GSIMViewResolver + ] }) -export class SavingsRoutingModule { } +export class SavingsRoutingModule {} diff --git a/src/app/savings/savings.module.ts b/src/app/savings/savings.module.ts index c454edf4d..06e7423ed 100644 --- a/src/app/savings/savings.module.ts +++ b/src/app/savings/savings.module.ts @@ -54,7 +54,6 @@ import { SavingsTransactionGeneralTabComponent } from './savings-account-view/tr import { SavingsTransactionDatatableTabComponent } from './savings-account-view/transactions/view-transaction/savings-transaction-datatable-tab/savings-transaction-datatable-tab.component'; import { GeneralTabComponent } from './savings-account-view/general-tab/general-tab.component'; - /** * Savings Module * @@ -114,6 +113,6 @@ import { GeneralTabComponent } from './savings-account-view/general-tab/general- SavingsTransactionDatatableTabComponent, GeneralTabComponent ], - providers: [ ] + providers: [] }) export class SavingsModule {} diff --git a/src/app/savings/savings.service.ts b/src/app/savings/savings.service.ts index 6411f8884..d637b3697 100644 --- a/src/app/savings/savings.service.ts +++ b/src/app/savings/savings.service.ts @@ -12,7 +12,6 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class SavingsService { - constructor(private http: HttpClient) {} /** @@ -53,7 +52,7 @@ export class SavingsService { * @returns {Observable} Savings data. */ getSavingsAccountData(accountId: string): Observable { - const httpParams = new HttpParams().set('associations', 'all' ); + const httpParams = new HttpParams().set('associations', 'all'); return this.http.get(`/savingsaccounts/${accountId}`, { params: httpParams }); } @@ -62,9 +61,7 @@ export class SavingsService { * @returns {Observable} Savings account and template. */ getSavingsAccountAndTemplate(accountId: string, template: boolean): Observable { - const httpParams = new HttpParams() - .set('template', template.toString()) - .set('associations', 'charges' ); + const httpParams = new HttpParams().set('template', template.toString()).set('associations', 'charges'); return this.http.get(`/savingsaccounts/${accountId}`, { params: httpParams }); } @@ -77,8 +74,12 @@ export class SavingsService { * @returns {Observable} Standing Instructions */ getStandingInstructions( - clientId: string, clientName: string, fromAccountId: string, - locale: string, dateFormat: string): Observable { + clientId: string, + clientName: string, + fromAccountId: string, + locale: string, + dateFormat: string + ): Observable { const httpParams = new HttpParams() .set('clientId', clientId) .set('clientName', clientName) @@ -162,7 +163,7 @@ export class SavingsService { * @returns {Observable} Savings account template. */ getSavingsAccountTemplate(entityId: string, productId?: string, isGroup?: boolean): Observable { - let httpParams = new HttpParams().set( isGroup ? 'groupId' : 'clientId', entityId); + let httpParams = new HttpParams().set(isGroup ? 'groupId' : 'clientId', entityId); httpParams = productId ? httpParams.set('productId', productId) : httpParams; return this.http.get('/savingsaccounts/template', { params: httpParams }); } @@ -239,10 +240,17 @@ export class SavingsService { * @param {string} transactionId Transaction Id * @returns {Observable} */ - executeSavingsAccountTransactionsCommand(accountId: string, command: string, data: any, transactionId?: any): Observable { + executeSavingsAccountTransactionsCommand( + accountId: string, + command: string, + data: any, + transactionId?: any + ): Observable { const httpParams = new HttpParams().set('command', command); if (transactionId) { - return this.http.post(`/savingsaccounts/${accountId}/transactions/${transactionId}`, data, { params: httpParams }); + return this.http.post(`/savingsaccounts/${accountId}/transactions/${transactionId}`, data, { + params: httpParams + }); } return this.http.post(`/savingsaccounts/${accountId}/transactions`, data, { params: httpParams }); } @@ -291,8 +299,8 @@ export class SavingsService { * @param savingAccountId GSIM Account Id of account to get data for. * @returns {Observable} Savings data. */ - getGSIMAccountData(savingAccountId: string, groupId: string): Observable { - const httpParams = new HttpParams().set('parentGSIMAccountNo', savingAccountId ); + getGSIMAccountData(savingAccountId: string, groupId: string): Observable { + const httpParams = new HttpParams().set('parentGSIMAccountNo', savingAccountId); return this.http.get(`/groups/${groupId}/gsimaccounts`, { params: httpParams }); } @@ -360,5 +368,4 @@ export class SavingsService { loadSavingsDocument(savingAccountId: any, data: any): Observable { return this.http.post(`/savings/${savingAccountId}/documents`, data); } - } diff --git a/src/app/search/search-page/search-page.component.spec.ts b/src/app/search/search-page/search-page.component.spec.ts index c39a155f0..e8a864f51 100644 --- a/src/app/search/search-page/search-page.component.spec.ts +++ b/src/app/search/search-page/search-page.component.spec.ts @@ -8,9 +8,8 @@ describe('SearchPageComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SearchPageComponent ] - }) - .compileComponents(); + declarations: [SearchPageComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/search/search-page/search-page.component.ts b/src/app/search/search-page/search-page.component.ts index ad10c6f30..241854d19 100644 --- a/src/app/search/search-page/search-page.component.ts +++ b/src/app/search/search-page/search-page.component.ts @@ -19,7 +19,15 @@ export class SearchPageComponent { /** Datasource for loans disbursal table */ dataSource: MatTableDataSource; /** Displayed Columns for serach results */ - displayedColumns: string[] = ['entityType', 'entityName', 'entityAccount', 'externalId', 'parentType', 'parentName', 'details']; + displayedColumns: string[] = [ + 'entityType', + 'entityName', + 'entityAccount', + 'externalId', + 'parentType', + 'parentName', + 'details' + ]; /** Paginator for the table */ @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator; @@ -29,12 +37,14 @@ export class SearchPageComponent { * @param {ActivatedRoute} route Activated Route * @param {Router} router Router */ - constructor(private route: ActivatedRoute, - private router: Router) { - this.route.data.subscribe(( data: { searchResults: any }) => { + constructor( + private route: ActivatedRoute, + private router: Router + ) { + this.route.data.subscribe((data: { searchResults: any }) => { this.dataSource = new MatTableDataSource(data.searchResults); this.dataSource.paginator = this.paginator; - this.hasResults = (data.searchResults.length > 0); + this.hasResults = data.searchResults.length > 0; this.overload = data.searchResults.length > 200 ? true : false; if (this.overload) { this.dataSource = new MatTableDataSource(data.searchResults.slice(0, 200)); @@ -49,33 +59,75 @@ export class SearchPageComponent { navigate(entity: SearchData) { switch (entity.entityType) { case 'CLIENT': - this.router.navigate(['clients', entity.entityId, 'general']); + this.router.navigate([ + 'clients', + entity.entityId, + 'general' + ]); break; case 'CLIENTIDENTIFIER': - this.router.navigate(['clients', entity.parentId, 'general']); + this.router.navigate([ + 'clients', + entity.parentId, + 'general' + ]); break; case 'CENTER': - this.router.navigate(['centers', entity.entityId]); + this.router.navigate([ + 'centers', + entity.entityId + ]); break; case 'GROUP': - this.router.navigate(['groups', entity.entityId]); + this.router.navigate([ + 'groups', + entity.entityId + ]); break; case 'SHARE': - this.router.navigate(['clients', entity.parentId, 'shares-accounts', entity.entityId]); + this.router.navigate([ + 'clients', + entity.parentId, + 'shares-accounts', + entity.entityId + ]); break; case 'SAVING': if (entity.subEntityType === 'depositAccountType.recurringDeposit') { - this.router.navigate(['clients', entity.parentId, 'recurring-deposits-accounts', entity.entityId, 'transactions']); + this.router.navigate([ + 'clients', + entity.parentId, + 'recurring-deposits-accounts', + entity.entityId, + 'transactions' + ]); } else if (entity.subEntityType === 'depositAccountType.fixedDeposit') { - this.router.navigate(['clients', entity.parentId, 'fixed-deposits-accounts', entity.entityId, 'transactions']); + this.router.navigate([ + 'clients', + entity.parentId, + 'fixed-deposits-accounts', + entity.entityId, + 'transactions' + ]); } else if (entity.subEntityType === 'depositAccountType.savingsDeposit') { - this.router.navigate(['clients', entity.parentId, 'savings-accounts', entity.entityId, 'transactions']); + this.router.navigate([ + 'clients', + entity.parentId, + 'savings-accounts', + entity.entityId, + 'transactions' + ]); } break; case 'LOAN': - this.router.navigate(['clients', entity.parentId, 'loans-accounts', entity.entityId, 'general']); + this.router.navigate([ + 'clients', + entity.parentId, + 'loans-accounts', + entity.entityId, + 'general' + ]); break; } } - } diff --git a/src/app/search/search-routing.module.ts b/src/app/search/search-routing.module.ts index d9e234e3d..b6633ea81 100644 --- a/src/app/search/search-routing.module.ts +++ b/src/app/search/search-routing.module.ts @@ -24,6 +24,7 @@ const routes: Routes = [ } } ]) + ]; @NgModule({ @@ -31,4 +32,4 @@ const routes: Routes = [ providers: [SearchResolver], exports: [RouterModule] }) -export class SearchRoutingModule { } +export class SearchRoutingModule {} diff --git a/src/app/search/search.model.ts b/src/app/search/search.model.ts index 51260b86c..f3c963a70 100644 --- a/src/app/search/search.model.ts +++ b/src/app/search/search.model.ts @@ -1,19 +1,18 @@ export interface SearchData { - entityId: number; - entityAccountNo: string; - entityExternalId: string; - entityName: string; - entityType: string; - parentId: number; - parentName: string; - entityStatus: EntityStatus; - parentType: string; - subEntityType: string; + entityId: number; + entityAccountNo: string; + entityExternalId: string; + entityName: string; + entityType: string; + parentId: number; + parentName: string; + entityStatus: EntityStatus; + parentType: string; + subEntityType: string; } export interface EntityStatus { - id: number; - code: string; - value: string; + id: number; + code: string; + value: string; } - diff --git a/src/app/search/search.module.ts b/src/app/search/search.module.ts index 2dd52860e..de8c9755b 100644 --- a/src/app/search/search.module.ts +++ b/src/app/search/search.module.ts @@ -20,4 +20,4 @@ import { PipesModule } from 'app/pipes/pipes.module'; SearchRoutingModule ] }) -export class SearchModule { } +export class SearchModule {} diff --git a/src/app/search/search.resolver.ts b/src/app/search/search.resolver.ts index 5ec9518cc..0ce1b766b 100644 --- a/src/app/search/search.resolver.ts +++ b/src/app/search/search.resolver.ts @@ -13,7 +13,6 @@ import { SearchService } from './search.service'; */ @Injectable() export class SearchResolver implements Resolve { - /** * @param {SearchService} searchService Notifications service. */ @@ -29,5 +28,4 @@ export class SearchResolver implements Resolve { const resource = route.queryParams['resource']; return this.searchService.getSearchResults(query, resource); } - } diff --git a/src/app/search/search.service.ts b/src/app/search/search.service.ts index 34e45f717..2fbae84a1 100644 --- a/src/app/search/search.service.ts +++ b/src/app/search/search.service.ts @@ -12,11 +12,10 @@ import { Observable } from 'rxjs'; providedIn: 'root' }) export class SearchService { - /** * @param {HttpClient} http Http Client to send requests. */ - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * @param {string} query Query String @@ -24,11 +23,7 @@ export class SearchService { * @returns {Observable} Search Results. */ getSearchResults(query: string, resource: string): Observable { - const httpParams = new HttpParams() - .set('exactMatch', 'false') - .set('query', query) - .set('resource', resource); + const httpParams = new HttpParams().set('exactMatch', 'false').set('query', query).set('resource', resource); return this.http.get('/search', { params: httpParams }); } - } diff --git a/src/app/self-service/app-configuration/app-configuration.component.spec.ts b/src/app/self-service/app-configuration/app-configuration.component.spec.ts index f28a679d5..8858e8c0c 100644 --- a/src/app/self-service/app-configuration/app-configuration.component.spec.ts +++ b/src/app/self-service/app-configuration/app-configuration.component.spec.ts @@ -8,9 +8,8 @@ describe('AppConfigurationComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ AppConfigurationComponent ] - }) - .compileComponents(); + declarations: [AppConfigurationComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/self-service/app-configuration/app-configuration.component.ts b/src/app/self-service/app-configuration/app-configuration.component.ts index 9b5885cd0..43a181aa0 100644 --- a/src/app/self-service/app-configuration/app-configuration.component.ts +++ b/src/app/self-service/app-configuration/app-configuration.component.ts @@ -12,7 +12,6 @@ import { Component } from '@angular/core'; styleUrls: ['./app-configuration.component.scss'] }) export class AppConfigurationComponent { - /** Placeholder for languages. */ languages: any; /** Placeholder for date formats. */ @@ -26,6 +25,5 @@ export class AppConfigurationComponent { /** Placeholder for online banking app fonts. */ onlineBankingAppFonts: any; - constructor() { } - + constructor() {} } diff --git a/src/app/self-service/self-service-routing.module.ts b/src/app/self-service/self-service-routing.module.ts index 9109d04f7..1908efb53 100644 --- a/src/app/self-service/self-service-routing.module.ts +++ b/src/app/self-service/self-service-routing.module.ts @@ -48,7 +48,10 @@ const routes: Routes = [ }, { path: 'view/:id', - data: { title: 'View Self Service User', routeResolveBreadcrumb: ['user', 'username'] }, + data: { title: 'View Self Service User', routeResolveBreadcrumb: [ + 'user', + 'username' + ] }, resolve: { user: ViewUserResolver }, @@ -79,6 +82,7 @@ const routes: Routes = [ ] } ]) + ]; /** @@ -93,4 +97,4 @@ const routes: Routes = [ ViewUserResolver ] }) -export class SelfServiceRoutingModule { } +export class SelfServiceRoutingModule {} diff --git a/src/app/self-service/self-service.component.spec.ts b/src/app/self-service/self-service.component.spec.ts index cc7053b71..34da20b7f 100644 --- a/src/app/self-service/self-service.component.spec.ts +++ b/src/app/self-service/self-service.component.spec.ts @@ -8,9 +8,8 @@ describe('SelfServiceComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SelfServiceComponent ] - }) - .compileComponents(); + declarations: [SelfServiceComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/self-service/self-service.component.ts b/src/app/self-service/self-service.component.ts index 66fe765fe..56de27bfd 100644 --- a/src/app/self-service/self-service.component.ts +++ b/src/app/self-service/self-service.component.ts @@ -12,7 +12,5 @@ import { Component } from '@angular/core'; styleUrls: ['./self-service.component.scss'] }) export class SelfServiceComponent { - - constructor() { } - + constructor() {} } diff --git a/src/app/self-service/self-service.module.ts b/src/app/self-service/self-service.module.ts index 0095a623a..e9b2045d4 100644 --- a/src/app/self-service/self-service.module.ts +++ b/src/app/self-service/self-service.module.ts @@ -34,4 +34,4 @@ import { TaskManagementComponent } from './task-management/task-management.compo TaskManagementComponent ] }) -export class SelfServiceModule { } +export class SelfServiceModule {} diff --git a/src/app/self-service/task-management/task-management.component.spec.ts b/src/app/self-service/task-management/task-management.component.spec.ts index 52e6cde1a..10e29bde2 100644 --- a/src/app/self-service/task-management/task-management.component.spec.ts +++ b/src/app/self-service/task-management/task-management.component.spec.ts @@ -8,9 +8,8 @@ describe('TaskManagementComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ TaskManagementComponent ] - }) - .compileComponents(); + declarations: [TaskManagementComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/self-service/task-management/task-management.component.ts b/src/app/self-service/task-management/task-management.component.ts index d637c1578..71b1aaf36 100644 --- a/src/app/self-service/task-management/task-management.component.ts +++ b/src/app/self-service/task-management/task-management.component.ts @@ -6,7 +6,5 @@ import { Component } from '@angular/core'; styleUrls: ['./task-management.component.scss'] }) export class TaskManagementComponent { - - constructor() { } - + constructor() {} } diff --git a/src/app/self-service/users/create-user/create-user.component.spec.ts b/src/app/self-service/users/create-user/create-user.component.spec.ts index 0489eff4e..c2f14c7ec 100644 --- a/src/app/self-service/users/create-user/create-user.component.spec.ts +++ b/src/app/self-service/users/create-user/create-user.component.spec.ts @@ -8,9 +8,8 @@ describe('CreateUserComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CreateUserComponent ] - }) - .compileComponents(); + declarations: [CreateUserComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/self-service/users/create-user/create-user.component.ts b/src/app/self-service/users/create-user/create-user.component.ts index b884e9c27..8ee11911c 100644 --- a/src/app/self-service/users/create-user/create-user.component.ts +++ b/src/app/self-service/users/create-user/create-user.component.ts @@ -20,19 +20,25 @@ export class CreateUserComponent implements OnInit { createUserForm: UntypedFormGroup; /** Denotes type of user. */ - userTypes = ['Existing User', 'New User']; + userTypes = [ + 'Existing User', + 'New User' + ]; /** Radio button group form control for type of user. */ userType = new UntypedFormControl(this.userTypes[0]); /** Placeholder for office data. */ offices: any[] = []; /** Placeholder for staff data. */ - staffOptions: any [] = []; + staffOptions: any[] = []; /** Placeholder for staff data. */ - genderOptions: any [] = []; + genderOptions: any[] = []; /** Placeholder for client data. */ - clientData: any [] = []; + clientData: any[] = []; /** Placeholder for gender data. */ - genderData = ['Male', 'Female']; + genderData = [ + 'Male', + 'Female' + ]; /** Minimum date of birth of user allowed. */ minDate = new Date(1900, 0, 1); /** Maximum date of birth of user allowed. */ @@ -41,10 +47,12 @@ export class CreateUserComponent implements OnInit { /** * @param {SettingsService} settingsService Settings Service */ - constructor(private formBuilder: UntypedFormBuilder, + constructor( + private formBuilder: UntypedFormBuilder, private route: ActivatedRoute, private clientService: ClientsService, - private settingsService: SettingsService) { + private settingsService: SettingsService + ) { this.route.data.subscribe((data: { offices: any }) => { this.offices = data.offices; }); @@ -62,8 +70,14 @@ export class CreateUserComponent implements OnInit { */ setClientForm() { this.createUserForm = this.formBuilder.group({ - 'officeId': ['', Validators.required], - 'staffId': ['', Validators.required] + officeId: [ + '', + Validators.required + ], + staffId: [ + '', + Validators.required + ] }); } @@ -78,5 +92,4 @@ export class CreateUserComponent implements OnInit { }); }); } - } diff --git a/src/app/self-service/users/edit-user/edit-user.component.spec.ts b/src/app/self-service/users/edit-user/edit-user.component.spec.ts index 3702bd7a3..a8d5bb071 100644 --- a/src/app/self-service/users/edit-user/edit-user.component.spec.ts +++ b/src/app/self-service/users/edit-user/edit-user.component.spec.ts @@ -8,9 +8,8 @@ describe('EditUserComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EditUserComponent ] - }) - .compileComponents(); + declarations: [EditUserComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/self-service/users/edit-user/edit-user.component.ts b/src/app/self-service/users/edit-user/edit-user.component.ts index a228828b1..aa6a7e285 100644 --- a/src/app/self-service/users/edit-user/edit-user.component.ts +++ b/src/app/self-service/users/edit-user/edit-user.component.ts @@ -13,7 +13,6 @@ import { SettingsService } from 'app/settings/settings.service'; styleUrls: ['./edit-user.component.scss'] }) export class EditUserComponent implements OnInit { - /** Placeholder for office data. */ officeData: any; /** Placeholder for staff data. */ @@ -28,10 +27,9 @@ export class EditUserComponent implements OnInit { /** * @param {SettingsService} settingsService Settings Service */ - constructor(private settingsService: SettingsService) { } - - ngOnInit() { - this.maxDate = this.settingsService.businessDate; - } + constructor(private settingsService: SettingsService) {} + ngOnInit() { + this.maxDate = this.settingsService.businessDate; + } } diff --git a/src/app/self-service/users/user.service.ts b/src/app/self-service/users/user.service.ts index b34b4363e..3d54d8705 100644 --- a/src/app/self-service/users/user.service.ts +++ b/src/app/self-service/users/user.service.ts @@ -18,11 +18,10 @@ import { User } from './user.model'; providedIn: 'root' }) export class UserService { - /** * @param {HttpClient} http Http Client to send requests. */ - constructor(private http: HttpClient) { } + constructor(private http: HttpClient) {} /** * Gets all the self service users. @@ -31,18 +30,17 @@ export class UserService { */ getUsers(): Observable { const httpParams = new HttpParams().set('fields', 'id,firstname,lastname,email,officeName,staff'); - return this.http.get('/users', { params: httpParams }) - .pipe( - map((users: any) => { - users.forEach((user: any) => { - user.name = `${user.firstname} ${user.lastname}`; - user.staff = user.staff ? `${user.staff.firstname} ${user.staff.lastname}` : ''; - delete user.firstname; - delete user.lastname; - }); - return users as User[]; - }) - ); + return this.http.get('/users', { params: httpParams }).pipe( + map((users: any) => { + users.forEach((user: any) => { + user.name = `${user.firstname} ${user.lastname}`; + user.staff = user.staff ? `${user.staff.firstname} ${user.staff.lastname}` : ''; + delete user.firstname; + delete user.lastname; + }); + return users as User[]; + }) + ); } /** @@ -54,8 +52,6 @@ export class UserService { * TODO: update endpoint once API available */ changePassword(userId: string, passwordObj: any) { - return this.http.put(`/users/${userId}`, passwordObj); } - } diff --git a/src/app/self-service/users/users.component.spec.ts b/src/app/self-service/users/users.component.spec.ts index 909b5bafc..6baec2df2 100644 --- a/src/app/self-service/users/users.component.spec.ts +++ b/src/app/self-service/users/users.component.spec.ts @@ -8,9 +8,8 @@ describe('UsersComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ UsersComponent ] - }) - .compileComponents(); + declarations: [UsersComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/self-service/users/users.component.ts b/src/app/self-service/users/users.component.ts index 616ef6da6..0e4c58b68 100644 --- a/src/app/self-service/users/users.component.ts +++ b/src/app/self-service/users/users.component.ts @@ -23,11 +23,18 @@ import { User } from './user.model'; styleUrls: ['./users.component.scss'] }) export class UsersComponent implements OnInit { - /** Self service users. */ userData: User[]; /** Columns to be displayed in users table. */ - displayedColumns: string[] = ['select', 'name', 'id', 'email', 'status', 'officeName', 'staff']; + displayedColumns: string[] = [ + 'select', + 'name', + 'id', + 'email', + 'status', + 'officeName', + 'staff' + ]; /** Data source for users table. */ dataSource: MatTableDataSource; /** Selection model for users table. */ @@ -84,9 +91,8 @@ export class UsersComponent implements OnInit { * Toggles selection for all rows of users table. */ masterToggle() { - this.isAllSelected() ? - this.selection.clear() : - this.dataSource.data.forEach((row: User) => this.selection.select(row)); + this.isAllSelected() + ? this.selection.clear() + : this.dataSource.data.forEach((row: User) => this.selection.select(row)); } - } diff --git a/src/app/self-service/users/view-user/view-user.component.spec.ts b/src/app/self-service/users/view-user/view-user.component.spec.ts index 57516288e..1977898ae 100644 --- a/src/app/self-service/users/view-user/view-user.component.spec.ts +++ b/src/app/self-service/users/view-user/view-user.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewUserComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewUserComponent ] - }) - .compileComponents(); + declarations: [ViewUserComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/self-service/users/view-user/view-user.component.ts b/src/app/self-service/users/view-user/view-user.component.ts index 1850cb078..1b70d6594 100644 --- a/src/app/self-service/users/view-user/view-user.component.ts +++ b/src/app/self-service/users/view-user/view-user.component.ts @@ -18,7 +18,6 @@ import { UserService } from '../user.service'; styleUrls: ['./view-user.component.scss'] }) export class ViewUserComponent { - /** Self service user. */ user: any; @@ -30,10 +29,12 @@ export class ViewUserComponent { * @param {Router} router Router for navigation. * @param {MatDialog} dialog Dialog reference. */ - constructor(private route: ActivatedRoute, - private userService: UserService, - private router: Router, - private dialog: MatDialog) { + constructor( + private route: ActivatedRoute, + private userService: UserService, + private router: Router, + private dialog: MatDialog + ) { this.route.data.subscribe((data: { user: any }) => { this.user = data.user; }); @@ -51,12 +52,11 @@ export class ViewUserComponent { if (response.password && response.repeatPassword) { const password = response.password; const repeatPassword = response.repeatPassword; - const data = {password: password, repeatPassword: repeatPassword }; + const data = { password: password, repeatPassword: repeatPassword }; this.userService.changePassword(this.user.id, data).subscribe(() => { this.router.navigate(['/..']); }); } }); } - } diff --git a/src/app/self-service/users/view-user/view-user.resolver.ts b/src/app/self-service/users/view-user/view-user.resolver.ts index 4af50f7dc..5804b8e90 100644 --- a/src/app/self-service/users/view-user/view-user.resolver.ts +++ b/src/app/self-service/users/view-user/view-user.resolver.ts @@ -16,7 +16,6 @@ import { UsersService } from 'app/users/users.service'; */ @Injectable() export class ViewUserResolver implements Resolve { - /** * @param {UserService} userService Self service user service. */ @@ -29,5 +28,4 @@ export class ViewUserResolver implements Resolve { resolve(): Observable { return this.userService.getUser('1'); } - } diff --git a/src/app/settings/settings-routing.module.ts b/src/app/settings/settings-routing.module.ts index e4888ac8a..5002c9962 100644 --- a/src/app/settings/settings-routing.module.ts +++ b/src/app/settings/settings-routing.module.ts @@ -17,6 +17,7 @@ const routes: Routes = [ data: { title: 'Settings', breadcrumb: 'Settings' } } ]) + ]; /** @@ -29,4 +30,4 @@ const routes: Routes = [ exports: [RouterModule], providers: [] }) -export class SettingsRoutingModule { } +export class SettingsRoutingModule {} diff --git a/src/app/settings/settings.component.spec.ts b/src/app/settings/settings.component.spec.ts index 91588f354..30193bf19 100644 --- a/src/app/settings/settings.component.spec.ts +++ b/src/app/settings/settings.component.spec.ts @@ -8,9 +8,8 @@ describe('SettingsComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ SettingsComponent ] - }) - .compileComponents(); + declarations: [SettingsComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts index f1d37972e..e044d373f 100644 --- a/src/app/settings/settings.component.ts +++ b/src/app/settings/settings.component.ts @@ -14,7 +14,6 @@ import { UntypedFormControl } from '@angular/forms'; styleUrls: ['./settings.component.scss'] }) export class SettingsComponent implements OnInit { - /** Placeholder for languages. update once translations are set up */ languages: any[] = [ { @@ -34,32 +33,32 @@ export class SettingsComponent implements OnInit { 'MM-dd-yy', 'yyyy-MM-dd' ]; - /** Decimals. */ - decimals: string[] = [ - '0', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - ]; + /** Decimals. */ + decimals: string[] = [ + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8' + ]; /** Placeholder for fonts. */ fonts: any; /** Language Setting */ language = new UntypedFormControl(''); /** Date Format Setting */ - dateFormat = new UntypedFormControl(''); + dateFormat = new UntypedFormControl(''); /** Decimals to Display Setting */ - decimalsToDisplay = new UntypedFormControl(''); + decimalsToDisplay = new UntypedFormControl(''); /** * @param {SettingsService} settingsService Settings Service */ - constructor(private settingsService: SettingsService) { } + constructor(private settingsService: SettingsService) {} ngOnInit() { this.language.patchValue(this.settingsService.language); @@ -92,5 +91,4 @@ export class SettingsComponent implements OnInit { compareOptions(option1: any, option2: any) { return option1 && option2 && option1.code === option2.code; } - } diff --git a/src/app/settings/settings.module.ts b/src/app/settings/settings.module.ts index e87b04bdb..893bd6a52 100644 --- a/src/app/settings/settings.module.ts +++ b/src/app/settings/settings.module.ts @@ -20,4 +20,4 @@ import { SettingsComponent } from './settings.component'; ], declarations: [SettingsComponent] }) -export class SettingsModule { } +export class SettingsModule {} diff --git a/src/app/settings/settings.service.ts b/src/app/settings/settings.service.ts index 311ed0539..d2e844c51 100644 --- a/src/app/settings/settings.service.ts +++ b/src/app/settings/settings.service.ts @@ -13,7 +13,6 @@ import { environment } from '../../environments/environment'; providedIn: 'root' }) export class SettingsService { - public static businessDateFormat = 'yyyy-MM-dd'; public static businessDateConfigName = 'enable-business-date'; public static businessDateType = 'BUSINESS_DATE'; @@ -21,8 +20,10 @@ export class SettingsService { minAllowedDate = new Date(1950, 0, 1); maxAllowedDate = new Date(2100, 0, 1); - constructor(private alertService: AlertService, - private dateUtils: Dates) { } + constructor( + private alertService: AlertService, + private dateUtils: Dates + ) {} /** * Sets date format setting throughout the app. @@ -36,7 +37,7 @@ export class SettingsService { * Sets language setting throughout the app. * @param {any} language Language. */ - setLanguage(language: { name: string, code: string }) { + setLanguage(language: { name: string; code: string }) { localStorage.setItem('mifosXLanguage', JSON.stringify(language)); } @@ -241,8 +242,10 @@ export class SettingsService { if (data.type === dateType) { const dateVal = new Date(data.date); this.setBusinessDate(this.dateUtils.formatDate(dateVal, SettingsService.businessDateFormat)); - this.alertService.alert({ type: dateType + ' Set', - message: this.dateUtils.formatDate(dateVal, this.dateFormat())}); + this.alertService.alert({ + type: dateType + ' Set', + message: this.dateUtils.formatDate(dateVal, this.dateFormat()) + }); return; } }); @@ -255,5 +258,4 @@ export class SettingsService { get themeDarkEnabled() { return JSON.parse(localStorage.getItem('mifosXThemeDarkEnabled')); } - } diff --git a/src/app/shared/account-number/account-number.component.spec.ts b/src/app/shared/account-number/account-number.component.spec.ts index c43c833ff..e85658a66 100644 --- a/src/app/shared/account-number/account-number.component.spec.ts +++ b/src/app/shared/account-number/account-number.component.spec.ts @@ -8,9 +8,8 @@ describe('AccountNumberComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ AccountNumberComponent ] - }) - .compileComponents(); + declarations: [AccountNumberComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/account-number/account-number.component.ts b/src/app/shared/account-number/account-number.component.ts index aa597f324..96687b52f 100644 --- a/src/app/shared/account-number/account-number.component.ts +++ b/src/app/shared/account-number/account-number.component.ts @@ -17,11 +17,11 @@ export class AccountNumberComponent implements OnInit { displayL = false; displayR = true; - constructor(private clipboard: Clipboard) { } + constructor(private clipboard: Clipboard) {} ngOnInit(): void { - this.displayL = (this.display === 'left'); - this.displayR = (this.display === 'right'); + this.displayL = this.display === 'left'; + this.displayR = this.display === 'right'; } copyValue(): void { diff --git a/src/app/shared/accounting/gl-account-display/gl-account-display.component.spec.ts b/src/app/shared/accounting/gl-account-display/gl-account-display.component.spec.ts index 731530a94..36270468a 100644 --- a/src/app/shared/accounting/gl-account-display/gl-account-display.component.spec.ts +++ b/src/app/shared/accounting/gl-account-display/gl-account-display.component.spec.ts @@ -8,9 +8,8 @@ describe('GlAccountDisplayComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GlAccountDisplayComponent ] - }) - .compileComponents(); + declarations: [GlAccountDisplayComponent] + }).compileComponents(); fixture = TestBed.createComponent(GlAccountDisplayComponent); component = fixture.componentInstance; diff --git a/src/app/shared/accounting/gl-account-display/gl-account-display.component.ts b/src/app/shared/accounting/gl-account-display/gl-account-display.component.ts index 94cf60fc1..d3f1bccf7 100644 --- a/src/app/shared/accounting/gl-account-display/gl-account-display.component.ts +++ b/src/app/shared/accounting/gl-account-display/gl-account-display.component.ts @@ -7,19 +7,22 @@ import { GLAccount } from 'app/shared/models/general.model'; styleUrls: ['./gl-account-display.component.scss'] }) export class GlAccountDisplayComponent { - @Input() glAccount: GLAccount | null = null; @Input() accountTitle: string | null = null; @Input() withTitle = '50%'; @Input() withAccount = '50%'; - constructor() { } + constructor() {} glAccountValue(): string { if (this.glAccount) { - return '(' + this.glAccount.glCode + ') ' + (this.glAccount.nameDecorated ? this.glAccount.nameDecorated : this.glAccount.name); + return ( + '(' + + this.glAccount.glCode + + ') ' + + (this.glAccount.nameDecorated ? this.glAccount.nameDecorated : this.glAccount.name) + ); } return ''; } - } diff --git a/src/app/shared/accounting/gl-account-selector/gl-account-selector.component.spec.ts b/src/app/shared/accounting/gl-account-selector/gl-account-selector.component.spec.ts index 59940c6d5..2933a17b3 100644 --- a/src/app/shared/accounting/gl-account-selector/gl-account-selector.component.spec.ts +++ b/src/app/shared/accounting/gl-account-selector/gl-account-selector.component.spec.ts @@ -8,9 +8,8 @@ describe('GlAccountSelectorComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ GlAccountSelectorComponent ] - }) - .compileComponents(); + declarations: [GlAccountSelectorComponent] + }).compileComponents(); fixture = TestBed.createComponent(GlAccountSelectorComponent); component = fixture.componentInstance; diff --git a/src/app/shared/accounting/gl-account-selector/gl-account-selector.component.ts b/src/app/shared/accounting/gl-account-selector/gl-account-selector.component.ts index 94774a012..35753d7ad 100644 --- a/src/app/shared/accounting/gl-account-selector/gl-account-selector.component.ts +++ b/src/app/shared/accounting/gl-account-selector/gl-account-selector.component.ts @@ -11,7 +11,6 @@ import { takeUntil } from 'rxjs/operators'; styleUrls: ['./gl-account-selector.component.scss'] }) export class GlAccountSelectorComponent implements OnInit, OnChanges, OnDestroy { - @Input() inputFormControl: UntypedFormControl; @Input() glAccountList: GLAccount[] = []; @Input() required = false; @@ -29,15 +28,13 @@ export class GlAccountSelectorComponent implements OnInit, OnChanges, OnDestroy placeHolderLabel = ''; noEntriesFoundLabel = ''; - constructor(private translateService: TranslateService) { } + constructor(private translateService: TranslateService) {} ngOnInit(): void { // listen for search field value changes - this.filterFormCtrl.valueChanges - .pipe(takeUntil(this._onDestroy)) - .subscribe(() => { - this.searchGLAccount(); - }); + this.filterFormCtrl.valueChanges.pipe(takeUntil(this._onDestroy)).subscribe(() => { + this.searchGLAccount(); + }); this.placeHolderLabel = this.translateService.instant('labels.inputs.Filter'); this.noEntriesFoundLabel = this.translateService.instant('labels.text.No data found'); @@ -59,13 +56,14 @@ export class GlAccountSelectorComponent implements OnInit, OnChanges, OnDestroy const search: string = this.filterFormCtrl.value.toLowerCase(); if (!search) { - this.glAccountData.next(this.glAccountList.slice()); + this.glAccountData.next(this.glAccountList.slice()); } else { - this.glAccountData.next(this.glAccountList.filter((option: GLAccount) => { - return option.name.toLowerCase().indexOf(search) >= 0 || option.glCode.toLowerCase().indexOf(search) >= 0; - })); + this.glAccountData.next( + this.glAccountList.filter((option: GLAccount) => { + return option.name.toLowerCase().indexOf(search) >= 0 || option.glCode.toLowerCase().indexOf(search) >= 0; + }) + ); } } } - } diff --git a/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.spec.ts b/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.spec.ts index 773447ed5..b30bdc60a 100644 --- a/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.spec.ts +++ b/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewJournalEntryTransactionComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ViewJournalEntryTransactionComponent ] - }) - .compileComponents(); + declarations: [ViewJournalEntryTransactionComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.ts b/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.ts index 17207bead..d4bb0bb1d 100644 --- a/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.ts +++ b/src/app/shared/accounting/view-journal-entry-transaction/view-journal-entry-transaction.component.ts @@ -15,7 +15,6 @@ import { Location } from '@angular/common'; styleUrls: ['./view-journal-entry-transaction.component.scss'] }) export class ViewJournalEntryTransactionComponent implements OnInit { - title: string; journalEntriesData: any[]; /** Transaction data. */ @@ -23,7 +22,14 @@ export class ViewJournalEntryTransactionComponent implements OnInit { /** Transaction ID. */ transactionId: string; /** Columns to be displayed in transaction table. */ - displayedColumns: string[] = ['id', 'glAccountType', 'glAccountCode', 'glAccountName', 'debit', 'credit']; + displayedColumns: string[] = [ + 'id', + 'glAccountType', + 'glAccountCode', + 'glAccountName', + 'debit', + 'credit' + ]; /** Data source for transaction table. */ dataSource: MatTableDataSource; @@ -40,17 +46,19 @@ export class ViewJournalEntryTransactionComponent implements OnInit { * @param {Router} router Router for navigation. * @param {MatDialog} dialog Dialog reference. */ - constructor(private accountingService: AccountingService, - private route: ActivatedRoute, - private router: Router, - public dialog: MatDialog, - private location: Location) { } + constructor( + private accountingService: AccountingService, + private route: ActivatedRoute, + private router: Router, + public dialog: MatDialog, + private location: Location + ) {} /** * Retrieves the transaction data from `resolve` and sets the transaction table. */ ngOnInit() { - this.route.data.subscribe((data: { title: string, transaction: any, transferJournalEntryData: any }) => { + this.route.data.subscribe((data: { title: string; transaction: any; transferJournalEntryData: any }) => { this.title = data.title; this.isJournalEntryLoaded = false; if (this.isViewTransaction()) { @@ -68,11 +76,11 @@ export class ViewJournalEntryTransactionComponent implements OnInit { } isViewTransaction(): boolean { - return (this.title === 'View Transaction'); + return this.title === 'View Transaction'; } isViewTransfer(): boolean { - return (this.title === 'View Transfer'); + return this.title === 'View Transfer'; } /** @@ -85,10 +93,14 @@ export class ViewJournalEntryTransactionComponent implements OnInit { this.dataSource = new MatTableDataSource(this.transaction.pageItems); this.dataSource.sortingDataAccessor = (transaction: any, property: any) => { switch (property) { - case 'glAccountType': return transaction.glAccountType.value; - case 'debit': return transaction.amount; - case 'credit': return transaction.amount; - default: return transaction[property]; + case 'glAccountType': + return transaction.glAccountType.value; + case 'debit': + return transaction.amount; + case 'credit': + return transaction.amount; + default: + return transaction[property]; } }; } @@ -116,12 +128,20 @@ export class ViewJournalEntryTransactionComponent implements OnInit { }); revertTransactionDialogRef.afterClosed().subscribe((response: any) => { if (response.revert) { - this.accountingService.revertTransaction(this.transactionId, response.comments).subscribe((reversedTransaction: any) => { - this.dataSource.data[0].reversed = true; - this.revertTransaction(reversedTransaction.transactionId); - }); + this.accountingService + .revertTransaction(this.transactionId, response.comments) + .subscribe((reversedTransaction: any) => { + this.dataSource.data[0].reversed = true; + this.revertTransaction(reversedTransaction.transactionId); + }); } else if (response.redirect) { - this.router.navigate(['../', transactionId], { relativeTo: this.route }); + this.router.navigate( + [ + '../', + transactionId + ], + { relativeTo: this.route } + ); } }); } diff --git a/src/app/shared/accounting/view-journal-entry/view-journal-entry.component.spec.ts b/src/app/shared/accounting/view-journal-entry/view-journal-entry.component.spec.ts index 30c10fb32..3e267c66c 100644 --- a/src/app/shared/accounting/view-journal-entry/view-journal-entry.component.spec.ts +++ b/src/app/shared/accounting/view-journal-entry/view-journal-entry.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewJournalEntryComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ViewJournalEntryComponent ] - }) - .compileComponents(); + declarations: [ViewJournalEntryComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/accounting/view-journal-entry/view-journal-entry.component.ts b/src/app/shared/accounting/view-journal-entry/view-journal-entry.component.ts index 029de49b5..e015386bc 100644 --- a/src/app/shared/accounting/view-journal-entry/view-journal-entry.component.ts +++ b/src/app/shared/accounting/view-journal-entry/view-journal-entry.component.ts @@ -11,16 +11,16 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./view-journal-entry.component.scss'] }) export class ViewJournalEntryComponent { - existsPaymentDetails = false; /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data Provides journal entry. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { - - this.existsPaymentDetails = (data.journalEntry.transactionDetails != null && data.journalEntry.transactionDetails.paymentDetails != null); + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) { + this.existsPaymentDetails = + data.journalEntry.transactionDetails != null && data.journalEntry.transactionDetails.paymentDetails != null; } - } diff --git a/src/app/shared/accounting/view-savings-accounting-details/view-savings-accounting-details.component.spec.ts b/src/app/shared/accounting/view-savings-accounting-details/view-savings-accounting-details.component.spec.ts index 8c71cc91f..94a4fd6c4 100644 --- a/src/app/shared/accounting/view-savings-accounting-details/view-savings-accounting-details.component.spec.ts +++ b/src/app/shared/accounting/view-savings-accounting-details/view-savings-accounting-details.component.spec.ts @@ -8,9 +8,8 @@ describe('ViewSavingsAccountingDetailsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ViewSavingsAccountingDetailsComponent ] - }) - .compileComponents(); + declarations: [ViewSavingsAccountingDetailsComponent] + }).compileComponents(); fixture = TestBed.createComponent(ViewSavingsAccountingDetailsComponent); component = fixture.componentInstance; diff --git a/src/app/shared/accounting/view-savings-accounting-details/view-savings-accounting-details.component.ts b/src/app/shared/accounting/view-savings-accounting-details/view-savings-accounting-details.component.ts index 40b324c6c..a1067624b 100644 --- a/src/app/shared/accounting/view-savings-accounting-details/view-savings-accounting-details.component.ts +++ b/src/app/shared/accounting/view-savings-accounting-details/view-savings-accounting-details.component.ts @@ -8,11 +8,10 @@ import { OptionData } from 'app/shared/models/option-data.model'; styleUrls: ['./view-savings-accounting-details.component.scss'] }) export class ViewSavingsAccountingDetailsComponent { - @Input() accountingRule: OptionData; @Input() accountingMappings: any[] = []; - constructor(private accounting: Accounting) { } + constructor(private accounting: Accounting) {} isCashOrAccrualAccounting(): boolean { if (this.accountingRule) { @@ -31,5 +30,4 @@ export class ViewSavingsAccountingDetailsComponent { getAccountingRuleName(value: string): string { return this.accounting.getAccountRuleName(value.toUpperCase()); } - } diff --git a/src/app/shared/cancel-dialog/cancel-dialog.component.spec.ts b/src/app/shared/cancel-dialog/cancel-dialog.component.spec.ts index 94decaa50..2cbab2953 100644 --- a/src/app/shared/cancel-dialog/cancel-dialog.component.spec.ts +++ b/src/app/shared/cancel-dialog/cancel-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('CancelDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ CancelDialogComponent ] - }) - .compileComponents(); + declarations: [CancelDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/cancel-dialog/cancel-dialog.component.ts b/src/app/shared/cancel-dialog/cancel-dialog.component.ts index bae3fb4ef..440476139 100644 --- a/src/app/shared/cancel-dialog/cancel-dialog.component.ts +++ b/src/app/shared/cancel-dialog/cancel-dialog.component.ts @@ -11,11 +11,11 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; styleUrls: ['./cancel-dialog.component.scss'] }) export class CancelDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/shared/change-password-dialog/change-password-dialog.component.spec.ts b/src/app/shared/change-password-dialog/change-password-dialog.component.spec.ts index 1ba6fd2da..1144ba12d 100644 --- a/src/app/shared/change-password-dialog/change-password-dialog.component.spec.ts +++ b/src/app/shared/change-password-dialog/change-password-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('ChangePasswordDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ChangePasswordDialogComponent ] - }) - .compileComponents(); + declarations: [ChangePasswordDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/change-password-dialog/change-password-dialog.component.ts b/src/app/shared/change-password-dialog/change-password-dialog.component.ts index 64a710056..acea9200d 100644 --- a/src/app/shared/change-password-dialog/change-password-dialog.component.ts +++ b/src/app/shared/change-password-dialog/change-password-dialog.component.ts @@ -14,7 +14,6 @@ import { PasswordsUtility } from 'app/core/utils/passwords-utility'; styleUrls: ['./change-password-dialog.component.scss'] }) export class ChangePasswordDialogComponent implements OnInit { - /** Change Password Form */ changePasswordForm: any; @@ -22,10 +21,12 @@ export class ChangePasswordDialogComponent implements OnInit { * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data Provides any data. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any, - private formBuilder: UntypedFormBuilder, - private passwordsUtility: PasswordsUtility) { } + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any, + private formBuilder: UntypedFormBuilder, + private passwordsUtility: PasswordsUtility + ) {} ngOnInit() { this.createChangePasswordForm(); @@ -34,8 +35,16 @@ export class ChangePasswordDialogComponent implements OnInit { /** Change Password form */ createChangePasswordForm() { this.changePasswordForm = this.formBuilder.group({ - 'password': ['', this.passwordsUtility.getPasswordValidators()], - 'repeatPassword': ['', [Validators.required, this.confirmPassword('password')]] + password: [ + '', + this.passwordsUtility.getPasswordValidators() + ], + repeatPassword: [ + '', + [ + Validators.required, + this.confirmPassword('password')] + ] }); } @@ -44,19 +53,18 @@ export class ChangePasswordDialogComponent implements OnInit { * @param controlNameToCompare Form Control Name to be compared. */ confirmPassword(controlNameToCompare: string): ValidatorFn { - return (c: AbstractControl): ValidationErrors|null => { - if (c.value == null || c.value.length === 0) { - return null; - } - const controlToCompare = c.root.get(controlNameToCompare); - if (controlToCompare) { - const subscription: Subscription = controlToCompare.valueChanges.subscribe(() => { - c.updateValueAndValidity(); - subscription.unsubscribe(); - }); - } - return controlToCompare && controlToCompare.value !== c.value ? {'notequal': true} : null; + return (c: AbstractControl): ValidationErrors | null => { + if (c.value == null || c.value.length === 0) { + return null; + } + const controlToCompare = c.root.get(controlNameToCompare); + if (controlToCompare) { + const subscription: Subscription = controlToCompare.valueChanges.subscribe(() => { + c.updateValueAndValidity(); + subscription.unsubscribe(); + }); + } + return controlToCompare && controlToCompare.value !== c.value ? { notequal: true } : null; }; } - } diff --git a/src/app/shared/common-logic/tree-control.service.ts b/src/app/shared/common-logic/tree-control.service.ts index e70aaf291..31abff85a 100644 --- a/src/app/shared/common-logic/tree-control.service.ts +++ b/src/app/shared/common-logic/tree-control.service.ts @@ -5,7 +5,7 @@ import { NestedTreeControl } from '@angular/cdk/tree'; providedIn: 'root' }) export class TreeControlService { - constructor() { } + constructor() {} toggleExpandCollapse(nestedTreeControl: NestedTreeControl, isTreeExpanded: boolean) { if (isTreeExpanded) { diff --git a/src/app/shared/confirmation-dialog/confirmation-dialog.component.spec.ts b/src/app/shared/confirmation-dialog/confirmation-dialog.component.spec.ts index 4610829b9..b1c144782 100644 --- a/src/app/shared/confirmation-dialog/confirmation-dialog.component.spec.ts +++ b/src/app/shared/confirmation-dialog/confirmation-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('ConfirmationDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ConfirmationDialogComponent ] - }) - .compileComponents(); + declarations: [ConfirmationDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts b/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts index e2f38868e..6933d5b64 100644 --- a/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts +++ b/src/app/shared/confirmation-dialog/confirmation-dialog.component.ts @@ -13,15 +13,16 @@ import { Dialogs } from 'app/core/dialogs/dialogs'; styleUrls: ['./confirmation-dialog.component.scss'] }) export class ConfirmationDialogComponent implements OnInit { - color: string; /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data Provides a deleteContext. */ - constructor(public dialogRef: MatDialogRef, - private dialogs: Dialogs, - @Inject(MAT_DIALOG_DATA) public data: DialogData) { } + constructor( + public dialogRef: MatDialogRef, + private dialogs: Dialogs, + @Inject(MAT_DIALOG_DATA) public data: DialogData + ) {} ngOnInit() { this.setColor(); @@ -30,5 +31,4 @@ export class ConfirmationDialogComponent implements OnInit { setColor() { this.color = this.dialogs.setColor(this.data.type); } - } diff --git a/src/app/shared/delete-dialog/delete-dialog.component.spec.ts b/src/app/shared/delete-dialog/delete-dialog.component.spec.ts index 38e082626..b5d276d13 100644 --- a/src/app/shared/delete-dialog/delete-dialog.component.spec.ts +++ b/src/app/shared/delete-dialog/delete-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('DeleteDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DeleteDialogComponent ] - }) - .compileComponents(); + declarations: [DeleteDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/delete-dialog/delete-dialog.component.ts b/src/app/shared/delete-dialog/delete-dialog.component.ts index 2ecef10b1..0771a3c0d 100644 --- a/src/app/shared/delete-dialog/delete-dialog.component.ts +++ b/src/app/shared/delete-dialog/delete-dialog.component.ts @@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./delete-dialog.component.scss'] }) export class DeleteDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data Provides a deleteContext. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/shared/disable-dialog/disable-dialog.component.spec.ts b/src/app/shared/disable-dialog/disable-dialog.component.spec.ts index 005a653e3..2cb1db9bd 100644 --- a/src/app/shared/disable-dialog/disable-dialog.component.spec.ts +++ b/src/app/shared/disable-dialog/disable-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('DisableDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ DisableDialogComponent ] - }) - .compileComponents(); + declarations: [DisableDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/disable-dialog/disable-dialog.component.ts b/src/app/shared/disable-dialog/disable-dialog.component.ts index 56c38de45..f69892efd 100644 --- a/src/app/shared/disable-dialog/disable-dialog.component.ts +++ b/src/app/shared/disable-dialog/disable-dialog.component.ts @@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./disable-dialog.component.scss'] }) export class DisableDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data Provides a disableContext. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/shared/dropdown/dropdown.component.spec.ts b/src/app/shared/dropdown/dropdown.component.spec.ts index 4918a4792..10333b3be 100644 --- a/src/app/shared/dropdown/dropdown.component.spec.ts +++ b/src/app/shared/dropdown/dropdown.component.spec.ts @@ -8,9 +8,8 @@ describe('DropdownComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ DropdownComponent ] - }) - .compileComponents(); + declarations: [DropdownComponent] + }).compileComponents(); fixture = TestBed.createComponent(DropdownComponent); component = fixture.componentInstance; diff --git a/src/app/shared/dropdown/dropdown.component.ts b/src/app/shared/dropdown/dropdown.component.ts index 52ba8f651..4c55f8281 100644 --- a/src/app/shared/dropdown/dropdown.component.ts +++ b/src/app/shared/dropdown/dropdown.component.ts @@ -8,14 +8,13 @@ import { TranslateService } from '@ngx-translate/core'; styleUrls: ['./dropdown.component.scss'] }) export class DropdownComponent { - @Input() placeHolderText: string; @Input() labelText: string; @Input() selectOptions: any[] = []; @Input() controlSelect: UntypedFormControl; @Input() required: boolean; - constructor(private translateService: TranslateService) { } + constructor(private translateService: TranslateService) {} getPlaceHolderText(): string { return this.placeHolderText ? this.translateService.instant('labels.inputs.' + this.placeHolderText) : ''; @@ -28,5 +27,4 @@ export class DropdownComponent { clearProperty() { this.controlSelect.patchValue(''); } - } diff --git a/src/app/shared/enable-dialog/enable-dialog.component.spec.ts b/src/app/shared/enable-dialog/enable-dialog.component.spec.ts index 256ca842a..38ceef9a8 100644 --- a/src/app/shared/enable-dialog/enable-dialog.component.spec.ts +++ b/src/app/shared/enable-dialog/enable-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('EnableDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ EnableDialogComponent ] - }) - .compileComponents(); + declarations: [EnableDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/enable-dialog/enable-dialog.component.ts b/src/app/shared/enable-dialog/enable-dialog.component.ts index 79bc25a5d..9a70eb109 100644 --- a/src/app/shared/enable-dialog/enable-dialog.component.ts +++ b/src/app/shared/enable-dialog/enable-dialog.component.ts @@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./enable-dialog.component.scss'] }) export class EnableDialogComponent { - /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data Provides a enableContext. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: any) { } - + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any + ) {} } diff --git a/src/app/shared/entity-name/entity-name.component.spec.ts b/src/app/shared/entity-name/entity-name.component.spec.ts index 70491c14d..8d045a043 100644 --- a/src/app/shared/entity-name/entity-name.component.spec.ts +++ b/src/app/shared/entity-name/entity-name.component.spec.ts @@ -8,9 +8,8 @@ describe('EntityNameComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ EntityNameComponent ] - }) - .compileComponents(); + declarations: [EntityNameComponent] + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/shared/entity-name/entity-name.component.ts b/src/app/shared/entity-name/entity-name.component.ts index 129ed323d..7b31b017b 100644 --- a/src/app/shared/entity-name/entity-name.component.ts +++ b/src/app/shared/entity-name/entity-name.component.ts @@ -7,7 +7,6 @@ import { Clipboard } from '@angular/cdk/clipboard'; styleUrls: ['./entity-name.component.scss'] }) export class EntityNameComponent implements OnInit { - @Input() entityName: string; @Input() display = 'right'; @@ -15,11 +14,11 @@ export class EntityNameComponent implements OnInit { displayL = false; displayR = true; - constructor(private clipboard: Clipboard) { } + constructor(private clipboard: Clipboard) {} ngOnInit(): void { - this.displayL = (this.display === 'left'); - this.displayR = (this.display === 'right'); + this.displayL = this.display === 'left'; + this.displayR = this.display === 'right'; } copyValue(): void { diff --git a/src/app/shared/error-dialog/error-dialog.component.spec.ts b/src/app/shared/error-dialog/error-dialog.component.spec.ts index 9f3434803..66d7fc6ad 100644 --- a/src/app/shared/error-dialog/error-dialog.component.spec.ts +++ b/src/app/shared/error-dialog/error-dialog.component.spec.ts @@ -8,9 +8,8 @@ describe('ErrorDialogComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ ErrorDialogComponent ] - }) - .compileComponents(); + declarations: [ErrorDialogComponent] + }).compileComponents(); })); beforeEach(() => { diff --git a/src/app/shared/error-dialog/error-dialog.component.ts b/src/app/shared/error-dialog/error-dialog.component.ts index 800e48608..ea692a245 100644 --- a/src/app/shared/error-dialog/error-dialog.component.ts +++ b/src/app/shared/error-dialog/error-dialog.component.ts @@ -8,15 +8,15 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; styleUrls: ['./error-dialog.component.scss'] }) export class ErrorDialogComponent { - showAsCode = false; /** * @param {MatDialogRef} dialogRef Component reference to dialog. * @param {any} data Provides any data. */ - constructor(public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: string) { - this.showAsCode = (data.startsWith('
'));
+  constructor(
+    public dialogRef: MatDialogRef,
+    @Inject(MAT_DIALOG_DATA) public data: string
+  ) {
+    this.showAsCode = data.startsWith('
');
   }
-
 }
diff --git a/src/app/shared/external-identifier/external-identifier.component.spec.ts b/src/app/shared/external-identifier/external-identifier.component.spec.ts
index 0ab285649..2889a72f1 100644
--- a/src/app/shared/external-identifier/external-identifier.component.spec.ts
+++ b/src/app/shared/external-identifier/external-identifier.component.spec.ts
@@ -8,9 +8,8 @@ describe('ExternalIdentifierComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ ExternalIdentifierComponent ]
-    })
-    .compileComponents();
+      declarations: [ExternalIdentifierComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/shared/external-identifier/external-identifier.component.ts b/src/app/shared/external-identifier/external-identifier.component.ts
index 485880b81..fd6003d1c 100644
--- a/src/app/shared/external-identifier/external-identifier.component.ts
+++ b/src/app/shared/external-identifier/external-identifier.component.ts
@@ -17,20 +17,22 @@ export class ExternalIdentifierComponent implements OnInit {
   displayR = true;
   emptyValue = false;
 
-  constructor(private clipboard: Clipboard,
-    private alertService: AlertService) { }
+  constructor(
+    private clipboard: Clipboard,
+    private alertService: AlertService
+  ) {}
 
   ngOnInit(): void {
-    this.emptyValue = (!this.externalId || this.externalId === '');
-    this.displayL = (this.display === 'left');
-    this.displayR = (this.display === 'right');
+    this.emptyValue = !this.externalId || this.externalId === '';
+    this.displayL = this.display === 'left';
+    this.displayR = this.display === 'right';
   }
 
   isLongValue(): boolean {
     if (this.externalId == null) {
       return false;
     }
-    return (this.externalId.length > 15);
+    return this.externalId.length > 15;
   }
 
   showValue() {
diff --git a/src/app/shared/file-upload/file-upload.component.spec.ts b/src/app/shared/file-upload/file-upload.component.spec.ts
index 0071ed860..684a50579 100644
--- a/src/app/shared/file-upload/file-upload.component.spec.ts
+++ b/src/app/shared/file-upload/file-upload.component.spec.ts
@@ -8,9 +8,8 @@ describe('FileUploadComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ FileUploadComponent ]
-    })
-    .compileComponents();
+      declarations: [FileUploadComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shared/file-upload/file-upload.component.ts b/src/app/shared/file-upload/file-upload.component.ts
index 976eca12c..695ffd3b9 100644
--- a/src/app/shared/file-upload/file-upload.component.ts
+++ b/src/app/shared/file-upload/file-upload.component.ts
@@ -10,7 +10,6 @@ import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
   styleUrls: ['./file-upload.component.scss']
 })
 export class FileUploadComponent implements OnInit {
-
   /** Form field flex dimension */
   @Input() flex: any;
   @Input() acceptFilter: string;
@@ -18,7 +17,7 @@ export class FileUploadComponent implements OnInit {
   /** Selected file name */
   fileName: File;
 
-  constructor() { }
+  constructor() {}
 
   ngOnInit() {
     if (!this.acceptFilter) {
@@ -33,5 +32,4 @@ export class FileUploadComponent implements OnInit {
   onFileSelect($event: any) {
     this.fileName = $event.target.files[0].name;
   }
-
 }
diff --git a/src/app/shared/footer/footer.component.spec.ts b/src/app/shared/footer/footer.component.spec.ts
index 2ca6c4543..6cf81a828 100644
--- a/src/app/shared/footer/footer.component.spec.ts
+++ b/src/app/shared/footer/footer.component.spec.ts
@@ -8,9 +8,8 @@ describe('FooterComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ FooterComponent ]
-    })
-    .compileComponents();
+      declarations: [FooterComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shared/footer/footer.component.ts b/src/app/shared/footer/footer.component.ts
index 4e5763665..61751f3e9 100644
--- a/src/app/shared/footer/footer.component.ts
+++ b/src/app/shared/footer/footer.component.ts
@@ -21,7 +21,6 @@ import { Subscription } from 'rxjs';
   styleUrls: ['./footer.component.scss']
 })
 export class FooterComponent implements OnInit, OnDestroy {
-
   /** Mifos X version. */
   versions: any = {
     mifos: environment.version,
@@ -44,13 +43,15 @@ export class FooterComponent implements OnInit, OnDestroy {
 
   displayBackEndInfo = true;
 
-  constructor(private systemService: SystemService,
+  constructor(
+    private systemService: SystemService,
     private settingsService: SettingsService,
     private authenticationService: AuthenticationService,
     private alertService: AlertService,
     private dateUtils: Dates,
-    private versionService: VersionService) {
-      this.displayBackEndInfo = (environment.displayBackEndInfo === 'true');
+    private versionService: VersionService
+  ) {
+    this.displayBackEndInfo = environment.displayBackEndInfo === 'true';
   }
 
   ngOnInit() {
@@ -58,7 +59,7 @@ export class FooterComponent implements OnInit, OnDestroy {
       this.alert$ = this.alertService.alertEvent.subscribe((alertEvent: Alert) => {
         const alertType = alertEvent.type;
         if (alertType === SettingsService.businessDateType + ' Set Config') {
-          this.isBusinessDateEnabled = (alertEvent.message === 'enabled') ? true : false;
+          this.isBusinessDateEnabled = alertEvent.message === 'enabled' ? true : false;
           this.isBusinessDateDefined = false;
           if (this.isBusinessDateEnabled) {
             this.setBusinessDate();
@@ -68,7 +69,9 @@ export class FooterComponent implements OnInit, OnDestroy {
             this.setBusinessDate();
           }
         } else if (alertType === 'Authentication Start') {
-          this.timer = setTimeout(() => { this.getConfigurations(); }, 60000);
+          this.timer = setTimeout(() => {
+            this.getConfigurations();
+          }, 60000);
         }
       });
       this.getConfigurations();
@@ -94,15 +97,18 @@ export class FooterComponent implements OnInit, OnDestroy {
    */
   getConfigurations(): void {
     if (this.authenticationService.isAuthenticated()) {
-      this.systemService.getConfigurationByName(SettingsService.businessDateConfigName)
-      .subscribe((configurationData: any) => {
-        this.isBusinessDateEnabled = configurationData.enabled;
-        this.settingsService.setBusinessDateConfig(configurationData.enabled);
-        if (this.isBusinessDateEnabled) {
-          this.setBusinessDate();
-          this.timer = setTimeout(() => { this.getConfigurations(); }, 60000);
-        }
-      });
+      this.systemService
+        .getConfigurationByName(SettingsService.businessDateConfigName)
+        .subscribe((configurationData: any) => {
+          this.isBusinessDateEnabled = configurationData.enabled;
+          this.settingsService.setBusinessDateConfig(configurationData.enabled);
+          if (this.isBusinessDateEnabled) {
+            this.setBusinessDate();
+            this.timer = setTimeout(() => {
+              this.getConfigurations();
+            }, 60000);
+          }
+        });
     } else {
       clearTimeout(this.timer);
     }
@@ -112,10 +118,11 @@ export class FooterComponent implements OnInit, OnDestroy {
    * Get the Business Date data
    */
   setBusinessDate(): void {
-    this.systemService.getBusinessDate(SettingsService.businessDateType)
-    .subscribe((data: any) => {
+    this.systemService.getBusinessDate(SettingsService.businessDateType).subscribe((data: any) => {
       this.businessDate = new Date(data.date);
-      this.settingsService.setBusinessDate(this.dateUtils.formatDate(this.businessDate, SettingsService.businessDateFormat));
+      this.settingsService.setBusinessDate(
+        this.dateUtils.formatDate(this.businessDate, SettingsService.businessDateFormat)
+      );
       this.isBusinessDateDefined = true;
     });
   }
diff --git a/src/app/shared/form-dialog/form-dialog.component.spec.ts b/src/app/shared/form-dialog/form-dialog.component.spec.ts
index 6a3fc0058..0e73bebe9 100644
--- a/src/app/shared/form-dialog/form-dialog.component.spec.ts
+++ b/src/app/shared/form-dialog/form-dialog.component.spec.ts
@@ -8,9 +8,8 @@ describe('FormDialogComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ FormDialogComponent ]
-    })
-    .compileComponents();
+      declarations: [FormDialogComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shared/form-dialog/form-dialog.component.ts b/src/app/shared/form-dialog/form-dialog.component.ts
index cee9cc974..6d55152c7 100644
--- a/src/app/shared/form-dialog/form-dialog.component.ts
+++ b/src/app/shared/form-dialog/form-dialog.component.ts
@@ -14,14 +14,13 @@ const layoutGap = 2;
   styleUrls: ['./form-dialog.component.scss']
 })
 export class FormDialogComponent implements OnInit {
-
   layout: {
-    columns: number,
-    columnWidth?: number,
-    flex?: number,
-    gap?: number,
-    cancelButtonText?: string,
-    addButtonText?: string
+    columns: number;
+    columnWidth?: number;
+    flex?: number;
+    gap?: number;
+    cancelButtonText?: string;
+    addButtonText?: string;
   } = {
     columns: 1,
     columnWidth: 400,
@@ -34,15 +33,19 @@ export class FormDialogComponent implements OnInit {
   formfields: FormfieldBase[];
   pristine: boolean;
 
-  constructor(public dialogRef: MatDialogRef,
-              @Inject(MAT_DIALOG_DATA) public data: any,
-              private formGroupService: FormGroupService) {
+  constructor(
+    public dialogRef: MatDialogRef,
+    @Inject(MAT_DIALOG_DATA) public data: any,
+    private formGroupService: FormGroupService
+  ) {
     this.dialogRef.disableClose = data.disableClose !== undefined ? data.disableClose : true;
-    this.formfields = data.formfields.sort((formfieldA: FormfieldBase, formfieldB: FormfieldBase) => formfieldA.order - formfieldB.order);
+    this.formfields = data.formfields.sort(
+      (formfieldA: FormfieldBase, formfieldB: FormfieldBase) => formfieldA.order - formfieldB.order
+    );
     this.pristine = data.pristine !== undefined ? data.pristine : true;
     this.layout = { ...this.layout, ...data.layout };
     this.layout.gap = this.layout.columns > 1 ? layoutGap : 0;
-    this.layout.flex = (this.layout.flex / this.layout.columns) - this.layout.gap;
+    this.layout.flex = this.layout.flex / this.layout.columns - this.layout.gap;
   }
 
   ngOnInit() {
@@ -52,5 +55,4 @@ export class FormDialogComponent implements OnInit {
       this.form.markAsDirty();
     }
   }
-
 }
diff --git a/src/app/shared/form-dialog/form-group.service.ts b/src/app/shared/form-dialog/form-group.service.ts
index 92f81d657..a281a2e2d 100644
--- a/src/app/shared/form-dialog/form-group.service.ts
+++ b/src/app/shared/form-dialog/form-group.service.ts
@@ -7,17 +7,17 @@ import { FormfieldBase } from './formfield/model/formfield-base';
   providedIn: 'root'
 })
 export class FormGroupService {
-
-  constructor() { }
+  constructor() {}
 
   createFormGroup(formfields: FormfieldBase[]) {
     const group: any = {};
 
-    formfields.forEach(formfield => {
-      group[formfield.controlName] = formfield.required ? new UntypedFormControl(formfield.value, Validators.required) : new UntypedFormControl(formfield.value);
+    formfields.forEach((formfield) => {
+      group[formfield.controlName] = formfield.required
+        ? new UntypedFormControl(formfield.value, Validators.required)
+        : new UntypedFormControl(formfield.value);
     });
 
     return new UntypedFormGroup(group);
   }
-
 }
diff --git a/src/app/shared/form-dialog/formfield/formfield.component.spec.ts b/src/app/shared/form-dialog/formfield/formfield.component.spec.ts
index 6c15a1935..a5702c901 100644
--- a/src/app/shared/form-dialog/formfield/formfield.component.spec.ts
+++ b/src/app/shared/form-dialog/formfield/formfield.component.spec.ts
@@ -8,9 +8,8 @@ describe('FormfieldComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ FormfieldComponent ]
-    })
-    .compileComponents();
+      declarations: [FormfieldComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shared/form-dialog/formfield/formfield.component.ts b/src/app/shared/form-dialog/formfield/formfield.component.ts
index b5df3f2c8..1bd9f7d92 100644
--- a/src/app/shared/form-dialog/formfield/formfield.component.ts
+++ b/src/app/shared/form-dialog/formfield/formfield.component.ts
@@ -9,10 +9,8 @@ import { FormfieldBase } from './model/formfield-base';
   styleUrls: ['./formfield.component.scss']
 })
 export class FormfieldComponent {
-
   @Input() form: UntypedFormGroup;
   @Input() formfield: FormfieldBase;
 
-  constructor() { }
-
+  constructor() {}
 }
diff --git a/src/app/shared/form-dialog/formfield/model/checkbox-base.ts b/src/app/shared/form-dialog/formfield/model/checkbox-base.ts
index 4dbb0da4a..4fee71c5d 100644
--- a/src/app/shared/form-dialog/formfield/model/checkbox-base.ts
+++ b/src/app/shared/form-dialog/formfield/model/checkbox-base.ts
@@ -1,10 +1,9 @@
 import { FormfieldBase } from './formfield-base';
 
 export class CheckboxBase extends FormfieldBase {
-    controlType = 'checkbox';
-
-    constructor(options: any) {
-        super(options);
-    }
+  controlType = 'checkbox';
 
+  constructor(options: any) {
+    super(options);
+  }
 }
diff --git a/src/app/shared/form-dialog/formfield/model/datepicker-base.ts b/src/app/shared/form-dialog/formfield/model/datepicker-base.ts
index 2c2404010..b522c406c 100644
--- a/src/app/shared/form-dialog/formfield/model/datepicker-base.ts
+++ b/src/app/shared/form-dialog/formfield/model/datepicker-base.ts
@@ -1,7 +1,6 @@
 import { FormfieldBase } from './formfield-base';
 
 export class DatepickerBase extends FormfieldBase {
-
   controlType = 'datepicker';
   minDate: Date;
   maxDate: Date;
@@ -11,5 +10,4 @@ export class DatepickerBase extends FormfieldBase {
     this.minDate = options['minDate'] || new Date(2000, 0, 1);
     this.maxDate = options['maxDate'] || new Date();
   }
-
 }
diff --git a/src/app/shared/form-dialog/formfield/model/datetimepicker-base.ts b/src/app/shared/form-dialog/formfield/model/datetimepicker-base.ts
index ae0a8cef7..cb6325fe8 100644
--- a/src/app/shared/form-dialog/formfield/model/datetimepicker-base.ts
+++ b/src/app/shared/form-dialog/formfield/model/datetimepicker-base.ts
@@ -1,7 +1,6 @@
 import { FormfieldBase } from './formfield-base';
 
 export class DateTimepickerBase extends FormfieldBase {
-
   controlType = 'datetimepicker';
   minDate: Date;
   maxDate: Date;
@@ -11,5 +10,4 @@ export class DateTimepickerBase extends FormfieldBase {
     this.minDate = options['minDate'] || new Date(2000, 0, 1);
     this.maxDate = options['maxDate'] || new Date();
   }
-
 }
diff --git a/src/app/shared/form-dialog/formfield/model/formfield-base.ts b/src/app/shared/form-dialog/formfield/model/formfield-base.ts
index 0078f2915..338f21f7e 100644
--- a/src/app/shared/form-dialog/formfield/model/formfield-base.ts
+++ b/src/app/shared/form-dialog/formfield/model/formfield-base.ts
@@ -1,5 +1,4 @@
 export class FormfieldBase {
-
   controlType: string;
   controlName: string;
   label: string;
@@ -7,20 +6,21 @@ export class FormfieldBase {
   required: boolean;
   order: number;
 
-  constructor(options: {
-              controlType?: string,
-              controlName?: string,
-              label?: string,
-              value?: any,
-              required?: boolean,
-              order?: number
-    } = {}) {
-      this.controlType = options.controlType || '';
-      this.controlName = options.controlName || '';
-      this.label = options.label || '';
-      this.value = options.value === undefined ? '' : options.value;
-      this.required = !!options.required;
-      this.order = options.order === undefined ? 1 : options.order;
+  constructor(
+    options: {
+      controlType?: string;
+      controlName?: string;
+      label?: string;
+      value?: any;
+      required?: boolean;
+      order?: number;
+    } = {}
+  ) {
+    this.controlType = options.controlType || '';
+    this.controlName = options.controlName || '';
+    this.label = options.label || '';
+    this.value = options.value === undefined ? '' : options.value;
+    this.required = !!options.required;
+    this.order = options.order === undefined ? 1 : options.order;
   }
-
 }
diff --git a/src/app/shared/form-dialog/formfield/model/input-base.ts b/src/app/shared/form-dialog/formfield/model/input-base.ts
index 5c728b875..38beffcf8 100644
--- a/src/app/shared/form-dialog/formfield/model/input-base.ts
+++ b/src/app/shared/form-dialog/formfield/model/input-base.ts
@@ -1,7 +1,6 @@
 import { FormfieldBase } from './formfield-base';
 
 export class InputBase extends FormfieldBase {
-
   controlType = 'input';
   type: string;
 
@@ -9,5 +8,4 @@ export class InputBase extends FormfieldBase {
     super(options);
     this.type = options['type'] || 'text';
   }
-
 }
diff --git a/src/app/shared/form-dialog/formfield/model/select-base.ts b/src/app/shared/form-dialog/formfield/model/select-base.ts
index fae07d6fd..f3bbe9823 100644
--- a/src/app/shared/form-dialog/formfield/model/select-base.ts
+++ b/src/app/shared/form-dialog/formfield/model/select-base.ts
@@ -1,17 +1,15 @@
 import { FormfieldBase } from './formfield-base';
 
 export class SelectBase extends FormfieldBase {
-
   controlType = 'select';
   options: {
-    label: string,
-    value: string,
-    data: {}[]
+    label: string;
+    value: string;
+    data: {}[];
   };
 
   constructor(options: {} = {}) {
     super(options);
     this.options = options['options'];
   }
-
 }
diff --git a/src/app/shared/icons.module.ts b/src/app/shared/icons.module.ts
index dcc1dc60f..55097fee6 100644
--- a/src/app/shared/icons.module.ts
+++ b/src/app/shared/icons.module.ts
@@ -123,7 +123,6 @@ import {
   exports: [FontAwesomeModule]
 })
 export class IconsModule {
-
   constructor(library: FaIconLibrary) {
     library.addIcons(
       faAnchor,
@@ -239,5 +238,4 @@ export class IconsModule {
       faTableCells
     );
   }
-
 }
diff --git a/src/app/shared/input-amount/input-amount.component.spec.ts b/src/app/shared/input-amount/input-amount.component.spec.ts
index c4ad83b5d..f71e275ed 100644
--- a/src/app/shared/input-amount/input-amount.component.spec.ts
+++ b/src/app/shared/input-amount/input-amount.component.spec.ts
@@ -8,9 +8,8 @@ describe('InputAmountComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ InputAmountComponent ]
-    })
-    .compileComponents();
+      declarations: [InputAmountComponent]
+    }).compileComponents();
 
     fixture = TestBed.createComponent(InputAmountComponent);
     component = fixture.componentInstance;
diff --git a/src/app/shared/input-amount/input-amount.component.ts b/src/app/shared/input-amount/input-amount.component.ts
index e87bcefd2..083befbee 100644
--- a/src/app/shared/input-amount/input-amount.component.ts
+++ b/src/app/shared/input-amount/input-amount.component.ts
@@ -8,7 +8,6 @@ import { UntypedFormControl } from '@angular/forms';
   styleUrls: ['./input-amount.component.scss']
 })
 export class InputAmountComponent {
-
   @Input() isRequired = false;
   @Input() currency: Currency;
   @Input() inputLabel: string;
@@ -16,10 +15,10 @@ export class InputAmountComponent {
 
   displayHint = false;
 
-  constructor() { }
+  constructor() {}
 
   numberOnly(event: any): boolean {
-    const charCode = (event.which) ? event.which : event.keyCode;
+    const charCode = event.which ? event.which : event.keyCode;
     if (charCode === 46) {
       if (!(this.inputFormControl.value.indexOf('.') > -1)) {
         return true;
@@ -38,5 +37,4 @@ export class InputAmountComponent {
   inputFocus(): void {
     this.displayHint = true;
   }
-
 }
diff --git a/src/app/shared/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.component.spec.ts b/src/app/shared/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.component.spec.ts
index d5fbea511..4b81580dc 100644
--- a/src/app/shared/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.component.spec.ts
+++ b/src/app/shared/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.component.spec.ts
@@ -8,9 +8,8 @@ describe('KeyboardShortcutsDialogComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ KeyboardShortcutsDialogComponent ]
-    })
-    .compileComponents();
+      declarations: [KeyboardShortcutsDialogComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shared/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.component.ts b/src/app/shared/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.component.ts
index d2e1ca1a5..4b2f0b4db 100644
--- a/src/app/shared/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.component.ts
+++ b/src/app/shared/keyboard-shortcuts-dialog/keyboard-shortcuts-dialog.component.ts
@@ -11,18 +11,16 @@ import { KeyboardShortcutsConfiguration } from '../../keyboards-shortcut-config'
   styleUrls: ['./keyboard-shortcuts-dialog.component.scss']
 })
 export class KeyboardShortcutsDialogComponent implements OnInit {
-
   buttonConfig: KeyboardShortcutsConfiguration;
 
   /**
    * @param {MatDialogRef} dialogRef Component reference to dialog.
    * @param {any} data Provides a deleteContext.
    */
-  constructor(public dialogRef: MatDialogRef) { }
+  constructor(public dialogRef: MatDialogRef) {}
 
   ngOnInit() {
     this.dialogRef.updateSize(`800px`);
     this.buttonConfig = new KeyboardShortcutsConfiguration();
   }
-
 }
diff --git a/src/app/shared/language-selector/language-selector.component.spec.ts b/src/app/shared/language-selector/language-selector.component.spec.ts
index 097465729..055c60f9e 100644
--- a/src/app/shared/language-selector/language-selector.component.spec.ts
+++ b/src/app/shared/language-selector/language-selector.component.spec.ts
@@ -8,9 +8,8 @@ describe('LanguageSelectorComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ LanguageSelectorComponent ]
-    })
-    .compileComponents();
+      declarations: [LanguageSelectorComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shared/language-selector/language-selector.component.ts b/src/app/shared/language-selector/language-selector.component.ts
index 0dab41409..bfbe4f609 100644
--- a/src/app/shared/language-selector/language-selector.component.ts
+++ b/src/app/shared/language-selector/language-selector.component.ts
@@ -18,7 +18,6 @@ import { SettingsService } from 'app/settings/settings.service';
   styleUrls: ['./language-selector.component.scss']
 })
 export class LanguageSelectorComponent {
-
   /** Language selector form control. */
   languageSelector = new UntypedFormControl();
 
@@ -26,8 +25,10 @@ export class LanguageSelectorComponent {
    * Sets the language of the application in the selector on initial setup.
    * @param {TranslateService} translateService Translate Service.
    */
-   constructor(private translateService: TranslateService,
-    private settingsService: SettingsService) {
+  constructor(
+    private translateService: TranslateService,
+    private settingsService: SettingsService
+  ) {
     this.languageSelector.setValue(this.currentLanguage);
   }
 
@@ -35,7 +36,7 @@ export class LanguageSelectorComponent {
    * Sets a new language to be used by the application.
    * @param {string} language New language.
    */
-   setLanguage() {
+  setLanguage() {
     this.translateService.use(this.languageSelector.value);
     this.settingsService.setLanguage({ name: '', code: this.languageSelector.value.substring(0, 2) });
   }
@@ -55,5 +56,4 @@ export class LanguageSelectorComponent {
   get languages(): string[] {
     return this.translateService.getLangs();
   }
-
 }
diff --git a/src/app/shared/long-text/long-text.component.html b/src/app/shared/long-text/long-text.component.html
index a8de75c1d..47ff2f21b 100644
--- a/src/app/shared/long-text/long-text.component.html
+++ b/src/app/shared/long-text/long-text.component.html
@@ -1,5 +1,7 @@
 
-  
+  
   {{ textValue | truncateText: printChars }}...
   {{ textValue }}
 
diff --git a/src/app/shared/long-text/long-text.component.spec.ts b/src/app/shared/long-text/long-text.component.spec.ts
index c3b27fd69..0a0a45a4b 100644
--- a/src/app/shared/long-text/long-text.component.spec.ts
+++ b/src/app/shared/long-text/long-text.component.spec.ts
@@ -8,9 +8,8 @@ describe('LongTextComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ LongTextComponent ]
-    })
-    .compileComponents();
+      declarations: [LongTextComponent]
+    }).compileComponents();
 
     fixture = TestBed.createComponent(LongTextComponent);
     component = fixture.componentInstance;
diff --git a/src/app/shared/long-text/long-text.component.ts b/src/app/shared/long-text/long-text.component.ts
index 8015c9a8c..2d739a6c2 100644
--- a/src/app/shared/long-text/long-text.component.ts
+++ b/src/app/shared/long-text/long-text.component.ts
@@ -16,10 +16,10 @@ export class LongTextComponent implements OnInit {
 
   printChars = 30;
 
-  constructor() { }
+  constructor() {}
 
   ngOnInit(): void {
-    this.emptyValue = (!this.textValue || this.textValue === '');
+    this.emptyValue = !this.textValue || this.textValue === '';
     this.printChars = this.chars;
   }
 
@@ -27,7 +27,7 @@ export class LongTextComponent implements OnInit {
     if (this.textValue == null) {
       return false;
     }
-    return (this.textValue.length > 25);
+    return this.textValue.length > 25;
   }
 
   showValue() {
diff --git a/src/app/shared/material.module.ts b/src/app/shared/material.module.ts
index 0b1b8ed82..53fd8f395 100644
--- a/src/app/shared/material.module.ts
+++ b/src/app/shared/material.module.ts
@@ -84,7 +84,7 @@ import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
     MatToolbarModule,
     MatTooltipModule,
     MatTreeModule,
-    MatBadgeModule,
+    MatBadgeModule
   ],
   providers: [
     {
@@ -100,4 +100,4 @@ import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
     }
   ]
 })
-export class MaterialModule { }
+export class MaterialModule {}
diff --git a/src/app/shared/models/general.model.ts b/src/app/shared/models/general.model.ts
index 5f4ec780a..13c04c983 100644
--- a/src/app/shared/models/general.model.ts
+++ b/src/app/shared/models/general.model.ts
@@ -1,48 +1,48 @@
 import { OptionData } from './option-data.model';
 
 export interface Currency {
-  code:           string;
-  name:           string;
+  code: string;
+  name: string;
   decimalPlaces?: number;
   inMultiplesOf?: number;
   displaySymbol?: string;
-  nameCode?:      string;
-  displayLabel?:  string;
+  nameCode?: string;
+  displayLabel?: string;
 }
 
 export interface GLAccount {
-  id:                     number;
-  name:                   string;
-  glCode:                 string;
-  description:            string;
-  nameDecorated?:         string;
-  disabled:               boolean;
-  manualEntriesAllowed:   boolean;
-  type:                   OptionData;
-  usage:                  OptionData;
-  parentId?:              number;
+  id: number;
+  name: string;
+  glCode: string;
+  description: string;
+  nameDecorated?: string;
+  disabled: boolean;
+  manualEntriesAllowed: boolean;
+  type: OptionData;
+  usage: OptionData;
+  parentId?: number;
 }
 
 export interface AccountingMapping {
-  id:     number;
-  name:   string;
+  id: number;
+  name: string;
   glCode: string;
 }
 
 export interface ChargeToIncomeAccountMapping {
-  charge:          Charge;
-  incomeAccount:   AccountingMapping;
+  charge: Charge;
+  incomeAccount: AccountingMapping;
 }
 
 export interface PaymentChannelToFundSourceMapping {
-  paymentType:       PaymentType;
+  paymentType: PaymentType;
   fundSourceAccount: AccountingMapping;
 }
 
 export interface ChargeOffReasonToExpenseAccountMapping {
   chargeOffReasonCodeValueId?: number;
-  expenseAccountId? : number;
-  chargeOffReasonCodeValue?:  ChargeOffReasonCodeValue;
+  expenseAccountId?: number;
+  chargeOffReasonCodeValue?: ChargeOffReasonCodeValue;
   expenseAccount?: AccountingMapping;
 }
 
@@ -56,34 +56,34 @@ export interface ChargeOffReasonCodeValue {
 }
 
 export interface PaymentType {
-  id:              number;
-  name:            string;
+  id: number;
+  name: string;
   isSystemDefined: boolean;
 }
 
 export interface PaymentTypeOption {
-  id:              number;
-  name:            string;
-  description:     string;
-  isCashPayment:   boolean;
+  id: number;
+  name: string;
+  description: string;
+  isCashPayment: boolean;
   isSystemDefined: boolean;
-  position:        number;
+  position: number;
 }
 
 export interface Charge {
-  id:                             number;
-  name:                           string;
-  active?:                        boolean;
-  penalty:                        boolean;
-  freeWithdrawal?:                boolean;
+  id: number;
+  name: string;
+  active?: boolean;
+  penalty: boolean;
+  freeWithdrawal?: boolean;
   freeWithdrawalChargeFrequency?: number;
-  restartFrequency?:              number;
-  restartFrequencyEnum?:          number;
-  isPaymentType?:                 boolean;
-  currency?:                      Currency;
-  amount?:                        number;
-  chargeTimeType?:                OptionData;
-  chargeAppliesTo?:               OptionData;
-  chargeCalculationType?:         OptionData;
-  chargePaymentMode?:             OptionData;
+  restartFrequency?: number;
+  restartFrequencyEnum?: number;
+  isPaymentType?: boolean;
+  currency?: Currency;
+  amount?: number;
+  chargeTimeType?: OptionData;
+  chargeAppliesTo?: OptionData;
+  chargeCalculationType?: OptionData;
+  chargePaymentMode?: OptionData;
 }
diff --git a/src/app/shared/notifications-tray/notifications-tray.component.spec.ts b/src/app/shared/notifications-tray/notifications-tray.component.spec.ts
index 8aa1b36fc..ec5e035eb 100644
--- a/src/app/shared/notifications-tray/notifications-tray.component.spec.ts
+++ b/src/app/shared/notifications-tray/notifications-tray.component.spec.ts
@@ -8,9 +8,8 @@ describe('NotificationsTrayComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ NotificationsTrayComponent ]
-    })
-    .compileComponents();
+      declarations: [NotificationsTrayComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shared/notifications-tray/notifications-tray.component.ts b/src/app/shared/notifications-tray/notifications-tray.component.ts
index 37529d621..5bbe68068 100644
--- a/src/app/shared/notifications-tray/notifications-tray.component.ts
+++ b/src/app/shared/notifications-tray/notifications-tray.component.ts
@@ -34,24 +34,25 @@ export class NotificationsTrayComponent implements OnInit, OnDestroy {
    * Shares, Savings, Deposits, Loans routes inaccessible because of dependency on entity ID.
    */
   routeMap: any = {
-    'client' : '/clients/',
-    'group' : '/groups/',
-    'loan': '/loans-accounts/',
-    'center' : '/centers/',
-    'shareAccount' : '/shares-accounts/',
-    'fixedDeposit' : '/fixed-deposits-accounts/',
-    'recurringDepositAccount': '/recurring-deposits-accounts/',
-    'savingsAccount' : '/savings-accounts/',
-    'shareProduct': '/products/share-products/',
-    'loanProduct' : '/products/loan-products/'
+    client: '/clients/',
+    group: '/groups/',
+    loan: '/loans-accounts/',
+    center: '/centers/',
+    shareAccount: '/shares-accounts/',
+    fixedDeposit: '/fixed-deposits-accounts/',
+    recurringDepositAccount: '/recurring-deposits-accounts/',
+    savingsAccount: '/savings-accounts/',
+    shareProduct: '/products/share-products/',
+    loanProduct: '/products/loan-products/'
   };
 
   /**
    * @param {NotificationsService} notificationsService Notifications Service
    */
   constructor(public notificationsService: NotificationsService) {
-    forkJoin([this.notificationsService.getNotifications(true, 9), this.notificationsService.getNotifications(false, 9)])
-    .subscribe((response: any[]) => {
+    forkJoin([
+      this.notificationsService.getNotifications(true, 9),
+      this.notificationsService.getNotifications(false, 9)]).subscribe((response: any[]) => {
       this.readNotifications = response[0].pageItems;
       this.unreadNotifications = response[1].pageItems;
       this.setNotifications();
@@ -83,7 +84,9 @@ export class NotificationsTrayComponent implements OnInit, OnDestroy {
       this.setNotifications();
     });
     // this.mockNotifications(); // Uncomment for Testing.
-    this.timer = setTimeout(() => { this.fetchUnreadNotifications(); }, this.waitTime * 1000);
+    this.timer = setTimeout(() => {
+      this.fetchUnreadNotifications();
+    }, this.waitTime * 1000);
   }
 
   /**
@@ -107,5 +110,4 @@ export class NotificationsTrayComponent implements OnInit, OnDestroy {
       this.setNotifications();
     });
   }
-
 }
diff --git a/src/app/shared/search-tool/search-tool.component.spec.ts b/src/app/shared/search-tool/search-tool.component.spec.ts
index 1359ef779..0544af1b7 100644
--- a/src/app/shared/search-tool/search-tool.component.spec.ts
+++ b/src/app/shared/search-tool/search-tool.component.spec.ts
@@ -8,9 +8,8 @@ describe('SearchToolComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ SearchToolComponent ]
-    })
-    .compileComponents();
+      declarations: [SearchToolComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shared/search-tool/search-tool.component.ts b/src/app/shared/search-tool/search-tool.component.ts
index ce7991df9..36300b53a 100644
--- a/src/app/shared/search-tool/search-tool.component.ts
+++ b/src/app/shared/search-tool/search-tool.component.ts
@@ -15,16 +15,15 @@ import { UntypedFormControl } from '@angular/forms';
     trigger('fadeInOut', [
       transition(':enter', [
         style({ opacity: 0 }),
-        animate(500, style({ opacity: 1 }))
-      ]),
+        animate(500, style({ opacity: 1 }))]),
       transition(':leave', [
-        animate(500, style({ opacity: 0 }))
-      ])
+        animate(500, style({ opacity: 0 }))])
+
     ])
+
   ]
 })
 export class SearchToolComponent {
-
   /** Query Form Control */
   query = new UntypedFormControl('');
   /** Resource Form Control */
@@ -57,7 +56,7 @@ export class SearchToolComponent {
     {
       name: 'Loans',
       value: 'loans'
-    },
+    }
   ];
 
   /**
@@ -84,5 +83,4 @@ export class SearchToolComponent {
     };
     this.router.navigate(['/search'], { queryParams: queryParams });
   }
-
 }
diff --git a/src/app/shared/server-selector/server-selector.component.spec.ts b/src/app/shared/server-selector/server-selector.component.spec.ts
index a28a27db5..9d73aee49 100644
--- a/src/app/shared/server-selector/server-selector.component.spec.ts
+++ b/src/app/shared/server-selector/server-selector.component.spec.ts
@@ -8,9 +8,8 @@ describe('ServerSelectorComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ServerSelectorComponent ]
-    })
-    .compileComponents();
+      declarations: [ServerSelectorComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shared/server-selector/server-selector.component.ts b/src/app/shared/server-selector/server-selector.component.ts
index f5ef073a3..5d1d4d9c2 100644
--- a/src/app/shared/server-selector/server-selector.component.ts
+++ b/src/app/shared/server-selector/server-selector.component.ts
@@ -14,9 +14,7 @@ import { SettingsService } from 'app/settings/settings.service';
   templateUrl: './server-selector.component.html',
   styleUrls: ['./server-selector.component.scss']
 })
-
 export class ServerSelectorComponent implements OnInit {
-
   /** Input server. */
   form: any;
 
@@ -24,7 +22,7 @@ export class ServerSelectorComponent implements OnInit {
   servers: string[];
 
   /** Server Setting */
-  serverSelector =  new UntypedFormControl('');
+  serverSelector = new UntypedFormControl('');
 
   /** Server list to show */
   existMoreThanOneServer = false;
@@ -32,20 +30,25 @@ export class ServerSelectorComponent implements OnInit {
   /**
    * @param {SettingsService} settingsService Settings Service
    */
-  constructor(private settingsService: SettingsService,
+  constructor(
+    private settingsService: SettingsService,
     public dialog: MatDialog,
-    private formBuilder: UntypedFormBuilder) { }
+    private formBuilder: UntypedFormBuilder
+  ) {}
 
   ngOnInit(): void {
     this.servers = this.settingsService.servers;
-    this.existMoreThanOneServer = (this.servers && this.servers.length > 1);
+    this.existMoreThanOneServer = this.servers && this.servers.length > 1;
     if (!this.existMoreThanOneServer) {
       this.settingsService.setServer(this.servers[0]);
     } else {
       this.existMoreThanOneServer = true;
       this.serverSelector.patchValue(this.settingsService.server);
       this.form = this.formBuilder.group({
-        'url': ['', [Validators.required]],
+        url: [
+          '',
+          [Validators.required]
+        ]
       });
     }
   }
@@ -57,7 +60,6 @@ export class ServerSelectorComponent implements OnInit {
     this.settingsService.setServer(this.serverSelector.value);
   }
 
-
   /**
    * Add new server to the list.
    */
@@ -69,5 +71,4 @@ export class ServerSelectorComponent implements OnInit {
     this.settingsService.setServers(servers);
     window.location.reload();
   }
-
 }
diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts
index dda0153e0..1ce645c2a 100644
--- a/src/app/shared/shared.module.ts
+++ b/src/app/shared/shared.module.ts
@@ -144,4 +144,4 @@ import { InputAmountComponent } from './input-amount/input-amount.component';
     InputAmountComponent
   ]
 })
-export class SharedModule { }
+export class SharedModule {}
diff --git a/src/app/shared/steppers/stepper-buttons/stepper-buttons.component.spec.ts b/src/app/shared/steppers/stepper-buttons/stepper-buttons.component.spec.ts
index 77d17703f..5758cd08f 100644
--- a/src/app/shared/steppers/stepper-buttons/stepper-buttons.component.spec.ts
+++ b/src/app/shared/steppers/stepper-buttons/stepper-buttons.component.spec.ts
@@ -8,9 +8,8 @@ describe('StepperButtonsComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ StepperButtonsComponent ]
-    })
-    .compileComponents();
+      declarations: [StepperButtonsComponent]
+    }).compileComponents();
 
     fixture = TestBed.createComponent(StepperButtonsComponent);
     component = fixture.componentInstance;
diff --git a/src/app/shared/steppers/stepper-buttons/stepper-buttons.component.ts b/src/app/shared/steppers/stepper-buttons/stepper-buttons.component.ts
index cb4eb57a8..7f5b76e13 100644
--- a/src/app/shared/steppers/stepper-buttons/stepper-buttons.component.ts
+++ b/src/app/shared/steppers/stepper-buttons/stepper-buttons.component.ts
@@ -6,10 +6,8 @@ import { Component, Input, OnInit } from '@angular/core';
   styleUrls: ['./stepper-buttons.component.scss']
 })
 export class StepperButtonsComponent {
-
   @Input() disablePrevious = false;
   @Input() disableNext = false;
 
-  constructor() { }
-
+  constructor() {}
 }
diff --git a/src/app/shared/svg-icon/svg-icon.component.spec.ts b/src/app/shared/svg-icon/svg-icon.component.spec.ts
index f4276b578..381c2dcf9 100644
--- a/src/app/shared/svg-icon/svg-icon.component.spec.ts
+++ b/src/app/shared/svg-icon/svg-icon.component.spec.ts
@@ -8,9 +8,8 @@ describe('SvgIconComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ SvgIconComponent ]
-    })
-    .compileComponents();
+      declarations: [SvgIconComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/shared/svg-icon/svg-icon.component.ts b/src/app/shared/svg-icon/svg-icon.component.ts
index 72f5c640c..fa67bffea 100644
--- a/src/app/shared/svg-icon/svg-icon.component.ts
+++ b/src/app/shared/svg-icon/svg-icon.component.ts
@@ -11,6 +11,5 @@ export class SvgIconComponent {
   @Input() iconClass: string;
   @Input() iconWidth: string;
 
-  constructor() { }
-
+  constructor() {}
 }
diff --git a/src/app/shared/tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component.spec.ts b/src/app/shared/tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component.spec.ts
index 535462c21..d4f943f6f 100644
--- a/src/app/shared/tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component.spec.ts
+++ b/src/app/shared/tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component.spec.ts
@@ -8,9 +8,8 @@ describe('DatatableMultiRowComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ DatatableMultiRowComponent ]
-    })
-    .compileComponents();
+      declarations: [DatatableMultiRowComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/shared/tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component.ts b/src/app/shared/tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component.ts
index 068d74f1c..27bf48ff5 100644
--- a/src/app/shared/tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component.ts
+++ b/src/app/shared/tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component.ts
@@ -22,7 +22,6 @@ import * as _ from 'lodash';
   styleUrls: ['./datatable-multi-row.component.scss']
 })
 export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges {
-
   SELECT_NAME_FIELD = 'select';
   /** Data Object */
   @Input() dataObject: any;
@@ -55,15 +54,17 @@ export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges
    * @param {MatDialog} dialog Mat Dialog.
    * @param {Datatables} datatables Datatable utils
    */
-  constructor(private route: ActivatedRoute,
-              private dateUtils: Dates,
-              private systemService: SystemService,
-              private settingsService: SettingsService,
-              private dialog: MatDialog,
-              private datatables: Datatables,
-              private dateFormat: DateFormatPipe,
-              private dateTimeFormat: DatetimeFormatPipe,
-              private numberFormat: DecimalPipe) { }
+  constructor(
+    private route: ActivatedRoute,
+    private dateUtils: Dates,
+    private systemService: SystemService,
+    private settingsService: SettingsService,
+    private dialog: MatDialog,
+    private datatables: Datatables,
+    private dateFormat: DateFormatPipe,
+    private dateTimeFormat: DatetimeFormatPipe,
+    private numberFormat: DecimalPipe
+  ) {}
 
   /**
    * Fetches data table name from route params.
@@ -117,7 +118,7 @@ export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges
       }
       this.isSelected = false;
       this.isLoading = false;
-     });
+    });
   }
 
   /**
@@ -127,7 +128,11 @@ export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges
     let dataTableEntryObject: any = { locale: this.settingsService.language.code };
     const dateTransformColumns: string[] = [];
     const columns = this.datatables.filterSystemColumns(this.dataObject.columnHeaders);
-    const formfields: FormfieldBase[] = this.datatables.getFormfields(columns, dateTransformColumns, dataTableEntryObject);
+    const formfields: FormfieldBase[] = this.datatables.getFormfields(
+      columns,
+      dateTransformColumns,
+      dataTableEntryObject
+    );
     const data = {
       title: 'Add ' + this.datatableName + ' for ' + this.entityType,
       formfields: formfields
@@ -136,12 +141,17 @@ export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges
     addDialogRef.afterClosed().subscribe((response: any) => {
       if (response.data) {
         dateTransformColumns.forEach((column) => {
-          response.data.value[column] = this.dateUtils.formatDate(response.data.value[column], dataTableEntryObject.dateFormat);
+          response.data.value[column] = this.dateUtils.formatDate(
+            response.data.value[column],
+            dataTableEntryObject.dateFormat
+          );
         });
         dataTableEntryObject = { ...response.data.value, ...dataTableEntryObject };
-        this.systemService.addEntityDatatableEntry(this.entityId, this.datatableName, dataTableEntryObject).subscribe((result: any) => {
-          this.getData();
-        });
+        this.systemService
+          .addEntityDatatableEntry(this.entityId, this.datatableName, dataTableEntryObject)
+          .subscribe((result: any) => {
+            this.getData();
+          });
       }
     });
   }
@@ -179,14 +189,14 @@ export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges
                 this.datatableData.splice(index, 1);
                 this.dataTableRef.renderRows();
                 this.selection = new SelectionModel(true, []);
-                this.isSelected = (this.selection.selected.length > 0);
+                this.isSelected = this.selection.selected.length > 0;
               }
             });
           });
         });
       } else {
         this.selection = new SelectionModel(true, []);
-        this.isSelected = (this.selection.selected.length > 0);
+        this.isSelected = this.selection.selected.length > 0;
       }
     });
   }
@@ -219,11 +229,11 @@ export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges
   /** Whether the number of selected elements matches the total number of rows. */
   isAllSelected() {
     const numSelected = this.selection.selected;
-    return (this.datatableData.length === numSelected);
+    return this.datatableData.length === numSelected;
   }
 
   isAnySelected() {
-    return (this.selection.selected && this.selection.selected.length > 0);
+    return this.selection.selected && this.selection.selected.length > 0;
   }
 
   /** Selects all rows if they are not all selected; otherwise clear selection. */
@@ -233,12 +243,12 @@ export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges
     } else {
       this.selection = new SelectionModel(true, []);
     }
-    this.isSelected = (this.selection.selected.length > 0);
+    this.isSelected = this.selection.selected.length > 0;
   }
 
   itemToggle(data: any): void {
     this.selection.toggle(data);
-    this.isSelected = (this.selection.selected.length > 0);
+    this.isSelected = this.selection.selected.length > 0;
   }
 
   /** The label for the checkbox on the passed row */
@@ -259,5 +269,4 @@ export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges
   getInputName(attr: string): string {
     return this.datatables.getName(attr);
   }
-
 }
diff --git a/src/app/shared/tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component.spec.ts b/src/app/shared/tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component.spec.ts
index 46694a012..65816a129 100644
--- a/src/app/shared/tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component.spec.ts
+++ b/src/app/shared/tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component.spec.ts
@@ -8,9 +8,8 @@ describe('DatatableSingleRowComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ DatatableSingleRowComponent ]
-    })
-    .compileComponents();
+      declarations: [DatatableSingleRowComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/shared/tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component.ts b/src/app/shared/tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component.ts
index 18555f17d..4447a7025 100644
--- a/src/app/shared/tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component.ts
+++ b/src/app/shared/tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component.ts
@@ -15,7 +15,6 @@ import { SystemService } from 'app/system/system.service';
   styleUrls: ['./datatable-single-row.component.scss']
 })
 export class DatatableSingleRowComponent implements OnInit {
-
   @Input() dataObject: any;
   @Input() entityId: string;
   @Input() entityType: string;
@@ -28,12 +27,14 @@ export class DatatableSingleRowComponent implements OnInit {
    * @param {SettingsService} settingsService Settings Service
    * @param {Datatables} datatables Datatable utils
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private dateUtils: Dates,
     private dialog: MatDialog,
     private settingsService: SettingsService,
     private datatables: Datatables,
-    private systemService: SystemService) { }
+    private systemService: SystemService
+  ) {}
 
   ngOnInit() {
     this.route.params.subscribe((routeParams: any) => {
@@ -47,7 +48,11 @@ export class DatatableSingleRowComponent implements OnInit {
     };
     const dateTransformColumns: string[] = [];
     const columns = this.datatables.filterSystemColumns(this.dataObject.columnHeaders);
-    const formfields: FormfieldBase[] = this.datatables.getFormfields(columns, dateTransformColumns, dataTableEntryObject);
+    const formfields: FormfieldBase[] = this.datatables.getFormfields(
+      columns,
+      dateTransformColumns,
+      dataTableEntryObject
+    );
     const data = {
       title: 'Add ' + this.datatableName + ' for ' + this.entityType,
       formfields: formfields
@@ -56,14 +61,19 @@ export class DatatableSingleRowComponent implements OnInit {
     addDialogRef.afterClosed().subscribe((response: any) => {
       if (response.data) {
         dateTransformColumns.forEach((column) => {
-          response.data.value[column] = this.dateUtils.formatDate(response.data.value[column], dataTableEntryObject.dateFormat);
+          response.data.value[column] = this.dateUtils.formatDate(
+            response.data.value[column],
+            dataTableEntryObject.dateFormat
+          );
         });
         dataTableEntryObject = { ...response.data.value, ...dataTableEntryObject };
-        this.systemService.addEntityDatatableEntry(this.entityId, this.datatableName, dataTableEntryObject).subscribe(() => {
-          this.systemService.getEntityDatatable(this.entityId, this.datatableName).subscribe((dataObject: any) => {
-            this.dataObject = dataObject;
+        this.systemService
+          .addEntityDatatableEntry(this.entityId, this.datatableName, dataTableEntryObject)
+          .subscribe(() => {
+            this.systemService.getEntityDatatable(this.entityId, this.datatableName).subscribe((dataObject: any) => {
+              this.dataObject = dataObject;
+            });
           });
-        });
       }
     });
   }
@@ -74,34 +84,49 @@ export class DatatableSingleRowComponent implements OnInit {
     };
     const dateTransformColumns: string[] = [];
     const columns = this.datatables.filterSystemColumns(this.dataObject.columnHeaders);
-    let formfields: FormfieldBase[] = this.datatables.getFormfields(columns, dateTransformColumns, dataTableEntryObject);
+    let formfields: FormfieldBase[] = this.datatables.getFormfields(
+      columns,
+      dateTransformColumns,
+      dataTableEntryObject
+    );
     formfields = formfields.map((formfield: FormfieldBase, index: number) => {
       if (formfield.controlType === 'datepicker') {
-        formfield.value = (this.dataObject.data[0].row[columns[index].idx]) ? this.dateUtils.parseDate(this.dataObject.data[0].row[columns[index].idx]) : '';
+        formfield.value = this.dataObject.data[0].row[columns[index].idx]
+          ? this.dateUtils.parseDate(this.dataObject.data[0].row[columns[index].idx])
+          : '';
       } else if (formfield.controlType === 'datetimepicker') {
-        formfield.value = (this.dataObject.data[0].row[columns[index].idx]) ? this.dateUtils.parseDatetime(this.dataObject.data[0].row[columns[index].idx]) : '';
+        formfield.value = this.dataObject.data[0].row[columns[index].idx]
+          ? this.dateUtils.parseDatetime(this.dataObject.data[0].row[columns[index].idx])
+          : '';
       } else {
-        formfield.value = (this.dataObject.data[0].row[columns[index].idx]) ? this.dataObject.data[0].row[columns[index].idx] : '';
+        formfield.value = this.dataObject.data[0].row[columns[index].idx]
+          ? this.dataObject.data[0].row[columns[index].idx]
+          : '';
       }
       return formfield;
     });
     const data = {
       title: 'Edit ' + this.datatableName + ' for ' + this.entityType,
       formfields: formfields,
-      layout: {addButtonText: 'Save'}
+      layout: { addButtonText: 'Save' }
     };
     const editDialogRef = this.dialog.open(FormDialogComponent, { data, width: '50rem' });
     editDialogRef.afterClosed().subscribe((response: any) => {
       if (response.data) {
         dateTransformColumns.forEach((column) => {
-          response.data.value[column] = this.dateUtils.formatDate(response.data.value[column], dataTableEntryObject.dateFormat);
+          response.data.value[column] = this.dateUtils.formatDate(
+            response.data.value[column],
+            dataTableEntryObject.dateFormat
+          );
         });
         dataTableEntryObject = { ...response.data.value, ...dataTableEntryObject };
-        this.systemService.editEntityDatatableEntry(this.entityId, this.datatableName, dataTableEntryObject).subscribe(() => {
-          this.systemService.getEntityDatatable(this.entityId, this.datatableName).subscribe((dataObject: any) => {
-            this.dataObject = dataObject;
+        this.systemService
+          .editEntityDatatableEntry(this.entityId, this.datatableName, dataTableEntryObject)
+          .subscribe(() => {
+            this.systemService.getEntityDatatable(this.entityId, this.datatableName).subscribe((dataObject: any) => {
+              this.dataObject = dataObject;
+            });
           });
-        });
       }
     });
   }
@@ -112,13 +137,12 @@ export class DatatableSingleRowComponent implements OnInit {
     });
     deleteDataTableDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
-        this.systemService.deleteDatatableContent(this.entityId, this.datatableName)
-          .subscribe(() => {
-            this.systemService.getEntityDatatable(this.entityId, this.datatableName).subscribe((dataObject: any) => {
-              this.dataObject = dataObject;
-            });
+        this.systemService.deleteDatatableContent(this.entityId, this.datatableName).subscribe(() => {
+          this.systemService.getEntityDatatable(this.entityId, this.datatableName).subscribe((dataObject: any) => {
+            this.dataObject = dataObject;
           });
-        }
+        });
+      }
     });
   }
 
@@ -167,5 +191,4 @@ export class DatatableSingleRowComponent implements OnInit {
   openSite(siteUrl: string) {
     window.open(siteUrl, '_blank');
   }
-
 }
diff --git a/src/app/shared/tabs/entity-datatable-tab/entity-datatable-tab.component.spec.ts b/src/app/shared/tabs/entity-datatable-tab/entity-datatable-tab.component.spec.ts
index 009153760..bfdb2a3df 100644
--- a/src/app/shared/tabs/entity-datatable-tab/entity-datatable-tab.component.spec.ts
+++ b/src/app/shared/tabs/entity-datatable-tab/entity-datatable-tab.component.spec.ts
@@ -8,9 +8,8 @@ describe('EntityDatatableTabComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ EntityDatatableTabComponent ]
-    })
-    .compileComponents();
+      declarations: [EntityDatatableTabComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/shared/tabs/entity-datatable-tab/entity-datatable-tab.component.ts b/src/app/shared/tabs/entity-datatable-tab/entity-datatable-tab.component.ts
index cb22264a9..2128a65f6 100644
--- a/src/app/shared/tabs/entity-datatable-tab/entity-datatable-tab.component.ts
+++ b/src/app/shared/tabs/entity-datatable-tab/entity-datatable-tab.component.ts
@@ -6,12 +6,10 @@ import { Component, Input } from '@angular/core';
   styleUrls: ['./entity-datatable-tab.component.scss']
 })
 export class EntityDatatableTabComponent {
-
   @Input() multiRowDatatableFlag = false;
   @Input() entityDatatable: any;
   @Input() entityType: string;
   @Input() entityId: string;
 
-  constructor() { }
-
+  constructor() {}
 }
diff --git a/src/app/shared/tabs/entity-documents-tab/entity-documents-tab.component.spec.ts b/src/app/shared/tabs/entity-documents-tab/entity-documents-tab.component.spec.ts
index 2db427eec..d4ec0dc61 100644
--- a/src/app/shared/tabs/entity-documents-tab/entity-documents-tab.component.spec.ts
+++ b/src/app/shared/tabs/entity-documents-tab/entity-documents-tab.component.spec.ts
@@ -8,9 +8,8 @@ describe('EntityDocumentsTabComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ EntityDocumentsTabComponent ]
-    })
-    .compileComponents();
+      declarations: [EntityDocumentsTabComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/shared/tabs/entity-documents-tab/entity-documents-tab.component.ts b/src/app/shared/tabs/entity-documents-tab/entity-documents-tab.component.ts
index 8d9254f01..14360399e 100644
--- a/src/app/shared/tabs/entity-documents-tab/entity-documents-tab.component.ts
+++ b/src/app/shared/tabs/entity-documents-tab/entity-documents-tab.component.ts
@@ -32,7 +32,12 @@ export class EntityDocumentsTabComponent implements OnInit {
   choice: boolean;
 
   /** Columns to be displayed in loan documents table. */
-  displayedColumns: string[] = ['name', 'description', 'filename', 'actions'];
+  displayedColumns: string[] = [
+    'name',
+    'description',
+    'filename',
+    'actions'
+  ];
   /** Data source for loan documents table. */
   dataSource: MatTableDataSource;
 
@@ -48,10 +53,12 @@ export class EntityDocumentsTabComponent implements OnInit {
    * @param {LoansService} loansService Loan Account services.
    * @param {ClientsService} clientsService Client services.
    */
-  constructor(public dialog: MatDialog,
+  constructor(
+    public dialog: MatDialog,
     private savingsService: SavingsService,
     private loansService: LoansService,
-    private clientsService: ClientsService) { }
+    private clientsService: ClientsService
+  ) {}
 
   ngOnInit() {
     this.dataSource = new MatTableDataSource(this.entityDocuments);
@@ -69,7 +76,7 @@ export class EntityDocumentsTabComponent implements OnInit {
     });
     uploadDocumentDialogRef.afterClosed().subscribe((dialogResponse: any) => {
       if (dialogResponse) {
-        const formData: FormData = new FormData;
+        const formData: FormData = new FormData();
         formData.append('name', dialogResponse.fileName);
         formData.append('file', dialogResponse.file);
         formData.append('description', dialogResponse.description);
@@ -104,5 +111,4 @@ export class EntityDocumentsTabComponent implements OnInit {
       }
     });
   }
-
 }
diff --git a/src/app/shared/tabs/entity-notes-tab/entity-notes-tab.component.spec.ts b/src/app/shared/tabs/entity-notes-tab/entity-notes-tab.component.spec.ts
index 975aadeb4..264fd4e7c 100644
--- a/src/app/shared/tabs/entity-notes-tab/entity-notes-tab.component.spec.ts
+++ b/src/app/shared/tabs/entity-notes-tab/entity-notes-tab.component.spec.ts
@@ -8,9 +8,8 @@ describe('EntityNotesTabComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ EntityNotesTabComponent ]
-    })
-    .compileComponents();
+      declarations: [EntityNotesTabComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/shared/tabs/entity-notes-tab/entity-notes-tab.component.ts b/src/app/shared/tabs/entity-notes-tab/entity-notes-tab.component.ts
index 3718a8e60..b4861f6f5 100644
--- a/src/app/shared/tabs/entity-notes-tab/entity-notes-tab.component.ts
+++ b/src/app/shared/tabs/entity-notes-tab/entity-notes-tab.component.ts
@@ -14,7 +14,6 @@ import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.componen
   styleUrls: ['./entity-notes-tab.component.scss']
 })
 export class EntityNotesTabComponent implements OnInit {
-
   @ViewChild('formRef', { static: true }) formRef: any;
 
   @Input() entityId: string;
@@ -26,12 +25,14 @@ export class EntityNotesTabComponent implements OnInit {
 
   noteForm: UntypedFormGroup;
 
-  constructor(private formBuilder: UntypedFormBuilder,
+  constructor(
+    private formBuilder: UntypedFormBuilder,
     private savingsService: SavingsService,
     private loansService: LoansService,
     private clientsService: ClientsService,
     private groupsService: GroupsService,
-    private dialog: MatDialog) { }
+    private dialog: MatDialog
+  ) {}
 
   ngOnInit() {
     this.createNoteForm();
@@ -39,7 +40,10 @@ export class EntityNotesTabComponent implements OnInit {
 
   createNoteForm() {
     this.noteForm = this.formBuilder.group({
-      'note': ['', Validators.required]
+      note: [
+        '',
+        Validators.required
+      ]
     });
   }
 
@@ -50,19 +54,22 @@ export class EntityNotesTabComponent implements OnInit {
 
   editNote(noteId: string, noteContent: string, index: number) {
     const editNoteDialogRef = this.dialog.open(FormDialogComponent, {
-      data: { formfields: [{
-                controlName: 'note',
-                required: true,
-                value: noteContent,
-                controlType: 'input',
-                label: 'Note'
-              }],
-              layout: {
-                columns: 1,
-                addButtonText: 'Confirm'
-              },
-              title: 'Edit Note'
-            }
+      data: {
+        formfields: [
+          {
+            controlName: 'note',
+            required: true,
+            value: noteContent,
+            controlType: 'input',
+            label: 'Note'
+          }
+        ],
+        layout: {
+          columns: 1,
+          addButtonText: 'Confirm'
+        },
+        title: 'Edit Note'
+      }
     });
     editNoteDialogRef.afterClosed().subscribe((response: any) => {
       if (response.data && response.data.value.note !== noteContent) {
@@ -81,5 +88,4 @@ export class EntityNotesTabComponent implements OnInit {
       }
     });
   }
-
 }
diff --git a/src/app/shared/tenant-selector/tenant-selector.component.spec.ts b/src/app/shared/tenant-selector/tenant-selector.component.spec.ts
index e590f21a7..bdb9d89e3 100644
--- a/src/app/shared/tenant-selector/tenant-selector.component.spec.ts
+++ b/src/app/shared/tenant-selector/tenant-selector.component.spec.ts
@@ -8,9 +8,8 @@ describe('TenantSelectorComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ TenantSelectorComponent ]
-    })
-    .compileComponents();
+      declarations: [TenantSelectorComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/shared/tenant-selector/tenant-selector.component.ts b/src/app/shared/tenant-selector/tenant-selector.component.ts
index 829b9193a..5723ebd1d 100644
--- a/src/app/shared/tenant-selector/tenant-selector.component.ts
+++ b/src/app/shared/tenant-selector/tenant-selector.component.ts
@@ -8,7 +8,6 @@ import { SettingsService } from 'app/settings/settings.service';
   styleUrls: ['./tenant-selector.component.scss']
 })
 export class TenantSelectorComponent implements OnInit {
-
   /** Tenant selector form control. */
   tenantSelector = new UntypedFormControl();
 
@@ -16,7 +15,7 @@ export class TenantSelectorComponent implements OnInit {
    * Sets the Tenant Identifier of the application in the selector on initial setup.
    * @param {SettingsService} settingsService Settings Service.
    */
-  constructor(private settingsService: SettingsService) { }
+  constructor(private settingsService: SettingsService) {}
 
   ngOnInit(): void {
     this.tenantSelector.setValue(this.settingsService.tenantIdentifier);
@@ -35,7 +34,6 @@ export class TenantSelectorComponent implements OnInit {
   }
 
   allowSelection(): boolean {
-    return (this.tenants.length > 1);
+    return this.tenants.length > 1;
   }
-
 }
diff --git a/src/app/shared/theme-picker/theme-manager.service.ts b/src/app/shared/theme-picker/theme-manager.service.ts
index 108c0aff7..4356a3afb 100644
--- a/src/app/shared/theme-picker/theme-manager.service.ts
+++ b/src/app/shared/theme-picker/theme-manager.service.ts
@@ -8,11 +8,10 @@ import { Injectable } from '@angular/core';
   providedIn: 'root'
 })
 export class ThemeManagerService {
-
   /** Stylesheet class for the theme of the application. */
   private themeManagerClass = 'theme-manager';
 
-  constructor() { }
+  constructor() {}
 
   /**
    * Sets a new theme for the application.
@@ -56,5 +55,4 @@ export class ThemeManagerService {
     document.head.appendChild(linkElement);
     return linkElement;
   }
-
 }
diff --git a/src/app/shared/theme-picker/theme-picker.component.spec.ts b/src/app/shared/theme-picker/theme-picker.component.spec.ts
index 87b8ba21c..5394b67bd 100644
--- a/src/app/shared/theme-picker/theme-picker.component.spec.ts
+++ b/src/app/shared/theme-picker/theme-picker.component.spec.ts
@@ -8,9 +8,8 @@ describe('ThemePickerComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ThemePickerComponent ]
-    })
-    .compileComponents();
+      declarations: [ThemePickerComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shared/theme-picker/theme-picker.component.ts b/src/app/shared/theme-picker/theme-picker.component.ts
index dc86faf9d..29135de08 100644
--- a/src/app/shared/theme-picker/theme-picker.component.ts
+++ b/src/app/shared/theme-picker/theme-picker.component.ts
@@ -19,7 +19,6 @@ import { ThemeStorageService } from './theme-storage.service';
   encapsulation: ViewEncapsulation.None
 })
 export class ThemePickerComponent implements OnInit {
-
   /** Default theme for the application. */
   currentTheme: Theme = {
     href: 'denim-yellowgreen.css',
@@ -41,7 +40,7 @@ export class ThemePickerComponent implements OnInit {
       href: 'indigo-pink.css',
       primary: '#3F51B5',
       accent: '#E91E63',
-      isDark: false,
+      isDark: false
     },
     {
       href: 'deeppurple-amber.css',
@@ -66,7 +65,7 @@ export class ThemePickerComponent implements OnInit {
   /**
    * @param {ThemeStorageService} themeStorageService Theme Storage Service.
    */
-  constructor(public themeStorageService: ThemeStorageService) {  }
+  constructor(public themeStorageService: ThemeStorageService) {}
 
   /**
    * Initializes the theme for the application.
@@ -86,5 +85,4 @@ export class ThemePickerComponent implements OnInit {
     this.currentTheme = theme;
     this.themeStorageService.installTheme(theme);
   }
-
 }
diff --git a/src/app/shared/theme-picker/theme-storage.service.ts b/src/app/shared/theme-picker/theme-storage.service.ts
index e0ee1c727..910e1b0a1 100644
--- a/src/app/shared/theme-picker/theme-storage.service.ts
+++ b/src/app/shared/theme-picker/theme-storage.service.ts
@@ -1,5 +1,5 @@
 /** Angular Imports */
-import {Injectable, EventEmitter} from '@angular/core';
+import { Injectable, EventEmitter } from '@angular/core';
 
 /** Custom Model */
 import { Theme } from './theme.model';
@@ -14,7 +14,6 @@ import { ThemeManagerService } from './theme-manager.service';
   providedIn: 'root'
 })
 export class ThemeStorageService {
-
   /** Key to store current theme of application in local storage. */
   private themeStorageKey = 'mifosXTheme';
   /** Theme update event. */
@@ -63,5 +62,4 @@ export class ThemeStorageService {
     }
     this.storeTheme(theme);
   }
-
 }
diff --git a/src/app/shared/theme-toggle/theme-toggle.component.spec.ts b/src/app/shared/theme-toggle/theme-toggle.component.spec.ts
index 2da9bb2f1..85a76df77 100644
--- a/src/app/shared/theme-toggle/theme-toggle.component.spec.ts
+++ b/src/app/shared/theme-toggle/theme-toggle.component.spec.ts
@@ -8,9 +8,8 @@ describe('ThemeToggleComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ ThemeToggleComponent ]
-    })
-    .compileComponents();
+      declarations: [ThemeToggleComponent]
+    }).compileComponents();
 
     fixture = TestBed.createComponent(ThemeToggleComponent);
     component = fixture.componentInstance;
diff --git a/src/app/shared/theme-toggle/theme-toggle.component.ts b/src/app/shared/theme-toggle/theme-toggle.component.ts
index e74ae7a93..c0f041dd9 100644
--- a/src/app/shared/theme-toggle/theme-toggle.component.ts
+++ b/src/app/shared/theme-toggle/theme-toggle.component.ts
@@ -8,18 +8,19 @@ import { SettingsService } from 'app/settings/settings.service';
   styleUrls: ['./theme-toggle.component.scss']
 })
 export class ThemeToggleComponent implements OnInit, OnChanges {
-
   darkModeOn: boolean;
 
-  constructor(private themingService: ThemingService,
-    private settingsService: SettingsService) { }
+  constructor(
+    private themingService: ThemingService,
+    private settingsService: SettingsService
+  ) {}
 
   ngOnInit(): void {
-    this.darkModeOn = (this.settingsService.themeDarkEnabled === 'true');
+    this.darkModeOn = this.settingsService.themeDarkEnabled === 'true';
   }
 
   ngOnChanges(changes: SimpleChanges): void {
-    this.darkModeOn = (this.settingsService.themeDarkEnabled === 'true');
+    this.darkModeOn = this.settingsService.themeDarkEnabled === 'true';
   }
 
   toggleTheme() {
@@ -27,5 +28,4 @@ export class ThemeToggleComponent implements OnInit, OnChanges {
     this.settingsService.setThemeDarkEnabled(this.darkModeOn ? 'true' : 'false');
     this.themingService.setDarkMode(this.darkModeOn);
   }
-
 }
diff --git a/src/app/shared/theme-toggle/theming.service.ts b/src/app/shared/theme-toggle/theming.service.ts
index ba501db64..a8c0334cc 100644
--- a/src/app/shared/theme-toggle/theming.service.ts
+++ b/src/app/shared/theme-toggle/theming.service.ts
@@ -7,20 +7,21 @@ import { BehaviorSubject } from 'rxjs';
 export class ThemingService {
   private darkModeOn = false;
 
-  themes = ['dark-theme', 'light-theme']; // <- list all themes in this array
+  themes = [
+    'dark-theme',
+    'light-theme'
+  ]; // <- list all themes in this array
   theme = new BehaviorSubject('light-theme'); // <- initial theme
 
   constructor(private ref: ApplicationRef) {
     // Initially check if dark mode is enabled on system
-    this.darkModeOn =
-      window.matchMedia &&
-      window.matchMedia('(prefers-color-scheme: dark)').matches;
+    this.darkModeOn = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
 
     // If dark mode is enabled then directly switch to the dark-theme
     this.setDarkMode(this.darkModeOn);
 
     // Watch for changes of the preference
-    window.matchMedia('(prefers-color-scheme: dark)').addListener(e => {
+    window.matchMedia('(prefers-color-scheme: dark)').addListener((e) => {
       const turnOn = e.matches;
       this.theme.next(turnOn ? 'dark-theme' : 'light-theme');
 
@@ -30,9 +31,7 @@ export class ThemingService {
   }
 
   isDarkMode(): boolean {
-    this.darkModeOn =
-      window.matchMedia &&
-      window.matchMedia('(prefers-color-scheme: dark)').matches;
+    this.darkModeOn = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
     return this.darkModeOn;
   }
 
diff --git a/src/app/shared/transaction-payment-detail/payment-detail-model.ts b/src/app/shared/transaction-payment-detail/payment-detail-model.ts
index c43f6a1af..a88b690d0 100644
--- a/src/app/shared/transaction-payment-detail/payment-detail-model.ts
+++ b/src/app/shared/transaction-payment-detail/payment-detail-model.ts
@@ -12,5 +12,3 @@ export interface PaymentDetail {
   receiptNumber: string;
   bankNumber: string;
 }
-
-
diff --git a/src/app/shared/transaction-payment-detail/transaction-payment-detail.component.spec.ts b/src/app/shared/transaction-payment-detail/transaction-payment-detail.component.spec.ts
index cd2508916..df5dc3f04 100644
--- a/src/app/shared/transaction-payment-detail/transaction-payment-detail.component.spec.ts
+++ b/src/app/shared/transaction-payment-detail/transaction-payment-detail.component.spec.ts
@@ -8,9 +8,8 @@ describe('TransactionPaymentDetailComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ TransactionPaymentDetailComponent ]
-    })
-    .compileComponents();
+      declarations: [TransactionPaymentDetailComponent]
+    }).compileComponents();
 
     fixture = TestBed.createComponent(TransactionPaymentDetailComponent);
     component = fixture.componentInstance;
diff --git a/src/app/shared/transaction-payment-detail/transaction-payment-detail.component.ts b/src/app/shared/transaction-payment-detail/transaction-payment-detail.component.ts
index 3eea49253..ce5948491 100644
--- a/src/app/shared/transaction-payment-detail/transaction-payment-detail.component.ts
+++ b/src/app/shared/transaction-payment-detail/transaction-payment-detail.component.ts
@@ -1,14 +1,12 @@
 import { Component, Input } from '@angular/core';
 import { PaymentDetail } from './payment-detail-model';
 
-
 @Component({
   selector: 'mifosx-transaction-payment-detail',
   templateUrl: './transaction-payment-detail.component.html',
   styleUrls: ['./transaction-payment-detail.component.scss']
 })
 export class TransactionPaymentDetailComponent {
-
   @Input() paymentDetailData: PaymentDetail;
 
   constructor() {}
@@ -24,7 +22,6 @@ export class TransactionPaymentDetailComponent {
   }
 
   isNotNullOrEmpty(value: any): boolean {
-    return (value !== null && value !== '');
+    return value !== null && value !== '';
   }
-
 }
diff --git a/src/app/shared/validators/percentage.validator.ts b/src/app/shared/validators/percentage.validator.ts
index d919c458e..5f9a929f0 100644
--- a/src/app/shared/validators/percentage.validator.ts
+++ b/src/app/shared/validators/percentage.validator.ts
@@ -1,10 +1,9 @@
 import { AbstractControl, ValidatorFn } from '@angular/forms';
 
 export function rangeValidator(min: number, max: number): ValidatorFn {
-
   return (control: AbstractControl): { [key: string]: boolean } | null => {
     if (control.value !== undefined && (isNaN(control.value) || control.value < min || control.value > max)) {
-        return { 'range': true };
+      return { range: true };
     }
     return null;
   };
diff --git a/src/app/shares/common-resolvers/share-account-actions.resolver.ts b/src/app/shares/common-resolvers/share-account-actions.resolver.ts
index 93372b0c6..3b1a90977 100644
--- a/src/app/shares/common-resolvers/share-account-actions.resolver.ts
+++ b/src/app/shares/common-resolvers/share-account-actions.resolver.ts
@@ -13,11 +13,10 @@ import { SharesService } from '../shares.service';
  */
 @Injectable()
 export class ShareAccountActionsResolver implements Resolve {
-
   /**
    * @param {sharesService} SharesService Shares service.
    */
-  constructor(private sharesService: SharesService) { }
+  constructor(private sharesService: SharesService) {}
 
   /**
    * Returns the Shares account actions data.
@@ -37,5 +36,4 @@ export class ShareAccountActionsResolver implements Resolve {
         return undefined;
     }
   }
-
 }
diff --git a/src/app/shares/common-resolvers/share-account-and-template.resolver.ts b/src/app/shares/common-resolvers/share-account-and-template.resolver.ts
index efc9cd6ee..f21ea3f65 100644
--- a/src/app/shares/common-resolvers/share-account-and-template.resolver.ts
+++ b/src/app/shares/common-resolvers/share-account-and-template.resolver.ts
@@ -13,11 +13,10 @@ import { SharesService } from '../shares.service';
  */
 @Injectable()
 export class SharesAccountAndTemplateResolver implements Resolve {
-
   /**
    * @param {SharesService} SharesService Shares service.
    */
-  constructor(private sharesService: SharesService) { }
+  constructor(private sharesService: SharesService) {}
 
   /**
    * Returns the Shares Account data and template.
@@ -28,5 +27,4 @@ export class SharesAccountAndTemplateResolver implements Resolve {
     const shareAccountId = route.paramMap.get('shareAccountId');
     return this.sharesService.getSharesAccountData(shareAccountId, true);
   }
-
 }
diff --git a/src/app/shares/common-resolvers/share-account-view.resolver.ts b/src/app/shares/common-resolvers/share-account-view.resolver.ts
index 84eb0323e..b2bcd9438 100644
--- a/src/app/shares/common-resolvers/share-account-view.resolver.ts
+++ b/src/app/shares/common-resolvers/share-account-view.resolver.ts
@@ -13,11 +13,10 @@ import { SharesService } from '../shares.service';
  */
 @Injectable()
 export class SharesAccountViewResolver implements Resolve {
-
   /**
    * @param {SharesService} SharesService Shares service.
    */
-  constructor(private sharesService: SharesService) { }
+  constructor(private sharesService: SharesService) {}
 
   /**
    * Returns the Shares Account data.
@@ -28,5 +27,4 @@ export class SharesAccountViewResolver implements Resolve {
     const shareAccountId = route.paramMap.get('shareAccountId') || route.parent.paramMap.get('shareAccountId');
     return this.sharesService.getSharesAccountData(shareAccountId, false);
   }
-
 }
diff --git a/src/app/shares/common-resolvers/shares-account-template.resolver.ts b/src/app/shares/common-resolvers/shares-account-template.resolver.ts
index 95a42ae55..66cf7dff8 100644
--- a/src/app/shares/common-resolvers/shares-account-template.resolver.ts
+++ b/src/app/shares/common-resolvers/shares-account-template.resolver.ts
@@ -13,11 +13,10 @@ import { SharesService } from '../shares.service';
  */
 @Injectable()
 export class SharesAccountTemplateResolver implements Resolve {
-
   /**
    * @param {SharesService} SharesService Shares service.
    */
-  constructor(private sharesService: SharesService) { }
+  constructor(private sharesService: SharesService) {}
 
   /**
    * Returns the Shares Account Template.
@@ -28,5 +27,4 @@ export class SharesAccountTemplateResolver implements Resolve {
     const clientId = route.parent.parent.paramMap.get('clientId');
     return this.sharesService.getSharesAccountTemplate(clientId);
   }
-
 }
diff --git a/src/app/shares/create-shares-account/create-shares-account.component.spec.ts b/src/app/shares/create-shares-account/create-shares-account.component.spec.ts
index 8c23811c5..624658d69 100644
--- a/src/app/shares/create-shares-account/create-shares-account.component.spec.ts
+++ b/src/app/shares/create-shares-account/create-shares-account.component.spec.ts
@@ -8,9 +8,8 @@ describe('CreateSharesAccountComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CreateSharesAccountComponent ]
-    })
-    .compileComponents();
+      declarations: [CreateSharesAccountComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/create-shares-account/create-shares-account.component.ts b/src/app/shares/create-shares-account/create-shares-account.component.ts
index a3fa247df..2c5b8efd5 100644
--- a/src/app/shares/create-shares-account/create-shares-account.component.ts
+++ b/src/app/shares/create-shares-account/create-shares-account.component.ts
@@ -21,18 +21,19 @@ import { Dates } from 'app/core/utils/dates';
   styleUrls: ['./create-shares-account.component.scss']
 })
 export class CreateSharesAccountComponent {
-
   /** Shares Account Template */
   sharesAccountTemplate: any;
   /** Shares Account Product Template */
   sharesAccountProductTemplate: any;
 
   /** Shares Account Details Step */
-  @ViewChild(SharesAccountDetailsStepComponent, { static: true }) sharesAccountDetailsStep: SharesAccountDetailsStepComponent;
+  @ViewChild(SharesAccountDetailsStepComponent, { static: true })
+  sharesAccountDetailsStep: SharesAccountDetailsStepComponent;
   /** Shares Account Terms Step */
   @ViewChild(SharesAccountTermsStepComponent, { static: true }) sharesAccountTermsStep: SharesAccountTermsStepComponent;
   /** Shares Account Charges Step */
-  @ViewChild(SharesAccountChargesStepComponent, { static: true }) sharesAccountChargesStep: SharesAccountChargesStepComponent;
+  @ViewChild(SharesAccountChargesStepComponent, { static: true })
+  sharesAccountChargesStep: SharesAccountChargesStepComponent;
 
   /**
    * Fetches shares account template from `resolve`
@@ -42,11 +43,13 @@ export class CreateSharesAccountComponent {
    * @param {SharesService} sharesService Shares Service
    * @param {SettingsService} settingsService Settings Service
    */
-  constructor(private route: ActivatedRoute,
-              private router: Router,
-              private dateUtils: Dates,
-              private sharesService: SharesService,
-              private settingsService: SettingsService) {
+  constructor(
+    private route: ActivatedRoute,
+    private router: Router,
+    private dateUtils: Dates,
+    private sharesService: SharesService,
+    private settingsService: SettingsService
+  ) {
     this.route.data.subscribe((data: { sharesAccountTemplate: any }) => {
       this.sharesAccountTemplate = data.sharesAccountTemplate;
     });
@@ -78,10 +81,7 @@ export class CreateSharesAccountComponent {
    * Checks validity of overall shares account form.
    */
   get sharesAccountFormValid() {
-    return (
-      this.sharesAccountDetailsForm.valid &&
-      this.sharesAccountTermsForm.valid
-    );
+    return this.sharesAccountDetailsForm.valid && this.sharesAccountTermsForm.valid;
   }
 
   /**
@@ -113,8 +113,13 @@ export class CreateSharesAccountComponent {
       locale
     };
     this.sharesService.createSharesAccount(sharesAccount).subscribe((response: any) => {
-      this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
+      this.router.navigate(
+        [
+          '../',
+          response.resourceId
+        ],
+        { relativeTo: this.route }
+      );
     });
   }
-
 }
diff --git a/src/app/shares/edit-shares-account/edit-shares-account.component.spec.ts b/src/app/shares/edit-shares-account/edit-shares-account.component.spec.ts
index 56de1233d..cdee7bf9b 100644
--- a/src/app/shares/edit-shares-account/edit-shares-account.component.spec.ts
+++ b/src/app/shares/edit-shares-account/edit-shares-account.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditSharesAccountComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditSharesAccountComponent ]
-    })
-    .compileComponents();
+      declarations: [EditSharesAccountComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/edit-shares-account/edit-shares-account.component.ts b/src/app/shares/edit-shares-account/edit-shares-account.component.ts
index 3b29d5c0b..da5a06fd0 100644
--- a/src/app/shares/edit-shares-account/edit-shares-account.component.ts
+++ b/src/app/shares/edit-shares-account/edit-shares-account.component.ts
@@ -21,18 +21,19 @@ import { Dates } from 'app/core/utils/dates';
   styleUrls: ['./edit-shares-account.component.scss']
 })
 export class EditSharesAccountComponent {
-
   /** Shares Account and Template */
   sharesAccountAndTemplate: any;
   /** Shares Account Product Template */
   sharesAccountProductTemplate: any;
 
   /** Shares Account Details Step */
-  @ViewChild(SharesAccountDetailsStepComponent, { static: true }) sharesAccountDetailsStep: SharesAccountDetailsStepComponent;
+  @ViewChild(SharesAccountDetailsStepComponent, { static: true })
+  sharesAccountDetailsStep: SharesAccountDetailsStepComponent;
   /** Shares Account Terms Step */
   @ViewChild(SharesAccountTermsStepComponent, { static: true }) sharesAccountTermsStep: SharesAccountTermsStepComponent;
   /** Shares Account Charges Step */
-  @ViewChild(SharesAccountChargesStepComponent, { static: true }) sharesAccountChargesStep: SharesAccountChargesStepComponent;
+  @ViewChild(SharesAccountChargesStepComponent, { static: true })
+  sharesAccountChargesStep: SharesAccountChargesStepComponent;
 
   /**
    * Fetches shares account template from `resolve`
@@ -42,11 +43,13 @@ export class EditSharesAccountComponent {
    * @param {SharesService} sharesService Shares Service
    * @param {SettingsService} settingsService Settings Service
    */
-  constructor(private route: ActivatedRoute,
-              private router: Router,
-              private dateUtils: Dates,
-              private sharesService: SharesService,
-              private settingsService: SettingsService) {
+  constructor(
+    private route: ActivatedRoute,
+    private router: Router,
+    private dateUtils: Dates,
+    private sharesService: SharesService,
+    private settingsService: SettingsService
+  ) {
     this.route.data.subscribe((data: { sharesAccountAndTemplate: any }) => {
       this.sharesAccountAndTemplate = data.sharesAccountAndTemplate;
     });
@@ -81,11 +84,9 @@ export class EditSharesAccountComponent {
     return (
       this.sharesAccountDetailsForm.valid &&
       this.sharesAccountTermsForm.valid &&
-      (
-        !this.sharesAccountDetailsForm.pristine ||
+      (!this.sharesAccountDetailsForm.pristine ||
         !this.sharesAccountTermsForm.pristine ||
-        !this.sharesAccountChargesStep.pristine
-      )
+        !this.sharesAccountChargesStep.pristine)
     );
   }
 
@@ -117,9 +118,10 @@ export class EditSharesAccountComponent {
       dateFormat,
       locale
     };
-    this.sharesService.updateSharesAccount(this.sharesAccountAndTemplate.id , sharesAccount).subscribe((response: any) => {
-      this.router.navigate(['../'], { relativeTo: this.route });
-    });
+    this.sharesService
+      .updateSharesAccount(this.sharesAccountAndTemplate.id, sharesAccount)
+      .subscribe((response: any) => {
+        this.router.navigate(['../'], { relativeTo: this.route });
+      });
   }
-
 }
diff --git a/src/app/shares/shares-account-actions/activate-shares-account/activate-shares-account.component.spec.ts b/src/app/shares/shares-account-actions/activate-shares-account/activate-shares-account.component.spec.ts
index ffb77e774..dd2611347 100644
--- a/src/app/shares/shares-account-actions/activate-shares-account/activate-shares-account.component.spec.ts
+++ b/src/app/shares/shares-account-actions/activate-shares-account/activate-shares-account.component.spec.ts
@@ -8,9 +8,8 @@ describe('ActivateSharesAccountComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ActivateSharesAccountComponent ]
-    })
-    .compileComponents();
+      declarations: [ActivateSharesAccountComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-actions/activate-shares-account/activate-shares-account.component.ts b/src/app/shares/shares-account-actions/activate-shares-account/activate-shares-account.component.ts
index a16f67109..3907c2e19 100644
--- a/src/app/shares/shares-account-actions/activate-shares-account/activate-shares-account.component.ts
+++ b/src/app/shares/shares-account-actions/activate-shares-account/activate-shares-account.component.ts
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
   styleUrls: ['./activate-shares-account.component.scss']
 })
 export class ActivateSharesAccountComponent implements OnInit {
-
   /** Minimum date allowed. */
   minDate = new Date(2000, 0, 1);
   /** Maximum date allowed. */
@@ -35,12 +34,14 @@ export class ActivateSharesAccountComponent implements OnInit {
    * @param {Router} router Router
    * @param {SettingsService} settingsService Settings Service.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private sharesService: SharesService,
-              private dateUtils: Dates,
-              private route: ActivatedRoute,
-              private router: Router,
-              private settingsService: SettingsService) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private sharesService: SharesService,
+    private dateUtils: Dates,
+    private route: ActivatedRoute,
+    private router: Router,
+    private settingsService: SettingsService
+  ) {
     this.accountId = this.route.parent.snapshot.params['shareAccountId'];
   }
 
@@ -57,7 +58,10 @@ export class ActivateSharesAccountComponent implements OnInit {
    */
   createActivateSharesAccountForm() {
     this.activateSharesAccountForm = this.formBuilder.group({
-      'activatedDate': ['', Validators.required]
+      activatedDate: [
+        '',
+        Validators.required
+      ]
     });
   }
 
@@ -82,5 +86,4 @@ export class ActivateSharesAccountComponent implements OnInit {
       this.router.navigate(['../../'], { relativeTo: this.route });
     });
   }
-
 }
diff --git a/src/app/shares/shares-account-actions/apply-shares/apply-shares.component.spec.ts b/src/app/shares/shares-account-actions/apply-shares/apply-shares.component.spec.ts
index e0d39407f..56c595426 100644
--- a/src/app/shares/shares-account-actions/apply-shares/apply-shares.component.spec.ts
+++ b/src/app/shares/shares-account-actions/apply-shares/apply-shares.component.spec.ts
@@ -8,9 +8,8 @@ describe('ApplySharesComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ApplySharesComponent ]
-    })
-    .compileComponents();
+      declarations: [ApplySharesComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-actions/apply-shares/apply-shares.component.ts b/src/app/shares/shares-account-actions/apply-shares/apply-shares.component.ts
index c18e61c44..ba465d136 100644
--- a/src/app/shares/shares-account-actions/apply-shares/apply-shares.component.ts
+++ b/src/app/shares/shares-account-actions/apply-shares/apply-shares.component.ts
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
   styleUrls: ['./apply-shares.component.scss']
 })
 export class ApplySharesComponent implements OnInit {
-
   /** Shares account data. */
   sharesAccountData: any;
 
@@ -38,12 +37,14 @@ export class ApplySharesComponent implements OnInit {
    * @param {Router} router Router
    * @param {SettingsService} settingsService Settings Service
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private sharesService: SharesService,
-              private dateUtils: Dates,
-              private route: ActivatedRoute,
-              private router: Router,
-              private settingsService: SettingsService) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private sharesService: SharesService,
+    private dateUtils: Dates,
+    private route: ActivatedRoute,
+    private router: Router,
+    private settingsService: SettingsService
+  ) {
     this.accountId = this.route.parent.snapshot.params['shareAccountId'];
     this.route.data.subscribe((data: { shareAccountActionData: any }) => {
       this.sharesAccountData = data.shareAccountActionData;
@@ -66,9 +67,15 @@ export class ApplySharesComponent implements OnInit {
    */
   createApplySharesAccountForm() {
     this.applySharesForm = this.formBuilder.group({
-      'requestedDate': ['', Validators.required],
-      'requestedShares': ['', Validators.required],
-      'unitPrice': [{value: '', disabled: true}]
+      requestedDate: [
+        '',
+        Validators.required
+      ],
+      requestedShares: [
+        '',
+        Validators.required
+      ],
+      unitPrice: [{ value: '', disabled: true }]
     });
   }
 
@@ -94,5 +101,4 @@ export class ApplySharesComponent implements OnInit {
       this.router.navigate(['../../'], { relativeTo: this.route });
     });
   }
-
 }
diff --git a/src/app/shares/shares-account-actions/approve-shares-account/approve-shares-account.component.spec.ts b/src/app/shares/shares-account-actions/approve-shares-account/approve-shares-account.component.spec.ts
index 3e787d6a3..a439b9801 100644
--- a/src/app/shares/shares-account-actions/approve-shares-account/approve-shares-account.component.spec.ts
+++ b/src/app/shares/shares-account-actions/approve-shares-account/approve-shares-account.component.spec.ts
@@ -8,9 +8,8 @@ describe('ApproveSharesAccountComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ApproveSharesAccountComponent ]
-    })
-    .compileComponents();
+      declarations: [ApproveSharesAccountComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-actions/approve-shares-account/approve-shares-account.component.ts b/src/app/shares/shares-account-actions/approve-shares-account/approve-shares-account.component.ts
index 67b8c63d2..498a1aee9 100644
--- a/src/app/shares/shares-account-actions/approve-shares-account/approve-shares-account.component.ts
+++ b/src/app/shares/shares-account-actions/approve-shares-account/approve-shares-account.component.ts
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
   styleUrls: ['./approve-shares-account.component.scss']
 })
 export class ApproveSharesAccountComponent implements OnInit {
-
   /** Minimum date allowed. */
   minDate = new Date(2000, 0, 1);
   /** Maximum date allowed. */
@@ -35,12 +34,14 @@ export class ApproveSharesAccountComponent implements OnInit {
    * @param {Router} router Router
    * @param {SettingsService} settingsService Settings Service.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private sharesService: SharesService,
-              private dateUtils: Dates,
-              private route: ActivatedRoute,
-              private router: Router,
-              private settingsService: SettingsService) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private sharesService: SharesService,
+    private dateUtils: Dates,
+    private route: ActivatedRoute,
+    private router: Router,
+    private settingsService: SettingsService
+  ) {
     this.accountId = this.route.parent.snapshot.params['shareAccountId'];
   }
 
@@ -57,8 +58,11 @@ export class ApproveSharesAccountComponent implements OnInit {
    */
   createApproveSharesAccountForm() {
     this.approveSharesAccountForm = this.formBuilder.group({
-      'approvedDate': ['', Validators.required],
-      'note': ['']
+      approvedDate: [
+        '',
+        Validators.required
+      ],
+      note: ['']
     });
   }
 
@@ -83,5 +87,4 @@ export class ApproveSharesAccountComponent implements OnInit {
       this.router.navigate(['../../'], { relativeTo: this.route });
     });
   }
-
 }
diff --git a/src/app/shares/shares-account-actions/approve-shares/approve-share-dialog/approve-share-dialog.component.spec.ts b/src/app/shares/shares-account-actions/approve-shares/approve-share-dialog/approve-share-dialog.component.spec.ts
index 274cb211a..5ea602ad8 100644
--- a/src/app/shares/shares-account-actions/approve-shares/approve-share-dialog/approve-share-dialog.component.spec.ts
+++ b/src/app/shares/shares-account-actions/approve-shares/approve-share-dialog/approve-share-dialog.component.spec.ts
@@ -8,9 +8,8 @@ describe('ApproveShareDialogComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ApproveShareDialogComponent ]
-    })
-    .compileComponents();
+      declarations: [ApproveShareDialogComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-actions/approve-shares/approve-share-dialog/approve-share-dialog.component.ts b/src/app/shares/shares-account-actions/approve-shares/approve-share-dialog/approve-share-dialog.component.ts
index d66f8a307..a6824aa42 100644
--- a/src/app/shares/shares-account-actions/approve-shares/approve-share-dialog/approve-share-dialog.component.ts
+++ b/src/app/shares/shares-account-actions/approve-shares/approve-share-dialog/approve-share-dialog.component.ts
@@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
   styleUrls: ['./approve-share-dialog.component.scss']
 })
 export class ApproveShareDialogComponent {
-
   /**
    * @param {MatDialogRef} dialogRef Component reference to dialog.
    * @param {any} data Provides a deleteContext.
    */
-  constructor(public dialogRef: MatDialogRef,
-    @Inject(MAT_DIALOG_DATA) public data: any) { }
-
+  constructor(
+    public dialogRef: MatDialogRef,
+    @Inject(MAT_DIALOG_DATA) public data: any
+  ) {}
 }
diff --git a/src/app/shares/shares-account-actions/approve-shares/approve-shares.component.spec.ts b/src/app/shares/shares-account-actions/approve-shares/approve-shares.component.spec.ts
index 960ba8b4a..b545c9b4b 100644
--- a/src/app/shares/shares-account-actions/approve-shares/approve-shares.component.spec.ts
+++ b/src/app/shares/shares-account-actions/approve-shares/approve-shares.component.spec.ts
@@ -8,9 +8,8 @@ describe('ApproveSharesComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ApproveSharesComponent ]
-    })
-    .compileComponents();
+      declarations: [ApproveSharesComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-actions/approve-shares/approve-shares.component.ts b/src/app/shares/shares-account-actions/approve-shares/approve-shares.component.ts
index 25bc0cbed..a3945318e 100644
--- a/src/app/shares/shares-account-actions/approve-shares/approve-shares.component.ts
+++ b/src/app/shares/shares-account-actions/approve-shares/approve-shares.component.ts
@@ -23,7 +23,6 @@ import { SettingsService } from 'app/settings/settings.service';
   styleUrls: ['./approve-shares.component.scss']
 })
 export class ApproveSharesComponent implements OnInit {
-
   /** Shares account data. */
   sharesAccountData: any;
 
@@ -32,7 +31,13 @@ export class ApproveSharesComponent implements OnInit {
   /** Shares account data. */
   sharesData: any[];
   /** Columns to be displayed in shares table. */
-  displayedColumns: string[] = ['transactionDate', 'totalShares', 'redeemedPrice', 'status', 'approve'];
+  displayedColumns: string[] = [
+    'transactionDate',
+    'totalShares',
+    'redeemedPrice',
+    'status',
+    'approve'
+  ];
   /** Data source for shares table. */
   dataSource: MatTableDataSource;
 
@@ -49,10 +54,12 @@ export class ApproveSharesComponent implements OnInit {
    * @param {MatDialog} dialog Dialog reference.
    * @param {SettingsService} settingsService Settings Service
    */
-  constructor(private sharesService: SharesService,
-              private route: ActivatedRoute,
-              public dialog: MatDialog,
-              private settingsService: SettingsService) {
+  constructor(
+    private sharesService: SharesService,
+    private route: ActivatedRoute,
+    public dialog: MatDialog,
+    private settingsService: SettingsService
+  ) {
     this.accountId = this.route.parent.snapshot.params['shareAccountId'];
     this.route.data.subscribe((data: { shareAccountActionData: any }) => {
       this.sharesAccountData = data.shareAccountActionData;
@@ -63,8 +70,9 @@ export class ApproveSharesComponent implements OnInit {
    * Sets the shares table.
    */
   ngOnInit() {
-    this.sharesData = this.sharesAccountData.purchasedShares
-    .filter((share: any) => share.status.value === 'Pending Approval');
+    this.sharesData = this.sharesAccountData.purchasedShares.filter(
+      (share: any) => share.status.value === 'Pending Approval'
+    );
     this.setShares();
   }
 
@@ -90,19 +98,20 @@ export class ApproveSharesComponent implements OnInit {
         const locale = this.settingsService.language.code;
         const dateFormat = this.settingsService.dateFormat;
         const data = {
-          requestedShares: [{id}],
+          requestedShares: [{ id }],
           dateFormat,
           locale
         };
-        this.sharesService.executeSharesAccountCommand(this.accountId, 'approveadditionalshares', data).subscribe(() => {
-          const share = this.sharesData.find(element => element.id === id);
-          const index = this.sharesData.indexOf(share);
-          this.sharesData.splice(index, 1);
-          this.dataSource.data = this.sharesData;
-          this.sharesTableRef.renderRows();
-        });
+        this.sharesService
+          .executeSharesAccountCommand(this.accountId, 'approveadditionalshares', data)
+          .subscribe(() => {
+            const share = this.sharesData.find((element) => element.id === id);
+            const index = this.sharesData.indexOf(share);
+            this.sharesData.splice(index, 1);
+            this.dataSource.data = this.sharesData;
+            this.sharesTableRef.renderRows();
+          });
       }
     });
   }
-
 }
diff --git a/src/app/shares/shares-account-actions/close-shares-account/close-shares-account.component.spec.ts b/src/app/shares/shares-account-actions/close-shares-account/close-shares-account.component.spec.ts
index 1cc2fc39f..bdacf2e75 100644
--- a/src/app/shares/shares-account-actions/close-shares-account/close-shares-account.component.spec.ts
+++ b/src/app/shares/shares-account-actions/close-shares-account/close-shares-account.component.spec.ts
@@ -8,9 +8,8 @@ describe('CloseSharesAccountComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CloseSharesAccountComponent ]
-    })
-    .compileComponents();
+      declarations: [CloseSharesAccountComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-actions/close-shares-account/close-shares-account.component.ts b/src/app/shares/shares-account-actions/close-shares-account/close-shares-account.component.ts
index 947a20900..f1478600c 100644
--- a/src/app/shares/shares-account-actions/close-shares-account/close-shares-account.component.ts
+++ b/src/app/shares/shares-account-actions/close-shares-account/close-shares-account.component.ts
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
   styleUrls: ['./close-shares-account.component.scss']
 })
 export class CloseSharesAccountComponent implements OnInit {
-
   /** Minimum date allowed. */
   minDate = new Date(2000, 0, 1);
   /** Maximum date allowed. */
@@ -35,12 +34,14 @@ export class CloseSharesAccountComponent implements OnInit {
    * @param {Router} router Router
    * @param {SettingsService} settingsService Settings Service.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private sharesService: SharesService,
-              private dateUtils: Dates,
-              private route: ActivatedRoute,
-              private router: Router,
-              private settingsService: SettingsService) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private sharesService: SharesService,
+    private dateUtils: Dates,
+    private route: ActivatedRoute,
+    private router: Router,
+    private settingsService: SettingsService
+  ) {
     this.accountId = this.route.parent.snapshot.params['shareAccountId'];
   }
 
@@ -57,8 +58,11 @@ export class CloseSharesAccountComponent implements OnInit {
    */
   createCloseSharesAccountForm() {
     this.closeSharesAccountForm = this.formBuilder.group({
-      'closedDate': ['', Validators.required],
-      'note': ['']
+      closedDate: [
+        '',
+        Validators.required
+      ],
+      note: ['']
     });
   }
 
@@ -83,5 +87,4 @@ export class CloseSharesAccountComponent implements OnInit {
       this.router.navigate(['../../'], { relativeTo: this.route });
     });
   }
-
 }
diff --git a/src/app/shares/shares-account-actions/redeem-shares/redeem-shares.component.spec.ts b/src/app/shares/shares-account-actions/redeem-shares/redeem-shares.component.spec.ts
index 33cc82d1e..6276af830 100644
--- a/src/app/shares/shares-account-actions/redeem-shares/redeem-shares.component.spec.ts
+++ b/src/app/shares/shares-account-actions/redeem-shares/redeem-shares.component.spec.ts
@@ -8,9 +8,8 @@ describe('RedeemSharesComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ RedeemSharesComponent ]
-    })
-    .compileComponents();
+      declarations: [RedeemSharesComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-actions/redeem-shares/redeem-shares.component.ts b/src/app/shares/shares-account-actions/redeem-shares/redeem-shares.component.ts
index 704b18685..92561ad4c 100644
--- a/src/app/shares/shares-account-actions/redeem-shares/redeem-shares.component.ts
+++ b/src/app/shares/shares-account-actions/redeem-shares/redeem-shares.component.ts
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
   styleUrls: ['./redeem-shares.component.scss']
 })
 export class RedeemSharesComponent implements OnInit {
-
   /** Shares account data. */
   sharesAccountData: any;
 
@@ -38,12 +37,14 @@ export class RedeemSharesComponent implements OnInit {
    * @param {Router} router Router
    * @param {SettingsService} settingsService Settings Service.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private sharesService: SharesService,
-              private dateUtils: Dates,
-              private route: ActivatedRoute,
-              private router: Router,
-              private settingsService: SettingsService) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private sharesService: SharesService,
+    private dateUtils: Dates,
+    private route: ActivatedRoute,
+    private router: Router,
+    private settingsService: SettingsService
+  ) {
     this.accountId = this.route.parent.snapshot.params['shareAccountId'];
     this.route.data.subscribe((data: { shareAccountActionData: any }) => {
       this.sharesAccountData = data.shareAccountActionData;
@@ -66,9 +67,15 @@ export class RedeemSharesComponent implements OnInit {
    */
   createRedeemSharesAccountForm() {
     this.redeemSharesForm = this.formBuilder.group({
-      'requestedDate': ['', Validators.required],
-      'requestedShares': ['', Validators.required],
-      'unitPrice': [{value: '', disabled: true}]
+      requestedDate: [
+        '',
+        Validators.required
+      ],
+      requestedShares: [
+        '',
+        Validators.required
+      ],
+      unitPrice: [{ value: '', disabled: true }]
     });
   }
 
@@ -94,5 +101,4 @@ export class RedeemSharesComponent implements OnInit {
       this.router.navigate(['../../'], { relativeTo: this.route });
     });
   }
-
 }
diff --git a/src/app/shares/shares-account-actions/reject-shares-account/reject-shares-account.component.spec.ts b/src/app/shares/shares-account-actions/reject-shares-account/reject-shares-account.component.spec.ts
index 8ad2b5f8c..71c444589 100644
--- a/src/app/shares/shares-account-actions/reject-shares-account/reject-shares-account.component.spec.ts
+++ b/src/app/shares/shares-account-actions/reject-shares-account/reject-shares-account.component.spec.ts
@@ -8,9 +8,8 @@ describe('RejectSharesAccountComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ RejectSharesAccountComponent ]
-    })
-    .compileComponents();
+      declarations: [RejectSharesAccountComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-actions/reject-shares-account/reject-shares-account.component.ts b/src/app/shares/shares-account-actions/reject-shares-account/reject-shares-account.component.ts
index 271f0904c..cb25e4aa1 100644
--- a/src/app/shares/shares-account-actions/reject-shares-account/reject-shares-account.component.ts
+++ b/src/app/shares/shares-account-actions/reject-shares-account/reject-shares-account.component.ts
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
   styleUrls: ['./reject-shares-account.component.scss']
 })
 export class RejectSharesAccountComponent implements OnInit {
-
   /** Minimum date allowed. */
   minDate = new Date(2000, 0, 1);
   /** Maximum date allowed. */
@@ -35,12 +34,14 @@ export class RejectSharesAccountComponent implements OnInit {
    * @param {Router} router Router
    * @param {SettingsService} settingsService Settings Service
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private sharesService: SharesService,
-              private dateUtils: Dates,
-              private route: ActivatedRoute,
-              private router: Router,
-              private settingsService: SettingsService) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private sharesService: SharesService,
+    private dateUtils: Dates,
+    private route: ActivatedRoute,
+    private router: Router,
+    private settingsService: SettingsService
+  ) {
     this.accountId = this.route.parent.snapshot.params['shareAccountId'];
   }
 
@@ -57,8 +58,11 @@ export class RejectSharesAccountComponent implements OnInit {
    */
   createRejectSharesAccountForm() {
     this.rejectSharesAccountForm = this.formBuilder.group({
-      'rejectedDate': ['', Validators.required],
-      'note': ['']
+      rejectedDate: [
+        '',
+        Validators.required
+      ],
+      note: ['']
     });
   }
 
@@ -83,5 +87,4 @@ export class RejectSharesAccountComponent implements OnInit {
       this.router.navigate(['../../'], { relativeTo: this.route });
     });
   }
-
 }
diff --git a/src/app/shares/shares-account-actions/reject-shares/reject-share-dialog/reject-share-dialog.component.spec.ts b/src/app/shares/shares-account-actions/reject-shares/reject-share-dialog/reject-share-dialog.component.spec.ts
index 1510d7f1a..10f2799f0 100644
--- a/src/app/shares/shares-account-actions/reject-shares/reject-share-dialog/reject-share-dialog.component.spec.ts
+++ b/src/app/shares/shares-account-actions/reject-shares/reject-share-dialog/reject-share-dialog.component.spec.ts
@@ -8,9 +8,8 @@ describe('RejectSharesDialogComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ RejectShareDialogComponent ]
-    })
-    .compileComponents();
+      declarations: [RejectShareDialogComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-actions/reject-shares/reject-share-dialog/reject-share-dialog.component.ts b/src/app/shares/shares-account-actions/reject-shares/reject-share-dialog/reject-share-dialog.component.ts
index 8c125cee6..76c175e50 100644
--- a/src/app/shares/shares-account-actions/reject-shares/reject-share-dialog/reject-share-dialog.component.ts
+++ b/src/app/shares/shares-account-actions/reject-shares/reject-share-dialog/reject-share-dialog.component.ts
@@ -11,12 +11,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
   styleUrls: ['./reject-share-dialog.component.scss']
 })
 export class RejectShareDialogComponent {
-
   /**
    * @param {MatDialogRef} dialogRef Component reference to dialog.
    * @param {any} data Provides a deleteContext.
    */
-  constructor(public dialogRef: MatDialogRef,
-    @Inject(MAT_DIALOG_DATA) public data: any) { }
-
+  constructor(
+    public dialogRef: MatDialogRef,
+    @Inject(MAT_DIALOG_DATA) public data: any
+  ) {}
 }
diff --git a/src/app/shares/shares-account-actions/reject-shares/reject-shares.component.spec.ts b/src/app/shares/shares-account-actions/reject-shares/reject-shares.component.spec.ts
index bf9b44c7d..81c19c3df 100644
--- a/src/app/shares/shares-account-actions/reject-shares/reject-shares.component.spec.ts
+++ b/src/app/shares/shares-account-actions/reject-shares/reject-shares.component.spec.ts
@@ -8,9 +8,8 @@ describe('RejectSharesComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ RejectSharesComponent ]
-    })
-    .compileComponents();
+      declarations: [RejectSharesComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-actions/reject-shares/reject-shares.component.ts b/src/app/shares/shares-account-actions/reject-shares/reject-shares.component.ts
index d19048db2..b78b3e7b0 100644
--- a/src/app/shares/shares-account-actions/reject-shares/reject-shares.component.ts
+++ b/src/app/shares/shares-account-actions/reject-shares/reject-shares.component.ts
@@ -23,7 +23,6 @@ import { SettingsService } from 'app/settings/settings.service';
   styleUrls: ['./reject-shares.component.scss']
 })
 export class RejectSharesComponent implements OnInit {
-
   /** Shares account data. */
   sharesAccountData: any;
 
@@ -32,7 +31,13 @@ export class RejectSharesComponent implements OnInit {
   /** Shares account data. */
   sharesData: any[];
   /** Columns to be displayed in shares table. */
-  displayedColumns: string[] = ['transactionDate', 'totalShares', 'redeemedPrice', 'status', 'reject'];
+  displayedColumns: string[] = [
+    'transactionDate',
+    'totalShares',
+    'redeemedPrice',
+    'status',
+    'reject'
+  ];
   /** Data source for shares table. */
   dataSource: MatTableDataSource;
 
@@ -49,10 +54,12 @@ export class RejectSharesComponent implements OnInit {
    * @param {MatDialog} dialog Mat Dialog
    * @param {SettingsService} settingsService Settings Service.
    */
-  constructor(private sharesService: SharesService,
-              private route: ActivatedRoute,
-              public dialog: MatDialog,
-              private settingsService: SettingsService) {
+  constructor(
+    private sharesService: SharesService,
+    private route: ActivatedRoute,
+    public dialog: MatDialog,
+    private settingsService: SettingsService
+  ) {
     this.accountId = this.route.parent.snapshot.params['shareAccountId'];
     this.route.data.subscribe((data: { shareAccountActionData: any }) => {
       this.sharesAccountData = data.shareAccountActionData;
@@ -63,8 +70,9 @@ export class RejectSharesComponent implements OnInit {
    * Sets the shares table.
    */
   ngOnInit() {
-    this.sharesData = this.sharesAccountData.purchasedShares
-    .filter((share: any) => share.status.value === 'Pending Approval');
+    this.sharesData = this.sharesAccountData.purchasedShares.filter(
+      (share: any) => share.status.value === 'Pending Approval'
+    );
     this.setShares();
   }
 
@@ -90,12 +98,12 @@ export class RejectSharesComponent implements OnInit {
         const locale = this.settingsService.language.code;
         const dateFormat = this.settingsService.dateFormat;
         const data = {
-          requestedShares: [{id}],
+          requestedShares: [{ id }],
           dateFormat,
           locale
         };
         this.sharesService.executeSharesAccountCommand(this.accountId, 'rejectadditionalshares', data).subscribe(() => {
-          const share = this.sharesData.find(element => element.id === id);
+          const share = this.sharesData.find((element) => element.id === id);
           const index = this.sharesData.indexOf(share);
           this.sharesData.splice(index, 1);
           this.dataSource.data = this.sharesData;
@@ -104,5 +112,4 @@ export class RejectSharesComponent implements OnInit {
       }
     });
   }
-
 }
diff --git a/src/app/shares/shares-account-actions/shares-account-actions.component.spec.ts b/src/app/shares/shares-account-actions/shares-account-actions.component.spec.ts
index 73591877f..dbe9d4d0c 100644
--- a/src/app/shares/shares-account-actions/shares-account-actions.component.spec.ts
+++ b/src/app/shares/shares-account-actions/shares-account-actions.component.spec.ts
@@ -8,9 +8,8 @@ describe('SharesAccountActionsComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ SharesAccountActionsComponent ]
-    })
-    .compileComponents();
+      declarations: [SharesAccountActionsComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-actions/shares-account-actions.component.ts b/src/app/shares/shares-account-actions/shares-account-actions.component.ts
index 3a9f05bcb..8457ae21a 100644
--- a/src/app/shares/shares-account-actions/shares-account-actions.component.ts
+++ b/src/app/shares/shares-account-actions/shares-account-actions.component.ts
@@ -14,25 +14,24 @@ import { SharesService } from '../shares.service';
   styleUrls: ['./shares-account-actions.component.scss']
 })
 export class SharesAccountActionsComponent {
-
   /** Shares Account Data */
   sharesAccountData: any;
   /** Flag object to store possible actions and render appropriate UI to the user */
   actions: {
-    'Approve': boolean
-    'Reject': boolean
-    'Close': boolean
-    'Activate': boolean
-    'Undo Approval': boolean
-    'Apply Additional Shares': boolean
-    'Redeem Shares': boolean
-    'Approve Additional Shares': boolean
-    'Reject Additional Shares': boolean
+    Approve: boolean;
+    Reject: boolean;
+    Close: boolean;
+    Activate: boolean;
+    'Undo Approval': boolean;
+    'Apply Additional Shares': boolean;
+    'Redeem Shares': boolean;
+    'Approve Additional Shares': boolean;
+    'Reject Additional Shares': boolean;
   } = {
-    'Approve': false,
-    'Reject': false,
-    'Close': false,
-    'Activate': false,
+    Approve: false,
+    Reject: false,
+    Close: false,
+    Activate: false,
     'Undo Approval': false,
     'Apply Additional Shares': false,
     'Redeem Shares': false,
@@ -47,5 +46,4 @@ export class SharesAccountActionsComponent {
     const name = this.route.snapshot.params['name'];
     this.actions[name] = true;
   }
-
 }
diff --git a/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.spec.ts b/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.spec.ts
index 3752c6c71..737d00f69 100644
--- a/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.spec.ts
+++ b/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.spec.ts
@@ -8,9 +8,8 @@ describe('UndoApprovalSharesAccountComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ UndoApprovalSharesAccountComponent ]
-    })
-    .compileComponents();
+      declarations: [UndoApprovalSharesAccountComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.ts b/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.ts
index b514059f7..9b958f11c 100644
--- a/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.ts
+++ b/src/app/shares/shares-account-actions/undo-approval-shares-account/undo-approval-shares-account.component.ts
@@ -14,7 +14,6 @@ import { SharesService } from 'app/shares/shares.service';
   styleUrls: ['./undo-approval-shares-account.component.scss']
 })
 export class UndoApprovalSharesAccountComponent {
-
   /** Shares Account Id */
   accountId: any;
 
@@ -23,9 +22,11 @@ export class UndoApprovalSharesAccountComponent {
    * @param {ActivatedRoute} route Activated Route
    * @param {Router} router Router
    */
-  constructor(private sharesService: SharesService,
-              private route: ActivatedRoute,
-              private router: Router) {
+  constructor(
+    private sharesService: SharesService,
+    private route: ActivatedRoute,
+    private router: Router
+  ) {
     this.accountId = this.route.parent.snapshot.params['shareAccountId'];
   }
 
@@ -38,5 +39,4 @@ export class UndoApprovalSharesAccountComponent {
       this.router.navigate(['../../'], { relativeTo: this.route });
     });
   }
-
 }
diff --git a/src/app/shares/shares-account-stepper/shares-account-charges-step/shares-account-charges-step.component.spec.ts b/src/app/shares/shares-account-stepper/shares-account-charges-step/shares-account-charges-step.component.spec.ts
index 71bd37ed8..e12f75d64 100644
--- a/src/app/shares/shares-account-stepper/shares-account-charges-step/shares-account-charges-step.component.spec.ts
+++ b/src/app/shares/shares-account-stepper/shares-account-charges-step/shares-account-charges-step.component.spec.ts
@@ -8,9 +8,8 @@ describe('SharesAccountChargesStepComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ SharesAccountChargesStepComponent ]
-    })
-    .compileComponents();
+      declarations: [SharesAccountChargesStepComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-stepper/shares-account-charges-step/shares-account-charges-step.component.ts b/src/app/shares/shares-account-stepper/shares-account-charges-step/shares-account-charges-step.component.ts
index d0f74a4cc..1a0cd3496 100644
--- a/src/app/shares/shares-account-stepper/shares-account-charges-step/shares-account-charges-step.component.ts
+++ b/src/app/shares/shares-account-stepper/shares-account-charges-step/shares-account-charges-step.component.ts
@@ -21,7 +21,6 @@ import { TranslateService } from '@ngx-translate/core';
   styleUrls: ['./shares-account-charges-step.component.scss']
 })
 export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
-
   /** Shares Account Product Template */
   @Input() sharesAccountProductTemplate: any;
   /** Shares Account Template */
@@ -38,13 +37,21 @@ export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
   /** For Edit Shares Account Form */
   isChargesPatched = false;
   /** Display columns for charges table */
-  displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'action'];
+  displayedColumns: string[] = [
+    'name',
+    'chargeCalculationType',
+    'amount',
+    'chargeTimeType',
+    'action'
+  ];
 
   /**
    * @param {MatDialog} dialog Mat Dialog
    */
-  constructor(private dialog: MatDialog,
-      private translateService: TranslateService) { }
+  constructor(
+    private dialog: MatDialog,
+    private translateService: TranslateService
+  ) {}
 
   ngOnInit() {
     this.currencyCode.valueChanges.subscribe(() => {
@@ -85,8 +92,9 @@ export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
         label: this.translateService.instant('labels.inputs.Amount'),
         value: charge.amount || charge.amountOrPercentage,
         type: 'number',
-        required: false,
-      }),
+        required: false
+      })
+
     ];
     const data = {
       title: this.translateService.instant('labels.heading.Edit Charge'),
@@ -127,5 +135,4 @@ export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
   get sharesAccountCharges() {
     return { charges: this.chargesDataSource };
   }
-
 }
diff --git a/src/app/shares/shares-account-stepper/shares-account-details-step/shares-account-details-step.component.spec.ts b/src/app/shares/shares-account-stepper/shares-account-details-step/shares-account-details-step.component.spec.ts
index 828994ccb..738bf3610 100644
--- a/src/app/shares/shares-account-stepper/shares-account-details-step/shares-account-details-step.component.spec.ts
+++ b/src/app/shares/shares-account-stepper/shares-account-details-step/shares-account-details-step.component.spec.ts
@@ -8,9 +8,8 @@ describe('SharesAccountDetailsStepComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ SharesAccountDetailsStepComponent ]
-    })
-    .compileComponents();
+      declarations: [SharesAccountDetailsStepComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-stepper/shares-account-details-step/shares-account-details-step.component.ts b/src/app/shares/shares-account-stepper/shares-account-details-step/shares-account-details-step.component.ts
index a63680fa9..8d3e2ec50 100644
--- a/src/app/shares/shares-account-stepper/shares-account-details-step/shares-account-details-step.component.ts
+++ b/src/app/shares/shares-account-stepper/shares-account-details-step/shares-account-details-step.component.ts
@@ -15,7 +15,6 @@ import { SharesService } from 'app/shares/shares.service';
   styleUrls: ['./shares-account-details-step.component.scss']
 })
 export class SharesAccountDetailsStepComponent implements OnInit {
-
   /** Shares Account Template */
   @Input() sharesAccountTemplate: any;
 
@@ -37,9 +36,11 @@ export class SharesAccountDetailsStepComponent implements OnInit {
    * @param {SharesService} sharesService Shares Service.
    * @param {SettingsService} settingsService Settings Service
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private sharesService: SharesService,
-              private settingsService: SettingsService) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private sharesService: SharesService,
+    private settingsService: SettingsService
+  ) {
     this.createSharesAccountDetailsForm();
   }
 
@@ -50,9 +51,11 @@ export class SharesAccountDetailsStepComponent implements OnInit {
       this.productData = this.sharesAccountTemplate.productOptions;
       if (this.sharesAccountTemplate.productId) {
         this.sharesAccountDetailsForm.patchValue({
-          'productId': this.sharesAccountTemplate.productId,
-          'submittedDate': this.sharesAccountTemplate.timeline.submittedOnDate && new Date(this.sharesAccountTemplate.timeline.submittedOnDate),
-          'externalId': this.sharesAccountTemplate.externalId
+          productId: this.sharesAccountTemplate.productId,
+          submittedDate:
+            this.sharesAccountTemplate.timeline.submittedOnDate &&
+            new Date(this.sharesAccountTemplate.timeline.submittedOnDate),
+          externalId: this.sharesAccountTemplate.externalId
         });
       }
     }
@@ -63,9 +66,15 @@ export class SharesAccountDetailsStepComponent implements OnInit {
    */
   createSharesAccountDetailsForm() {
     this.sharesAccountDetailsForm = this.formBuilder.group({
-      'productId': ['', Validators.required],
-      'submittedDate': ['', Validators.required],
-      'externalId': ['']
+      productId: [
+        '',
+        Validators.required
+      ],
+      submittedDate: [
+        '',
+        Validators.required
+      ],
+      externalId: ['']
     });
   }
 
@@ -87,5 +96,4 @@ export class SharesAccountDetailsStepComponent implements OnInit {
   get sharesAccountDetails() {
     return this.sharesAccountDetailsForm.value;
   }
-
 }
diff --git a/src/app/shares/shares-account-stepper/shares-account-preview-step/shares-account-preview-step.component.spec.ts b/src/app/shares/shares-account-stepper/shares-account-preview-step/shares-account-preview-step.component.spec.ts
index 047029a76..b034c98e6 100644
--- a/src/app/shares/shares-account-stepper/shares-account-preview-step/shares-account-preview-step.component.spec.ts
+++ b/src/app/shares/shares-account-stepper/shares-account-preview-step/shares-account-preview-step.component.spec.ts
@@ -8,9 +8,8 @@ describe('SharesAccountPreviewStepComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ SharesAccountPreviewStepComponent ]
-    })
-    .compileComponents();
+      declarations: [SharesAccountPreviewStepComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-stepper/shares-account-preview-step/shares-account-preview-step.component.ts b/src/app/shares/shares-account-stepper/shares-account-preview-step/shares-account-preview-step.component.ts
index e22abba8a..42c75c15e 100644
--- a/src/app/shares/shares-account-stepper/shares-account-preview-step/shares-account-preview-step.component.ts
+++ b/src/app/shares/shares-account-stepper/shares-account-preview-step/shares-account-preview-step.component.ts
@@ -10,7 +10,6 @@ import { Component, Input, Output, EventEmitter } from '@angular/core';
   styleUrls: ['./shares-account-preview-step.component.scss']
 })
 export class SharesAccountPreviewStepComponent {
-
   /** Shares Account Product Template */
   @Input() sharesAccountProductTemplate: any;
   /** Shares Account Template */
@@ -21,11 +20,15 @@ export class SharesAccountPreviewStepComponent {
   @Input() sharesAccount: any;
 
   /** Display columns for charges table. */
-  chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType'];
+  chargesDisplayedColumns: string[] = [
+    'name',
+    'chargeCalculationType',
+    'amount',
+    'chargeTimeType'
+  ];
 
   /** Form submission event */
   @Output() submitEvent = new EventEmitter();
 
-  constructor() { }
-
+  constructor() {}
 }
diff --git a/src/app/shares/shares-account-stepper/shares-account-terms-step/shares-account-terms-step.component.spec.ts b/src/app/shares/shares-account-stepper/shares-account-terms-step/shares-account-terms-step.component.spec.ts
index cf269b09c..b329d91d3 100644
--- a/src/app/shares/shares-account-stepper/shares-account-terms-step/shares-account-terms-step.component.spec.ts
+++ b/src/app/shares/shares-account-stepper/shares-account-terms-step/shares-account-terms-step.component.spec.ts
@@ -8,9 +8,8 @@ describe('SharesAccountTermsStepComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ SharesAccountTermsStepComponent ]
-    })
-    .compileComponents();
+      declarations: [SharesAccountTermsStepComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-stepper/shares-account-terms-step/shares-account-terms-step.component.ts b/src/app/shares/shares-account-stepper/shares-account-terms-step/shares-account-terms-step.component.ts
index 2f1239e94..3d4e725cc 100644
--- a/src/app/shares/shares-account-stepper/shares-account-terms-step/shares-account-terms-step.component.ts
+++ b/src/app/shares/shares-account-stepper/shares-account-terms-step/shares-account-terms-step.component.ts
@@ -13,7 +13,6 @@ import { Currency } from 'app/shared/models/general.model';
   styleUrls: ['./shares-account-terms-step.component.scss']
 })
 export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
-
   /** Shares Account and Product Template */
   @Input() sharesAccountProductTemplate: any;
   /** [Optional] Shares Account Template */
@@ -40,8 +39,10 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
    * @param {FormBuilder} formBuilder Form Builder
    * @param {SettingsService} settingsService Settings Service
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-    private settingsService: SettingsService) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private settingsService: SettingsService
+  ) {
     this.createSharesAccountTermsForm();
   }
 
@@ -49,11 +50,11 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
     if (this.sharesAccountProductTemplate) {
       this.currency = this.sharesAccountProductTemplate.currency;
       this.sharesAccountTermsForm.patchValue({
-        'currencyCode': this.sharesAccountProductTemplate.currency.code,
-        'decimal': this.sharesAccountProductTemplate.currency.decimalPlaces,
-        'currencyMultiple': this.sharesAccountProductTemplate.currency.inMultiplesOf,
-        'unitPrice': this.sharesAccountProductTemplate.currentMarketPrice,
-        'savingsAccountId': ''
+        currencyCode: this.sharesAccountProductTemplate.currency.code,
+        decimal: this.sharesAccountProductTemplate.currency.decimalPlaces,
+        currencyMultiple: this.sharesAccountProductTemplate.currency.inMultiplesOf,
+        unitPrice: this.sharesAccountProductTemplate.currentMarketPrice,
+        savingsAccountId: ''
       });
       this.setOptions();
       if (this.sharesAccountTemplate) {
@@ -69,13 +70,18 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
     this.maxDate = this.settingsService.businessDate;
     if (this.sharesAccountTemplate) {
       this.sharesAccountTermsForm.patchValue({
-        'requestedShares': this.sharesAccountTemplate.summary.totalPendingForApprovalShares,
-        'minimumActivePeriod': this.sharesAccountTemplate.minimumActivePeriod,
-        'minimumActivePeriodFrequencyType': this.sharesAccountTemplate.minimumActivePeriod && this.sharesAccountTemplate.minimumActivePeriodTypeEnum.id,
-        'lockinPeriodFrequency': this.sharesAccountTemplate.lockinPeriod,
-        'lockinPeriodFrequencyType': this.sharesAccountTemplate.lockinPeriod && this.sharesAccountTemplate.lockPeriodTypeEnum.id,
-        'applicationDate': this.sharesAccountTemplate.purchasedShares[0].purchasedDate && new Date(this.sharesAccountTemplate.purchasedShares[0].purchasedDate),
-        'allowDividendCalculationForInactiveClients': this.sharesAccountTemplate.allowDividendCalculationForInactiveClients
+        requestedShares: this.sharesAccountTemplate.summary.totalPendingForApprovalShares,
+        minimumActivePeriod: this.sharesAccountTemplate.minimumActivePeriod,
+        minimumActivePeriodFrequencyType:
+          this.sharesAccountTemplate.minimumActivePeriod && this.sharesAccountTemplate.minimumActivePeriodTypeEnum.id,
+        lockinPeriodFrequency: this.sharesAccountTemplate.lockinPeriod,
+        lockinPeriodFrequencyType:
+          this.sharesAccountTemplate.lockinPeriod && this.sharesAccountTemplate.lockPeriodTypeEnum.id,
+        applicationDate:
+          this.sharesAccountTemplate.purchasedShares[0].purchasedDate &&
+          new Date(this.sharesAccountTemplate.purchasedShares[0].purchasedDate),
+        allowDividendCalculationForInactiveClients:
+          this.sharesAccountTemplate.allowDividendCalculationForInactiveClients
       });
     }
   }
@@ -85,18 +91,27 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
    */
   createSharesAccountTermsForm() {
     this.sharesAccountTermsForm = this.formBuilder.group({
-      'currencyCode': [{value: '', disabled: true}],
-      'decimal': [{value: '',  disabled: true}],
-      'requestedShares': ['', Validators.required],
-      'unitPrice': [{value: '',  disabled: true}],
-      'currencyMultiple': [{value: '', disabled: true}],
-      'savingsAccountId': ['', Validators.required],
-      'minimumActivePeriod': [''],
-      'minimumActivePeriodFrequencyType': [''],
-      'lockinPeriodFrequency': [''],
-      'lockinPeriodFrequencyType': [''],
-      'applicationDate': ['', Validators.required],
-      'allowDividendCalculationForInactiveClients': [false]
+      currencyCode: [{ value: '', disabled: true }],
+      decimal: [{ value: '', disabled: true }],
+      requestedShares: [
+        '',
+        Validators.required
+      ],
+      unitPrice: [{ value: '', disabled: true }],
+      currencyMultiple: [{ value: '', disabled: true }],
+      savingsAccountId: [
+        '',
+        Validators.required
+      ],
+      minimumActivePeriod: [''],
+      minimumActivePeriodFrequencyType: [''],
+      lockinPeriodFrequency: [''],
+      lockinPeriodFrequencyType: [''],
+      applicationDate: [
+        '',
+        Validators.required
+      ],
+      allowDividendCalculationForInactiveClients: [false]
     });
   }
 
@@ -104,7 +119,8 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
    * Sets all select dropdown options.
    */
   setOptions() {
-    this.minimumActivePeriodFrequencyTypeData = this.sharesAccountProductTemplate.minimumActivePeriodFrequencyTypeOptions;
+    this.minimumActivePeriodFrequencyTypeData =
+      this.sharesAccountProductTemplate.minimumActivePeriodFrequencyTypeOptions;
     this.lockinPeriodFrequencyTypeData = this.sharesAccountProductTemplate.lockinPeriodFrequencyTypeOptions;
     this.savingsAccountsData = this.sharesAccountProductTemplate.clientSavingsAccounts;
   }
@@ -122,5 +138,4 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
     }
     return 0;
   }
-
 }
diff --git a/src/app/shares/shares-account-view/charges-tab/charges-tab.component.spec.ts b/src/app/shares/shares-account-view/charges-tab/charges-tab.component.spec.ts
index 1ef118215..0733958ac 100644
--- a/src/app/shares/shares-account-view/charges-tab/charges-tab.component.spec.ts
+++ b/src/app/shares/shares-account-view/charges-tab/charges-tab.component.spec.ts
@@ -8,9 +8,8 @@ describe('ChargesTabComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ChargesTabComponent ]
-    })
-    .compileComponents();
+      declarations: [ChargesTabComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-view/charges-tab/charges-tab.component.ts b/src/app/shares/shares-account-view/charges-tab/charges-tab.component.ts
index 9b1dafed1..7f40c023b 100644
--- a/src/app/shares/shares-account-view/charges-tab/charges-tab.component.ts
+++ b/src/app/shares/shares-account-view/charges-tab/charges-tab.component.ts
@@ -12,7 +12,6 @@ import { ActivatedRoute } from '@angular/router';
   styleUrls: ['./charges-tab.component.scss']
 })
 export class ChargesTabComponent implements OnInit {
-
   /** Shares Account Data */
   sharesAccountData: any;
   /** Charges Data */
@@ -20,7 +19,17 @@ export class ChargesTabComponent implements OnInit {
   /** Data source for charges table. */
   dataSource: MatTableDataSource;
   /** Columns to be displayed in charges table. */
-  displayedColumns: string[] = ['name', 'feeOrPenalty', 'paymentDueAt', 'calculationType', 'due', 'paid', 'waived', 'outstanding', 'actions' ];
+  displayedColumns: string[] = [
+    'name',
+    'feeOrPenalty',
+    'paymentDueAt',
+    'calculationType',
+    'due',
+    'paid',
+    'waived',
+    'outstanding',
+    'actions'
+  ];
 
   /**
    * Retrieves shares account aata from `resolve`.
@@ -35,8 +44,7 @@ export class ChargesTabComponent implements OnInit {
   }
 
   ngOnInit() {
-    const activeCharges = this.chargesData ? this.chargesData.filter(charge => charge.isActive) : [];
+    const activeCharges = this.chargesData ? this.chargesData.filter((charge) => charge.isActive) : [];
     this.dataSource = new MatTableDataSource(activeCharges);
   }
-
 }
diff --git a/src/app/shares/shares-account-view/dividends-tab/dividends-tab.component.spec.ts b/src/app/shares/shares-account-view/dividends-tab/dividends-tab.component.spec.ts
index 0d82e4718..94ea885df 100644
--- a/src/app/shares/shares-account-view/dividends-tab/dividends-tab.component.spec.ts
+++ b/src/app/shares/shares-account-view/dividends-tab/dividends-tab.component.spec.ts
@@ -8,9 +8,8 @@ describe('DividendsTabComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ DividendsTabComponent ]
-    })
-    .compileComponents();
+      declarations: [DividendsTabComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-view/dividends-tab/dividends-tab.component.ts b/src/app/shares/shares-account-view/dividends-tab/dividends-tab.component.ts
index d563dcf44..9e1ab3797 100644
--- a/src/app/shares/shares-account-view/dividends-tab/dividends-tab.component.ts
+++ b/src/app/shares/shares-account-view/dividends-tab/dividends-tab.component.ts
@@ -12,7 +12,6 @@ import { ActivatedRoute } from '@angular/router';
   styleUrls: ['./dividends-tab.component.scss']
 })
 export class DividendsTabComponent implements OnInit {
-
   /** Shares Account Data */
   shareAccountData: any;
   /** Dividends Data */
@@ -41,5 +40,4 @@ export class DividendsTabComponent implements OnInit {
   ngOnInit() {
     this.dataSource = new MatTableDataSource(this.dividendsData);
   }
-
 }
diff --git a/src/app/shares/shares-account-view/general-tab/general-tab.component.spec.ts b/src/app/shares/shares-account-view/general-tab/general-tab.component.spec.ts
index 23d4dfb2b..c0c1ba0aa 100644
--- a/src/app/shares/shares-account-view/general-tab/general-tab.component.spec.ts
+++ b/src/app/shares/shares-account-view/general-tab/general-tab.component.spec.ts
@@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ GeneralTabComponent ]
-    })
-    .compileComponents();
+      declarations: [GeneralTabComponent]
+    }).compileComponents();
 
     fixture = TestBed.createComponent(GeneralTabComponent);
     component = fixture.componentInstance;
diff --git a/src/app/shares/shares-account-view/general-tab/general-tab.component.ts b/src/app/shares/shares-account-view/general-tab/general-tab.component.ts
index 007a4b8d3..4ca00c74c 100644
--- a/src/app/shares/shares-account-view/general-tab/general-tab.component.ts
+++ b/src/app/shares/shares-account-view/general-tab/general-tab.component.ts
@@ -19,5 +19,4 @@ export class GeneralTabComponent {
       this.sharesAccountData = data.sharesAccountData;
     });
   }
-
 }
diff --git a/src/app/shares/shares-account-view/shares-account-view.component.spec.ts b/src/app/shares/shares-account-view/shares-account-view.component.spec.ts
index f65036d2e..59b862e3f 100644
--- a/src/app/shares/shares-account-view/shares-account-view.component.spec.ts
+++ b/src/app/shares/shares-account-view/shares-account-view.component.spec.ts
@@ -8,9 +8,8 @@ describe('SharesAccountViewComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ SharesAccountViewComponent ]
-    })
-    .compileComponents();
+      declarations: [SharesAccountViewComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-view/shares-account-view.component.ts b/src/app/shares/shares-account-view/shares-account-view.component.ts
index f91344c40..84492cdec 100644
--- a/src/app/shares/shares-account-view/shares-account-view.component.ts
+++ b/src/app/shares/shares-account-view/shares-account-view.component.ts
@@ -21,7 +21,6 @@ import { SharesButtonsConfiguration } from './shares-buttons.config';
   styleUrls: ['./shares-account-view.component.scss']
 })
 export class SharesAccountViewComponent implements OnInit {
-
   /** Shares Account Data */
   sharesAccountData: any;
   /** Button Configurations */
@@ -36,10 +35,12 @@ export class SharesAccountViewComponent implements OnInit {
    * @param {SharesService} sharesService Shares Service
    * @param {MatDialog} dialog Mat Dialog
    */
-  constructor(private route: ActivatedRoute,
-              private router: Router,
-              private sharesService: SharesService,
-              public dialog: MatDialog) {
+  constructor(
+    private route: ActivatedRoute,
+    private router: Router,
+    private sharesService: SharesService,
+    public dialog: MatDialog
+  ) {
     this.route.data.subscribe((data: { sharesAccountData: any }) => {
       this.sharesAccountData = data.sharesAccountData;
     });
@@ -77,7 +78,10 @@ export class SharesAccountViewComponent implements OnInit {
       const purchasedShares: any[] = this.sharesAccountData.purchasedShares;
       let sharesPendingForApproval = false;
       purchasedShares.forEach((share: any) => {
-        if (share.status.code === 'purchasedSharesStatusType.applied' && share.type.code === 'purchasedSharesType.purchased') {
+        if (
+          share.status.code === 'purchasedSharesStatusType.applied' &&
+          share.type.code === 'purchasedSharesType.purchased'
+        ) {
           sharesPendingForApproval = true;
         }
       });
@@ -129,5 +133,4 @@ export class SharesAccountViewComponent implements OnInit {
       }
     });
   }
-
 }
diff --git a/src/app/shares/shares-account-view/shares-buttons.config.ts b/src/app/shares/shares-account-view/shares-buttons.config.ts
index 5406b3e13..67412a204 100644
--- a/src/app/shares/shares-account-view/shares-buttons.config.ts
+++ b/src/app/shares/shares-account-view/shares-buttons.config.ts
@@ -1,15 +1,14 @@
 /** Shares Account Buttons Configuration */
 export class SharesButtonsConfiguration {
-
   optionArray: {
-    name: string,
-    taskPermissionName: string,
+    name: string;
+    taskPermissionName: string;
   }[];
 
   buttonsArray: {
-    name: string,
-    icon: string,
-    taskPermissionName: string,
+    name: string;
+    icon: string;
+    taskPermissionName: string;
   }[];
 
   constructor(status: string) {
@@ -86,7 +85,7 @@ export class SharesButtonsConfiguration {
 
   setOptions(status: string) {
     switch (status) {
-        case 'Active':
+      case 'Active':
         this.optionArray = [
           {
             name: 'Close',
@@ -112,14 +111,13 @@ export class SharesButtonsConfiguration {
     }
   }
 
-  addOption(option: {name: string, taskPermissionName: string}) {
+  addOption(option: { name: string; taskPermissionName: string }) {
     this.optionArray.push(option);
   }
 
   removeButton(name: string) {
-    const buttonNames = this.buttonsArray.map(entry => entry.name);
+    const buttonNames = this.buttonsArray.map((entry) => entry.name);
     const index = buttonNames.indexOf(name);
     this.buttonsArray.splice(index, 1);
   }
-
 }
diff --git a/src/app/shares/shares-account-view/transactions-tab/transactions-tab.component.spec.ts b/src/app/shares/shares-account-view/transactions-tab/transactions-tab.component.spec.ts
index a67fc2279..0175d84c6 100644
--- a/src/app/shares/shares-account-view/transactions-tab/transactions-tab.component.spec.ts
+++ b/src/app/shares/shares-account-view/transactions-tab/transactions-tab.component.spec.ts
@@ -8,9 +8,8 @@ describe('TransactionsTabComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ TransactionsTabComponent ]
-    })
-    .compileComponents();
+      declarations: [TransactionsTabComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/shares/shares-account-view/transactions-tab/transactions-tab.component.ts b/src/app/shares/shares-account-view/transactions-tab/transactions-tab.component.ts
index b7588c8e7..15776d2d0 100644
--- a/src/app/shares/shares-account-view/transactions-tab/transactions-tab.component.ts
+++ b/src/app/shares/shares-account-view/transactions-tab/transactions-tab.component.ts
@@ -12,7 +12,6 @@ import { ActivatedRoute } from '@angular/router';
   styleUrls: ['./transactions-tab.component.scss']
 })
 export class TransactionsTabComponent implements OnInit {
-
   /** Shares Account Data */
   shareAccountData: any;
   /** Transactions Data */
@@ -43,5 +42,4 @@ export class TransactionsTabComponent implements OnInit {
   ngOnInit() {
     this.dataSource = new MatTableDataSource(this.transactionsData);
   }
-
 }
diff --git a/src/app/shares/shares-routing.module.ts b/src/app/shares/shares-routing.module.ts
index 4be5242f7..8c370e720 100644
--- a/src/app/shares/shares-routing.module.ts
+++ b/src/app/shares/shares-routing.module.ts
@@ -54,7 +54,7 @@ const routes: Routes = [
                 data: { title: 'Shares Account General', breadcrumb: 'General', routeParamBreadcrumb: false },
                 resolve: {
                   sharesAccountData: SharesAccountViewResolver
-                },
+                }
               },
               {
                 path: 'transactions',
@@ -90,7 +90,7 @@ const routes: Routes = [
             }
           }
         ]
-      },
+      }
     ]
   }
 ];
@@ -108,4 +108,4 @@ const routes: Routes = [
     ShareAccountActionsResolver
   ]
 })
-export class SharesRoutingModule { }
+export class SharesRoutingModule {}
diff --git a/src/app/shares/shares.module.ts b/src/app/shares/shares.module.ts
index dc672874e..a03d9aebe 100644
--- a/src/app/shares/shares.module.ts
+++ b/src/app/shares/shares.module.ts
@@ -67,6 +67,6 @@ import { GeneralTabComponent } from './shares-account-view/general-tab/general-t
     RejectShareDialogComponent,
     GeneralTabComponent
   ],
-  providers: [ ]
+  providers: []
 })
-export class SharesModule { }
+export class SharesModule {}
diff --git a/src/app/shares/shares.service.ts b/src/app/shares/shares.service.ts
index be480d43a..bffbe39d3 100644
--- a/src/app/shares/shares.service.ts
+++ b/src/app/shares/shares.service.ts
@@ -12,7 +12,6 @@ import { Observable } from 'rxjs';
   providedIn: 'root'
 })
 export class SharesService {
-
   /**
    * @param {HttpClient} http Http Client
    */
@@ -74,5 +73,4 @@ export class SharesService {
     const httpParams = new HttpParams().set('command', command);
     return this.http.post(`/accounts/share/${accountId}`, data, { params: httpParams });
   }
-
 }
diff --git a/src/app/system/account-number-preferences/account-number-preferences.component.spec.ts b/src/app/system/account-number-preferences/account-number-preferences.component.spec.ts
index f844393c7..1ec741730 100644
--- a/src/app/system/account-number-preferences/account-number-preferences.component.spec.ts
+++ b/src/app/system/account-number-preferences/account-number-preferences.component.spec.ts
@@ -8,9 +8,8 @@ describe('AccountNumberPreferencesComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ AccountNumberPreferencesComponent ]
-    })
-    .compileComponents();
+      declarations: [AccountNumberPreferencesComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/account-number-preferences/account-number-preferences.component.ts b/src/app/system/account-number-preferences/account-number-preferences.component.ts
index 812c8b829..5a46723fb 100644
--- a/src/app/system/account-number-preferences/account-number-preferences.component.ts
+++ b/src/app/system/account-number-preferences/account-number-preferences.component.ts
@@ -14,7 +14,6 @@ import { ActivatedRoute } from '@angular/router';
   styleUrls: ['./account-number-preferences.component.scss']
 })
 export class AccountNumberPreferencesComponent implements OnInit {
-
   /** Account Number Preferences data. */
   accountNumberPreferencesData: any;
   /** Columns to be displayed in account number preferences table. */
@@ -54,7 +53,8 @@ export class AccountNumberPreferencesComponent implements OnInit {
       return accountNumberPreference.accountType.value;
     };
     this.dataSource.sort = this.sort;
-    this.dataSource.filterPredicate = (data: any, filter: string) => data.accountType.value.toLowerCase().indexOf(filter) !== -1;
+    this.dataSource.filterPredicate = (data: any, filter: string) =>
+      data.accountType.value.toLowerCase().indexOf(filter) !== -1;
   }
 
   /**
diff --git a/src/app/system/account-number-preferences/account-number-preferences.resolver.ts b/src/app/system/account-number-preferences/account-number-preferences.resolver.ts
index ccc7864c2..6fa1f59de 100644
--- a/src/app/system/account-number-preferences/account-number-preferences.resolver.ts
+++ b/src/app/system/account-number-preferences/account-number-preferences.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class AccountNumberPreferencesResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class AccountNumberPreferencesResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getAccountNumberPreferences();
   }
-
 }
diff --git a/src/app/system/account-number-preferences/create-account-number-preference/account-number-preferences-template.resolver.ts b/src/app/system/account-number-preferences/create-account-number-preference/account-number-preferences-template.resolver.ts
index f8e1a46b3..cb8f62023 100644
--- a/src/app/system/account-number-preferences/create-account-number-preference/account-number-preferences-template.resolver.ts
+++ b/src/app/system/account-number-preferences/create-account-number-preference/account-number-preferences-template.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class AccountNumberPreferencesTemplateResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class AccountNumberPreferencesTemplateResolver implements Resolve
   resolve(): Observable {
     return this.systemService.getAccountNumberPreferencesTemplate();
   }
-
 }
diff --git a/src/app/system/account-number-preferences/create-account-number-preference/create-account-number-preference.component.spec.ts b/src/app/system/account-number-preferences/create-account-number-preference/create-account-number-preference.component.spec.ts
index 775ac7777..05c0ef3a5 100644
--- a/src/app/system/account-number-preferences/create-account-number-preference/create-account-number-preference.component.spec.ts
+++ b/src/app/system/account-number-preferences/create-account-number-preference/create-account-number-preference.component.spec.ts
@@ -8,9 +8,8 @@ describe('CreateAccountNumberPreferenceComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CreateAccountNumberPreferenceComponent ]
-    })
-    .compileComponents();
+      declarations: [CreateAccountNumberPreferenceComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/account-number-preferences/create-account-number-preference/create-account-number-preference.component.ts b/src/app/system/account-number-preferences/create-account-number-preference/create-account-number-preference.component.ts
index b744bd084..b1b810e67 100644
--- a/src/app/system/account-number-preferences/create-account-number-preference/create-account-number-preference.component.ts
+++ b/src/app/system/account-number-preferences/create-account-number-preference/create-account-number-preference.component.ts
@@ -15,7 +15,6 @@ import { SystemService } from '../../system.service';
   styleUrls: ['./create-account-number-preference.component.scss']
 })
 export class CreateAccountNumberPreferenceComponent implements OnInit {
-
   /** Account Number Preferences Form */
   accountNumberPreferenceForm: UntypedFormGroup;
   /** Account Number Preferences Template Data */
@@ -30,10 +29,12 @@ export class CreateAccountNumberPreferenceComponent implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    * @param {Router} router Router for navigation.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private route: ActivatedRoute,
-              private router: Router) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private route: ActivatedRoute,
+    private router: Router
+  ) {
     this.route.data.subscribe((data: { accountNumberPreferencesTemplate: any }) => {
       this.accountNumberPreferencesTemplateData = data.accountNumberPreferencesTemplate;
     });
@@ -52,10 +53,12 @@ export class CreateAccountNumberPreferenceComponent implements OnInit {
    * Subscribes on Form Controls to change Prefix Type data.
    */
   getPrefixTypeValue() {
-    this.accountNumberPreferenceForm.get('accountType').valueChanges
-      .subscribe(accountId => {
-        this.prefixTypeData = this.accountNumberPreferencesTemplateData.prefixTypeOptions[`accountType.${this.accountNumberPreferencesTemplateData.accountTypeOptions.find((accountType: any) => accountType.id === accountId).value.toLowerCase()}`];
-      });
+    this.accountNumberPreferenceForm.get('accountType').valueChanges.subscribe((accountId) => {
+      this.prefixTypeData =
+        this.accountNumberPreferencesTemplateData.prefixTypeOptions[
+          `accountType.${this.accountNumberPreferencesTemplateData.accountTypeOptions.find((accountType: any) => accountType.id === accountId).value.toLowerCase()}`
+        ];
+    });
   }
 
   /**
@@ -63,8 +66,11 @@ export class CreateAccountNumberPreferenceComponent implements OnInit {
    */
   createAccountNumberPreferenceForm() {
     this.accountNumberPreferenceForm = this.formBuilder.group({
-      'accountType': ['', Validators.required],
-      'prefixType': ['']
+      accountType: [
+        '',
+        Validators.required
+      ],
+      prefixType: ['']
     });
   }
 
@@ -77,10 +83,14 @@ export class CreateAccountNumberPreferenceComponent implements OnInit {
     if (accountNumberPreference.prefixType === '') {
       accountNumberPreference.prefixType = undefined;
     }
-    this.systemService.createAccountNumberPreference(accountNumberPreference)
-      .subscribe((response: any) => {
-        this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
-      });
+    this.systemService.createAccountNumberPreference(accountNumberPreference).subscribe((response: any) => {
+      this.router.navigate(
+        [
+          '../',
+          response.resourceId
+        ],
+        { relativeTo: this.route }
+      );
+    });
   }
-
 }
diff --git a/src/app/system/account-number-preferences/edit-account-number-preference/edit-account-number-preference.component.spec.ts b/src/app/system/account-number-preferences/edit-account-number-preference/edit-account-number-preference.component.spec.ts
index 7b564e51e..c8ec52b53 100644
--- a/src/app/system/account-number-preferences/edit-account-number-preference/edit-account-number-preference.component.spec.ts
+++ b/src/app/system/account-number-preferences/edit-account-number-preference/edit-account-number-preference.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditAccountNumberPreferenceComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditAccountNumberPreferenceComponent ]
-    })
-    .compileComponents();
+      declarations: [EditAccountNumberPreferenceComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/account-number-preferences/edit-account-number-preference/edit-account-number-preference.component.ts b/src/app/system/account-number-preferences/edit-account-number-preference/edit-account-number-preference.component.ts
index 0e75f5493..6386a28a7 100644
--- a/src/app/system/account-number-preferences/edit-account-number-preference/edit-account-number-preference.component.ts
+++ b/src/app/system/account-number-preferences/edit-account-number-preference/edit-account-number-preference.component.ts
@@ -15,7 +15,6 @@ import { SystemService } from 'app/system/system.service';
   styleUrls: ['./edit-account-number-preference.component.scss']
 })
 export class EditAccountNumberPreferenceComponent implements OnInit {
-
   /** Account Number Preference Form */
   accountNumberPreferenceForm: UntypedFormGroup;
   /** Account Number Preference Data */
@@ -32,11 +31,13 @@ export class EditAccountNumberPreferenceComponent implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    * @param {Router} router Router for navigation.
    */
-  constructor(private route: ActivatedRoute,
-              private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private router: Router) {
-    this.route.data.subscribe((data: { accountNumberPreference: any, accountNumberPreferencesTemplate: any }) => {
+  constructor(
+    private route: ActivatedRoute,
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private router: Router
+  ) {
+    this.route.data.subscribe((data: { accountNumberPreference: any; accountNumberPreferencesTemplate: any }) => {
       this.accountNumberPreferenceData = data.accountNumberPreference;
       this.accountNumberPreferencesTemplateData = data.accountNumberPreferencesTemplate;
     });
@@ -47,7 +48,8 @@ export class EditAccountNumberPreferenceComponent implements OnInit {
    * Creates and sets account number preference form.
    */
   ngOnInit() {
-    this.prefixTypeData = this.accountNumberPreferencesTemplateData.prefixTypeOptions[this.accountNumberPreferenceData.accountType.code];
+    this.prefixTypeData =
+      this.accountNumberPreferencesTemplateData.prefixTypeOptions[this.accountNumberPreferenceData.accountType.code];
     this.createAccountNumberPreferenceForm();
   }
 
@@ -56,8 +58,11 @@ export class EditAccountNumberPreferenceComponent implements OnInit {
    */
   createAccountNumberPreferenceForm() {
     this.accountNumberPreferenceForm = this.formBuilder.group({
-      'accountType': [{ value: this.accountNumberPreferenceData.accountType.id, disabled: true }, Validators.required],
-      'prefixType': [this.accountNumberPreferenceData.prefixType ? this.accountNumberPreferenceData.prefixType.id : 0]
+      accountType: [
+        { value: this.accountNumberPreferenceData.accountType.id, disabled: true },
+        Validators.required
+      ],
+      prefixType: [this.accountNumberPreferenceData.prefixType ? this.accountNumberPreferenceData.prefixType.id : 0]
     });
   }
 
@@ -70,10 +75,10 @@ export class EditAccountNumberPreferenceComponent implements OnInit {
     if (accountNumberPreferenceValue.prefixType === '') {
       accountNumberPreferenceValue.prefixType = undefined;
     }
-    this.systemService.updateAccountNumberPreference(this.accountNumberPreferenceData.id, accountNumberPreferenceValue)
+    this.systemService
+      .updateAccountNumberPreference(this.accountNumberPreferenceData.id, accountNumberPreferenceValue)
       .subscribe((response: any) => {
         this.router.navigate(['../'], { relativeTo: this.route });
       });
   }
-
 }
diff --git a/src/app/system/account-number-preferences/view-account-number-preference/account-number-preference.resolver.ts b/src/app/system/account-number-preferences/view-account-number-preference/account-number-preference.resolver.ts
index 9527518c9..f753c71ae 100644
--- a/src/app/system/account-number-preferences/view-account-number-preference/account-number-preference.resolver.ts
+++ b/src/app/system/account-number-preferences/view-account-number-preference/account-number-preference.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class AccountNumberPreferenceResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -27,5 +26,4 @@ export class AccountNumberPreferenceResolver implements Resolve {
     const accountNumberPreferenceId = route.paramMap.get('id');
     return this.systemService.getAccountNumberPreference(accountNumberPreferenceId);
   }
-
 }
diff --git a/src/app/system/account-number-preferences/view-account-number-preference/view-account-number-preference.component.spec.ts b/src/app/system/account-number-preferences/view-account-number-preference/view-account-number-preference.component.spec.ts
index 75549a1c7..9f4fb3951 100644
--- a/src/app/system/account-number-preferences/view-account-number-preference/view-account-number-preference.component.spec.ts
+++ b/src/app/system/account-number-preferences/view-account-number-preference/view-account-number-preference.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewAccountNumberPreferenceComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewAccountNumberPreferenceComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewAccountNumberPreferenceComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/account-number-preferences/view-account-number-preference/view-account-number-preference.component.ts b/src/app/system/account-number-preferences/view-account-number-preference/view-account-number-preference.component.ts
index 998a8e24e..3c43798bd 100644
--- a/src/app/system/account-number-preferences/view-account-number-preference/view-account-number-preference.component.ts
+++ b/src/app/system/account-number-preferences/view-account-number-preference/view-account-number-preference.component.ts
@@ -19,7 +19,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co
   styleUrls: ['./view-account-number-preference.component.scss']
 })
 export class ViewAccountNumberPreferenceComponent {
-
   /** Account Number Preference Data */
   accountNumberPreferenceData: any;
 
@@ -31,11 +30,13 @@ export class ViewAccountNumberPreferenceComponent {
    * @param {MatDialog} dialog Dialog reference.
    * @param {TranslateService} translateService Translate Service.
    */
-  constructor(private route: ActivatedRoute,
-              private systemService: SystemService,
-              private router: Router,
-              private dialog: MatDialog,
-              private translateService: TranslateService) {
+  constructor(
+    private route: ActivatedRoute,
+    private systemService: SystemService,
+    private router: Router,
+    private dialog: MatDialog,
+    private translateService: TranslateService
+  ) {
     this.route.data.subscribe((data: { accountNumberPreference: any }) => {
       this.accountNumberPreferenceData = data.accountNumberPreference;
     });
@@ -46,16 +47,19 @@ export class ViewAccountNumberPreferenceComponent {
    */
   delete() {
     const deleteAccountNumberPreferenceDialogRef = this.dialog.open(DeleteDialogComponent, {
-      data: { deleteContext: this.translateService.instant('labels.heading.Account Number Preferences') + ' ' + this.accountNumberPreferenceData.id}
+      data: {
+        deleteContext:
+          this.translateService.instant('labels.heading.Account Number Preferences') +
+          ' ' +
+          this.accountNumberPreferenceData.id
+      }
     });
     deleteAccountNumberPreferenceDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
-        this.systemService.deleteAccountNumberPreference(this.accountNumberPreferenceData.id)
-          .subscribe(() => {
-            this.router.navigate(['/system/account-number-preferences']);
-          });
+        this.systemService.deleteAccountNumberPreference(this.accountNumberPreferenceData.id).subscribe(() => {
+          this.router.navigate(['/system/account-number-preferences']);
+        });
       }
     });
   }
-
 }
diff --git a/src/app/system/audit-trails/audit-trail-search-template.resolver.ts b/src/app/system/audit-trails/audit-trail-search-template.resolver.ts
index 48a43a142..ea0051557 100644
--- a/src/app/system/audit-trails/audit-trail-search-template.resolver.ts
+++ b/src/app/system/audit-trails/audit-trail-search-template.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class AuditTrailSearchTemplateResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class AuditTrailSearchTemplateResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getAuditTrailSearchTemplate();
   }
-
 }
diff --git a/src/app/system/audit-trails/audit-trail.datasource.ts b/src/app/system/audit-trails/audit-trail.datasource.ts
index f7a976781..9c09c0ed2 100644
--- a/src/app/system/audit-trails/audit-trail.datasource.ts
+++ b/src/app/system/audit-trails/audit-trail.datasource.ts
@@ -11,7 +11,6 @@ import { SystemService } from '../system.service';
  * Audit Trails custom data source to implement server side filtering, pagination and sorting.
  */
 export class AuditTrailsDataSource implements DataSource {
-
   /** Audit Trails behavior subject to represent loaded audit trails page. */
   private auditTrailsSubject = new BehaviorSubject([]);
   /** Records subject to represent total number of filtered audit trail records. */
@@ -23,7 +22,7 @@ export class AuditTrailsDataSource implements DataSource {
   /**
    * @param {SystemService} systemService System Service.
    */
-  constructor(private systemService: SystemService) { }
+  constructor(private systemService: SystemService) {}
 
   /**
    * Gets audit trails on the basis of provided parameters and emits the value.
@@ -33,9 +32,16 @@ export class AuditTrailsDataSource implements DataSource {
    * @param {number} pageIndex Page number.
    * @param {number} limit Number of entries within the page.
    */
-  getAuditTrails(filterBy: any, orderBy: string = '', sortOrder: string = '', pageIndex: number = 0, limit: number = 10) {
+  getAuditTrails(
+    filterBy: any,
+    orderBy: string = '',
+    sortOrder: string = '',
+    pageIndex: number = 0,
+    limit: number = 10
+  ) {
     this.auditTrailsSubject.next([]);
-    this.systemService.getAuditTrails(filterBy, orderBy, sortOrder, pageIndex * limit, limit)
+    this.systemService
+      .getAuditTrails(filterBy, orderBy, sortOrder, pageIndex * limit, limit)
       .subscribe((auditTrails: any) => {
         this.recordsSubject.next(auditTrails.totalFilteredRecords);
         this.auditTrailsSubject.next(auditTrails.pageItems);
@@ -56,5 +62,4 @@ export class AuditTrailsDataSource implements DataSource {
     this.auditTrailsSubject.complete();
     this.recordsSubject.complete();
   }
-
 }
diff --git a/src/app/system/audit-trails/audit-trails.component.spec.ts b/src/app/system/audit-trails/audit-trails.component.spec.ts
index 0ff2c3ba6..8d9638d77 100644
--- a/src/app/system/audit-trails/audit-trails.component.spec.ts
+++ b/src/app/system/audit-trails/audit-trails.component.spec.ts
@@ -8,9 +8,8 @@ describe('AuditTrailsComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ AuditTrailsComponent ]
-    })
-    .compileComponents();
+      declarations: [AuditTrailsComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/audit-trails/audit-trails.component.ts b/src/app/system/audit-trails/audit-trails.component.ts
index 338319ede..f6787467e 100644
--- a/src/app/system/audit-trails/audit-trails.component.ts
+++ b/src/app/system/audit-trails/audit-trails.component.ts
@@ -26,7 +26,6 @@ import { Dates } from 'app/core/utils/dates';
   styleUrls: ['./audit-trails.component.scss']
 })
 export class AuditTrailsComponent implements OnInit, AfterViewInit {
-
   /** Minimum date allowed. */
   minDate = new Date(2000, 0, 1);
   /** Maximum date allowed. */
@@ -44,7 +43,18 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
   /** Audit Trail Search Template Data. */
   auditTrailSearchTemplateData: any;
   /** Columns to be displayed in audit trails table. */
-  displayedColumns: string[] = ['id', 'resourceId', 'processingResult', 'maker', 'actionName', 'entityName', 'officeName', 'madeOnDate', 'checker', 'checkedOnDate'];
+  displayedColumns: string[] = [
+    'id',
+    'resourceId',
+    'processingResult',
+    'maker',
+    'actionName',
+    'entityName',
+    'officeName',
+    'madeOnDate',
+    'checker',
+    'checkedOnDate'
+  ];
   /** Data source for audit trails table. */
   dataSource: AuditTrailsDataSource;
   /** Audit Trails filter. */
@@ -131,10 +141,12 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
    * @param {Dates} dateUtils Dates utils
    * @param {SettingsService} settingsService Settings Service
    */
-  constructor(private route: ActivatedRoute,
-              private systemService: SystemService,
-              private dateUtils: Dates,
-              private settingsService: SettingsService) {
+  constructor(
+    private route: ActivatedRoute,
+    private systemService: SystemService,
+    private dateUtils: Dates,
+    private settingsService: SettingsService
+  ) {
     this.route.data.subscribe((data: { auditTrailSearchTemplate: any }) => {
       this.auditTrailSearchTemplateData = data.auditTrailSearchTemplate;
     });
@@ -160,13 +172,14 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
   ngAfterViewInit() {
     this.user.valueChanges
       .pipe(
-        map(value => value.id ? value.id : ''),
+        map((value) => (value.id ? value.id : '')),
         debounceTime(500),
         distinctUntilChanged(),
         tap((filterValue) => {
           this.applyFilter(filterValue, 'makerId');
         })
-      ).subscribe();
+      )
+      .subscribe();
 
     this.fromDate.valueChanges
       .pipe(
@@ -175,7 +188,8 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
         tap((filterValue) => {
           this.applyFilter(this.getDate(filterValue), 'makerDateTimeFrom');
         })
-      ).subscribe();
+      )
+      .subscribe();
 
     this.toDate.valueChanges
       .pipe(
@@ -184,7 +198,8 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
         tap((filterValue) => {
           this.applyFilter(this.getDate(filterValue), 'makerDateTimeTo');
         })
-      ).subscribe();
+      )
+      .subscribe();
 
     this.checkedFromDate.valueChanges
       .pipe(
@@ -193,7 +208,8 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
         tap((filterValue) => {
           this.applyFilter(this.getDate(filterValue), 'checkerDateTimeFrom');
         })
-      ).subscribe();
+      )
+      .subscribe();
 
     this.checkedToDate.valueChanges
       .pipe(
@@ -202,7 +218,8 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
         tap((filterValue) => {
           this.applyFilter(this.getDate(filterValue), 'checkerDateTimeTo');
         })
-      ).subscribe();
+      )
+      .subscribe();
 
     this.resourceId.valueChanges
       .pipe(
@@ -211,44 +228,47 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
         tap((filterValue) => {
           this.applyFilter(filterValue, 'resourceId');
         })
-      ).subscribe();
+      )
+      .subscribe();
 
     this.actionName.valueChanges
       .pipe(
-        map(value => value ? value : ''),
+        map((value) => (value ? value : '')),
         debounceTime(500),
         distinctUntilChanged(),
         tap((filterValue) => {
           this.applyFilter(filterValue, 'actionName');
         })
-      ).subscribe();
+      )
+      .subscribe();
 
     this.entityName.valueChanges
       .pipe(
-        map(value => value ? value : ''),
+        map((value) => (value ? value : '')),
         debounceTime(500),
         distinctUntilChanged(),
         tap((filterValue) => {
           this.applyFilter(filterValue, 'entityName');
         })
-      ).subscribe();
+      )
+      .subscribe();
 
     this.checker.valueChanges
       .pipe(
-        map(value => value ? value : ''),
+        map((value) => (value ? value : '')),
         debounceTime(500),
         distinctUntilChanged(),
         tap((filterValue) => {
           this.applyFilter(filterValue, 'checkerId');
         })
-      ).subscribe();
+      )
+      .subscribe();
 
-    this.sort.sortChange.subscribe(() => this.paginator.pageIndex = 0);
+    this.sort.sortChange.subscribe(() => (this.paginator.pageIndex = 0));
 
     merge(this.sort.sortChange, this.paginator.page)
-      .pipe(
-        tap(() => this.loadAuditTrailsPage())
-      ).subscribe();
+      .pipe(tap(() => this.loadAuditTrailsPage()))
+      .subscribe();
   }
 
   /**
@@ -256,7 +276,13 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
    */
   getAuditTrails() {
     this.dataSource = new AuditTrailsDataSource(this.systemService);
-    this.dataSource.getAuditTrails(this.filterAuditTrailsBy, this.sort.active, this.sort.direction, this.paginator.pageIndex, this.paginator.pageSize);
+    this.dataSource.getAuditTrails(
+      this.filterAuditTrailsBy,
+      this.sort.active,
+      this.sort.direction,
+      this.paginator.pageIndex,
+      this.paginator.pageSize
+    );
   }
 
   /**
@@ -266,7 +292,13 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
     if (!this.sort.direction) {
       delete this.sort.active;
     }
-    this.dataSource.getAuditTrails(this.filterAuditTrailsBy, this.sort.active, this.sort.direction, this.paginator.pageIndex, this.paginator.pageSize);
+    this.dataSource.getAuditTrails(
+      this.filterAuditTrailsBy,
+      this.sort.active,
+      this.sort.direction,
+      this.paginator.pageIndex,
+      this.paginator.pageSize
+    );
   }
 
   /**
@@ -276,7 +308,7 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
    */
   applyFilter(filterValue: string, property: string) {
     this.paginator.pageIndex = 0;
-    const findIndex = this.filterAuditTrailsBy.findIndex(filter => filter.type === property);
+    const findIndex = this.filterAuditTrailsBy.findIndex((filter) => filter.type === property);
     this.filterAuditTrailsBy[findIndex].value = filterValue;
     this.loadAuditTrailsPage();
   }
@@ -312,48 +344,52 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
    * Sets filtered users for autocomplete.
    */
   setFilteredUsers() {
-    this.filteredUserData = this.user.valueChanges
-      .pipe(
-        startWith(''),
-        map((user: any) => typeof user === 'string' ? user : user.name),
-        map((userName: string) => userName ? this.filterUserAutocompleteData(userName) : this.auditTrailSearchTemplateData.appUsers)
-      );
+    this.filteredUserData = this.user.valueChanges.pipe(
+      startWith(''),
+      map((user: any) => (typeof user === 'string' ? user : user.name)),
+      map((userName: string) =>
+        userName ? this.filterUserAutocompleteData(userName) : this.auditTrailSearchTemplateData.appUsers
+      )
+    );
   }
 
   /**
    * Sets filtered checkers for autocomplete.
    */
   setFilteredCheckers() {
-    this.filteredCheckerData = this.checker.valueChanges
-      .pipe(
-        startWith(''),
-        map((user: any) => typeof user === 'string' ? user : user.name),
-        map((userName: string) => userName ? this.filterUserAutocompleteData(userName) : this.auditTrailSearchTemplateData.appUsers)
-      );
+    this.filteredCheckerData = this.checker.valueChanges.pipe(
+      startWith(''),
+      map((user: any) => (typeof user === 'string' ? user : user.name)),
+      map((userName: string) =>
+        userName ? this.filterUserAutocompleteData(userName) : this.auditTrailSearchTemplateData.appUsers
+      )
+    );
   }
 
   /**
    * Sets filtered actions for autocomplete.
    */
   setFilteredActions() {
-    this.filteredActionData = this.actionName.valueChanges
-      .pipe(
-        startWith(''),
-        map((action: any) => typeof action === 'string' ? action : ''),
-        map((actionName: string) => actionName ? this.filterActionAutocompleteData(actionName) : this.auditTrailSearchTemplateData.actionNames)
-      );
+    this.filteredActionData = this.actionName.valueChanges.pipe(
+      startWith(''),
+      map((action: any) => (typeof action === 'string' ? action : '')),
+      map((actionName: string) =>
+        actionName ? this.filterActionAutocompleteData(actionName) : this.auditTrailSearchTemplateData.actionNames
+      )
+    );
   }
 
   /**
    * Sets filtered entities for autocomplete.
    */
   setFilteredEntities() {
-    this.filteredEntityData = this.entityName.valueChanges
-      .pipe(
-        startWith(''),
-        map((entity: any) => typeof entity === 'string' ? entity : ''),
-        map((entityName: string) => entityName ? this.filterEntityAutocompleteData(entityName) : this.auditTrailSearchTemplateData.entityNames)
-      );
+    this.filteredEntityData = this.entityName.valueChanges.pipe(
+      startWith(''),
+      map((entity: any) => (typeof entity === 'string' ? entity : '')),
+      map((entityName: string) =>
+        entityName ? this.filterEntityAutocompleteData(entityName) : this.auditTrailSearchTemplateData.entityNames
+      )
+    );
   }
 
   /**
@@ -362,7 +398,9 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
    * @returns {any} Filtered users.
    */
   private filterUserAutocompleteData(userName: string): any {
-    return this.auditTrailSearchTemplateData.appUsers.filter((user: any) => user.username.toLowerCase().includes(userName.toLowerCase()));
+    return this.auditTrailSearchTemplateData.appUsers.filter((user: any) =>
+      user.username.toLowerCase().includes(userName.toLowerCase())
+    );
   }
 
   /**
@@ -371,7 +409,9 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
    * @returns {any} Filtered actions.
    */
   private filterActionAutocompleteData(actionName: string): any {
-    return this.auditTrailSearchTemplateData.actionNames.filter((action: any) => action.toLowerCase().includes(actionName.toLowerCase()));
+    return this.auditTrailSearchTemplateData.actionNames.filter((action: any) =>
+      action.toLowerCase().includes(actionName.toLowerCase())
+    );
   }
 
   /**
@@ -380,7 +420,9 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
    * @returns {any} Filtered entities.
    */
   private filterEntityAutocompleteData(entityName: string): any {
-    return this.auditTrailSearchTemplateData.entityNames.filter((entity: any) => entity.toLowerCase().includes(entityName.toLowerCase()));
+    return this.auditTrailSearchTemplateData.entityNames.filter((entity: any) =>
+      entity.toLowerCase().includes(entityName.toLowerCase())
+    );
   }
 
   /**
@@ -388,24 +430,55 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
    */
   downloadCSV() {
     const dateFormat = this.settingsService.dateFormat;
-    const replacer = (key: any, value: any) => value === undefined ? '' : value;
-    const header = ['ID', 'Resource ID', 'Status', 'Office', 'Made On', 'Maker', 'Checked On', 'Checker', 'Entity', 'Action', 'Client'];
-    const headerCode = ['id', 'resourceId', 'processingResult', 'officeName', 'madeOnDate', 'maker', 'checkedOnDate', 'checker', 'entityName', 'actionName', 'clientName'];
-    this.systemService.getAuditTrails(this.filterAuditTrailsBy, this.sort.active ? this.sort.active : '', this.sort.direction, 0, -1).subscribe((response: any) => {
-      if (response !== undefined) {
-        let csv = response.pageItems.map((row: any) => headerCode.map(fieldName => (fieldName === 'madeOnDate' || fieldName === 'checkedOnDate') && (JSON.stringify(row[fieldName], replacer) !== '""')
-          ? this.dateUtils.formatDate(JSON.stringify(row[fieldName], replacer), dateFormat)
-          : JSON.stringify(row[fieldName], replacer)));
-        csv.unshift(`data:text/csv;charset=utf-8,${header.join()}`);
-        csv = csv.join('\r\n');
-        const link = document.createElement('a');
-        link.setAttribute('href', encodeURI(csv));
-        link.setAttribute('download', 'Audit Trails.csv');
-        document.body.appendChild(link);
-        link.click();
-        document.body.removeChild(link);
-      }
-    });
+    const replacer = (key: any, value: any) => (value === undefined ? '' : value);
+    const header = [
+      'ID',
+      'Resource ID',
+      'Status',
+      'Office',
+      'Made On',
+      'Maker',
+      'Checked On',
+      'Checker',
+      'Entity',
+      'Action',
+      'Client'
+    ];
+    const headerCode = [
+      'id',
+      'resourceId',
+      'processingResult',
+      'officeName',
+      'madeOnDate',
+      'maker',
+      'checkedOnDate',
+      'checker',
+      'entityName',
+      'actionName',
+      'clientName'
+    ];
+    this.systemService
+      .getAuditTrails(this.filterAuditTrailsBy, this.sort.active ? this.sort.active : '', this.sort.direction, 0, -1)
+      .subscribe((response: any) => {
+        if (response !== undefined) {
+          let csv = response.pageItems.map((row: any) =>
+            headerCode.map((fieldName) =>
+              (fieldName === 'madeOnDate' || fieldName === 'checkedOnDate') &&
+              JSON.stringify(row[fieldName], replacer) !== '""'
+                ? this.dateUtils.formatDate(JSON.stringify(row[fieldName], replacer), dateFormat)
+                : JSON.stringify(row[fieldName], replacer)
+            )
+          );
+          csv.unshift(`data:text/csv;charset=utf-8,${header.join()}`);
+          csv = csv.join('\r\n');
+          const link = document.createElement('a');
+          link.setAttribute('href', encodeURI(csv));
+          link.setAttribute('download', 'Audit Trails.csv');
+          document.body.appendChild(link);
+          link.click();
+          document.body.removeChild(link);
+        }
+      });
   }
 
   /**
@@ -419,5 +492,4 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
     const dateFormat = this.settingsService.dateFormat;
     return this.dateUtils.formatDate(timestamp, dateFormat);
   }
-
 }
diff --git a/src/app/system/audit-trails/view-audit/audit-trail.resolver.ts b/src/app/system/audit-trails/view-audit/audit-trail.resolver.ts
index 7debb6bd0..b581a3080 100644
--- a/src/app/system/audit-trails/view-audit/audit-trail.resolver.ts
+++ b/src/app/system/audit-trails/view-audit/audit-trail.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class AuditTrailResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -27,5 +26,4 @@ export class AuditTrailResolver implements Resolve {
     const auditTrailId = route.paramMap.get('id');
     return this.systemService.getAuditTrail(auditTrailId);
   }
-
 }
diff --git a/src/app/system/audit-trails/view-audit/view-audit.component.spec.ts b/src/app/system/audit-trails/view-audit/view-audit.component.spec.ts
index 5cbbd9f1f..d9577783a 100644
--- a/src/app/system/audit-trails/view-audit/view-audit.component.spec.ts
+++ b/src/app/system/audit-trails/view-audit/view-audit.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewAuditComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewAuditComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewAuditComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/audit-trails/view-audit/view-audit.component.ts b/src/app/system/audit-trails/view-audit/view-audit.component.ts
index dd9734a4a..c91ac6aad 100644
--- a/src/app/system/audit-trails/view-audit/view-audit.component.ts
+++ b/src/app/system/audit-trails/view-audit/view-audit.component.ts
@@ -14,11 +14,13 @@ import { MatTableDataSource } from '@angular/material/table';
   styleUrls: ['./view-audit.component.scss']
 })
 export class ViewAuditComponent implements OnInit {
-
   /** Audit Trail Data. */
   auditTrailData: any;
   /** Columns to be displayed in audit trail table. */
-  displayedColumns: string[] = ['command', 'commandValue'];
+  displayedColumns: string[] = [
+    'command',
+    'commandValue'
+  ];
   /** Data source for audit trail table. */
   dataSource: MatTableDataSource;
 
@@ -48,10 +50,12 @@ export class ViewAuditComponent implements OnInit {
    * Initalizes Audit Trail Commands Data.
    */
   get auditTrailCommandsData() {
-    return Object.entries(JSON.parse(this.auditTrailData.commandAsJson))
-      .map(
-        ([key, value]) => ({ command: key, commandValue: value })
-      );
+    return Object.entries(JSON.parse(this.auditTrailData.commandAsJson)).map(
+      ([
+        key,
+        value
+      ]) => ({ command: key, commandValue: value })
+    );
   }
 
   /**
@@ -62,5 +66,4 @@ export class ViewAuditComponent implements OnInit {
     this.dataSource.paginator = this.paginator;
     this.dataSource.sort = this.sort;
   }
-
 }
diff --git a/src/app/system/codes/code.resolver.ts b/src/app/system/codes/code.resolver.ts
index b40a772d8..5e61d0d71 100644
--- a/src/app/system/codes/code.resolver.ts
+++ b/src/app/system/codes/code.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class CodeResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -27,5 +26,4 @@ export class CodeResolver implements Resolve {
     const id = route.paramMap.get('id');
     return this.systemService.getCode(id);
   }
-
 }
diff --git a/src/app/system/codes/codes.component.spec.ts b/src/app/system/codes/codes.component.spec.ts
index 03508bb70..7441f7002 100644
--- a/src/app/system/codes/codes.component.spec.ts
+++ b/src/app/system/codes/codes.component.spec.ts
@@ -8,9 +8,8 @@ describe('CodesComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CodesComponent ]
-    })
-    .compileComponents();
+      declarations: [CodesComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/codes/codes.component.ts b/src/app/system/codes/codes.component.ts
index d1334db79..10635ede0 100644
--- a/src/app/system/codes/codes.component.ts
+++ b/src/app/system/codes/codes.component.ts
@@ -15,11 +15,13 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura
   styleUrls: ['./codes.component.scss']
 })
 export class CodesComponent implements OnInit, AfterViewInit {
-
   /** Codes data. */
   codesData: any;
   /** Columns to be displayed in codes table. */
-  displayedColumns: string[] = ['name', 'systemDefined'];
+  displayedColumns: string[] = [
+    'name',
+    'systemDefined'
+  ];
   /** Data source for codes table. */
   dataSource: MatTableDataSource;
 
@@ -44,11 +46,13 @@ export class CodesComponent implements OnInit, AfterViewInit {
    * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
    * @param {PopoverService} popoverService PopoverService.
    */
-  constructor(private route: ActivatedRoute,
-              private router: Router,
-              private configurationWizardService: ConfigurationWizardService,
-              private popoverService: PopoverService) {
-    this.route.data.subscribe(( data: { codes: any }) => {
+  constructor(
+    private route: ActivatedRoute,
+    private router: Router,
+    private configurationWizardService: ConfigurationWizardService,
+    private popoverService: PopoverService
+  ) {
+    this.route.data.subscribe((data: { codes: any }) => {
       this.codesData = data.codes;
     });
   }
@@ -84,7 +88,12 @@ export class CodesComponent implements OnInit, AfterViewInit {
    * @param position String.
    * @param backdrop Boolean.
    */
-  showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+  showPopover(
+    template: TemplateRef,
+    target: HTMLElement | ElementRef,
+    position: string,
+    backdrop: boolean
+  ): void {
     setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
   }
 
@@ -123,5 +132,4 @@ export class CodesComponent implements OnInit, AfterViewInit {
     this.configurationWizardService.showSystemCodes = true;
     this.router.navigate(['/system']);
   }
-
 }
diff --git a/src/app/system/codes/codes.resolver.ts b/src/app/system/codes/codes.resolver.ts
index ca0dc6565..ce601e7b3 100644
--- a/src/app/system/codes/codes.resolver.ts
+++ b/src/app/system/codes/codes.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class CodesResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class CodesResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getCodes();
   }
-
 }
diff --git a/src/app/system/codes/create-code/create-code.component.spec.ts b/src/app/system/codes/create-code/create-code.component.spec.ts
index 8c6ad8971..c01772eba 100644
--- a/src/app/system/codes/create-code/create-code.component.spec.ts
+++ b/src/app/system/codes/create-code/create-code.component.spec.ts
@@ -8,9 +8,8 @@ describe('CreateCodeComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CreateCodeComponent ]
-    })
-    .compileComponents();
+      declarations: [CreateCodeComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/codes/create-code/create-code.component.ts b/src/app/system/codes/create-code/create-code.component.ts
index 6b2bc0dde..741d20f79 100644
--- a/src/app/system/codes/create-code/create-code.component.ts
+++ b/src/app/system/codes/create-code/create-code.component.ts
@@ -1,5 +1,5 @@
 /** Angular Imports */
-import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit  } from '@angular/core';
+import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
 import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
 import { Router, ActivatedRoute } from '@angular/router';
 
@@ -15,7 +15,6 @@ import { ConfigurationWizardService } from '../../../configuration-wizard/config
   styleUrls: ['./create-code.component.scss']
 })
 export class CreateCodeComponent implements OnInit, AfterViewInit {
-
   /** Code form. */
   codeForm: UntypedFormGroup;
 
@@ -32,12 +31,14 @@ export class CreateCodeComponent implements OnInit, AfterViewInit {
    * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
    * @param {PopoverService} popoverService PopoverService.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private route: ActivatedRoute,
-              private router: Router,
-              private configurationWizardService: ConfigurationWizardService,
-              private popoverService: PopoverService) { }
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private route: ActivatedRoute,
+    private router: Router,
+    private configurationWizardService: ConfigurationWizardService,
+    private popoverService: PopoverService
+  ) {}
 
   /**
    * Creates the code form.
@@ -51,7 +52,10 @@ export class CreateCodeComponent implements OnInit, AfterViewInit {
    */
   createCodeForm() {
     this.codeForm = this.formBuilder.group({
-      'name': ['', Validators.required]
+      name: [
+        '',
+        Validators.required
+      ]
     });
   }
 
@@ -60,15 +64,20 @@ export class CreateCodeComponent implements OnInit, AfterViewInit {
    * if successful redirects to view created code.
    */
   submit() {
-    this.systemService.createCode(this.codeForm.value)
-      .subscribe((response: any) => {
-        if (this.configurationWizardService.showSystemCodesForm === true) {
-          this.configurationWizardService.showSystemCodesForm = false;
-          this.configurationWizardService.showRolesandPermission = true;
-          this.router.navigate(['/system']);
-        } else {
-        this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
-        }
+    this.systemService.createCode(this.codeForm.value).subscribe((response: any) => {
+      if (this.configurationWizardService.showSystemCodesForm === true) {
+        this.configurationWizardService.showSystemCodesForm = false;
+        this.configurationWizardService.showRolesandPermission = true;
+        this.router.navigate(['/system']);
+      } else {
+        this.router.navigate(
+          [
+            '../',
+            response.resourceId
+          ],
+          { relativeTo: this.route }
+        );
+      }
     });
   }
 
@@ -79,7 +88,12 @@ export class CreateCodeComponent implements OnInit, AfterViewInit {
    * @param position String.
    * @param backdrop Boolean.
    */
-  showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+  showPopover(
+    template: TemplateRef,
+    target: HTMLElement | ElementRef,
+    position: string,
+    backdrop: boolean
+  ): void {
     setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
   }
 
diff --git a/src/app/system/codes/edit-code/edit-code.component.spec.ts b/src/app/system/codes/edit-code/edit-code.component.spec.ts
index 39bde715a..4fbc6da18 100644
--- a/src/app/system/codes/edit-code/edit-code.component.spec.ts
+++ b/src/app/system/codes/edit-code/edit-code.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditCodeComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditCodeComponent ]
-    })
-    .compileComponents();
+      declarations: [EditCodeComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/codes/edit-code/edit-code.component.ts b/src/app/system/codes/edit-code/edit-code.component.ts
index b951bc942..4b59f091f 100644
--- a/src/app/system/codes/edit-code/edit-code.component.ts
+++ b/src/app/system/codes/edit-code/edit-code.component.ts
@@ -15,7 +15,6 @@ import { SystemService } from '../../system.service';
   styleUrls: ['./edit-code.component.scss']
 })
 export class EditCodeComponent implements OnInit {
-
   /** Code Form */
   codeForm: UntypedFormGroup;
   /** Code Data */
@@ -28,10 +27,12 @@ export class EditCodeComponent implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    * @param {Router} router Router for navigation.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private route: ActivatedRoute,
-              private router: Router) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private route: ActivatedRoute,
+    private router: Router
+  ) {
     this.route.data.subscribe((data: { code: any }) => {
       this.codeData = data.code;
     });
@@ -49,7 +50,10 @@ export class EditCodeComponent implements OnInit {
    */
   createCodeForm() {
     this.codeForm = this.formBuilder.group({
-      'name': [this.codeData.name, Validators.required]
+      name: [
+        this.codeData.name,
+        Validators.required
+      ]
     });
   }
 
@@ -58,10 +62,14 @@ export class EditCodeComponent implements OnInit {
    * if successful redirects to view updated code.
    */
   submit() {
-    this.systemService.updateCode(this.codeForm.value, this.codeData.id)
-      .subscribe((response: any) => {
-        this.router.navigate(['../../', response.resourceId], { relativeTo: this.route });
-      });
+    this.systemService.updateCode(this.codeForm.value, this.codeData.id).subscribe((response: any) => {
+      this.router.navigate(
+        [
+          '../../',
+          response.resourceId
+        ],
+        { relativeTo: this.route }
+      );
+    });
   }
-
 }
diff --git a/src/app/system/codes/view-code/code-values.resolver.ts b/src/app/system/codes/view-code/code-values.resolver.ts
index d248d22d2..28e44da45 100644
--- a/src/app/system/codes/view-code/code-values.resolver.ts
+++ b/src/app/system/codes/view-code/code-values.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class CodeValuesResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -27,5 +26,4 @@ export class CodeValuesResolver implements Resolve {
     const codeId = route.paramMap.get('id');
     return this.systemService.getCodeValues(codeId);
   }
-
 }
diff --git a/src/app/system/codes/view-code/view-code.component.spec.ts b/src/app/system/codes/view-code/view-code.component.spec.ts
index 5d0c6571a..be6e6432c 100644
--- a/src/app/system/codes/view-code/view-code.component.spec.ts
+++ b/src/app/system/codes/view-code/view-code.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewCodeComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewCodeComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewCodeComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/codes/view-code/view-code.component.ts b/src/app/system/codes/view-code/view-code.component.ts
index 132d9945d..73e5d33fc 100644
--- a/src/app/system/codes/view-code/view-code.component.ts
+++ b/src/app/system/codes/view-code/view-code.component.ts
@@ -20,7 +20,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co
   styleUrls: ['./view-code.component.scss']
 })
 export class ViewCodeComponent implements OnInit {
-
   /** Code Data */
   codeData: any;
   /** Code Values Data */
@@ -39,13 +38,15 @@ export class ViewCodeComponent implements OnInit {
    * @param {MatDialog} dialog Dialog reference.
    * @param {TranslateService} translateService Translate Service.
    */
-  constructor(private route: ActivatedRoute,
-              private systemService: SystemService,
-              private router: Router,
-              private formBuilder: UntypedFormBuilder,
-              private dialog: MatDialog,
-              private translateService: TranslateService) {
-    this.route.data.subscribe((data: { code: any, codeValues: any }) => {
+  constructor(
+    private route: ActivatedRoute,
+    private systemService: SystemService,
+    private router: Router,
+    private formBuilder: UntypedFormBuilder,
+    private dialog: MatDialog,
+    private translateService: TranslateService
+  ) {
+    this.route.data.subscribe((data: { code: any; codeValues: any }) => {
       this.codeData = data.code;
       this.codeValuesData = data.codeValues;
     });
@@ -82,7 +83,7 @@ export class ViewCodeComponent implements OnInit {
    */
   createCodeValuesForm() {
     this.codeValuesForm = this.formBuilder.group({
-      'codeValues': this.formBuilder.array([])
+      codeValues: this.formBuilder.array([])
     });
   }
 
@@ -101,10 +102,16 @@ export class ViewCodeComponent implements OnInit {
    */
   createCodeValuesRow(codeValue?: any): UntypedFormGroup {
     return this.formBuilder.group({
-      'name': [{ value: codeValue ? codeValue.name : '', disabled: true }, Validators.required],
-      'description': [{ value: codeValue ? codeValue.description : '', disabled: true }],
-      'position': [{ value: codeValue ? codeValue.position : 0, disabled: true }, Validators.required],
-      'isActive': [{ value: codeValue ? codeValue.active : false, disabled: true }]
+      name: [
+        { value: codeValue ? codeValue.name : '', disabled: true },
+        Validators.required
+      ],
+      description: [{ value: codeValue ? codeValue.description : '', disabled: true }],
+      position: [
+        { value: codeValue ? codeValue.position : 0, disabled: true },
+        Validators.required
+      ],
+      isActive: [{ value: codeValue ? codeValue.active : false, disabled: true }]
     });
   }
 
@@ -114,12 +121,11 @@ export class ViewCodeComponent implements OnInit {
    */
   deleteCodeValue(index: number) {
     const codeValueId = this.codeValuesData[index].id;
-    this.systemService.deleteCodeValue(this.codeData.id, codeValueId)
-      .subscribe((response: any) => {
-        this.codeValuesData.splice(index, 1);
-        this.codeValues.removeAt(index);
-        this.codeValueRowStatus.splice(index, 1);
-      });
+    this.systemService.deleteCodeValue(this.codeData.id, codeValueId).subscribe((response: any) => {
+      this.codeValuesData.splice(index, 1);
+      this.codeValues.removeAt(index);
+      this.codeValueRowStatus.splice(index, 1);
+    });
   }
 
   /**
@@ -136,8 +142,10 @@ export class ViewCodeComponent implements OnInit {
    * @param {number} index Index of the row.
    */
   updateCodeValue(index: number) {
-    const updatedCodeValue: { name: string, description: string, position: number, isActive: boolean } = this.codeValues.at(index).value;
-    this.systemService.updateCodeValue(this.codeData.id, this.codeValuesData[index].id, updatedCodeValue)
+    const updatedCodeValue: { name: string; description: string; position: number; isActive: boolean } =
+      this.codeValues.at(index).value;
+    this.systemService
+      .updateCodeValue(this.codeData.id, this.codeValuesData[index].id, updatedCodeValue)
       .subscribe((response: any) => {
         this.codeValues.at(index).disable();
         this.codeValueRowStatus[index] = 'disabled';
@@ -150,14 +158,13 @@ export class ViewCodeComponent implements OnInit {
    */
   delete() {
     const deleteCodeDialogRef = this.dialog.open(DeleteDialogComponent, {
-      data: { deleteContext: this.translateService.instant('labels.inputs.Code') + ' ' + this.codeData.name}
+      data: { deleteContext: this.translateService.instant('labels.inputs.Code') + ' ' + this.codeData.name }
     });
     deleteCodeDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
-        this.systemService.deleteCode(this.codeData.id)
-          .subscribe(() => {
-            this.router.navigate(['/system/codes']);
-          });
+        this.systemService.deleteCode(this.codeData.id).subscribe(() => {
+          this.router.navigate(['/system/codes']);
+        });
       }
     });
   }
@@ -181,20 +188,20 @@ export class ViewCodeComponent implements OnInit {
    * @param {number} index Index of the row.
    */
   addCodeValue(index: number) {
-    const newCodeValue: { name: string, description: string, position: string, isActive: boolean } = this.codeValues.at(index).value;
-    this.systemService.createCodeValue(this.codeData.id, newCodeValue)
-      .subscribe((response: any) => {
-        this.codeValues.at(index).disable();
-        this.codeValueRowStatus[index] = 'disabled';
-        this.codeValuesData.push({
-          id: response.subResourceId,
-          name: this.codeValues.at(index).get('name').value,
-          description: this.codeValues.at(index).get('description').value,
-          position: this.codeValues.at(index).get('position').value,
-          isActive: this.codeValues.at(index).get('isActive').value
-        });
-        this.codeValues.at(index).markAsPristine();
+    const newCodeValue: { name: string; description: string; position: string; isActive: boolean } =
+      this.codeValues.at(index).value;
+    this.systemService.createCodeValue(this.codeData.id, newCodeValue).subscribe((response: any) => {
+      this.codeValues.at(index).disable();
+      this.codeValueRowStatus[index] = 'disabled';
+      this.codeValuesData.push({
+        id: response.subResourceId,
+        name: this.codeValues.at(index).get('name').value,
+        description: this.codeValues.at(index).get('description').value,
+        position: this.codeValues.at(index).get('position').value,
+        isActive: this.codeValues.at(index).get('isActive').value
       });
+      this.codeValues.at(index).markAsPristine();
+    });
   }
 
   /**
@@ -205,5 +212,4 @@ export class ViewCodeComponent implements OnInit {
     this.codeValues.at(index).enable();
     this.codeValueRowStatus[index] = 'edit';
   }
-
 }
diff --git a/src/app/system/configurations/business-date-tab/business-date-tab.component.spec.ts b/src/app/system/configurations/business-date-tab/business-date-tab.component.spec.ts
index 2fb5248f7..24658d511 100644
--- a/src/app/system/configurations/business-date-tab/business-date-tab.component.spec.ts
+++ b/src/app/system/configurations/business-date-tab/business-date-tab.component.spec.ts
@@ -8,9 +8,8 @@ describe('BusinessDateTabComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ BusinessDateTabComponent ]
-    })
-    .compileComponents();
+      declarations: [BusinessDateTabComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/system/configurations/business-date-tab/business-date-tab.component.ts b/src/app/system/configurations/business-date-tab/business-date-tab.component.ts
index da87702a9..ccf95a8ec 100644
--- a/src/app/system/configurations/business-date-tab/business-date-tab.component.ts
+++ b/src/app/system/configurations/business-date-tab/business-date-tab.component.ts
@@ -50,13 +50,14 @@ export class BusinessDateTabComponent implements OnInit {
     private settingsService: SettingsService,
     private formBuilder: UntypedFormBuilder,
     private dateUtils: Dates,
-    private alertService: AlertService) {}
+    private alertService: AlertService
+  ) {}
 
   ngOnInit(): void {
     this.alert$ = this.alertService.alertEvent.subscribe((alertEvent: Alert) => {
       const alertType = alertEvent.type;
       if (alertType === SettingsService.businessDateType + ' Set Config') {
-        this.isBusinessDateEnabled = (alertEvent.message === 'enabled') ? true : false;
+        this.isBusinessDateEnabled = alertEvent.message === 'enabled' ? true : false;
         if (this.isBusinessDateEnabled) {
           this.setBusinessDates();
           this.createBusinessDateForm();
@@ -71,19 +72,19 @@ export class BusinessDateTabComponent implements OnInit {
   /**
    * Get the Configuration and the Business Date data
    */
-   getConfigurations(): void {
-    this.systemService.getConfigurationByName(SettingsService.businessDateConfigName)
-    .subscribe((configurationData: any) => {
-      this.isBusinessDateEnabled = configurationData.enabled;
-      if (this.isBusinessDateEnabled) {
-        this.setBusinessDates();
-      }
-    });
+  getConfigurations(): void {
+    this.systemService
+      .getConfigurationByName(SettingsService.businessDateConfigName)
+      .subscribe((configurationData: any) => {
+        this.isBusinessDateEnabled = configurationData.enabled;
+        if (this.isBusinessDateEnabled) {
+          this.setBusinessDates();
+        }
+      });
   }
 
   setBusinessDates(): void {
-    this.systemService.getBusinessDates()
-    .subscribe((businessDateData: any) => {
+    this.systemService.getBusinessDates().subscribe((businessDateData: any) => {
       businessDateData.forEach((data: any) => {
         if (data.type === SettingsService.businessDateType) {
           this.businessDate = new Date(data.date);
@@ -105,15 +106,21 @@ export class BusinessDateTabComponent implements OnInit {
    */
   createBusinessDateForm(): void {
     this.businessDateForm = this.formBuilder.group({
-      'businessDate': [new Date(), Validators.required],
-      'cobDate': [new Date(), Validators.required],
+      businessDate: [
+        new Date(),
+        Validators.required
+      ],
+      cobDate: [
+        new Date(),
+        Validators.required
+      ]
     });
   }
 
   /**
    * Flag to display or not the datepicker control to set the Business Date value
    */
-   editInProgressToggle(index: any): void {
+  editInProgressToggle(index: any): void {
     this.dateIndex = index;
     this.isEditInProgress = !this.isEditInProgress;
   }
diff --git a/src/app/system/configurations/configurations.component.spec.ts b/src/app/system/configurations/configurations.component.spec.ts
index 804bbdc20..79144b60a 100644
--- a/src/app/system/configurations/configurations.component.spec.ts
+++ b/src/app/system/configurations/configurations.component.spec.ts
@@ -8,9 +8,8 @@ describe('ConfigurationsComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ ConfigurationsComponent ]
-    })
-    .compileComponents();
+      declarations: [ConfigurationsComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/system/configurations/configurations.component.ts b/src/app/system/configurations/configurations.component.ts
index ee435da29..5790d0f72 100644
--- a/src/app/system/configurations/configurations.component.ts
+++ b/src/app/system/configurations/configurations.component.ts
@@ -16,14 +16,16 @@ export class ConfigurationsComponent implements OnInit {
 
   isBusinessDateEnabled = false;
 
-  constructor(private alertService: AlertService,
-    private systemService: SystemService) { }
+  constructor(
+    private alertService: AlertService,
+    private systemService: SystemService
+  ) {}
 
   ngOnInit(): void {
     this.alert$ = this.alertService.alertEvent.subscribe((alertEvent: Alert) => {
       const alertType = alertEvent.type;
       if (alertType === SettingsService.businessDateType + ' Set Config') {
-        this.isBusinessDateEnabled = (alertEvent.message === 'enabled') ? true : false;
+        this.isBusinessDateEnabled = alertEvent.message === 'enabled' ? true : false;
       }
     });
     this.getConfigurations();
@@ -32,10 +34,11 @@ export class ConfigurationsComponent implements OnInit {
   /**
    * Get the Configuration and the Business Date data
    */
-   getConfigurations(): void {
-    this.systemService.getConfigurationByName(SettingsService.businessDateConfigName)
-    .subscribe((configurationData: any) => {
-      this.isBusinessDateEnabled = configurationData.enabled;
-    });
+  getConfigurations(): void {
+    this.systemService
+      .getConfigurationByName(SettingsService.businessDateConfigName)
+      .subscribe((configurationData: any) => {
+        this.isBusinessDateEnabled = configurationData.enabled;
+      });
   }
 }
diff --git a/src/app/system/configurations/global-configurations-tab/edit-configuration/edit-configuration.component.spec.ts b/src/app/system/configurations/global-configurations-tab/edit-configuration/edit-configuration.component.spec.ts
index fc7d6a6af..c7a9aa622 100644
--- a/src/app/system/configurations/global-configurations-tab/edit-configuration/edit-configuration.component.spec.ts
+++ b/src/app/system/configurations/global-configurations-tab/edit-configuration/edit-configuration.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditConfigurationComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditConfigurationComponent ]
-    })
-    .compileComponents();
+      declarations: [EditConfigurationComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/configurations/global-configurations-tab/edit-configuration/edit-configuration.component.ts b/src/app/system/configurations/global-configurations-tab/edit-configuration/edit-configuration.component.ts
index a5f22f08a..238ee007d 100644
--- a/src/app/system/configurations/global-configurations-tab/edit-configuration/edit-configuration.component.ts
+++ b/src/app/system/configurations/global-configurations-tab/edit-configuration/edit-configuration.component.ts
@@ -16,7 +16,6 @@ import { SystemService } from '../../../system.service';
   styleUrls: ['./edit-configuration.component.scss']
 })
 export class EditConfigurationComponent implements OnInit {
-
   /** Minimum transaction date allowed. */
   minDate = new Date(2000, 0, 1);
   /** Maximum transaction date allowed. */
@@ -35,11 +34,13 @@ export class EditConfigurationComponent implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    * @param {Router} router Router for navigation.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private settingsService: SettingsService,
-              private route: ActivatedRoute,
-              private router: Router) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private settingsService: SettingsService,
+    private route: ActivatedRoute,
+    private router: Router
+  ) {
     this.route.data.subscribe((data: { configuration: any }) => {
       this.configuration = data.configuration;
     });
@@ -58,11 +59,14 @@ export class EditConfigurationComponent implements OnInit {
    */
   createConfigurationForm() {
     this.configurationForm = this.formBuilder.group({
-      'name': [{ value: this.configuration.name, disabled: true }, Validators.required],
-      'description': [{ value: this.configuration.description, disabled: true }],
-      'value': [this.configuration.value],
-      'stringValue': [this.configuration.stringValue],
-      'dateValue': [this.configuration.dateValue]
+      name: [
+        { value: this.configuration.name, disabled: true },
+        Validators.required
+      ],
+      description: [{ value: this.configuration.description, disabled: true }],
+      value: [this.configuration.value],
+      stringValue: [this.configuration.stringValue],
+      dateValue: [this.configuration.dateValue]
     });
   }
 
@@ -71,7 +75,11 @@ export class EditConfigurationComponent implements OnInit {
    * if successful redirects to view all global configurations.
    */
   submit() {
-    if (this.configurationForm.value.value != null || this.configurationForm.value.stringValue != null || this.configurationForm.value.dateValue != null) {
+    if (
+      this.configurationForm.value.value != null ||
+      this.configurationForm.value.stringValue != null ||
+      this.configurationForm.value.dateValue != null
+    ) {
       const payload = {
         ...this.configurationForm.value
       };
@@ -85,12 +93,9 @@ export class EditConfigurationComponent implements OnInit {
         delete payload.dateValue;
       }
 
-      this.systemService
-        .updateConfiguration(this.configuration.id, payload)
-        .subscribe((response: any) => {
-          this.router.navigate(['../../'], { relativeTo: this.route });
-        });
+      this.systemService.updateConfiguration(this.configuration.id, payload).subscribe((response: any) => {
+        this.router.navigate(['../../'], { relativeTo: this.route });
+      });
     }
   }
-
 }
diff --git a/src/app/system/configurations/global-configurations-tab/global-configuration.resolver.ts b/src/app/system/configurations/global-configurations-tab/global-configuration.resolver.ts
index 7888a15af..b654636b1 100644
--- a/src/app/system/configurations/global-configurations-tab/global-configuration.resolver.ts
+++ b/src/app/system/configurations/global-configurations-tab/global-configuration.resolver.ts
@@ -13,19 +13,17 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class GlobalConfigurationResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
-   constructor(private systemService: SystemService) {}
-
-   /**
-    * Returns the Configuration data.
-    * @returns {Observable}
-    */
-   resolve(route: ActivatedRouteSnapshot): Observable {
-     const configurationId = route.paramMap.get('id');
-     return this.systemService.getConfiguration(configurationId);
-   }
+  constructor(private systemService: SystemService) {}
 
+  /**
+   * Returns the Configuration data.
+   * @returns {Observable}
+   */
+  resolve(route: ActivatedRouteSnapshot): Observable {
+    const configurationId = route.paramMap.get('id');
+    return this.systemService.getConfiguration(configurationId);
+  }
 }
diff --git a/src/app/system/configurations/global-configurations-tab/global-configurations-tab.component.spec.ts b/src/app/system/configurations/global-configurations-tab/global-configurations-tab.component.spec.ts
index 7719af12e..597e7a7b4 100644
--- a/src/app/system/configurations/global-configurations-tab/global-configurations-tab.component.spec.ts
+++ b/src/app/system/configurations/global-configurations-tab/global-configurations-tab.component.spec.ts
@@ -8,9 +8,8 @@ describe('GlobalConfigurationsTabComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ GlobalConfigurationsTabComponent ]
-    })
-    .compileComponents();
+      declarations: [GlobalConfigurationsTabComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/system/configurations/global-configurations-tab/global-configurations-tab.component.ts b/src/app/system/configurations/global-configurations-tab/global-configurations-tab.component.ts
index 8efb20d05..99fcf378b 100644
--- a/src/app/system/configurations/global-configurations-tab/global-configurations-tab.component.ts
+++ b/src/app/system/configurations/global-configurations-tab/global-configurations-tab.component.ts
@@ -18,11 +18,17 @@ import { ConfigurationWizardService } from '../../../configuration-wizard/config
   styleUrls: ['./global-configurations-tab.component.scss']
 })
 export class GlobalConfigurationsTabComponent implements OnInit, AfterViewInit {
-
   /** Configuration data. */
   configurationData: any;
   /** Columns to be displayed in configurations table. */
-  displayedColumns: string[] = ['name', 'enabled', 'value', 'stringValue', 'dateValue', 'edit'];
+  displayedColumns: string[] = [
+    'name',
+    'enabled',
+    'value',
+    'stringValue',
+    'dateValue',
+    'edit'
+  ];
   /** Data source for configurations table. */
   dataSource: MatTableDataSource;
 
@@ -48,12 +54,14 @@ export class GlobalConfigurationsTabComponent implements OnInit, AfterViewInit {
    * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
    * @param {PopoverService} popoverService PopoverService.
    */
-  constructor(private route: ActivatedRoute,
-              private alertService: AlertService,
-              private systemService: SystemService,
-              private router: Router,
-              private configurationWizardService: ConfigurationWizardService,
-              private popoverService: PopoverService) {
+  constructor(
+    private route: ActivatedRoute,
+    private alertService: AlertService,
+    private systemService: SystemService,
+    private router: Router,
+    private configurationWizardService: ConfigurationWizardService,
+    private popoverService: PopoverService
+  ) {
     this.route.data.subscribe((data: { configurations: any }) => {
       this.configurationData = data.configurations;
     });
@@ -69,9 +77,8 @@ export class GlobalConfigurationsTabComponent implements OnInit, AfterViewInit {
   /**
    * Initializes the data source, paginator and sorter for configurations table.
    */
-   setConfigurationData(): void {
-    this.systemService.getConfigurations()
-    .subscribe((configurationData: any) => {
+  setConfigurationData(): void {
+    this.systemService.getConfigurations().subscribe((configurationData: any) => {
       this.configurationData = configurationData.globalConfiguration;
       this.dataSource = new MatTableDataSource(this.configurationData);
       this.dataSource.paginator = this.paginator;
@@ -91,12 +98,13 @@ export class GlobalConfigurationsTabComponent implements OnInit, AfterViewInit {
    * Enables/Disables respective configuration
    */
   toggleStatus(configuration: any) {
-    this.systemService.updateConfiguration(configuration.id, { enabled: !configuration.enabled })
+    this.systemService
+      .updateConfiguration(configuration.id, { enabled: !configuration.enabled })
       .subscribe((response: any) => {
         configuration.enabled = response.changes.enabled;
         if (configuration.name === SettingsService.businessDateConfigName) {
           const msg = configuration.enabled ? 'enabled' : 'disabled';
-          this.alertService.alert({type: SettingsService.businessDateType + ' Set Config', message: msg});
+          this.alertService.alert({ type: SettingsService.businessDateType + ' Set Config', message: msg });
         }
       });
   }
@@ -108,7 +116,12 @@ export class GlobalConfigurationsTabComponent implements OnInit, AfterViewInit {
    * @param position String.
    * @param backdrop Boolean.
    */
-   showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+  showPopover(
+    template: TemplateRef,
+    target: HTMLElement | ElementRef,
+    position: string,
+    backdrop: boolean
+  ): void {
     setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
   }
 
@@ -148,5 +161,4 @@ export class GlobalConfigurationsTabComponent implements OnInit, AfterViewInit {
     this.configurationWizardService.showConfigurations = true;
     this.router.navigate(['/system']);
   }
-
 }
diff --git a/src/app/system/configurations/global-configurations-tab/global-configurations.resolver.ts b/src/app/system/configurations/global-configurations-tab/global-configurations.resolver.ts
index b8cd18ae6..ad950fb96 100644
--- a/src/app/system/configurations/global-configurations-tab/global-configurations.resolver.ts
+++ b/src/app/system/configurations/global-configurations-tab/global-configurations.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class GlobalConfigurationsResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class GlobalConfigurationsResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getConfigurations();
   }
-
 }
diff --git a/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.component.spec.ts b/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.component.spec.ts
index f2217228e..eb87b4173 100644
--- a/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.component.spec.ts
+++ b/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.component.spec.ts
@@ -8,9 +8,8 @@ describe('ConfigureMakerCheckerTasksComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ConfigureMakerCheckerTasksComponent ]
-    })
-    .compileComponents();
+      declarations: [ConfigureMakerCheckerTasksComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.component.ts b/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.component.ts
index 0296b8a23..a32104777 100644
--- a/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.component.ts
+++ b/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.component.ts
@@ -14,7 +14,6 @@ import { SystemService } from '../system.service';
   styleUrls: ['./configure-maker-checker-tasks.component.scss']
 })
 export class ConfigureMakerCheckerTasksComponent implements OnInit, AfterViewInit {
-
   permissionsData: any;
   groupings: string[] = [];
   formData = {};
@@ -28,10 +27,10 @@ export class ConfigureMakerCheckerTasksComponent implements OnInit, AfterViewIni
   backupform: UntypedFormGroup;
 
   permissions: {
-    permissions: { code: string, id: number }[]
+    permissions: { code: string; id: number }[];
   };
   tempPermissionUIData: {
-    permissions: { code: string }[]
+    permissions: { code: string }[];
   }[];
 
   /* Reference of edit button */
@@ -51,12 +50,14 @@ export class ConfigureMakerCheckerTasksComponent implements OnInit, AfterViewIni
    * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
    * @param {PopoverService} popoverService PopoverService.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private systemService: SystemService,
     private formBuilder: UntypedFormBuilder,
     private router: Router,
     private configurationWizardService: ConfigurationWizardService,
-    private popoverService: PopoverService ) {
+    private popoverService: PopoverService
+  ) {
     this.route.data.subscribe((data: { permissions: any }) => {
       this.permissionsData = data.permissions;
     });
@@ -82,16 +83,24 @@ export class ConfigureMakerCheckerTasksComponent implements OnInit, AfterViewIni
     return this.formBuilder.group({
       ...permission,
       ...{
-        code: [permission.code, Validators.required],
-        selected: [{ value: permission.selected, disabled: true }, Validators.required]
+        code: [
+          permission.code,
+          Validators.required
+        ],
+        selected: [
+          { value: permission.selected, disabled: true },
+          Validators.required
+        ]
       }
     });
   }
 
   setMakerCheckerTask() {
-    this.tempPermissionUIData = [{
-      permissions: []
-    }];
+    this.tempPermissionUIData = [
+      {
+        permissions: []
+      }
+    ];
     for (const i in this.permissionsData) {
       if (this.permissionsData[i]) {
         if (this.permissionsData[i].grouping !== this.currentGrouping) {
@@ -111,7 +120,6 @@ export class ConfigureMakerCheckerTasksComponent implements OnInit, AfterViewIni
     this.previousGrouping = grouping;
   }
 
-
   permissionName = function (name: any) {
     name = name || '';
     // replace '_' with ' '
@@ -173,15 +181,14 @@ export class ConfigureMakerCheckerTasksComponent implements OnInit, AfterViewIni
     const permissionData = {
       permissions: {}
     };
-    for (let i = 0; i < value.length; i++ ) {
+    for (let i = 0; i < value.length; i++) {
       data[value[i].code] = value[i].selected;
     }
     permissionData.permissions = data;
     this.formGroup.controls.roster.disable();
     this.checkboxesChanged = false;
     this.isDisabled = true;
-    this.systemService.updateMakerCheckerPermission(permissionData).subscribe((response: any) => {
-    });
+    this.systemService.updateMakerCheckerPermission(permissionData).subscribe((response: any) => {});
   }
 
   /**
@@ -191,7 +198,12 @@ export class ConfigureMakerCheckerTasksComponent implements OnInit, AfterViewIni
    * @param position String.
    * @param backdrop Boolean.
    */
-  showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+  showPopover(
+    template: TemplateRef,
+    target: HTMLElement | ElementRef,
+    position: string,
+    backdrop: boolean
+  ): void {
     setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
   }
 
@@ -201,12 +213,12 @@ export class ConfigureMakerCheckerTasksComponent implements OnInit, AfterViewIni
   ngAfterViewInit() {
     if (this.configurationWizardService.showMakerCheckerTablePage === true) {
       setTimeout(() => {
-          this.showPopover(this.templateButtonEdit, this.buttonEdit.nativeElement, 'bottom', true);
+        this.showPopover(this.templateButtonEdit, this.buttonEdit.nativeElement, 'bottom', true);
       });
     }
     if (this.configurationWizardService.showMakerCheckerTableList === true) {
       setTimeout(() => {
-          this.showPopover(this.templateMcTable, this.mcTable.nativeElement, 'top', true);
+        this.showPopover(this.templateMcTable, this.mcTable.nativeElement, 'top', true);
       });
     }
   }
diff --git a/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.resolver.ts b/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.resolver.ts
index 720351a86..809cd29a1 100644
--- a/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.resolver.ts
+++ b/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.resolver.ts
@@ -13,18 +13,16 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class MakerCheckerTasksResolver implements Resolve {
+  /**
+   * @param {SystemService} systemService System service.
+   */
+  constructor(private systemService: SystemService) {}
 
-    /**
-     * @param {SystemService} systemService System service.
-     */
-    constructor(private systemService: SystemService) { }
-
-    /**
-     * Returns all the Configurable Maker Checker Tasks.
-     * @returns {Observable}
-     */
-    resolve(): Observable {
-        return this.systemService.getMakerCheckerPermissions();
-    }
-
+  /**
+   * Returns all the Configurable Maker Checker Tasks.
+   * @returns {Observable}
+   */
+  resolve(): Observable {
+    return this.systemService.getMakerCheckerPermissions();
+  }
 }
diff --git a/src/app/system/entity-to-entity-mapping/entity-to-entity-mapping.component.spec.ts b/src/app/system/entity-to-entity-mapping/entity-to-entity-mapping.component.spec.ts
index 169414902..337b31641 100644
--- a/src/app/system/entity-to-entity-mapping/entity-to-entity-mapping.component.spec.ts
+++ b/src/app/system/entity-to-entity-mapping/entity-to-entity-mapping.component.spec.ts
@@ -8,9 +8,8 @@ describe('EntityToEntityMappingComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EntityToEntityMappingComponent ]
-    })
-    .compileComponents();
+      declarations: [EntityToEntityMappingComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/entity-to-entity-mapping/entity-to-entity-mapping.component.ts b/src/app/system/entity-to-entity-mapping/entity-to-entity-mapping.component.ts
index 8df41e9e7..c0a534a50 100644
--- a/src/app/system/entity-to-entity-mapping/entity-to-entity-mapping.component.ts
+++ b/src/app/system/entity-to-entity-mapping/entity-to-entity-mapping.component.ts
@@ -29,7 +29,6 @@ import { DeleteDialogComponent } from '../../shared/delete-dialog/delete-dialog.
   styleUrls: ['./entity-to-entity-mapping.component.scss']
 })
 export class EntityToEntityMappingComponent implements OnInit {
-
   /** Stores entity to entity mapping data */
   entityMappings: string[] = [];
   /** Stores Id of selected mapping type */
@@ -68,26 +67,34 @@ export class EntityToEntityMappingComponent implements OnInit {
   /** List of Entity to Entity Mapping */
   displayedColumns: string[] = ['entitymapping'];
   /** Columns for details of a chosen mapping */
-  entityMappingListColumns: string[] = ['fromentity', 'toentity', 'startdate', 'enddate', 'edit', 'delete'];
+  entityMappingListColumns: string[] = [
+    'fromentity',
+    'toentity',
+    'startdate',
+    'enddate',
+    'edit',
+    'delete'
+  ];
 
   /** Paginator for entity table. */
   @ViewChild(MatPaginator) paginator: MatPaginator;
   /** Sorter for entity table. */
   @ViewChild(MatSort) sort: MatSort;
 
-
   /**
    * Retrieves the codes data from `resolve`.
    * @param {ActivatedRoute} route Activated Route.
    * @param {TranslateService} translateService Translate Service.
    */
-  constructor(private route: ActivatedRoute,
-              private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private dateUtils: Dates,
-              private dialog: MatDialog,
-              private settingsService: SettingsService,
-              private translateService: TranslateService) {
+  constructor(
+    private route: ActivatedRoute,
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private dateUtils: Dates,
+    private dialog: MatDialog,
+    private settingsService: SettingsService,
+    private translateService: TranslateService
+  ) {
     this.route.data.subscribe((data: { entityMappings: any }) => {
       this.entityMappings = data.entityMappings;
     });
@@ -98,8 +105,14 @@ export class EntityToEntityMappingComponent implements OnInit {
    */
   createFilterPreferenceForm() {
     this.filterPreferenceForm = this.formBuilder.group({
-      'mappingFirstParamId': ['', Validators.required],
-      'mappingSecondParamId': ['', Validators.required]
+      mappingFirstParamId: [
+        '',
+        Validators.required
+      ],
+      mappingSecondParamId: [
+        '',
+        Validators.required
+      ]
     });
   }
 
@@ -131,7 +144,6 @@ export class EntityToEntityMappingComponent implements OnInit {
     this.retrieveById = id;
     this.createFilterPreferenceForm();
     switch (this.retrieveById) {
-
       case 1:
         this.systemService.getOffices().subscribe((response: any) => {
           this.firstEntityData = response;
@@ -183,7 +195,6 @@ export class EntityToEntityMappingComponent implements OnInit {
         });
         break;
     }
-
   }
 
   /**
@@ -201,11 +212,13 @@ export class EntityToEntityMappingComponent implements OnInit {
 
     this.selectedFromId = this.filterPreference.mappingFirstParamId;
     this.selectedToId = this.filterPreference.mappingSecondParamId;
-    this.systemService.getEntitytoEntityData(this.retrieveById, this.selectedFromId, this.selectedToId).subscribe((response: any) => {
-      this.entityMappingsListData = new MatTableDataSource(response);
-      this.entityMappingsListData.paginator = this.paginator;
-      this.entityMappingsListData.sort = this.sort;
-    });
+    this.systemService
+      .getEntitytoEntityData(this.retrieveById, this.selectedFromId, this.selectedToId)
+      .subscribe((response: any) => {
+        this.entityMappingsListData = new MatTableDataSource(response);
+        this.entityMappingsListData.paginator = this.paginator;
+        this.entityMappingsListData.sort = this.sort;
+      });
   }
 
   /**
@@ -218,7 +231,7 @@ export class EntityToEntityMappingComponent implements OnInit {
     const formfields: FormfieldBase[] = [
       new SelectBase({
         controlName: 'fromId',
-        label:  this.translateService.instant(`labels.inputs.${this.firstMappingEntity}`),
+        label: this.translateService.instant(`labels.inputs.${this.firstMappingEntity}`),
         options: { label: 'name', value: 'id', data: this.firstEntityData },
         required: true
       }),
@@ -240,9 +253,13 @@ export class EntityToEntityMappingComponent implements OnInit {
         type: 'date',
         required: false
       })
+
     ];
     const data = {
-      title: this.translateService.instant('labels.buttons.Add') + ' ' + this.translateService.instant('labels.heading.Entity to Entity Mapping'),
+      title:
+        this.translateService.instant('labels.buttons.Add') +
+        ' ' +
+        this.translateService.instant('labels.heading.Entity to Entity Mapping'),
       layout: { addButtonText: 'Confirm' },
       formfields: formfields
     };
@@ -291,9 +308,13 @@ export class EntityToEntityMappingComponent implements OnInit {
         type: 'date',
         required: false
       })
+
     ];
     const data = {
-      title: this.translateService.instant('labels.buttons.Edit') + ' ' + this.translateService.instant('labels.heading.Entity to Entity Mapping'),
+      title:
+        this.translateService.instant('labels.buttons.Edit') +
+        ' ' +
+        this.translateService.instant('labels.heading.Entity to Entity Mapping'),
       layout: { addButtonText: 'Confirm' },
       formfields: formfields
     };
@@ -305,13 +326,11 @@ export class EntityToEntityMappingComponent implements OnInit {
     });
   }
 
-
   /**
    * Submits the new mapping
    * @param addMappingForm Add Mapping Form Data
    */
   submitNew(addMappingForm: any) {
-
     if (addMappingForm.value.fromId === '') {
       addMappingForm.value.fromId = undefined;
     }
@@ -365,12 +384,10 @@ export class EntityToEntityMappingComponent implements OnInit {
     });
     deleteNoteDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
-        this.systemService.deleteMapping(id)
-          .subscribe(() => {
-            this.showFilteredData();
-          });
+        this.systemService.deleteMapping(id).subscribe(() => {
+          this.showFilteredData();
+        });
       }
     });
   }
-
 }
diff --git a/src/app/system/entity-to-entity-mapping/entity-to-entity-mapping.resolver.ts b/src/app/system/entity-to-entity-mapping/entity-to-entity-mapping.resolver.ts
index 6d64f765b..9b14c5d11 100644
--- a/src/app/system/entity-to-entity-mapping/entity-to-entity-mapping.resolver.ts
+++ b/src/app/system/entity-to-entity-mapping/entity-to-entity-mapping.resolver.ts
@@ -13,18 +13,16 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class EntityToEntityMappingResolver implements Resolve {
+  /**
+   * @param {SystemService} systemService System service.
+   */
+  constructor(private systemService: SystemService) {}
 
-    /**
-     * @param {SystemService} systemService System service.
-     */
-    constructor(private systemService: SystemService) { }
-
-    /**
-     * Returns the Mapping data.
-     * @returns {Observable}
-     */
-    resolve(): Observable {
-        return this.systemService.getEntityMappings();
-    }
-
+  /**
+   * Returns the Mapping data.
+   * @returns {Observable}
+   */
+  resolve(): Observable {
+    return this.systemService.getEntityMappings();
+  }
 }
diff --git a/src/app/system/external-services/amazon-s3/amazon-s3.component.spec.ts b/src/app/system/external-services/amazon-s3/amazon-s3.component.spec.ts
index a3c5d8091..bda843f12 100644
--- a/src/app/system/external-services/amazon-s3/amazon-s3.component.spec.ts
+++ b/src/app/system/external-services/amazon-s3/amazon-s3.component.spec.ts
@@ -8,9 +8,8 @@ describe('AmazonS3Component', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ AmazonS3Component ]
-    })
-    .compileComponents();
+      declarations: [AmazonS3Component]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/external-services/amazon-s3/amazon-s3.component.ts b/src/app/system/external-services/amazon-s3/amazon-s3.component.ts
index b792168d0..1433606bd 100644
--- a/src/app/system/external-services/amazon-s3/amazon-s3.component.ts
+++ b/src/app/system/external-services/amazon-s3/amazon-s3.component.ts
@@ -13,11 +13,13 @@ import { ActivatedRoute } from '@angular/router';
   styleUrls: ['./amazon-s3.component.scss']
 })
 export class AmazonS3Component implements OnInit {
-
   /** Amazon S3 configuration data. */
   amazonS3ConfigurationData: any;
   /** Columns to be displayed in Amazon S3 configuration table. */
-  displayedColumns: string[] = ['name', 'value'];
+  displayedColumns: string[] = [
+    'name',
+    'value'
+  ];
   /** Data source for Amazon S3 configuration table. */
   dataSource: MatTableDataSource;
 
@@ -56,5 +58,4 @@ export class AmazonS3Component implements OnInit {
     }
     return value;
   }
-
 }
diff --git a/src/app/system/external-services/amazon-s3/amazon-s3.resolver.ts b/src/app/system/external-services/amazon-s3/amazon-s3.resolver.ts
index 1a62d1362..03f34a7f6 100644
--- a/src/app/system/external-services/amazon-s3/amazon-s3.resolver.ts
+++ b/src/app/system/external-services/amazon-s3/amazon-s3.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class AmazonS3ConfigurationResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class AmazonS3ConfigurationResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getExternalConfiguration('S3');
   }
-
 }
diff --git a/src/app/system/external-services/amazon-s3/edit-amazon-s3/edit-amazon-s3.component.spec.ts b/src/app/system/external-services/amazon-s3/edit-amazon-s3/edit-amazon-s3.component.spec.ts
index bf3a02b71..ca9e44c86 100644
--- a/src/app/system/external-services/amazon-s3/edit-amazon-s3/edit-amazon-s3.component.spec.ts
+++ b/src/app/system/external-services/amazon-s3/edit-amazon-s3/edit-amazon-s3.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditAmazonS3Component', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditAmazonS3Component ]
-    })
-    .compileComponents();
+      declarations: [EditAmazonS3Component]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/external-services/amazon-s3/edit-amazon-s3/edit-amazon-s3.component.ts b/src/app/system/external-services/amazon-s3/edit-amazon-s3/edit-amazon-s3.component.ts
index b8f1a770d..b90170924 100644
--- a/src/app/system/external-services/amazon-s3/edit-amazon-s3/edit-amazon-s3.component.ts
+++ b/src/app/system/external-services/amazon-s3/edit-amazon-s3/edit-amazon-s3.component.ts
@@ -15,7 +15,6 @@ import { SystemService } from 'app/system/system.service';
   styleUrls: ['./edit-amazon-s3.component.scss']
 })
 export class EditAmazonS3Component implements OnInit {
-
   /** Amazon S3 Configuration data */
   amazonS3ConfigurationData: any;
   /** Amazon S3 Configuration Form */
@@ -32,10 +31,12 @@ export class EditAmazonS3Component implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    * @param {Router} router Router for navigation.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private route: ActivatedRoute,
-              private router: Router) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private route: ActivatedRoute,
+    private router: Router
+  ) {
     this.route.data.subscribe((data: { amazonS3Configuration: any }) => {
       this.amazonS3ConfigurationData = data.amazonS3Configuration;
     });
@@ -55,9 +56,18 @@ export class EditAmazonS3Component implements OnInit {
    */
   createAmazonS3ConfigurationForm() {
     this.amazonS3ConfigurationForm = this.formBuilder.group({
-      's3_bucket_name': [this.amazonS3ConfigurationData[1].value, Validators.required],
-      's3_access_key': [this.amazonS3ConfigurationData[0].value, Validators.required],
-      's3_secret_key': [this.amazonS3ConfigurationData[2].value, Validators.required]
+      s3_bucket_name: [
+        this.amazonS3ConfigurationData[1].value,
+        Validators.required
+      ],
+      s3_access_key: [
+        this.amazonS3ConfigurationData[0].value,
+        Validators.required
+      ],
+      s3_secret_key: [
+        this.amazonS3ConfigurationData[2].value,
+        Validators.required
+      ]
     });
   }
 
@@ -72,5 +82,4 @@ export class EditAmazonS3Component implements OnInit {
         this.router.navigate(['../'], { relativeTo: this.route });
       });
   }
-
 }
diff --git a/src/app/system/external-services/email/edit-email/edit-email.component.spec.ts b/src/app/system/external-services/email/edit-email/edit-email.component.spec.ts
index 162cf7566..427c75b26 100644
--- a/src/app/system/external-services/email/edit-email/edit-email.component.spec.ts
+++ b/src/app/system/external-services/email/edit-email/edit-email.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditEmailComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditEmailComponent ]
-    })
-    .compileComponents();
+      declarations: [EditEmailComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/external-services/email/edit-email/edit-email.component.ts b/src/app/system/external-services/email/edit-email/edit-email.component.ts
index 79a48b09b..6daf08e43 100644
--- a/src/app/system/external-services/email/edit-email/edit-email.component.ts
+++ b/src/app/system/external-services/email/edit-email/edit-email.component.ts
@@ -15,7 +15,6 @@ import { SystemService } from 'app/system/system.service';
   styleUrls: ['./edit-email.component.scss']
 })
 export class EditEmailComponent implements OnInit {
-
   /** Password input field type. */
   passwordInputType: string;
   /** Email Configuration data */
@@ -30,10 +29,12 @@ export class EditEmailComponent implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    * @param {Router} router Router for navigation.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private route: ActivatedRoute,
-              private router: Router) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private route: ActivatedRoute,
+    private router: Router
+  ) {
     this.route.data.subscribe((data: { emailConfiguration: any }) => {
       this.emailConfigurationData = data.emailConfiguration;
     });
@@ -52,13 +53,34 @@ export class EditEmailComponent implements OnInit {
    */
   setEmailConfigurationForm() {
     this.emailConfigurationForm = this.formBuilder.group({
-      'username': [this.emailConfigurationData[0].value, Validators.required],
-      'password': [this.emailConfigurationData[1].value, Validators.required],
-      'host': [this.emailConfigurationData[2].value, Validators.required],
-      'port': [this.emailConfigurationData[3].value, Validators.required],
-      'useTLS': [this.emailConfigurationData[4].value, Validators.required],
-      'fromEmail': [this.emailConfigurationData[5].value, Validators.required],
-      'fromName': [this.emailConfigurationData[6].value, Validators.required]
+      username: [
+        this.emailConfigurationData[0].value,
+        Validators.required
+      ],
+      password: [
+        this.emailConfigurationData[1].value,
+        Validators.required
+      ],
+      host: [
+        this.emailConfigurationData[2].value,
+        Validators.required
+      ],
+      port: [
+        this.emailConfigurationData[3].value,
+        Validators.required
+      ],
+      useTLS: [
+        this.emailConfigurationData[4].value,
+        Validators.required
+      ],
+      fromEmail: [
+        this.emailConfigurationData[5].value,
+        Validators.required
+      ],
+      fromName: [
+        this.emailConfigurationData[6].value,
+        Validators.required
+      ]
     });
   }
 
@@ -73,5 +95,4 @@ export class EditEmailComponent implements OnInit {
         this.router.navigate(['../'], { relativeTo: this.route });
       });
   }
-
 }
diff --git a/src/app/system/external-services/email/email.component.spec.ts b/src/app/system/external-services/email/email.component.spec.ts
index f435ad93b..7665c2c6d 100644
--- a/src/app/system/external-services/email/email.component.spec.ts
+++ b/src/app/system/external-services/email/email.component.spec.ts
@@ -8,9 +8,8 @@ describe('EmailComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EmailComponent ]
-    })
-    .compileComponents();
+      declarations: [EmailComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/external-services/email/email.component.ts b/src/app/system/external-services/email/email.component.ts
index bb63c8f10..00c135ab5 100644
--- a/src/app/system/external-services/email/email.component.ts
+++ b/src/app/system/external-services/email/email.component.ts
@@ -13,11 +13,13 @@ import { MatTableDataSource } from '@angular/material/table';
   styleUrls: ['./email.component.scss']
 })
 export class EmailComponent implements OnInit {
-
   /** Email configuration data. */
   emailConfigurationData: any;
   /** Columns to be displayed in Email configuration table. */
-  displayedColumns: string[] = ['name', 'value'];
+  displayedColumns: string[] = [
+    'name',
+    'value'
+  ];
   /** Data source for Email configuration table. */
   dataSource: MatTableDataSource;
 
@@ -48,5 +50,4 @@ export class EmailComponent implements OnInit {
     this.dataSource = new MatTableDataSource(this.emailConfigurationData);
     this.dataSource.sort = this.sort;
   }
-
 }
diff --git a/src/app/system/external-services/email/email.resolver.ts b/src/app/system/external-services/email/email.resolver.ts
index cb50b0ac1..a513c3e08 100644
--- a/src/app/system/external-services/email/email.resolver.ts
+++ b/src/app/system/external-services/email/email.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class EmailConfigurationResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class EmailConfigurationResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getExternalConfiguration('SMTP');
   }
-
 }
diff --git a/src/app/system/external-services/external-services.component.spec.ts b/src/app/system/external-services/external-services.component.spec.ts
index bbdfbabe0..e5f3be075 100644
--- a/src/app/system/external-services/external-services.component.spec.ts
+++ b/src/app/system/external-services/external-services.component.spec.ts
@@ -8,9 +8,8 @@ describe('ExternalServicesComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ExternalServicesComponent ]
-    })
-    .compileComponents();
+      declarations: [ExternalServicesComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/external-services/external-services.component.ts b/src/app/system/external-services/external-services.component.ts
index cbae37a8a..cf619e700 100644
--- a/src/app/system/external-services/external-services.component.ts
+++ b/src/app/system/external-services/external-services.component.ts
@@ -6,22 +6,21 @@ import { Component } from '@angular/core';
  */
 @Component({
   selector: 'mifosx-external-services',
-  templateUrl: './external-services.component.html',
+  templateUrl: './external-services.component.html'
 })
 export class ExternalServicesComponent {
   // Initialize an array of 4 boolean values, all set to false
   arrowBooleans: boolean[] = new Array(4).fill(false);
 
-  constructor() { }
+  constructor() {}
 
   /**
    * Popover function
    * @param arrowNumber - The index of the boolean value to toggle.
    */
 
-  arrowBooleansToggle(arrowNumber:  number) {
+  arrowBooleansToggle(arrowNumber: number) {
     // Toggle the boolean value at the given index
     this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber];
   }
-
 }
diff --git a/src/app/system/external-services/notification/edit-notification/edit-notification.component.spec.ts b/src/app/system/external-services/notification/edit-notification/edit-notification.component.spec.ts
index 14114b085..5dc17a47c 100644
--- a/src/app/system/external-services/notification/edit-notification/edit-notification.component.spec.ts
+++ b/src/app/system/external-services/notification/edit-notification/edit-notification.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditNotificationComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditNotificationComponent ]
-    })
-    .compileComponents();
+      declarations: [EditNotificationComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/external-services/notification/edit-notification/edit-notification.component.ts b/src/app/system/external-services/notification/edit-notification/edit-notification.component.ts
index d9fe571d8..8f7c05c97 100644
--- a/src/app/system/external-services/notification/edit-notification/edit-notification.component.ts
+++ b/src/app/system/external-services/notification/edit-notification/edit-notification.component.ts
@@ -15,7 +15,6 @@ import { SystemService } from 'app/system/system.service';
   styleUrls: ['./edit-notification.component.scss']
 })
 export class EditNotificationComponent implements OnInit {
-
   /** Notification Configuration data */
   notificationConfigurationData: any;
   /** Notification Configuration Form */
@@ -28,10 +27,12 @@ export class EditNotificationComponent implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    * @param {Router} router Router for navigation.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private route: ActivatedRoute,
-              private router: Router) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private route: ActivatedRoute,
+    private router: Router
+  ) {
     this.route.data.subscribe((data: { notificationConfiguration: any }) => {
       this.notificationConfigurationData = data.notificationConfiguration;
     });
@@ -49,9 +50,18 @@ export class EditNotificationComponent implements OnInit {
    */
   setNotificationConfigurationForm() {
     this.notificationConfigurationForm = this.formBuilder.group({
-      'server_key': [this.notificationConfigurationData[0].value, Validators.required],
-      'gcm_end_point': [this.notificationConfigurationData[1].value, Validators.required],
-      'fcm_end_point': [this.notificationConfigurationData[2].value, Validators.required]
+      server_key: [
+        this.notificationConfigurationData[0].value,
+        Validators.required
+      ],
+      gcm_end_point: [
+        this.notificationConfigurationData[1].value,
+        Validators.required
+      ],
+      fcm_end_point: [
+        this.notificationConfigurationData[2].value,
+        Validators.required
+      ]
     });
   }
 
@@ -66,5 +76,4 @@ export class EditNotificationComponent implements OnInit {
         this.router.navigate(['../'], { relativeTo: this.route });
       });
   }
-
 }
diff --git a/src/app/system/external-services/notification/notification.component.spec.ts b/src/app/system/external-services/notification/notification.component.spec.ts
index 69192c5e3..50b267b5a 100644
--- a/src/app/system/external-services/notification/notification.component.spec.ts
+++ b/src/app/system/external-services/notification/notification.component.spec.ts
@@ -8,9 +8,8 @@ describe('NotificationComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ NotificationComponent ]
-    })
-    .compileComponents();
+      declarations: [NotificationComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/external-services/notification/notification.component.ts b/src/app/system/external-services/notification/notification.component.ts
index 8b1a21860..cdc539c33 100644
--- a/src/app/system/external-services/notification/notification.component.ts
+++ b/src/app/system/external-services/notification/notification.component.ts
@@ -13,11 +13,13 @@ import { MatTableDataSource } from '@angular/material/table';
   styleUrls: ['./notification.component.scss']
 })
 export class NotificationComponent implements OnInit {
-
   /** Notification configuration data. */
   notificationConfigurationData: any;
   /** Columns to be displayed in Notification configuration table. */
-  displayedColumns: string[] = ['name', 'value'];
+  displayedColumns: string[] = [
+    'name',
+    'value'
+  ];
   /** Data source for Notification configuration table. */
   dataSource: MatTableDataSource;
 
@@ -56,5 +58,4 @@ export class NotificationComponent implements OnInit {
     }
     return value;
   }
-
 }
diff --git a/src/app/system/external-services/notification/notification.resolver.ts b/src/app/system/external-services/notification/notification.resolver.ts
index 74d3bd889..3e19fed53 100644
--- a/src/app/system/external-services/notification/notification.resolver.ts
+++ b/src/app/system/external-services/notification/notification.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class NotificationConfigurationResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class NotificationConfigurationResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getExternalConfiguration('NOTIFICATION');
   }
-
 }
diff --git a/src/app/system/external-services/sms/edit-sms/edit-sms.component.spec.ts b/src/app/system/external-services/sms/edit-sms/edit-sms.component.spec.ts
index 4c1c1069f..041696118 100644
--- a/src/app/system/external-services/sms/edit-sms/edit-sms.component.spec.ts
+++ b/src/app/system/external-services/sms/edit-sms/edit-sms.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditSmsComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditSMSComponent ]
-    })
-    .compileComponents();
+      declarations: [EditSMSComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/external-services/sms/edit-sms/edit-sms.component.ts b/src/app/system/external-services/sms/edit-sms/edit-sms.component.ts
index f3f0155bb..2ccbc0283 100644
--- a/src/app/system/external-services/sms/edit-sms/edit-sms.component.ts
+++ b/src/app/system/external-services/sms/edit-sms/edit-sms.component.ts
@@ -15,7 +15,6 @@ import { SystemService } from 'app/system/system.service';
   styleUrls: ['./edit-sms.component.scss']
 })
 export class EditSMSComponent implements OnInit {
-
   /** SMS Configuration data */
   smsConfigurationData: any;
   /** SMS Configuration Form */
@@ -28,10 +27,12 @@ export class EditSMSComponent implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    * @param {Router} router Router for navigation.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private route: ActivatedRoute,
-              private router: Router) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private route: ActivatedRoute,
+    private router: Router
+  ) {
     this.route.data.subscribe((data: { smsConfiguration: any }) => {
       this.smsConfigurationData = data.smsConfiguration;
     });
@@ -49,10 +50,22 @@ export class EditSMSComponent implements OnInit {
    */
   setSMSConfigurationForm() {
     this.smsConfigurationForm = this.formBuilder.group({
-      'host_name': [this.smsConfigurationData[0].value, Validators.required],
-      'port_number': [this.smsConfigurationData[1].value, Validators.required],
-      'end_point': [this.smsConfigurationData[2].value, Validators.required],
-      'tenant_app_key': [this.smsConfigurationData[3].value, Validators.required]
+      host_name: [
+        this.smsConfigurationData[0].value,
+        Validators.required
+      ],
+      port_number: [
+        this.smsConfigurationData[1].value,
+        Validators.required
+      ],
+      end_point: [
+        this.smsConfigurationData[2].value,
+        Validators.required
+      ],
+      tenant_app_key: [
+        this.smsConfigurationData[3].value,
+        Validators.required
+      ]
     });
   }
 
@@ -67,5 +80,4 @@ export class EditSMSComponent implements OnInit {
         this.router.navigate(['../'], { relativeTo: this.route });
       });
   }
-
 }
diff --git a/src/app/system/external-services/sms/sms.component.spec.ts b/src/app/system/external-services/sms/sms.component.spec.ts
index 40911f3e5..1db1031fb 100644
--- a/src/app/system/external-services/sms/sms.component.spec.ts
+++ b/src/app/system/external-services/sms/sms.component.spec.ts
@@ -8,9 +8,8 @@ describe('SmsComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ SMSComponent ]
-    })
-    .compileComponents();
+      declarations: [SMSComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/external-services/sms/sms.component.ts b/src/app/system/external-services/sms/sms.component.ts
index 2efbf0475..2f0a49210 100644
--- a/src/app/system/external-services/sms/sms.component.ts
+++ b/src/app/system/external-services/sms/sms.component.ts
@@ -13,11 +13,13 @@ import { MatTableDataSource } from '@angular/material/table';
   styleUrls: ['./sms.component.scss']
 })
 export class SMSComponent implements OnInit {
-
   /** SMS configuration data. */
   smsConfigurationData: any;
   /** Columns to be displayed in SMS configuration table. */
-  displayedColumns: string[] = ['name', 'value'];
+  displayedColumns: string[] = [
+    'name',
+    'value'
+  ];
   /** Data source for SMS configuration table. */
   dataSource: MatTableDataSource;
 
@@ -29,10 +31,10 @@ export class SMSComponent implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    */
   constructor(private route: ActivatedRoute) {
-    this.route.data.subscribe((data: {smsConfiguration: any}) => {
+    this.route.data.subscribe((data: { smsConfiguration: any }) => {
       this.smsConfigurationData = data.smsConfiguration;
     });
-   }
+  }
 
   /**
    * Sets the SMS Configuration table.
@@ -48,5 +50,4 @@ export class SMSComponent implements OnInit {
     this.dataSource = new MatTableDataSource(this.smsConfigurationData);
     this.dataSource.sort = this.sort;
   }
-
 }
diff --git a/src/app/system/external-services/sms/sms.resolver.ts b/src/app/system/external-services/sms/sms.resolver.ts
index 0f74485ef..66cde7bb9 100644
--- a/src/app/system/external-services/sms/sms.resolver.ts
+++ b/src/app/system/external-services/sms/sms.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class SMSConfigurationResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class SMSConfigurationResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getExternalConfiguration('SMS');
   }
-
 }
diff --git a/src/app/system/manage-data-tables/app-table-data.ts b/src/app/system/manage-data-tables/app-table-data.ts
index dd20012e5..81bdd3d5a 100644
--- a/src/app/system/manage-data-tables/app-table-data.ts
+++ b/src/app/system/manage-data-tables/app-table-data.ts
@@ -1,4 +1,4 @@
-export const appTableData: { displayValue: string, value: string }[] = [
+export const appTableData: { displayValue: string; value: string }[] = [
   { displayValue: 'Client', value: 'm_client' },
   { displayValue: 'Group', value: 'm_group' },
   { displayValue: 'Center', value: 'm_center' },
@@ -11,13 +11,13 @@ export const appTableData: { displayValue: string, value: string }[] = [
   { displayValue: 'Share Product', value: 'm_share_product' }
 ];
 
-export const entitySubTypeData: { displayValue: string, value: string }[] = [
+export const entitySubTypeData: { displayValue: string; value: string }[] = [
   { displayValue: 'Person', value: 'Person' },
-  { displayValue: 'Entity', value: 'Entity' },
+  { displayValue: 'Entity', value: 'Entity' }
 ];
 
-export const savingsSubTypeData: { displayValue: string, value: string }[] = [
+export const savingsSubTypeData: { displayValue: string; value: string }[] = [
   { displayValue: 'Savings Product', value: 'Savings Product' },
   { displayValue: 'Fixed Deposit', value: 'Fixed Deposit' },
-  { displayValue: 'Recurring Deposit', value: 'Recurring Deposit' },
+  { displayValue: 'Recurring Deposit', value: 'Recurring Deposit' }
 ];
diff --git a/src/app/system/manage-data-tables/column-dialog/column-dialog.component.spec.ts b/src/app/system/manage-data-tables/column-dialog/column-dialog.component.spec.ts
index a304ea04b..38d070848 100644
--- a/src/app/system/manage-data-tables/column-dialog/column-dialog.component.spec.ts
+++ b/src/app/system/manage-data-tables/column-dialog/column-dialog.component.spec.ts
@@ -8,9 +8,8 @@ describe('ColumnDialogComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ColumnDialogComponent ]
-    })
-    .compileComponents();
+      declarations: [ColumnDialogComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-data-tables/column-dialog/column-dialog.component.ts b/src/app/system/manage-data-tables/column-dialog/column-dialog.component.ts
index 43d37280e..0ee432d1b 100644
--- a/src/app/system/manage-data-tables/column-dialog/column-dialog.component.ts
+++ b/src/app/system/manage-data-tables/column-dialog/column-dialog.component.ts
@@ -15,7 +15,6 @@ import { columnTypeData } from '../column-type-data';
   styleUrls: ['./column-dialog.component.scss']
 })
 export class ColumnDialogComponent implements OnInit {
-
   /** Column Form. */
   columnForm: UntypedFormGroup;
   /** Column Type Data */
@@ -26,22 +25,53 @@ export class ColumnDialogComponent implements OnInit {
    * @param {FormBuilder} formBuilder Form Builder.
    * @param {any} data Provides the column codes and values for the form (if available).
    */
-  constructor(public dialogRef: MatDialogRef,
-              public formBuilder: UntypedFormBuilder,
-              @Inject(MAT_DIALOG_DATA) public data: any) { }
+  constructor(
+    public dialogRef: MatDialogRef,
+    public formBuilder: UntypedFormBuilder,
+    @Inject(MAT_DIALOG_DATA) public data: any
+  ) {}
 
   /**
    * Creates the add column form.
    */
   ngOnInit() {
     this.columnForm = this.formBuilder.group({
-      'name': [this.data ? this.data.columnName : '', Validators.required],
-      'type': [{ value: this.data ? (this.data.columnDisplayType === '' ? '' : this.getColumnType(this.data.columnDisplayType)) : '', disabled: this.data.type === 'existing' }, Validators.required],
-      'length': [{ value: this.data ? + this.data.columnLength : '', disabled: this.getColumnType(this.data.columnDisplayType) !== 'String' || this.data.type === 'existing' }, Validators.required],
-      'mandatory': [{ value: this.data.isColumnNullable, disabled: this.data.type === 'existing' }],
-      'unique': [{ value: this.data.isColumnUnique, disabled: this.data.isColumnNullable || this.data.type === 'existing' }],
-      'indexed': [{ value: this.data.isColumnIndexed, disabled: this.data.type === 'existing' }],
-      'code': [{ value: this.data ? this.data.columnCode : '', disabled: this.getColumnType(this.data.columnDisplayType) !== 'Dropdown' || this.data.type === 'existing' }, Validators.required],
+      name: [
+        this.data ? this.data.columnName : '',
+        Validators.required
+      ],
+      type: [
+        {
+          value: this.data
+            ? this.data.columnDisplayType === ''
+              ? ''
+              : this.getColumnType(this.data.columnDisplayType)
+            : '',
+          disabled: this.data.type === 'existing'
+        },
+        Validators.required
+
+      ],
+      length: [
+        {
+          value: this.data ? +this.data.columnLength : '',
+          disabled: this.getColumnType(this.data.columnDisplayType) !== 'String' || this.data.type === 'existing'
+        },
+        Validators.required
+
+      ],
+      mandatory: [{ value: this.data.isColumnNullable, disabled: this.data.type === 'existing' }],
+      unique: [
+        { value: this.data.isColumnUnique, disabled: this.data.isColumnNullable || this.data.type === 'existing' }],
+      indexed: [{ value: this.data.isColumnIndexed, disabled: this.data.type === 'existing' }],
+      code: [
+        {
+          value: this.data ? this.data.columnCode : '',
+          disabled: this.getColumnType(this.data.columnDisplayType) !== 'Dropdown' || this.data.type === 'existing'
+        },
+        Validators.required
+
+      ]
     });
     this.onColumnTypeChanges();
   }
@@ -72,25 +102,24 @@ export class ColumnDialogComponent implements OnInit {
    * Watches on Column Type field to enable/diable certain fields.
    */
   onColumnTypeChanges() {
-    this.columnForm.get('type').valueChanges
-      .subscribe(type => {
-        switch (type) {
-          case 'String': {
-            this.columnForm.get('length').enable();
-            this.columnForm.get('code').disable();
-            break;
-          }
-          case 'Dropdown': {
-            this.columnForm.get('code').enable();
-            this.columnForm.get('length').disable();
-            break;
-          }
-          default: {
-            this.columnForm.get('code').disable();
-            this.columnForm.get('length').disable();
-          }
+    this.columnForm.get('type').valueChanges.subscribe((type) => {
+      switch (type) {
+        case 'String': {
+          this.columnForm.get('length').enable();
+          this.columnForm.get('code').disable();
+          break;
         }
-      });
+        case 'Dropdown': {
+          this.columnForm.get('code').enable();
+          this.columnForm.get('length').disable();
+          break;
+        }
+        default: {
+          this.columnForm.get('code').disable();
+          this.columnForm.get('length').disable();
+        }
+      }
+    });
   }
 
   /**
@@ -99,5 +128,4 @@ export class ColumnDialogComponent implements OnInit {
   submit() {
     this.dialogRef.close(this.columnForm.value);
   }
-
 }
diff --git a/src/app/system/manage-data-tables/column-type-data.ts b/src/app/system/manage-data-tables/column-type-data.ts
index bc799a050..4e33f6daa 100644
--- a/src/app/system/manage-data-tables/column-type-data.ts
+++ b/src/app/system/manage-data-tables/column-type-data.ts
@@ -1,10 +1,10 @@
-export const columnTypeData: { displayValue: string, value: string }[] = [
-    { displayValue: 'Boolean', value: 'Boolean' },
-    { displayValue: 'Date', value: 'Date' },
-    { displayValue: 'Date and Time', value: 'Datetime' },
-    { displayValue: 'Decimal', value: 'Decimal' },
-    { displayValue: 'Dropdown', value: 'Dropdown' },
-    { displayValue: 'Number', value: 'Number' },
-    { displayValue: 'String', value: 'String' },
-    { displayValue: 'Text', value: 'Text' }
-  ];
+export const columnTypeData: { displayValue: string; value: string }[] = [
+  { displayValue: 'Boolean', value: 'Boolean' },
+  { displayValue: 'Date', value: 'Date' },
+  { displayValue: 'Date and Time', value: 'Datetime' },
+  { displayValue: 'Decimal', value: 'Decimal' },
+  { displayValue: 'Dropdown', value: 'Dropdown' },
+  { displayValue: 'Number', value: 'Number' },
+  { displayValue: 'String', value: 'String' },
+  { displayValue: 'Text', value: 'Text' }
+];
diff --git a/src/app/system/manage-data-tables/create-data-table/create-data-table.component.spec.ts b/src/app/system/manage-data-tables/create-data-table/create-data-table.component.spec.ts
index 64788c2b2..f7129dad1 100644
--- a/src/app/system/manage-data-tables/create-data-table/create-data-table.component.spec.ts
+++ b/src/app/system/manage-data-tables/create-data-table/create-data-table.component.spec.ts
@@ -8,9 +8,8 @@ describe('CreateDataTableComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CreateDataTableComponent ]
-    })
-    .compileComponents();
+      declarations: [CreateDataTableComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-data-tables/create-data-table/create-data-table.component.ts b/src/app/system/manage-data-tables/create-data-table/create-data-table.component.ts
index baa0a8daa..751b7e6ad 100644
--- a/src/app/system/manage-data-tables/create-data-table/create-data-table.component.ts
+++ b/src/app/system/manage-data-tables/create-data-table/create-data-table.component.ts
@@ -33,7 +33,6 @@ import { DatatableColumn } from '../datatable-column.model';
   styleUrls: ['./create-data-table.component.scss']
 })
 export class CreateDataTableComponent implements OnInit, AfterViewInit {
-
   /** Data Table Form */
   dataTableForm: UntypedFormGroup;
   /** Application Table Data */
@@ -46,18 +45,27 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
   columnData: DatatableColumn[] = [];
   /** Data passed to dialog. */
   dataForDialog: DatatableColumn = {
-      columnName: undefined,
-      columnDisplayType: undefined,
-      isColumnNullable: undefined,
-      columnLength: undefined,
-      columnCode: undefined,
-      columnCodes: undefined,
-      type: undefined,
-      isColumnUnique: undefined,
-      isColumnIndexed: undefined
-    };
+    columnName: undefined,
+    columnDisplayType: undefined,
+    isColumnNullable: undefined,
+    columnLength: undefined,
+    columnCode: undefined,
+    columnCodes: undefined,
+    type: undefined,
+    isColumnUnique: undefined,
+    isColumnIndexed: undefined
+  };
   /** Columns to be displayed in columns table. */
-  displayedColumns: string[] = ['name', 'type', 'length', 'code', 'mandatory', 'unique', 'indexed', 'actions'];
+  displayedColumns: string[] = [
+    'name',
+    'type',
+    'length',
+    'code',
+    'mandatory',
+    'unique',
+    'indexed',
+    'actions'
+  ];
   /** Data source for columns table. */
   dataSource: MatTableDataSource;
   /** Paginator for columns table. */
@@ -81,14 +89,16 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
    * @param {PopoverService} popoverService PopoverService.
    * @param {TranslateService} translateService Translate Service.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private route: ActivatedRoute,
-              private router: Router,
-              private dialog: MatDialog,
-              private configurationWizardService: ConfigurationWizardService,
-              private popoverService: PopoverService,
-              private translateService: TranslateService) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private route: ActivatedRoute,
+    private router: Router,
+    private dialog: MatDialog,
+    private configurationWizardService: ConfigurationWizardService,
+    private popoverService: PopoverService,
+    private translateService: TranslateService
+  ) {
     this.route.data.subscribe((data: { columnCodes: any }) => {
       this.dataForDialog.columnCodes = data.columnCodes;
     });
@@ -101,8 +111,8 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
     this.createDataTableForm();
     this.setColumns();
     this.dataTableForm.controls.apptableName.valueChanges.subscribe((value: any) => {
-      this.showEntitySubType = (value === 'm_client');
-      this.showSavingsSubType = (value === 'm_savings_product');
+      this.showEntitySubType = value === 'm_client';
+      this.showSavingsSubType = value === 'm_savings_product';
     });
   }
 
@@ -120,10 +130,16 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
    */
   createDataTableForm() {
     this.dataTableForm = this.formBuilder.group({
-      'datatableName': ['', Validators.required],
-      'apptableName': ['', Validators.required],
-      'multiRow': [false],
-      'entitySubType': ['']
+      datatableName: [
+        '',
+        Validators.required
+      ],
+      apptableName: [
+        '',
+        Validators.required
+      ],
+      multiRow: [false],
+      entitySubType: ['']
     });
   }
 
@@ -181,7 +197,7 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
     });
     editColumnDialogRef.afterClosed().subscribe((response: any) => {
       if (response !== '') {
-        this.columnData[this.columnData.findIndex(newColumn => newColumn.columnName === column.name)] = {
+        this.columnData[this.columnData.findIndex((newColumn) => newColumn.columnName === column.name)] = {
           columnName: response.name,
           columnDisplayType: response.type,
           isColumnNullable: !response.mandatory,
@@ -202,7 +218,7 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
    */
   deleteColumn(column: any) {
     const deleteColumnDialogRef = this.dialog.open(DeleteDialogComponent, {
-      data: { deleteContext:  this.translateService.instant('labels.inputs.Column') + ' ' + column.name}
+      data: { deleteContext: this.translateService.instant('labels.inputs.Column') + ' ' + column.name }
     });
     deleteColumnDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
@@ -236,10 +252,16 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
     }
     this.systemService.createDataTable(payload).subscribe((response: any) => {
       if (this.configurationWizardService.showDatatablesForm === true) {
-          this.configurationWizardService.showDatatablesForm = false;
-          this.openDialog();
+        this.configurationWizardService.showDatatablesForm = false;
+        this.openDialog();
       } else {
-        this.router.navigate(['../', response.resourceIdentifier], { relativeTo: this.route });
+        this.router.navigate(
+          [
+            '../',
+            response.resourceIdentifier
+          ],
+          { relativeTo: this.route }
+        );
       }
     });
   }
@@ -251,7 +273,12 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
    * @param position String.
    * @param backdrop Boolean.
    */
-  showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+  showPopover(
+    template: TemplateRef,
+    target: HTMLElement | ElementRef,
+    position: string,
+    backdrop: boolean
+  ): void {
     setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
   }
 
@@ -261,7 +288,7 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
   ngAfterViewInit() {
     if (this.configurationWizardService.showDatatablesForm === true) {
       setTimeout(() => {
-          this.showPopover(this.templateDataTableFormRef, this.dataTableFormRef.nativeElement, 'bottom', true);
+        this.showPopover(this.templateDataTableFormRef, this.dataTableFormRef.nativeElement, 'bottom', true);
       });
     }
   }
@@ -291,22 +318,22 @@ export class CreateDataTableComponent implements OnInit, AfterViewInit {
     const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, {
       data: {
         stepName: 'data table'
-      },
+      }
     });
     continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => {
       if (response.step === 1) {
-          this.configurationWizardService.showDatatablesForm = false;
-          this.router.navigate(['../'], { relativeTo: this.route });
-        } else if (response.step === 2) {
-          this.configurationWizardService.showDatatablesForm = true;
-          this.router.routeReuseStrategy.shouldReuseRoute = () => false;
-          this.router.onSameUrlNavigation = 'reload';
-          this.router.navigate(['/organization/data-tables/create']);
-        } else if (response.step === 3) {
-          this.configurationWizardService.showDatatablesForm = false;
-          this.configurationWizardService.showSystemCodes = true;
-          this.router.navigate(['/system']);
-        }
+        this.configurationWizardService.showDatatablesForm = false;
+        this.router.navigate(['../'], { relativeTo: this.route });
+      } else if (response.step === 2) {
+        this.configurationWizardService.showDatatablesForm = true;
+        this.router.routeReuseStrategy.shouldReuseRoute = () => false;
+        this.router.onSameUrlNavigation = 'reload';
+        this.router.navigate(['/organization/data-tables/create']);
+      } else if (response.step === 3) {
+        this.configurationWizardService.showDatatablesForm = false;
+        this.configurationWizardService.showSystemCodes = true;
+        this.router.navigate(['/system']);
+      }
     });
   }
 }
diff --git a/src/app/system/manage-data-tables/data-table.resolver.ts b/src/app/system/manage-data-tables/data-table.resolver.ts
index 4492da060..6f6149569 100644
--- a/src/app/system/manage-data-tables/data-table.resolver.ts
+++ b/src/app/system/manage-data-tables/data-table.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class DataTableResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -28,6 +27,4 @@ export class DataTableResolver implements Resolve {
     const dataTableName = route.paramMap.get('datatableName');
     return this.systemService.getDataTable(dataTableName);
   }
-
 }
-
diff --git a/src/app/system/manage-data-tables/datatable-column.model.ts b/src/app/system/manage-data-tables/datatable-column.model.ts
index 115c3e6dd..50be04926 100644
--- a/src/app/system/manage-data-tables/datatable-column.model.ts
+++ b/src/app/system/manage-data-tables/datatable-column.model.ts
@@ -1,6 +1,4 @@
-
 export interface DatatableColumn {
-
   columnName: string;
   columnDisplayType: string;
   isColumnNullable: boolean;
@@ -10,5 +8,4 @@ export interface DatatableColumn {
   type: string;
   isColumnUnique: boolean;
   isColumnIndexed: boolean;
-
 }
diff --git a/src/app/system/manage-data-tables/edit-data-table/edit-data-table.component.spec.ts b/src/app/system/manage-data-tables/edit-data-table/edit-data-table.component.spec.ts
index a18135ac8..3437e11e7 100644
--- a/src/app/system/manage-data-tables/edit-data-table/edit-data-table.component.spec.ts
+++ b/src/app/system/manage-data-tables/edit-data-table/edit-data-table.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditDataTableComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditDataTableComponent ]
-    })
-    .compileComponents();
+      declarations: [EditDataTableComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-data-tables/edit-data-table/edit-data-table.component.ts b/src/app/system/manage-data-tables/edit-data-table/edit-data-table.component.ts
index 2d11e2a5f..4212a6d15 100644
--- a/src/app/system/manage-data-tables/edit-data-table/edit-data-table.component.ts
+++ b/src/app/system/manage-data-tables/edit-data-table/edit-data-table.component.ts
@@ -28,7 +28,6 @@ import { DatatableColumn } from '../datatable-column.model';
   styleUrls: ['./edit-data-table.component.scss']
 })
 export class EditDataTableComponent implements OnInit {
-
   /** Data Table Form. */
   dataTableForm: UntypedFormGroup;
   /** Data Table Data. */
@@ -43,29 +42,58 @@ export class EditDataTableComponent implements OnInit {
   isFormEdited = false;
   /** Data Table Changes Data. */
   dataTableChangesData: {
-    apptableName: string,
-    entitySubType: string,
-    dropColumns?: { name: string }[],
-    changeColumns: { name: string, newName?: string, code?: string, newCode?: string, mandatory: boolean, length?: number, unique?: boolean, indexed?: boolean  }[],
-    addColumns?: { name?: string, type?: string, code?: string, mandatory?: boolean, length?: number, unique?: boolean, indexed?: boolean }[]
+    apptableName: string;
+    entitySubType: string;
+    dropColumns?: { name: string }[];
+    changeColumns: {
+      name: string;
+      newName?: string;
+      code?: string;
+      newCode?: string;
+      mandatory: boolean;
+      length?: number;
+      unique?: boolean;
+      indexed?: boolean;
+    }[];
+    addColumns?: {
+      name?: string;
+      type?: string;
+      code?: string;
+      mandatory?: boolean;
+      length?: number;
+      unique?: boolean;
+      indexed?: boolean;
+    }[];
   } = {
-    apptableName: '', changeColumns: [], addColumns: [], dropColumns: [],
+    apptableName: '',
+    changeColumns: [],
+    addColumns: [],
+    dropColumns: [],
     entitySubType: ''
   };
   /** Data passed to dialog. */
   dataForDialog: DatatableColumn = {
-      columnName: undefined,
-      columnDisplayType: undefined,
-      isColumnNullable: undefined,
-      columnLength: undefined,
-      columnCode: undefined,
-      columnCodes: undefined,
-      type: undefined,
-      isColumnUnique: undefined,
-      isColumnIndexed: undefined
-    };
+    columnName: undefined,
+    columnDisplayType: undefined,
+    isColumnNullable: undefined,
+    columnLength: undefined,
+    columnCode: undefined,
+    columnCodes: undefined,
+    type: undefined,
+    isColumnUnique: undefined,
+    isColumnIndexed: undefined
+  };
   /** Columns to be displayed in columns table. */
-  displayedColumns: string[] = ['name', 'type', 'length', 'code', 'mandatory', 'unique', 'indexed', 'actions'];
+  displayedColumns: string[] = [
+    'name',
+    'type',
+    'length',
+    'code',
+    'mandatory',
+    'unique',
+    'indexed',
+    'actions'
+  ];
   /** Data source for columns table. */
   dataSource: MatTableDataSource;
   /** Paginator for columns table. */
@@ -81,16 +109,21 @@ export class EditDataTableComponent implements OnInit {
    * @param {FormBuilder} formBuilder Form Builder.
    * @param {MatDialog} dialog Dialog Reference.
    */
-  constructor(private systemService: SystemService,
-              private formBuilder: UntypedFormBuilder,
-              private route: ActivatedRoute,
-              private router: Router,
-              private dialog: MatDialog,
-              private translateService: TranslateService) {
-    this.route.data.subscribe((data: { dataTable: any, columnCodes: any }) => {
+  constructor(
+    private systemService: SystemService,
+    private formBuilder: UntypedFormBuilder,
+    private route: ActivatedRoute,
+    private router: Router,
+    private dialog: MatDialog,
+    private translateService: TranslateService
+  ) {
+    this.route.data.subscribe((data: { dataTable: any; columnCodes: any }) => {
       this.dataTableData = data.dataTable;
       this.dataTableData.columnHeaderData.forEach((item: any) => {
-        item.system = ['created_at', 'updated_at'].includes(item.columnName);
+        item.system = [
+          'created_at',
+          'updated_at'
+        ].includes(item.columnName);
       });
       this.columnData = this.dataTableData.columnHeaderData;
       this.dataForDialog.columnCodes = data.columnCodes;
@@ -105,7 +138,7 @@ export class EditDataTableComponent implements OnInit {
     this.createDataTableForm();
     this.setColumns();
     this.dataTableForm.controls.apptableName.valueChanges.subscribe((value: any) => {
-      this.showEntitySubType = (value === 'm_client');
+      this.showEntitySubType = value === 'm_client';
     });
   }
 
@@ -129,7 +162,7 @@ export class EditDataTableComponent implements OnInit {
       this.columnData[index].columnDisplayType = this.getColumnType(this.columnData[index].columnDisplayType);
       this.columnData[index].type = 'existing';
     }
-    this.showEntitySubType = (this.dataTableData.applicationTableName === 'm_client');
+    this.showEntitySubType = this.dataTableData.applicationTableName === 'm_client';
   }
 
   /**
@@ -137,9 +170,15 @@ export class EditDataTableComponent implements OnInit {
    */
   createDataTableForm() {
     this.dataTableForm = this.formBuilder.group({
-      'datatableName': [{ value: this.dataTableData.registeredTableName, disabled: true }, Validators.required],
-      'apptableName': [{ value: this.dataTableData.applicationTableName, disabled: true }, Validators.required],
-      'entitySubType': [{ value: this.dataTableData.entitySubType, disabled: true }]
+      datatableName: [
+        { value: this.dataTableData.registeredTableName, disabled: true },
+        Validators.required
+      ],
+      apptableName: [
+        { value: this.dataTableData.applicationTableName, disabled: true },
+        Validators.required
+      ],
+      entitySubType: [{ value: this.dataTableData.entitySubType, disabled: true }]
     });
   }
 
@@ -175,11 +214,14 @@ export class EditDataTableComponent implements OnInit {
         };
         let alreadyExist = false;
         this.columnData.forEach((column: DatatableColumn) => {
-          if ((newColumn.columnName === column.columnName) || (newColumn.columnName === column.columnName
-            && newColumn.columnDisplayType === column.columnDisplayType
-            && newColumn.isColumnNullable === column.isColumnNullable)) {
-              alreadyExist = true;
-            }
+          if (
+            newColumn.columnName === column.columnName ||
+            (newColumn.columnName === column.columnName &&
+              newColumn.columnDisplayType === column.columnDisplayType &&
+              newColumn.isColumnNullable === column.isColumnNullable)
+          ) {
+            alreadyExist = true;
+          }
         });
         if (!alreadyExist) {
           this.dataTableChangesData.addColumns.push({
@@ -220,10 +262,14 @@ export class EditDataTableComponent implements OnInit {
       if (response !== '') {
         this.isFormEdited = true;
         if (column.type === 'new') {
-          this.dataTableChangesData.addColumns[this.dataTableChangesData.addColumns
-            .findIndex(newColumn => newColumn.name === column.columnName
-                                    && newColumn.type === column.columnDisplayType
-                                    && newColumn.mandatory === column.isColumnNullable)] = {
+          this.dataTableChangesData.addColumns[
+            this.dataTableChangesData.addColumns.findIndex(
+              (newColumn) =>
+                newColumn.name === column.columnName &&
+                newColumn.type === column.columnDisplayType &&
+                newColumn.mandatory === column.isColumnNullable
+            )
+          ] = {
             name: response.name,
             type: response.type,
             code: response.code,
@@ -252,7 +298,9 @@ export class EditDataTableComponent implements OnInit {
             type: 'existing'
           };
 
-          const index = this.dataTableChangesData.changeColumns.findIndex(newColumn => newColumn.newName === column.columnName);
+          const index = this.dataTableChangesData.changeColumns.findIndex(
+            (newColumn) => newColumn.newName === column.columnName
+          );
           if (index === -1) {
             this.dataTableChangesData.changeColumns.push({
               name: column.columnName,
@@ -284,7 +332,7 @@ export class EditDataTableComponent implements OnInit {
    */
   deleteColumn(column: any) {
     const deleteColumnDialogRef = this.dialog.open(DeleteDialogComponent, {
-      data: { deleteContext:  this.translateService.instant('labels.inputs.Column') + ' ' + column.columnName}
+      data: { deleteContext: this.translateService.instant('labels.inputs.Column') + ' ' + column.columnName }
     });
     deleteColumnDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
@@ -296,10 +344,15 @@ export class EditDataTableComponent implements OnInit {
             name: column.columnName
           });
         } else if (column.type === 'new') {
-          this.dataTableChangesData.addColumns.splice(this.dataTableChangesData.addColumns
-            .findIndex(newColumn => newColumn.name === column.columnName
-                                    && newColumn.type === column.columnDisplayType
-                                    && newColumn.mandatory === column.isColumnNullable), 1);
+          this.dataTableChangesData.addColumns.splice(
+            this.dataTableChangesData.addColumns.findIndex(
+              (newColumn) =>
+                newColumn.name === column.columnName &&
+                newColumn.type === column.columnDisplayType &&
+                newColumn.mandatory === column.isColumnNullable
+            ),
+            1
+          );
         }
       }
     });
@@ -338,10 +391,10 @@ export class EditDataTableComponent implements OnInit {
     if (!this.dataTableChangesData.dropColumns || this.dataTableChangesData.dropColumns.length === 0) {
       this.dataTableChangesData.dropColumns = undefined;
     }
-    this.systemService.updateDataTable(this.dataTableChangesData, this.dataTableData.registeredTableName)
+    this.systemService
+      .updateDataTable(this.dataTableChangesData, this.dataTableData.registeredTableName)
       .subscribe((response: any) => {
         this.router.navigate(['../'], { relativeTo: this.route });
       });
   }
-
 }
diff --git a/src/app/system/manage-data-tables/manage-data-tables.component.spec.ts b/src/app/system/manage-data-tables/manage-data-tables.component.spec.ts
index e959ea52e..b1c8fd7e3 100644
--- a/src/app/system/manage-data-tables/manage-data-tables.component.spec.ts
+++ b/src/app/system/manage-data-tables/manage-data-tables.component.spec.ts
@@ -8,9 +8,8 @@ describe('ManageDataTablesComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ManageDataTablesComponent ]
-    })
-    .compileComponents();
+      declarations: [ManageDataTablesComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-data-tables/manage-data-tables.component.ts b/src/app/system/manage-data-tables/manage-data-tables.component.ts
index 369ddcfb6..6b662c4e8 100644
--- a/src/app/system/manage-data-tables/manage-data-tables.component.ts
+++ b/src/app/system/manage-data-tables/manage-data-tables.component.ts
@@ -21,11 +21,14 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura
   styleUrls: ['./manage-data-tables.component.scss']
 })
 export class ManageDataTablesComponent implements OnInit, AfterViewInit {
-
   /** Data table data. */
   dataTableData: any;
   /** Columns to be displayed in manage data tables table. */
-  displayedColumns: string[] = ['registeredTableName', 'applicationTableName', 'entitySubType'];
+  displayedColumns: string[] = [
+    'registeredTableName',
+    'applicationTableName',
+    'entitySubType'
+  ];
   /** Data source for manage data tables table. */
   dataSource: MatTableDataSource;
 
@@ -50,11 +53,13 @@ export class ManageDataTablesComponent implements OnInit, AfterViewInit {
    * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
    * @param {PopoverService} popoverService PopoverService.
    */
-  constructor(private route: ActivatedRoute,
-              private router: Router,
-              private configurationWizardService: ConfigurationWizardService,
-              private popoverService: PopoverService) {
-    this.route.data.subscribe(( data: { dataTables: any }) => {
+  constructor(
+    private route: ActivatedRoute,
+    private router: Router,
+    private configurationWizardService: ConfigurationWizardService,
+    private popoverService: PopoverService
+  ) {
+    this.route.data.subscribe((data: { dataTables: any }) => {
       this.dataTableData = data.dataTables;
     });
   }
@@ -90,7 +95,12 @@ export class ManageDataTablesComponent implements OnInit, AfterViewInit {
    * @param position String.
    * @param backdrop Boolean.
    */
-  showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+  showPopover(
+    template: TemplateRef,
+    target: HTMLElement | ElementRef,
+    position: string,
+    backdrop: boolean
+  ): void {
     setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
   }
 
@@ -100,12 +110,12 @@ export class ManageDataTablesComponent implements OnInit, AfterViewInit {
   ngAfterViewInit() {
     if (this.configurationWizardService.showDatatablesPage === true) {
       setTimeout(() => {
-          this.showPopover(this.templateCreateDatatableRef, this.createDatatableRef.nativeElement, 'bottom', true);
+        this.showPopover(this.templateCreateDatatableRef, this.createDatatableRef.nativeElement, 'bottom', true);
       });
     }
     if (this.configurationWizardService.showDatatablesList === true) {
       setTimeout(() => {
-          this.showPopover(this.templateDatatablesList, this.datatablesList.nativeElement, 'top', true);
+        this.showPopover(this.templateDatatablesList, this.datatablesList.nativeElement, 'top', true);
       });
     }
   }
diff --git a/src/app/system/manage-data-tables/manage-data-tables.resolver.ts b/src/app/system/manage-data-tables/manage-data-tables.resolver.ts
index 67813fd4e..a8e9c0ebf 100644
--- a/src/app/system/manage-data-tables/manage-data-tables.resolver.ts
+++ b/src/app/system/manage-data-tables/manage-data-tables.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class ManageDataTablesResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class ManageDataTablesResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getDataTables();
   }
-
 }
diff --git a/src/app/system/manage-data-tables/view-data-table/view-data-table.component.spec.ts b/src/app/system/manage-data-tables/view-data-table/view-data-table.component.spec.ts
index 753384604..d8b3d31de 100644
--- a/src/app/system/manage-data-tables/view-data-table/view-data-table.component.spec.ts
+++ b/src/app/system/manage-data-tables/view-data-table/view-data-table.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewDataTableComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewDataTableComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewDataTableComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-data-tables/view-data-table/view-data-table.component.ts b/src/app/system/manage-data-tables/view-data-table/view-data-table.component.ts
index 2144d9f75..5de4c6d3c 100644
--- a/src/app/system/manage-data-tables/view-data-table/view-data-table.component.ts
+++ b/src/app/system/manage-data-tables/view-data-table/view-data-table.component.ts
@@ -22,13 +22,20 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co
   styleUrls: ['./view-data-table.component.scss']
 })
 export class ViewDataTableComponent implements OnInit {
-
   /** Data Table Data */
   dataTableData: any;
   /** Column Data */
   columnsData: any;
   /** Columns to be displayed in columns table. */
-  displayedColumns: string[] = ['columnName', 'columnDisplayType', 'columnLength', 'columnCode', 'isColumnNullable', 'isColumnUnique', 'isColumnIndexed'];
+  displayedColumns: string[] = [
+    'columnName',
+    'columnDisplayType',
+    'columnLength',
+    'columnCode',
+    'isColumnNullable',
+    'isColumnUnique',
+    'isColumnIndexed'
+  ];
   /** Data source for columns table. */
   dataSource: MatTableDataSource;
 
@@ -45,11 +52,13 @@ export class ViewDataTableComponent implements OnInit {
    * @param {MatDialog} dialog Dialog reference.
    *  @param {TranslateService} translateService Translate Service.
    */
-  constructor(private route: ActivatedRoute,
-              private systemService: SystemService,
-              private router: Router,
-              private dialog: MatDialog,
-              private translateService: TranslateService) {
+  constructor(
+    private route: ActivatedRoute,
+    private systemService: SystemService,
+    private router: Router,
+    private dialog: MatDialog,
+    private translateService: TranslateService
+  ) {
     this.route.data.subscribe((data: { dataTable: any }) => {
       this.dataTableData = data.dataTable;
       this.columnsData = this.dataTableData.columnHeaderData;
@@ -79,16 +88,17 @@ export class ViewDataTableComponent implements OnInit {
    */
   delete() {
     const deleteDataTableDialogRef = this.dialog.open(DeleteDialogComponent, {
-      data: { deleteContext:  this.translateService.instant('labels.inputs.Data Table') + ' ' + this.dataTableData.registeredTableName}
+      data: {
+        deleteContext:
+          this.translateService.instant('labels.inputs.Data Table') + ' ' + this.dataTableData.registeredTableName
+      }
     });
     deleteDataTableDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
-        this.systemService.deleteDataTable(this.dataTableData.registeredTableName)
-          .subscribe(() => {
-            this.router.navigate(['/system/data-tables'], { relativeTo: this.route });
-          });
+        this.systemService.deleteDataTable(this.dataTableData.registeredTableName).subscribe(() => {
+          this.router.navigate(['/system/data-tables'], { relativeTo: this.route });
+        });
       }
     });
-
   }
 }
diff --git a/src/app/system/manage-external-events/manage-external-events.component.spec.ts b/src/app/system/manage-external-events/manage-external-events.component.spec.ts
index 1d0be4cf5..e6ba616c7 100644
--- a/src/app/system/manage-external-events/manage-external-events.component.spec.ts
+++ b/src/app/system/manage-external-events/manage-external-events.component.spec.ts
@@ -8,9 +8,8 @@ describe('ManageExternalEventsComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ ManageExternalEventsComponent ]
-    })
-    .compileComponents();
+      declarations: [ManageExternalEventsComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/system/manage-external-events/manage-external-events.component.ts b/src/app/system/manage-external-events/manage-external-events.component.ts
index afc8bdd43..467b1b91e 100644
--- a/src/app/system/manage-external-events/manage-external-events.component.ts
+++ b/src/app/system/manage-external-events/manage-external-events.component.ts
@@ -11,7 +11,6 @@ import { SystemService } from '../system.service';
   styleUrls: ['./manage-external-events.component.scss']
 })
 export class ManageExternalEventsComponent implements OnInit {
-
   /** Events Data. */
   eventsData: any;
   externalEventConfigurations: any = {};
@@ -19,17 +18,22 @@ export class ManageExternalEventsComponent implements OnInit {
   existAnyUpdate = false;
 
   /** Columns to be displayed in events table. */
-  displayedColumns: string[] = ['eventType', 'status'];
+  displayedColumns: string[] = [
+    'eventType',
+    'status'
+  ];
   /** Data source for reports table. */
   dataSource: MatTableDataSource;
 
-   /** Paginator for reports table. */
-   @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
-   /** Sorter for reports table. */
-   @ViewChild(MatSort, { static: true }) sort: MatSort;
+  /** Paginator for reports table. */
+  @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
+  /** Sorter for reports table. */
+  @ViewChild(MatSort, { static: true }) sort: MatSort;
 
-  constructor(private route: ActivatedRoute,
-    private systemService: SystemService) {
+  constructor(
+    private route: ActivatedRoute,
+    private systemService: SystemService
+  ) {
     this.route.data.subscribe((data: { events: any }) => {
       this.eventsData = data.events.externalEventConfiguration;
     });
diff --git a/src/app/system/manage-external-events/manage-external-events.resolver.ts b/src/app/system/manage-external-events/manage-external-events.resolver.ts
index 89add373d..23c1d0d5d 100644
--- a/src/app/system/manage-external-events/manage-external-events.resolver.ts
+++ b/src/app/system/manage-external-events/manage-external-events.resolver.ts
@@ -1,9 +1,5 @@
 import { Injectable } from '@angular/core';
-import {
-  Router, Resolve,
-  RouterStateSnapshot,
-  ActivatedRouteSnapshot
-} from '@angular/router';
+import { Router, Resolve, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router';
 import { Observable, of } from 'rxjs';
 import { SystemService } from '../system.service';
 
@@ -11,17 +7,16 @@ import { SystemService } from '../system.service';
   providedIn: 'root'
 })
 export class ManageExternalEventsResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
-   constructor(private systemService: SystemService) {}
+  constructor(private systemService: SystemService) {}
 
-   /**
-    * Returns the Configuration data.
-    * @returns {Observable}
-    */
-   resolve(route: ActivatedRouteSnapshot): Observable {
-     return this.systemService.getExternalEventConfiguration();
-   }
+  /**
+   * Returns the Configuration data.
+   * @returns {Observable}
+   */
+  resolve(route: ActivatedRouteSnapshot): Observable {
+    return this.systemService.getExternalEventConfiguration();
+  }
 }
diff --git a/src/app/system/manage-hooks/add-event-dialog/add-event-dialog.component.spec.ts b/src/app/system/manage-hooks/add-event-dialog/add-event-dialog.component.spec.ts
index 9744d9c91..1938ee0e6 100644
--- a/src/app/system/manage-hooks/add-event-dialog/add-event-dialog.component.spec.ts
+++ b/src/app/system/manage-hooks/add-event-dialog/add-event-dialog.component.spec.ts
@@ -8,9 +8,8 @@ describe('AddEventDialogComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ AddEventDialogComponent ]
-    })
-    .compileComponents();
+      declarations: [AddEventDialogComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-hooks/add-event-dialog/add-event-dialog.component.ts b/src/app/system/manage-hooks/add-event-dialog/add-event-dialog.component.ts
index 732daa499..37663b459 100644
--- a/src/app/system/manage-hooks/add-event-dialog/add-event-dialog.component.ts
+++ b/src/app/system/manage-hooks/add-event-dialog/add-event-dialog.component.ts
@@ -12,7 +12,6 @@ import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms
   styleUrls: ['./add-event-dialog.component.scss']
 })
 export class AddEventDialogComponent implements OnInit {
-
   /** Event Form. */
   eventForm: UntypedFormGroup;
   /** Entity Data. */
@@ -25,19 +24,29 @@ export class AddEventDialogComponent implements OnInit {
    * @param {FormBuilder} formBuilder Form Builder.
    * @param {any} data Provides grouping, entities and actions data to fill dropdowns.
    */
-  constructor(public dialogRef: MatDialogRef,
+  constructor(
+    public dialogRef: MatDialogRef,
     public formBuilder: UntypedFormBuilder,
-    @Inject(MAT_DIALOG_DATA) public data: any) {
-  }
+    @Inject(MAT_DIALOG_DATA) public data: any
+  ) {}
 
   /**
    * Creates add event form.
    */
   ngOnInit() {
     this.eventForm = this.formBuilder.group({
-      'grouping': ['', Validators.required],
-      'entity': ['', Validators.required],
-      'action': ['', Validators.required]
+      grouping: [
+        '',
+        Validators.required
+      ],
+      entity: [
+        '',
+        Validators.required
+      ],
+      action: [
+        '',
+        Validators.required
+      ]
     });
     this.setGroupingListener();
     this.setEntityListener();
@@ -47,20 +56,18 @@ export class AddEventDialogComponent implements OnInit {
    * Subscribes to the grouping dropdown to set entity data for that row accordingly.
    */
   setGroupingListener() {
-    this.eventForm.get('grouping').valueChanges
-      .subscribe(changedGrouping => {
-        this.entityData = this.data.groupings.find((grouping: any) => grouping.name === changedGrouping).entities;
-      });
+    this.eventForm.get('grouping').valueChanges.subscribe((changedGrouping) => {
+      this.entityData = this.data.groupings.find((grouping: any) => grouping.name === changedGrouping).entities;
+    });
   }
 
   /**
    * Subscribes to the entity dropdown to set entity data for that row accordingly.
    */
   setEntityListener() {
-    this.eventForm.get('entity').valueChanges
-      .subscribe(changedEntity => {
-        this.actionData = this.entityData.find((entity: any) => entity.name === changedEntity).actions;
-      });
+    this.eventForm.get('entity').valueChanges.subscribe((changedEntity) => {
+      this.actionData = this.entityData.find((entity: any) => entity.name === changedEntity).actions;
+    });
   }
 
   /**
@@ -69,5 +76,4 @@ export class AddEventDialogComponent implements OnInit {
   submit() {
     this.dialogRef.close(this.eventForm.value);
   }
-
 }
diff --git a/src/app/system/manage-hooks/create-hook/create-hook.component.spec.ts b/src/app/system/manage-hooks/create-hook/create-hook.component.spec.ts
index 272ae47db..159154d72 100644
--- a/src/app/system/manage-hooks/create-hook/create-hook.component.spec.ts
+++ b/src/app/system/manage-hooks/create-hook/create-hook.component.spec.ts
@@ -8,9 +8,8 @@ describe('CreateHookComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CreateHookComponent ]
-    })
-    .compileComponents();
+      declarations: [CreateHookComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-hooks/create-hook/create-hook.component.ts b/src/app/system/manage-hooks/create-hook/create-hook.component.ts
index 8624cdeb9..46bdf2a62 100644
--- a/src/app/system/manage-hooks/create-hook/create-hook.component.ts
+++ b/src/app/system/manage-hooks/create-hook/create-hook.component.ts
@@ -23,13 +23,16 @@ import { AddEventDialogComponent } from '../add-event-dialog/add-event-dialog.co
   styleUrls: ['./create-hook.component.scss']
 })
 export class CreateHookComponent implements OnInit {
-
   /** Hooks Template Data. */
   hooksTemplateData: any;
   /** Hook Form. */
   hookForm: UntypedFormGroup;
   /** Columns to be displayed in events table. */
-  displayedColumns: string[] = ['entityName', 'actionName', 'actions'];
+  displayedColumns: string[] = [
+    'entityName',
+    'actionName',
+    'actions'
+  ];
   /** Data source for events table. */
   dataSource: MatTableDataSource;
   /** Events Data. */
@@ -46,12 +49,14 @@ export class CreateHookComponent implements OnInit {
    * @param {MatDialog} dialog Dialog Reference.
    * @param {TranslateService} translateService Translate Service.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private systemService: SystemService,
     private router: Router,
     private formBuilder: UntypedFormBuilder,
     private dialog: MatDialog,
-    private translateService: TranslateService) {
+    private translateService: TranslateService
+  ) {
     this.route.data.subscribe((data: { hooksTemplate: any }) => {
       this.hooksTemplateData = data.hooksTemplate;
     });
@@ -62,7 +67,7 @@ export class CreateHookComponent implements OnInit {
    */
   ngOnInit() {
     this.createHookForm();
-    this.hookForm.get('name').valueChanges.subscribe(name => {
+    this.hookForm.get('name').valueChanges.subscribe((name) => {
       if (name === 'Web') {
         this.hookForm.get('contentType').enable();
         this.hookForm.get('phoneNumber').disable();
@@ -93,15 +98,39 @@ export class CreateHookComponent implements OnInit {
    */
   createHookForm() {
     this.hookForm = this.formBuilder.group({
-      'name': ['Web', Validators.required],
-      'displayName': ['', Validators.required],
-      'isActive': [''],
-      'phoneNumber': [{ value: '', disabled: true }, Validators.required],
-      'smsProvider': [{ value: '', disabled: true }, Validators.required],
-      'smsProviderAccountId': [{ value: '', disabled: true }, Validators.required],
-      'smsProviderToken': [{ value: '', disabled: true }, Validators.required],
-      'contentType': ['', Validators.required],
-      'payloadUrl': ['', Validators.required]
+      name: [
+        'Web',
+        Validators.required
+      ],
+      displayName: [
+        '',
+        Validators.required
+      ],
+      isActive: [''],
+      phoneNumber: [
+        { value: '', disabled: true },
+        Validators.required
+      ],
+      smsProvider: [
+        { value: '', disabled: true },
+        Validators.required
+      ],
+      smsProviderAccountId: [
+        { value: '', disabled: true },
+        Validators.required
+      ],
+      smsProviderToken: [
+        { value: '', disabled: true },
+        Validators.required
+      ],
+      contentType: [
+        '',
+        Validators.required
+      ],
+      payloadUrl: [
+        '',
+        Validators.required
+      ]
     });
   }
 
@@ -131,7 +160,12 @@ export class CreateHookComponent implements OnInit {
    */
   deleteEvent(index: number) {
     const deleteEventDialogRef = this.dialog.open(DeleteDialogComponent, {
-      data: { deleteContext: this.translateService.instant('labels.inputs.event with entity name of') + ' ' + this.eventsData[index].entityName }
+      data: {
+        deleteContext:
+          this.translateService.instant('labels.inputs.event with entity name of') +
+          ' ' +
+          this.eventsData[index].entityName
+      }
     });
     deleteEventDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
@@ -147,11 +181,17 @@ export class CreateHookComponent implements OnInit {
    */
   submit() {
     const hook: {
-      name: string, isActive: boolean, displayName: string, events: any,
+      name: string;
+      isActive: boolean;
+      displayName: string;
+      events: any;
       config: {
-        'Payload URL': string, 'Content Type'?: string, 'SMS Provider'?: string,
-        'SMS Provider Account Id'?: string, 'SMS Provider Token'?: string
-      }
+        'Payload URL': string;
+        'Content Type'?: string;
+        'SMS Provider'?: string;
+        'SMS Provider Account Id'?: string;
+        'SMS Provider Token'?: string;
+      };
     } = {
       name: this.hookForm.get('name').value,
       isActive: this.hookForm.get('isActive').value,
@@ -161,13 +201,22 @@ export class CreateHookComponent implements OnInit {
         'Payload URL': this.hookForm.get('payloadUrl').value,
         'Content Type': this.hookForm.get('contentType').enabled ? this.hookForm.get('contentType').value : undefined,
         'SMS Provider': this.hookForm.get('smsProvider').enabled ? this.hookForm.get('smsProvider').value : undefined,
-        'SMS Provider Account Id': this.hookForm.get('smsProviderAccountId').enabled ? this.hookForm.get('smsProviderAccountId').value : undefined,
-        'SMS Provider Token': this.hookForm.get('smsProviderToken').enabled ? this.hookForm.get('smsProviderToken').value : undefined
+        'SMS Provider Account Id': this.hookForm.get('smsProviderAccountId').enabled
+          ? this.hookForm.get('smsProviderAccountId').value
+          : undefined,
+        'SMS Provider Token': this.hookForm.get('smsProviderToken').enabled
+          ? this.hookForm.get('smsProviderToken').value
+          : undefined
       }
     };
-    this.systemService.createHook(hook)
-      .subscribe((response: any) => {
-        this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
-      });
+    this.systemService.createHook(hook).subscribe((response: any) => {
+      this.router.navigate(
+        [
+          '../',
+          response.resourceId
+        ],
+        { relativeTo: this.route }
+      );
+    });
   }
 }
diff --git a/src/app/system/manage-hooks/edit-hook/edit-hook.component.spec.ts b/src/app/system/manage-hooks/edit-hook/edit-hook.component.spec.ts
index 2b0405eb0..a75dfd339 100644
--- a/src/app/system/manage-hooks/edit-hook/edit-hook.component.spec.ts
+++ b/src/app/system/manage-hooks/edit-hook/edit-hook.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditHookComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditHookComponent ]
-    })
-    .compileComponents();
+      declarations: [EditHookComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-hooks/edit-hook/edit-hook.component.ts b/src/app/system/manage-hooks/edit-hook/edit-hook.component.ts
index 9b1497fe9..d986bc7aa 100644
--- a/src/app/system/manage-hooks/edit-hook/edit-hook.component.ts
+++ b/src/app/system/manage-hooks/edit-hook/edit-hook.component.ts
@@ -23,7 +23,6 @@ import { AddEventDialogComponent } from '../add-event-dialog/add-event-dialog.co
   styleUrls: ['./edit-hook.component.scss']
 })
 export class EditHookComponent implements OnInit {
-
   /** Hooks Template Data. */
   hooksTemplateData: any;
   /** Hook Data. */
@@ -31,7 +30,11 @@ export class EditHookComponent implements OnInit {
   /** Hook Form. */
   hookForm: UntypedFormGroup;
   /** Columns to be displayed in events table. */
-  displayedColumns: string[] = ['entityName', 'actionName', 'actions'];
+  displayedColumns: string[] = [
+    'entityName',
+    'actionName',
+    'actions'
+  ];
   /** Data source for events table. */
   dataSource: MatTableDataSource;
   /** Events Data. */
@@ -50,13 +53,15 @@ export class EditHookComponent implements OnInit {
    * @param {MatDialog} dialog Dialog Reference.
    * @param {TranslateService} translateService Translate Service.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private systemService: SystemService,
     private router: Router,
     private formBuilder: UntypedFormBuilder,
     private dialog: MatDialog,
-    private translateService: TranslateService) {
-    this.route.data.subscribe((data: { hooksTemplate: any, hook: any }) => {
+    private translateService: TranslateService
+  ) {
+    this.route.data.subscribe((data: { hooksTemplate: any; hook: any }) => {
       this.hooksTemplateData = data.hooksTemplate;
       this.hookData = data.hook;
       this.eventsData = data.hook.events ? data.hook.events : [];
@@ -84,15 +89,59 @@ export class EditHookComponent implements OnInit {
    */
   createHookForm() {
     this.hookForm = this.formBuilder.group({
-      'name': [{ value: this.hookData.name, disabled: true }, Validators.required],
-      'displayName': [this.hookData.displayName, Validators.required],
-      'isActive': [this.hookData.isActive],
-      'phoneNumber': [{ value: this.hookData.name === 'SMS Bridge' ? this.hookData.config[1].fieldValue : '', disabled: this.hookData.name !== 'SMS Bridge' }, Validators.required],
-      'smsProvider': [{ value: this.hookData.name === 'SMS Bridge' ? this.hookData.config[2].fieldValue : '', disabled: this.hookData.name !== 'SMS Bridge' }, Validators.required],
-      'smsProviderAccountId': [{ value: this.hookData.name === 'SMS Bridge' ? this.hookData.config[3].fieldValue : '', disabled: this.hookData.name !== 'SMS Bridge' }, Validators.required],
-      'smsProviderToken': [{ value: this.hookData.name === 'SMS Bridge' ? this.hookData.config[4].fieldValue : '', disabled: this.hookData.name !== 'SMS Bridge' }, Validators.required],
-      'contentType': [{ value: this.hookData.name === 'Web' ? this.hookData.config[0].fieldValue : '', disabled: this.hookData.name !== 'Web' }, Validators.required],
-      'payloadUrl': [this.hookData.name === 'Web' ? this.hookData.config[1].fieldValue : this.hookData.config[0].fieldValue, Validators.required]
+      name: [
+        { value: this.hookData.name, disabled: true },
+        Validators.required
+      ],
+      displayName: [
+        this.hookData.displayName,
+        Validators.required
+      ],
+      isActive: [this.hookData.isActive],
+      phoneNumber: [
+        {
+          value: this.hookData.name === 'SMS Bridge' ? this.hookData.config[1].fieldValue : '',
+          disabled: this.hookData.name !== 'SMS Bridge'
+        },
+        Validators.required
+
+      ],
+      smsProvider: [
+        {
+          value: this.hookData.name === 'SMS Bridge' ? this.hookData.config[2].fieldValue : '',
+          disabled: this.hookData.name !== 'SMS Bridge'
+        },
+        Validators.required
+
+      ],
+      smsProviderAccountId: [
+        {
+          value: this.hookData.name === 'SMS Bridge' ? this.hookData.config[3].fieldValue : '',
+          disabled: this.hookData.name !== 'SMS Bridge'
+        },
+        Validators.required
+
+      ],
+      smsProviderToken: [
+        {
+          value: this.hookData.name === 'SMS Bridge' ? this.hookData.config[4].fieldValue : '',
+          disabled: this.hookData.name !== 'SMS Bridge'
+        },
+        Validators.required
+
+      ],
+      contentType: [
+        {
+          value: this.hookData.name === 'Web' ? this.hookData.config[0].fieldValue : '',
+          disabled: this.hookData.name !== 'Web'
+        },
+        Validators.required
+
+      ],
+      payloadUrl: [
+        this.hookData.name === 'Web' ? this.hookData.config[1].fieldValue : this.hookData.config[0].fieldValue,
+        Validators.required
+      ]
     });
   }
 
@@ -121,7 +170,12 @@ export class EditHookComponent implements OnInit {
    */
   deleteEvent(index: number) {
     const deleteEventDialogRef = this.dialog.open(DeleteDialogComponent, {
-      data: { deleteContext: this.translateService.instant('labels.inputs.event with entity name of') + ' ' + this.eventsData[index].entityName }
+      data: {
+        deleteContext:
+          this.translateService.instant('labels.inputs.event with entity name of') +
+          ' ' +
+          this.eventsData[index].entityName
+      }
     });
     deleteEventDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
@@ -138,11 +192,17 @@ export class EditHookComponent implements OnInit {
    */
   submit() {
     const hook: {
-      name: string, isActive: boolean, displayName: string, events: any,
+      name: string;
+      isActive: boolean;
+      displayName: string;
+      events: any;
       config: {
-        'Payload URL': string, 'Content Type'?: string, 'SMS Provider'?: string,
-        'SMS Provider Account Id'?: string, 'SMS Provider Token'?: string
-      }
+        'Payload URL': string;
+        'Content Type'?: string;
+        'SMS Provider'?: string;
+        'SMS Provider Account Id'?: string;
+        'SMS Provider Token'?: string;
+      };
     } = {
       name: this.hookForm.get('name').value,
       isActive: this.hookForm.get('isActive').value,
@@ -152,14 +212,16 @@ export class EditHookComponent implements OnInit {
         'Payload URL': this.hookForm.get('payloadUrl').value,
         'Content Type': this.hookForm.get('contentType').enabled ? this.hookForm.get('contentType').value : undefined,
         'SMS Provider': this.hookForm.get('smsProvider').enabled ? this.hookForm.get('smsProvider').value : undefined,
-        'SMS Provider Account Id': this.hookForm.get('smsProviderAccountId').enabled ? this.hookForm.get('smsProviderAccountId').value : undefined,
-        'SMS Provider Token': this.hookForm.get('smsProviderToken').enabled ? this.hookForm.get('smsProviderToken').value : undefined
+        'SMS Provider Account Id': this.hookForm.get('smsProviderAccountId').enabled
+          ? this.hookForm.get('smsProviderAccountId').value
+          : undefined,
+        'SMS Provider Token': this.hookForm.get('smsProviderToken').enabled
+          ? this.hookForm.get('smsProviderToken').value
+          : undefined
       }
     };
-    this.systemService.updateHook(this.hookData.id, hook)
-      .subscribe((response: any) => {
-        this.router.navigate(['../'], { relativeTo: this.route });
-      });
+    this.systemService.updateHook(this.hookData.id, hook).subscribe((response: any) => {
+      this.router.navigate(['../'], { relativeTo: this.route });
+    });
   }
-
 }
diff --git a/src/app/system/manage-hooks/hooks-template.resolver.ts b/src/app/system/manage-hooks/hooks-template.resolver.ts
index 4918520c2..4f1095637 100644
--- a/src/app/system/manage-hooks/hooks-template.resolver.ts
+++ b/src/app/system/manage-hooks/hooks-template.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class HooksTemplateResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class HooksTemplateResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getHooksTemplate();
   }
-
 }
diff --git a/src/app/system/manage-hooks/manage-hooks.component.spec.ts b/src/app/system/manage-hooks/manage-hooks.component.spec.ts
index 4869896c2..513b60175 100644
--- a/src/app/system/manage-hooks/manage-hooks.component.spec.ts
+++ b/src/app/system/manage-hooks/manage-hooks.component.spec.ts
@@ -8,9 +8,8 @@ describe('ManageHooksComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ManageHooksComponent ]
-    })
-    .compileComponents();
+      declarations: [ManageHooksComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-hooks/manage-hooks.component.ts b/src/app/system/manage-hooks/manage-hooks.component.ts
index 244bc7454..16d9d7d93 100644
--- a/src/app/system/manage-hooks/manage-hooks.component.ts
+++ b/src/app/system/manage-hooks/manage-hooks.component.ts
@@ -14,11 +14,14 @@ import { ActivatedRoute } from '@angular/router';
   styleUrls: ['./manage-hooks.component.scss']
 })
 export class ManageHooksComponent implements OnInit {
-
   /** Hook data. */
   hookData: any;
   /** Columns to be displayed in manage hooks table. */
-  displayedColumns: string[] = ['name', 'displayName', 'isActive'];
+  displayedColumns: string[] = [
+    'name',
+    'displayName',
+    'isActive'
+  ];
   /** Data source for manage hooks table. */
   dataSource: MatTableDataSource;
 
@@ -32,7 +35,7 @@ export class ManageHooksComponent implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    */
   constructor(private route: ActivatedRoute) {
-    this.route.data.subscribe(( data: { hooks: any }) => {
+    this.route.data.subscribe((data: { hooks: any }) => {
       this.hookData = data.hooks;
     });
   }
@@ -60,5 +63,4 @@ export class ManageHooksComponent implements OnInit {
     this.dataSource.paginator = this.paginator;
     this.dataSource.sort = this.sort;
   }
-
 }
diff --git a/src/app/system/manage-hooks/manage-hooks.resolver.ts b/src/app/system/manage-hooks/manage-hooks.resolver.ts
index 34620043c..a33c4baa8 100644
--- a/src/app/system/manage-hooks/manage-hooks.resolver.ts
+++ b/src/app/system/manage-hooks/manage-hooks.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class ManageHooksResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class ManageHooksResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getHooks();
   }
-
 }
diff --git a/src/app/system/manage-hooks/view-hook/hook.resolver.ts b/src/app/system/manage-hooks/view-hook/hook.resolver.ts
index 4d0d745ea..fa5227b5a 100644
--- a/src/app/system/manage-hooks/view-hook/hook.resolver.ts
+++ b/src/app/system/manage-hooks/view-hook/hook.resolver.ts
@@ -1,6 +1,6 @@
 /** Angular Imports */
 import { Injectable } from '@angular/core';
-import {ActivatedRouteSnapshot, Resolve} from '@angular/router';
+import { ActivatedRouteSnapshot, Resolve } from '@angular/router';
 
 /** rxjs Imports */
 import { Observable } from 'rxjs';
@@ -13,7 +13,6 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class HookResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -27,5 +26,4 @@ export class HookResolver implements Resolve {
     const hookId = route.paramMap.get('id');
     return this.systemService.getHook(hookId);
   }
-
 }
diff --git a/src/app/system/manage-hooks/view-hook/view-hook.component.spec.ts b/src/app/system/manage-hooks/view-hook/view-hook.component.spec.ts
index 7a37870a7..816f76f9c 100644
--- a/src/app/system/manage-hooks/view-hook/view-hook.component.spec.ts
+++ b/src/app/system/manage-hooks/view-hook/view-hook.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewHookComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewHookComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewHookComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-hooks/view-hook/view-hook.component.ts b/src/app/system/manage-hooks/view-hook/view-hook.component.ts
index b8e3e4b7f..252bef005 100644
--- a/src/app/system/manage-hooks/view-hook/view-hook.component.ts
+++ b/src/app/system/manage-hooks/view-hook/view-hook.component.ts
@@ -19,7 +19,6 @@ import { SystemService } from '../../system.service';
   styleUrls: ['./view-hook.component.scss']
 })
 export class ViewHookComponent {
-
   /** Hook Data. */
   hookData: any;
 
@@ -31,11 +30,13 @@ export class ViewHookComponent {
    * @param {Router} router Router for navigation.
    * @param {TranslateService} translateService Translate Service.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private dialog: MatDialog,
     private systemService: SystemService,
     private router: Router,
-    private translateService: TranslateService) {
+    private translateService: TranslateService
+  ) {
     this.route.data.subscribe((data: { hook: any }) => {
       this.hookData = data.hook;
     });
@@ -50,12 +51,10 @@ export class ViewHookComponent {
     });
     deleteHookDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
-        this.systemService.deleteHook(this.hookData.id)
-          .subscribe(() => {
-            this.router.navigate(['/system/hooks']);
-          });
+        this.systemService.deleteHook(this.hookData.id).subscribe(() => {
+          this.router.navigate(['/system/hooks']);
+        });
       }
     });
   }
-
 }
diff --git a/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.spec.ts b/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.spec.ts
index 1a285d514..f61834e03 100644
--- a/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.spec.ts
+++ b/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.spec.ts
@@ -8,9 +8,8 @@ describe('CobWorkflowComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ CobWorkflowComponent ]
-    })
-    .compileComponents();
+      declarations: [CobWorkflowComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.ts b/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.ts
index 4db5031e9..639aaa0a4 100644
--- a/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.ts
+++ b/src/app/system/manage-jobs/cob-workflow/cob-workflow.component.ts
@@ -15,7 +15,7 @@ export class CobWorkflowComponent implements OnInit, OnDestroy {
   /** Timer to refetch COB Catch-Up status every 5 seconds */
   timer: any;
 
-  constructor(private systemService: SystemService) { }
+  constructor(private systemService: SystemService) {}
 
   ngOnInit(): void {
     this.getCOBCatchUpStatus();
@@ -29,7 +29,9 @@ export class CobWorkflowComponent implements OnInit, OnDestroy {
     this.systemService.getCOBCatchUpStatus().subscribe((response: any) => {
       this.isCatchUpRunning = response.isCatchUpRunning;
     });
-    this.timer = setTimeout(() => { this.getCOBCatchUpStatus(); }, this.waitTime * 1000);
+    this.timer = setTimeout(() => {
+      this.getCOBCatchUpStatus();
+    }, this.waitTime * 1000);
   }
 
   runCatchUp(): void {
@@ -38,5 +40,4 @@ export class CobWorkflowComponent implements OnInit, OnDestroy {
       this.waitTime = 5000;
     });
   }
-
 }
diff --git a/src/app/system/manage-jobs/cob-workflow/loan-locked/loan-locked.component.spec.ts b/src/app/system/manage-jobs/cob-workflow/loan-locked/loan-locked.component.spec.ts
index 205e57217..6e947188f 100644
--- a/src/app/system/manage-jobs/cob-workflow/loan-locked/loan-locked.component.spec.ts
+++ b/src/app/system/manage-jobs/cob-workflow/loan-locked/loan-locked.component.spec.ts
@@ -8,9 +8,8 @@ describe('LoanLockedComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ LoanLockedComponent ]
-    })
-    .compileComponents();
+      declarations: [LoanLockedComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/system/manage-jobs/cob-workflow/loan-locked/loan-locked.component.ts b/src/app/system/manage-jobs/cob-workflow/loan-locked/loan-locked.component.ts
index e91dac4fc..c05f10ad1 100644
--- a/src/app/system/manage-jobs/cob-workflow/loan-locked/loan-locked.component.ts
+++ b/src/app/system/manage-jobs/cob-workflow/loan-locked/loan-locked.component.ts
@@ -16,7 +16,6 @@ import { TasksService } from 'app/tasks/tasks.service';
   styleUrls: ['./loan-locked.component.scss']
 })
 export class LoanLockedComponent implements OnInit {
-
   /** Loans Data */
   loans: any[] = [];
   /** Batch Requests */
@@ -26,10 +25,17 @@ export class LoanLockedComponent implements OnInit {
   /** Row Selection */
   selection: SelectionModel;
   /** Displayed Columns for loan disbursal data */
-  displayedColumns: string[] = ['select', 'loanId', 'lockPlacedOn', 'lockOwner', 'error', 'details'];
+  displayedColumns: string[] = [
+    'select',
+    'loanId',
+    'lockPlacedOn',
+    'lockOwner',
+    'error',
+    'details'
+  ];
 
   /** Paginator for the table */
-  @ViewChild(MatPaginator, {static: false})
+  @ViewChild(MatPaginator, { static: false })
   set paginator(value: MatPaginator) {
     if (this.dataSource != null) {
       this.dataSource.paginator = value;
@@ -52,14 +58,15 @@ export class LoanLockedComponent implements OnInit {
    * @param {MatDialog} dialog Dialog reference.
    * @param {TranslateService} translateService Translate Service.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private router: Router,
     private loansService: LoansService,
     private systemService: SystemService,
     private tasksService: TasksService,
     private dialog: MatDialog,
-    private translateService: TranslateService) {
-  }
+    private translateService: TranslateService
+  ) {}
 
   ngOnInit(): void {
     this.allowRunInlineJob = false;
@@ -82,7 +89,7 @@ export class LoanLockedComponent implements OnInit {
       this.loans = data.content;
       this.dataSource = new MatTableDataSource(this.loans);
       this.dataSource.paginator = this.paginator;
-      this.showPaginator = (this.loans.length > this.pageSize);
+      this.showPaginator = this.loans.length > this.pageSize;
       this.allowRunInlineJob = false;
       this.selection = new SelectionModel(true, []);
     });
@@ -102,9 +109,9 @@ export class LoanLockedComponent implements OnInit {
 
   /** Selects all rows if they are not all selected; otherwise clear selection. */
   masterToggle() {
-    this.isAllSelected() ?
-      this.selection.clear() :
-      this.dataSource.data.forEach((row: any) => this.selection.select(row));
+    this.isAllSelected()
+      ? this.selection.clear()
+      : this.dataSource.data.forEach((row: any) => this.selection.select(row));
   }
 
   /** The label for the checkbox on the passed row */
@@ -145,5 +152,4 @@ export class LoanLockedComponent implements OnInit {
       });
     }
   }
-
 }
diff --git a/src/app/system/manage-jobs/cob-workflow/loan-locked/loan-locked.resolver.ts b/src/app/system/manage-jobs/cob-workflow/loan-locked/loan-locked.resolver.ts
index 2ab530435..5fd703635 100644
--- a/src/app/system/manage-jobs/cob-workflow/loan-locked/loan-locked.resolver.ts
+++ b/src/app/system/manage-jobs/cob-workflow/loan-locked/loan-locked.resolver.ts
@@ -1,9 +1,5 @@
 import { Injectable } from '@angular/core';
-import {
-  Router, Resolve,
-  RouterStateSnapshot,
-  ActivatedRouteSnapshot
-} from '@angular/router';
+import { Router, Resolve, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router';
 import { TasksService } from 'app/tasks/tasks.service';
 import { Observable, of } from 'rxjs';
 
@@ -11,17 +7,16 @@ import { Observable, of } from 'rxjs';
   providedIn: 'root'
 })
 export class LoanLockedResolver implements Resolve {
+  /**
+   * @param {TasksService} tasksService Tasks service.
+   */
+  constructor(private tasksService: TasksService) {}
 
-    /**
-     * @param {TasksService} tasksService Tasks service.
-     */
-     constructor(private tasksService: TasksService) { }
-
-     /**
-      * Returns all the loans data.
-      * @returns {Observable}
-      */
-     resolve(): Observable {
-         return this.tasksService.getAllLoansLocked(0, 200);
-     }
+  /**
+   * Returns all the loans data.
+   * @returns {Observable}
+   */
+  resolve(): Observable {
+    return this.tasksService.getAllLoansLocked(0, 200);
+  }
 }
diff --git a/src/app/system/manage-jobs/manage-jobs.component.spec.ts b/src/app/system/manage-jobs/manage-jobs.component.spec.ts
index 3dd232386..c88d9c58c 100644
--- a/src/app/system/manage-jobs/manage-jobs.component.spec.ts
+++ b/src/app/system/manage-jobs/manage-jobs.component.spec.ts
@@ -8,9 +8,8 @@ describe('ManageJobsComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ ManageJobsComponent ]
-    })
-    .compileComponents();
+      declarations: [ManageJobsComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/system/manage-jobs/manage-jobs.component.ts b/src/app/system/manage-jobs/manage-jobs.component.ts
index bc424f793..ced2ab4e0 100644
--- a/src/app/system/manage-jobs/manage-jobs.component.ts
+++ b/src/app/system/manage-jobs/manage-jobs.component.ts
@@ -12,8 +12,10 @@ export class ManageJobsComponent {
   /** Process running flag */
   isCatchUpRunning = true;
 
-  constructor(private systemService: SystemService,
-    private translateService: TranslateService) { }
+  constructor(
+    private systemService: SystemService,
+    private translateService: TranslateService
+  ) {}
 
   onJobTabChange(event: MatTabChangeEvent) {
     if (event.index === 2) {
@@ -26,5 +28,4 @@ export class ManageJobsComponent {
   title(label: string) {
     return this.translateService.instant('labels.inputs.' + label);
   }
-
 }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-popover.component.spec.ts b/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-popover.component.spec.ts
index 0267847af..fe6ad2806 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-popover.component.spec.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-popover.component.spec.ts
@@ -8,9 +8,8 @@ describe('CustomParametersPopoverComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ CustomParametersPopoverComponent ]
-    })
-    .compileComponents();
+      declarations: [CustomParametersPopoverComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-popover.component.ts b/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-popover.component.ts
index cc4295f7e..0dcb8f00a 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-popover.component.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-popover.component.ts
@@ -47,7 +47,6 @@ interface JobDataType {
   styleUrls: ['./custom-parameters-popover.component.scss']
 })
 export class CustomParametersPopoverComponent implements OnInit {
-
   /* Job table childer */
   @ViewChildren(CustomParametersTableComponent) tableComponents: QueryList;
 
@@ -58,7 +57,10 @@ export class CustomParametersPopoverComponent implements OnInit {
   /* API call response message */
   messages: { message: string; status: number }[] = [];
 
-  constructor(private systemService: SystemService, @Inject(MAT_DIALOG_DATA) public data: SelectedJobsDataType) { }
+  constructor(
+    private systemService: SystemService,
+    @Inject(MAT_DIALOG_DATA) public data: SelectedJobsDataType
+  ) {}
 
   ngOnInit(): void {
     this.selectedJobs = this.data.selectedJobs.selected.map((jobJSON) => ({
@@ -78,16 +80,14 @@ export class CustomParametersPopoverComponent implements OnInit {
     });
 
     tableData.forEach((job) => {
-      this.systemService.runSelectedJobWithParameters(job.jobId,
-        { jobParameters: job.jobParameters }
-      )
-      .then((response) => {
-        this.messages.push({
-          message: `${job.displayName}: ${response.statusText} (${response.status})`,
-          status: response.ok
+      this.systemService
+        .runSelectedJobWithParameters(job.jobId, { jobParameters: job.jobParameters })
+        .then((response) => {
+          this.messages.push({
+            message: `${job.displayName}: ${response.statusText} (${response.status})`,
+            status: response.ok
+          });
         });
-      });
     });
   }
-
 }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-table/custom-parameters-table.component.spec.ts b/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-table/custom-parameters-table.component.spec.ts
index 9df2d83d9..6453eca0d 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-table/custom-parameters-table.component.spec.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-table/custom-parameters-table.component.spec.ts
@@ -8,9 +8,8 @@ describe('CustomParametersTableComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ CustomParametersTableComponent ]
-    })
-    .compileComponents();
+      declarations: [CustomParametersTableComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-table/custom-parameters-table.component.ts b/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-table/custom-parameters-table.component.ts
index 068d71203..6a9c99fba 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-table/custom-parameters-table.component.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/custom-parameters-popover/custom-parameters-table/custom-parameters-table.component.ts
@@ -7,7 +7,6 @@ import { JobIdAndParameterType, JobParameterType } from '../custom-parameters-po
   styleUrls: ['./custom-parameters-table.component.scss']
 })
 export class CustomParametersTableComponent implements OnInit {
-
   /* Job name for table title */
   @Input() displayName: string;
   /* Job id for table */
@@ -20,9 +19,13 @@ export class CustomParametersTableComponent implements OnInit {
   /* Job parameters copy updated by user input */
   updatedJobParameters: JobParameterType[];
   /* Columns for the table */
-  columnsToDisplay: string[] = ['parameterName', 'parameterValue', 'actions'];
+  columnsToDisplay: string[] = [
+    'parameterName',
+    'parameterValue',
+    'actions'
+  ];
 
-  constructor() { }
+  constructor() {}
 
   ngOnInit(): void {
     this.updatedJobParameters = this.jobParameters;
@@ -45,7 +48,7 @@ export class CustomParametersTableComponent implements OnInit {
   deleteParameter(index: number): void {
     let idx = 0;
     const jobParameters: JobParameterType[] = [];
-    for ( ; idx < this.updatedJobParameters.length; idx++ ) {
+    for (; idx < this.updatedJobParameters.length; idx++) {
       if (idx !== index) {
         jobParameters.push(this.updatedJobParameters[idx]);
       }
@@ -64,5 +67,4 @@ export class CustomParametersTableComponent implements OnInit {
       jobParameters: this.updatedJobParameters
     };
   }
-
 }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/edit-scheduler-job/edit-scheduler-job.component.spec.ts b/src/app/system/manage-jobs/scheduler-jobs/edit-scheduler-job/edit-scheduler-job.component.spec.ts
index c3cec580b..0b3337a57 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/edit-scheduler-job/edit-scheduler-job.component.spec.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/edit-scheduler-job/edit-scheduler-job.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditSchedulerJobComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditSchedulerJobComponent ]
-    })
-    .compileComponents();
+      declarations: [EditSchedulerJobComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-jobs/scheduler-jobs/edit-scheduler-job/edit-scheduler-job.component.ts b/src/app/system/manage-jobs/scheduler-jobs/edit-scheduler-job/edit-scheduler-job.component.ts
index d91ae3c2e..c3918c245 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/edit-scheduler-job/edit-scheduler-job.component.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/edit-scheduler-job/edit-scheduler-job.component.ts
@@ -15,7 +15,6 @@ import { SystemService } from 'app/system/system.service';
   styleUrls: ['./edit-scheduler-job.component.scss']
 })
 export class EditSchedulerJobComponent implements OnInit {
-
   /** Job Data. */
   jobData: any;
   /** Job Form. */
@@ -28,10 +27,12 @@ export class EditSchedulerJobComponent implements OnInit {
    * @param {Router} router Router for navigation.
    * @param {ActivatedRoute} route Activated Route.
    */
-  constructor(private route: ActivatedRoute,
-              private systemService: SystemService,
-              private router: Router,
-              private formBuilder: UntypedFormBuilder ) {
+  constructor(
+    private route: ActivatedRoute,
+    private systemService: SystemService,
+    private router: Router,
+    private formBuilder: UntypedFormBuilder
+  ) {
     this.route.data.subscribe((data: { jobSelected: any }) => {
       this.jobData = data.jobSelected;
     });
@@ -49,9 +50,15 @@ export class EditSchedulerJobComponent implements OnInit {
    */
   createJobForm() {
     this.jobForm = this.formBuilder.group({
-      'displayName': [this.jobData.displayName, Validators.required],
-      'cronExpression': [this.jobData.cronExpression, Validators.required],
-      'active': [this.jobData.active]
+      displayName: [
+        this.jobData.displayName,
+        Validators.required
+      ],
+      cronExpression: [
+        this.jobData.cronExpression,
+        Validators.required
+      ],
+      active: [this.jobData.active]
     });
   }
 
@@ -59,10 +66,8 @@ export class EditSchedulerJobComponent implements OnInit {
    * Submits the edit job form.
    */
   submit() {
-    this.systemService.updateScheduler(this.jobData.jobId, this.jobForm.value)
-      .subscribe(() => {
-        this.router.navigate(['../'], { relativeTo: this.route });
+    this.systemService.updateScheduler(this.jobData.jobId, this.jobForm.value).subscribe(() => {
+      this.router.navigate(['../'], { relativeTo: this.route });
     });
   }
-
 }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/error-log-popover/error-log-popover.component.spec.ts b/src/app/system/manage-jobs/scheduler-jobs/error-log-popover/error-log-popover.component.spec.ts
index fd39e880c..be7dd37c1 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/error-log-popover/error-log-popover.component.spec.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/error-log-popover/error-log-popover.component.spec.ts
@@ -8,9 +8,8 @@ describe('ErrorLogPopoverComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ ErrorLogPopoverComponent ]
-    })
-    .compileComponents();
+      declarations: [ErrorLogPopoverComponent]
+    }).compileComponents();
 
     fixture = TestBed.createComponent(ErrorLogPopoverComponent);
     component = fixture.componentInstance;
diff --git a/src/app/system/manage-jobs/scheduler-jobs/error-log-popover/error-log-popover.component.ts b/src/app/system/manage-jobs/scheduler-jobs/error-log-popover/error-log-popover.component.ts
index 5ecfa454d..50244d24c 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/error-log-popover/error-log-popover.component.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/error-log-popover/error-log-popover.component.ts
@@ -3,7 +3,6 @@ import { MAT_DIALOG_DATA } from '@angular/material/dialog';
 import { TranslateService } from '@ngx-translate/core';
 import { SchedulerJob } from '../models/scheduler-job.model';
 
-
 interface ErrorJobDataType {
   job: SchedulerJob;
 }
@@ -19,16 +18,19 @@ export class ErrorLogPopoverComponent implements OnInit {
   /* Initialize Selected Job */
   job: SchedulerJob;
 
-  constructor(@Inject(MAT_DIALOG_DATA) public data: ErrorJobDataType,
-    private translateService: TranslateService) { }
+  constructor(
+    @Inject(MAT_DIALOG_DATA) public data: ErrorJobDataType,
+    private translateService: TranslateService
+  ) {}
 
   ngOnInit(): void {
     this.job = this.data.job;
   }
 
   buttonLabel(): string {
-    const label: string = this.show ? this.translateService.instant('labels.buttons.Show less') : this.translateService.instant('labels.buttons.Show more');
+    const label: string = this.show
+      ? this.translateService.instant('labels.buttons.Show less')
+      : this.translateService.instant('labels.buttons.Show more');
     return this.translateService.instant('labels.buttons.' + label);
   }
-
 }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-job.resolver.ts b/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-job.resolver.ts
index e2cf0f95b..e9926636f 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-job.resolver.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-job.resolver.ts
@@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
 import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
 
 /** rxjs Imports */
-import { Observable} from 'rxjs';
+import { Observable } from 'rxjs';
 
 /** Custom Services */
 import { SystemService } from '../../system.service';
@@ -13,7 +13,6 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class ManageSchedulerJobResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -27,5 +26,4 @@ export class ManageSchedulerJobResolver implements Resolve {
     const jobId = route.paramMap.get('id');
     return this.systemService.getSelectedJob(jobId);
   }
-
 }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.component.spec.ts b/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.component.spec.ts
index c545f33b6..7fdb76cb1 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.component.spec.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.component.spec.ts
@@ -8,9 +8,8 @@ describe('ManageSchedulerJobsComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ManageSchedulerJobsComponent ]
-    })
-    .compileComponents();
+      declarations: [ManageSchedulerJobsComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.component.ts b/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.component.ts
index 19f2af267..df7ddd2a4 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.component.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.component.ts
@@ -30,13 +30,20 @@ import { RunSelectedJobsPopoverComponent } from './run-selected-jobs-popover/run
   styleUrls: ['./manage-scheduler-jobs.component.scss']
 })
 export class ManageSchedulerJobsComponent implements OnInit, AfterViewInit {
-
   /** Jobs data. */
   jobData: any;
   /** Scheduler data */
   schedulerData: any;
   /** Columns to be displayed in manage scheduler jobs table. */
-  displayedColumns: string[] = ['select', 'displayName', 'active', 'previousRunTime', 'currentlyRunning', 'nextRunTime', 'errorLog'];
+  displayedColumns: string[] = [
+    'select',
+    'displayName',
+    'active',
+    'previousRunTime',
+    'currentlyRunning',
+    'nextRunTime',
+    'errorLog'
+  ];
   /** Data source for manage scheduler jobs table. */
   dataSource: MatTableDataSource;
   /** Initialize Selection */
@@ -68,12 +75,14 @@ export class ManageSchedulerJobsComponent implements OnInit, AfterViewInit {
    * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
    * @param {PopoverService} popoverService PopoverService.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private systemService: SystemService,
     private router: Router,
     private dialog: MatDialog,
     private configurationWizardService: ConfigurationWizardService,
-    private popoverService: PopoverService) {
+    private popoverService: PopoverService
+  ) {
     this.route.data.subscribe((data: { jobsScheduler: any }) => {
       if (data.jobsScheduler) {
         this.jobData = data.jobsScheduler[0];
@@ -102,9 +111,7 @@ export class ManageSchedulerJobsComponent implements OnInit, AfterViewInit {
    * Selects all rows if they are not all selected; otherwise clear selection.
    */
   masterToggle() {
-    this.isAllSelected() ?
-      this.selection.clear() :
-      this.dataSource.data.forEach(row => this.selection.select(row));
+    this.isAllSelected() ? this.selection.clear() : this.dataSource.data.forEach((row) => this.selection.select(row));
   }
 
   /**
@@ -119,49 +126,50 @@ export class ManageSchedulerJobsComponent implements OnInit, AfterViewInit {
    * Initializes the data source, paginator and sorter for manage scheduler jobs table.
    */
   setJobs() {
-    this.systemService.getJobs()
-      .subscribe((jobData: any) => {
-        this.dataSource = new MatTableDataSource(jobData);
-        this.dataSource.paginator = this.paginator;
-        this.dataSource.sort = this.sort;
-        this.jobsCounter = jobData.length;
-        this.selection.clear();
-        this.dataSource.sortingDataAccessor = (item, property) => {
-          switch (property) {
-            case 'previousRunStatus': return item.lastRunHistory.status;
-            case 'errorLog': return item.lastRunHistory.status;
-            case 'previousRunTime': return new Date(item.lastRunHistory.jobRunStartTime);
-            case 'nextRunTime': return new Date(item.nextRunTime);
-            default: return item[property];
-          }
-        };
-      });
+    this.systemService.getJobs().subscribe((jobData: any) => {
+      this.dataSource = new MatTableDataSource(jobData);
+      this.dataSource.paginator = this.paginator;
+      this.dataSource.sort = this.sort;
+      this.jobsCounter = jobData.length;
+      this.selection.clear();
+      this.dataSource.sortingDataAccessor = (item, property) => {
+        switch (property) {
+          case 'previousRunStatus':
+            return item.lastRunHistory.status;
+          case 'errorLog':
+            return item.lastRunHistory.status;
+          case 'previousRunTime':
+            return new Date(item.lastRunHistory.jobRunStartTime);
+          case 'nextRunTime':
+            return new Date(item.nextRunTime);
+          default:
+            return item[property];
+        }
+      };
+    });
   }
 
   getScheduler() {
-    this.systemService.getScheduler()
-      .subscribe((schedulerData: any) => {
-        this.schedulerData = schedulerData;
-        this.schedulerActive = this.schedulerData.active;
-      });
+    this.systemService.getScheduler().subscribe((schedulerData: any) => {
+      this.schedulerData = schedulerData;
+      this.schedulerActive = this.schedulerData.active;
+    });
   }
 
   suspendScheduler(): void {
-    this.systemService.runCommandOnScheduler('stop')
-      .subscribe(() => {
-        this.getScheduler();
-      });
+    this.systemService.runCommandOnScheduler('stop').subscribe(() => {
+      this.getScheduler();
+    });
   }
 
   activateScheduler(): void {
-    this.systemService.runCommandOnScheduler('start')
-      .subscribe(() => {
-        this.getScheduler();
-      });
+    this.systemService.runCommandOnScheduler('start').subscribe(() => {
+      this.getScheduler();
+    });
   }
 
   isAnyJobSelected(): boolean {
-    return (this.selection.selected.length > 0);
+    return this.selection.selected.length > 0;
   }
 
   runSelectedJobs(): void {
@@ -180,7 +188,12 @@ export class ManageSchedulerJobsComponent implements OnInit, AfterViewInit {
    * @param position String.
    * @param backdrop Boolean.
    */
-  showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+  showPopover(
+    template: TemplateRef,
+    target: HTMLElement | ElementRef,
+    position: string,
+    backdrop: boolean
+  ): void {
     setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
   }
 
@@ -228,7 +241,7 @@ export class ManageSchedulerJobsComponent implements OnInit, AfterViewInit {
         nextStepName: 'Setup Accounting',
         previousStepName: 'System',
         stepPercentage: 60
-      },
+      }
     });
     nextStepDialogRef.afterClosed().subscribe((response: { nextStep: boolean }) => {
       if (response.nextStep) {
@@ -275,12 +288,12 @@ export class ManageSchedulerJobsComponent implements OnInit, AfterViewInit {
       }
     });
 
-    dialog.componentInstance.confirmedJobs.subscribe(result => {
+    dialog.componentInstance.confirmedJobs.subscribe((result) => {
       if (result) {
         const selectedJobs = this.selection.selected;
-        const confirmedJobIds = result.map(job => job.jobId);
+        const confirmedJobIds = result.map((job) => job.jobId);
 
-        selectedJobs.forEach(job => {
+        selectedJobs.forEach((job) => {
           if (!confirmedJobIds.includes(job.jobId)) {
             this.selection.deselect(job);
           }
@@ -290,5 +303,4 @@ export class ManageSchedulerJobsComponent implements OnInit, AfterViewInit {
       }
     });
   }
-
 }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.resolver.ts b/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.resolver.ts
index 56fa724b7..3c696669b 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.resolver.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/manage-scheduler-jobs.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class ManageSchedulerJobsResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -29,5 +28,4 @@ export class ManageSchedulerJobsResolver implements Resolve {
       this.systemService.getScheduler()
     ]);
   }
-
 }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/models/scheduler-job.model.ts b/src/app/system/manage-jobs/scheduler-jobs/models/scheduler-job.model.ts
index 0e29effaf..9dbc01bd0 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/models/scheduler-job.model.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/models/scheduler-job.model.ts
@@ -1,19 +1,19 @@
 export interface SchedulerJob {
-    jobId:            number;
-    displayName:      string;
-    nextRunTime:      Date;
-    cronExpression:   string;
-    active:           boolean;
-    currentlyRunning: boolean;
-    lastRunHistory:   LastRunHistory;
+  jobId: number;
+  displayName: string;
+  nextRunTime: Date;
+  cronExpression: string;
+  active: boolean;
+  currentlyRunning: boolean;
+  lastRunHistory: LastRunHistory;
 }
 
 export interface LastRunHistory {
-    version:            number;
-    jobRunStartTime:    Date;
-    jobRunEndTime:      Date;
-    status:             string;
-    jobRunErrorMessage: string;
-    triggerType:        string;
-    jobRunErrorLog:     string;
+  version: number;
+  jobRunStartTime: Date;
+  jobRunEndTime: Date;
+  status: string;
+  jobRunErrorMessage: string;
+  triggerType: string;
+  jobRunErrorLog: string;
 }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-popover.component.spec.ts b/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-popover.component.spec.ts
index 263d52f18..0a82fc29e 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-popover.component.spec.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-popover.component.spec.ts
@@ -8,9 +8,8 @@ describe('RunSelectedJobsPopoverComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ RunSelectedJobsPopoverComponent ]
-    })
-    .compileComponents();
+      declarations: [RunSelectedJobsPopoverComponent]
+    }).compileComponents();
 
     fixture = TestBed.createComponent(RunSelectedJobsPopoverComponent);
     component = fixture.componentInstance;
diff --git a/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-popover.component.ts b/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-popover.component.ts
index bf51da715..b139449dc 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-popover.component.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-popover.component.ts
@@ -1,8 +1,5 @@
 import { SelectionModel } from '@angular/cdk/collections';
-import {
-  Component, EventEmitter, Inject, OnInit, Output, QueryList,
-  ViewChildren
-} from '@angular/core';
+import { Component, EventEmitter, Inject, OnInit, Output, QueryList, ViewChildren } from '@angular/core';
 import { MAT_DIALOG_DATA } from '@angular/material/dialog';
 import { SystemService } from 'app/system/system.service';
 import { RunSelectedJobsTableComponent } from './run-selected-jobs-table/run-selected-jobs-table.component';
@@ -33,13 +30,11 @@ export interface JobDataType {
   styleUrls: ['./run-selected-jobs-popover.component.scss']
 })
 export class RunSelectedJobsPopoverComponent implements OnInit {
-
   /** Confirmed jobs event emitter */
   @Output() confirmedJobs = new EventEmitter();
 
   /** Job table children */
-  @ViewChildren(RunSelectedJobsTableComponent) tableComponents:
-    QueryList;
+  @ViewChildren(RunSelectedJobsTableComponent) tableComponents: QueryList;
 
   /** Initialize Selected Jobs */
   selectedJobs: JobDataType[] = [];
@@ -50,32 +45,34 @@ export class RunSelectedJobsPopoverComponent implements OnInit {
   /** API call response message */
   messages: { message: string; status: number }[] = [];
 
-  constructor(private systemService: SystemService, @Inject(MAT_DIALOG_DATA)
-  public data: SelectedJobsDataType) { }
+  constructor(
+    private systemService: SystemService,
+    @Inject(MAT_DIALOG_DATA)
+    public data: SelectedJobsDataType
+  ) {}
   ngOnInit(): void {
     this.selectedJobs = this.data.selectedJobs.selected.sort((a, b) => a.jobId - b.jobId);
   }
 
   /**
-  * Run all confirmed jobs from table
-  */
+   * Run all confirmed jobs from table
+   */
   runSelectedJobs(): void {
     this.messages = [];
     let tableData: JobDataType[] = [];
     this.tableComponents.forEach((tableComponent) => {
-      tableData = (tableComponent.getTableData());
+      tableData = tableComponent.getTableData();
     });
 
     tableData.forEach((job) => {
-      this.systemService.runSelectedJob(job.jobId.toString())
-        .then((response) => {
-          this.messages.push({
-            message: `${job.displayName}: ${response.statusText} (${response.status})`,
-            status: response.ok
-          });
+      this.systemService.runSelectedJob(job.jobId.toString()).then((response) => {
+        this.messages.push({
+          message: `${job.displayName}: ${response.statusText} (${response.status})`,
+          status: response.ok
         });
+      });
     });
 
     this.confirmedJobs.emit(tableData);
   }
-}
\ No newline at end of file
+}
diff --git a/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-table/run-selected-jobs-table.component.spec.ts b/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-table/run-selected-jobs-table.component.spec.ts
index d623821e4..f1757f79a 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-table/run-selected-jobs-table.component.spec.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-table/run-selected-jobs-table.component.spec.ts
@@ -8,9 +8,8 @@ describe('RunSelectedJobsTableComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ RunSelectedJobsTableComponent ]
-    })
-    .compileComponents();
+      declarations: [RunSelectedJobsTableComponent]
+    }).compileComponents();
 
     fixture = TestBed.createComponent(RunSelectedJobsTableComponent);
     component = fixture.componentInstance;
diff --git a/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-table/run-selected-jobs-table.component.ts b/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-table/run-selected-jobs-table.component.ts
index 68d3b95f5..66196d74b 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-table/run-selected-jobs-table.component.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/run-selected-jobs-popover/run-selected-jobs-table/run-selected-jobs-table.component.ts
@@ -10,24 +10,24 @@ import { JobDataType } from '../run-selected-jobs-popover.component';
   styleUrls: ['./run-selected-jobs-table.component.scss']
 })
 export class RunSelectedJobsTableComponent {
-
   /** Selected Jobs For Table */
   @Input() selectedJobs: JobDataType[] = [];
 
   /** Confirmed Jobs */
-  @Output() confirmedJobs: EventEmitter = new
-    EventEmitter();
+  @Output() confirmedJobs: EventEmitter = new EventEmitter();
 
   /** Columns for the table */
-  columnsToDisplay: string[] = ['displayName', 'actions'];
+  columnsToDisplay: string[] = [
+    'displayName',
+    'actions'
+  ];
 
-  constructor() {
-  }
+  constructor() {}
 
   /**
-  * Removes job from selection array
-  * @param index
-  */
+   * Removes job from selection array
+   * @param index
+   */
   removeJobFromSelection(index: number): void {
     let idx = 0;
     const finalSelectedJobs: JobDataType[] = [];
@@ -40,9 +40,9 @@ export class RunSelectedJobsTableComponent {
   }
 
   /**
-  * Gets selected jobs array
-  * @returns selected jobs array
-  */
+   * Gets selected jobs array
+   * @returns selected jobs array
+   */
   getTableData(): JobDataType[] {
     return this.selectedJobs;
   }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/view-history-scheduler-job/view-history-scheduler-job.component.spec.ts b/src/app/system/manage-jobs/scheduler-jobs/view-history-scheduler-job/view-history-scheduler-job.component.spec.ts
index cedaf24f0..e96cbc292 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/view-history-scheduler-job/view-history-scheduler-job.component.spec.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/view-history-scheduler-job/view-history-scheduler-job.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewHistorySchedulerJobComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewHistorySchedulerJobComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewHistorySchedulerJobComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-jobs/scheduler-jobs/view-history-scheduler-job/view-history-scheduler-job.component.ts b/src/app/system/manage-jobs/scheduler-jobs/view-history-scheduler-job/view-history-scheduler-job.component.ts
index 08e3f71d0..3dbc7a284 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/view-history-scheduler-job/view-history-scheduler-job.component.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/view-history-scheduler-job/view-history-scheduler-job.component.ts
@@ -13,11 +13,17 @@ import { ActivatedRoute, Router } from '@angular/router';
   styleUrls: ['./view-history-scheduler-job.component.scss']
 })
 export class ViewHistorySchedulerJobComponent implements OnInit {
-
   /** Job History data. */
   jobHistoryData: any;
   /** Columns to be displayed in Scheduler Job History. */
-  displayedColumns: string[] = ['version', 'run_start_time', 'run_end_time', 'status', 'run_type', 'error_log'];
+  displayedColumns: string[] = [
+    'version',
+    'run_start_time',
+    'run_end_time',
+    'status',
+    'run_type',
+    'error_log'
+  ];
   /** Data source for Scheduler Job History table. */
   dataSource: MatTableDataSource;
 
@@ -30,23 +36,27 @@ export class ViewHistorySchedulerJobComponent implements OnInit {
    * Retrieves the scheduler Job History data from `resolve`.
    * @param {ActivatedRoute} route Activated Route.
    */
-  constructor(private route: ActivatedRoute,
-              private dialog: MatDialog,
-              private router: Router ) {
-    this.route.data.subscribe(( data: { jobsSchedulerHistory: any }) => {
+  constructor(
+    private route: ActivatedRoute,
+    private dialog: MatDialog,
+    private router: Router
+  ) {
+    this.route.data.subscribe((data: { jobsSchedulerHistory: any }) => {
       this.jobHistoryData = data.jobsSchedulerHistory;
     });
-   }
+  }
 
   /**
    * Filters data in scheduler Job History table based on passed value.
    * @param {string} filterValue Value to filter data.
    */
   applyFilter(filterValue: string) {
-    const filterObject = [{
-      id: 'version',
-      value: filterValue
-    }];
+    const filterObject = [
+      {
+        id: 'version',
+        value: filterValue
+      }
+    ];
     this.dataSource.filter = JSON.stringify(filterObject);
   }
 
@@ -61,8 +71,7 @@ export class ViewHistorySchedulerJobComponent implements OnInit {
     this.dataSource = new MatTableDataSource(this.jobHistoryData.pageItems);
     this.dataSource.paginator = this.paginator;
     /** Search By Version */
-    this.dataSource.filterPredicate =
-    (data: any, filtersJson: string) => {
+    this.dataSource.filterPredicate = (data: any, filtersJson: string) => {
       const matchFilter: any[] = [];
       const filters = JSON.parse(filtersJson);
       filters.forEach((filter: any) => {
@@ -73,7 +82,7 @@ export class ViewHistorySchedulerJobComponent implements OnInit {
           matchFilter.push(val.toString().toLowerCase().includes(filter.value.toLowerCase()));
         }
       });
-        return matchFilter.every(Boolean);
+      return matchFilter.every(Boolean);
     };
   }
 
@@ -84,11 +93,10 @@ export class ViewHistorySchedulerJobComponent implements OnInit {
   openError(version: any) {
     const openErrorLogDialog = this.dialog.open(ErrorDialogComponent, {
       width: '400px',
-      data: this.jobHistoryData.pageItems.filter( (data: any) => data.version === version )[0].jobRunErrorLog
+      data: this.jobHistoryData.pageItems.filter((data: any) => data.version === version)[0].jobRunErrorLog
     });
     openErrorLogDialog.afterClosed().subscribe((response: any) => {
       this.router.navigate(['']);
     });
   }
-
 }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/view-history-scheduler-job/view-history-scheduler-job.resolver.ts b/src/app/system/manage-jobs/scheduler-jobs/view-history-scheduler-job/view-history-scheduler-job.resolver.ts
index 7d2baa8c4..e672e790d 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/view-history-scheduler-job/view-history-scheduler-job.resolver.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/view-history-scheduler-job/view-history-scheduler-job.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../../../system.service';
  */
 @Injectable()
 export class ViewHistorySchedulerJobsResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -27,5 +26,4 @@ export class ViewHistorySchedulerJobsResolver implements Resolve {
     const jobId = route.paramMap.get('id');
     return this.systemService.getHistoryScheduler(jobId);
   }
-
 }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/view-scheduler-job/view-scheduler-job.component.spec.ts b/src/app/system/manage-jobs/scheduler-jobs/view-scheduler-job/view-scheduler-job.component.spec.ts
index fde16593a..8fb4a711d 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/view-scheduler-job/view-scheduler-job.component.spec.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/view-scheduler-job/view-scheduler-job.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewSchedulerJobComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewSchedulerJobComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewSchedulerJobComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-jobs/scheduler-jobs/view-scheduler-job/view-scheduler-job.component.ts b/src/app/system/manage-jobs/scheduler-jobs/view-scheduler-job/view-scheduler-job.component.ts
index 9688415e3..6d2fcad90 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/view-scheduler-job/view-scheduler-job.component.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/view-scheduler-job/view-scheduler-job.component.ts
@@ -1,5 +1,5 @@
 /** Angular Imports */
-import { Component} from '@angular/core';
+import { Component } from '@angular/core';
 import { ActivatedRoute } from '@angular/router';
 
 /**
@@ -11,7 +11,6 @@ import { ActivatedRoute } from '@angular/router';
   styleUrls: ['./view-scheduler-job.component.scss']
 })
 export class ViewSchedulerJobComponent {
-
   /** Job Data. */
   jobData: any;
 
@@ -24,5 +23,4 @@ export class ViewSchedulerJobComponent {
       this.jobData = data.selectedJob;
     });
   }
-
 }
diff --git a/src/app/system/manage-jobs/scheduler-jobs/view-scheduler-job/view-scheduler-job.resolver.ts b/src/app/system/manage-jobs/scheduler-jobs/view-scheduler-job/view-scheduler-job.resolver.ts
index abccf8b8a..67f319e92 100644
--- a/src/app/system/manage-jobs/scheduler-jobs/view-scheduler-job/view-scheduler-job.resolver.ts
+++ b/src/app/system/manage-jobs/scheduler-jobs/view-scheduler-job/view-scheduler-job.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../../../system.service';
  */
 @Injectable()
 export class ViewSchedulerJobResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -27,5 +26,4 @@ export class ViewSchedulerJobResolver implements Resolve {
     const jobId = route.paramMap.get('id');
     return this.systemService.getSelectedJob(jobId);
   }
-
 }
diff --git a/src/app/system/manage-jobs/workflow-jobs/workflow-diagram/workflow-diagram.component.spec.ts b/src/app/system/manage-jobs/workflow-jobs/workflow-diagram/workflow-diagram.component.spec.ts
index 6a513551f..b15399bc3 100644
--- a/src/app/system/manage-jobs/workflow-jobs/workflow-diagram/workflow-diagram.component.spec.ts
+++ b/src/app/system/manage-jobs/workflow-jobs/workflow-diagram/workflow-diagram.component.spec.ts
@@ -8,9 +8,8 @@ describe('WorkflowDiagramComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ WorkflowDiagramComponent ]
-    })
-    .compileComponents();
+      declarations: [WorkflowDiagramComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/system/manage-jobs/workflow-jobs/workflow-diagram/workflow-diagram.component.ts b/src/app/system/manage-jobs/workflow-jobs/workflow-diagram/workflow-diagram.component.ts
index 74d7d4278..da00d8045 100644
--- a/src/app/system/manage-jobs/workflow-jobs/workflow-diagram/workflow-diagram.component.ts
+++ b/src/app/system/manage-jobs/workflow-jobs/workflow-diagram/workflow-diagram.component.ts
@@ -3,7 +3,6 @@ import { DagreNodesOnlyLayout, Edge, Layout, Node } from '@swimlane/ngx-graph';
 import * as shape from 'd3-shape';
 import { Subject } from 'rxjs';
 
-
 export class JobStep {
   id: number;
   stepName: string;
@@ -18,7 +17,10 @@ export class JobStep {
 export class WorkflowDiagramComponent implements OnInit {
   @Input() jobStepsData: JobStep[] = [];
 
-  diagramSize: [number, number] = [1024, 300];
+  diagramSize: [number, number] = [
+    1024,
+    300
+  ];
   public nodes: Node[] = [];
   public links: Edge[] = [];
   public layoutSettings = {
@@ -27,11 +29,15 @@ export class WorkflowDiagramComponent implements OnInit {
   public curve: any = shape.curveLinear;
   public layout: Layout = new DagreNodesOnlyLayout();
   colorScheme = {
-    domain: ['#5AA454', '#A10A28', '#C7B42C']
+    domain: [
+      '#5AA454',
+      '#A10A28',
+      '#C7B42C'
+    ]
   };
   center$ = new Subject();
 
-  constructor() { }
+  constructor() {}
 
   ngOnInit(): void {
     let nodeCounter = 0;
@@ -49,8 +55,8 @@ export class WorkflowDiagramComponent implements OnInit {
 
       if (nodeCounter > 0) {
         const edge: Edge = {
-          id: `link_${(jobStep.id)}`,
-          source: `node_${(jobStep.order - 1)}`,
+          id: `link_${jobStep.id}`,
+          source: `node_${jobStep.order - 1}`,
           target: currentNode,
           label: '',
           data: {
@@ -68,7 +74,6 @@ export class WorkflowDiagramComponent implements OnInit {
   }
 
   public getStyles(node: Node): any {
-      return 'node_odd';
+    return 'node_odd';
   }
-
 }
diff --git a/src/app/system/manage-jobs/workflow-jobs/workflow-jobs.component.spec.ts b/src/app/system/manage-jobs/workflow-jobs/workflow-jobs.component.spec.ts
index 0d313a02e..3d43c68c0 100644
--- a/src/app/system/manage-jobs/workflow-jobs/workflow-jobs.component.spec.ts
+++ b/src/app/system/manage-jobs/workflow-jobs/workflow-jobs.component.spec.ts
@@ -8,9 +8,8 @@ describe('WorkflowJobsComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ WorkflowJobsComponent ]
-    })
-    .compileComponents();
+      declarations: [WorkflowJobsComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/system/manage-jobs/workflow-jobs/workflow-jobs.component.ts b/src/app/system/manage-jobs/workflow-jobs/workflow-jobs.component.ts
index f32133928..17ed7f7d3 100644
--- a/src/app/system/manage-jobs/workflow-jobs/workflow-jobs.component.ts
+++ b/src/app/system/manage-jobs/workflow-jobs/workflow-jobs.component.ts
@@ -30,19 +30,27 @@ export class WorkflowJobsComponent implements OnInit {
   @ViewChild('table') table: MatTable;
 
   /** Columns to be displayed in the table. */
-  displayedColumns: string[] = ['stepName', 'stepOrder', 'actions'];
+  displayedColumns: string[] = [
+    'stepName',
+    'stepOrder',
+    'actions'
+  ];
 
-  constructor(private systemService: SystemService,
-              public dialog: MatDialog,
-              private translateService: TranslateService) {}
+  constructor(
+    private systemService: SystemService,
+    public dialog: MatDialog,
+    private translateService: TranslateService
+  ) {}
 
   ngOnInit(): void {
-    this.systemService.getWorkflowJobNames().toPromise()
-    .then(jobNames => {
-      this.jobNameOptions = jobNames.businessJobs.sort(function (a: any, b: any) {
-        return a.stepName - b.stepName;
+    this.systemService
+      .getWorkflowJobNames()
+      .toPromise()
+      .then((jobNames) => {
+        this.jobNameOptions = jobNames.businessJobs.sort(function (a: any, b: any) {
+          return a.stepName - b.stepName;
+        });
       });
-    });
   }
 
   /**
@@ -91,49 +99,54 @@ export class WorkflowJobsComponent implements OnInit {
     if (this.jobStepName != null) {
       const jobDatas = this.jobStepName.split('_');
       this.jobAvailableStepsData = [];
-      this.systemService.getAvailablesJobSteps(jobDatas[0]).toPromise()
-      .then(jobData => {
-        this.jobAvailableStepsData = jobData.availableBusinessSteps.sort(function (a: any, b: any) {
-          return a.stepName - b.stepName;
-        });
-
-        const tmpStepsNames: any = [];
-        this.jobStepsData.forEach((step: any) => {
-          return tmpStepsNames.push(step.stepName);
-        });
-
-        if (this.jobAvailableStepsData.length > 0) {
-          this.jobAvailableStepsData = this.jobAvailableStepsData.filter((item: any) => {
-            return (tmpStepsNames.indexOf(item.stepName) < 0);
+      this.systemService
+        .getAvailablesJobSteps(jobDatas[0])
+        .toPromise()
+        .then((jobData) => {
+          this.jobAvailableStepsData = jobData.availableBusinessSteps.sort(function (a: any, b: any) {
+            return a.stepName - b.stepName;
           });
-        }
 
-        if (this.jobAvailableStepsData.length > 0) {
-          for (let index = 0; index < this.jobAvailableStepsData.length; index++) {
-            this.jobAvailableStepsData[index].stepDescription = this.translateService.instant(`labels.catalogs.${this.jobAvailableStepsData[index].stepDescription}`);
+          const tmpStepsNames: any = [];
+          this.jobStepsData.forEach((step: any) => {
+            return tmpStepsNames.push(step.stepName);
+          });
+
+          if (this.jobAvailableStepsData.length > 0) {
+            this.jobAvailableStepsData = this.jobAvailableStepsData.filter((item: any) => {
+              return tmpStepsNames.indexOf(item.stepName) < 0;
+            });
           }
-          const frmFields: FormfieldBase[] = [
-            new SelectBase({
-              controlName: 'stepName',
-              label: this.translateService.instant('labels.text.Step'),
-              options: { label: 'stepDescription', value: 'stepName', data: this.jobAvailableStepsData },
-              order: 1
-            })
-          ];
-          const data = {
-            title: this.translateService.instant('labels.text.Add Job Step to Workflow'),
-            layout: { addButtonText: 'Add' },
-            formfields: frmFields
-          };
-          const stepDialogRef = this.dialog.open(FormDialogComponent, { data });
-          stepDialogRef.afterClosed().subscribe((response: any) => {
-            if (response.data) {
-              this.jobStepsData = this.jobStepsData.concat(response.data.value);
-              this.stepOrderHasChanged = true;
+
+          if (this.jobAvailableStepsData.length > 0) {
+            for (let index = 0; index < this.jobAvailableStepsData.length; index++) {
+              this.jobAvailableStepsData[index].stepDescription = this.translateService.instant(
+                `labels.catalogs.${this.jobAvailableStepsData[index].stepDescription}`
+              );
             }
-          });
-        }
-      });
+            const frmFields: FormfieldBase[] = [
+              new SelectBase({
+                controlName: 'stepName',
+                label: this.translateService.instant('labels.text.Step'),
+                options: { label: 'stepDescription', value: 'stepName', data: this.jobAvailableStepsData },
+                order: 1
+              })
+
+            ];
+            const data = {
+              title: this.translateService.instant('labels.text.Add Job Step to Workflow'),
+              layout: { addButtonText: 'Add' },
+              formfields: frmFields
+            };
+            const stepDialogRef = this.dialog.open(FormDialogComponent, { data });
+            stepDialogRef.afterClosed().subscribe((response: any) => {
+              if (response.data) {
+                this.jobStepsData = this.jobStepsData.concat(response.data.value);
+                this.stepOrderHasChanged = true;
+              }
+            });
+          }
+        });
     }
   }
 
@@ -145,13 +158,14 @@ export class WorkflowJobsComponent implements OnInit {
     });
 
     const payload = {
-      'businessSteps': this.jobStepsData
+      businessSteps: this.jobStepsData
     };
 
-    this.systemService.putWorkflowJobSteps(this.jobStepName, payload).toPromise()
-    .then(data => {
-      this.stepOrderHasChanged = false;
-    });
+    this.systemService
+      .putWorkflowJobSteps(this.jobStepName, payload)
+      .toPromise()
+      .then((data) => {
+        this.stepOrderHasChanged = false;
+      });
   }
-
 }
diff --git a/src/app/system/manage-jobs/workflow-jobs/workflow-jobs.resolver.ts b/src/app/system/manage-jobs/workflow-jobs/workflow-jobs.resolver.ts
index bc4320d9f..380bcc269 100644
--- a/src/app/system/manage-jobs/workflow-jobs/workflow-jobs.resolver.ts
+++ b/src/app/system/manage-jobs/workflow-jobs/workflow-jobs.resolver.ts
@@ -7,18 +7,16 @@ import { Observable } from 'rxjs';
   providedIn: 'root'
 })
 export class WorkflowJobResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
-   constructor(private systemService: SystemService) {}
-
-   /**
-    * Returns the Configuration data.
-    * @returns {Observable}
-    */
-   resolve(route: ActivatedRouteSnapshot): Observable {
-     return this.systemService.getWorkflowJobNames();
-   }
+  constructor(private systemService: SystemService) {}
 
+  /**
+   * Returns the Configuration data.
+   * @returns {Observable}
+   */
+  resolve(route: ActivatedRouteSnapshot): Observable {
+    return this.systemService.getWorkflowJobNames();
+  }
 }
diff --git a/src/app/system/manage-reports/create-report/create-report.component.spec.ts b/src/app/system/manage-reports/create-report/create-report.component.spec.ts
index 00e5344fb..a254303f5 100644
--- a/src/app/system/manage-reports/create-report/create-report.component.spec.ts
+++ b/src/app/system/manage-reports/create-report/create-report.component.spec.ts
@@ -8,9 +8,8 @@ describe('CreateReportComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CreateReportComponent ]
-    })
-    .compileComponents();
+      declarations: [CreateReportComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-reports/create-report/create-report.component.ts b/src/app/system/manage-reports/create-report/create-report.component.ts
index c0b0a988b..d614e823b 100644
--- a/src/app/system/manage-reports/create-report/create-report.component.ts
+++ b/src/app/system/manage-reports/create-report/create-report.component.ts
@@ -24,20 +24,22 @@ import { ReportParameterDialogComponent } from '../report-parameter-dialog/repor
   styleUrls: ['./create-report.component.scss']
 })
 export class CreateReportComponent implements OnInit {
-
   /** Report Form. */
   reportForm: UntypedFormGroup;
   /** Report Template Data. */
   reportTemplateData: any;
   /** Data passed to dialog. */
-  dataForDialog: { allowedParameters: any[], parameterName: string, reportParameterName: string } =
-    {
-      allowedParameters: undefined,
-      parameterName: undefined,
-      reportParameterName: undefined
-    };
+  dataForDialog: { allowedParameters: any[]; parameterName: string; reportParameterName: string } = {
+    allowedParameters: undefined,
+    parameterName: undefined,
+    reportParameterName: undefined
+  };
   /** Columns to be displayed in report parameters table. */
-  displayedColumns: string[] = ['parameterName', 'parameterNamePassed', 'actions'];
+  displayedColumns: string[] = [
+    'parameterName',
+    'parameterNamePassed',
+    'actions'
+  ];
   /** Data source for report parameters table. */
   dataSource: MatTableDataSource;
   /** Report Parameters Data. */
@@ -47,7 +49,13 @@ export class CreateReportComponent implements OnInit {
   /** Sorter for report parameters table. */
   @ViewChild(MatSort, { static: true }) sort: MatSort;
 
-  reportCategoryTypeOptions: string[] = ['Client', 'Loan', 'Savings', 'Fund', 'Accounting'];
+  reportCategoryTypeOptions: string[] = [
+    'Client',
+    'Loan',
+    'Savings',
+    'Fund',
+    'Accounting'
+  ];
 
   /**
    * Retrieves the report template data from `resolve`.
@@ -58,12 +66,14 @@ export class CreateReportComponent implements OnInit {
    * @param {MatDialog} dialog Dialog Reference.
    * @param {TranslateService} translateService Translate Service.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private route: ActivatedRoute,
-              private router: Router,
-              private dialog: MatDialog,
-              private translateServices: TranslateService) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private route: ActivatedRoute,
+    private router: Router,
+    private dialog: MatDialog,
+    private translateServices: TranslateService
+  ) {
     this.route.data.subscribe((data: { reportTemplate: any }) => {
       this.reportTemplateData = data.reportTemplate;
       this.dataForDialog.allowedParameters = this.reportTemplateData.allowedParameters;
@@ -93,13 +103,22 @@ export class CreateReportComponent implements OnInit {
    */
   createReportForm() {
     this.reportForm = this.formBuilder.group({
-      'reportName': ['', Validators.required],
-      'reportCategory': [''],
-      'description': [''],
-      'reportType': ['', Validators.required],
-      'reportSubType': [{ value: '', disabled: true }],
-      'useReport': [false],
-      'reportSql': ['', Validators.required]
+      reportName: [
+        '',
+        Validators.required
+      ],
+      reportCategory: [''],
+      description: [''],
+      reportType: [
+        '',
+        Validators.required
+      ],
+      reportSubType: [{ value: '', disabled: true }],
+      useReport: [false],
+      reportSql: [
+        '',
+        Validators.required
+      ]
     });
   }
 
@@ -114,10 +133,14 @@ export class CreateReportComponent implements OnInit {
     });
     addReportParameterDialogRef.afterClosed().subscribe((response: any) => {
       if (response !== '') {
-        this.reportParametersData.push({ id: '',
-                                         parameterName: this.reportTemplateData.allowedParameters.find((allowedParameter: any) => allowedParameter.id === response.parameterName).parameterName,
-                                         parameterId: response.parameterName,
-                                         reportParameterName: response.reportParameterName });
+        this.reportParametersData.push({
+          id: '',
+          parameterName: this.reportTemplateData.allowedParameters.find(
+            (allowedParameter: any) => allowedParameter.id === response.parameterName
+          ).parameterName,
+          parameterId: response.parameterName,
+          reportParameterName: response.reportParameterName
+        });
         this.dataSource.connect().next(this.reportParametersData);
       }
     });
@@ -135,10 +158,14 @@ export class CreateReportComponent implements OnInit {
     });
     editReportParameterDialogRef.afterClosed().subscribe((response: any) => {
       if (response !== '') {
-        this.reportParametersData[this.reportParametersData.indexOf(reportParameter)] = { id: '',
-          parameterName: this.reportTemplateData.allowedParameters.find((allowedParameter: any) => allowedParameter.id === response.parameterName).parameterName,
+        this.reportParametersData[this.reportParametersData.indexOf(reportParameter)] = {
+          id: '',
+          parameterName: this.reportTemplateData.allowedParameters.find(
+            (allowedParameter: any) => allowedParameter.id === response.parameterName
+          ).parameterName,
           parameterId: response.parameterName,
-          reportParameterName: response.reportParameterName };
+          reportParameterName: response.reportParameterName
+        };
         this.dataSource.connect().next(this.reportParametersData);
       }
     });
@@ -150,7 +177,10 @@ export class CreateReportComponent implements OnInit {
    */
   deleteReportParameter(reportParameter: any) {
     const deleteReportDialogRef = this.dialog.open(DeleteDialogComponent, {
-      data: { deleteContext: this.translateServices.instant('labels.heading.Report Parameter') + ' ' + reportParameter.parameterName }
+      data: {
+        deleteContext:
+          this.translateServices.instant('labels.heading.Report Parameter') + ' ' + reportParameter.parameterName
+      }
     });
     deleteReportDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
@@ -164,22 +194,21 @@ export class CreateReportComponent implements OnInit {
    * Toggles the visibility status of Report Sub Type dropdown.
    */
   toggleVisibility() {
-    this.reportForm.get('reportType').valueChanges
-      .subscribe(type => {
-        switch (type) {
-          case 'Chart':
-            this.reportForm.get('reportSubType').enable();
-            this.reportForm.get('reportSql').enable();
-            break;
-          case 'Pentaho':
-            this.reportForm.get('reportSql').disable();
-            this.reportForm.get('reportSubType').disable();
-            break;
-          default:
-            this.reportForm.get('reportSql').enable();
-            this.reportForm.get('reportSubType').disable();
-        }
-      });
+    this.reportForm.get('reportType').valueChanges.subscribe((type) => {
+      switch (type) {
+        case 'Chart':
+          this.reportForm.get('reportSubType').enable();
+          this.reportForm.get('reportSql').enable();
+          break;
+        case 'Pentaho':
+          this.reportForm.get('reportSql').disable();
+          this.reportForm.get('reportSubType').disable();
+          break;
+        default:
+          this.reportForm.get('reportSql').enable();
+          this.reportForm.get('reportSubType').disable();
+      }
+    });
   }
 
   /**
@@ -187,15 +216,19 @@ export class CreateReportComponent implements OnInit {
    * if successful redirects to view created report.
    */
   submit() {
-    this.reportForm.value.reportParameters = this.reportParametersData.map( function(reportParameter: any) {
+    this.reportForm.value.reportParameters = this.reportParametersData.map(function (reportParameter: any) {
       reportParameter.parameterName = undefined;
       return reportParameter;
     });
-    this.systemService.createReport(this.reportForm.value)
-      .subscribe((response: any) => {
-        // TODO: Implement Maker Checker Component.
-        this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
-      });
+    this.systemService.createReport(this.reportForm.value).subscribe((response: any) => {
+      // TODO: Implement Maker Checker Component.
+      this.router.navigate(
+        [
+          '../',
+          response.resourceId
+        ],
+        { relativeTo: this.route }
+      );
+    });
   }
-
 }
diff --git a/src/app/system/manage-reports/edit-report/edit-report.component.spec.ts b/src/app/system/manage-reports/edit-report/edit-report.component.spec.ts
index 364b58bfc..779666fad 100644
--- a/src/app/system/manage-reports/edit-report/edit-report.component.spec.ts
+++ b/src/app/system/manage-reports/edit-report/edit-report.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditReportComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditReportComponent ]
-    })
-    .compileComponents();
+      declarations: [EditReportComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-reports/edit-report/edit-report.component.ts b/src/app/system/manage-reports/edit-report/edit-report.component.ts
index c38bbab44..dbcbbf499 100644
--- a/src/app/system/manage-reports/edit-report/edit-report.component.ts
+++ b/src/app/system/manage-reports/edit-report/edit-report.component.ts
@@ -23,7 +23,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co
   styleUrls: ['./edit-report.component.scss']
 })
 export class EditReportComponent implements OnInit {
-
   /** Report Data. */
   reportData: any;
   /** Report Template Data. */
@@ -31,22 +30,31 @@ export class EditReportComponent implements OnInit {
   /** Report Parameters Data. */
   reportParametersData: any[] = [];
   /** Data passed to dialog. */
-  dataForDialog: { allowedParameters: any[], parameterName: string, reportParameterName: string } =
-    {
-      allowedParameters: undefined,
-      parameterName: undefined,
-      reportParameterName: undefined
-    };
+  dataForDialog: { allowedParameters: any[]; parameterName: string; reportParameterName: string } = {
+    allowedParameters: undefined,
+    parameterName: undefined,
+    reportParameterName: undefined
+  };
   /** Report Form. */
   reportForm: UntypedFormGroup;
   /** Columns to be displayed in report parameters table. */
-  displayedColumns: string[] = ['parameterName', 'parameterNamePassed', 'actions'];
+  displayedColumns: string[] = [
+    'parameterName',
+    'parameterNamePassed',
+    'actions'
+  ];
   /** Data source for report parameters table. */
   dataSource: MatTableDataSource;
   /** Boolean to check if report parameters data is changed or not. */
   isReportParametersChanged: Boolean = false;
 
-  reportCategoryTypeOptions: string[] = ['Client', 'Loan', 'Savings', 'Fund', 'Accounting'];
+  reportCategoryTypeOptions: string[] = [
+    'Client',
+    'Loan',
+    'Savings',
+    'Fund',
+    'Accounting'
+  ];
 
   /** Paginator for report parameters table. */
   @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
@@ -61,12 +69,14 @@ export class EditReportComponent implements OnInit {
    * @param {Router} router Router for navigation.
    * @param {MatDialog} dialog Dialog Reference.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private route: ActivatedRoute,
-              private router: Router,
-              private systemService: SystemService,
-              private dialog: MatDialog) {
-    this.route.data.subscribe((data: { report: any, reportTemplate: any }) => {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private route: ActivatedRoute,
+    private router: Router,
+    private systemService: SystemService,
+    private dialog: MatDialog
+  ) {
+    this.route.data.subscribe((data: { report: any; reportTemplate: any }) => {
       this.reportData = data.report;
       this.reportParametersData = data.report.reportParameters ? data.report.reportParameters : [];
       this.reportTemplateData = data.reportTemplate;
@@ -97,13 +107,41 @@ export class EditReportComponent implements OnInit {
    */
   createReportForm() {
     this.reportForm = this.formBuilder.group({
-      'reportName': [{ value: this.reportData.reportName, disabled: this.reportData.coreReport }, Validators.required],
-      'reportCategory': [{ value: this.reportData.reportCategory ? this.reportData.reportCategory : '', disabled: this.reportData.coreReport }],
-      'description': [{ value: this.reportData.description ? this.reportData.description : '', disabled: this.reportData.coreReport }],
-      'reportType': [{ value: this.reportData.reportType, disabled: this.reportData.coreReport }, Validators.required],
-      'reportSubType': [{ value: this.reportData.reportSubType ? this.reportData.reportSubType : '', disabled: this.reportData.reportType !== 'Chart' || this.reportData.coreReport }],
-      'useReport': [this.reportData.useReport ? this.reportData.useReport : false],
-      'reportSql': [{ value: this.reportData.reportSql, disabled: this.reportData.coreReport || this.reportData.reportType === 'Pentaho' }, Validators.required]
+      reportName: [
+        { value: this.reportData.reportName, disabled: this.reportData.coreReport },
+        Validators.required
+      ],
+      reportCategory: [
+        {
+          value: this.reportData.reportCategory ? this.reportData.reportCategory : '',
+          disabled: this.reportData.coreReport
+        }
+      ],
+      description: [
+        {
+          value: this.reportData.description ? this.reportData.description : '',
+          disabled: this.reportData.coreReport
+        }
+      ],
+      reportType: [
+        { value: this.reportData.reportType, disabled: this.reportData.coreReport },
+        Validators.required
+      ],
+      reportSubType: [
+        {
+          value: this.reportData.reportSubType ? this.reportData.reportSubType : '',
+          disabled: this.reportData.reportType !== 'Chart' || this.reportData.coreReport
+        }
+      ],
+      useReport: [this.reportData.useReport ? this.reportData.useReport : false],
+      reportSql: [
+        {
+          value: this.reportData.reportSql,
+          disabled: this.reportData.coreReport || this.reportData.reportType === 'Pentaho'
+        },
+        Validators.required
+
+      ]
     });
   }
 
@@ -118,10 +156,14 @@ export class EditReportComponent implements OnInit {
     });
     addReportParameterDialogRef.afterClosed().subscribe((response: any) => {
       if (response !== '') {
-        this.reportParametersData.push({ id: '',
-                                         parameterName: this.reportTemplateData.allowedParameters.find((allowedParameter: any) => allowedParameter.id === response.parameterName).parameterName,
-                                         parameterId: response.parameterName,
-                                         reportParameterName: response.reportParameterName ? response.reportParameterName : undefined });
+        this.reportParametersData.push({
+          id: '',
+          parameterName: this.reportTemplateData.allowedParameters.find(
+            (allowedParameter: any) => allowedParameter.id === response.parameterName
+          ).parameterName,
+          parameterId: response.parameterName,
+          reportParameterName: response.reportParameterName ? response.reportParameterName : undefined
+        });
         this.dataSource.connect().next(this.reportParametersData);
         this.isReportParametersChanged = true;
       }
@@ -140,10 +182,14 @@ export class EditReportComponent implements OnInit {
     });
     editReportParameterDialogRef.afterClosed().subscribe((response: any) => {
       if (response !== '') {
-        this.reportParametersData[this.reportParametersData.indexOf(reportParameter)] = { id: reportParameter.id,
-          parameterName: this.reportTemplateData.allowedParameters.find((allowedParameter: any) => allowedParameter.id === response.parameterName).parameterName,
+        this.reportParametersData[this.reportParametersData.indexOf(reportParameter)] = {
+          id: reportParameter.id,
+          parameterName: this.reportTemplateData.allowedParameters.find(
+            (allowedParameter: any) => allowedParameter.id === response.parameterName
+          ).parameterName,
           parameterId: response.parameterName,
-          reportParameterName: response.reportParameterName };
+          reportParameterName: response.reportParameterName
+        };
         this.dataSource.connect().next(this.reportParametersData);
         this.isReportParametersChanged = true;
       }
@@ -171,22 +217,21 @@ export class EditReportComponent implements OnInit {
    * Toggles the visibility status of Report Sub Type dropdown.
    */
   toggleVisibility() {
-    this.reportForm.get('reportType').valueChanges
-      .subscribe(type => {
-        switch (type) {
-          case 'Chart':
-            this.reportForm.get('reportSubType').enable();
-            this.reportForm.get('reportSql').enable();
-            break;
-          case 'Pentaho':
-            this.reportForm.get('reportSql').disable();
-            this.reportForm.get('reportSubType').disable();
-            break;
-          default:
-            this.reportForm.get('reportSql').enable();
-            this.reportForm.get('reportSubType').disable();
-        }
-      });
+    this.reportForm.get('reportType').valueChanges.subscribe((type) => {
+      switch (type) {
+        case 'Chart':
+          this.reportForm.get('reportSubType').enable();
+          this.reportForm.get('reportSql').enable();
+          break;
+        case 'Pentaho':
+          this.reportForm.get('reportSql').disable();
+          this.reportForm.get('reportSubType').disable();
+          break;
+        default:
+          this.reportForm.get('reportSql').enable();
+          this.reportForm.get('reportSubType').disable();
+      }
+    });
   }
 
   /**
@@ -198,15 +243,13 @@ export class EditReportComponent implements OnInit {
       this.reportForm.value.reportParameters = undefined;
     } else {
       this.reportForm.value.reportParameters = this.reportParametersData;
-      this.reportForm.value.reportParameters.map( function(reportParameter: any) {
+      this.reportForm.value.reportParameters.map(function (reportParameter: any) {
         reportParameter.parameterName = undefined;
         return reportParameter;
       });
     }
-    this.systemService.updateReport(this.reportData.id, this.reportForm.value)
-      .subscribe(() => {
-        this.router.navigate(['../'], { relativeTo: this.route });
-      });
+    this.systemService.updateReport(this.reportData.id, this.reportForm.value).subscribe(() => {
+      this.router.navigate(['../'], { relativeTo: this.route });
+    });
   }
-
 }
diff --git a/src/app/system/manage-reports/manage-reports.component.spec.ts b/src/app/system/manage-reports/manage-reports.component.spec.ts
index f38934028..65f57e957 100644
--- a/src/app/system/manage-reports/manage-reports.component.spec.ts
+++ b/src/app/system/manage-reports/manage-reports.component.spec.ts
@@ -8,9 +8,8 @@ describe('ManageReportsComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ManageReportsComponent ]
-    })
-    .compileComponents();
+      declarations: [ManageReportsComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-reports/manage-reports.component.ts b/src/app/system/manage-reports/manage-reports.component.ts
index 152b349e3..1c0fd8909 100644
--- a/src/app/system/manage-reports/manage-reports.component.ts
+++ b/src/app/system/manage-reports/manage-reports.component.ts
@@ -22,23 +22,29 @@ import { CompletionDialogComponent } from '../../configuration-wizard/completion
   styleUrls: ['./manage-reports.component.scss']
 })
 export class ManageReportsComponent implements OnInit, AfterViewInit {
-
   /** Reports Data. */
   reportsData: any;
   /** Columns to be displayed in reports table. */
-  displayedColumns: string[] = ['reportName', 'reportType', 'reportSubType', 'reportCategory', 'coreReport', 'userReport'];
+  displayedColumns: string[] = [
+    'reportName',
+    'reportType',
+    'reportSubType',
+    'reportCategory',
+    'coreReport',
+    'userReport'
+  ];
   /** Data source for reports table. */
   dataSource: MatTableDataSource;
 
-   /** Paginator for reports table. */
-   @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
-   /** Sorter for reports table. */
-   @ViewChild(MatSort, { static: true }) sort: MatSort;
+  /** Paginator for reports table. */
+  @ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
+  /** Sorter for reports table. */
+  @ViewChild(MatSort, { static: true }) sort: MatSort;
 
-   /* Reference of Create Report Button */
-   @ViewChild('buttonCreateReport') buttonCreateReport: ElementRef;
-   /* Template for popover on Create Report Button */
-   @ViewChild('templateButtonCreateReport') templateButtonCreateReport: TemplateRef;
+  /* Reference of Create Report Button */
+  @ViewChild('buttonCreateReport') buttonCreateReport: ElementRef;
+  /* Template for popover on Create Report Button */
+  @ViewChild('templateButtonCreateReport') templateButtonCreateReport: TemplateRef;
 
   /**
    * Retrieves the reports data from `resolve`.
@@ -48,11 +54,13 @@ export class ManageReportsComponent implements OnInit, AfterViewInit {
    * @param {PopoverService} popoverService PopoverService.
    * @param {Matdialog} matdialog Matdialog.
    */
-  constructor(private route: ActivatedRoute,
-              private router: Router,
-              private configurationWizardService: ConfigurationWizardService,
-              private popoverService: PopoverService,
-              private dialog: MatDialog) {
+  constructor(
+    private route: ActivatedRoute,
+    private router: Router,
+    private configurationWizardService: ConfigurationWizardService,
+    private popoverService: PopoverService,
+    private dialog: MatDialog
+  ) {
     this.route.data.subscribe((data: { reports: any }) => {
       this.reportsData = data.reports;
     });
@@ -100,7 +108,12 @@ export class ManageReportsComponent implements OnInit, AfterViewInit {
    * @param position String.
    * @param backdrop Boolean.
    */
-  showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+  showPopover(
+    template: TemplateRef,
+    target: HTMLElement | ElementRef,
+    position: string,
+    backdrop: boolean
+  ): void {
     setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
   }
 
@@ -123,7 +136,7 @@ export class ManageReportsComponent implements OnInit, AfterViewInit {
    * Completed Configuration Wizard Tour Dialog.
    */
   openNextStepDialog() {
-    const completionDialogRef = this.dialog.open( CompletionDialogComponent );
+    const completionDialogRef = this.dialog.open(CompletionDialogComponent);
     completionDialogRef.afterClosed().subscribe(() => {
       this.router.navigate(['/home']);
     });
diff --git a/src/app/system/manage-reports/report-parameter-dialog/report-parameter-dialog.component.spec.ts b/src/app/system/manage-reports/report-parameter-dialog/report-parameter-dialog.component.spec.ts
index f43221f11..fa6dcf347 100644
--- a/src/app/system/manage-reports/report-parameter-dialog/report-parameter-dialog.component.spec.ts
+++ b/src/app/system/manage-reports/report-parameter-dialog/report-parameter-dialog.component.spec.ts
@@ -8,9 +8,8 @@ describe('AddReportParameterDialogComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ReportParameterDialogComponent ]
-    })
-    .compileComponents();
+      declarations: [ReportParameterDialogComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-reports/report-parameter-dialog/report-parameter-dialog.component.ts b/src/app/system/manage-reports/report-parameter-dialog/report-parameter-dialog.component.ts
index e78304de8..37744894a 100644
--- a/src/app/system/manage-reports/report-parameter-dialog/report-parameter-dialog.component.ts
+++ b/src/app/system/manage-reports/report-parameter-dialog/report-parameter-dialog.component.ts
@@ -12,7 +12,6 @@ import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms
   styleUrls: ['./report-parameter-dialog.component.scss']
 })
 export class ReportParameterDialogComponent implements OnInit {
-
   /** Report Parameter Form. */
   reportParameterForm: UntypedFormGroup;
 
@@ -21,18 +20,22 @@ export class ReportParameterDialogComponent implements OnInit {
    * @param {FormBuilder} formBuilder Form Builder.
    * @param {any} data Provides the allowed parameters and values for the form (if available).
    */
-  constructor(public dialogRef: MatDialogRef,
-              public formBuilder: UntypedFormBuilder,
-              @Inject(MAT_DIALOG_DATA) public data: any) {
-  }
+  constructor(
+    public dialogRef: MatDialogRef,
+    public formBuilder: UntypedFormBuilder,
+    @Inject(MAT_DIALOG_DATA) public data: any
+  ) {}
 
   /**
    * Creates the add report parameter form.
    */
   ngOnInit() {
     this.reportParameterForm = this.formBuilder.group({
-      'parameterName': [this.data.parameterName, Validators.required],
-      'reportParameterName': [this.data.reportParameterName]
+      parameterName: [
+        this.data.parameterName,
+        Validators.required
+      ],
+      reportParameterName: [this.data.reportParameterName]
     });
   }
 
@@ -42,5 +45,4 @@ export class ReportParameterDialogComponent implements OnInit {
   submit() {
     this.dialogRef.close(this.reportParameterForm.value);
   }
-
 }
diff --git a/src/app/system/manage-reports/report-template.resolver.ts b/src/app/system/manage-reports/report-template.resolver.ts
index a9c58e281..1f8a485f9 100644
--- a/src/app/system/manage-reports/report-template.resolver.ts
+++ b/src/app/system/manage-reports/report-template.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class ReportTemplateResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class ReportTemplateResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getReportTemplate();
   }
-
 }
diff --git a/src/app/system/manage-reports/report.resolver.ts b/src/app/system/manage-reports/report.resolver.ts
index 7f062f44e..2659e579f 100644
--- a/src/app/system/manage-reports/report.resolver.ts
+++ b/src/app/system/manage-reports/report.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class ReportResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -27,5 +26,4 @@ export class ReportResolver implements Resolve {
     const reportId = route.paramMap.get('id');
     return this.systemService.getReport(reportId);
   }
-
 }
diff --git a/src/app/system/manage-reports/reports.resolver.ts b/src/app/system/manage-reports/reports.resolver.ts
index 7cf44177c..5f7331a52 100644
--- a/src/app/system/manage-reports/reports.resolver.ts
+++ b/src/app/system/manage-reports/reports.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class ReportsResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class ReportsResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getReports();
   }
-
 }
diff --git a/src/app/system/manage-reports/view-report/view-report.component.spec.ts b/src/app/system/manage-reports/view-report/view-report.component.spec.ts
index 9b75b70f5..d1249dc88 100644
--- a/src/app/system/manage-reports/view-report/view-report.component.spec.ts
+++ b/src/app/system/manage-reports/view-report/view-report.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewReportComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewReportComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewReportComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-reports/view-report/view-report.component.ts b/src/app/system/manage-reports/view-report/view-report.component.ts
index 13272460d..6191dec3e 100644
--- a/src/app/system/manage-reports/view-report/view-report.component.ts
+++ b/src/app/system/manage-reports/view-report/view-report.component.ts
@@ -18,7 +18,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co
   styleUrls: ['./view-report.component.scss']
 })
 export class ViewReportComponent {
-
   /** Report Data. */
   reportData: any;
 
@@ -29,10 +28,12 @@ export class ViewReportComponent {
    * @param {MatDialog} dialog Dialog Reference.
    * @param {Router} router Router for navigation.
    */
-  constructor(private route: ActivatedRoute,
-              private systemService: SystemService,
-              private dialog: MatDialog,
-              private router: Router) {
+  constructor(
+    private route: ActivatedRoute,
+    private systemService: SystemService,
+    private dialog: MatDialog,
+    private router: Router
+  ) {
     this.route.data.subscribe((data: { report: any }) => {
       this.reportData = data.report;
     });
@@ -47,10 +48,9 @@ export class ViewReportComponent {
     });
     deleteReportDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
-        this.systemService.deleteReport(this.reportData.id)
-          .subscribe(() => {
-            this.router.navigate(['/system/reports']);
-          });
+        this.systemService.deleteReport(this.reportData.id).subscribe(() => {
+          this.router.navigate(['/system/reports']);
+        });
       }
     });
   }
diff --git a/src/app/system/manage-surveys/create-survey/create-survey.component.spec.ts b/src/app/system/manage-surveys/create-survey/create-survey.component.spec.ts
index 80176109d..406ac7625 100644
--- a/src/app/system/manage-surveys/create-survey/create-survey.component.spec.ts
+++ b/src/app/system/manage-surveys/create-survey/create-survey.component.spec.ts
@@ -8,9 +8,8 @@ describe('CreateSurveyComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CreateSurveyComponent ]
-    })
-    .compileComponents();
+      declarations: [CreateSurveyComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-surveys/create-survey/create-survey.component.ts b/src/app/system/manage-surveys/create-survey/create-survey.component.ts
index 22e4d24d5..ed7add93f 100644
--- a/src/app/system/manage-surveys/create-survey/create-survey.component.ts
+++ b/src/app/system/manage-surveys/create-survey/create-survey.component.ts
@@ -20,7 +20,6 @@ import { CancelDialogComponent } from '../../../shared/cancel-dialog/cancel-dial
   styleUrls: ['./create-survey.component.scss']
 })
 export class CreateSurveyComponent implements OnInit {
-
   /** Survey form. */
   surveyForm: UntypedFormGroup;
 
@@ -31,11 +30,13 @@ export class CreateSurveyComponent implements OnInit {
    * @param {Router} router Router for navigation.
    * @param {MatDialog} dialog Dialog reference.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private route: ActivatedRoute,
-              private router: Router,
-              public dialog: MatDialog) { }
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private route: ActivatedRoute,
+    private router: Router,
+    public dialog: MatDialog
+  ) {}
 
   /**
    * Creates the survey form.
@@ -49,11 +50,22 @@ export class CreateSurveyComponent implements OnInit {
    */
   createSurveyForm() {
     this.surveyForm = this.formBuilder.group({
-      'key': ['', Validators.required],
-      'name': ['', Validators.required],
-      'countryCode': ['', [Validators.required, Validators.pattern('^\\s*([A-Za-z]{2})?\\s*$')]],
-      'description': [''],
-      'questionDatas': this.formBuilder.array([])
+      key: [
+        '',
+        Validators.required
+      ],
+      name: [
+        '',
+        Validators.required
+      ],
+      countryCode: [
+        '',
+        [
+          Validators.required,
+          Validators.pattern('^\\s*([A-Za-z]{2})?\\s*$')]
+      ],
+      description: [''],
+      questionDatas: this.formBuilder.array([])
     });
   }
 
@@ -71,7 +83,11 @@ export class CreateSurveyComponent implements OnInit {
    * @returns {FormArray} Responses form array.
    */
   getResponseDatas(questionIndex: number): UntypedFormArray {
-    return this.surveyForm.get(['questionDatas', questionIndex, 'responseDatas']) as UntypedFormArray;
+    return this.surveyForm.get([
+      'questionDatas',
+      questionIndex,
+      'responseDatas'
+    ]) as UntypedFormArray;
   }
 
   /**
@@ -80,11 +96,17 @@ export class CreateSurveyComponent implements OnInit {
    */
   createQuestionForm(): UntypedFormGroup {
     return this.formBuilder.group({
-      'key': ['', Validators.required],
-      'text': ['', Validators.required],
-      'description': [''],
-      'responseDatas': this.formBuilder.array([this.createResponseForm()]),
-      'sequenceNo': ['']
+      key: [
+        '',
+        Validators.required
+      ],
+      text: [
+        '',
+        Validators.required
+      ],
+      description: [''],
+      responseDatas: this.formBuilder.array([this.createResponseForm()]),
+      sequenceNo: ['']
     });
   }
 
@@ -111,9 +133,17 @@ export class CreateSurveyComponent implements OnInit {
    */
   createResponseForm(): UntypedFormGroup {
     return this.formBuilder.group({
-      'text': ['', Validators.required],
-      'value': ['', [Validators.required, Validators.pattern('^\\s*[-]?\\d{0,4}\\s*$')]],
-      'sequenceNo': ['']
+      text: [
+        '',
+        Validators.required
+      ],
+      value: [
+        '',
+        [
+          Validators.required,
+          Validators.pattern('^\\s*[-]?\\d{0,4}\\s*$')]
+      ],
+      sequenceNo: ['']
     });
   }
 
@@ -141,9 +171,15 @@ export class CreateSurveyComponent implements OnInit {
    */
   updateSequenceNumber() {
     for (let questionIndex = 0; questionIndex < this.questionDatas.length; questionIndex++) {
-      this.questionDatas.at(questionIndex).get('sequenceNo').setValue(questionIndex + 1);
+      this.questionDatas
+        .at(questionIndex)
+        .get('sequenceNo')
+        .setValue(questionIndex + 1);
       for (let responseIndex = 0; responseIndex < this.getResponseDatas(questionIndex).length; responseIndex++) {
-        this.getResponseDatas(questionIndex).at(responseIndex).get('sequenceNo').setValue(responseIndex + 1);
+        this.getResponseDatas(questionIndex)
+          .at(responseIndex)
+          .get('sequenceNo')
+          .setValue(responseIndex + 1);
       }
     }
   }
@@ -188,5 +224,4 @@ export class CreateSurveyComponent implements OnInit {
       this.router.navigate(['../'], { relativeTo: this.route });
     });
   }
-
 }
diff --git a/src/app/system/manage-surveys/edit-survey/edit-survey.component.spec.ts b/src/app/system/manage-surveys/edit-survey/edit-survey.component.spec.ts
index 5330e1414..20f95a617 100644
--- a/src/app/system/manage-surveys/edit-survey/edit-survey.component.spec.ts
+++ b/src/app/system/manage-surveys/edit-survey/edit-survey.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditSurveyComponent', () => {
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      declarations: [ EditSurveyComponent ]
-    })
-    .compileComponents();
+      declarations: [EditSurveyComponent]
+    }).compileComponents();
   });
 
   beforeEach(() => {
diff --git a/src/app/system/manage-surveys/edit-survey/edit-survey.component.ts b/src/app/system/manage-surveys/edit-survey/edit-survey.component.ts
index ca6a7fdfc..6b8a7e3eb 100644
--- a/src/app/system/manage-surveys/edit-survey/edit-survey.component.ts
+++ b/src/app/system/manage-surveys/edit-survey/edit-survey.component.ts
@@ -23,7 +23,6 @@ import { Survey, QuestionData, ResponseData } from './../survey.model';
   styleUrls: ['./edit-survey.component.scss']
 })
 export class EditSurveyComponent {
-
   /** Survey form. */
   surveyForm: UntypedFormGroup;
 
@@ -34,27 +33,29 @@ export class EditSurveyComponent {
    * @param {Router} router Router for navigation.
    * @param {MatDialog} dialog Dialog reference.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private route: ActivatedRoute,
-              private router: Router,
-              public dialog: MatDialog) {
-                this.createSurveyForm();
-                this.route.data.subscribe((data: { survey: any }) => {
-                  this.prepareSurveyForm(data.survey);
-                });
-              }
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private route: ActivatedRoute,
+    private router: Router,
+    public dialog: MatDialog
+  ) {
+    this.createSurveyForm();
+    this.route.data.subscribe((data: { survey: any }) => {
+      this.prepareSurveyForm(data.survey);
+    });
+  }
 
   /**
    * Takes an object of type Survey
    * and prepares the survey form.
    */
   prepareSurveyForm(survey: Survey) {
-      this.surveyForm.get('key').setValue(survey.key);
-      this.surveyForm.get('name').setValue(survey.name);
-      this.surveyForm.get('countryCode').setValue(survey.countryCode);
-      this.surveyForm.get('description').setValue(survey.description);
-      this.prepareQuestionDatas(this.questionDatas, survey.questionDatas);
+    this.surveyForm.get('key').setValue(survey.key);
+    this.surveyForm.get('name').setValue(survey.name);
+    this.surveyForm.get('countryCode').setValue(survey.countryCode);
+    this.surveyForm.get('description').setValue(survey.description);
+    this.prepareQuestionDatas(this.questionDatas, survey.questionDatas);
   }
 
   /**
@@ -68,7 +69,7 @@ export class EditSurveyComponent {
       questionForm.get('text').setValue(questionData.text);
       questionForm.get('description').setValue(questionData.description);
       // questionForm.get('responseDatas').setValue([]);
-      this.prepareResponseDatas((questionForm.get('responseDatas')), questionData.responseDatas, idx);
+      this.prepareResponseDatas(questionForm.get('responseDatas'), questionData.responseDatas, idx);
     });
   }
 
@@ -92,11 +93,22 @@ export class EditSurveyComponent {
    */
   createSurveyForm() {
     this.surveyForm = this.formBuilder.group({
-      'key': ['', Validators.required],
-      'name': ['', Validators.required],
-      'countryCode': ['', [Validators.required, Validators.pattern('^\\s*([A-Za-z]{2})?\\s*$')]],
-      'description': [''],
-      'questionDatas': this.formBuilder.array([])
+      key: [
+        '',
+        Validators.required
+      ],
+      name: [
+        '',
+        Validators.required
+      ],
+      countryCode: [
+        '',
+        [
+          Validators.required,
+          Validators.pattern('^\\s*([A-Za-z]{2})?\\s*$')]
+      ],
+      description: [''],
+      questionDatas: this.formBuilder.array([])
     });
   }
 
@@ -114,7 +126,11 @@ export class EditSurveyComponent {
    * @returns {FormArray} Responses form array.
    */
   getResponseDatas(questionIndex: number): UntypedFormArray {
-    return this.surveyForm.get(['questionDatas', questionIndex, 'responseDatas']) as UntypedFormArray;
+    return this.surveyForm.get([
+      'questionDatas',
+      questionIndex,
+      'responseDatas'
+    ]) as UntypedFormArray;
   }
 
   /**
@@ -123,11 +139,17 @@ export class EditSurveyComponent {
    */
   createQuestionForm(): UntypedFormGroup {
     return this.formBuilder.group({
-      'key': ['', Validators.required],
-      'text': ['', Validators.required],
-      'description': [''],
-      'responseDatas': this.formBuilder.array([this.createResponseForm()]),
-      'sequenceNo': ['']
+      key: [
+        '',
+        Validators.required
+      ],
+      text: [
+        '',
+        Validators.required
+      ],
+      description: [''],
+      responseDatas: this.formBuilder.array([this.createResponseForm()]),
+      sequenceNo: ['']
     });
   }
 
@@ -154,9 +176,17 @@ export class EditSurveyComponent {
    */
   createResponseForm(): UntypedFormGroup {
     return this.formBuilder.group({
-      'text': ['', Validators.required],
-      'value': ['', [Validators.required, Validators.pattern('^\\s*[-]?\\d{0,4}\\s*$')]],
-      'sequenceNo': ['']
+      text: [
+        '',
+        Validators.required
+      ],
+      value: [
+        '',
+        [
+          Validators.required,
+          Validators.pattern('^\\s*[-]?\\d{0,4}\\s*$')]
+      ],
+      sequenceNo: ['']
     });
   }
 
@@ -184,9 +214,15 @@ export class EditSurveyComponent {
    */
   updateSequenceNumber() {
     for (let questionIndex = 0; questionIndex < this.questionDatas.length; questionIndex++) {
-      this.questionDatas.at(questionIndex).get('sequenceNo').setValue(questionIndex + 1);
+      this.questionDatas
+        .at(questionIndex)
+        .get('sequenceNo')
+        .setValue(questionIndex + 1);
       for (let responseIndex = 0; responseIndex < this.getResponseDatas(questionIndex).length; responseIndex++) {
-        this.getResponseDatas(questionIndex).at(responseIndex).get('sequenceNo').setValue(responseIndex + 1);
+        this.getResponseDatas(questionIndex)
+          .at(responseIndex)
+          .get('sequenceNo')
+          .setValue(responseIndex + 1);
       }
     }
   }
@@ -227,9 +263,10 @@ export class EditSurveyComponent {
     this.surveyForm.patchValue({
       countryCode: this.surveyForm.value.countryCode.toUpperCase()
     });
-    this.systemService.editSurvey(this.route.snapshot.paramMap.get('id'), this.surveyForm.value).subscribe((response: any) => {
-      this.router.navigate(['../'], { relativeTo: this.route });
-    });
+    this.systemService
+      .editSurvey(this.route.snapshot.paramMap.get('id'), this.surveyForm.value)
+      .subscribe((response: any) => {
+        this.router.navigate(['../'], { relativeTo: this.route });
+      });
   }
-
 }
diff --git a/src/app/system/manage-surveys/manage-surveys.component.spec.ts b/src/app/system/manage-surveys/manage-surveys.component.spec.ts
index 5385671fe..7f6d7be01 100644
--- a/src/app/system/manage-surveys/manage-surveys.component.spec.ts
+++ b/src/app/system/manage-surveys/manage-surveys.component.spec.ts
@@ -8,9 +8,8 @@ describe('SurveysComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ManageSurveysComponent ]
-    })
-    .compileComponents();
+      declarations: [ManageSurveysComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-surveys/manage-surveys.component.ts b/src/app/system/manage-surveys/manage-surveys.component.ts
index 962caac78..fde976464 100644
--- a/src/app/system/manage-surveys/manage-surveys.component.ts
+++ b/src/app/system/manage-surveys/manage-surveys.component.ts
@@ -14,14 +14,20 @@ import { SystemService } from '../system.service';
 @Component({
   selector: 'mifosx-manage-surveys',
   templateUrl: './manage-surveys.component.html',
-  styleUrls: ['./manage-surveys.component.scss'],
+  styleUrls: ['./manage-surveys.component.scss']
 })
 export class ManageSurveysComponent implements OnInit {
-
   /* Surveys data */
   surveysData: any;
   /* Columns to be displayed in manage surveys data table */
-  displayedColumns: string[] = ['key', 'name', 'description', 'countryCode', 'status', 'action'];
+  displayedColumns: string[] = [
+    'key',
+    'name',
+    'description',
+    'countryCode',
+    'status',
+    'action'
+  ];
   /* Data source for manage surveys data table */
   dataSource: MatTableDataSource;
 
@@ -36,9 +42,9 @@ export class ManageSurveysComponent implements OnInit {
    */
   constructor(
     private route: ActivatedRoute,
-    private systemService: SystemService,
+    private systemService: SystemService
   ) {
-    this.route.data.subscribe(( data: { surveys: any }) => {
+    this.route.data.subscribe((data: { surveys: any }) => {
       this.surveysData = data.surveys;
     });
   }
@@ -50,7 +56,7 @@ export class ManageSurveysComponent implements OnInit {
    */
   isActive(validFrom: string, validTo: string) {
     const curdate = new Date().toISOString().split('T')[0];
-    return (curdate >= validFrom && curdate <= validTo);
+    return curdate >= validFrom && curdate <= validTo;
   }
 
   /**
@@ -60,9 +66,12 @@ export class ManageSurveysComponent implements OnInit {
     this.setSurveys();
     this.dataSource.sortingDataAccessor = (item, property) => {
       switch (property) {
-        case 'status': return this.isActive(item.validFrom, item.validTo);
-        case 'action': return this.isActive(item.validFrom, item.validTo);
-        default: return item[property];
+        case 'status':
+          return this.isActive(item.validFrom, item.validTo);
+        case 'action':
+          return this.isActive(item.validFrom, item.validTo);
+        default:
+          return item[property];
       }
     };
   }
@@ -110,5 +119,4 @@ export class ManageSurveysComponent implements OnInit {
       survey.validTo = yesterday;
     });
   }
-
 }
diff --git a/src/app/system/manage-surveys/manage-surveys.resolver.ts b/src/app/system/manage-surveys/manage-surveys.resolver.ts
index b41e45946..5cf249be8 100644
--- a/src/app/system/manage-surveys/manage-surveys.resolver.ts
+++ b/src/app/system/manage-surveys/manage-surveys.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class ManageSurveysResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class ManageSurveysResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getSurveys();
   }
-
 }
diff --git a/src/app/system/manage-surveys/survey.model.ts b/src/app/system/manage-surveys/survey.model.ts
index daba3104d..b8413bbeb 100644
--- a/src/app/system/manage-surveys/survey.model.ts
+++ b/src/app/system/manage-surveys/survey.model.ts
@@ -1,24 +1,24 @@
 export class Survey {
-    id: number;
-    key: string;
-    name: string;
-    countryCode: string;
-    description: string;
-    questionDatas: Array;
+  id: number;
+  key: string;
+  name: string;
+  countryCode: string;
+  description: string;
+  questionDatas: Array;
 }
 
 export class QuestionData {
-    id: number;
-    key: string;
-    sequenceNo: number;
-    text: string;
-    description: string;
-    responseDatas: Array;
+  id: number;
+  key: string;
+  sequenceNo: number;
+  text: string;
+  description: string;
+  responseDatas: Array;
 }
 
 export class ResponseData {
-    id: number;
-    sequenceNo: number;
-    text: string;
-    value: number;
+  id: number;
+  sequenceNo: number;
+  text: string;
+  value: number;
 }
diff --git a/src/app/system/manage-surveys/survey.resolver.ts b/src/app/system/manage-surveys/survey.resolver.ts
index 7b5909e1c..51c4d4686 100644
--- a/src/app/system/manage-surveys/survey.resolver.ts
+++ b/src/app/system/manage-surveys/survey.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class SurveyResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -27,5 +26,4 @@ export class SurveyResolver implements Resolve {
     const surveyId = route.paramMap.get('id');
     return this.systemService.getSurvey(surveyId);
   }
-
 }
diff --git a/src/app/system/manage-surveys/view-survey/view-survey.component.spec.ts b/src/app/system/manage-surveys/view-survey/view-survey.component.spec.ts
index efd6b8094..45d04a068 100644
--- a/src/app/system/manage-surveys/view-survey/view-survey.component.spec.ts
+++ b/src/app/system/manage-surveys/view-survey/view-survey.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewSurveyComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewSurveyComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewSurveyComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/manage-surveys/view-survey/view-survey.component.ts b/src/app/system/manage-surveys/view-survey/view-survey.component.ts
index 39bc51762..9bcfd4089 100644
--- a/src/app/system/manage-surveys/view-survey/view-survey.component.ts
+++ b/src/app/system/manage-surveys/view-survey/view-survey.component.ts
@@ -15,12 +15,14 @@ import { SystemService } from 'app/system/system.service';
   styleUrls: ['./view-survey.component.scss']
 })
 export class ViewSurveyComponent {
-
   /** Survey Data */
   surveyData: any;
 
   /** Columns shown in individual survey table */
-  displayedColumns: string[] = [ 'text', 'value'];
+  displayedColumns: string[] = [
+    'text',
+    'value'
+  ];
 
   /**
    * Retrieves the survey data from `resolve`.
@@ -29,10 +31,12 @@ export class ViewSurveyComponent {
    * @param {MatDialog} dialog Dialog Reference.
    * @param {Router} router Router for navigation.
    */
-  constructor(private route: ActivatedRoute,
-              private systemService: SystemService,
-              private dialog: MatDialog,
-              private router: Router) {
+  constructor(
+    private route: ActivatedRoute,
+    private systemService: SystemService,
+    private dialog: MatDialog,
+    private router: Router
+  ) {
     this.route.data.subscribe((data: { survey: any }) => {
       this.surveyData = data.survey;
     });
diff --git a/src/app/system/roles-and-permissions/add-role/add-role.component.spec.ts b/src/app/system/roles-and-permissions/add-role/add-role.component.spec.ts
index 3efbbf4bf..c57d273e2 100644
--- a/src/app/system/roles-and-permissions/add-role/add-role.component.spec.ts
+++ b/src/app/system/roles-and-permissions/add-role/add-role.component.spec.ts
@@ -8,9 +8,8 @@ describe('AddRoleComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ AddRoleComponent ]
-    })
-    .compileComponents();
+      declarations: [AddRoleComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/roles-and-permissions/add-role/add-role.component.ts b/src/app/system/roles-and-permissions/add-role/add-role.component.ts
index c4ecf23f5..d1cfedf81 100644
--- a/src/app/system/roles-and-permissions/add-role/add-role.component.ts
+++ b/src/app/system/roles-and-permissions/add-role/add-role.component.ts
@@ -15,7 +15,6 @@ import { SystemService } from '../../system.service';
   styleUrls: ['./add-role.component.scss']
 })
 export class AddRoleComponent implements OnInit {
-
   /** Role form. */
   roleForm: UntypedFormGroup;
 
@@ -25,10 +24,12 @@ export class AddRoleComponent implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    * @param {Router} router Router for navigation.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private systemService: SystemService,
-              private route: ActivatedRoute,
-              private router: Router) { }
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private systemService: SystemService,
+    private route: ActivatedRoute,
+    private router: Router
+  ) {}
 
   /**
    * Creates the role form.
@@ -42,8 +43,14 @@ export class AddRoleComponent implements OnInit {
    */
   createRoleForm() {
     this.roleForm = this.formBuilder.group({
-      'name': ['', Validators.required],
-      'description': ['', Validators.required]
+      name: [
+        '',
+        Validators.required
+      ],
+      description: [
+        '',
+        Validators.required
+      ]
     });
   }
 
@@ -52,10 +59,8 @@ export class AddRoleComponent implements OnInit {
    * if successful redirects back to roles and permission.
    */
   submit() {
-    this.systemService.createRole(this.roleForm.value)
-      .subscribe((response: any) => {
-        this.router.navigate(['../'], { relativeTo: this.route });
+    this.systemService.createRole(this.roleForm.value).subscribe((response: any) => {
+      this.router.navigate(['../'], { relativeTo: this.route });
     });
   }
-
 }
diff --git a/src/app/system/roles-and-permissions/edit-role/edit-role.component.spec.ts b/src/app/system/roles-and-permissions/edit-role/edit-role.component.spec.ts
index 128057ce0..875727426 100644
--- a/src/app/system/roles-and-permissions/edit-role/edit-role.component.spec.ts
+++ b/src/app/system/roles-and-permissions/edit-role/edit-role.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditRoleComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditRoleComponent ]
-    })
-    .compileComponents();
+      declarations: [EditRoleComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/roles-and-permissions/edit-role/edit-role.component.ts b/src/app/system/roles-and-permissions/edit-role/edit-role.component.ts
index 51dc96839..8b554485e 100644
--- a/src/app/system/roles-and-permissions/edit-role/edit-role.component.ts
+++ b/src/app/system/roles-and-permissions/edit-role/edit-role.component.ts
@@ -12,7 +12,7 @@ import { SystemService } from '../../system.service';
 @Component({
   selector: 'mifosx-edit-role',
   templateUrl: './edit-role.component.html',
-  styleUrls: ['./edit-role.component.scss'],
+  styleUrls: ['./edit-role.component.scss']
 })
 export class EditRoleComponent implements OnInit {
   /** Role Form */
@@ -50,8 +50,14 @@ export class EditRoleComponent implements OnInit {
    */
   createRoleForm() {
     this.roleForm = this.formBuilder.group({
-      name: [{ value: this.roleData.name, disabled: true }, Validators.required],
-      description: [this.roleData.description, Validators.required],
+      name: [
+        { value: this.roleData.name, disabled: true },
+        Validators.required
+      ],
+      description: [
+        this.roleData.description,
+        Validators.required
+      ]
     });
   }
 
diff --git a/src/app/system/roles-and-permissions/roles-and-permissions.component.spec.ts b/src/app/system/roles-and-permissions/roles-and-permissions.component.spec.ts
index 7354825f2..f446cde92 100644
--- a/src/app/system/roles-and-permissions/roles-and-permissions.component.spec.ts
+++ b/src/app/system/roles-and-permissions/roles-and-permissions.component.spec.ts
@@ -8,9 +8,8 @@ describe('RolesAndPermissionsComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ RolesAndPermissionsComponent ]
-    })
-    .compileComponents();
+      declarations: [RolesAndPermissionsComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/roles-and-permissions/roles-and-permissions.component.ts b/src/app/system/roles-and-permissions/roles-and-permissions.component.ts
index 0c7aea3a0..1e697ceb3 100644
--- a/src/app/system/roles-and-permissions/roles-and-permissions.component.ts
+++ b/src/app/system/roles-and-permissions/roles-and-permissions.component.ts
@@ -21,11 +21,15 @@ import { ConfigurationWizardService } from '../../configuration-wizard/configura
   styleUrls: ['./roles-and-permissions.component.scss']
 })
 export class RolesAndPermissionsComponent implements OnInit, AfterViewInit {
-
   /** Role data. */
   roleData: any;
   /** Columns to be displayed in roles and permissions table. */
-  displayedColumns: string[] = ['name', 'description', 'disabled', 'actions'];
+  displayedColumns: string[] = [
+    'name',
+    'description',
+    'disabled',
+    'actions'
+  ];
   /** Data source for roles and permissions table. */
   dataSource: MatTableDataSource;
 
@@ -49,11 +53,13 @@ export class RolesAndPermissionsComponent implements OnInit, AfterViewInit {
    * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
    * @param {PopoverService} popoverService PopoverService.
    */
-  constructor(private route: ActivatedRoute,
-              private router: Router,
-              private configurationWizardService: ConfigurationWizardService,
-              private popoverService: PopoverService) {
-    this.route.data.subscribe(( data: { roles: any }) => {
+  constructor(
+    private route: ActivatedRoute,
+    private router: Router,
+    private configurationWizardService: ConfigurationWizardService,
+    private popoverService: PopoverService
+  ) {
+    this.route.data.subscribe((data: { roles: any }) => {
       this.roleData = data.roles;
     });
   }
@@ -97,7 +103,12 @@ export class RolesAndPermissionsComponent implements OnInit, AfterViewInit {
    * @param position String.
    * @param backdrop Boolean.
    */
-  showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+  showPopover(
+    template: TemplateRef,
+    target: HTMLElement | ElementRef,
+    position: string,
+    backdrop: boolean
+  ): void {
     setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
   }
 
@@ -112,7 +123,12 @@ export class RolesAndPermissionsComponent implements OnInit, AfterViewInit {
     }
     if (this.configurationWizardService.showRolesandPermissionList === true) {
       setTimeout(() => {
-        this.showPopover(this.templateTableRolesandPermissions, this.tableRolesandPermissions.nativeElement, 'top', true);
+        this.showPopover(
+          this.templateTableRolesandPermissions,
+          this.tableRolesandPermissions.nativeElement,
+          'top',
+          true
+        );
       });
     }
   }
@@ -136,5 +152,4 @@ export class RolesAndPermissionsComponent implements OnInit, AfterViewInit {
     this.configurationWizardService.showRolesandPermission = true;
     this.router.navigate(['/system']);
   }
-
 }
diff --git a/src/app/system/roles-and-permissions/roles-and-permissions.resolver.ts b/src/app/system/roles-and-permissions/roles-and-permissions.resolver.ts
index 50895d799..7c28677de 100644
--- a/src/app/system/roles-and-permissions/roles-and-permissions.resolver.ts
+++ b/src/app/system/roles-and-permissions/roles-and-permissions.resolver.ts
@@ -13,7 +13,6 @@ import { SystemService } from '../system.service';
  */
 @Injectable()
 export class RolesAndPermissionsResolver implements Resolve {
-
   /**
    * @param {SystemService} systemService System service.
    */
@@ -26,5 +25,4 @@ export class RolesAndPermissionsResolver implements Resolve {
   resolve(): Observable {
     return this.systemService.getRoles();
   }
-
 }
diff --git a/src/app/system/roles-and-permissions/view-role/view-role.component.spec.ts b/src/app/system/roles-and-permissions/view-role/view-role.component.spec.ts
index 2f2fca0e2..1de48c5af 100644
--- a/src/app/system/roles-and-permissions/view-role/view-role.component.spec.ts
+++ b/src/app/system/roles-and-permissions/view-role/view-role.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewRoleComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewRoleComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewRoleComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/roles-and-permissions/view-role/view-role.component.ts b/src/app/system/roles-and-permissions/view-role/view-role.component.ts
index b332b344d..98c5b209f 100644
--- a/src/app/system/roles-and-permissions/view-role/view-role.component.ts
+++ b/src/app/system/roles-and-permissions/view-role/view-role.component.ts
@@ -21,7 +21,6 @@ import { EnableDialogComponent } from '../../../shared/enable-dialog/enable-dial
   styleUrls: ['./view-role.component.scss']
 })
 export class ViewRoleComponent implements OnInit {
-
   /** Role Permissions Data */
   rolePermissionService: any;
   /** Stores the current grouping */
@@ -46,11 +45,11 @@ export class ViewRoleComponent implements OnInit {
   backupform: UntypedFormGroup;
   /** Temporarily stores Permission data */
   tempPermissionUIData: {
-    permissions: { code: string }[]
+    permissions: { code: string }[];
   }[];
   /** Stores permissions */
   permissions: {
-    permissions: { code: string, id: number }[]
+    permissions: { code: string; id: number }[];
   };
 
   /**
@@ -62,12 +61,14 @@ export class ViewRoleComponent implements OnInit {
    * @param {MatDialog} dialog Shared Dialog Boxes.
    * @param {TranslateService} translateService Translate Service.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private systemService: SystemService,
     private router: Router,
     private formBuilder: UntypedFormBuilder,
     private translateService: TranslateService,
-    public dialog: MatDialog) {
+    public dialog: MatDialog
+  ) {
     this.route.data.subscribe((data: { roledetails: any }) => {
       this.rolePermissionService = data.roledetails;
     });
@@ -94,17 +95,24 @@ export class ViewRoleComponent implements OnInit {
    */
   createForm() {
     this.formGroup = this.formBuilder.group({
-      roster: this.formBuilder.array(this.rolePermissionService.permissionUsageData.map((elem: any) => this.createMemberGroup(elem)))
+      roster: this.formBuilder.array(
+        this.rolePermissionService.permissionUsageData.map((elem: any) => this.createMemberGroup(elem))
+      )
     });
-
   }
 
   createMemberGroup(permission: any): UntypedFormGroup {
     return this.formBuilder.group({
       ...permission,
       ...{
-        code: [permission.code, Validators.required],
-        selected: [{ value: permission.selected, disabled: true }, Validators.required]
+        code: [
+          permission.code,
+          Validators.required
+        ],
+        selected: [
+          { value: permission.selected, disabled: true },
+          Validators.required
+        ]
       }
     });
   }
@@ -113,9 +121,11 @@ export class ViewRoleComponent implements OnInit {
    * Groups the permissions based on rules
    */
   groupRules() {
-    this.tempPermissionUIData = [{
-      permissions: []
-    }];
+    this.tempPermissionUIData = [
+      {
+        permissions: []
+      }
+    ];
     for (const i in this.rolePermissionService.permissionUsageData) {
       if (this.rolePermissionService.permissionUsageData[i]) {
         if (this.rolePermissionService.permissionUsageData[i].grouping !== this.currentGrouping) {
@@ -123,7 +133,11 @@ export class ViewRoleComponent implements OnInit {
           this.groupings.push(this.currentGrouping);
           this.tempPermissionUIData[this.currentGrouping] = { permissions: [] };
         }
-        const temp = { code: this.rolePermissionService.permissionUsageData[i].code, id: i, selected: this.rolePermissionService.permissionUsageData[i].selected };
+        const temp = {
+          code: this.rolePermissionService.permissionUsageData[i].code,
+          id: i,
+          selected: this.rolePermissionService.permissionUsageData[i].selected
+        };
         this.tempPermissionUIData[this.currentGrouping].permissions.push(temp);
       }
     }
@@ -210,7 +224,7 @@ export class ViewRoleComponent implements OnInit {
     const permissionData = {
       permissions: {}
     };
-    for (let i = 0; i < value.length; i++ ) {
+    for (let i = 0; i < value.length; i++) {
       data[value[i].code] = value[i].selected;
     }
     permissionData.permissions = data;
@@ -253,12 +267,10 @@ export class ViewRoleComponent implements OnInit {
     });
     deleteRoleDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
-        this.systemService.deleteRole(this.roleId)
-          .subscribe(() => {
-            this.router.navigate(['/system/roles-and-permissions']);
-          });
+        this.systemService.deleteRole(this.roleId).subscribe(() => {
+          this.router.navigate(['/system/roles-and-permissions']);
+        });
       } else {
-
       }
     });
   }
@@ -272,12 +284,10 @@ export class ViewRoleComponent implements OnInit {
     });
     enableRoleDialogRef.afterClosed().subscribe((response: any) => {
       if (response.enable) {
-        this.systemService.enableRole(this.roleId)
-          .subscribe(() => {
-            this.router.navigate(['/system/roles-and-permissions']);
-          });
+        this.systemService.enableRole(this.roleId).subscribe(() => {
+          this.router.navigate(['/system/roles-and-permissions']);
+        });
       } else {
-
       }
     });
   }
@@ -291,14 +301,11 @@ export class ViewRoleComponent implements OnInit {
     });
     deleteRoleDialogRef.afterClosed().subscribe((response: any) => {
       if (response.disable) {
-        this.systemService.disableRole(this.roleId)
-          .subscribe(() => {
-            this.router.navigate(['/system/roles-and-permissions']);
-          });
+        this.systemService.disableRole(this.roleId).subscribe(() => {
+          this.router.navigate(['/system/roles-and-permissions']);
+        });
       } else {
-
       }
     });
   }
-
 }
diff --git a/src/app/system/roles-and-permissions/view-role/view-role.resolver.ts b/src/app/system/roles-and-permissions/view-role/view-role.resolver.ts
index 412a6a28b..961240fae 100644
--- a/src/app/system/roles-and-permissions/view-role/view-role.resolver.ts
+++ b/src/app/system/roles-and-permissions/view-role/view-role.resolver.ts
@@ -13,19 +13,17 @@ import { SystemService } from '../../system.service';
  */
 @Injectable()
 export class ViewRoleResolver implements Resolve {
+  /**
+   * @param {SystemService} systemService System service.
+   */
+  constructor(private systemService: SystemService) {}
 
-    /**
-     * @param {SystemService} systemService System service.
-     */
-    constructor(private systemService: SystemService) { }
-
-    /**
-     * Returns the roles and permissions data.
-     * @returns {Observable}
-     */
-    resolve(route: ActivatedRouteSnapshot): Observable {
-        const id = route.paramMap.get('id');
-        return this.systemService.getRole(id);
-    }
-
+  /**
+   * Returns the roles and permissions data.
+   * @returns {Observable}
+   */
+  resolve(route: ActivatedRouteSnapshot): Observable {
+    const id = route.paramMap.get('id');
+    return this.systemService.getRole(id);
+  }
 }
diff --git a/src/app/system/system-routing.module.ts b/src/app/system/system-routing.module.ts
index 8329f56fb..209a7f7c5 100644
--- a/src/app/system/system-routing.module.ts
+++ b/src/app/system/system-routing.module.ts
@@ -137,7 +137,7 @@ const routes: Routes = [
                 }
               ]
             }
-          ],
+          ]
         },
         {
           path: 'external-events',
@@ -149,7 +149,7 @@ const routes: Routes = [
               resolve: {
                 events: ManageExternalEventsResolver
               }
-            },
+            }
           ]
         },
         {
@@ -263,7 +263,7 @@ const routes: Routes = [
               component: ManageDataTablesComponent,
               resolve: {
                 dataTables: ManageDataTablesResolver
-              },
+              }
             },
             {
               path: 'create',
@@ -295,7 +295,7 @@ const routes: Routes = [
                 }
               ]
             }
-          ],
+          ]
         },
         {
           path: 'hooks',
@@ -365,7 +365,7 @@ const routes: Routes = [
                   path: '',
                   component: ViewRoleComponent,
                   resolve: {
-                    roledetails: ViewRoleResolver,
+                    roledetails: ViewRoleResolver
                   }
                 },
                 {
@@ -373,7 +373,7 @@ const routes: Routes = [
                   component: EditRoleComponent,
                   data: { title: 'Edit Role', breadcrumb: 'Edit', routeParamBreadcrumb: false },
                   resolve: {
-                    role: ViewRoleResolver,
+                    role: ViewRoleResolver
                   }
                 }
               ]
@@ -402,7 +402,7 @@ const routes: Routes = [
             {
               path: 'create',
               component: CreateSurveyComponent,
-              data: { title: 'Create Survey', breadcrumb: 'Create' },
+              data: { title: 'Create Survey', breadcrumb: 'Create' }
             },
             {
               path: ':id',
@@ -434,7 +434,7 @@ const routes: Routes = [
             {
               path: '',
               component: ManageJobsComponent,
-              resolve: {},
+              resolve: {}
             },
             {
               path: ':id',
@@ -461,11 +461,11 @@ const routes: Routes = [
                   data: { title: 'Scheduler Job History', breadcrumb: 'View History' },
                   resolve: {
                     jobsSchedulerHistory: ViewHistorySchedulerJobsResolver
-                  },
+                  }
                 }
               ]
             }
-          ],
+          ]
         },
         {
           path: 'configurations',
@@ -598,6 +598,7 @@ const routes: Routes = [
       ]
     }
   ])
+
 ];
 
 @NgModule({
@@ -637,4 +638,4 @@ const routes: Routes = [
     ViewHistorySchedulerJobsResolver
   ]
 })
-export class SystemRoutingModule { }
+export class SystemRoutingModule {}
diff --git a/src/app/system/system.component.spec.ts b/src/app/system/system.component.spec.ts
index aade39394..b38887797 100644
--- a/src/app/system/system.component.spec.ts
+++ b/src/app/system/system.component.spec.ts
@@ -8,9 +8,8 @@ describe('SystemComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ SystemComponent ]
-    })
-    .compileComponents();
+      declarations: [SystemComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/system/system.component.ts b/src/app/system/system.component.ts
index a7d6b2b0c..13925c1fc 100644
--- a/src/app/system/system.component.ts
+++ b/src/app/system/system.component.ts
@@ -12,7 +12,6 @@ import { PopoverService } from '../configuration-wizard/popover/popover.service'
   styleUrls: ['./system.component.scss']
 })
 export class SystemComponent implements AfterViewInit {
-
   /* Reference of manage datatables */
   @ViewChild('datatables') datatables: ElementRef;
   /* Template for popover on manage datables */
@@ -49,9 +48,11 @@ export class SystemComponent implements AfterViewInit {
    * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
    * @param {PopoverService} popoverService PopoverService.
    */
-  constructor(private router: Router,
-              private configurationWizardService: ConfigurationWizardService,
-              private popoverService: PopoverService) { }
+  constructor(
+    private router: Router,
+    private configurationWizardService: ConfigurationWizardService,
+    private popoverService: PopoverService
+  ) {}
 
   /**
    * Popover function
@@ -61,7 +62,12 @@ export class SystemComponent implements AfterViewInit {
    * @param backdrop Boolean.
    * @param arrowNumber - The index of the boolean value to toggle.
    */
-  showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+  showPopover(
+    template: TemplateRef,
+    target: HTMLElement | ElementRef,
+    position: string,
+    backdrop: boolean
+  ): void {
     setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
   }
 
@@ -129,7 +135,7 @@ export class SystemComponent implements AfterViewInit {
    */
   nextStepCodes() {
     this.configurationWizardService.showSystemCodes = false;
-    this.configurationWizardService.showSystemCodesPage  = true;
+    this.configurationWizardService.showSystemCodesPage = true;
     this.router.navigate(['/system/codes']);
   }
 
@@ -230,7 +236,7 @@ export class SystemComponent implements AfterViewInit {
     this.router.navigate(['/organization/manage-funds']);
   }
 
-  arrowBooleansToggle(arrowNumber:  number) {
+  arrowBooleansToggle(arrowNumber: number) {
     // Toggle the boolean value at the given index
     this.arrowBooleans[arrowNumber] = !this.arrowBooleans[arrowNumber];
   }
diff --git a/src/app/system/system.module.ts b/src/app/system/system.module.ts
index 3c618c52d..ee172b2d7 100644
--- a/src/app/system/system.module.ts
+++ b/src/app/system/system.module.ts
@@ -154,6 +154,6 @@ import { RunSelectedJobsTableComponent } from './manage-jobs/scheduler-jobs/run-
     ErrorLogPopoverComponent,
     RunSelectedJobsPopoverComponent,
     RunSelectedJobsTableComponent
-  ],
+  ]
 })
-export class SystemModule { }
+export class SystemModule {}
diff --git a/src/app/system/system.service.ts b/src/app/system/system.service.ts
index 9191c24a1..48e01bda0 100644
--- a/src/app/system/system.service.ts
+++ b/src/app/system/system.service.ts
@@ -18,7 +18,7 @@ export class SystemService {
   /**
    * @param {HttpClient} http Http Client to send requests.
    */
-  constructor(private http: HttpClient) { }
+  constructor(private http: HttpClient) {}
 
   /**
    * @returns {Observable} Data tables.
@@ -128,7 +128,7 @@ export class SystemService {
    */
   enableRole(roleId: string): Observable {
     const httpParams = new HttpParams().set('command', 'enable');
-    return this.http.post(`/roles/${roleId}`, {} , { params: httpParams });
+    return this.http.post(`/roles/${roleId}`, {}, { params: httpParams });
   }
 
   /**
@@ -258,7 +258,6 @@ export class SystemService {
     return this.http.post(`/surveys/${surveyId}?command=deactivate`, null);
   }
 
-
   /**
    * @returns {Observable} Fetches Jobs.
    */
@@ -330,7 +329,7 @@ export class SystemService {
    * @param {any} Job Job to be updated.
    * @returns {Observable}
    */
-   updateScheduler(jobId: string, job: any): Observable {
+  updateScheduler(jobId: string, job: any): Observable {
     return this.http.put(`/jobs/${jobId}`, job);
   }
 
@@ -338,7 +337,7 @@ export class SystemService {
    * @param {string} jobId Job Id on which jobs to run
    * @returns {Observable}
    */
-   runSelectedJob(jobId: string): Promise {
+  runSelectedJob(jobId: string): Promise {
     return this.http.post(`/jobs/${jobId}?command=executeJob`, this.emptyPayload, { observe: 'response' }).toPromise();
   }
 
@@ -409,7 +408,7 @@ export class SystemService {
   /**
    * @returns {Observable} Business Date data using a type BUSINESS_DATE / COB_DATE.
    */
-   getBusinessDate(dateType: string): Observable {
+  getBusinessDate(dateType: string): Observable {
     return this.http.get(`/businessdate/${dateType}`);
   }
 
@@ -417,7 +416,7 @@ export class SystemService {
    * @param {any} dateData Business Date data to be updated.
    * @returns {Observable}
    */
-   updateBusinessDate(dateData: any): Observable {
+  updateBusinessDate(dateData: any): Observable {
     return this.http.post(`/businessdate`, dateData);
   }
 
@@ -440,7 +439,7 @@ export class SystemService {
    * @param {string} configurationId Configuration ID of configuration.
    * @returns {Observable} Configuration.
    */
-   getConfigurationByName(configurationName: string): Observable {
+  getConfigurationByName(configurationName: string): Observable {
     return this.http.get(`/configurations/name/${configurationName}`);
   }
 
@@ -513,7 +512,10 @@ export class SystemService {
    * @param {any} accountNumberPreferenceChanges Changes in Account Number Preference.
    * @returns {Observable}
    */
-  updateAccountNumberPreference(accountNumberPreferenceId: string, accountNumberPreferenceChanges: any): Observable {
+  updateAccountNumberPreference(
+    accountNumberPreferenceId: string,
+    accountNumberPreferenceChanges: any
+  ): Observable {
     return this.http.put(`/accountnumberformats/${accountNumberPreferenceId}`, accountNumberPreferenceChanges);
   }
 
@@ -628,7 +630,6 @@ export class SystemService {
     return this.http.get(`/entitytoentitymapping/${mapId}`);
   }
 
-
   /**
    * Creates a new mapping
    * @param {any} mapType Map id to be created.
@@ -689,9 +690,8 @@ export class SystemService {
    * @returns {Observable}
    */
   getMakerCheckerPermissions(): Observable {
-    const httpParams = new HttpParams()
-                      .set('makerCheckerable', 'true');
-    return this.http.get('/permissions', {params: httpParams});
+    const httpParams = new HttpParams().set('makerCheckerable', 'true');
+    return this.http.get('/permissions', { params: httpParams });
   }
 
   /**
@@ -699,8 +699,7 @@ export class SystemService {
    * @returns {Observable}
    */
   updateMakerCheckerPermission(data: any): Observable {
-    const httpParams = new HttpParams()
-                      .set('makerCheckerable', 'true');
+    const httpParams = new HttpParams().set('makerCheckerable', 'true');
     return this.http.put('/permissions', data, { params: httpParams });
   }
 
@@ -714,7 +713,7 @@ export class SystemService {
   /**
    * @returns {Observable}
    */
-   putExternalEventConfiguration(payload: any): Observable {
+  putExternalEventConfiguration(payload: any): Observable {
     return this.http.put('/externalevents/configuration', payload);
   }
 
diff --git a/src/app/system/version.service.ts b/src/app/system/version.service.ts
index ea0c93df2..8e3ecc02e 100644
--- a/src/app/system/version.service.ts
+++ b/src/app/system/version.service.ts
@@ -9,11 +9,9 @@ import { Observable } from 'rxjs';
   providedIn: 'root'
 })
 export class VersionService {
-
-  constructor(private http: HttpClient) { }
+  constructor(private http: HttpClient) {}
 
   getBackendInfo(): Observable {
     return this.http.get('/fineract-provider/actuator/info');
   }
-
 }
diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/checker-inbox/checker-inbox.component.spec.ts b/src/app/tasks/checker-inbox-and-tasks-tabs/checker-inbox/checker-inbox.component.spec.ts
index 9f29ef9c0..5468d4d89 100644
--- a/src/app/tasks/checker-inbox-and-tasks-tabs/checker-inbox/checker-inbox.component.spec.ts
+++ b/src/app/tasks/checker-inbox-and-tasks-tabs/checker-inbox/checker-inbox.component.spec.ts
@@ -8,9 +8,8 @@ describe('CheckerInboxComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CheckerInboxComponent ]
-    })
-    .compileComponents();
+      declarations: [CheckerInboxComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/checker-inbox/checker-inbox.component.ts b/src/app/tasks/checker-inbox-and-tasks-tabs/checker-inbox/checker-inbox.component.ts
index 34c940b64..1ffa09f22 100644
--- a/src/app/tasks/checker-inbox-and-tasks-tabs/checker-inbox/checker-inbox.component.ts
+++ b/src/app/tasks/checker-inbox-and-tasks-tabs/checker-inbox/checker-inbox.component.ts
@@ -21,7 +21,6 @@ import { TranslateService } from '@ngx-translate/core';
   styleUrls: ['./checker-inbox.component.scss']
 })
 export class CheckerInboxComponent implements OnInit {
-
   /** Data to be displayed */
   searchData: any;
   /** Maker Checker Template */
@@ -41,7 +40,15 @@ export class CheckerInboxComponent implements OnInit {
   /** Selecting rows from table */
   selection: SelectionModel;
   /** Displayed Column in table */
-  displayedColumns: string[] = ['select', 'id', 'madeOnDate', 'status', 'user', 'action', 'entity'];
+  displayedColumns: string[] = [
+    'select',
+    'id',
+    'madeOnDate',
+    'status',
+    'user',
+    'action',
+    'entity'
+  ];
 
   /**
    * Retrieves the maker checker data from `resolve`.
@@ -53,15 +60,17 @@ export class CheckerInboxComponent implements OnInit {
    * @param {TasksService} tasksService Tasks Service.
    * @param {FormBuilder} formBuilder Form Builder.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private dialog: MatDialog,
     private dateUtils: Dates,
     private router: Router,
     private translateService: TranslateService,
     private tasksService: TasksService,
     private settingsService: SettingsService,
-    private formBuilder: UntypedFormBuilder) {
-    this.route.data.subscribe((data: { makerCheckerResource: any, makerCheckerTemplate: any }) => {
+    private formBuilder: UntypedFormBuilder
+  ) {
+    this.route.data.subscribe((data: { makerCheckerResource: any; makerCheckerTemplate: any }) => {
       this.searchData = data.makerCheckerResource;
       if (this.searchData.length > 0) {
         this.checkerData = true;
@@ -81,11 +90,11 @@ export class CheckerInboxComponent implements OnInit {
    */
   createMakerCheckerSearchForm() {
     this.makerCheckerSearchForm = this.formBuilder.group({
-      'makerDateTimeFrom': [''],
-      'makerDateTimeto': [''],
-      'actionName': [''],
-      'entityName': [''],
-      'resourceId': ['']
+      makerDateTimeFrom: [''],
+      makerDateTimeto: [''],
+      actionName: [''],
+      entityName: [''],
+      resourceId: ['']
     });
   }
 
@@ -117,9 +126,9 @@ export class CheckerInboxComponent implements OnInit {
 
   /** Selects all rows if they are not all selected; otherwise clear selection. */
   masterToggle() {
-    this.isAllSelected() ?
-      this.selection.clear() :
-      this.dataSource.data.forEach((row: any) => this.selection.select(row));
+    this.isAllSelected()
+      ? this.selection.clear()
+      : this.dataSource.data.forEach((row: any) => this.selection.select(row));
   }
 
   /** The label for the checkbox on the passed row */
@@ -132,7 +141,10 @@ export class CheckerInboxComponent implements OnInit {
 
   approveChecker() {
     const approveCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
-      data: { heading: this.translateService.instant('labels.heading.Approve Checker'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to approve checker') }
+      data: {
+        heading: this.translateService.instant('labels.heading.Approve Checker'),
+        dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to approve checker')
+      }
     });
     approveCheckerDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
       if (response.confirm) {
@@ -143,7 +155,10 @@ export class CheckerInboxComponent implements OnInit {
 
   rejectChecker() {
     const rejectCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
-      data: { heading: this.translateService.instant('labels.heading.Reject Checker'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to reject checker') }
+      data: {
+        heading: this.translateService.instant('labels.heading.Reject Checker'),
+        dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to reject checker')
+      }
     });
     rejectCheckerDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
       if (response.confirm) {
@@ -154,7 +169,10 @@ export class CheckerInboxComponent implements OnInit {
 
   deleteChecker() {
     const deleteCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
-      data: { heading: this.translateService.instant('labels.heading.Delete Checker'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to delete checker') }
+      data: {
+        heading: this.translateService.instant('labels.heading.Delete Checker'),
+        dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to delete checker')
+      }
     });
     deleteCheckerDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
       if (response.confirm) {
@@ -201,8 +219,8 @@ export class CheckerInboxComponent implements OnInit {
    */
   reload() {
     const url: string = this.router.url;
-    this.router.navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
+    this.router
+      .navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
       .then(() => this.router.navigate([url]));
   }
-
 }
diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/client-approval/client-approval.component.spec.ts b/src/app/tasks/checker-inbox-and-tasks-tabs/client-approval/client-approval.component.spec.ts
index cf516c6e0..7867b6e67 100644
--- a/src/app/tasks/checker-inbox-and-tasks-tabs/client-approval/client-approval.component.spec.ts
+++ b/src/app/tasks/checker-inbox-and-tasks-tabs/client-approval/client-approval.component.spec.ts
@@ -8,9 +8,8 @@ describe('ClientApprovalComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ClientApprovalComponent ]
-    })
-    .compileComponents();
+      declarations: [ClientApprovalComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/client-approval/client-approval.component.ts b/src/app/tasks/checker-inbox-and-tasks-tabs/client-approval/client-approval.component.ts
index 18fe86ebc..f2aa83733 100644
--- a/src/app/tasks/checker-inbox-and-tasks-tabs/client-approval/client-approval.component.ts
+++ b/src/app/tasks/checker-inbox-and-tasks-tabs/client-approval/client-approval.component.ts
@@ -22,7 +22,6 @@ import { Dates } from 'app/core/utils/dates';
   styleUrls: ['./client-approval.component.scss']
 })
 export class ClientApprovalComponent {
-
   /** Grouped Clients Data */
   groupedClients: any;
   /** Checks to show the data */
@@ -34,7 +33,12 @@ export class ClientApprovalComponent {
   /** Row Selection Data */
   selection: SelectionModel;
   /** Displayed Columns */
-  displayedColumns: string[] = ['select', 'name', 'accountNumber', 'staff'];
+  displayedColumns: string[] = [
+    'select',
+    'name',
+    'accountNumber',
+    'staff'
+  ];
 
   /**
    * Retrieves the grouped client data from `resolve`.
@@ -45,12 +49,14 @@ export class ClientApprovalComponent {
    * @param {SettingsService} settingsService Settings Service.
    * @param {TasksService} tasksService Tasks Service.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private dialog: MatDialog,
     private dateUtils: Dates,
     private router: Router,
     private settingsService: SettingsService,
-    private tasksService: TasksService) {
+    private tasksService: TasksService
+  ) {
     this.route.data.subscribe((data: { groupedClientData: any }) => {
       this.groupedClients = _.groupBy(data.groupedClientData.pageItems, 'officeName');
       if (Object.keys(this.groupedClients).length) {
@@ -72,9 +78,9 @@ export class ClientApprovalComponent {
   /** Selects all rows if they are not all selected; otherwise clear selection. */
   masterToggle(dataSource3: any) {
     if (dataSource3) {
-      this.isAllSelected(dataSource3) ?
-        dataSource3.forEach((row: any) => this.selection.deselect(row)) :
-        dataSource3.forEach((row: any) => this.selection.select(row));
+      this.isAllSelected(dataSource3)
+        ? dataSource3.forEach((row: any) => this.selection.deselect(row))
+        : dataSource3.forEach((row: any) => this.selection.select(row));
     }
   }
 
@@ -94,7 +100,8 @@ export class ClientApprovalComponent {
         value: new Date(),
         type: 'datetime-local',
         required: true
-      }),
+      })
+
     ];
     const data = {
       title: 'Enter Clients Activation Date',
@@ -131,7 +138,7 @@ export class ClientApprovalComponent {
     });
     this.tasksService.submitBatchData(this.batchRequests).subscribe((response: any) => {
       response.forEach((responseEle: any) => {
-        if (responseEle.statusCode = '200') {
+        if ((responseEle.statusCode = '200')) {
           activatedAccounts++;
           responseEle.body = JSON.parse(responseEle.body);
           if (selectedAccounts === activatedAccounts) {
@@ -152,8 +159,8 @@ export class ClientApprovalComponent {
    */
   reload() {
     const url: string = this.router.url;
-    this.router.navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
+    this.router
+      .navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
       .then(() => this.router.navigate([url]));
   }
-
 }
diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/loan-approval/loan-approval.component.spec.ts b/src/app/tasks/checker-inbox-and-tasks-tabs/loan-approval/loan-approval.component.spec.ts
index 903bac954..8de923726 100644
--- a/src/app/tasks/checker-inbox-and-tasks-tabs/loan-approval/loan-approval.component.spec.ts
+++ b/src/app/tasks/checker-inbox-and-tasks-tabs/loan-approval/loan-approval.component.spec.ts
@@ -8,9 +8,8 @@ describe('LoanApprovalComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ LoanApprovalComponent ]
-    })
-    .compileComponents();
+      declarations: [LoanApprovalComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/loan-approval/loan-approval.component.ts b/src/app/tasks/checker-inbox-and-tasks-tabs/loan-approval/loan-approval.component.ts
index 840ec4c79..c31b6d116 100644
--- a/src/app/tasks/checker-inbox-and-tasks-tabs/loan-approval/loan-approval.component.ts
+++ b/src/app/tasks/checker-inbox-and-tasks-tabs/loan-approval/loan-approval.component.ts
@@ -21,7 +21,6 @@ import { TranslateService } from '@ngx-translate/core';
   styleUrls: ['./loan-approval.component.scss']
 })
 export class LoanApprovalComponent {
-
   /** Offices Data */
   offices: any;
   /** Loans Data */
@@ -39,7 +38,13 @@ export class LoanApprovalComponent {
   /** List of Requests */
   batchRequests: any[];
   /** Displayed Columns */
-  displayedColumns: string[] = ['select', 'clientName', 'loan', 'amount', 'loanPurpose'];
+  displayedColumns: string[] = [
+    'select',
+    'clientName',
+    'loan',
+    'amount',
+    'loanPurpose'
+  ];
 
   /**
    * Retrieves the offices and loans data from `resolve`.
@@ -50,14 +55,16 @@ export class LoanApprovalComponent {
    * @param {SettingsService} settingsService Settings Service.
    * @param {TasksService} tasksService Tasks Service.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private dialog: MatDialog,
     private dateUtils: Dates,
     private router: Router,
     private translateService: TranslateService,
     private settingsService: SettingsService,
-    private tasksService: TasksService) {
-    this.route.data.subscribe((data: { officesData: any, loansData: any }) => {
+    private tasksService: TasksService
+  ) {
+    this.route.data.subscribe((data: { officesData: any; loansData: any }) => {
       this.offices = data.officesData;
       this.loans = data.loansData.pageItems;
       this.setOfficeData();
@@ -107,9 +114,9 @@ export class LoanApprovalComponent {
   /** Selects all rows if they are not all selected; otherwise clear selection. */
   masterToggle(dataSource3: any) {
     if (dataSource3) {
-      this.isAllSelected(dataSource3) ?
-        dataSource3.forEach((row: any) => this.selection.deselect(row)) :
-        dataSource3.forEach((row: any) => this.selection.select(row));
+      this.isAllSelected(dataSource3)
+        ? dataSource3.forEach((row: any) => this.selection.deselect(row))
+        : dataSource3.forEach((row: any) => this.selection.select(row));
     }
   }
 
@@ -123,7 +130,10 @@ export class LoanApprovalComponent {
 
   approveLoan() {
     const approveLoanDialogRef = this.dialog.open(ConfirmationDialogComponent, {
-      data: { heading: this.translateService.instant('labels.heading.Approve Loan'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to Approve Loan') }
+      data: {
+        heading: this.translateService.instant('labels.heading.Approve Loan'),
+        dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to Approve Loan')
+      }
     });
     approveLoanDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
       if (response.confirm) {
@@ -154,7 +164,7 @@ export class LoanApprovalComponent {
     });
     this.tasksService.submitBatchData(this.batchRequests).subscribe((response: any) => {
       response.forEach((responseEle: any) => {
-        if (responseEle.statusCode = '200') {
+        if ((responseEle.statusCode = '200')) {
           approvedAccounts++;
           responseEle.body = JSON.parse(responseEle.body);
           if (selectedAccounts === approvedAccounts) {
@@ -174,7 +184,7 @@ export class LoanApprovalComponent {
     this.tasksService.getAllLoansToBeApproved().subscribe((response: any) => {
       this.loans = response.pageItems;
       this.loans = this.loans.filter((account: any) => {
-        return (account.status.waitingForDisbursal === true);
+        return account.status.waitingForDisbursal === true;
       });
       this.dataSource = new MatTableDataSource(this.loans);
       this.selection = new SelectionModel(true, []);
@@ -187,8 +197,8 @@ export class LoanApprovalComponent {
    */
   reload() {
     const url: string = this.router.url;
-    this.router.navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
+    this.router
+      .navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
       .then(() => this.router.navigate([url]));
   }
-
 }
diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/loan-disbursal/loan-disbursal.component.spec.ts b/src/app/tasks/checker-inbox-and-tasks-tabs/loan-disbursal/loan-disbursal.component.spec.ts
index 1a39d232f..ed0068ea7 100644
--- a/src/app/tasks/checker-inbox-and-tasks-tabs/loan-disbursal/loan-disbursal.component.spec.ts
+++ b/src/app/tasks/checker-inbox-and-tasks-tabs/loan-disbursal/loan-disbursal.component.spec.ts
@@ -8,9 +8,8 @@ describe('LoanDisbursalComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ LoanDisbursalComponent ]
-    })
-    .compileComponents();
+      declarations: [LoanDisbursalComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/loan-disbursal/loan-disbursal.component.ts b/src/app/tasks/checker-inbox-and-tasks-tabs/loan-disbursal/loan-disbursal.component.ts
index 63cffa7ed..38192e55f 100644
--- a/src/app/tasks/checker-inbox-and-tasks-tabs/loan-disbursal/loan-disbursal.component.ts
+++ b/src/app/tasks/checker-inbox-and-tasks-tabs/loan-disbursal/loan-disbursal.component.ts
@@ -20,7 +20,6 @@ import { TranslateService } from '@ngx-translate/core';
   styleUrls: ['./loan-disbursal.component.scss']
 })
 export class LoanDisbursalComponent {
-
   /** Loans Data */
   loans: any;
   /** Batch Requests */
@@ -30,7 +29,13 @@ export class LoanDisbursalComponent {
   /** Row Selection */
   selection: SelectionModel;
   /** Displayed Columns for loan disbursal data */
-  displayedColumns: string[] = ['select', 'client', 'loanAccountNumber', 'loanProduct', 'principal'];
+  displayedColumns: string[] = [
+    'select',
+    'client',
+    'loanAccountNumber',
+    'loanProduct',
+    'principal'
+  ];
 
   /**
    * Retrieves the loans data from `resolve`.
@@ -41,16 +46,18 @@ export class LoanDisbursalComponent {
    * @param {SettingsService} settingsService Settings Service.
    * @param {TasksService} tasksService Tasks Service.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private dialog: MatDialog,
     private dateUtils: Dates,
     private settingsService: SettingsService,
     private translateService: TranslateService,
-    private tasksService: TasksService) {
+    private tasksService: TasksService
+  ) {
     this.route.data.subscribe((data: { loansData: any }) => {
       this.loans = data.loansData.pageItems;
       this.loans = this.loans.filter((account: any) => {
-        return (account.status.waitingForDisbursal === true);
+        return account.status.waitingForDisbursal === true;
       });
       this.dataSource = new MatTableDataSource(this.loans);
       this.selection = new SelectionModel(true, []);
@@ -66,9 +73,9 @@ export class LoanDisbursalComponent {
 
   /** Selects all rows if they are not all selected; otherwise clear selection. */
   masterToggle() {
-    this.isAllSelected() ?
-      this.selection.clear() :
-      this.dataSource.data.forEach((row: any) => this.selection.select(row));
+    this.isAllSelected()
+      ? this.selection.clear()
+      : this.dataSource.data.forEach((row: any) => this.selection.select(row));
   }
 
   /** The label for the checkbox on the passed row */
@@ -81,7 +88,10 @@ export class LoanDisbursalComponent {
 
   disburseLoan() {
     const disburseLoanDialogRef = this.dialog.open(ConfirmationDialogComponent, {
-      data: { heading: this.translateService.instant('labels.heading.Loan Disbursal'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to Disburse Loan') }
+      data: {
+        heading: this.translateService.instant('labels.heading.Loan Disbursal'),
+        dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to Disburse Loan')
+      }
     });
     disburseLoanDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
       if (response.confirm) {
@@ -112,7 +122,7 @@ export class LoanDisbursalComponent {
     });
     this.tasksService.submitBatchData(this.batchRequests).subscribe((response: any) => {
       response.forEach((responseEle: any) => {
-        if (responseEle.statusCode = '200') {
+        if ((responseEle.statusCode = '200')) {
           approvedAccounts++;
           responseEle.body = JSON.parse(responseEle.body);
           if (selectedAccounts === approvedAccounts) {
@@ -127,7 +137,7 @@ export class LoanDisbursalComponent {
     this.tasksService.getAllLoansToBeDisbursed().subscribe((response: any) => {
       this.loans = response.pageItems;
       this.loans = this.loans.filter((account: any) => {
-        return (account.status.waitingForDisbursal === true);
+        return account.status.waitingForDisbursal === true;
       });
       this.dataSource = new MatTableDataSource(this.loans);
       this.selection = new SelectionModel(true, []);
@@ -137,5 +147,4 @@ export class LoanDisbursalComponent {
   applyFilter(filterValue: string = '') {
     this.dataSource.filter = filterValue.trim().toLowerCase();
   }
-
 }
diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/reschedule-loan/reschedule-loan.component.spec.ts b/src/app/tasks/checker-inbox-and-tasks-tabs/reschedule-loan/reschedule-loan.component.spec.ts
index c7163876f..07df623f6 100644
--- a/src/app/tasks/checker-inbox-and-tasks-tabs/reschedule-loan/reschedule-loan.component.spec.ts
+++ b/src/app/tasks/checker-inbox-and-tasks-tabs/reschedule-loan/reschedule-loan.component.spec.ts
@@ -8,9 +8,8 @@ describe('RescheduleLoanComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ RescheduleLoanComponent ]
-    })
-    .compileComponents();
+      declarations: [RescheduleLoanComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/reschedule-loan/reschedule-loan.component.ts b/src/app/tasks/checker-inbox-and-tasks-tabs/reschedule-loan/reschedule-loan.component.ts
index 32d22ac14..5db01a686 100644
--- a/src/app/tasks/checker-inbox-and-tasks-tabs/reschedule-loan/reschedule-loan.component.ts
+++ b/src/app/tasks/checker-inbox-and-tasks-tabs/reschedule-loan/reschedule-loan.component.ts
@@ -21,7 +21,6 @@ import { TranslateService } from '@ngx-translate/core';
   styleUrls: ['./reschedule-loan.component.scss']
 })
 export class RescheduleLoanComponent {
-
   /** Loans Data */
   loans: any;
   /** Datasource */
@@ -31,7 +30,14 @@ export class RescheduleLoanComponent {
   /** Batch Requests */
   batchRequests: any[];
   /** Displayed Columns */
-  displayedColumns: string[] = ['select', 'client', 'rescheduleRequestNo', 'loanAccountNo', 'rescheduleForm', 'rescheduleReason'];
+  displayedColumns: string[] = [
+    'select',
+    'client',
+    'rescheduleRequestNo',
+    'loanAccountNo',
+    'rescheduleForm',
+    'rescheduleReason'
+  ];
 
   /**
    * Retrieves the reschedule loan data from `resolve`.
@@ -42,13 +48,15 @@ export class RescheduleLoanComponent {
    * @param {SettingsService} settingsService Settings Service.
    * @param {TasksService} tasksService Tasks Service.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private dialog: MatDialog,
     private dateUtils: Dates,
     private router: Router,
     private settingsService: SettingsService,
     private translateService: TranslateService,
-    private tasksService: TasksService) {
+    private tasksService: TasksService
+  ) {
     this.route.data.subscribe((data: { recheduleLoansData: any }) => {
       this.loans = data.recheduleLoansData;
       this.dataSource = new MatTableDataSource(this.loans);
@@ -65,9 +73,9 @@ export class RescheduleLoanComponent {
 
   /** Selects all rows if they are not all selected; otherwise clear selection. */
   masterToggle() {
-    this.isAllSelected() ?
-      this.selection.clear() :
-      this.dataSource.data.forEach((row: any) => this.selection.select(row));
+    this.isAllSelected()
+      ? this.selection.clear()
+      : this.dataSource.data.forEach((row: any) => this.selection.select(row));
   }
 
   /** The label for the checkbox on the passed row */
@@ -80,7 +88,13 @@ export class RescheduleLoanComponent {
 
   bulkLoanReschedule(action: string) {
     const rescheduleLoanDialogRef = this.dialog.open(ConfirmationDialogComponent, {
-      data: { heading: this.translateService.instant('labels.heading.Reschedule Loan'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to') + action + this.translateService.instant('labels.dialogContext.the Reschedule Loan') }
+      data: {
+        heading: this.translateService.instant('labels.heading.Reschedule Loan'),
+        dialogContext:
+          this.translateService.instant('labels.dialogContext.Are you sure you want to') +
+          action +
+          this.translateService.instant('labels.dialogContext.the Reschedule Loan')
+      }
     });
     rescheduleLoanDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
       if (response.confirm) {
@@ -126,8 +140,8 @@ export class RescheduleLoanComponent {
    */
   reload() {
     const url: string = this.router.url;
-    this.router.navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
+    this.router
+      .navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
       .then(() => this.router.navigate([url]));
   }
-
 }
diff --git a/src/app/tasks/checker-inbox-and-tasks/checker-inbox-and-tasks.component.spec.ts b/src/app/tasks/checker-inbox-and-tasks/checker-inbox-and-tasks.component.spec.ts
index 9eaeb8c83..ed47c11e1 100644
--- a/src/app/tasks/checker-inbox-and-tasks/checker-inbox-and-tasks.component.spec.ts
+++ b/src/app/tasks/checker-inbox-and-tasks/checker-inbox-and-tasks.component.spec.ts
@@ -8,9 +8,8 @@ describe('CheckerInboxAndTasksComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CheckerInboxAndTasksComponent ]
-    })
-    .compileComponents();
+      declarations: [CheckerInboxAndTasksComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/tasks/checker-inbox-and-tasks/checker-inbox-and-tasks.component.ts b/src/app/tasks/checker-inbox-and-tasks/checker-inbox-and-tasks.component.ts
index 39651b689..04c62952d 100644
--- a/src/app/tasks/checker-inbox-and-tasks/checker-inbox-and-tasks.component.ts
+++ b/src/app/tasks/checker-inbox-and-tasks/checker-inbox-and-tasks.component.ts
@@ -10,7 +10,5 @@ import { Component } from '@angular/core';
   styleUrls: ['./checker-inbox-and-tasks.component.scss']
 })
 export class CheckerInboxAndTasksComponent {
-
-  constructor() { }
-
+  constructor() {}
 }
diff --git a/src/app/tasks/common-resolvers/getCheckerInboxDetail.resolver.ts b/src/app/tasks/common-resolvers/getCheckerInboxDetail.resolver.ts
index 1d6448c59..2ffee819c 100644
--- a/src/app/tasks/common-resolvers/getCheckerInboxDetail.resolver.ts
+++ b/src/app/tasks/common-resolvers/getCheckerInboxDetail.resolver.ts
@@ -13,19 +13,17 @@ import { TasksService } from '../tasks.service';
  */
 @Injectable()
 export class GetCheckerInboxDetailResolver implements Resolve {
+  /**
+   * @param {TasksService} tasksService Tasks service.
+   */
+  constructor(private tasksService: TasksService) {}
 
-    /**
-     * @param {TasksService} tasksService Tasks service.
-     */
-    constructor(private tasksService: TasksService) { }
-
-    /**
-     * Returns the detail data of the checker inbox.
-     * @returns {Observable}
-     */
-    resolve(route: ActivatedRouteSnapshot): Observable {
-        const checkerId = route.paramMap.get('id');
-        return this.tasksService.getCheckerInboxDetail(checkerId);
-    }
-
+  /**
+   * Returns the detail data of the checker inbox.
+   * @returns {Observable}
+   */
+  resolve(route: ActivatedRouteSnapshot): Observable {
+    const checkerId = route.paramMap.get('id');
+    return this.tasksService.getCheckerInboxDetail(checkerId);
+  }
 }
diff --git a/src/app/tasks/common-resolvers/getGroupedClientsData.resolver.ts b/src/app/tasks/common-resolvers/getGroupedClientsData.resolver.ts
index 6f892b169..52ca243c0 100644
--- a/src/app/tasks/common-resolvers/getGroupedClientsData.resolver.ts
+++ b/src/app/tasks/common-resolvers/getGroupedClientsData.resolver.ts
@@ -13,7 +13,6 @@ import { TasksService } from '../tasks.service';
  */
 @Injectable()
 export class GetGroupedClientsData implements Resolve {
-
   /**
    * @param {TasksService} tasksService Tasks service.
    */
@@ -26,5 +25,4 @@ export class GetGroupedClientsData implements Resolve {
   resolve(): Observable {
     return this.tasksService.getGroupedClientsData();
   }
-
 }
diff --git a/src/app/tasks/common-resolvers/getLoansToBeApproved.resolver.ts b/src/app/tasks/common-resolvers/getLoansToBeApproved.resolver.ts
index e10544731..dd2e05b59 100644
--- a/src/app/tasks/common-resolvers/getLoansToBeApproved.resolver.ts
+++ b/src/app/tasks/common-resolvers/getLoansToBeApproved.resolver.ts
@@ -13,18 +13,16 @@ import { TasksService } from '../tasks.service';
  */
 @Injectable()
 export class GetLoansToBeApproved implements Resolve {
+  /**
+   * @param {TasksService} tasksService Tasks service.
+   */
+  constructor(private tasksService: TasksService) {}
 
-    /**
-     * @param {TasksService} tasksService Tasks service.
-     */
-    constructor(private tasksService: TasksService) { }
-
-    /**
-     * Returns all the loans data.
-     * @returns {Observable}
-     */
-    resolve(): Observable {
-        return this.tasksService.getAllLoansToBeApproved();
-    }
-
+  /**
+   * Returns all the loans data.
+   * @returns {Observable}
+   */
+  resolve(): Observable {
+    return this.tasksService.getAllLoansToBeApproved();
+  }
 }
diff --git a/src/app/tasks/common-resolvers/getLoansToBeDisbursed.resolver.ts b/src/app/tasks/common-resolvers/getLoansToBeDisbursed.resolver.ts
index a19763046..e98f56d0e 100644
--- a/src/app/tasks/common-resolvers/getLoansToBeDisbursed.resolver.ts
+++ b/src/app/tasks/common-resolvers/getLoansToBeDisbursed.resolver.ts
@@ -13,18 +13,16 @@ import { TasksService } from '../tasks.service';
  */
 @Injectable()
 export class GetLoansToBeDisbursed implements Resolve {
+  /**
+   * @param {TasksService} tasksService Tasks service.
+   */
+  constructor(private tasksService: TasksService) {}
 
-    /**
-     * @param {TasksService} tasksService Tasks service.
-     */
-    constructor(private tasksService: TasksService) { }
-
-    /**
-     * Returns all the loans data.
-     * @returns {Observable}
-     */
-    resolve(): Observable {
-        return this.tasksService.getAllLoansToBeDisbursed();
-    }
-
+  /**
+   * Returns all the loans data.
+   * @returns {Observable}
+   */
+  resolve(): Observable {
+    return this.tasksService.getAllLoansToBeDisbursed();
+  }
 }
diff --git a/src/app/tasks/common-resolvers/getOffices.resolver.ts b/src/app/tasks/common-resolvers/getOffices.resolver.ts
index bc80d8d93..6f60adb6d 100644
--- a/src/app/tasks/common-resolvers/getOffices.resolver.ts
+++ b/src/app/tasks/common-resolvers/getOffices.resolver.ts
@@ -13,18 +13,16 @@ import { TasksService } from '../tasks.service';
  */
 @Injectable()
 export class GetOffices implements Resolve {
+  /**
+   * @param {TasksService} tasksService Tasks service.
+   */
+  constructor(private tasksService: TasksService) {}
 
-    /**
-     * @param {TasksService} tasksService Tasks service.
-     */
-    constructor(private tasksService: TasksService) { }
-
-    /**
-     * Returns the offices data.
-     * @returns {Observable}
-     */
-    resolve(): Observable {
-        return this.tasksService.getAllOffices();
-    }
-
+  /**
+   * Returns the offices data.
+   * @returns {Observable}
+   */
+  resolve(): Observable {
+    return this.tasksService.getAllOffices();
+  }
 }
diff --git a/src/app/tasks/common-resolvers/getRescheduleLoans.resolver.ts b/src/app/tasks/common-resolvers/getRescheduleLoans.resolver.ts
index 39c275913..2c2460454 100644
--- a/src/app/tasks/common-resolvers/getRescheduleLoans.resolver.ts
+++ b/src/app/tasks/common-resolvers/getRescheduleLoans.resolver.ts
@@ -13,18 +13,16 @@ import { TasksService } from '../tasks.service';
  */
 @Injectable()
 export class GetRescheduleLoans implements Resolve {
+  /**
+   * @param {TasksService} tasksService Tasks service.
+   */
+  constructor(private tasksService: TasksService) {}
 
-    /**
-     * @param {TasksService} tasksService Tasks service.
-     */
-    constructor(private tasksService: TasksService) { }
-
-    /**
-     * Returns the pending reschedule data.
-     * @returns {Observable}
-     */
-    resolve(): Observable {
-        return this.tasksService.getPendingRescheduleLoans();
-    }
-
+  /**
+   * Returns the pending reschedule data.
+   * @returns {Observable}
+   */
+  resolve(): Observable {
+    return this.tasksService.getPendingRescheduleLoans();
+  }
 }
diff --git a/src/app/tasks/common-resolvers/getmakercheckers.resolver.ts b/src/app/tasks/common-resolvers/getmakercheckers.resolver.ts
index 16c4531fa..0b5cf6d7a 100644
--- a/src/app/tasks/common-resolvers/getmakercheckers.resolver.ts
+++ b/src/app/tasks/common-resolvers/getmakercheckers.resolver.ts
@@ -13,7 +13,6 @@ import { TasksService } from '../tasks.service';
  */
 @Injectable()
 export class GetMakerCheckers implements Resolve {
-
   /**
    * @param {TasksService} tasksService Tasks service.
    */
@@ -26,5 +25,4 @@ export class GetMakerCheckers implements Resolve {
   resolve(): Observable {
     return this.tasksService.getMakerCheckerData();
   }
-
 }
diff --git a/src/app/tasks/common-resolvers/makerCheckerTemplate.resolver.ts b/src/app/tasks/common-resolvers/makerCheckerTemplate.resolver.ts
index 685e6e379..53a8d090a 100644
--- a/src/app/tasks/common-resolvers/makerCheckerTemplate.resolver.ts
+++ b/src/app/tasks/common-resolvers/makerCheckerTemplate.resolver.ts
@@ -13,18 +13,16 @@ import { TasksService } from '../tasks.service';
  */
 @Injectable()
 export class MakerCheckerTemplate implements Resolve {
+  /**
+   * @param {TasksService} tasksService Tasks service.
+   */
+  constructor(private tasksService: TasksService) {}
 
-    /**
-     * @param {TasksService} tasksService Tasks service.
-     */
-    constructor(private tasksService: TasksService) { }
-
-    /**
-     * Returns the maker checker template data.
-     * @returns {Observable}
-     */
-    resolve(): Observable {
-        return this.tasksService.getMakerCheckerTemplate();
-    }
-
+  /**
+   * Returns the maker checker template data.
+   * @returns {Observable}
+   */
+  resolve(): Observable {
+    return this.tasksService.getMakerCheckerTemplate();
+  }
 }
diff --git a/src/app/tasks/tasks-routing.module.ts b/src/app/tasks/tasks-routing.module.ts
index 55a474cb6..6475d4c7a 100644
--- a/src/app/tasks/tasks-routing.module.ts
+++ b/src/app/tasks/tasks-routing.module.ts
@@ -47,7 +47,7 @@ const routes: Routes = [
           data: { title: 'Client Approval' },
           resolve: {
             groupedClientData: GetGroupedClientsData
-          },
+          }
         },
         {
           path: 'loan-approval',
@@ -56,7 +56,7 @@ const routes: Routes = [
           resolve: {
             officesData: GetOffices,
             loansData: GetLoansToBeApproved
-          },
+          }
         },
         {
           path: 'loan-disbursal',
@@ -88,8 +88,9 @@ const routes: Routes = [
           }
         }
       ]
-    },
+    }
   ])
+
 ];
 
 @NgModule({
@@ -106,4 +107,4 @@ const routes: Routes = [
     GetCheckerInboxDetailResolver
   ]
 })
-export class TasksRoutingModule { }
+export class TasksRoutingModule {}
diff --git a/src/app/tasks/tasks.module.ts b/src/app/tasks/tasks.module.ts
index b6db52531..ec454bc25 100644
--- a/src/app/tasks/tasks.module.ts
+++ b/src/app/tasks/tasks.module.ts
@@ -34,6 +34,6 @@ import { ViewCheckerInboxComponent } from './view-checker-inbox/view-checker-inb
     RescheduleLoanComponent,
     ViewCheckerInboxComponent
   ],
-  providers: [ ]
+  providers: []
 })
-export class TasksModule { }
+export class TasksModule {}
diff --git a/src/app/tasks/tasks.service.ts b/src/app/tasks/tasks.service.ts
index b511ec494..9c8a13bda 100644
--- a/src/app/tasks/tasks.service.ts
+++ b/src/app/tasks/tasks.service.ts
@@ -12,11 +12,10 @@ import { Observable } from 'rxjs';
   providedIn: 'root'
 })
 export class TasksService {
-
   /**
    * @param {HttpClient} http Http Client to send requests.
    */
-  constructor(private http: HttpClient) { }
+  constructor(private http: HttpClient) {}
 
   /**
    * Get Maker Checker Data
@@ -47,9 +46,8 @@ export class TasksService {
    * Get Grouped Clients Data
    */
   getGroupedClientsData(): Observable {
-    const httpParams = new HttpParams().set('limit', '1000')
-                                       .set('status', 'PENDING');
-    return this.http.get('/clients', { params: httpParams});
+    const httpParams = new HttpParams().set('limit', '1000').set('status', 'PENDING');
+    return this.http.get('/clients', { params: httpParams });
   }
 
   /**
@@ -63,8 +61,7 @@ export class TasksService {
    * Get all loans to be approved
    */
   getAllLoansToBeApproved(): Observable {
-    const httpParams = new HttpParams().set('limit', '1000')
-                                       .set('status', '100');
+    const httpParams = new HttpParams().set('limit', '1000').set('status', '100');
     return this.http.get('/loans', { params: httpParams });
   }
 
@@ -72,8 +69,7 @@ export class TasksService {
    * Get all loans to be created
    */
   getAllLoansToBeDisbursed(): Observable {
-    const httpParams = new HttpParams().set('limit', '1000')
-                                       .set('status', '200');
+    const httpParams = new HttpParams().set('limit', '1000').set('status', '200');
     return this.http.get('/loans', { params: httpParams });
   }
 
@@ -126,5 +122,4 @@ export class TasksService {
   getCheckerInboxDetail(makerCheckerId: any): Observable {
     return this.http.get(`/audits/${makerCheckerId}`);
   }
-
 }
diff --git a/src/app/tasks/view-checker-inbox/view-checker-inbox.component.spec.ts b/src/app/tasks/view-checker-inbox/view-checker-inbox.component.spec.ts
index 6aa8883bd..4e25b7c9a 100644
--- a/src/app/tasks/view-checker-inbox/view-checker-inbox.component.spec.ts
+++ b/src/app/tasks/view-checker-inbox/view-checker-inbox.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewCheckerInboxComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewCheckerInboxComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewCheckerInboxComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/tasks/view-checker-inbox/view-checker-inbox.component.ts b/src/app/tasks/view-checker-inbox/view-checker-inbox.component.ts
index a3c71d4a8..61991dccd 100644
--- a/src/app/tasks/view-checker-inbox/view-checker-inbox.component.ts
+++ b/src/app/tasks/view-checker-inbox/view-checker-inbox.component.ts
@@ -17,7 +17,6 @@ import { TranslateService } from '@ngx-translate/core';
   styleUrls: ['./view-checker-inbox.component.scss']
 })
 export class ViewCheckerInboxComponent {
-
   /** Checker Inbox Details Data */
   checkerInboxDetail: any;
   /** JsonData */
@@ -32,25 +31,29 @@ export class ViewCheckerInboxComponent {
    * @param {router} router Router.
    * @param {TasksService} tasksService Tasks Service.
    */
-  constructor(private route: ActivatedRoute,
+  constructor(
+    private route: ActivatedRoute,
     private dialog: MatDialog,
     private router: Router,
     private translateService: TranslateService,
-    private tasksService: TasksService) {
+    private tasksService: TasksService
+  ) {
     this.route.data.subscribe((data: { checkerInboxDetail: any }) => {
       this.checkerInboxDetail = data.checkerInboxDetail;
       this.jsondata = JSON.parse(this.checkerInboxDetail.commandAsJson);
-      this.displayJSONData = !(_.isEmpty(this.jsondata));
+      this.displayJSONData = !_.isEmpty(this.jsondata);
     });
   }
 
-
   /**
    * Approve Checker
    */
   approveChecker() {
     const approveCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
-      data: { heading: this.translateService.instant('labels.heading.Approve Checker'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to approve checker') }
+      data: {
+        heading: this.translateService.instant('labels.heading.Approve Checker'),
+        dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to approve checker')
+      }
     });
     approveCheckerDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
       if (response.confirm) {
@@ -66,7 +69,10 @@ export class ViewCheckerInboxComponent {
    */
   rejectChecker() {
     const rejectCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
-      data: { heading: this.translateService.instant('labels.heading.Reject Checker'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to reject checker') }
+      data: {
+        heading: this.translateService.instant('labels.heading.Reject Checker'),
+        dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to reject checker')
+      }
     });
     rejectCheckerDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
       if (response.confirm) {
@@ -82,7 +88,10 @@ export class ViewCheckerInboxComponent {
    */
   deleteChecker() {
     const deleteCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
-      data: { heading: this.translateService.instant('labels.heading.Delete Checker'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to delete checker') }
+      data: {
+        heading: this.translateService.instant('labels.heading.Delete Checker'),
+        dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to delete checker')
+      }
     });
     deleteCheckerDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
       if (response.confirm) {
@@ -92,5 +101,4 @@ export class ViewCheckerInboxComponent {
       }
     });
   }
-
 }
diff --git a/src/app/templates/common-resolvers/create-template.resolver.ts b/src/app/templates/common-resolvers/create-template.resolver.ts
index 0e23d2884..14a5bd6cb 100644
--- a/src/app/templates/common-resolvers/create-template.resolver.ts
+++ b/src/app/templates/common-resolvers/create-template.resolver.ts
@@ -13,7 +13,6 @@ import { TemplatesService } from '../templates.service';
  */
 @Injectable()
 export class CreateTemplateResolver implements Resolve {
-
   /**
    * @param {TemplatesService} templatesService Templates service.
    */
@@ -26,5 +25,4 @@ export class CreateTemplateResolver implements Resolve {
   resolve(): Observable {
     return this.templatesService.getCreateTemplateData();
   }
-
 }
diff --git a/src/app/templates/common-resolvers/edit-template.resolver.ts b/src/app/templates/common-resolvers/edit-template.resolver.ts
index ad22d8a50..61970d576 100644
--- a/src/app/templates/common-resolvers/edit-template.resolver.ts
+++ b/src/app/templates/common-resolvers/edit-template.resolver.ts
@@ -13,7 +13,6 @@ import { TemplatesService } from '../templates.service';
  */
 @Injectable()
 export class EditTemplateResolver implements Resolve {
-
   /**
    * @param {TemplatesService} templatesService Templates service.
    */
@@ -27,5 +26,4 @@ export class EditTemplateResolver implements Resolve {
     const templateId = route.paramMap.get('id');
     return this.templatesService.getEditTemplateData(templateId);
   }
-
 }
diff --git a/src/app/templates/common-resolvers/template.resolver.ts b/src/app/templates/common-resolvers/template.resolver.ts
index 299e41ef0..df335649c 100644
--- a/src/app/templates/common-resolvers/template.resolver.ts
+++ b/src/app/templates/common-resolvers/template.resolver.ts
@@ -13,7 +13,6 @@ import { TemplatesService } from '../templates.service';
  */
 @Injectable()
 export class TemplateResolver implements Resolve {
-
   /**
    * @param {TemplatesService} templatesService Templates service.
    */
@@ -27,5 +26,4 @@ export class TemplateResolver implements Resolve {
     const templateId = route.paramMap.get('id');
     return this.templatesService.getTemplate(templateId);
   }
-
 }
diff --git a/src/app/templates/common-resolvers/templates.resolver.ts b/src/app/templates/common-resolvers/templates.resolver.ts
index 6da5fb466..864f7e8bd 100644
--- a/src/app/templates/common-resolvers/templates.resolver.ts
+++ b/src/app/templates/common-resolvers/templates.resolver.ts
@@ -13,7 +13,6 @@ import { TemplatesService } from '../templates.service';
  */
 @Injectable()
 export class TemplatesResolver implements Resolve {
-
   /**
    * @param {TemplatesService} templatesService Templates service.
    */
@@ -26,5 +25,4 @@ export class TemplatesResolver implements Resolve {
   resolve(): Observable {
     return this.templatesService.getTemplates();
   }
-
 }
diff --git a/src/app/templates/create-template/create-template.component.spec.ts b/src/app/templates/create-template/create-template.component.spec.ts
index 890adc35b..87bd27343 100644
--- a/src/app/templates/create-template/create-template.component.spec.ts
+++ b/src/app/templates/create-template/create-template.component.spec.ts
@@ -8,9 +8,8 @@ describe('CreateTemplateComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CreateTemplateComponent ]
-    })
-    .compileComponents();
+      declarations: [CreateTemplateComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/templates/create-template/create-template.component.ts b/src/app/templates/create-template/create-template.component.ts
index 79d82e0ff..3b5e04d6a 100644
--- a/src/app/templates/create-template/create-template.component.ts
+++ b/src/app/templates/create-template/create-template.component.ts
@@ -21,7 +21,6 @@ import { TemplatesService } from '../templates.service';
   styleUrls: ['./create-template.component.scss']
 })
 export class CreateTemplateComponent implements OnInit {
-
   /** CKEditor5 */
   public Editor = ClassicEditor;
   /** CKEditor5 Template Reference */
@@ -50,10 +49,12 @@ export class CreateTemplateComponent implements OnInit {
    * @param {Router} router Router for navigation.
    * @param {TemplateService} templateService Templates Service
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private route: ActivatedRoute,
-              private router: Router,
-              private templateService: TemplatesService) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private route: ActivatedRoute,
+    private router: Router,
+    private templateService: TemplatesService
+  ) {
     this.route.data.subscribe((data: { createTemplateData: any }) => {
       this.createTemplateData = data.createTemplateData;
     });
@@ -69,9 +70,18 @@ export class CreateTemplateComponent implements OnInit {
    */
   createTemplateForm() {
     this.templateForm = this.formBuilder.group({
-      'entity': ['', Validators.required],
-      'type': ['', Validators.required],
-      'name': ['', Validators.required]
+      entity: [
+        '',
+        Validators.required
+      ],
+      type: [
+        '',
+        Validators.required
+      ],
+      name: [
+        '',
+        Validators.required
+      ]
     });
   }
 
@@ -81,17 +91,19 @@ export class CreateTemplateComponent implements OnInit {
   buildDependencies() {
     const tenantIdentifier = 'default'; // update once global settings are setup.
     this.templateForm.get('entity').valueChanges.subscribe((value: any) => {
-      if (value === 0) { // client
+      if (value === 0) {
+        // client
         this.mappers.splice(0, 1, {
           mappersorder: 0,
           mapperskey: new UntypedFormControl('client'),
           mappersvalue: new UntypedFormControl('clients/{{clientId}}?tenantIdentifier=' + tenantIdentifier)
         });
-      } else { // loan
+      } else {
+        // loan
         this.mappers.splice(0, 1, {
           mappersorder: 0,
           mapperskey: new UntypedFormControl('loan'),
-          mappersvalue: new UntypedFormControl('loans/{{loanId}}?associations=all&tenantIdentifier=' + tenantIdentifier )
+          mappersvalue: new UntypedFormControl('loans/{{loanId}}?associations=all&tenantIdentifier=' + tenantIdentifier)
         });
       }
       this.setEditorContent('');
@@ -127,7 +139,7 @@ export class CreateTemplateComponent implements OnInit {
       this.ckEditor.editorInstance.model.change((writer: any) => {
         const insertPosition = this.ckEditor.editorInstance.model.document.selection.getFirstPosition();
         writer.insertText(label, insertPosition);
-    } );
+      });
     }
   }
 
@@ -166,8 +178,13 @@ export class CreateTemplateComponent implements OnInit {
       text: this.getEditorContent()
     };
     this.templateService.createTemplate(template).subscribe((response: any) => {
-      this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
+      this.router.navigate(
+        [
+          '../',
+          response.resourceId
+        ],
+        { relativeTo: this.route }
+      );
     });
   }
-
 }
diff --git a/src/app/templates/edit-template/edit-template.component.spec.ts b/src/app/templates/edit-template/edit-template.component.spec.ts
index f52268284..0914e9714 100644
--- a/src/app/templates/edit-template/edit-template.component.spec.ts
+++ b/src/app/templates/edit-template/edit-template.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditTemplateComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditTemplateComponent ]
-    })
-    .compileComponents();
+      declarations: [EditTemplateComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/templates/edit-template/edit-template.component.ts b/src/app/templates/edit-template/edit-template.component.ts
index 6f4fa228b..29ea71ccf 100644
--- a/src/app/templates/edit-template/edit-template.component.ts
+++ b/src/app/templates/edit-template/edit-template.component.ts
@@ -21,7 +21,6 @@ import { TemplatesService } from '../templates.service';
   styleUrls: ['./edit-template.component.scss']
 })
 export class EditTemplateComponent implements OnInit {
-
   /** CKEditor5 */
   public Editor = ClassicEditor;
   /** CKEditor5 Template Reference */
@@ -50,18 +49,19 @@ export class EditTemplateComponent implements OnInit {
    * @param {Router} router Router for navigation.
    * @param {TemplateService} templateService Templates Service
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private route: ActivatedRoute,
-              private router: Router,
-              private templateService: TemplatesService) {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private route: ActivatedRoute,
+    private router: Router,
+    private templateService: TemplatesService
+  ) {
     this.route.data.subscribe((data: { editTemplateData: any }) => {
       this.editTemplateData = data.editTemplateData;
-      this.mappers = this.editTemplateData.template.mappers
-        .map((mapper: any) => ({
-          mappersorder: mapper.mapperorder,
-          mapperskey: new UntypedFormControl(mapper.mapperkey),
-          mappersvalue: new UntypedFormControl(mapper.mappervalue)
-        }));
+      this.mappers = this.editTemplateData.template.mappers.map((mapper: any) => ({
+        mappersorder: mapper.mapperorder,
+        mapperskey: new UntypedFormControl(mapper.mapperkey),
+        mappersvalue: new UntypedFormControl(mapper.mappervalue)
+      }));
     });
   }
 
@@ -75,9 +75,11 @@ export class EditTemplateComponent implements OnInit {
    */
   createTemplateForm() {
     this.templateForm = this.formBuilder.group({
-      'entity': [this.editTemplateData.entities.find((entity: any) => entity.name === this.editTemplateData.template.entity).id],
-      'type': [this.editTemplateData.types.find((type: any) => type.name === this.editTemplateData.template.type).id],
-      'name': [this.editTemplateData.template.name]
+      entity: [
+        this.editTemplateData.entities.find((entity: any) => entity.name === this.editTemplateData.template.entity).id
+      ],
+      type: [this.editTemplateData.types.find((type: any) => type.name === this.editTemplateData.template.type).id],
+      name: [this.editTemplateData.template.name]
     });
   }
 
@@ -87,17 +89,19 @@ export class EditTemplateComponent implements OnInit {
   buildDependencies() {
     const tenantIdentifier = 'default'; // update once global settings are setup.
     this.templateForm.get('entity').valueChanges.subscribe((value: any) => {
-      if (value === 0) { // client
+      if (value === 0) {
+        // client
         this.mappers.splice(0, 1, {
           mappersorder: 0,
           mapperskey: new UntypedFormControl('client'),
           mappersvalue: new UntypedFormControl('clients/{{clientId}}?tenantIdentifier=' + tenantIdentifier)
         });
-      } else { // loan
+      } else {
+        // loan
         this.mappers.splice(0, 1, {
           mappersorder: 0,
           mapperskey: new UntypedFormControl('loan'),
-          mappersvalue: new UntypedFormControl('loans/{{loanId}}?associations=all&tenantIdentifier=' + tenantIdentifier )
+          mappersvalue: new UntypedFormControl('loans/{{loanId}}?associations=all&tenantIdentifier=' + tenantIdentifier)
         });
       }
       this.setEditorContent('');
@@ -132,7 +136,7 @@ export class EditTemplateComponent implements OnInit {
       this.ckEditor.editorInstance.model.change((writer: any) => {
         const insertPosition = this.ckEditor.editorInstance.model.document.selection.getFirstPosition();
         writer.insertText(label, insertPosition);
-    } );
+      });
     }
   }
 
@@ -174,5 +178,4 @@ export class EditTemplateComponent implements OnInit {
       this.router.navigate(['../'], { relativeTo: this.route });
     });
   }
-
 }
diff --git a/src/app/templates/template-parameter-labels.ts b/src/app/templates/template-parameter-labels.ts
index 69e941ff9..f4f42473c 100644
--- a/src/app/templates/template-parameter-labels.ts
+++ b/src/app/templates/template-parameter-labels.ts
@@ -1,4 +1,4 @@
-export const clientParameterLabels =  [
+export const clientParameterLabels = [
   '{{client.accountNo}}',
   '{{client.status.value}}',
   '{{client.fullname}}',
@@ -8,7 +8,7 @@ export const clientParameterLabels =  [
   '{{/client.groups}}'
 ];
 
-export const loanParameterLabels =  [
+export const loanParameterLabels = [
   '{{loan.accountNo}}',
   '{{loan.status.value}}',
   '{{loan.loanProductId}}',
@@ -16,7 +16,7 @@ export const loanParameterLabels =  [
   '{{loan.loanProductDescription}}'
 ];
 
-export const repaymentParameterLabels =  [
+export const repaymentParameterLabels = [
   '{{loan.repaymentSchedule.loanTermInDays}}',
   '{{loan.repaymentSchedule.totalPrincipalDisbursed}}',
   '{{loan.repaymentSchedule.totalPrincipalExpected}}',
diff --git a/src/app/templates/templates-routing.module.ts b/src/app/templates/templates-routing.module.ts
index 0a9d27a70..0d861c6ea 100644
--- a/src/app/templates/templates-routing.module.ts
+++ b/src/app/templates/templates-routing.module.ts
@@ -63,6 +63,7 @@ const routes: Routes = [
       ]
     }
   ])
+
 ];
 
 /**
@@ -80,4 +81,4 @@ const routes: Routes = [
     CreateTemplateResolver
   ]
 })
-export class TemplatesRoutingModule { }
+export class TemplatesRoutingModule {}
diff --git a/src/app/templates/templates.component.spec.ts b/src/app/templates/templates.component.spec.ts
index b5c63aa3e..e5fe5593b 100644
--- a/src/app/templates/templates.component.spec.ts
+++ b/src/app/templates/templates.component.spec.ts
@@ -8,9 +8,8 @@ describe('TemplatesComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ TemplatesComponent ]
-    })
-    .compileComponents();
+      declarations: [TemplatesComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/templates/templates.component.ts b/src/app/templates/templates.component.ts
index 37f5633e8..6d99e2129 100644
--- a/src/app/templates/templates.component.ts
+++ b/src/app/templates/templates.component.ts
@@ -14,11 +14,14 @@ import { ActivatedRoute } from '@angular/router';
   styleUrls: ['./templates.component.scss']
 })
 export class TemplatesComponent implements OnInit {
-
   /** Templates data. */
   templatesData: any;
   /** Columns to be displayed in templates table. */
-  displayedColumns: string[] = ['entity', 'type', 'name'];
+  displayedColumns: string[] = [
+    'entity',
+    'type',
+    'name'
+  ];
   /** Data source for templates table. */
   dataSource: MatTableDataSource;
 
@@ -32,7 +35,7 @@ export class TemplatesComponent implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    */
   constructor(private route: ActivatedRoute) {
-    this.route.data.subscribe(( data: { templates: any }) => {
+    this.route.data.subscribe((data: { templates: any }) => {
       this.templatesData = data.templates;
     });
   }
@@ -60,5 +63,4 @@ export class TemplatesComponent implements OnInit {
     this.dataSource.paginator = this.paginator;
     this.dataSource.sort = this.sort;
   }
-
 }
diff --git a/src/app/templates/templates.module.ts b/src/app/templates/templates.module.ts
index 18b3ab841..d74c64f7d 100644
--- a/src/app/templates/templates.module.ts
+++ b/src/app/templates/templates.module.ts
@@ -29,7 +29,7 @@ import { CreateTemplateComponent } from './create-template/create-template.compo
     TemplatesComponent,
     ViewTemplateComponent,
     EditTemplateComponent,
-    CreateTemplateComponent,
+    CreateTemplateComponent
   ]
 })
-export class TemplatesModule { }
+export class TemplatesModule {}
diff --git a/src/app/templates/templates.service.ts b/src/app/templates/templates.service.ts
index 8d7f9ea16..e7bc5008e 100644
--- a/src/app/templates/templates.service.ts
+++ b/src/app/templates/templates.service.ts
@@ -12,11 +12,10 @@ import { Observable } from 'rxjs';
   providedIn: 'root'
 })
 export class TemplatesService {
-
   /**
    * @param {HttpClient} http Http Client to send requests.
    */
-  constructor(private http: HttpClient) { }
+  constructor(private http: HttpClient) {}
 
   /**
    * @returns {Observable} Templates data
@@ -53,7 +52,7 @@ export class TemplatesService {
    * @param templateId Template Id.
    * @returns {Observable}.
    */
-  createTemplate(templateData: any): Observable  {
+  createTemplate(templateData: any): Observable {
     return this.http.post(`/templates`, templateData);
   }
 
@@ -62,7 +61,7 @@ export class TemplatesService {
    * @param templateId Template Id.
    * @returns {Observable}.
    */
-  updateTemplate(templateData: any, templateId: any): Observable  {
+  updateTemplate(templateData: any, templateId: any): Observable {
     return this.http.put(`/templates/${templateId}`, templateData);
   }
 
@@ -73,5 +72,4 @@ export class TemplatesService {
   deleteTemplate(templateId: string): Observable {
     return this.http.delete(`/templates/${templateId}`);
   }
-
 }
diff --git a/src/app/templates/view-template/view-template.component.spec.ts b/src/app/templates/view-template/view-template.component.spec.ts
index f4972ab23..2ffd0255c 100644
--- a/src/app/templates/view-template/view-template.component.spec.ts
+++ b/src/app/templates/view-template/view-template.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewTemplateComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewTemplateComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewTemplateComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/templates/view-template/view-template.component.ts b/src/app/templates/view-template/view-template.component.ts
index 98f4b88d9..5ea08a740 100644
--- a/src/app/templates/view-template/view-template.component.ts
+++ b/src/app/templates/view-template/view-template.component.ts
@@ -18,7 +18,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co
   styleUrls: ['./view-template.component.scss']
 })
 export class ViewTemplateComponent {
-
   /** Template Data */
   templateData: any;
 
@@ -29,10 +28,12 @@ export class ViewTemplateComponent {
    * @param {Router} router Router for navigation.
    * @param {MatDialog} dialog Dialog reference.
    */
-  constructor(private route: ActivatedRoute,
-              private templatesService: TemplatesService,
-              private router: Router,
-              private dialog: MatDialog) {
+  constructor(
+    private route: ActivatedRoute,
+    private templatesService: TemplatesService,
+    private router: Router,
+    private dialog: MatDialog
+  ) {
     this.route.data.subscribe((data: { template: any }) => {
       this.templateData = data.template;
     });
@@ -47,12 +48,10 @@ export class ViewTemplateComponent {
     });
     deleteTemplateDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
-        this.templatesService.deleteTemplate(this.templateData.id)
-          .subscribe(() => {
-            this.router.navigate(['/templates']);
-          });
+        this.templatesService.deleteTemplate(this.templateData.id).subscribe(() => {
+          this.router.navigate(['/templates']);
+        });
       }
     });
   }
-
 }
diff --git a/src/app/users/create-user/create-user.component.spec.ts b/src/app/users/create-user/create-user.component.spec.ts
index 0489eff4e..c2f14c7ec 100644
--- a/src/app/users/create-user/create-user.component.spec.ts
+++ b/src/app/users/create-user/create-user.component.spec.ts
@@ -8,9 +8,8 @@ describe('CreateUserComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CreateUserComponent ]
-    })
-    .compileComponents();
+      declarations: [CreateUserComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/users/create-user/create-user.component.ts b/src/app/users/create-user/create-user.component.ts
index 9a8bd47b2..3785872f7 100644
--- a/src/app/users/create-user/create-user.component.ts
+++ b/src/app/users/create-user/create-user.component.ts
@@ -1,6 +1,5 @@
 /** Angular Imports */
-import { Component, OnInit, TemplateRef, ElementRef , ViewChild,
-         AfterViewInit } from '@angular/core';
+import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
 import { UntypedFormGroup, UntypedFormBuilder, UntypedFormControl, Validators } from '@angular/forms';
 import { Router, ActivatedRoute } from '@angular/router';
 import { MatDialog } from '@angular/material/dialog';
@@ -24,7 +23,6 @@ import { ContinueSetupDialogComponent } from 'app/configuration-wizard/continue-
   styleUrls: ['./create-user.component.scss']
 })
 export class CreateUserComponent implements OnInit, AfterViewInit {
-
   /** User form. */
   userForm: UntypedFormGroup;
   /** Offices data. */
@@ -48,20 +46,20 @@ export class CreateUserComponent implements OnInit, AfterViewInit {
    * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
    * @param {PopoverService} popoverService PopoverService.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private usersService: UsersService,
-              private route: ActivatedRoute,
-              private router: Router,
-              private popoverService: PopoverService,
-              private configurationWizardService: ConfigurationWizardService,
-              private dialog: MatDialog,
-              private passwordsUtility: PasswordsUtility) {
-    this.route.data.subscribe((data: {
-        usersTemplate: any
-      }) => {
-        this.officesData = data.usersTemplate.allowedOffices;
-        this.rolesData = data.usersTemplate.availableRoles;
-      });
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private usersService: UsersService,
+    private route: ActivatedRoute,
+    private router: Router,
+    private popoverService: PopoverService,
+    private configurationWizardService: ConfigurationWizardService,
+    private dialog: MatDialog,
+    private passwordsUtility: PasswordsUtility
+  ) {
+    this.route.data.subscribe((data: { usersTemplate: any }) => {
+      this.officesData = data.usersTemplate.allowedOffices;
+      this.rolesData = data.usersTemplate.availableRoles;
+    });
   }
 
   /**
@@ -77,17 +75,45 @@ export class CreateUserComponent implements OnInit, AfterViewInit {
    * Creates the user form.
    */
   createUserForm() {
-    this.userForm = this.formBuilder.group({
-      'username': ['', Validators.required],
-      'email': ['', [Validators.required, Validators.email]],
-      'firstname': ['', [Validators.required, Validators.pattern('(^[A-z]).*')]],
-      'lastname': ['', [Validators.required, Validators.pattern('(^[A-z]).*')]],
-      'sendPasswordToEmail': [true],
-      'passwordNeverExpires': [false],
-      'officeId': ['', Validators.required],
-      'staffId': [''],
-      'roles': ['', Validators.required]
-    }, { validator: confirmPasswordValidator });
+    this.userForm = this.formBuilder.group(
+      {
+        username: [
+          '',
+          Validators.required
+        ],
+        email: [
+          '',
+          [
+            Validators.required,
+            Validators.email
+          ]
+        ],
+        firstname: [
+          '',
+          [
+            Validators.required,
+            Validators.pattern('(^[A-z]).*')]
+        ],
+        lastname: [
+          '',
+          [
+            Validators.required,
+            Validators.pattern('(^[A-z]).*')]
+        ],
+        sendPasswordToEmail: [true],
+        passwordNeverExpires: [false],
+        officeId: [
+          '',
+          Validators.required
+        ],
+        staffId: [''],
+        roles: [
+          '',
+          Validators.required
+        ]
+      },
+      { validator: confirmPasswordValidator }
+    );
   }
 
   /**
@@ -110,10 +136,18 @@ export class CreateUserComponent implements OnInit, AfterViewInit {
       if (sendPasswordToEmail) {
         this.userForm.removeControl('password');
         this.userForm.removeControl('repeatPassword');
-        this.userForm.get('email').setValidators([Validators.required, Validators.email]);
+        this.userForm.get('email').setValidators([
+          Validators.required,
+          Validators.email
+        ]);
       } else {
         this.userForm.addControl('password', new UntypedFormControl('', this.passwordsUtility.getPasswordValidators()));
-        this.userForm.addControl('repeatPassword', new UntypedFormControl('', [Validators.required, this.passwordsUtility.confirmPassword('password')]));
+        this.userForm.addControl(
+          'repeatPassword',
+          new UntypedFormControl('', [
+            Validators.required,
+            this.passwordsUtility.confirmPassword('password')])
+        );
         this.userForm.get('email').setValidators([Validators.email]);
       }
       this.userForm.get('email').updateValueAndValidity();
@@ -134,7 +168,13 @@ export class CreateUserComponent implements OnInit, AfterViewInit {
         this.configurationWizardService.showUsersForm = false;
         this.openDialog();
       } else {
-        this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
+        this.router.navigate(
+          [
+            '../',
+            response.resourceId
+          ],
+          { relativeTo: this.route }
+        );
       }
     });
   }
@@ -146,7 +186,12 @@ export class CreateUserComponent implements OnInit, AfterViewInit {
    * @param position String.
    * @param backdrop Boolean.
    */
-  showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+  showPopover(
+    template: TemplateRef,
+    target: HTMLElement | ElementRef,
+    position: string,
+    backdrop: boolean
+  ): void {
     setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
   }
 
@@ -155,9 +200,9 @@ export class CreateUserComponent implements OnInit, AfterViewInit {
    */
   ngAfterViewInit() {
     if (this.configurationWizardService.showUsersForm === true) {
-    setTimeout(() => {
+      setTimeout(() => {
         this.showPopover(this.templateUserFormRef, this.userFormRef.nativeElement, 'top', true);
-    });
+      });
     }
   }
 
@@ -186,22 +231,22 @@ export class CreateUserComponent implements OnInit, AfterViewInit {
     const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, {
       data: {
         stepName: 'user'
-      },
+      }
     });
     continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => {
       if (response.step === 1) {
-          this.configurationWizardService.showUsersForm = false;
-          this.router.navigate(['../'], { relativeTo: this.route });
-        } else if (response.step === 2) {
-          this.configurationWizardService.showUsersForm = true;
-          this.router.routeReuseStrategy.shouldReuseRoute = () => false;
-          this.router.onSameUrlNavigation = 'reload';
-          this.router.navigate(['/organization/users/create']);
-        } else if (response.step === 3) {
-          this.configurationWizardService.showUsersForm = false;
-          this.configurationWizardService.showMakerCheckerTable = true;
-          this.router.navigate(['/system']);
-        }
+        this.configurationWizardService.showUsersForm = false;
+        this.router.navigate(['../'], { relativeTo: this.route });
+      } else if (response.step === 2) {
+        this.configurationWizardService.showUsersForm = true;
+        this.router.routeReuseStrategy.shouldReuseRoute = () => false;
+        this.router.onSameUrlNavigation = 'reload';
+        this.router.navigate(['/organization/users/create']);
+      } else if (response.step === 3) {
+        this.configurationWizardService.showUsersForm = false;
+        this.configurationWizardService.showMakerCheckerTable = true;
+        this.router.navigate(['/system']);
+      }
     });
   }
 }
diff --git a/src/app/users/edit-user/edit-user.component.spec.ts b/src/app/users/edit-user/edit-user.component.spec.ts
index 3702bd7a3..a8d5bb071 100644
--- a/src/app/users/edit-user/edit-user.component.spec.ts
+++ b/src/app/users/edit-user/edit-user.component.spec.ts
@@ -8,9 +8,8 @@ describe('EditUserComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ EditUserComponent ]
-    })
-    .compileComponents();
+      declarations: [EditUserComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/users/edit-user/edit-user.component.ts b/src/app/users/edit-user/edit-user.component.ts
index 51495b8d8..05fa2d047 100644
--- a/src/app/users/edit-user/edit-user.component.ts
+++ b/src/app/users/edit-user/edit-user.component.ts
@@ -10,12 +10,11 @@ import { UsersService } from '../users.service';
  * Edit User Component.
  */
 @Component({
-    selector: 'mifosx-edit-user',
-    templateUrl: './edit-user.component.html',
-    styleUrls: ['./edit-user.component.scss']
+  selector: 'mifosx-edit-user',
+  templateUrl: './edit-user.component.html',
+  styleUrls: ['./edit-user.component.scss']
 })
 export class EditUserComponent implements OnInit {
-
   /** User Data */
   userData: any;
   /** Offices Data */
@@ -34,11 +33,13 @@ export class EditUserComponent implements OnInit {
    * @param {ActivatedRoute} route Activated Route.
    * @param {Router} router Router for navigation.
    */
-  constructor(private formBuilder: UntypedFormBuilder,
-              private usersService: UsersService,
-              private route: ActivatedRoute,
-              private router: Router) {
-    this.route.data.subscribe((data: { user: any, usersTemplate: any }) => {
+  constructor(
+    private formBuilder: UntypedFormBuilder,
+    private usersService: UsersService,
+    private route: ActivatedRoute,
+    private router: Router
+  ) {
+    this.route.data.subscribe((data: { user: any; usersTemplate: any }) => {
       this.userData = data.user;
       this.officesData = data.usersTemplate.allowedOffices;
       this.rolesData = data.usersTemplate.availableRoles;
@@ -56,14 +57,39 @@ export class EditUserComponent implements OnInit {
   createEditUserForm() {
     const staffId = this.userData.staff ? this.userData.staff.id : null;
     this.editUserForm = this.formBuilder.group({
-      'username': [this.userData.username, Validators.required],
-      'email': [this.userData.email, [Validators.required, Validators.email]],
-      'firstname': [this.userData.firstname, [Validators.required, Validators.pattern('(^[A-z]).*')]],
-      'lastname': [this.userData.lastname, [Validators.required, Validators.pattern('(^[A-z]).*')]],
-      'passwordNeverExpires': [this.userData.passwordNeverExpires],
-      'officeId': [this.userData.officeId, Validators.required],
-      'staffId': [staffId],
-      'roles': [this.userData.selectedRoles.map((role: any) => role.id), Validators.required]
+      username: [
+        this.userData.username,
+        Validators.required
+      ],
+      email: [
+        this.userData.email,
+        [
+          Validators.required,
+          Validators.email
+        ]
+      ],
+      firstname: [
+        this.userData.firstname,
+        [
+          Validators.required,
+          Validators.pattern('(^[A-z]).*')]
+      ],
+      lastname: [
+        this.userData.lastname,
+        [
+          Validators.required,
+          Validators.pattern('(^[A-z]).*')]
+      ],
+      passwordNeverExpires: [this.userData.passwordNeverExpires],
+      officeId: [
+        this.userData.officeId,
+        Validators.required
+      ],
+      staffId: [staffId],
+      roles: [
+        this.userData.selectedRoles.map((role: any) => role.id),
+        Validators.required
+      ]
     });
   }
 
@@ -85,8 +111,13 @@ export class EditUserComponent implements OnInit {
   submit() {
     const editedUser = this.editUserForm.value;
     this.usersService.editUser(this.userData.id, editedUser).subscribe((response: any) => {
-      this.router.navigate(['../../', response.resourceId], { relativeTo: this.route });
+      this.router.navigate(
+        [
+          '../../',
+          response.resourceId
+        ],
+        { relativeTo: this.route }
+      );
     });
   }
-
 }
diff --git a/src/app/users/user.resolver.ts b/src/app/users/user.resolver.ts
index 22d085aab..4f21650d8 100644
--- a/src/app/users/user.resolver.ts
+++ b/src/app/users/user.resolver.ts
@@ -13,7 +13,6 @@ import { UsersService } from './users.service';
  */
 @Injectable()
 export class UserResolver implements Resolve {
-
   /**
    * @param {UsersService} usersService Users service.
    */
diff --git a/src/app/users/users-routing.module.ts b/src/app/users/users-routing.module.ts
index 7d4386266..cd3a1fbe7 100644
--- a/src/app/users/users-routing.module.ts
+++ b/src/app/users/users-routing.module.ts
@@ -63,6 +63,7 @@ const routes: Routes = [
       ]
     }
   ])
+
 ];
 
 /**
@@ -79,4 +80,4 @@ const routes: Routes = [
     UserResolver
   ]
 })
-export class UsersRoutingModule { }
+export class UsersRoutingModule {}
diff --git a/src/app/users/users-template.resolver.ts b/src/app/users/users-template.resolver.ts
index 774ef5c21..3c7dd9d28 100644
--- a/src/app/users/users-template.resolver.ts
+++ b/src/app/users/users-template.resolver.ts
@@ -13,7 +13,6 @@ import { UsersService } from './users.service';
  */
 @Injectable()
 export class UsersTemplateResolver implements Resolve {
-
   /**
    * @param {UsersService} usersService Users service.
    */
@@ -26,5 +25,4 @@ export class UsersTemplateResolver implements Resolve {
   resolve(): Observable {
     return this.usersService.getUsersTemplate();
   }
-
 }
diff --git a/src/app/users/users.component.spec.ts b/src/app/users/users.component.spec.ts
index 909b5bafc..6baec2df2 100644
--- a/src/app/users/users.component.spec.ts
+++ b/src/app/users/users.component.spec.ts
@@ -8,9 +8,8 @@ describe('UsersComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ UsersComponent ]
-    })
-    .compileComponents();
+      declarations: [UsersComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/users/users.component.ts b/src/app/users/users.component.ts
index 0b187a534..5b3177794 100644
--- a/src/app/users/users.component.ts
+++ b/src/app/users/users.component.ts
@@ -1,5 +1,5 @@
 /** Angular Imports */
-import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit  } from '@angular/core';
+import { Component, OnInit, TemplateRef, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
 import { ActivatedRoute, Router } from '@angular/router';
 import { MatPaginator } from '@angular/material/paginator';
 import { MatSort } from '@angular/material/sort';
@@ -21,11 +21,15 @@ import { ConfigurationWizardService } from '../configuration-wizard/configuratio
   styleUrls: ['./users.component.scss']
 })
 export class UsersComponent implements OnInit, AfterViewInit {
-
   /** Users data. */
   usersData: any;
   /** Columns to be displayed in users table. */
-  displayedColumns: string[] = ['firstname', 'lastname', 'email', 'officeName'];
+  displayedColumns: string[] = [
+    'firstname',
+    'lastname',
+    'email',
+    'officeName'
+  ];
   /** Data source for users table. */
   dataSource: MatTableDataSource;
 
@@ -50,11 +54,13 @@ export class UsersComponent implements OnInit, AfterViewInit {
    * @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
    * @param {PopoverService} popoverService PopoverService.
    */
-  constructor(private route: ActivatedRoute,
-              private router: Router,
-              private configurationWizardService: ConfigurationWizardService,
-              private popoverService: PopoverService) {
-    this.route.data.subscribe(( data: { users: any }) => {
+  constructor(
+    private route: ActivatedRoute,
+    private router: Router,
+    private configurationWizardService: ConfigurationWizardService,
+    private popoverService: PopoverService
+  ) {
+    this.route.data.subscribe((data: { users: any }) => {
       this.usersData = data.users;
     });
   }
@@ -90,7 +96,12 @@ export class UsersComponent implements OnInit, AfterViewInit {
    * @param position String.
    * @param backdrop Boolean.
    */
-  showPopover(template: TemplateRef, target: HTMLElement | ElementRef, position: string, backdrop: boolean): void {
+  showPopover(
+    template: TemplateRef,
+    target: HTMLElement | ElementRef,
+    position: string,
+    backdrop: boolean
+  ): void {
     setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
   }
 
@@ -130,5 +141,4 @@ export class UsersComponent implements OnInit, AfterViewInit {
     this.configurationWizardService.showRolesandPermissionList = true;
     this.router.navigate(['/system/roles-and-permissions']);
   }
-
 }
diff --git a/src/app/users/users.module.ts b/src/app/users/users.module.ts
index 313f85e9e..2fd3af459 100644
--- a/src/app/users/users.module.ts
+++ b/src/app/users/users.module.ts
@@ -28,4 +28,4 @@ import { EditUserComponent } from './edit-user/edit-user.component';
     EditUserComponent
   ]
 })
-export class UsersModule { }
+export class UsersModule {}
diff --git a/src/app/users/users.resolver.ts b/src/app/users/users.resolver.ts
index ada6ef705..a4070ecdc 100644
--- a/src/app/users/users.resolver.ts
+++ b/src/app/users/users.resolver.ts
@@ -13,7 +13,6 @@ import { UsersService } from './users.service';
  */
 @Injectable()
 export class UsersResolver implements Resolve {
-
   /**
    * @param {UsersService} usersService Users service.
    */
@@ -26,5 +25,4 @@ export class UsersResolver implements Resolve {
   resolve(): Observable {
     return this.usersService.getUsers();
   }
-
 }
diff --git a/src/app/users/users.service.ts b/src/app/users/users.service.ts
index 1eaf6b6f7..20e62300a 100644
--- a/src/app/users/users.service.ts
+++ b/src/app/users/users.service.ts
@@ -12,11 +12,10 @@ import { Observable } from 'rxjs';
   providedIn: 'root'
 })
 export class UsersService {
-
   /**
    * @param {HttpClient} http Http Client to send requests.
    */
-  constructor(private http: HttpClient) { }
+  constructor(private http: HttpClient) {}
 
   /**
    * @returns {Observable} Users data
@@ -80,10 +79,7 @@ export class UsersService {
    * @returns {Observable} Staff data.
    */
   getStaff(officeId: any): Observable {
-    const httpParams = new HttpParams()
-      .set('officeId', officeId.toString())
-      .set('status', 'all');
+    const httpParams = new HttpParams().set('officeId', officeId.toString()).set('status', 'all');
     return this.http.get('/staff', { params: httpParams });
   }
-
 }
diff --git a/src/app/users/view-user/view-user.component.spec.ts b/src/app/users/view-user/view-user.component.spec.ts
index 57516288e..1977898ae 100644
--- a/src/app/users/view-user/view-user.component.spec.ts
+++ b/src/app/users/view-user/view-user.component.spec.ts
@@ -8,9 +8,8 @@ describe('ViewUserComponent', () => {
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ ViewUserComponent ]
-    })
-    .compileComponents();
+      declarations: [ViewUserComponent]
+    }).compileComponents();
   }));
 
   beforeEach(() => {
diff --git a/src/app/users/view-user/view-user.component.ts b/src/app/users/view-user/view-user.component.ts
index b2e2e7ca4..11ee05749 100644
--- a/src/app/users/view-user/view-user.component.ts
+++ b/src/app/users/view-user/view-user.component.ts
@@ -19,7 +19,6 @@ import { ChangePasswordDialogComponent } from 'app/shared/change-password-dialog
   styleUrls: ['./view-user.component.scss']
 })
 export class ViewUserComponent {
-
   /** User Data. */
   userData: any;
 
@@ -30,10 +29,12 @@ export class ViewUserComponent {
    * @param {Router} router Router for navigation.
    * @param {MatDialog} dialog Dialog reference.
    */
-  constructor(private usersService: UsersService,
-              private route: ActivatedRoute,
-              private router: Router,
-              private dialog: MatDialog) {
+  constructor(
+    private usersService: UsersService,
+    private route: ActivatedRoute,
+    private router: Router,
+    private dialog: MatDialog
+  ) {
     this.route.data.subscribe((data: { user: any }) => {
       this.userData = data.user;
     });
@@ -48,10 +49,9 @@ export class ViewUserComponent {
     });
     deleteUserDialogRef.afterClosed().subscribe((response: any) => {
       if (response.delete) {
-        this.usersService.deleteUser(this.userData.id)
-          .subscribe(() => {
-            this.router.navigate(['/appusers']);
-          });
+        this.usersService.deleteUser(this.userData.id).subscribe(() => {
+          this.router.navigate(['/appusers']);
+        });
       }
     });
   }
@@ -69,12 +69,11 @@ export class ViewUserComponent {
         const password = response.password;
         const repeatPassword = response.repeatPassword;
         const firstname = this.userData.firstname;
-        const data = {password: password, repeatPassword: repeatPassword, firstname: firstname};
+        const data = { password: password, repeatPassword: repeatPassword, firstname: firstname };
         this.usersService.changePassword(this.userData.id, data).subscribe(() => {
           this.router.navigate(['/appusers']);
         });
       }
     });
   }
-
 }
diff --git a/src/app/web-app.component.ts b/src/app/web-app.component.ts
index 50ce47e4d..bd5d809f6 100644
--- a/src/app/web-app.component.ts
+++ b/src/app/web-app.component.ts
@@ -71,18 +71,17 @@ registerLocaleData(localeSW);
   animations: [
     trigger('opacityScale', [
       transition(':enter', [
-          style({ opacity: 0, transform: 'scale(.95)' }),
-          animate('100ms ease-out', style({  opacity: 1, transform: 'scale(1)' }))
-      ]),
+        style({ opacity: 0, transform: 'scale(.95)' }),
+        animate('100ms ease-out', style({ opacity: 1, transform: 'scale(1)' }))]),
       transition(':leave', [
-          style({ opacity: 1, transform: 'scale(1)' }),
-          animate('75ms ease-in', style({ opacity: 0, transform: 'scale(.95)' }))
-      ])
+        style({ opacity: 1, transform: 'scale(1)' }),
+        animate('75ms ease-in', style({ opacity: 0, transform: 'scale(.95)' }))])
+
     ])
+
   ]
 })
 export class WebAppComponent implements OnInit {
-
   buttonConfig: KeyboardShortcutsConfiguration;
 
   i18nService: I18nService;
@@ -101,19 +100,21 @@ export class WebAppComponent implements OnInit {
    * @param {IdleTimeoutService} idle Idle timeout service.
    * @param {MatDialog} dialog Dialog component.
    */
-  constructor(private router: Router,
-              private activatedRoute: ActivatedRoute,
-              private titleService: Title,
-              private translateService: TranslateService,
-              private themeStorageService: ThemeStorageService,
-              public snackBar: MatSnackBar,
-              private alertService: AlertService,
-              private settingsService: SettingsService,
-              private authenticationService: AuthenticationService,
-              private themingService: ThemingService,
-              private dateUtils: Dates,
-              private idle: IdleTimeoutService,
-              private dialog: MatDialog) { }
+  constructor(
+    private router: Router,
+    private activatedRoute: ActivatedRoute,
+    private titleService: Title,
+    private translateService: TranslateService,
+    private themeStorageService: ThemeStorageService,
+    public snackBar: MatSnackBar,
+    private alertService: AlertService,
+    private settingsService: SettingsService,
+    private authenticationService: AuthenticationService,
+    private themingService: ThemingService,
+    private dateUtils: Dates,
+    private idle: IdleTimeoutService,
+    private dialog: MatDialog
+  ) {}
 
   @HostBinding('class') public cssClass: string;
 
@@ -133,7 +134,7 @@ export class WebAppComponent implements OnInit {
       this.cssClass = value;
     });
     this.themingService.setInitialDarkMode();
-    this.themingService.setDarkMode((this.settingsService.themeDarkEnabled === 'true'));
+    this.themingService.setDarkMode(this.settingsService.themeDarkEnabled === 'true');
 
     // Setup logger
     if (environment.production) {
@@ -152,7 +153,7 @@ export class WebAppComponent implements OnInit {
     this.i18nService = new I18nService(this.translateService);
 
     // Change page title on navigation or language change, based on route data
-    const onNavigationEnd = this.router.events.pipe(filter(event => event instanceof NavigationEnd));
+    const onNavigationEnd = this.router.events.pipe(filter((event) => event instanceof NavigationEnd));
     merge(this.translateService.onLangChange, onNavigationEnd)
       .pipe(
         map(() => {
@@ -162,10 +163,10 @@ export class WebAppComponent implements OnInit {
           }
           return route;
         }),
-        filter(route => route.outlet === 'primary'),
-        mergeMap(route => route.data)
+        filter((route) => route.outlet === 'primary'),
+        mergeMap((route) => route.data)
       )
-      .subscribe(event => {
+      .subscribe((event) => {
         let title = event['title'];
         if (!title) {
           title = 'APP_NAME';
@@ -219,7 +220,10 @@ export class WebAppComponent implements OnInit {
     if (environment.session.timeout.idleTimeout > 0) {
       this.idle.$onSessionTimeout.subscribe(() => {
         if (this.authenticationService.getUserLoggedIn()) {
-          this.alertService.alert({type: 'Session timeout', message: this.translateService.instant('labels.text.Session timed out')});
+          this.alertService.alert({
+            type: 'Session timeout',
+            message: this.translateService.instant('labels.text.Session timed out')
+          });
           this.dialog.open(SessionTimeoutDialogComponent);
           this.logout();
         }
@@ -228,8 +232,7 @@ export class WebAppComponent implements OnInit {
   }
 
   logout() {
-    this.authenticationService.logout()
-      .subscribe(() => this.router.navigate(['/login'], { replaceUrl: true }));
+    this.authenticationService.logout().subscribe(() => this.router.navigate(['/login'], { replaceUrl: true }));
   }
 
   help() {
@@ -239,7 +242,10 @@ export class WebAppComponent implements OnInit {
   // Monitor all keyboard events and excute keyboard shortcuts
   @HostListener('window:keydown', ['$event'])
   onKeydownHandler(event: KeyboardEvent) {
-    const routeD = this.buttonConfig.buttonCombinations.find(x => (x.ctrlKey === event.ctrlKey && x.shiftKey === event.shiftKey && x.altKey === event.altKey && x.key === event.key));
+    const routeD = this.buttonConfig.buttonCombinations.find(
+      (x) =>
+        x.ctrlKey === event.ctrlKey && x.shiftKey === event.shiftKey && x.altKey === event.altKey && x.key === event.key
+    );
     if (!(routeD === undefined)) {
       switch (routeD.id) {
         case 'logout':
@@ -274,5 +280,4 @@ export class WebAppComponent implements OnInit {
       }
     }
   }
-
 }
diff --git a/src/assets/env.template.js b/src/assets/env.template.js
index 26d31b70f..36c9e8b80 100644
--- a/src/assets/env.template.js
+++ b/src/assets/env.template.js
@@ -35,13 +35,12 @@
   // Time in milliseconds for Session idle timeout, default 300000 seconds
   window['env']['sessionIdleTimeout'] = '$MIFOS_SESSION_IDLE_TIMEOUT';
 
-  // OAuth Server Enabled  
+  // OAuth Server Enabled
   window['env']['oauthServerEnabled'] = '$MIFOS_OAUTH_SERVER_ENABLED';
 
-  // OAuth Server URL  
+  // OAuth Server URL
   window['env']['oauthServerUrl'] = '$MIFOS_OAUTH_SERVER_URL';
 
-  // OAuth Client Id  
+  // OAuth Client Id
   window['env']['oauthAppId'] = '$MIFOS_OAUTH_CLIENT_ID';
-
 })(this);
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index b0cbec57c..62a60f2aa 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -9,8 +9,9 @@ export const environment = {
   fineractPlatformTenantId: window['env']['fineractPlatformTenantId'] || 'default',
   fineractPlatformTenantIds: window['env']['fineractPlatformTenantIds'] || 'default',
   // For connecting to others servers running elsewhere update the base API URL
-  baseApiUrls: window['env']['fineractApiUrls'] ||
-  'https://dev.mifos.io,https://demo.mifos.io,https://qa.mifos.io,https://staging.mifos.io,https://mobile.mifos.io,https://demo.fineract.dev,https://localhost:8443',
+  baseApiUrls:
+    window['env']['fineractApiUrls'] ||
+    'https://dev.mifos.io,https://demo.mifos.io,https://qa.mifos.io,https://staging.mifos.io,https://mobile.mifos.io,https://demo.fineract.dev,https://localhost:8443',
   // For connecting to server running elsewhere set the base API URL
   baseApiUrl: window['env']['fineractApiUrl'] || window.location.protocol + '//' + window.location.hostname,
   oauthServerUrl: window['env']['oauthServerUrl'] || window['env']['fineractApiUrl'] + window['env']['apiProvider'],
@@ -19,17 +20,19 @@ export const environment = {
   apiVersion: window['env']['apiVersion'] || '/v1',
   serverUrl: '',
   oauth: {
-    enabled: window['env']['oauthServerEnabled'] || false,  // For connecting to Mifos X using OAuth2 Authentication change the value to true
+    enabled: window['env']['oauthServerEnabled'] || false, // For connecting to Mifos X using OAuth2 Authentication change the value to true
     serverUrl: window['env']['oauthServerUrl'] || '',
     appId: window['env']['oauthAppId'] || ''
   },
   warningDialog: {
     title: 'Warning',
-    content: 'This system is for authorized use only. Unauthorized access will result in possible legal action. By accessing this system, you acknowledge that you are authorized to do so and that all data stored and processed here is confidential.',
+    content:
+      'This system is for authorized use only. Unauthorized access will result in possible legal action. By accessing this system, you acknowledge that you are authorized to do so and that all data stored and processed here is confidential.',
     buttonText: 'Close'
   },
   defaultLanguage: window['env']['defaultLanguage'] || 'en-US',
-  supportedLanguages: window['env']['supportedLanguages'] || 'cs-CS,de-DE,en-US,es-MX,fr-FR,it-IT,ko-KO,lt-LT,lv-LV,ne-NE,pt-PT,sw-SW',
+  supportedLanguages:
+    window['env']['supportedLanguages'] || 'cs-CS,de-DE,en-US,es-MX,fr-FR,it-IT,ko-KO,lt-LT,lv-LV,ne-NE,pt-PT,sw-SW',
   preloadClients: window['env']['preloadClients'] || true,
 
   defaultCharDelimiter: window['env']['defaultCharDelimiter'] || ',',
@@ -42,11 +45,10 @@ export const environment = {
   waitTimeForCOBCatchUp: window['env']['waitTimeForCOBCatchUp'] || 30,
   session: {
     timeout: {
-      idleTimeout: window['env']['sessionIdleTimeout'] || 300000, // 5 minutes
+      idleTimeout: window['env']['sessionIdleTimeout'] || 300000 // 5 minutes
     }
   }
 };
 
 // Server URL
 environment.serverUrl = `${environment.baseApiUrl}${environment.apiProvider}${environment.apiVersion}`;
-
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 0ba4f6c96..2d9d31b7f 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -14,27 +14,36 @@ export const environment = {
   fineractPlatformTenantId: window['env']['fineractPlatformTenantId'] || 'default',
   fineractPlatformTenantIds: window['env']['fineractPlatformTenantIds'] || 'default',
   // For connecting to others servers running elsewhere update the base API URL
-  baseApiUrls: window['env']['fineractApiUrls'] ||
-    'https://dev.mifos.io,https://demo.mifos.io,https://qa.mifos.io,https://staging.mifos.io,https://mobile.mifos.io,https://demo.fineract.dev,https://localhost:8443,'
-    + window.location.protocol + '//' + window.location.hostname + ':' + window.location.port,
+  baseApiUrls:
+    window['env']['fineractApiUrls'] ||
+    'https://dev.mifos.io,https://demo.mifos.io,https://qa.mifos.io,https://staging.mifos.io,https://mobile.mifos.io,https://demo.fineract.dev,https://localhost:8443,' +
+      window.location.protocol +
+      '//' +
+      window.location.hostname +
+      ':' +
+      window.location.port,
   // For connecting to server running elsewhere set the base API URL
-  baseApiUrl: window['env']['baseApiUrl'] || window.location.protocol + '//' + window.location.hostname + ':' + window.location.port,
+  baseApiUrl:
+    window['env']['baseApiUrl'] ||
+    window.location.protocol + '//' + window.location.hostname + ':' + window.location.port,
   allowServerSwitch: env.allow_switching_backend_instance,
   apiProvider: window['env']['apiProvider'] || '/fineract-provider/api',
   apiVersion: window['env']['apiVersion'] || '/v1',
   serverUrl: '',
   oauth: {
-    enabled: window['env']['oauthServerEnabled'] || false,  // For connecting to Mifos X using OAuth2 Authentication change the value to true
+    enabled: window['env']['oauthServerEnabled'] || false, // For connecting to Mifos X using OAuth2 Authentication change the value to true
     serverUrl: window['env']['oauthServerUrl'] || '',
     appId: window['env']['oauthAppId'] || ''
   },
   warningDialog: {
     title: 'Warning',
-    content: 'This system is for authorized use only. Unauthorized access will result in possible legal action. By accessing this system, you acknowledge that you are authorized to do so and that all data stored and processed here is confidential.',
+    content:
+      'This system is for authorized use only. Unauthorized access will result in possible legal action. By accessing this system, you acknowledge that you are authorized to do so and that all data stored and processed here is confidential.',
     buttonText: 'Close'
   },
   defaultLanguage: window['env']['defaultLanguage'] || 'en-US',
-  supportedLanguages: window['env']['supportedLanguages'] || 'cs-CS,de-DE,en-US,es-MX,fr-FR,it-IT,ko-KO,lt-LT,lv-LV,ne-NE,pt-PT,sw-SW',
+  supportedLanguages:
+    window['env']['supportedLanguages'] || 'cs-CS,de-DE,en-US,es-MX,fr-FR,it-IT,ko-KO,lt-LT,lv-LV,ne-NE,pt-PT,sw-SW',
   preloadClients: window['env']['preloadClients'] || true,
 
   defaultCharDelimiter: window['env']['defaultCharDelimiter'] || ',',
@@ -47,11 +56,10 @@ export const environment = {
   waitTimeForCOBCatchUp: window['env']['waitTimeForCOBCatchUp'] || 30,
   session: {
     timeout: {
-      idleTimeout: window['env']['sessionIdleTimeout'] || 300000, // 5 minutes
+      idleTimeout: window['env']['sessionIdleTimeout'] || 300000 // 5 minutes
     }
   }
 };
 
 // Server URL
 environment.serverUrl = `${environment.baseApiUrl}${environment.apiProvider}${environment.apiVersion}`;
-
diff --git a/src/karma.conf.ts b/src/karma.conf.ts
index 5e459c648..40ba7f75b 100644
--- a/src/karma.conf.ts
+++ b/src/karma.conf.ts
@@ -2,57 +2,47 @@
 
 module.exports = (config: any) => {
   config.set({
-
     // base path that will be used to resolve all patterns (eg. files, exclude)
     basePath: '..',
 
-
     // frameworks to use
     // available frameworks: https://www.npmjs.com/search?q=keywords:karma-adapter
-    frameworks: ['jasmine', '@angular-devkit/build-angular'],
-
+    frameworks: [
+      'jasmine',
+      '@angular-devkit/build-angular'
+    ],
 
     // list of files / patterns to load in the browser
     files: [
       'src/**/*spec.ts',
-      'src/**/*.ts',
+      'src/**/*.ts'
     ],
 
-
     // list of files / patterns to exclude
-    exclude: [
-    ],
-
+    exclude: [],
 
     // preprocess matching files before serving them to the browser
     // available preprocessors: https://www.npmjs.com/search?q=keywords:karma-preprocessor
-    preprocessors: {
-    },
-
+    preprocessors: {},
 
     // test results reporter to use
     // possible values: 'dots', 'progress'
     // available reporters: https://www.npmjs.com/search?q=keywords:karma-reporter
     reporters: ['progress'],
 
-
     // web server port
     port: 9876,
 
-
     // enable / disable colors in the output (reporters and logs)
     colors: true,
 
-
     // level of logging
     // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
     logLevel: config.LOG_INFO,
 
-
     // enable / disable watching file and executing tests whenever any file changes
     autoWatch: true,
 
-
     // start these browsers
     // available browser launchers: https://www.npmjs.com/search?q=keywords:karma-launcher
     browsers: ['Chrome'],
@@ -76,9 +66,12 @@ module.exports = (config: any) => {
       require('karma-chrome-launcher'),
       require('karma-jasmine-html-reporter'),
       require('karma-coverage'),
-      require('@angular-devkit/build-angular/plugins/karma'),
+      require('@angular-devkit/build-angular/plugins/karma')
     ],
 
-    reporter: ['progress', 'kjhtml']
+    reporter: [
+      'progress',
+      'kjhtml'
+    ]
   });
 };
diff --git a/src/main.ts b/src/main.ts
index 0d6bb06a4..e8bc2602f 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -14,5 +14,6 @@ if (environment.production) {
   enableProdMode();
 }
 
-platformBrowserDynamic().bootstrapModule(AppModule)
-  .catch(err => console.log(err));
+platformBrowserDynamic()
+  .bootstrapModule(AppModule)
+  .catch((err) => console.log(err));
diff --git a/src/polyfills.ts b/src/polyfills.ts
index ea1731602..7f108f0e3 100644
--- a/src/polyfills.ts
+++ b/src/polyfills.ts
@@ -3,8 +3,6 @@
  */
 import '@angular/localize/init';
 
-
-
 /**
  * Web Animations `@angular/platform-browser/animations`
  * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
@@ -22,17 +20,15 @@ import '@angular/localize/init';
 // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
 
 /*
-* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
-* with the following flag, it will bypass `zone.js` patch for IE/Edge
-*/
+ * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
+ * with the following flag, it will bypass `zone.js` patch for IE/Edge
+ */
 // (window as any).__Zone_enable_cross_context_check = true;
 
 /***************************************************************************************************
  * Zone JS is required by default for Angular itself.
  */
-import 'zone.js/dist/zone';  // Included with Angular CLI.
-
-
+import 'zone.js/dist/zone'; // Included with Angular CLI.
 
 /***************************************************************************************************
  * APPLICATION IMPORTS
diff --git a/src/test.ts b/src/test.ts
index 7e24186ee..32ce5abc0 100644
--- a/src/test.ts
+++ b/src/test.ts
@@ -5,18 +5,12 @@
 
 import 'zone.js/dist/zone-testing';
 import { getTestBed } from '@angular/core/testing';
-import {
-  BrowserDynamicTestingModule,
-  platformBrowserDynamicTesting
-} from '@angular/platform-browser-dynamic/testing';
+import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
 
 declare const require: any;
 
 // First, initialize the Angular testing environment.
-getTestBed().initTestEnvironment(
-  BrowserDynamicTestingModule,
-  platformBrowserDynamicTesting()
-);
+getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
 // Then we find all the tests.
 const context = require.context('./', true, /\.spec\.ts$/);
 // And load the modules.