taxtank-core 0.30.18 → 0.30.20
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/esm2020/lib/collections/allocation-rule.collection.mjs +14 -1
- package/esm2020/lib/db/Enums/chart-accounts/chart-accounts-category.enum.mjs +3 -1
- package/esm2020/lib/db/Enums/chart-accounts/chart-accounts-list.enum.mjs +3 -1
- package/esm2020/lib/db/Enums/holding/holding-type-category.enum.mjs +10 -0
- package/esm2020/lib/db/Enums/subscription/service-product-id.enum.mjs +2 -1
- package/esm2020/lib/db/Enums/tank-type.enum.mjs +2 -1
- package/esm2020/lib/db/Enums/user-roles.enum.mjs +2 -1
- package/esm2020/lib/db/Models/holding/holding-sale.mjs +3 -0
- package/esm2020/lib/db/Models/holding/holding-type.mjs +3 -0
- package/esm2020/lib/db/Models/holding/holding.mjs +3 -0
- package/esm2020/lib/db/Models/holding/index.mjs +4 -0
- package/esm2020/lib/db/Models/index.mjs +2 -1
- package/esm2020/lib/db/Models/transaction/transaction-base.mjs +14 -1
- package/esm2020/lib/forms/client/client-income-types.form.mjs +2 -2
- package/esm2020/lib/forms/report/my-tax/my-tax-income-statements.form.mjs +17 -1
- package/esm2020/lib/models/account-setup/account-setup-item.mjs +2 -2
- package/esm2020/lib/models/account-setup/account-setup-items.const.mjs +14 -4
- package/esm2020/lib/models/account-setup/account-setup-items.enum.mjs +2 -1
- package/esm2020/lib/models/chart-accounts/chart-accounts-categories.const.mjs +16 -2
- package/esm2020/lib/models/chart-accounts/chart-accounts.mjs +4 -1
- package/esm2020/lib/models/client/client-income-types.mjs +1 -15
- package/esm2020/lib/models/holding/holding-sale.mjs +10 -0
- package/esm2020/lib/models/holding/holding-type.mjs +10 -0
- package/esm2020/lib/models/holding/holding.mjs +27 -0
- package/esm2020/lib/models/holding/index.mjs +4 -0
- package/esm2020/lib/models/index.mjs +2 -1
- package/esm2020/lib/models/report/my-tax/my-tax-income-statements/my-tax-income-statements.mjs +10 -1
- package/esm2020/lib/models/service-subscription/service-product.mjs +4 -1
- package/esm2020/lib/models/transaction/allocation-rule-condition.mjs +32 -1
- package/esm2020/lib/models/transaction/allocation-rule-transaction.mjs +48 -9
- package/esm2020/lib/models/transaction/allocation-rule.mjs +64 -3
- package/esm2020/lib/models/transaction/transaction.mjs +5 -2
- package/esm2020/lib/models/user/user-roles.const.mjs +3 -1
- package/esm2020/lib/services/account-setup/account-setup.service.mjs +19 -14
- package/esm2020/lib/services/http/holding/holding-sale.service.mjs +27 -0
- package/esm2020/lib/services/http/holding/holding-type.service.mjs +27 -0
- package/esm2020/lib/services/http/holding/holding.service.mjs +27 -0
- package/esm2020/lib/services/http/holding/index.mjs +4 -0
- package/esm2020/lib/services/http/index.mjs +2 -1
- package/esm2020/lib/services/http/rest/rest.service.mjs +1 -1
- package/fesm2015/taxtank-core.mjs +363 -46
- package/fesm2015/taxtank-core.mjs.map +1 -1
- package/fesm2020/taxtank-core.mjs +362 -46
- package/fesm2020/taxtank-core.mjs.map +1 -1
- package/lib/collections/allocation-rule.collection.d.ts +8 -0
- package/lib/db/Enums/chart-accounts/chart-accounts-category.enum.d.ts +3 -1
- package/lib/db/Enums/chart-accounts/chart-accounts-list.enum.d.ts +3 -1
- package/lib/db/Enums/holding/holding-type-category.enum.d.ts +8 -0
- package/lib/db/Enums/subscription/service-product-id.enum.d.ts +2 -1
- package/lib/db/Enums/tank-type.enum.d.ts +2 -1
- package/lib/db/Enums/user-roles.enum.d.ts +1 -0
- package/lib/db/Models/holding/holding-sale.d.ts +12 -0
- package/lib/db/Models/holding/holding-type.d.ts +12 -0
- package/lib/db/Models/holding/holding.d.ts +16 -0
- package/lib/db/Models/holding/index.d.ts +3 -0
- package/lib/db/Models/index.d.ts +1 -0
- package/lib/db/Models/transaction/transaction-base.d.ts +1 -0
- package/lib/forms/report/my-tax/my-tax-income-statements.form.d.ts +2 -2
- package/lib/models/account-setup/account-setup-item.d.ts +1 -1
- package/lib/models/account-setup/account-setup-items.enum.d.ts +2 -1
- package/lib/models/chart-accounts/chart-accounts.d.ts +1 -0
- package/lib/models/client/client-income-types.d.ts +0 -9
- package/lib/models/holding/holding-sale.d.ts +12 -0
- package/lib/models/holding/holding-type.d.ts +12 -0
- package/lib/models/holding/holding.d.ts +17 -0
- package/lib/models/holding/index.d.ts +3 -0
- package/lib/models/index.d.ts +1 -0
- package/lib/models/report/my-tax/my-tax-income-statements/my-tax-income-statements.d.ts +4 -0
- package/lib/models/service-subscription/service-product.d.ts +1 -0
- package/lib/models/transaction/allocation-rule-condition.d.ts +4 -0
- package/lib/models/transaction/allocation-rule-transaction.d.ts +5 -1
- package/lib/models/transaction/allocation-rule.d.ts +19 -1
- package/lib/services/account-setup/account-setup.service.d.ts +3 -2
- package/lib/services/http/holding/holding-sale.service.d.ts +17 -0
- package/lib/services/http/holding/holding-type.service.d.ts +17 -0
- package/lib/services/http/holding/holding.service.d.ts +17 -0
- package/lib/services/http/holding/index.d.ts +3 -0
- package/lib/services/http/index.d.ts +1 -0
- package/lib/services/http/rest/rest.service.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { Collection } from './collection';
|
|
2
2
|
import { AllocationRule } from '../models';
|
|
3
|
+
import { CollectionDictionary } from './collection-dictionary';
|
|
4
|
+
import { BankTransactionCollection } from './bank-transaction.collection';
|
|
3
5
|
export declare class AllocationRuleCollection extends Collection<AllocationRule> {
|
|
4
6
|
getExpense(): this;
|
|
5
7
|
getIncome(): this;
|
|
6
8
|
getTransfer(): this;
|
|
9
|
+
/**
|
|
10
|
+
* Get dictionary where key is bank transaction id and value is collection of matched rules.
|
|
11
|
+
* Group by this way for better performance
|
|
12
|
+
* @TODO Alex: break bank transactions by pagination in case of bad performance
|
|
13
|
+
*/
|
|
14
|
+
groupByBankTransaction(bankTransactions: BankTransactionCollection): CollectionDictionary<AllocationRuleCollection>;
|
|
7
15
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Holding } from './holding';
|
|
2
|
+
import { File } from '../file';
|
|
3
|
+
export declare class HoldingSale {
|
|
4
|
+
quantity?: number;
|
|
5
|
+
price?: number;
|
|
6
|
+
fee?: number;
|
|
7
|
+
total?: number;
|
|
8
|
+
profit?: number;
|
|
9
|
+
id?: number;
|
|
10
|
+
holding?: Holding;
|
|
11
|
+
file?: File;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HoldingTypeCategoryEnum } from '../../Enums/holding/holding-type-category.enum';
|
|
2
|
+
import { User } from '../user/user';
|
|
3
|
+
export declare class HoldingType {
|
|
4
|
+
category?: HoldingTypeCategoryEnum;
|
|
5
|
+
name?: string;
|
|
6
|
+
ticker?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
price?: number;
|
|
9
|
+
dividendPercent?: number;
|
|
10
|
+
id?: number;
|
|
11
|
+
user?: User;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { User } from '../user/user';
|
|
2
|
+
import { HoldingType } from './holding-type';
|
|
3
|
+
import { File } from '../file';
|
|
4
|
+
import { HoldingSale } from './holding-sale';
|
|
5
|
+
export declare class Holding {
|
|
6
|
+
isTaxFree?: boolean;
|
|
7
|
+
date?: Date;
|
|
8
|
+
quantity?: number;
|
|
9
|
+
price?: number;
|
|
10
|
+
fee?: number;
|
|
11
|
+
id?: number;
|
|
12
|
+
user?: User;
|
|
13
|
+
type?: HoldingType;
|
|
14
|
+
file?: File;
|
|
15
|
+
sales?: HoldingSale[];
|
|
16
|
+
}
|
package/lib/db/Models/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbstractForm } from '../../abstract.form';
|
|
2
|
-
import { MyTaxIncomeStatements } from '../../../models/report
|
|
3
|
-
import { User } from '../../../models
|
|
2
|
+
import { MyTaxIncomeStatements } from '../../../models/report';
|
|
3
|
+
import { User } from '../../../models';
|
|
4
4
|
export declare class MyTaxIncomeStatementsForm extends AbstractForm<MyTaxIncomeStatements> {
|
|
5
5
|
private incomeStatements;
|
|
6
6
|
constructor(incomeStatements: MyTaxIncomeStatements, user: User);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Account setup item instance is using for account setup checklist
|
|
3
3
|
*/
|
|
4
|
-
import { AbstractModel } from '../../db/Models
|
|
4
|
+
import { AbstractModel } from '../../db/Models';
|
|
5
5
|
export declare class AccountSetupItem extends AbstractModel {
|
|
6
6
|
title: string;
|
|
7
7
|
description: string;
|
|
@@ -1,12 +1,3 @@
|
|
|
1
1
|
import { ClientIncomeTypes as ClientIncomeTypesBase } from '../../db/Models/user/client-income-types';
|
|
2
2
|
export declare class ClientIncomeTypes extends ClientIncomeTypesBase {
|
|
3
|
-
salary: boolean;
|
|
4
|
-
property: boolean;
|
|
5
|
-
sole: boolean;
|
|
6
|
-
dividends: boolean;
|
|
7
|
-
other: boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Get count of selected income types
|
|
10
|
-
*/
|
|
11
|
-
get length(): number;
|
|
12
3
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Holding } from './holding';
|
|
2
|
+
import { AppFile } from '../file';
|
|
3
|
+
import { AbstractModel } from '../../db/Models';
|
|
4
|
+
export declare class HoldingSale extends AbstractModel {
|
|
5
|
+
quantity: number;
|
|
6
|
+
price: number;
|
|
7
|
+
fee: number;
|
|
8
|
+
total: number;
|
|
9
|
+
profit: number;
|
|
10
|
+
holding?: Holding;
|
|
11
|
+
file: AppFile;
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HoldingTypeCategoryEnum } from '../../db/Enums/holding/holding-type-category.enum';
|
|
2
|
+
import { User } from '../user';
|
|
3
|
+
import { AbstractModel } from '../../db/Models';
|
|
4
|
+
export declare class HoldingType extends AbstractModel {
|
|
5
|
+
category: HoldingTypeCategoryEnum;
|
|
6
|
+
name: string;
|
|
7
|
+
ticker: string;
|
|
8
|
+
description: string;
|
|
9
|
+
price: number;
|
|
10
|
+
dividendPercent: number;
|
|
11
|
+
user: User;
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { User } from '../user';
|
|
2
|
+
import { HoldingType } from './holding-type';
|
|
3
|
+
import { AppFile } from '../file';
|
|
4
|
+
import { HoldingSale } from './holding-sale';
|
|
5
|
+
import { Collection } from '../../collections';
|
|
6
|
+
import { AbstractModel } from '../../db/Models';
|
|
7
|
+
export declare class Holding extends AbstractModel {
|
|
8
|
+
isTaxFree: boolean;
|
|
9
|
+
date: Date;
|
|
10
|
+
quantity: number;
|
|
11
|
+
price: number;
|
|
12
|
+
fee: number;
|
|
13
|
+
user: User;
|
|
14
|
+
type: HoldingType;
|
|
15
|
+
file: AppFile;
|
|
16
|
+
sales: Collection<HoldingSale>;
|
|
17
|
+
}
|
package/lib/models/index.d.ts
CHANGED
|
@@ -26,5 +26,9 @@ export declare class MyTaxIncomeStatements {
|
|
|
26
26
|
superannuationIncomeStreamsTotalUntaxed: number;
|
|
27
27
|
attributablePsiTransactionsTotalAmount: number;
|
|
28
28
|
attributablePsiTransactionsTotalTax: number;
|
|
29
|
+
fhssTransactionsTotalAmount: number;
|
|
30
|
+
fhssTransactionsTotalTax: number;
|
|
31
|
+
australianSpecialPaymentsTotalAmount: number;
|
|
32
|
+
australianSpecialPaymentsTotalTax: number;
|
|
29
33
|
constructor(transactions: TransactionCollection);
|
|
30
34
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { AllocationRuleCondition as AllocationRuleConditionBase } from '../../db/Models/transaction/allocation-rule-condition';
|
|
2
|
+
import { BankTransaction } from '../bank';
|
|
2
3
|
export declare class AllocationRuleCondition extends AllocationRuleConditionBase {
|
|
4
|
+
matchBankTransaction(bankTransaction: BankTransaction): boolean;
|
|
5
|
+
matchBankTransactionByAmount(bankTransaction: BankTransaction): boolean;
|
|
6
|
+
matchBankTransactionByDescription(bankTransaction: BankTransaction): boolean;
|
|
3
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AllocationRuleTransaction as AllocationRuleTransactionBase } from '../../db/Models/transaction/allocation-rule-transaction';
|
|
2
2
|
import { ChartAccounts } from '../chart-accounts';
|
|
3
3
|
import { AllocationRuleTransactionMetaField } from './allocation-rule-transaction-meta-field';
|
|
4
|
-
import { Loan, Property, SoleBusiness } from '../../models';
|
|
4
|
+
import { BankTransaction, Loan, Property, SoleBusiness, Transaction } from '../../models';
|
|
5
5
|
import { IncomeSource } from '../income-source/income-source';
|
|
6
6
|
export declare class AllocationRuleTransaction extends AllocationRuleTransactionBase {
|
|
7
7
|
chartAccounts: ChartAccounts;
|
|
@@ -14,4 +14,8 @@ export declare class AllocationRuleTransaction extends AllocationRuleTransaction
|
|
|
14
14
|
childTransactions: AllocationRuleTransaction[];
|
|
15
15
|
claimPercent: number;
|
|
16
16
|
calculateClaimPercent(): number;
|
|
17
|
+
/**
|
|
18
|
+
* Create Transaction instance based on passed bank transaction and rule transaction
|
|
19
|
+
*/
|
|
20
|
+
toTransaction(bankTransaction: BankTransaction): Transaction;
|
|
17
21
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AllocationRule as AllocationRuleBase } from '../../db/Models/transaction/allocation-rule';
|
|
2
|
-
import { BankAccount } from '../bank';
|
|
2
|
+
import { BankAccount, BankTransaction } from '../bank';
|
|
3
3
|
import { AllocationRuleCondition } from './allocation-rule-condition';
|
|
4
4
|
import { AllocationRuleTransaction } from './allocation-rule-transaction';
|
|
5
5
|
import { AllocationRuleConditionOperatorEnum, AllocationRuleTypeEnum } from '../../db/Enums';
|
|
6
|
+
import { Transaction } from './transaction';
|
|
6
7
|
export declare class AllocationRule extends AllocationRuleBase {
|
|
7
8
|
bankAccount?: BankAccount;
|
|
8
9
|
conditions?: AllocationRuleCondition[];
|
|
@@ -21,4 +22,21 @@ export declare class AllocationRule extends AllocationRuleBase {
|
|
|
21
22
|
isPropertyIncome(): boolean;
|
|
22
23
|
isWorkIncome(): boolean;
|
|
23
24
|
isSoleIncome(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* @TODO Alex: move to collection
|
|
27
|
+
*/
|
|
28
|
+
matchBankTransaction(bankTransaction: BankTransaction): boolean;
|
|
29
|
+
createTransaction(bankTransaction: BankTransaction): Transaction;
|
|
30
|
+
/**
|
|
31
|
+
* Rule is matched when all conditions matched
|
|
32
|
+
*/
|
|
33
|
+
private checkAnd;
|
|
34
|
+
/**
|
|
35
|
+
* Rule is matched when at least one condition matched
|
|
36
|
+
*/
|
|
37
|
+
private checkOr;
|
|
38
|
+
/**
|
|
39
|
+
* Create allocation rule based on bank transaction (just prefill rule fields with bank transaction values)
|
|
40
|
+
*/
|
|
41
|
+
static fromBankTransaction(bankTransaction: BankTransaction): AllocationRule;
|
|
24
42
|
}
|
|
@@ -9,7 +9,7 @@ import { Observable, ReplaySubject } from 'rxjs';
|
|
|
9
9
|
import { AccountSetupItemCollection } from '../../collections/account-setup-item.collection';
|
|
10
10
|
import { VehicleClaimService } from '../http/vehicle/vehicle-claim.service';
|
|
11
11
|
import { TransactionService } from '../http/transaction/transaction.service';
|
|
12
|
-
import { SoleBusinessService } from '../http';
|
|
12
|
+
import { HoldingService, SoleBusinessService } from '../http';
|
|
13
13
|
import * as i0 from "@angular/core";
|
|
14
14
|
/**
|
|
15
15
|
* Service handling user's account setup process.
|
|
@@ -24,10 +24,11 @@ export declare class AccountSetupService {
|
|
|
24
24
|
private vehicleClaimService;
|
|
25
25
|
private transactionService;
|
|
26
26
|
private soleBusinessService;
|
|
27
|
+
private holdingService;
|
|
27
28
|
cache: AccountSetupItemCollection;
|
|
28
29
|
cacheSubject: ReplaySubject<AccountSetupItemCollection>;
|
|
29
30
|
clientIncomeTypesId: number;
|
|
30
|
-
constructor(clientIncomeTypesService: ClientIncomeTypesService, propertyService: PropertyService, incomeSourceService: IncomeSourceService, bankAccountsService: BankAccountService, transactionAllocationService: TransactionAllocationService, vehicleClaimService: VehicleClaimService, transactionService: TransactionService, soleBusinessService: SoleBusinessService);
|
|
31
|
+
constructor(clientIncomeTypesService: ClientIncomeTypesService, propertyService: PropertyService, incomeSourceService: IncomeSourceService, bankAccountsService: BankAccountService, transactionAllocationService: TransactionAllocationService, vehicleClaimService: VehicleClaimService, transactionService: TransactionService, soleBusinessService: SoleBusinessService, holdingService: HoldingService);
|
|
31
32
|
/**
|
|
32
33
|
* Get list of account setup items for current user
|
|
33
34
|
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HoldingSale as HoldingSaleBase } from '../../../db/Models';
|
|
2
|
+
import { HoldingSale } from '../../../models';
|
|
3
|
+
import { RestService, RestMethod } from '../rest';
|
|
4
|
+
import { Collection } from '../../../collections';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Service that handling banks logic
|
|
8
|
+
*/
|
|
9
|
+
export declare class HoldingSaleService extends RestService<HoldingSaleBase, HoldingSale, Collection<HoldingSale>> {
|
|
10
|
+
modelClass: typeof HoldingSale;
|
|
11
|
+
collectionClass: typeof Collection;
|
|
12
|
+
endpointUri: string;
|
|
13
|
+
isApiPlatform: boolean;
|
|
14
|
+
disabledMethods: RestMethod[];
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HoldingSaleService, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<HoldingSaleService>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HoldingType as HoldingTypeBase } from '../../../db/Models';
|
|
2
|
+
import { HoldingType } from '../../../models';
|
|
3
|
+
import { RestService, RestMethod } from '../rest';
|
|
4
|
+
import { Collection } from '../../../collections';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Service that handling banks logic
|
|
8
|
+
*/
|
|
9
|
+
export declare class HoldingTypeService extends RestService<HoldingTypeBase, HoldingType, Collection<HoldingType>> {
|
|
10
|
+
modelClass: typeof HoldingType;
|
|
11
|
+
collectionClass: typeof Collection;
|
|
12
|
+
endpointUri: string;
|
|
13
|
+
isApiPlatform: boolean;
|
|
14
|
+
disabledMethods: RestMethod[];
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HoldingTypeService, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<HoldingTypeService>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Holding as HoldingBase } from '../../../db/Models';
|
|
2
|
+
import { Holding } from '../../../models';
|
|
3
|
+
import { RestService, RestMethod } from '../rest';
|
|
4
|
+
import { Collection } from '../../../collections';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Service that handling banks logic
|
|
8
|
+
*/
|
|
9
|
+
export declare class HoldingService extends RestService<HoldingBase, Holding, Collection<Holding>> {
|
|
10
|
+
modelClass: typeof Holding;
|
|
11
|
+
collectionClass: typeof Collection;
|
|
12
|
+
endpointUri: string;
|
|
13
|
+
isApiPlatform: boolean;
|
|
14
|
+
disabledMethods: RestMethod[];
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HoldingService, never>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<HoldingService>;
|
|
17
|
+
}
|
|
@@ -14,7 +14,7 @@ import * as i0 from "@angular/core";
|
|
|
14
14
|
* BaseModel - base entity model that extends by Model
|
|
15
15
|
* CollectionModel - entity collection class
|
|
16
16
|
*/
|
|
17
|
-
export declare abstract class RestService<BaseModel
|
|
17
|
+
export declare abstract class RestService<BaseModel, Model extends AbstractModel, CollectionModel extends Collection<Model>> implements IEventListener {
|
|
18
18
|
protected http: HttpClient;
|
|
19
19
|
protected eventDispatcherService: EventDispatcherService;
|
|
20
20
|
protected environment: any;
|