taxtank-core 0.11.0 → 0.12.0
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/bundles/taxtank-core.umd.js +2742 -2773
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/collection.js +4 -1
- package/esm2015/lib/collections/depreciation.collection.js +24 -10
- package/esm2015/lib/collections/transaction.collection.js +28 -1
- package/esm2015/lib/collections/vehicle-logbook.collection.js +88 -0
- package/esm2015/lib/collections/vehicle.collection.js +9 -0
- package/esm2015/lib/db/Enums/chart-accounts-heading-vehicle-list.enum.js +3 -1
- package/esm2015/lib/db/Enums/chart-accounts-list.enum.js +4 -3
- package/esm2015/lib/db/Models/vehicle-claim.js +1 -1
- package/esm2015/lib/db/Models/vehicle.js +1 -1
- package/esm2015/lib/forms/index.js +3 -1
- package/esm2015/lib/forms/vehicle/vehicle-claim.form.js +114 -0
- package/esm2015/lib/forms/vehicle/vehicle.form.js +20 -0
- package/esm2015/lib/interfaces/event-listener.interface.js +1 -1
- package/esm2015/lib/interfaces/expense.interface.js +2 -0
- package/esm2015/lib/interfaces/tank.interface.js +1 -1
- package/esm2015/lib/models/chart-accounts/chart-accounts-value.js +4 -0
- package/esm2015/lib/models/chart-accounts/chart-accounts.js +34 -1
- package/esm2015/lib/models/depreciation/depreciation.js +5 -1
- package/esm2015/lib/models/event/app-event-type.enum.js +4 -1
- package/esm2015/lib/models/logbook/logbook-period.js +8 -1
- package/esm2015/lib/models/logbook/vehicle-claim.js +63 -4
- package/esm2015/lib/models/logbook/vehicle-logbook.js +9 -3
- package/esm2015/lib/models/logbook/vehicle.js +7 -29
- package/esm2015/lib/models/transaction/transaction.js +1 -1
- package/esm2015/lib/services/account-setup/account-setup.service.js +7 -22
- package/esm2015/lib/services/http/bank/bank-account/bank-account.service.js +6 -15
- package/esm2015/lib/services/http/bank/bank-connection/bank-connection.service.js +6 -15
- package/esm2015/lib/services/http/bank/bank-transaction/bank-transaction.service.js +6 -15
- package/esm2015/lib/services/http/bank/basiq/basiq.service.js +6 -15
- package/esm2015/lib/services/http/chart-accounts/chart-accounts.service.js +1 -1
- package/esm2015/lib/services/http/chat/chat.service.js +8 -12
- package/esm2015/lib/services/http/chat/message/message.service.js +8 -12
- package/esm2015/lib/services/http/chat/message-document/message-document.service.js +1 -1
- package/esm2015/lib/services/http/depreciation/depreciation.service.js +6 -23
- package/esm2015/lib/services/http/document/document-folder/document-folder.service.js +6 -14
- package/esm2015/lib/services/http/firm/client-movement/client-movement.service.js +6 -15
- package/esm2015/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.js +6 -15
- package/esm2015/lib/services/http/income-source/income-source.service.js +6 -14
- package/esm2015/lib/services/http/income-source/salary-forecast/salary-forecast.service.js +6 -15
- package/esm2015/lib/services/http/income-source/sole-forecast/sole-forecast.service.js +6 -15
- package/esm2015/lib/services/http/loan/loan.service.js +6 -15
- package/esm2015/lib/services/http/property/property-document/property-document.service.js +6 -15
- package/esm2015/lib/services/http/property/property-share/property-share.service.js +6 -15
- package/esm2015/lib/services/http/property/property.service.js +6 -15
- package/esm2015/lib/services/http/rest/rest.service.js +31 -4
- package/esm2015/lib/services/http/service-notification/service-notification.service.js +8 -12
- package/esm2015/lib/services/http/subscription/subscription.service.js +1 -4
- package/esm2015/lib/services/http/tax-review/tax-review-history/tax-review-history.service.js +15 -16
- package/esm2015/lib/services/http/tax-review/tax-review.service.js +6 -15
- package/esm2015/lib/services/http/tax-summary/tax-summary.service.js +1 -1
- package/esm2015/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.js +6 -15
- package/esm2015/lib/services/http/transaction/transaction.service.js +6 -25
- package/esm2015/lib/services/http/user/user-event-setting/user-event-setting.service.js +6 -14
- package/esm2015/lib/services/http/user/user-event-type/user-event-type.service.js +6 -14
- package/esm2015/lib/services/http/vehicle/messages.enum.js +13 -0
- package/esm2015/lib/services/http/vehicle/vehicle-claim.service.js +24 -0
- package/esm2015/lib/services/http/vehicle/vehicle-logbook.service.js +59 -0
- package/esm2015/lib/services/http/vehicle/vehicle.service.js +49 -213
- package/esm2015/public-api.js +7 -2
- package/fesm2015/taxtank-core.js +2481 -2458
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/collection.d.ts +1 -0
- package/lib/collections/depreciation.collection.d.ts +5 -4
- package/lib/collections/transaction.collection.d.ts +9 -0
- package/lib/collections/vehicle-logbook.collection.d.ts +30 -0
- package/lib/collections/vehicle.collection.d.ts +6 -0
- package/lib/db/Enums/chart-accounts-heading-vehicle-list.enum.d.ts +3 -1
- package/lib/db/Enums/chart-accounts-list.enum.d.ts +4 -3
- package/lib/db/Models/vehicle-claim.d.ts +2 -0
- package/lib/db/Models/vehicle.d.ts +2 -0
- package/lib/forms/index.d.ts +2 -0
- package/lib/forms/vehicle/vehicle-claim.form.d.ts +43 -0
- package/lib/forms/vehicle/vehicle.form.d.ts +11 -0
- package/lib/interfaces/event-listener.interface.d.ts +1 -0
- package/lib/interfaces/expense.interface.d.ts +12 -0
- package/lib/interfaces/tank.interface.d.ts +2 -0
- package/lib/models/chart-accounts/chart-accounts-value.d.ts +3 -0
- package/lib/models/chart-accounts/chart-accounts.d.ts +18 -0
- package/lib/models/depreciation/depreciation.d.ts +6 -2
- package/lib/models/event/app-event-type.enum.d.ts +4 -1
- package/lib/models/logbook/logbook-period.d.ts +4 -0
- package/lib/models/logbook/vehicle-claim.d.ts +20 -3
- package/lib/models/logbook/vehicle-logbook.d.ts +8 -2
- package/lib/models/logbook/vehicle.d.ts +5 -7
- package/lib/models/transaction/transaction.d.ts +2 -2
- package/lib/services/account-setup/account-setup.service.d.ts +3 -7
- package/lib/services/http/bank/bank-account/bank-account.service.d.ts +2 -7
- package/lib/services/http/bank/bank-connection/bank-connection.service.d.ts +2 -7
- package/lib/services/http/bank/bank-transaction/bank-transaction.service.d.ts +3 -8
- package/lib/services/http/bank/basiq/basiq.service.d.ts +2 -7
- package/lib/services/http/chat/chat.service.d.ts +4 -7
- package/lib/services/http/chat/message/message.service.d.ts +4 -7
- package/lib/services/http/chat/message-document/message-document.service.d.ts +3 -3
- package/lib/services/http/depreciation/depreciation.service.d.ts +2 -11
- package/lib/services/http/document/document-folder/document-folder.service.d.ts +0 -6
- package/lib/services/http/firm/client-movement/client-movement.service.d.ts +2 -7
- package/lib/services/http/income-source/income-source-forecast/income-source-forecast.service.d.ts +2 -7
- package/lib/services/http/income-source/income-source.service.d.ts +0 -6
- package/lib/services/http/income-source/salary-forecast/salary-forecast.service.d.ts +1 -7
- package/lib/services/http/income-source/sole-forecast/sole-forecast.service.d.ts +2 -7
- package/lib/services/http/loan/loan.service.d.ts +2 -7
- package/lib/services/http/property/property-document/property-document.service.d.ts +3 -8
- package/lib/services/http/property/property-share/property-share.service.d.ts +2 -7
- package/lib/services/http/property/property.service.d.ts +2 -7
- package/lib/services/http/rest/rest.service.d.ts +17 -2
- package/lib/services/http/service-notification/service-notification.service.d.ts +4 -7
- package/lib/services/http/subscription/subscription.service.d.ts +0 -1
- package/lib/services/http/tax-review/tax-review-history/tax-review-history.service.d.ts +7 -7
- package/lib/services/http/tax-review/tax-review.service.d.ts +1 -7
- package/lib/services/http/tax-summary/tax-summary.service.d.ts +2 -1
- package/lib/services/http/transaction/transaction-allocation/transaction-allocation.service.d.ts +3 -8
- package/lib/services/http/transaction/transaction.service.d.ts +0 -12
- package/lib/services/http/user/user-event-setting/user-event-setting.service.d.ts +0 -6
- package/lib/services/http/user/user-event-type/user-event-type.service.d.ts +0 -6
- package/lib/services/http/vehicle/messages.enum.d.ts +11 -0
- package/lib/services/http/vehicle/vehicle-claim.service.d.ts +13 -0
- package/lib/services/http/vehicle/vehicle-logbook.service.d.ts +22 -0
- package/lib/services/http/vehicle/vehicle.service.d.ts +17 -80
- package/package.json +1 -1
- package/public-api.d.ts +6 -1
- package/esm2015/lib/collections/logbook.collection.js +0 -97
- package/lib/collections/logbook.collection.d.ts +0 -19
|
@@ -14,10 +14,6 @@ export declare class DepreciationCollection extends Collection<Depreciation> {
|
|
|
14
14
|
getCloseBalanceByYear(year?: number): number;
|
|
15
15
|
getCurrentYearForecastAmount(): number;
|
|
16
16
|
get closeBalance(): number;
|
|
17
|
-
/**
|
|
18
|
-
* Get new depreciations collections filtered by tank type
|
|
19
|
-
*/
|
|
20
|
-
getByTankType(tankType: TankTypeEnum): DepreciationCollection;
|
|
21
17
|
getByPropertiesIds(ids: number[]): DepreciationCollection;
|
|
22
18
|
getWithCapitalProject(): DepreciationCollection;
|
|
23
19
|
getWithoutCapitalProject(): DepreciationCollection;
|
|
@@ -29,6 +25,11 @@ export declare class DepreciationCollection extends Collection<Depreciation> {
|
|
|
29
25
|
getWrittenOffDepreciations(): DepreciationCollection;
|
|
30
26
|
getLowValuePoolDepreciations(): DepreciationCollection;
|
|
31
27
|
getCapitalProjects(): DepreciationCapitalProject[];
|
|
28
|
+
/**
|
|
29
|
+
* Get a new collection of depreciations related to vehicles
|
|
30
|
+
*/
|
|
31
|
+
getVehicleDepreciations(): DepreciationCollection;
|
|
32
|
+
getByTankType(tankType: TankTypeEnum): this;
|
|
32
33
|
/**
|
|
33
34
|
* Create TransactionCollection from depreciation items
|
|
34
35
|
*/
|
|
@@ -2,6 +2,7 @@ import { Collection } from './collection';
|
|
|
2
2
|
import { Transaction } from '../models/transaction/transaction';
|
|
3
3
|
import { TransactionAllocationCollection } from './transaction-allocation.collection';
|
|
4
4
|
import { ChartAccountsCategoryEnum } from '../db/Enums/chart-accounts-category.enum';
|
|
5
|
+
import { TankTypeEnum } from '../db/Enums/tank-type.enum';
|
|
5
6
|
/**
|
|
6
7
|
* Collection of transactions
|
|
7
8
|
*/
|
|
@@ -68,4 +69,12 @@ export declare class TransactionCollection extends Collection<Transaction> {
|
|
|
68
69
|
getDebitTransactions(): TransactionCollection;
|
|
69
70
|
getCreditTransactions(): TransactionCollection;
|
|
70
71
|
getByAllocations(allocations: TransactionAllocationCollection): TransactionCollection;
|
|
72
|
+
/**
|
|
73
|
+
* Get transactions related to Vehicle category
|
|
74
|
+
*/
|
|
75
|
+
getVehicleTransactions(): this;
|
|
76
|
+
/**
|
|
77
|
+
* Get new transaction collection filtered by tank type
|
|
78
|
+
*/
|
|
79
|
+
getByTankType(tankType: TankTypeEnum): this;
|
|
71
80
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { VehicleLogbook } from '../models/logbook/vehicle-logbook';
|
|
2
|
+
import { LogbookPeriod } from '../models/logbook/logbook-period';
|
|
3
|
+
import { Collection } from './collection';
|
|
4
|
+
export declare class VehicleLogbookCollection extends Collection<VehicleLogbook> {
|
|
5
|
+
/**
|
|
6
|
+
* Check if we can calculate the best period
|
|
7
|
+
*/
|
|
8
|
+
isBestPeriodExist(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Get collection of non-personal logbooks (work-related, sole-related).
|
|
11
|
+
*/
|
|
12
|
+
getBusinessLogbooks(): this;
|
|
13
|
+
/**
|
|
14
|
+
* Logbook Period is the best when it has the biggest amount of work kilometers
|
|
15
|
+
* Best period duration is defined as LOGBOOK_PERIOD_DURATION (12 weeks) by the ATO
|
|
16
|
+
*/
|
|
17
|
+
getBestPeriod(): LogbookPeriod;
|
|
18
|
+
/**
|
|
19
|
+
* Calculate total kilometers traveled
|
|
20
|
+
*/
|
|
21
|
+
getKlms(): number;
|
|
22
|
+
/**
|
|
23
|
+
* Calculate work usage (percent of business-related kilometers from total kilometers)
|
|
24
|
+
*/
|
|
25
|
+
getWorkUsage(): number;
|
|
26
|
+
/**
|
|
27
|
+
* Get LOGBOOK_PERIOD_DURATION date range from passed start date
|
|
28
|
+
*/
|
|
29
|
+
private getPeriodRange;
|
|
30
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Collection } from './collection';
|
|
2
|
+
import { Vehicle } from '../models/logbook/vehicle';
|
|
3
|
+
import { VehicleLogbookCollection } from './vehicle-logbook.collection';
|
|
4
|
+
export declare class VehicleCollection extends Collection<Vehicle> {
|
|
5
|
+
getLogbooks(): VehicleLogbookCollection;
|
|
6
|
+
}
|
|
@@ -6,14 +6,15 @@ export declare enum ChartAccountsListEnum {
|
|
|
6
6
|
BUILDING_AT_COST = 304,
|
|
7
7
|
MANAGEMENT_FEES_PLATFORM_FEES = 656,
|
|
8
8
|
KLMS_TRAVELLED_FOR_WORK = 24,
|
|
9
|
+
KLMS_TRAVELLED = 683,
|
|
9
10
|
DIRECTOR_FEES = 6,
|
|
10
11
|
SALARY_OR_WAGES = 2,
|
|
11
12
|
VEHICLES = 25,
|
|
12
13
|
COMMERCIAL_VEHICLES = 26,
|
|
14
|
+
VEHICLE_LOAN_INTEREST = 37,
|
|
15
|
+
VEHICLE_LOAN_PRINCIPAL = 38,
|
|
13
16
|
TAX_INSTALMENTS = 662,
|
|
14
17
|
INTEREST_EARNED = 22,
|
|
15
18
|
TRUST_INCOME = 567,
|
|
16
|
-
TAX_OFFSETS_N_R_A_S = 571
|
|
17
|
-
VEHICLE_LOAN_INTEREST = 37,
|
|
18
|
-
VEHICLE_LOAN_PRINCIPAL = 38
|
|
19
|
+
TAX_OFFSETS_N_R_A_S = 571
|
|
19
20
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VehicleClaimMethodEnum } from '../Enums/vehicle-claim-method.enum';
|
|
2
2
|
import { User } from './user';
|
|
3
|
+
import { TankTypeEnum } from '../Enums/tank-type.enum';
|
|
3
4
|
export declare class VehicleClaim {
|
|
4
5
|
financialYear?: number;
|
|
5
6
|
method?: VehicleClaimMethodEnum;
|
|
@@ -8,4 +9,5 @@ export declare class VehicleClaim {
|
|
|
8
9
|
isManual?: boolean;
|
|
9
10
|
id?: number;
|
|
10
11
|
user?: User;
|
|
12
|
+
tankType?: TankTypeEnum;
|
|
11
13
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { User } from './user';
|
|
2
2
|
import { VehicleLogbook } from './vehicle-logbook';
|
|
3
|
+
import { TankTypeEnum } from '../Enums/tank-type.enum';
|
|
3
4
|
export declare class Vehicle {
|
|
4
5
|
name?: string;
|
|
5
6
|
id?: number;
|
|
6
7
|
user?: User;
|
|
7
8
|
logbook?: VehicleLogbook[];
|
|
9
|
+
tankType?: TankTypeEnum;
|
|
8
10
|
}
|
package/lib/forms/index.d.ts
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AbstractForm } from '../abstract.form';
|
|
2
|
+
import { VehicleClaim } from '../../models/logbook/vehicle-claim';
|
|
3
|
+
import { VehicleLogbookCollection } from '../../collections/vehicle-logbook.collection';
|
|
4
|
+
export declare class VehicleClaimForm extends AbstractForm {
|
|
5
|
+
private vehicleClaim;
|
|
6
|
+
private logbooks;
|
|
7
|
+
constructor(vehicleClaim: VehicleClaim, logbooks: VehicleLogbookCollection);
|
|
8
|
+
/**
|
|
9
|
+
* Check if vehicle claim method changed
|
|
10
|
+
*/
|
|
11
|
+
isMethodChanged(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Check if KLMs method selected
|
|
14
|
+
*/
|
|
15
|
+
isKLMsMethod(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Check if Logbook method selected
|
|
18
|
+
*/
|
|
19
|
+
isLogbookMethod(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Check if user selected manual calculation
|
|
22
|
+
*/
|
|
23
|
+
isManual(): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* @TODO save model, add generics and handle it in AbstractForm
|
|
26
|
+
*/
|
|
27
|
+
submit(): VehicleClaim;
|
|
28
|
+
private setIsManualState;
|
|
29
|
+
/**
|
|
30
|
+
* Handle method field value changes.
|
|
31
|
+
* Set work usage value depended of selected method.
|
|
32
|
+
*/
|
|
33
|
+
private listenMethodChanges;
|
|
34
|
+
/**
|
|
35
|
+
* Handle isManual field value changes.
|
|
36
|
+
* Enable/disable fields depended of isManual value
|
|
37
|
+
*/
|
|
38
|
+
private listenIsManualChanges;
|
|
39
|
+
/**
|
|
40
|
+
* Set automatic calculated values depended of current method for non-manual vehicle claim
|
|
41
|
+
*/
|
|
42
|
+
private setValues;
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractForm } from '../abstract.form';
|
|
2
|
+
import { Vehicle } from '../../models/logbook/vehicle';
|
|
3
|
+
import { VehicleClaim } from '../../models/logbook/vehicle-claim';
|
|
4
|
+
export declare class VehicleForm extends AbstractForm {
|
|
5
|
+
private vehicle;
|
|
6
|
+
constructor(vehicle: Vehicle);
|
|
7
|
+
/**
|
|
8
|
+
* @TODO save model, add generics and handle it in AbstractForm
|
|
9
|
+
*/
|
|
10
|
+
submit(): VehicleClaim;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChartAccounts } from '../models/chart-accounts/chart-accounts';
|
|
2
|
+
import { ITank } from './tank.interface';
|
|
3
|
+
/**
|
|
4
|
+
* Interface with common transactions fields and methods
|
|
5
|
+
* @TODO remove I prefix in all interfaces. Naming issue: need to get common name for transaction and depreciation or
|
|
6
|
+
* rename Transaction class or cut transaction-related logic from Depreciation and never work with Depreciation as with Transaction.
|
|
7
|
+
* @TODO add more common fields from Transaction and Depreciation if required
|
|
8
|
+
*/
|
|
9
|
+
export interface Expense extends ITank {
|
|
10
|
+
amount: number;
|
|
11
|
+
chartAccounts: ChartAccounts;
|
|
12
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ChartAccounts as ChartAccountsBase } from '../../db/Models/chart-accounts';
|
|
2
2
|
import { ChartAccountsHeading } from './chart-accounts-heading';
|
|
3
3
|
import { ChartAccountsMetadata } from './chart-accounts-metadata';
|
|
4
|
+
import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
|
|
5
|
+
import { ChartAccountsValue } from './chart-accounts-value';
|
|
4
6
|
export declare class ChartAccounts extends ChartAccountsBase {
|
|
5
7
|
heading: ChartAccountsHeading;
|
|
6
8
|
metadata: ChartAccountsMetadata[];
|
|
@@ -12,6 +14,14 @@ export declare class ChartAccounts extends ChartAccountsBase {
|
|
|
12
14
|
* Check if chart accounts id is related for 'Klms travelled for work' category
|
|
13
15
|
*/
|
|
14
16
|
isKlmsForWork(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Check if chart accounts id is related for 'Klms travelled for sole' category
|
|
19
|
+
*/
|
|
20
|
+
isKlmsForSole(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Check if accounts id is related for KLMs category related to passed tank type
|
|
23
|
+
*/
|
|
24
|
+
isKLMsByTankType(tankType: TankTypeEnum): boolean;
|
|
15
25
|
/**
|
|
16
26
|
* Check if chart accounts id is related for 'NRAS Tax Offset' category
|
|
17
27
|
*/
|
|
@@ -64,4 +74,12 @@ export declare class ChartAccounts extends ChartAccountsBase {
|
|
|
64
74
|
* Check if transaction chart account is work related car expenses
|
|
65
75
|
*/
|
|
66
76
|
isVehicleLoanExpense(): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Get chart accounts value for current financial year
|
|
79
|
+
*/
|
|
80
|
+
getCurrentYearValue(): ChartAccountsValue;
|
|
81
|
+
/**
|
|
82
|
+
* Get chart accounts value by financial year
|
|
83
|
+
*/
|
|
84
|
+
getValueByYear(year: number): ChartAccountsValue;
|
|
67
85
|
}
|
|
@@ -4,11 +4,11 @@ import { DepreciationCapitalProject } from './depreciation-capital-project';
|
|
|
4
4
|
import { DepreciationForecast } from './depreciation-forecast';
|
|
5
5
|
import { ChartAccounts } from '../chart-accounts/chart-accounts';
|
|
6
6
|
import { BankTransaction } from '../bank/bank-transaction';
|
|
7
|
-
import { ITank } from '../../interfaces/tank.interface';
|
|
8
7
|
import { IReceipt } from '../../interfaces/receipt.interface';
|
|
9
8
|
import { IAsset } from '../../interfaces/asset.interface';
|
|
10
9
|
import { Transaction } from '../transaction/transaction';
|
|
11
|
-
|
|
10
|
+
import { Expense } from '../../interfaces/expense.interface';
|
|
11
|
+
export declare class Depreciation extends DepreciationBase implements Expense, IReceipt {
|
|
12
12
|
static WRITTEN_OFF_THRESHOLD: number;
|
|
13
13
|
static LOW_VALUE_POOL_THRESHOLD: number;
|
|
14
14
|
purchaseDate: Date;
|
|
@@ -22,6 +22,10 @@ export declare class Depreciation extends DepreciationBase implements ITank, IRe
|
|
|
22
22
|
bankTransaction: BankTransaction;
|
|
23
23
|
type: DepreciationTypeEnum;
|
|
24
24
|
receipt: IAsset;
|
|
25
|
+
/**
|
|
26
|
+
* @TODO remove after ? signs removed from db models
|
|
27
|
+
*/
|
|
28
|
+
amount: number;
|
|
25
29
|
isCapital(): boolean;
|
|
26
30
|
isBorrowingExpense(): boolean;
|
|
27
31
|
isAsset(): boolean;
|
|
@@ -36,5 +36,8 @@ export declare enum AppEventTypeEnum {
|
|
|
36
36
|
TRANSACTIONS_CREATED = 34,
|
|
37
37
|
USER_UPDATED = 35,
|
|
38
38
|
VEHICLE_CLAIM_UPDATED = 36,
|
|
39
|
-
VEHICLE_CLAIM_CREATED = 37
|
|
39
|
+
VEHICLE_CLAIM_CREATED = 37,
|
|
40
|
+
VEHICLE_LOGBOOK_CREATED = 38,
|
|
41
|
+
VEHICLE_LOGBOOK_UPDATED = 39,
|
|
42
|
+
VEHICLE_LOGBOOK_DELETED = 40
|
|
40
43
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { VehicleClaim as VehicleClaimBase } from '../../db/Models/vehicle-claim';
|
|
2
2
|
import { VehicleClaimMethodEnum } from '../../db/Enums/vehicle-claim-method.enum';
|
|
3
|
+
import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
|
|
4
|
+
import { Transaction } from '../transaction/transaction';
|
|
5
|
+
import { TransactionCollection } from '../../collections/transaction.collection';
|
|
3
6
|
export declare class VehicleClaim extends VehicleClaimBase {
|
|
4
7
|
kmsLimit: number;
|
|
5
8
|
financialYear: number;
|
|
@@ -11,9 +14,23 @@ export declare class VehicleClaim extends VehicleClaimBase {
|
|
|
11
14
|
* get amount of kilometres per week
|
|
12
15
|
*/
|
|
13
16
|
get averageWeeklyTraveledKms(): number;
|
|
14
|
-
|
|
17
|
+
isLogbookMethod(): boolean;
|
|
18
|
+
isKLMsMethod(): boolean;
|
|
19
|
+
isWorkTank(): boolean;
|
|
20
|
+
isSoleTank(): boolean;
|
|
15
21
|
/**
|
|
16
|
-
* Claim amount for
|
|
22
|
+
* Claim amount for KLMs method. Exists only for KLMs method.
|
|
17
23
|
*/
|
|
18
|
-
|
|
24
|
+
getKLMsClaimAmount(vehicleClaimRate: number): number;
|
|
25
|
+
/**
|
|
26
|
+
* Get logbook claim amount. Exists only for logbook method.
|
|
27
|
+
* ClaimAmount = WorkUsage * transaction/depreciation amount
|
|
28
|
+
*/
|
|
29
|
+
getLogbookClaimAmount(transactions: TransactionCollection): number;
|
|
30
|
+
/**
|
|
31
|
+
* Create KLMs transaction based on vehicle claim and vehicle claim rate
|
|
32
|
+
* @TODO handle on backend: Create klms transaction when vhicle claim created
|
|
33
|
+
*/
|
|
34
|
+
toTransaction(vehicleClaimRate: number): Transaction;
|
|
35
|
+
getKlmsChartAccountsIdByTankType(tankType?: TankTypeEnum): number;
|
|
19
36
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { VehicleLogbook as VehicleLogbookBase } from '../../db/Models/vehicle-logbook';
|
|
2
2
|
export declare class VehicleLogbook extends VehicleLogbookBase {
|
|
3
3
|
date: Date;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Get amount of kilometers in this logbook
|
|
6
|
+
*/
|
|
7
|
+
getKlms(): number;
|
|
8
|
+
/**
|
|
9
|
+
* Check if logbook is business-related
|
|
10
|
+
*/
|
|
11
|
+
isBusiness(): boolean;
|
|
6
12
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Vehicle as VehicleBase } from '../../db/Models/vehicle';
|
|
2
2
|
import { VehicleLogbook } from './vehicle-logbook';
|
|
3
|
+
import { VehicleLogbookCollection } from '../../collections/vehicle-logbook.collection';
|
|
3
4
|
export declare class Vehicle extends VehicleBase {
|
|
4
5
|
logbook: VehicleLogbook[];
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
get lastLogbook(): VehicleLogbook | {
|
|
10
|
-
odometerEnd: number;
|
|
11
|
-
};
|
|
6
|
+
/**
|
|
7
|
+
* Get vehicle's logbooks as collection
|
|
8
|
+
*/
|
|
9
|
+
getLogbooks(): VehicleLogbookCollection;
|
|
12
10
|
}
|
|
@@ -9,10 +9,10 @@ import { TransactionMetadata } from './transaction-metadata';
|
|
|
9
9
|
import { Loan } from '../loan/loan';
|
|
10
10
|
import { TransactionAllocation } from './transaction-allocation';
|
|
11
11
|
import { IReceipt } from '../../interfaces/receipt.interface';
|
|
12
|
-
import { ITank } from '../../interfaces/tank.interface';
|
|
13
12
|
import { TransactionAllocationCollection } from '../../collections/transaction-allocation.collection';
|
|
14
13
|
import { Depreciation } from '../depreciation/depreciation';
|
|
15
|
-
|
|
14
|
+
import { Expense } from '../../interfaces/expense.interface';
|
|
15
|
+
export declare class Transaction extends TransactionBase implements Expense, IReceipt {
|
|
16
16
|
transactions: Transaction[];
|
|
17
17
|
property: Property;
|
|
18
18
|
receipt: TransactionReceipt;
|
|
@@ -3,9 +3,9 @@ import { ClientIncomeTypesService } from '../http/firm/client-income/client-inco
|
|
|
3
3
|
import { IncomeSourceService } from '../http/income-source/income-source.service';
|
|
4
4
|
import { PropertyService } from '../http/property/property.service';
|
|
5
5
|
import { TransactionAllocationService } from '../http/transaction/transaction-allocation/transaction-allocation.service';
|
|
6
|
-
import { VehicleService } from '../http/vehicle/vehicle.service';
|
|
7
6
|
import { Observable, ReplaySubject } from 'rxjs';
|
|
8
7
|
import { AccountSetupItemCollection } from '../../collections/account-setup-item.collection';
|
|
8
|
+
import { VehicleClaimService } from '../http/vehicle/vehicle-claim.service';
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
/**
|
|
11
11
|
* Service handling user's account setup process.
|
|
@@ -17,10 +17,10 @@ export declare class AccountSetupService {
|
|
|
17
17
|
private incomeSourceService;
|
|
18
18
|
private bankAccountsService;
|
|
19
19
|
private transactionAllocationService;
|
|
20
|
-
private
|
|
20
|
+
private vehicleClaimService;
|
|
21
21
|
cache: AccountSetupItemCollection;
|
|
22
22
|
cacheSubject: ReplaySubject<AccountSetupItemCollection>;
|
|
23
|
-
constructor(clientIncomeTypesService: ClientIncomeTypesService, propertyService: PropertyService, incomeSourceService: IncomeSourceService, bankAccountsService: BankAccountService, transactionAllocationService: TransactionAllocationService,
|
|
23
|
+
constructor(clientIncomeTypesService: ClientIncomeTypesService, propertyService: PropertyService, incomeSourceService: IncomeSourceService, bankAccountsService: BankAccountService, transactionAllocationService: TransactionAllocationService, vehicleClaimService: VehicleClaimService);
|
|
24
24
|
/**
|
|
25
25
|
* Get list of account setup items for current user
|
|
26
26
|
*/
|
|
@@ -34,10 +34,6 @@ export declare class AccountSetupService {
|
|
|
34
34
|
* Some items are optional and depends of user's client income types
|
|
35
35
|
*/
|
|
36
36
|
private createBatch;
|
|
37
|
-
/**
|
|
38
|
-
* @TODO Temp solution: Refactor with new logbook system (waiting for PR finish). Use this.getItem() instead after refactoring
|
|
39
|
-
*/
|
|
40
|
-
private getLogbookItem;
|
|
41
37
|
/**
|
|
42
38
|
* @TODO work with collection when services refactored
|
|
43
39
|
*/
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
2
|
import { BankAccount as BankAccountBase } from '../../../../db/Models/bank-account';
|
|
4
3
|
import { RestService } from '../../rest/rest.service';
|
|
5
4
|
import { BankAccount } from '../../../../models/bank/bank-account';
|
|
6
|
-
import {
|
|
5
|
+
import { IEventListener } from '../../../../interfaces/event-listener.interface';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
/**
|
|
9
8
|
* Service that handling user's bank accounts logic
|
|
10
9
|
*/
|
|
11
|
-
export declare class BankAccountService extends RestService<BankAccountBase, BankAccount> {
|
|
12
|
-
protected http: HttpClient;
|
|
13
|
-
protected eventDispatcherService: EventDispatcherService;
|
|
14
|
-
protected environment: any;
|
|
10
|
+
export declare class BankAccountService extends RestService<BankAccountBase, BankAccount> implements IEventListener {
|
|
15
11
|
url: string;
|
|
16
12
|
modelClass: typeof BankAccount;
|
|
17
|
-
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
|
|
18
13
|
/**
|
|
19
14
|
* Listen system notifications and update cache when got basiq notification received
|
|
20
15
|
*/
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
3
2
|
import { BankConnection as BankConnectionBase } from '../../../../db/Models/bank-connection';
|
|
4
|
-
import { EventDispatcherService } from '../../../event/event-dispatcher.service';
|
|
5
3
|
import { BankConnection } from '../../../../models/bank/bank-connection';
|
|
6
4
|
import { RestService } from '../../rest/rest.service';
|
|
5
|
+
import { IEventListener } from '../../../../interfaces/event-listener.interface';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
/**
|
|
9
8
|
* BankConnection means user account at specific bank (usually each user has only one at the same bank)
|
|
10
9
|
* service handles BankConnection management
|
|
11
10
|
*/
|
|
12
|
-
export declare class BankConnectionService extends RestService<BankConnectionBase, BankConnection> {
|
|
13
|
-
protected http: HttpClient;
|
|
14
|
-
protected eventDispatcherService: EventDispatcherService;
|
|
15
|
-
protected environment: any;
|
|
11
|
+
export declare class BankConnectionService extends RestService<BankConnectionBase, BankConnection> implements IEventListener {
|
|
16
12
|
modelClass: typeof BankConnection;
|
|
17
13
|
url: string;
|
|
18
|
-
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
|
|
19
14
|
listenEvents(): void;
|
|
20
15
|
post(bankConnection: BankConnection): Observable<BankConnection>;
|
|
21
16
|
listenToAddedBankAccounts(): void;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import { BankTransaction as BankTransactionBase } from '../../../../db/Models/bank-transaction';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { RestService } from '../../rest/rest.service';
|
|
4
|
-
import { HttpClient } from '@angular/common/http';
|
|
5
4
|
import { BankTransaction } from '../../../../models/bank/bank-transaction';
|
|
6
|
-
import {
|
|
5
|
+
import { IEventListener } from '../../../../interfaces/event-listener.interface';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
/**
|
|
9
8
|
* Service for bank transactions business logic
|
|
10
9
|
*/
|
|
11
|
-
export declare class BankTransactionService extends RestService<BankTransactionBase, BankTransaction> {
|
|
12
|
-
protected http: HttpClient;
|
|
13
|
-
protected eventDispatcherService: EventDispatcherService;
|
|
14
|
-
protected environment: any;
|
|
10
|
+
export declare class BankTransactionService extends RestService<BankTransactionBase, BankTransaction> implements IEventListener {
|
|
15
11
|
url: string;
|
|
16
12
|
modelClass: typeof BankTransaction;
|
|
17
|
-
|
|
18
|
-
private listenEvents;
|
|
13
|
+
listenEvents(): void;
|
|
19
14
|
/**
|
|
20
15
|
* get list of bank transactions for passed bank account id
|
|
21
16
|
* @param bankAccountId Id of bank account we search bank transactions for
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import { HttpClient } from '@angular/common/http';
|
|
2
1
|
import { Observable, ReplaySubject } from 'rxjs';
|
|
3
2
|
import { BankAccount as BankAccountBase } from '../../../../db/Models/bank-account';
|
|
4
3
|
import { RestService } from '../../rest/rest.service';
|
|
5
4
|
import { BankAccount } from '../../../../models/bank/bank-account';
|
|
6
5
|
import { BasiqToken } from '../../../../models/bank/basiq-token';
|
|
7
|
-
import { EventDispatcherService } from '../../../event/event-dispatcher.service';
|
|
8
6
|
import { BankConnection } from '../../../../models/bank/bank-connection';
|
|
7
|
+
import { IEventListener } from '../../../../interfaces/event-listener.interface';
|
|
9
8
|
import * as i0 from "@angular/core";
|
|
10
9
|
/**
|
|
11
10
|
* basiq is a middleman between bank and user
|
|
12
11
|
* service is responsible for fetching bank related information
|
|
13
12
|
*/
|
|
14
|
-
export declare class BasiqService extends RestService<BankAccountBase, BankAccount> {
|
|
15
|
-
protected http: HttpClient;
|
|
16
|
-
protected eventDispatcherService: EventDispatcherService;
|
|
17
|
-
protected environment: any;
|
|
13
|
+
export declare class BasiqService extends RestService<BankAccountBase, BankAccount> implements IEventListener {
|
|
18
14
|
token: BasiqToken;
|
|
19
15
|
tokenSubject: ReplaySubject<BasiqToken>;
|
|
20
16
|
url: string;
|
|
21
17
|
modelClass: typeof BankAccount;
|
|
22
|
-
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
|
|
23
18
|
/**
|
|
24
19
|
* Listen events from Event Dispatcher service
|
|
25
20
|
*/
|
|
@@ -2,26 +2,23 @@ import { Chat as ChatBase } from '../../../db/Models/chat';
|
|
|
2
2
|
import { HttpClient } from '@angular/common/http';
|
|
3
3
|
import { SseService } from '../../event/sse.service';
|
|
4
4
|
import { RestService } from '../rest/rest.service';
|
|
5
|
-
import { IEventListener } from '../../../interfaces/event-listener.interface';
|
|
6
5
|
import { Chat } from '../../../models/chat/chat';
|
|
7
6
|
import { EventDispatcherService } from '../../event/event-dispatcher.service';
|
|
7
|
+
import { ToastService } from '../../toast/toast.service';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
/**
|
|
10
10
|
* Service for work with chats
|
|
11
11
|
*/
|
|
12
|
-
export declare class ChatService extends RestService<ChatBase, Chat>
|
|
12
|
+
export declare class ChatService extends RestService<ChatBase, Chat> {
|
|
13
13
|
protected http: HttpClient;
|
|
14
14
|
protected eventDispatcherService: EventDispatcherService;
|
|
15
15
|
protected environment: any;
|
|
16
|
+
protected toastService: ToastService;
|
|
16
17
|
private sseService;
|
|
17
18
|
modelClass: typeof Chat;
|
|
18
19
|
url: string;
|
|
19
20
|
isHydra: boolean;
|
|
20
|
-
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, sseService: SseService);
|
|
21
|
-
/**
|
|
22
|
-
* SSE and Event Dispatcher Services listeners
|
|
23
|
-
*/
|
|
24
|
-
listenEvents(): void;
|
|
21
|
+
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService, sseService: SseService);
|
|
25
22
|
/**
|
|
26
23
|
* Listen chats events
|
|
27
24
|
*/
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
import { Message as MessageBase } from '../../../../db/Models/message';
|
|
2
|
-
import { IEventListener } from '../../../../interfaces/event-listener.interface';
|
|
3
2
|
import { HttpClient } from '@angular/common/http';
|
|
4
3
|
import { Message } from '../../../../models/chat/message';
|
|
5
4
|
import { RestService } from '../../rest/rest.service';
|
|
6
5
|
import { EventDispatcherService } from '../../../event/event-dispatcher.service';
|
|
7
6
|
import { SseService } from '../../../event/sse.service';
|
|
7
|
+
import { ToastService } from '../../../toast/toast.service';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
/**
|
|
10
10
|
* Service for work with messages
|
|
11
11
|
*/
|
|
12
|
-
export declare class MessageService extends RestService<MessageBase, Message>
|
|
12
|
+
export declare class MessageService extends RestService<MessageBase, Message> {
|
|
13
13
|
protected http: HttpClient;
|
|
14
14
|
protected eventDispatcherService: EventDispatcherService;
|
|
15
15
|
protected environment: any;
|
|
16
|
+
protected toastService: ToastService;
|
|
16
17
|
private sseService;
|
|
17
18
|
modelClass: typeof Message;
|
|
18
19
|
url: string;
|
|
19
20
|
isHydra: boolean;
|
|
20
|
-
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, sseService: SseService);
|
|
21
|
-
/**
|
|
22
|
-
* SSE and Event Dispatcher Services listeners
|
|
23
|
-
*/
|
|
24
|
-
listenEvents(): void;
|
|
21
|
+
constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService, sseService: SseService);
|
|
25
22
|
/**
|
|
26
23
|
* subscribe to new chat messages
|
|
27
24
|
*/
|
|
@@ -8,9 +8,9 @@ import * as i0 from "@angular/core";
|
|
|
8
8
|
* Service for work with Message Documents
|
|
9
9
|
*/
|
|
10
10
|
export declare class MessageDocumentService implements IEventListener {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
private http;
|
|
12
|
+
private eventDispatcherService;
|
|
13
|
+
private environment;
|
|
14
14
|
url: string;
|
|
15
15
|
cache: Readonly<Array<Readonly<MessageDocument>>>;
|
|
16
16
|
cacheSubject: ReplaySubject<Readonly<Array<Readonly<MessageDocument>>>>;
|