taxtank-core 0.0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +16 -0
- package/karma.conf.js +44 -0
- package/ng-package.json +12 -0
- package/package.json +13 -12
- package/src/lib/collections/abstract.collection.ts +83 -0
- package/src/lib/collections/bank-account.collection.ts +171 -0
- package/src/lib/collections/bank-transaction.collection.ts +153 -0
- package/src/lib/collections/client-movement.collection.ts +42 -0
- package/src/lib/collections/client-portfolio-report.collection.ts +47 -0
- package/src/lib/collections/client.collection.ts +5 -0
- package/src/lib/collections/collection-dictionary.ts +112 -0
- package/src/lib/collections/depreciation-forecast.collection.ts +25 -0
- package/src/lib/collections/depreciation.collection.ts +113 -0
- package/src/lib/collections/employee.collection.ts +14 -0
- package/src/lib/collections/income-source.collection.ts +44 -0
- package/src/lib/collections/loan.collection.ts +22 -0
- package/src/lib/collections/logbook.collection.ts +129 -0
- package/src/lib/collections/message-document.collection.ts +16 -0
- package/src/lib/collections/message.collection.ts +27 -0
- package/src/lib/collections/property.collection.ts +88 -0
- package/src/lib/collections/service-price.collection.ts +13 -0
- package/src/lib/collections/service-subscription.collection.ts +20 -0
- package/src/lib/collections/tax-return-category-item.collection.ts +148 -0
- package/src/lib/collections/tax-review.collection.ts +64 -0
- package/src/lib/collections/transaction-allocation.collection.ts +54 -0
- package/src/lib/collections/transaction.collection.ts +170 -0
- package/src/lib/collections/user-event-setting.collection.ts +70 -0
- package/src/lib/db/Enums/address-type.enum.ts +4 -0
- package/src/lib/db/Enums/bank-account-status.enum.ts +4 -0
- package/src/lib/db/Enums/bank-account-type.enum.ts +10 -0
- package/src/lib/db/Enums/bank-connection-status.enum.ts +5 -0
- package/src/lib/db/Enums/bank-transaction-type.enum.ts +4 -0
- package/src/lib/db/Enums/chart-accounts-category.enum.ts +13 -0
- package/src/lib/db/Enums/chart-accounts-etp.enum.ts +7 -0
- package/src/lib/db/Enums/chart-accounts-heading-tax-deductible.enum.ts +6 -0
- package/src/lib/db/Enums/chart-accounts-heading-taxable.enum.ts +6 -0
- package/src/lib/db/Enums/chart-accounts-heading-vehicle-list.enum.ts +4 -0
- package/src/lib/db/Enums/chart-accounts-list.enum.ts +19 -0
- package/src/lib/db/Enums/chart-accounts-metadata-list.enum.ts +14 -0
- package/src/lib/db/Enums/chart-accounts-metadata-type.enum.ts +4 -0
- package/src/lib/db/Enums/chart-accounts-type.enum.ts +4 -0
- package/src/lib/db/Enums/chat-status.enum.ts +4 -0
- package/src/lib/db/Enums/client-details-medicare-exemption.enum.ts +5 -0
- package/src/lib/db/Enums/client-details-work-depreciation-calculation.enum.ts +4 -0
- package/src/lib/db/Enums/client-details-working-holiday-maker.enum.ts +5 -0
- package/src/lib/db/Enums/client-invite-status.enum.ts +4 -0
- package/src/lib/db/Enums/client-invite-type.enum.ts +4 -0
- package/src/lib/db/Enums/depreciation-calculation-percent.enum.ts +7 -0
- package/src/lib/db/Enums/depreciation-calculation.enum.ts +7 -0
- package/src/lib/db/Enums/depreciation-type.enum.ts +6 -0
- package/src/lib/db/Enums/depreciation-write-off-amount.enum.ts +4 -0
- package/src/lib/db/Enums/firm-type.enum.ts +4 -0
- package/src/lib/db/Enums/income-source-type-list-other.enum.ts +6 -0
- package/src/lib/db/Enums/income-source-type-list-salary.enum.ts +3 -0
- package/src/lib/db/Enums/income-source-type-list-work.enum.ts +8 -0
- package/src/lib/db/Enums/income-source-type.enum.ts +5 -0
- package/src/lib/db/Enums/invite-status.enum.ts +5 -0
- package/src/lib/db/Enums/loan-bank-type.enum.ts +10 -0
- package/src/lib/db/Enums/loan-frequency.enum.ts +6 -0
- package/src/lib/db/Enums/loan-interest-type.enum.ts +4 -0
- package/src/lib/db/Enums/loan-payout-type.enum.ts +4 -0
- package/src/lib/db/Enums/loan-repayment-frequency.enum.ts +5 -0
- package/src/lib/db/Enums/loan-repayment-type.enum.ts +4 -0
- package/src/lib/db/Enums/loan-type.enum.ts +12 -0
- package/src/lib/db/Enums/loan-vehicle-type.enum.ts +5 -0
- package/src/lib/db/Enums/phone-type.enum.ts +4 -0
- package/src/lib/db/Enums/property-depreciation-calculation.enum.ts +4 -0
- package/src/lib/db/Enums/property-owner-access.enum.ts +4 -0
- package/src/lib/db/Enums/property-owner-status.enum.ts +5 -0
- package/src/lib/db/Enums/registration-invite-status.enum.ts +4 -0
- package/src/lib/db/Enums/salary-forecast-frequency.enum.ts +6 -0
- package/src/lib/db/Enums/service-notification-status.enum.ts +5 -0
- package/src/lib/db/Enums/service-notification-type.enum.ts +4 -0
- package/src/lib/db/Enums/service-payment-status.enum.ts +4 -0
- package/src/lib/db/Enums/service-price-recurring-interval.enum.ts +6 -0
- package/src/lib/db/Enums/service-price-type.enum.ts +4 -0
- package/src/lib/db/Enums/service-subscription-status.enum.ts +8 -0
- package/src/lib/db/Enums/spare-document-spare-type.enum.ts +4 -0
- package/src/lib/db/Enums/tank-type.enum.ts +5 -0
- package/src/lib/db/Enums/tax-calculation-medicare-exemption.enum.ts +4 -0
- package/src/lib/db/Enums/tax-calculation-type.enum.ts +12 -0
- package/src/lib/db/Enums/tax-return-category-list.enum.ts +26 -0
- package/src/lib/db/Enums/tax-return-category-section.enum.ts +6 -0
- package/src/lib/db/Enums/tax-review-status.enum.ts +11 -0
- package/src/lib/db/Enums/tax-summary-list.enum.ts +15 -0
- package/src/lib/db/Enums/tax-summary-section.enum.ts +6 -0
- package/src/lib/db/Enums/tax-summary-tax-summary.enum.ts +15 -0
- package/src/lib/db/Enums/ticket-feedback.enum.ts +4 -0
- package/src/lib/db/Enums/ticket-status.enum.ts +7 -0
- package/src/lib/db/Enums/ticket-types.enum.ts +3 -0
- package/src/lib/db/Enums/transaction-operation.enum.ts +5 -0
- package/src/lib/db/Enums/transaction-source.enum.ts +4 -0
- package/src/lib/db/Enums/transaction-type.enum.ts +4 -0
- package/src/lib/db/Enums/user-event-status.enum.ts +6 -0
- package/src/lib/db/Enums/user-event-type-frequency.enum.ts +6 -0
- package/src/lib/db/Enums/user-event-type-reminder-type.enum.ts +6 -0
- package/src/lib/db/Enums/user-event-type-reminder.enum.ts +5 -0
- package/src/lib/db/Enums/user-event-type-type.enum.ts +33 -0
- package/src/lib/db/Enums/user-medicare-exemption.enum.ts +5 -0
- package/src/lib/db/Enums/user-roles.enum.ts +13 -0
- package/src/lib/db/Enums/user-status.enum.ts +6 -0
- package/src/lib/db/Enums/user-title.enum.ts +7 -0
- package/src/lib/db/Enums/user-work-depreciation-calculation.enum.ts +4 -0
- package/src/lib/db/Enums/user-working-holiday-maker.enum.ts +5 -0
- package/src/lib/db/Enums/vehicle-claim-method.enum.ts +4 -0
- package/src/lib/db/Enums/vehicle-logbook-purpose.enum.ts +4 -0
- package/src/lib/db/Models/address.ts +20 -0
- package/src/lib/db/Models/bank-account-balance.ts +13 -0
- package/src/lib/db/Models/bank-account-property.ts +9 -0
- package/src/lib/db/Models/bank-account.ts +34 -0
- package/src/lib/db/Models/bank-connection.ts +15 -0
- package/src/lib/db/Models/bank-provider-account.ts +13 -0
- package/src/lib/db/Models/bank-transaction-import.ts +12 -0
- package/src/lib/db/Models/bank-transaction-rule.ts +26 -0
- package/src/lib/db/Models/bank-transaction.ts +17 -0
- package/src/lib/db/Models/bank.ts +12 -0
- package/src/lib/db/Models/basiq-job.ts +9 -0
- package/src/lib/db/Models/borrowing-expense-loan.ts +15 -0
- package/src/lib/db/Models/borrowing-expense.ts +7 -0
- package/src/lib/db/Models/capital-cost-property.ts +14 -0
- package/src/lib/db/Models/capital-cost.ts +4 -0
- package/src/lib/db/Models/chart-accounts-depreciation.ts +11 -0
- package/src/lib/db/Models/chart-accounts-heading.ts +7 -0
- package/src/lib/db/Models/chart-accounts-metadata.ts +12 -0
- package/src/lib/db/Models/chart-accounts-value.ts +13 -0
- package/src/lib/db/Models/chart-accounts.ts +24 -0
- package/src/lib/db/Models/chat.ts +18 -0
- package/src/lib/db/Models/client-details.ts +30 -0
- package/src/lib/db/Models/client-invite.ts +17 -0
- package/src/lib/db/Models/client-movement.ts +13 -0
- package/src/lib/db/Models/country.ts +5 -0
- package/src/lib/db/Models/depreciation-capital-project.ts +14 -0
- package/src/lib/db/Models/depreciation-forecast.ts +19 -0
- package/src/lib/db/Models/depreciation-receipt.ts +12 -0
- package/src/lib/db/Models/depreciation.ts +43 -0
- package/src/lib/db/Models/document-base.ts +10 -0
- package/src/lib/db/Models/document-folder.ts +10 -0
- package/src/lib/db/Models/document.ts +12 -0
- package/src/lib/db/Models/employee-details.ts +8 -0
- package/src/lib/db/Models/employee-invite.ts +10 -0
- package/src/lib/db/Models/financial-data-system.ts +10 -0
- package/src/lib/db/Models/firm-invite.ts +15 -0
- package/src/lib/db/Models/firm.ts +29 -0
- package/src/lib/db/Models/income-source-forecast.ts +13 -0
- package/src/lib/db/Models/income-source-type.ts +9 -0
- package/src/lib/db/Models/income-source.ts +21 -0
- package/src/lib/db/Models/loan-payout.ts +13 -0
- package/src/lib/db/Models/loan.ts +34 -0
- package/src/lib/db/Models/message-document.ts +16 -0
- package/src/lib/db/Models/message.ts +16 -0
- package/src/lib/db/Models/occupation.ts +5 -0
- package/src/lib/db/Models/phone.ts +13 -0
- package/src/lib/db/Models/property-capital-cost.ts +14 -0
- package/src/lib/db/Models/property-category-movement.ts +18 -0
- package/src/lib/db/Models/property-category.ts +14 -0
- package/src/lib/db/Models/property-document.ts +14 -0
- package/src/lib/db/Models/property-forecast.ts +15 -0
- package/src/lib/db/Models/property-owner.ts +21 -0
- package/src/lib/db/Models/property-sold.ts +13 -0
- package/src/lib/db/Models/property-subscription.ts +10 -0
- package/src/lib/db/Models/property-valuation.ts +13 -0
- package/src/lib/db/Models/property.ts +42 -0
- package/src/lib/db/Models/registration-invite.ts +13 -0
- package/src/lib/db/Models/salary-forecast.ts +16 -0
- package/src/lib/db/Models/service-notification.ts +14 -0
- package/src/lib/db/Models/service-payment.ts +12 -0
- package/src/lib/db/Models/service-price.ts +16 -0
- package/src/lib/db/Models/service-product.ts +13 -0
- package/src/lib/db/Models/service-subscription-item.ts +10 -0
- package/src/lib/db/Models/service-subscription.ts +15 -0
- package/src/lib/db/Models/spare-document-category.ts +6 -0
- package/src/lib/db/Models/spare-document.ts +16 -0
- package/src/lib/db/Models/tax-calculation.ts +19 -0
- package/src/lib/db/Models/tax-return-category.ts +13 -0
- package/src/lib/db/Models/tax-return-item.ts +16 -0
- package/src/lib/db/Models/tax-return.ts +9 -0
- package/src/lib/db/Models/tax-review.ts +14 -0
- package/src/lib/db/Models/ticket.ts +20 -0
- package/src/lib/db/Models/transaction-allocation.ts +9 -0
- package/src/lib/db/Models/transaction-base.ts +33 -0
- package/src/lib/db/Models/transaction-metadata.ts +12 -0
- package/src/lib/db/Models/transaction-receipt.ts +12 -0
- package/src/lib/db/Models/transaction.ts +44 -0
- package/src/lib/db/Models/user-event-setting.ts +11 -0
- package/src/lib/db/Models/user-event-type.ts +16 -0
- package/src/lib/db/Models/user-event.ts +14 -0
- package/src/lib/db/Models/user.ts +52 -0
- package/src/lib/db/Models/vehicle-claim.ts +12 -0
- package/src/lib/db/Models/vehicle-logbook.ts +17 -0
- package/src/lib/db/Models/vehicle.ts +9 -0
- package/src/lib/functions/array/index.ts +3 -0
- package/src/lib/functions/array/replace.ts +5 -0
- package/src/lib/functions/array/sort-deep.ts +19 -0
- package/src/lib/functions/array/sort.ts +8 -0
- package/src/lib/functions/clone-deep.ts +4 -0
- package/src/lib/functions/create-date.ts +7 -0
- package/src/lib/functions/enum-to-list.ts +16 -0
- package/src/lib/functions/get-doc-icon.ts +21 -0
- package/src/lib/functions/mat-options-functions.ts +11 -0
- package/src/lib/functions/mat-sort-options.ts +9 -0
- package/src/lib/functions/round-to.ts +9 -0
- package/src/lib/functions/tax-review-filter-predicate.ts +11 -0
- package/src/lib/interfaces/asset-entity-type.enum.ts +10 -0
- package/src/lib/interfaces/asset-type.enum.ts +9 -0
- package/src/lib/interfaces/asset.interface.ts +18 -0
- package/src/lib/interfaces/chart-data.interface.ts +11 -0
- package/src/lib/interfaces/chart-serie.interface.ts +8 -0
- package/src/lib/interfaces/document.interface.ts +20 -0
- package/src/lib/interfaces/documentable.interface.ts +9 -0
- package/src/lib/interfaces/event-listener.interface.ts +9 -0
- package/src/lib/interfaces/income-source-forecast.interface.ts +7 -0
- package/src/lib/interfaces/option.interface.ts +4 -0
- package/src/lib/interfaces/photoable.ts +14 -0
- package/src/lib/interfaces/receipt.interface.ts +13 -0
- package/src/lib/interfaces/salary-forecast.interface.ts +17 -0
- package/src/lib/interfaces/tank.interface.ts +9 -0
- package/src/lib/models/address/address.ts +24 -0
- package/src/lib/models/address/country.ts +17 -0
- package/src/lib/models/bank/bank-account-chart-data.ts +42 -0
- package/src/lib/models/bank/bank-account-property.ts +8 -0
- package/src/lib/models/bank/bank-account-types.const.ts +15 -0
- package/src/lib/models/bank/bank-account.ts +136 -0
- package/src/lib/models/bank/bank-connection.ts +12 -0
- package/src/lib/models/bank/bank-transaction-chart-data.ts +132 -0
- package/src/lib/models/bank/bank-transaction-summary-fields.enum.ts +4 -0
- package/src/lib/models/bank/bank-transaction.ts +74 -0
- package/src/lib/models/bank/bank.ts +21 -0
- package/src/lib/models/bank/basiq-job.ts +4 -0
- package/src/lib/models/bank/basiq-token.ts +16 -0
- package/src/lib/models/bank/type-loan.const.ts +7 -0
- package/src/lib/models/borrowing-expense/borrowing-expense-loan.ts +4 -0
- package/src/lib/models/borrowing-expense/borrowing-expense.ts +4 -0
- package/src/lib/models/chart/chart-data.ts +13 -0
- package/src/lib/models/chart/chart-serie.ts +8 -0
- package/src/lib/models/chart-accounts/chart-accounts-categories.const.ts +85 -0
- package/src/lib/models/chart-accounts/chart-accounts-depreciation.ts +14 -0
- package/src/lib/models/chart-accounts/chart-accounts-heading.ts +6 -0
- package/src/lib/models/chart-accounts/chart-accounts-metadata.ts +15 -0
- package/src/lib/models/chart-accounts/chart-accounts-tax-labels.enum.ts +5 -0
- package/src/lib/models/chart-accounts/chart-accounts.ts +137 -0
- package/src/lib/models/chat/chat-view-type.enum.ts +4 -0
- package/src/lib/models/chat/chat.ts +23 -0
- package/src/lib/models/chat/message-document.ts +18 -0
- package/src/lib/models/chat/message.ts +40 -0
- package/src/lib/models/client/client-details.ts +4 -0
- package/src/lib/models/client/client-invite.ts +70 -0
- package/src/lib/models/client/client-movement.ts +25 -0
- package/src/lib/models/client/client-portfolio-chart-data.ts +65 -0
- package/src/lib/models/client/client-portfolio-report.ts +10 -0
- package/src/lib/models/depreciation/depreciation-capital-project.ts +10 -0
- package/src/lib/models/depreciation/depreciation-forecast.ts +31 -0
- package/src/lib/models/depreciation/depreciation-group-item.ts +20 -0
- package/src/lib/models/depreciation/depreciation-group.enum.ts +7 -0
- package/src/lib/models/depreciation/depreciation-group.ts +25 -0
- package/src/lib/models/depreciation/depreciation-groups.const.ts +35 -0
- package/src/lib/models/depreciation/depreciation-receipt.ts +9 -0
- package/src/lib/models/depreciation/depreciation.ts +174 -0
- package/src/lib/models/document/document-api-url-prefix.enum.ts +7 -0
- package/src/lib/models/document/document-file-types.const.ts +22 -0
- package/src/lib/models/document/document-folder.ts +11 -0
- package/src/lib/models/document/document.ts +29 -0
- package/src/lib/models/employee/employee-details.ts +8 -0
- package/src/lib/models/employee/employee-invite.ts +12 -0
- package/src/lib/models/endpoint/endpoint.ts +35 -0
- package/src/lib/models/endpoint/endpoints.const.ts +157 -0
- package/src/lib/models/event/app-event-type.enum.ts +37 -0
- package/src/lib/models/event/app-event.ts +9 -0
- package/src/lib/models/file/icons-file.enum.ts +5 -0
- package/src/lib/models/financial-year/financial-year.ts +57 -0
- package/src/lib/models/financial-year/month-name-short.enum.ts +19 -0
- package/src/lib/models/financial-year/month-number.enum.ts +19 -0
- package/src/lib/models/financial-year/months.const.ts +1 -0
- package/src/lib/models/firm/firm.ts +31 -0
- package/src/lib/models/income-position/income-position.ts +13 -0
- package/src/lib/models/income-source/income-source-chart-data.ts +57 -0
- package/src/lib/models/income-source/income-source-forecast.ts +35 -0
- package/src/lib/models/income-source/income-source-type.ts +30 -0
- package/src/lib/models/income-source/income-source.ts +57 -0
- package/src/lib/models/income-source/salary-forecast.ts +23 -0
- package/src/lib/models/loan/loan-max-number-of-payments.enum.ts +8 -0
- package/src/lib/models/loan/loan-payment.ts +17 -0
- package/src/lib/models/loan/loan-payout.ts +13 -0
- package/src/lib/models/loan/loan.ts +38 -0
- package/src/lib/models/logbook/default-vehicle-expense.ts +20 -0
- package/src/lib/models/logbook/logbook-period.ts +12 -0
- package/src/lib/models/logbook/logbook-purpose-options.const.ts +6 -0
- package/src/lib/models/logbook/vehicle-claim.ts +27 -0
- package/src/lib/models/logbook/vehicle-logbook.ts +16 -0
- package/src/lib/models/logbook/vehicle.ts +46 -0
- package/src/lib/models/notification/notification-event-types.const.ts +43 -0
- package/src/lib/models/notification/notification.ts +66 -0
- package/src/lib/models/phone/phone.ts +10 -0
- package/src/lib/models/property/calculation-form-item.ts +24 -0
- package/src/lib/models/property/calculation-form-type.enum.ts +7 -0
- package/src/lib/models/property/capital-costs-itmes.const.ts +57 -0
- package/src/lib/models/property/corelogic-suggestion.ts +18 -0
- package/src/lib/models/property/ownership-filter-options.enum.ts +8 -0
- package/src/lib/models/property/property-capital-cost.ts +4 -0
- package/src/lib/models/property/property-category-movement.ts +18 -0
- package/src/lib/models/property/property-category.ts +9 -0
- package/src/lib/models/property/property-document.ts +21 -0
- package/src/lib/models/property/property-equity-chart-data.ts +188 -0
- package/src/lib/models/property/property-equity-chart-item.ts +35 -0
- package/src/lib/models/property/property-equity-chart-type.enum.ts +4 -0
- package/src/lib/models/property/property-forecast.ts +55 -0
- package/src/lib/models/property/property-owner.ts +50 -0
- package/src/lib/models/property/property-sold.ts +10 -0
- package/src/lib/models/property/property-subscription.ts +11 -0
- package/src/lib/models/property/property-valuation.ts +24 -0
- package/src/lib/models/property/property.ts +157 -0
- package/src/lib/models/registration-invite/registration-invite.ts +12 -0
- package/src/lib/models/service-subscription/module-url-list.const.ts +11 -0
- package/src/lib/models/service-subscription/service-payment.ts +8 -0
- package/src/lib/models/service-subscription/service-price.ts +8 -0
- package/src/lib/models/service-subscription/service-product.ts +11 -0
- package/src/lib/models/service-subscription/service-subscription-item.ts +12 -0
- package/src/lib/models/service-subscription/service-subscription.ts +151 -0
- package/src/lib/models/service-subscription/subscription-description.const.ts +8 -0
- package/src/lib/models/service-subscription/subscription-title.const.ts +8 -0
- package/src/lib/models/service-subscription/subscription-type.enum.ts +6 -0
- package/src/lib/models/tax-review/tax-review.ts +96 -0
- package/src/lib/models/tax-summary/tax-return-category-item-details.ts +14 -0
- package/src/lib/models/tax-summary/tax-return-category-item.ts +22 -0
- package/src/lib/models/tax-summary/tax-summary-section.ts +32 -0
- package/src/lib/models/tax-summary/tax-summary-type.enum.ts +7 -0
- package/src/lib/models/tax-summary/tax-summary.ts +79 -0
- package/src/lib/models/transaction/income-amount-type.enum.ts +7 -0
- package/src/lib/models/transaction/transaction-allocation.ts +20 -0
- package/src/lib/models/transaction/transaction-metadata.ts +8 -0
- package/src/lib/models/transaction/transaction-receipt.ts +9 -0
- package/src/lib/models/transaction/transaction.ts +241 -0
- package/src/lib/models/user/my-account-history-initiated-by.enum.ts +4 -0
- package/src/lib/models/user/my-account-history-status.enum.ts +4 -0
- package/src/lib/models/user/my-account-history-type.enum.ts +5 -0
- package/src/lib/models/user/my-account-history.ts +12 -0
- package/src/lib/models/user/occupation.ts +4 -0
- package/src/lib/models/user/user-roles.const.ts +13 -0
- package/src/lib/models/user/user-to-register.ts +7 -0
- package/src/lib/models/user/user-work-position.const.ts +7 -0
- package/src/lib/models/user/user.ts +160 -0
- package/src/lib/models/user-event/user-event-category.enum.ts +9 -0
- package/src/lib/models/user-event/user-event-category.ts +9 -0
- package/src/lib/models/user-event/user-event-setting-field.enum.ts +8 -0
- package/src/lib/models/user-event/user-event-setting.ts +11 -0
- package/src/lib/models/user-event/user-event-type.ts +22 -0
- package/src/lib/services/address/address.service.spec.ts +12 -0
- package/src/lib/services/address/address.service.ts +36 -0
- package/src/lib/services/asset/assets.service.spec.ts +12 -0
- package/src/lib/services/asset/assets.service.ts +51 -0
- package/src/lib/services/auth/auth.service.ts +48 -0
- package/src/lib/services/auth/jwt.service.ts +37 -0
- package/src/lib/services/bank/bank-account-calculation.service.spec.ts +16 -0
- package/src/lib/services/bank/bank-account-calculation.service.ts +38 -0
- package/src/lib/services/bank/bank-account.service.spec.ts +12 -0
- package/src/lib/services/bank/bank-account.service.ts +120 -0
- package/src/lib/services/bank/bank-connection.service.spec.ts +12 -0
- package/src/lib/services/bank/bank-connection.service.ts +42 -0
- package/src/lib/services/bank/bank-transaction-calculation.service.spec.ts +16 -0
- package/src/lib/services/bank/bank-transaction-calculation.service.ts +71 -0
- package/src/lib/services/bank/bank-transaction.service.spec.ts +12 -0
- package/src/lib/services/bank/bank-transaction.service.ts +97 -0
- package/src/lib/services/bank/bank.service.spec.ts +12 -0
- package/src/lib/services/bank/bank.service.ts +16 -0
- package/src/lib/services/bank/basiq.service.spec.ts +12 -0
- package/src/lib/services/bank/basiq.service.ts +103 -0
- package/src/lib/services/base-rest.service.spec.ts +13 -0
- package/src/lib/services/base-rest.service.ts +229 -0
- package/src/lib/services/borrowing-expense/borrowing-expense.service.spec.ts +12 -0
- package/src/lib/services/borrowing-expense/borrowing-expense.service.ts +82 -0
- package/src/lib/services/chart-accounts/chart-accounts-depreciations.service.spec.ts +16 -0
- package/src/lib/services/chart-accounts/chart-accounts-depreciations.service.ts +34 -0
- package/src/lib/services/chart-accounts/chart-accounts.service.spec.ts +12 -0
- package/src/lib/services/chart-accounts/chart-accounts.service.ts +101 -0
- package/src/lib/services/chat/chat.service.spec.ts +16 -0
- package/src/lib/services/chat/chat.service.ts +79 -0
- package/src/lib/services/chat/message-document.service.spec.ts +16 -0
- package/src/lib/services/chat/message-document.service.ts +133 -0
- package/src/lib/services/chat/message.service.spec.ts +16 -0
- package/src/lib/services/chat/message.service.ts +61 -0
- package/src/lib/services/client/client-invite.service.spec.ts +16 -0
- package/src/lib/services/client/client-invite.service.ts +111 -0
- package/src/lib/services/client/client-movement.service.spec.ts +16 -0
- package/src/lib/services/client/client-movement.service.ts +114 -0
- package/src/lib/services/client/client-portfolio-report.service.spec.ts +16 -0
- package/src/lib/services/client/client-portfolio-report.service.ts +34 -0
- package/src/lib/services/depreciation/capital-project.service.spec.ts +16 -0
- package/src/lib/services/depreciation/capital-project.service.ts +69 -0
- package/src/lib/services/depreciation/depreciation.service.spec.ts +12 -0
- package/src/lib/services/depreciation/depreciation.service.ts +171 -0
- package/src/lib/services/document/document-folder.service.spec.ts +16 -0
- package/src/lib/services/document/document-folder.service.ts +95 -0
- package/src/lib/services/employee/employee-invite.service.spec.ts +16 -0
- package/src/lib/services/employee/employee-invite.service.ts +53 -0
- package/src/lib/services/employee/employee.service.spec.ts +16 -0
- package/src/lib/services/employee/employee.service.ts +35 -0
- package/src/lib/services/event/event-dispatcher.service.spec.ts +16 -0
- package/src/lib/services/event/event-dispatcher.service.ts +29 -0
- package/src/lib/services/event/sse.service.spec.ts +16 -0
- package/src/lib/services/event/sse.service.ts +42 -0
- package/src/lib/services/firm/firm.service.spec.ts +16 -0
- package/src/lib/services/firm/firm.service.ts +93 -0
- package/src/lib/services/header-title/header-title.service.spec.ts +12 -0
- package/src/lib/services/header-title/header-title.service.ts +31 -0
- package/src/lib/services/income-source/income-source-forecast.service.spec.ts +16 -0
- package/src/lib/services/income-source/income-source-forecast.service.ts +91 -0
- package/src/lib/services/income-source/income-source.service.spec.ts +12 -0
- package/src/lib/services/income-source/income-source.service.ts +127 -0
- package/src/lib/services/income-source/salary-forecast.service.spec.ts +16 -0
- package/src/lib/services/income-source/salary-forecast.service.ts +92 -0
- package/src/lib/services/intercom/intercom.service.spec.ts +16 -0
- package/src/lib/services/intercom/intercom.service.ts +37 -0
- package/src/lib/services/loan/loan.service.spec.ts +12 -0
- package/src/lib/services/loan/loan.service.ts +166 -0
- package/src/lib/services/notification/notification.service.spec.ts +12 -0
- package/src/lib/services/notification/notification.service.ts +60 -0
- package/src/lib/services/preloader/preloader.service.spec.ts +16 -0
- package/src/lib/services/preloader/preloader.service.ts +28 -0
- package/src/lib/services/property/corelogic.service.spec.ts +12 -0
- package/src/lib/services/property/corelogic.service.ts +47 -0
- package/src/lib/services/property/property-calculation.service.spec.ts +16 -0
- package/src/lib/services/property/property-calculation.service.ts +166 -0
- package/src/lib/services/property/property-capital-cost.service.ts +42 -0
- package/src/lib/services/property/property-category.service.spec.ts +16 -0
- package/src/lib/services/property/property-category.service.ts +15 -0
- package/src/lib/services/property/property-document.service.spec.ts +16 -0
- package/src/lib/services/property/property-document.service.ts +74 -0
- package/src/lib/services/property/property-owner.service.spec.ts +12 -0
- package/src/lib/services/property/property-owner.service.ts +134 -0
- package/src/lib/services/property/property-sold.service.spec.ts +16 -0
- package/src/lib/services/property/property-sold.service.ts +15 -0
- package/src/lib/services/property/property.service.spec.ts +12 -0
- package/src/lib/services/property/property.service.ts +136 -0
- package/src/lib/services/subscription/subscription.service.spec.ts +12 -0
- package/src/lib/services/subscription/subscription.service.ts +153 -0
- package/src/lib/services/tax-review/tax-review-history.service.spec.ts +16 -0
- package/src/lib/services/tax-review/tax-review-history.service.ts +35 -0
- package/src/lib/services/tax-review/tax-review.service.spec.ts +16 -0
- package/src/lib/services/tax-review/tax-review.service.ts +114 -0
- package/src/lib/services/tax-summary/tax-summary.service.ts +70 -0
- package/src/lib/services/transaction/transaction-allocation.service.spec.ts +12 -0
- package/src/lib/services/transaction/transaction-allocation.service.ts +92 -0
- package/src/lib/services/transaction/transaction-calculation.service.spec.ts +16 -0
- package/src/lib/services/transaction/transaction-calculation.service.ts +50 -0
- package/src/lib/services/transaction/transaction.service.spec.ts +12 -0
- package/src/lib/services/transaction/transaction.service.ts +374 -0
- package/src/lib/services/user/occupation.service.spec.ts +12 -0
- package/src/lib/services/user/occupation.service.ts +42 -0
- package/src/lib/services/user/user-switcher.service.ts +34 -0
- package/src/lib/services/user/user.service.spec.ts +12 -0
- package/src/lib/services/user/user.service.ts +140 -0
- package/src/lib/services/user-event/user-event-setting.service.spec.ts +16 -0
- package/src/lib/services/user-event/user-event-setting.service.ts +60 -0
- package/src/lib/services/user-event/user-event-type.service.spec.ts +16 -0
- package/src/lib/services/user-event/user-event-type.service.ts +24 -0
- package/src/lib/services/work/work-tank.service.spec.ts +12 -0
- package/src/lib/services/work/work-tank.service.ts +277 -0
- package/src/lib/tt-core.module.ts +22 -0
- package/src/lib/tt-core.service.spec.ts +16 -0
- package/src/lib/tt-core.service.ts +17 -0
- package/src/public-api.ts +425 -0
- package/src/test.ts +27 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/bundles/taxtank-core.umd.js +0 -97
- package/bundles/taxtank-core.umd.js.map +0 -1
- package/esm2015/lib/tt-core.module.js +0 -33
- package/esm2015/lib/tt-core.service.js +0 -23
- package/esm2015/public-api.js +0 -6
- package/esm2015/taxtank-core.js +0 -5
- package/fesm2015/taxtank-core.js +0 -64
- package/fesm2015/taxtank-core.js.map +0 -1
- package/lib/tt-core.module.d.ts +0 -9
- package/lib/tt-core.service.d.ts +0 -8
- package/public-api.d.ts +0 -2
- package/taxtank-core.d.ts +0 -5
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { Endpoint } from './endpoint';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* List of all app endpoints
|
|
5
|
+
*/
|
|
6
|
+
export const ENDPOINTS: {[key: string]: Endpoint} = {
|
|
7
|
+
ASSETS_GET: new Endpoint('GET', '\\/assets\\/\.\*\\/\\d+'),
|
|
8
|
+
|
|
9
|
+
BANK_ACCOUNTS_GET: new Endpoint('GET', '\\/bank-accounts'),
|
|
10
|
+
BANK_ACCOUNTS_POST: new Endpoint('POST', '\\/bank-accounts'),
|
|
11
|
+
BANK_ACCOUNTS_PUT: new Endpoint('PUT', '\\/bank-accounts\\/\\d+'),
|
|
12
|
+
BANK_CONNECTION_POST: new Endpoint('POST', '\\/bank-connections'),
|
|
13
|
+
BANK_TRANSACTIONS_GET: new Endpoint('GET', '\\/bank-transactions'),
|
|
14
|
+
BANK_TRANSACTIONS_DELETE: new Endpoint('DELETE', '\\/bank-transactions\\/\\d+'),
|
|
15
|
+
BANK_TRANSACTIONS_IMPORT_POST: new Endpoint('POST', '\\/bank-transactions\\/\\d+\\/import'),
|
|
16
|
+
BASIQ_ACCOUNTS_GET: new Endpoint('GET', '\\/basiq\\/\\accounts'),
|
|
17
|
+
|
|
18
|
+
CAPITAL_COSTS_GET: new Endpoint('GET', '\\/capital-costs'),
|
|
19
|
+
CHARTS_INCOME_GET: new Endpoint('GET', '\\/charts\\/\\incomes'),
|
|
20
|
+
CHARTS_EXPENSES_GET: new Endpoint('GET', '\\/charts\\/\\expenses'),
|
|
21
|
+
CHART_ACCOUNTS_GET: new Endpoint('GET', '\\/chart-accounts'),
|
|
22
|
+
CLIENTS_GET: new Endpoint('GET', '\\/clients'),
|
|
23
|
+
CLIENTS_PUT: new Endpoint('PUT', '\\/clients'),
|
|
24
|
+
CLIENTS_EXCLUDE_PUT: new Endpoint('PUT', '\\/clients\\/\\d+\\/exclude'),
|
|
25
|
+
CLIENTS_INVITES_GET: new Endpoint('GET', '\\/clients\\/\\invites'),
|
|
26
|
+
CLIENTS_INVITES_POST: new Endpoint('POST', '\\/clients\\/\\invites'),
|
|
27
|
+
CLIENTS_INVITES_DELETE: new Endpoint('DELETE', '\\/clients\\/\\invites\\/\\d+'),
|
|
28
|
+
CLIENTS_INVITES_ACCEPT_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/accept'),
|
|
29
|
+
CLIENTS_INVITES_REJECT_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/reject'),
|
|
30
|
+
CLIENTS_INVITES_RESEND_POST: new Endpoint('POST', '\\/clients\\/\\invites\\/\\d+\\/resend'),
|
|
31
|
+
CLIENT_MOVEMENTS_GET: new Endpoint('GET', '\\/client-movements'),
|
|
32
|
+
CLIENT_MOVEMENTS_POST: new Endpoint('POST', '\\/client-movements'),
|
|
33
|
+
COUNTRIES_GET: new Endpoint('GET', '\\/countries'),
|
|
34
|
+
|
|
35
|
+
DEPRECIATIONS_CLOSING_GET: new Endpoint('GET', '\\/depreciations\\/\\closing-balance\.\*'),
|
|
36
|
+
DEPRECIATIONS_GET: new Endpoint('GET', '\\/depreciations'),
|
|
37
|
+
DEPRECIATIONS_POST: new Endpoint('POST', '\\/depreciations'),
|
|
38
|
+
DEPRECIATIONS_PUT: new Endpoint('PUT', '\\/depreciations\\/\\d+'),
|
|
39
|
+
|
|
40
|
+
EMPLOYEES_GET: new Endpoint('GET', '\\/employees'),
|
|
41
|
+
EMPLOYEES_INVITES_GET: new Endpoint('GET', '\\/employees\\/\\invites'),
|
|
42
|
+
EMPLOYEES_INVITES_DELETE: new Endpoint('DELETE', '\\/employees\\/\\invites\\/\\d+'),
|
|
43
|
+
EMPLOYEES_INVITE_POST: new Endpoint('POST', '\\/employees\\/\\invites'),
|
|
44
|
+
EMPLOYEES_INVITES_REJECT_POST: new Endpoint('POST', '\\/employees\\/\\invites\\/\\d+\\/\\reject'),
|
|
45
|
+
EMPLOYEES_INVITES_RESEND_POST: new Endpoint('POST', '\\/employees\\/\\invites\\/\\d+\\/\\resend'),
|
|
46
|
+
|
|
47
|
+
FIRM_GET: new Endpoint('GET', '\\/firms'),
|
|
48
|
+
FIRM_CURRENT_GET: new Endpoint('GET', '\\/firms\\/current'),
|
|
49
|
+
FIRM_CURRENT_PUT: new Endpoint('PUT', '\\/firms\\/current\.\*'),
|
|
50
|
+
FIRM_INVITE_POST: new Endpoint('POST', '\\/firms\\/invite'),
|
|
51
|
+
FIRM_REGISTRATION_POST: new Endpoint('POST', '\\/firms\\/registration'),
|
|
52
|
+
FIRM_UPDATE_PHOTO_POST: new Endpoint('POST', '\\/firms\\/photo\.\*'),
|
|
53
|
+
FOLDERS_GET: new Endpoint('GET', '\\/folders'),
|
|
54
|
+
FOLDERS_POST: new Endpoint('POST', '\\/folders'),
|
|
55
|
+
FOLDERS_PUT: new Endpoint('PUT', '\\/folders\\/\\d+'),
|
|
56
|
+
FOLDERS_DOCUMENTS_POST: new Endpoint('POST', '\\/folders\\/\\d+\\/documents'),
|
|
57
|
+
FOLDERS_DOCUMENTS_PUT: new Endpoint('PUT', '\\/folders\\/\\d+\\/documents\\/\\d+'),
|
|
58
|
+
|
|
59
|
+
INCOME_SOURCES_GET: new Endpoint('GET', '\\/income-sources'),
|
|
60
|
+
INCOME_SOURCES_POST: new Endpoint('POST', '\\/income-sources'),
|
|
61
|
+
INCOME_SOURCES_PUT: new Endpoint('PUT', '\\/income-sources'),
|
|
62
|
+
INCOME_SOURCES_DELETE: new Endpoint('DELETE', '\\/income-sources\\/\\d+'),
|
|
63
|
+
INCOME_SOURCE_FORECAST_GET: new Endpoint('GET', '\\/income-source-forecasts'),
|
|
64
|
+
INCOME_SOURCE_FORECAST_POST: new Endpoint('POST', '\\/income-source-forecasts'),
|
|
65
|
+
INCOME_SOURCE_FORECAST_PUT: new Endpoint('PUT', '\\/income-source-forecasts'),
|
|
66
|
+
INCOME_SOURCE_FORECAST_DELETE: new Endpoint('DELETE', '\\/income-source-forecasts\\/\\d+'),
|
|
67
|
+
INCOME_SOURCE_TYPES_GET: new Endpoint('GET', '\\/income-source-types'),
|
|
68
|
+
|
|
69
|
+
LOANS_GET: new Endpoint('GET', '\\/bank-accounts\\/loans'),
|
|
70
|
+
LOANS_POST: new Endpoint('POST', '\\/bank-accounts\\/loans'),
|
|
71
|
+
LOANS_PUT: new Endpoint('PUT', '\\/bank-accounts\\/loans/\\d+'),
|
|
72
|
+
LOANS_PAYOUT_POST: new Endpoint('POST', '\\/loans\\/\\d+\\/payout'),
|
|
73
|
+
LOANS_PAYOUT_PUT: new Endpoint('PUT', '\\/loans\\/\\d+\\/payout\\/\\d+'),
|
|
74
|
+
LOANS_PAYOUT_DELETE: new Endpoint('DELETE', '\\/loans\\/\\d+\\/payout\\/\\d+'),
|
|
75
|
+
LOANS_CALCULATION_POST: new Endpoint('POST', '\\/bank-accounts\\/loans\\/calculation'),
|
|
76
|
+
LOGIN_CHECK_POST: new Endpoint('POST', '\\/login_check'),
|
|
77
|
+
|
|
78
|
+
NOTIFICATIONS_GET: new Endpoint('GET', '\\/service-notifications'),
|
|
79
|
+
|
|
80
|
+
OCCUPATIONS_GET: new Endpoint('GET', '\\/occupations'),
|
|
81
|
+
|
|
82
|
+
PROPERTIES_GET: new Endpoint('GET', '\\/properties'),
|
|
83
|
+
PROPERTIES_POST: new Endpoint('POST', '\\/properties'),
|
|
84
|
+
PROPERTY_PUT: new Endpoint('PUT', '\\/properties/\\d+'),
|
|
85
|
+
PROPERTIES_PUT: new Endpoint('PUT', '\\/properties'),
|
|
86
|
+
PROPERTIES_CATEGORIES_EQUITY_GET: new Endpoint('GET', '\\/properties\\/categories\\/equity'),
|
|
87
|
+
PROPERTIES_CATEGORIES_GET: new Endpoint('GET', '\\/properties\\/categories'),
|
|
88
|
+
PROPERTIES_CATEGORIES_PUT: new Endpoint('PUT', '\\/properties\\/categories\\/\\d+'),
|
|
89
|
+
PROPERTIES_CATEGORIES_POST: new Endpoint('POST', '\\/properties\\/categories'),
|
|
90
|
+
PROPERTIES_CATEGORY_MOVEMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/category-movements'),
|
|
91
|
+
PROPERTIES_CATEGORY_MOVEMENTS_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/category-movements\\/\\d+'),
|
|
92
|
+
PROPERTIES_CO_OWNERS_PUT: new Endpoint('PUT', '\\/properties\\/co-owners\\/\\d+'),
|
|
93
|
+
PROPERTIES_CO_OWNERS_GET: new Endpoint('GET', '\\/properties\\/co-owners'),
|
|
94
|
+
PROPERTIES_CO_OWNERS_POST: new Endpoint('POST', '\\/properties\\/co-owners'),
|
|
95
|
+
PROPERTIES_DEACTIVATE_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/deactivate'),
|
|
96
|
+
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_GET: new Endpoint('GET', '\\/properties\\/\\d+\\/depreciation-capital-projects'),
|
|
97
|
+
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/depreciation-capital-projects'),
|
|
98
|
+
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/depreciation-capital-projects\\/\\d+'),
|
|
99
|
+
PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_DELETE: new Endpoint('DELETE', '\\/properties\\/\\d+\\/depreciation-capital-projects\\/\\d+'),
|
|
100
|
+
PROPERTIES_DOCUMENTS_GET: new Endpoint('GET', '\\/properties\\/documents'),
|
|
101
|
+
PROPERTIES_DOCUMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/documents'),
|
|
102
|
+
PROPERTIES_DOCUMENTS_PUT: new Endpoint('PUT', '\\/properties\\/documents\\/\\d+'),
|
|
103
|
+
PROPERTIES_DOCUMENTS_DELETE: new Endpoint('DELETE', '\\/properties\\/documents\\/\\d+'),
|
|
104
|
+
PROPERTIES_PHOTO_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/photo\.\*'),
|
|
105
|
+
PROPERTIES_SUGGESTIONS_GET: new Endpoint('GET', '/property\\/\\w+\\/v2\\/.*$'),
|
|
106
|
+
PROPERTIES_VALUATIONS_DOCUMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/valuations\\/\\d+\\/documents'),
|
|
107
|
+
|
|
108
|
+
PRORATION_COST_POST: new Endpoint('POST', '\\/subscriptions\\/proration-cost'),
|
|
109
|
+
|
|
110
|
+
SALARY_FORECAST_GET: new Endpoint('GET', '\\/salary-forecasts'),
|
|
111
|
+
SALARY_FORECAST_POST: new Endpoint('POST', '\\/salary-forecasts'),
|
|
112
|
+
SALARY_FORECAST_PUT: new Endpoint('PUT', '\\/salary-forecasts'),
|
|
113
|
+
SERVICE_PRICES_GET: new Endpoint('GET', '\\/service-prices'),
|
|
114
|
+
SERVICE_PAYMENTS_GET: new Endpoint('GET', '\\/service-payments'),
|
|
115
|
+
STRIPE_BILLING_PORTAL_GET: new Endpoint('GET', '\\/stripe\\/billing-portal-session'),
|
|
116
|
+
STRIPE_CHECKOUT_SESSION_POST: new Endpoint('POST', '\\/stripe\\/checkout-session'),
|
|
117
|
+
SUBSCRIPTION_LAST_GET: new Endpoint('GET', '\\/subscriptions\\/last'),
|
|
118
|
+
SUBSCRIPTION_ITEMS_PUT: new Endpoint('PUT', '\\/subscriptions\\/items'),
|
|
119
|
+
|
|
120
|
+
TAX_CALCULATION_POST: new Endpoint('POST', '\\/tax-calculation'),
|
|
121
|
+
TAX_REVIEWS_GET: new Endpoint('GET', '\\/tax-reviews'),
|
|
122
|
+
TAX_REVIEWS_DELETE: new Endpoint('DELETE', '\\/tax-reviews\\/\\d+'),
|
|
123
|
+
TAX_REVIEWS_POST: new Endpoint('POST', '\\/tax-reviews'),
|
|
124
|
+
TAX_REVIEWS_PUT: new Endpoint('PUT', '\\/tax-reviews\\/\\d+'),
|
|
125
|
+
TAX_SUMMARY_ACTUAL_GET: new Endpoint('GET', '\\/tax-summary\\/actuals'),
|
|
126
|
+
TAX_SUMMARY_FORECAST_GET: new Endpoint('GET', '\\/tax-summary\\/forecasts'),
|
|
127
|
+
TRANSACTION_DELETE: new Endpoint('DELETE', '\\/transactions\\/\\d+'),
|
|
128
|
+
TRANSACTION_PUT: new Endpoint('PUT', '\\/transactions\\/\\d+'),
|
|
129
|
+
TRANSACTIONS_GET: new Endpoint('GET', '\\/transactions'),
|
|
130
|
+
TRANSACTIONS_POST: new Endpoint('POST', '\\/transactions'),
|
|
131
|
+
TRANSACTIONS_PUT: new Endpoint('PUT', '\\/transactions'),
|
|
132
|
+
TRANSACTIONS_ALLOCATIONS_GET: new Endpoint('GET', '\\/transactions-allocations'),
|
|
133
|
+
TRANSACTIONS_ALLOCATIONS_POST: new Endpoint('POST', '\\/transactions-allocations'),
|
|
134
|
+
TRANSACTIONS_ALLOCATIONS_DELETE: new Endpoint('DELETE', '\\/transactions-allocations\\/\\d+'),
|
|
135
|
+
|
|
136
|
+
USER_CONFIRMATION_POST: new Endpoint('POST', '\\/users\\/confirmation'),
|
|
137
|
+
USER_CURRENT_GET: new Endpoint('GET', '\\/users\\/current'),
|
|
138
|
+
USER_CURRENT_PASSWORD_PUT: new Endpoint('PUT', '\\/users\\/current\\/password\.\*'),
|
|
139
|
+
USER_EVENT_SETTINGS_GET: new Endpoint('GET', '\\/user-event-settings'),
|
|
140
|
+
USER_EVENT_TYPES_GET: new Endpoint('GET', '\\/user-event-types'),
|
|
141
|
+
USER_INVITE_DELETE: new Endpoint('DELETE', '\\/users\\/invite\\/\\d+'),
|
|
142
|
+
USER_INVITE_POST: new Endpoint('POST', '\\/users\\/invite'),
|
|
143
|
+
USER_INVITE_RESEND_POST: new Endpoint('POST', '\\/users\\/invite/\\d+\\/resend'),
|
|
144
|
+
USER_PUT: new Endpoint('PUT', '\\/users\\/\\d+'),
|
|
145
|
+
USER_REGISTRATION_POST: new Endpoint('POST', '\\/users\\/registration'),
|
|
146
|
+
USER_RESET_PASSWORD_PUT: new Endpoint('PUT', '\\/users\\/reset-password'),
|
|
147
|
+
USER_SEARCH_GET: new Endpoint('GET', '\\/users\\/search\.\*'),
|
|
148
|
+
USER_UPDATE_PHOTO_POST: new Endpoint('POST', '\\/users\\/photo\.\*'),
|
|
149
|
+
USER_STATUS_PUT: new Endpoint('PUT', '\\/users\\/status'),
|
|
150
|
+
|
|
151
|
+
VEHICLES_GET: new Endpoint('GET', '\\/vehicles'),
|
|
152
|
+
VEHICLE_CLAIMS_GET: new Endpoint('GET', '\\/vehicle-claims'),
|
|
153
|
+
VEHICLE_CLAIMS_POST: new Endpoint('POST', '\\/vehicle-claims'),
|
|
154
|
+
VEHICLE_LOGBOOK_POST: new Endpoint('POST', '\\/vehicles\\/\\d+\\/logbooks'),
|
|
155
|
+
VEHICLE_LOGBOOK_PUT: new Endpoint('PUT', '\\/vehicles\\/\\d+\\/logbooks\\/\\d+'),
|
|
156
|
+
VEHICLE_CLAIMS_PUT: new Endpoint('PUT', '\\/vehicle-claims\\/\\d+')
|
|
157
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export enum AppEventTypeEnum {
|
|
2
|
+
CLIENT_MOVEMENT_CLOSED,
|
|
3
|
+
BANK_CONNECTION_ADDED,
|
|
4
|
+
BANK_ACCOUNT_CREATED,
|
|
5
|
+
BANK_ACCOUNT_UPDATED,
|
|
6
|
+
BANK_TRANSACTION_ALLOCATED,
|
|
7
|
+
CLIENT_INVITE_ACCEPTED,
|
|
8
|
+
CLIENT_OPEN_CHAT,
|
|
9
|
+
CLIENT_TRANSFER_TO_OTHER_EMPLOYEE,
|
|
10
|
+
DEPRECIATION_DELETED,
|
|
11
|
+
DEPRECIATIONS_CREATED,
|
|
12
|
+
INCOME_SOURCES_CREATED,
|
|
13
|
+
INCOME_SOURCES_UPDATED,
|
|
14
|
+
INCOME_SOURCES_FORECASTS_CREATED,
|
|
15
|
+
INCOME_SOURCES_FORECASTS_UPDATED,
|
|
16
|
+
LOAN_UPDATED,
|
|
17
|
+
LOAN_PAYOUT_UPDATED,
|
|
18
|
+
MESSAGE_CREATED,
|
|
19
|
+
MESSAGE_FILE_CREATED,
|
|
20
|
+
MESSAGE_FILE_DELETED,
|
|
21
|
+
NOTIFICATION_ADDED,
|
|
22
|
+
PROPERTY_UPDATED_WITH_DOCUMENT,
|
|
23
|
+
PROPERTY_DOCUMENT_ADDED,
|
|
24
|
+
PROPERTY_OWNER_UPDATED,
|
|
25
|
+
PROPERTY_SUBSCRIPTION_ADDED,
|
|
26
|
+
PROPERTY_SUBSCRIPTION_DELETED,
|
|
27
|
+
PROPERTY_VALUATION_DOCUMENT_CREATED,
|
|
28
|
+
SERVICE_SUBSCRIPTION_UPDATED,
|
|
29
|
+
TAX_REVIEW_UPDATED,
|
|
30
|
+
TRANSACTION_CREATED,
|
|
31
|
+
TRANSACTION_DELETED,
|
|
32
|
+
TRANSACTION_UPDATED,
|
|
33
|
+
TRANSACTIONS_CREATED,
|
|
34
|
+
USER_UPDATED,
|
|
35
|
+
VEHICLE_CLAIM_UPDATED,
|
|
36
|
+
VEHICLE_CLAIM_CREATED
|
|
37
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppEventTypeEnum } from './app-event-type.enum';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* any event happened in the app, which needs to be handled somehow (distributed to other part of the app)
|
|
5
|
+
*/
|
|
6
|
+
export class AppEvent<T> {
|
|
7
|
+
constructor(public type: AppEventTypeEnum, public payload: T) {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export class FinancialYear {
|
|
2
|
+
constructor(date?: Date) {
|
|
3
|
+
this.year = date ? FinancialYear.toFinYear(date) : +localStorage.getItem('financialYear') || FinancialYear.toFinYear(new Date());
|
|
4
|
+
|
|
5
|
+
this.setStartDate(this.year);
|
|
6
|
+
this.setEndDate(this.year);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
static startMonthIndex: number = 6;
|
|
10
|
+
year: number;
|
|
11
|
+
startDate: Date;
|
|
12
|
+
endDate: Date;
|
|
13
|
+
|
|
14
|
+
private yearStartDate: string = '-07-01';
|
|
15
|
+
private yearEndDate: string = '-06-30';
|
|
16
|
+
|
|
17
|
+
includes(date: Date): boolean {
|
|
18
|
+
return this.year === new FinancialYear(date).year;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static toFinYear(date: Date): number {
|
|
22
|
+
return date.getFullYear() + (date.getMonth() >= this.startMonthIndex ? 1 : 0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
get prevFinYear(): FinancialYear {
|
|
26
|
+
return new FinancialYear(new Date(`${new Date().getFullYear() - 1}${this.yearStartDate}`));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get date by desired month
|
|
31
|
+
*/
|
|
32
|
+
getMonthDate(monthIndex: number): Date {
|
|
33
|
+
if (monthIndex >= FinancialYear.startMonthIndex) {
|
|
34
|
+
return new Date(`${this.year - 1}-${monthIndex + 1}-01`);
|
|
35
|
+
}
|
|
36
|
+
return new Date(`${this.year}-${monthIndex + 1}-01`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private setStartDate(year: number): void {
|
|
40
|
+
this.startDate = new Date(`${year - 1}${this.yearStartDate}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
private setEndDate(year: number): void {
|
|
44
|
+
this.endDate = new Date(`${year}${this.yearEndDate}`);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
getPastMonths(): number[] {
|
|
48
|
+
const months: number[] = [];
|
|
49
|
+
const now: Date = new Date();
|
|
50
|
+
const endDate: Date = this.endDate < now ? this.endDate : now;
|
|
51
|
+
for (const d: Date = this.startDate; d <= endDate; d.setMonth(d.getMonth() + 1)) {
|
|
52
|
+
months.push(d.getMonth());
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return months;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @TODO move to pipe/translation
|
|
3
|
+
* enum with months short names.
|
|
4
|
+
* Order of items match with financial year months order
|
|
5
|
+
*/
|
|
6
|
+
export enum MonthNameShortEnum {
|
|
7
|
+
JULY = 'Jul',
|
|
8
|
+
AUGUST = 'Aug',
|
|
9
|
+
SEPTEMBER = 'Sep',
|
|
10
|
+
OCTOBER = 'Oct',
|
|
11
|
+
NOVEMBER = 'Nov',
|
|
12
|
+
DECEMBER = 'Dec',
|
|
13
|
+
JANUARY = 'Jan',
|
|
14
|
+
FEBRUARY = 'Feb',
|
|
15
|
+
MARCH = 'Mar',
|
|
16
|
+
APRIL = 'Apr',
|
|
17
|
+
MAY = 'May',
|
|
18
|
+
JUNE = 'Jun'
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* enum with months indexes.
|
|
3
|
+
* item value match with js Date month index from 0 to 11
|
|
4
|
+
* Order of items match with financial year months order
|
|
5
|
+
*/
|
|
6
|
+
export enum MonthNumberEnum {
|
|
7
|
+
JULY = 6,
|
|
8
|
+
AUGUST = 7,
|
|
9
|
+
SEPTEMBER = 8,
|
|
10
|
+
OCTOBER = 9,
|
|
11
|
+
NOVEMBER = 10,
|
|
12
|
+
DECEMBER = 11,
|
|
13
|
+
JANUARY = 0,
|
|
14
|
+
FEBRUARY = 1,
|
|
15
|
+
MARCH = 2,
|
|
16
|
+
APRIL = 3,
|
|
17
|
+
MAY = 4,
|
|
18
|
+
JUNE = 5
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const MONTHS: string[] = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'Jan'];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Firm as FirmBase } from '../../db/Models/firm';
|
|
2
|
+
import { Phone } from '../phone/phone';
|
|
3
|
+
import { Address } from '../address/address';
|
|
4
|
+
import { User } from '../user/user';
|
|
5
|
+
import { Type } from 'class-transformer';
|
|
6
|
+
import { Photoable } from '../../interfaces/photoable';
|
|
7
|
+
|
|
8
|
+
export class Firm extends FirmBase implements Photoable {
|
|
9
|
+
@Type(() => User)
|
|
10
|
+
owner: User;
|
|
11
|
+
|
|
12
|
+
@Type(() => Address)
|
|
13
|
+
address: Address;
|
|
14
|
+
|
|
15
|
+
@Type(() => Phone)
|
|
16
|
+
phone: Phone;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* get firm photo link
|
|
20
|
+
*/
|
|
21
|
+
getPhoto(): string {
|
|
22
|
+
return this.photo;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* get firm initials
|
|
27
|
+
*/
|
|
28
|
+
getInitials(): string {
|
|
29
|
+
return `${this.name[0].toUpperCase()}${this.name[1]}`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
|
|
3
|
+
// Todo extend from the base model when the backend is ready TT-555
|
|
4
|
+
export class IncomePosition {
|
|
5
|
+
@Type(() => Date)
|
|
6
|
+
date: Date;
|
|
7
|
+
income: number;
|
|
8
|
+
expenses: number;
|
|
9
|
+
otherIncome: number;
|
|
10
|
+
otherDeductions: number;
|
|
11
|
+
incomeForecast: number;
|
|
12
|
+
incomeSourceForecast: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { TransactionCollection } from '../../collections/transaction.collection';
|
|
2
|
+
import { IChartData } from '../../interfaces/chart-data.interface';
|
|
3
|
+
import { FinancialYear } from '../financial-year/financial-year';
|
|
4
|
+
import { MonthNameShortEnum } from '../financial-year/month-name-short.enum';
|
|
5
|
+
import { MonthNumberEnum } from '../financial-year/month-number.enum';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Income sources chart data
|
|
9
|
+
*/
|
|
10
|
+
export class IncomeSourceChartData {
|
|
11
|
+
private forecastedIncomeAmount: number;
|
|
12
|
+
private transactions: TransactionCollection;
|
|
13
|
+
|
|
14
|
+
constructor(
|
|
15
|
+
forecastedIncomeAmount: number,
|
|
16
|
+
transactions: TransactionCollection,
|
|
17
|
+
) {
|
|
18
|
+
this.forecastedIncomeAmount = forecastedIncomeAmount;
|
|
19
|
+
this.transactions = transactions;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Get prepared data for income sources chart
|
|
24
|
+
*/
|
|
25
|
+
get(): IChartData[] {
|
|
26
|
+
const chartData: IChartData[] = [{
|
|
27
|
+
id: 'actualIncome',
|
|
28
|
+
name: 'Actual Income',
|
|
29
|
+
data: [],
|
|
30
|
+
// display future actual incomes with dash line and past actual incomes with solid line
|
|
31
|
+
zones: [{
|
|
32
|
+
// line style after current month
|
|
33
|
+
value: new FinancialYear().getMonthDate(new Date().getMonth()).getTime(),
|
|
34
|
+
dashStyle: 'Solid'
|
|
35
|
+
}, {
|
|
36
|
+
// default line style
|
|
37
|
+
dashStyle: 'Dash'
|
|
38
|
+
}]
|
|
39
|
+
}, {
|
|
40
|
+
id: 'forecastedIncome',
|
|
41
|
+
name: 'Forecasted Income',
|
|
42
|
+
data: [],
|
|
43
|
+
}];
|
|
44
|
+
|
|
45
|
+
for (const key in MonthNameShortEnum) {
|
|
46
|
+
if (MonthNameShortEnum.hasOwnProperty(key)) {
|
|
47
|
+
// transaction collection for provided month
|
|
48
|
+
const monthTransactionCollection: TransactionCollection = this.transactions.getByMonth(+MonthNumberEnum[key]);
|
|
49
|
+
|
|
50
|
+
chartData[0].data.push([new FinancialYear().getMonthDate(+MonthNumberEnum[key]).getTime(), monthTransactionCollection.amount]);
|
|
51
|
+
chartData[1].data.push([new FinancialYear().getMonthDate(+MonthNumberEnum[key]).getTime(), this.forecastedIncomeAmount / 12]);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return chartData;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IncomeSourceForecast as IncomeSourceForecastBase } from '../../db/Models/income-source-forecast';
|
|
2
|
+
import { SalaryForecastFrequencyEnum } from '../../db/Enums/salary-forecast-frequency.enum';
|
|
3
|
+
import { IIncomeSourceForecast } from '../../interfaces/income-source-forecast.interface';
|
|
4
|
+
import { Type } from 'class-transformer';
|
|
5
|
+
import { ISalaryForecast } from '../../interfaces/salary-forecast.interface';
|
|
6
|
+
import { IncomeSourceType } from './income-source-type';
|
|
7
|
+
import { IncomeSource } from './income-source';
|
|
8
|
+
|
|
9
|
+
export class IncomeSourceForecast extends IncomeSourceForecastBase implements IIncomeSourceForecast, ISalaryForecast {
|
|
10
|
+
id: number;
|
|
11
|
+
|
|
12
|
+
@Type(() => IncomeSourceType)
|
|
13
|
+
incomeSourceType: IncomeSourceType;
|
|
14
|
+
|
|
15
|
+
tax: number;
|
|
16
|
+
paygIncome: number = 0;
|
|
17
|
+
financialYear: number;
|
|
18
|
+
frequency: SalaryForecastFrequencyEnum = SalaryForecastFrequencyEnum.ANNUAL;
|
|
19
|
+
isTaxFree: boolean = false;
|
|
20
|
+
|
|
21
|
+
@Type(() => IncomeSource)
|
|
22
|
+
incomeSource: IncomeSource;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Sometimes Income source has Salary & Income source forecasts,
|
|
26
|
+
* and we need these fields to work with Income source forecasts like with Salary Forecasts
|
|
27
|
+
*/
|
|
28
|
+
get netPay(): number {
|
|
29
|
+
return this.amount;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
get grossAmount(): number {
|
|
33
|
+
return this.amount + this.tax + this.taxInstalments + this.frankingCredits;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IncomeSourceType as IncomeSourceTypeBase } from '../../db/Models/income-source-type';
|
|
2
|
+
import { IncomeSourceTypeListSalaryEnum } from '../../db/Enums/income-source-type-list-salary.enum';
|
|
3
|
+
import { IncomeSourceTypeListWorkEnum } from '../../db/Enums/income-source-type-list-work.enum';
|
|
4
|
+
import { IncomeSourceTypeListOtherEnum } from '../../db/Enums/income-source-type-list-other.enum';
|
|
5
|
+
import { IncomeSourceTypeEnum } from '../../db/Enums/income-source-type.enum';
|
|
6
|
+
|
|
7
|
+
export class IncomeSourceType extends IncomeSourceTypeBase {
|
|
8
|
+
isSalary(): boolean {
|
|
9
|
+
return !!IncomeSourceTypeListSalaryEnum[this.id];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
isWork(): boolean {
|
|
13
|
+
return !!IncomeSourceTypeListWorkEnum[this.id];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
isOther(): boolean {
|
|
17
|
+
return !!IncomeSourceTypeListOtherEnum[this.id];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get type(): IncomeSourceTypeEnum {
|
|
21
|
+
switch (true) {
|
|
22
|
+
case this.isSalary():
|
|
23
|
+
return IncomeSourceTypeEnum.SALARY;
|
|
24
|
+
case this.isWork():
|
|
25
|
+
return IncomeSourceTypeEnum.WORK;
|
|
26
|
+
default:
|
|
27
|
+
return IncomeSourceTypeEnum.OTHER;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { IncomeSource as IncomeSourceBase } from '../../db/Models/income-source';
|
|
2
|
+
import { IncomeSourceTypeEnum } from '../../db/Enums/income-source-type.enum';
|
|
3
|
+
import { ISalaryForecast } from '../../interfaces/salary-forecast.interface';
|
|
4
|
+
import { IIncomeSourceForecast } from '../../interfaces/income-source-forecast.interface';
|
|
5
|
+
import { Type } from 'class-transformer';
|
|
6
|
+
import { SalaryForecast } from './salary-forecast';
|
|
7
|
+
import { IncomeSourceForecast } from './income-source-forecast';
|
|
8
|
+
import { FinancialYear } from '../financial-year/financial-year';
|
|
9
|
+
|
|
10
|
+
export class IncomeSource extends IncomeSourceBase {
|
|
11
|
+
@Type(() => SalaryForecast)
|
|
12
|
+
salaryForecasts: SalaryForecast[];
|
|
13
|
+
|
|
14
|
+
@Type(() => IncomeSourceForecast)
|
|
15
|
+
incomeSourceForecasts: IncomeSourceForecast[];
|
|
16
|
+
|
|
17
|
+
@Type(() => Date)
|
|
18
|
+
dateFrom: Date;
|
|
19
|
+
|
|
20
|
+
@Type(() => Date)
|
|
21
|
+
dateTo: Date;
|
|
22
|
+
|
|
23
|
+
isSalaryIncome(): boolean {
|
|
24
|
+
return this.type === IncomeSourceTypeEnum.SALARY;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
isWorkIncome(): boolean {
|
|
28
|
+
return this.type === IncomeSourceTypeEnum.WORK;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
isOtherIncome(): boolean {
|
|
32
|
+
return this.type === IncomeSourceTypeEnum.OTHER;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get salary and other income forecasts
|
|
37
|
+
*/
|
|
38
|
+
get forecasts(): ISalaryForecast[] {
|
|
39
|
+
return [...this.salaryForecasts, ...this.incomeSourceForecasts];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get actual (1st from the list) forecast
|
|
44
|
+
*/
|
|
45
|
+
get actualForecast(): IIncomeSourceForecast {
|
|
46
|
+
return this.forecasts[0];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Check if user was working in month taken by the index
|
|
51
|
+
* @param monthIndex by which month should be taken
|
|
52
|
+
*/
|
|
53
|
+
isWorkedInMonth(monthIndex: number): boolean {
|
|
54
|
+
const monthDate: Date = new FinancialYear().getMonthDate(monthIndex);
|
|
55
|
+
return (!this.dateFrom || monthDate >= this.dateFrom) && (!this.dateTo || monthDate < this.dateTo);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SalaryForecast as SalaryForecastBase } from '../../db/Models/salary-forecast';
|
|
2
|
+
import { ISalaryForecast } from '../../interfaces/salary-forecast.interface';
|
|
3
|
+
import { SalaryForecastFrequencyEnum } from '../../db/Enums/salary-forecast-frequency.enum';
|
|
4
|
+
import { IncomeSource } from './income-source';
|
|
5
|
+
import { IIncomeSourceForecast } from '../../interfaces/income-source-forecast.interface';
|
|
6
|
+
import { Expose, Transform, Type } from 'class-transformer';
|
|
7
|
+
|
|
8
|
+
export class SalaryForecast extends SalaryForecastBase implements IIncomeSourceForecast, ISalaryForecast {
|
|
9
|
+
id: number;
|
|
10
|
+
|
|
11
|
+
@Transform(({obj}) => obj.netPay + obj.tax)
|
|
12
|
+
@Expose() grossAmount: number;
|
|
13
|
+
|
|
14
|
+
tax: number;
|
|
15
|
+
netPay: number;
|
|
16
|
+
paygIncome: number;
|
|
17
|
+
financialYear: number;
|
|
18
|
+
frequency: SalaryForecastFrequencyEnum;
|
|
19
|
+
isTaxFree: boolean;
|
|
20
|
+
|
|
21
|
+
@Type(() => IncomeSource)
|
|
22
|
+
incomeSource: IncomeSource;
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Type } from 'class-transformer';
|
|
2
|
+
|
|
3
|
+
// @Todo no base model from backend list
|
|
4
|
+
/**
|
|
5
|
+
* Loan payment class
|
|
6
|
+
*/
|
|
7
|
+
export class LoanPayment {
|
|
8
|
+
@Type(() => Date)
|
|
9
|
+
date: Date;
|
|
10
|
+
interestAccrued: number;
|
|
11
|
+
interestBalance: number;
|
|
12
|
+
number: number;
|
|
13
|
+
paymentDue: number;
|
|
14
|
+
principalBalance: number;
|
|
15
|
+
principalPaid: number;
|
|
16
|
+
totalOwed: number;
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { LoanPayout as LoanPayoutBase } from '../../db/Models/loan-payout';
|
|
2
|
+
import { LoanPayoutTypeEnum } from '../../db/Enums/loan-payout-type.enum';
|
|
3
|
+
|
|
4
|
+
export class LoanPayout extends LoanPayoutBase {
|
|
5
|
+
type: LoanPayoutTypeEnum;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Check if payout type is refinance
|
|
9
|
+
*/
|
|
10
|
+
isRefinance(): boolean {
|
|
11
|
+
return this.type === LoanPayoutTypeEnum.REFINANCE;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Loan as LoanBase } from '../../db/Models/loan';
|
|
2
|
+
import { LoanRepaymentTypeEnum } from '../../db/Enums/loan-repayment-type.enum';
|
|
3
|
+
import { LoanVehicleTypeEnum } from '../../db/Enums/loan-vehicle-type.enum';
|
|
4
|
+
import { Type } from 'class-transformer';
|
|
5
|
+
import { LoanPayment } from './loan-payment';
|
|
6
|
+
import { LoanPayout } from './loan-payout';
|
|
7
|
+
import { FinancialYear } from '../financial-year/financial-year';
|
|
8
|
+
import last from 'lodash/last';
|
|
9
|
+
|
|
10
|
+
export class Loan extends LoanBase {
|
|
11
|
+
@Type(() => LoanPayment)
|
|
12
|
+
payments: LoanPayment[];
|
|
13
|
+
|
|
14
|
+
@Type(() => Date)
|
|
15
|
+
commencementDate: Date;
|
|
16
|
+
|
|
17
|
+
@Type(() => LoanPayout)
|
|
18
|
+
payout: LoanPayout;
|
|
19
|
+
|
|
20
|
+
repaymentType: LoanRepaymentTypeEnum = LoanRepaymentTypeEnum.PRINCIPAL_AND_INTEREST;
|
|
21
|
+
currentBalance: number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Check if loan type is related to LoanVehicleTypeEnum
|
|
25
|
+
*/
|
|
26
|
+
isVehicle(): boolean {
|
|
27
|
+
return this.type in LoanVehicleTypeEnum;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get the last payment for passed financial year
|
|
32
|
+
* @param year financial year for filter
|
|
33
|
+
*/
|
|
34
|
+
getLastPaymentByYear(year: number): LoanPayment {
|
|
35
|
+
const finYear: FinancialYear = new FinancialYear(new Date(year.toString()));
|
|
36
|
+
return last(this.payments.filter((payment: LoanPayment): boolean => payment.date > finYear.startDate && payment.date < finYear.endDate));
|
|
37
|
+
}
|
|
38
|
+
}
|