taxtank-core 1.0.29 → 1.0.31
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/README.md +5 -5
- package/fesm2022/taxtank-core-common.mjs.map +1 -1
- package/fesm2022/taxtank-core.mjs +254 -189
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/src/lib/collections/account-setup-item.collection.d.ts +5 -1
- package/src/lib/collections/bank-account.collection.d.ts +1 -1
- package/src/lib/collections/subscription/service-subscription.collection.d.ts +2 -0
- package/src/lib/db/Enums/index.d.ts +1 -0
- package/src/lib/db/Enums/onboarding-videos.enum.d.ts +7 -0
- package/src/lib/db/Enums/setup-item-type.enum.d.ts +8 -2
- package/src/lib/db/Models/property/property.d.ts +1 -0
- package/src/lib/db/Models/setup-item.d.ts +4 -1
- package/src/lib/models/account-setup/account-setup-item-status.enum.d.ts +5 -0
- package/src/lib/models/account-setup/account-setup-item.d.ts +5 -12
- package/src/lib/models/account-setup/account-setup-items.enum.d.ts +29 -11
- package/src/lib/models/account-setup/index.d.ts +3 -0
- package/src/lib/models/bank/bank-account.d.ts +6 -6
- package/src/lib/models/index.d.ts +1 -0
- package/src/lib/models/user/user.d.ts +1 -1
- package/src/lib/services/account-setup/account-setup.service.d.ts +32 -14
- package/src/lib/services/http/firm/firm.service.d.ts +0 -4
- package/src/lib/services/http/loan/borrowing-expense/borrowing-expense.service.d.ts +2 -1
- package/src/lib/services/http/rest/rest-old.service.d.ts +1 -0
- package/src/lib/services/http/rest/rest.service.d.ts +1 -0
- package/src/lib/services/http/setup-item/setup-item.service.d.ts +1 -1
- package/src/lib/services/http/user/user.service.d.ts +2 -2
- /package/src/lib/{functions/transformer → transformer}/transformDate.d.ts +0 -0
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
@@ -37,6 +37,7 @@ export * from './src/lib/db/Enums/depreciation-write-off-amount.enum';
|
|
37
37
|
export * from './src/lib/db/Enums/firm/firm-type.enum';
|
38
38
|
export * from './src/lib/db/Enums/income-source';
|
39
39
|
export * from './src/lib/db/Enums/invite-status.enum';
|
40
|
+
export * from './src/lib/db/Enums/onboarding-videos.enum';
|
40
41
|
export * from './src/lib/db/Enums/bank/loan';
|
41
42
|
export * from './src/lib/db/Enums/phone-type.enum';
|
42
43
|
export * from './src/lib/db/Enums/property/property-depreciation-calculation.enum';
|
@@ -1,6 +1,10 @@
|
|
1
|
-
import { AccountSetupItem } from '../models
|
1
|
+
import { AccountSetupItem } from '../models';
|
2
2
|
import { Collection } from './collection';
|
3
|
+
import { User } from '../models';
|
3
4
|
export declare class AccountSetupItemCollection extends Collection<AccountSetupItem> {
|
4
5
|
constructor(items: AccountSetupItem[]);
|
5
6
|
isCompleted(): boolean;
|
7
|
+
getByUser(user: User): this;
|
8
|
+
getScore(): number;
|
9
|
+
setUrlId(id: string): void;
|
6
10
|
}
|
@@ -31,7 +31,7 @@ export declare class BankAccountCollection extends Collection<BankAccount> {
|
|
31
31
|
/**
|
32
32
|
* Get Collection of bank accounts by tank type
|
33
33
|
*/
|
34
|
-
getByTankType(tankType
|
34
|
+
getByTankType(tankType?: TankTypeEnum): BankAccountCollection;
|
35
35
|
/**
|
36
36
|
* Get list of all bank account properties
|
37
37
|
*/
|
@@ -10,6 +10,7 @@ export declare class ServiceSubscriptionCollection extends Collection<ServiceSub
|
|
10
10
|
getExpiredTrials(): this;
|
11
11
|
getExpiredAfter(date?: Date): this;
|
12
12
|
getPaid(): this;
|
13
|
+
getRoles(): UserRolesEnum[];
|
13
14
|
getActivePaid(): ServiceSubscription;
|
14
15
|
/**
|
15
16
|
* @TODO vik remove trials replaced by paid item
|
@@ -19,5 +20,6 @@ export declare class ServiceSubscriptionCollection extends Collection<ServiceSub
|
|
19
20
|
findByProduct(product: ServiceProduct): ServiceSubscription;
|
20
21
|
filterByProduct(product: ServiceProduct): this;
|
21
22
|
filterByRole(role: UserRolesEnum): this;
|
23
|
+
findByRole(role: UserRolesEnum): ServiceSubscription;
|
22
24
|
hasPropertyTank(): boolean;
|
23
25
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SetupItemTypeEnum } from '../Enums
|
1
|
+
import { SetupItemTypeEnum } from '../Enums';
|
2
2
|
import { UserRolesEnum } from 'taxtank-core/common';
|
3
3
|
import { AbstractModel } from './abstract-model';
|
4
4
|
export declare class SetupItem extends AbstractModel {
|
@@ -7,5 +7,8 @@ export declare class SetupItem extends AbstractModel {
|
|
7
7
|
description?: string;
|
8
8
|
url?: string;
|
9
9
|
urlFragment?: string;
|
10
|
+
isRequired?: boolean;
|
11
|
+
order?: number;
|
12
|
+
score?: number;
|
10
13
|
roles?: UserRolesEnum;
|
11
14
|
}
|
@@ -1,15 +1,8 @@
|
|
1
1
|
import { SetupItem } from '../../db/Models/setup-item';
|
2
2
|
export declare class AccountSetupItem extends SetupItem {
|
3
|
-
|
4
|
-
get
|
5
|
-
get
|
6
|
-
get
|
7
|
-
get
|
8
|
-
get isWorkLogbook(): boolean;
|
9
|
-
get isTransactionAllocate(): boolean;
|
10
|
-
get isSoleBusiness(): boolean;
|
11
|
-
get isHoldings(): boolean;
|
12
|
-
get isFirmDetails(): boolean;
|
13
|
-
get isInviteTeam(): boolean;
|
14
|
-
get isInviteClients(): boolean;
|
3
|
+
status: number;
|
4
|
+
get isPending(): boolean;
|
5
|
+
get isAchieved(): boolean;
|
6
|
+
get isCompleted(): boolean;
|
7
|
+
get isSkipped(): boolean;
|
15
8
|
}
|
@@ -1,17 +1,35 @@
|
|
1
1
|
/**
|
2
|
-
*
|
3
|
-
* @TODO Vik/Nikita: Do we need to generate it from backend? If some ids changed?
|
2
|
+
* TODO remove
|
4
3
|
*/
|
5
4
|
export declare enum AccountSetupItemsEnum {
|
6
|
-
|
7
|
-
|
5
|
+
FIRM_DETAILS = 9,
|
6
|
+
FIRM_EMPLOYEES = 10,
|
7
|
+
FIRM_CLIENTS = 11,
|
8
|
+
WORK_SALARY = 1,
|
9
|
+
WORK_OTHER_INCOME = 2,
|
10
|
+
WORK_VEHICLE_CLAIM = 5,
|
11
|
+
WORK_HOME_OFFICE = 13,
|
12
|
+
WORK_BANK_ACCOUNT = 14,
|
13
|
+
WORK_DEPRECIATION = 15,
|
8
14
|
PROPERTY = 3,
|
9
|
-
|
10
|
-
|
11
|
-
|
15
|
+
PROPERTIES = 29,
|
16
|
+
PROPERTIES_BANK_ACCOUNT = 30,
|
17
|
+
PROPERTY_CAPITAL_COST = 17,
|
18
|
+
PROPERTY_RENT_INCOME = 18,
|
19
|
+
PROPERTY_DEPRECIATION = 19,
|
20
|
+
PROPERTY_CO_OWNER = 20,
|
12
21
|
SOLE_BUSINESS = 7,
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
22
|
+
SOLE_BUSINESSES = 33,
|
23
|
+
SOLE_VEHICLE_CLAIM = 12,
|
24
|
+
SOLE_HOME_OFFICE = 21,
|
25
|
+
SOLE_DEPRECIATION = 22,
|
26
|
+
SOLE_BANK_ACCOUNT = 23,
|
27
|
+
HOLDING_TRADE = 8,
|
28
|
+
HOLDING_INTEGRATION = 25,
|
29
|
+
HOLDING_REPORTS = 36,
|
30
|
+
BANK_CONNECTION = 4,
|
31
|
+
BANK_ACCOUNT = 26,
|
32
|
+
BANK_ALLOCATION = 6,
|
33
|
+
BANK_RULE = 27,
|
34
|
+
BANK_BORROWING_EXPENSE = 28
|
17
35
|
}
|
@@ -22,7 +22,7 @@ export declare class BankAccount extends BankAccountBase {
|
|
22
22
|
get partialAccountNumber(): string;
|
23
23
|
get balance(): number;
|
24
24
|
/**
|
25
|
-
* Get current opening balance amount
|
25
|
+
* Get the current opening balance amount
|
26
26
|
*/
|
27
27
|
getOpeningBalance(year?: number): number;
|
28
28
|
/**
|
@@ -34,7 +34,7 @@ export declare class BankAccount extends BankAccountBase {
|
|
34
34
|
*/
|
35
35
|
isSavingsAccount(): boolean;
|
36
36
|
/**
|
37
|
-
* check if bank account type is Loan
|
37
|
+
* check if a bank account type is Loan
|
38
38
|
*/
|
39
39
|
isLoan(): boolean;
|
40
40
|
/**
|
@@ -42,15 +42,15 @@ export declare class BankAccount extends BankAccountBase {
|
|
42
42
|
*/
|
43
43
|
isCreditCard(): boolean;
|
44
44
|
/**
|
45
|
-
* check if bank account related to work tank
|
45
|
+
* check if a bank account related to work tank
|
46
46
|
*/
|
47
47
|
isWorkTank(): boolean;
|
48
48
|
/**
|
49
|
-
* check if bank account related to work tank
|
49
|
+
* check if a bank account related to work tank
|
50
50
|
*/
|
51
51
|
isPropertyTank(): boolean;
|
52
52
|
/**
|
53
|
-
* check if bank account related to sole tank
|
53
|
+
* check if a bank account related to sole tank
|
54
54
|
*/
|
55
55
|
isSoleTank(): boolean;
|
56
56
|
/**
|
@@ -59,7 +59,7 @@ export declare class BankAccount extends BankAccountBase {
|
|
59
59
|
*/
|
60
60
|
getPropertyById(id: number): BankAccountProperty;
|
61
61
|
/**
|
62
|
-
* check if bank account is related with passed property by id
|
62
|
+
* check if a bank account is related with passed property by id
|
63
63
|
* @param propertyId Property id for checking
|
64
64
|
*/
|
65
65
|
hasProperty(propertyId: number): boolean;
|
@@ -7,7 +7,7 @@ import { Phone } from '../phone/phone';
|
|
7
7
|
import { ServiceSubscription } from '../service-subscription';
|
8
8
|
import { SoleDetails } from '../sole';
|
9
9
|
import { AppFile } from '../file';
|
10
|
-
import { AccountSetupItem } from '../account-setup
|
10
|
+
import { AccountSetupItem } from '../account-setup';
|
11
11
|
import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
|
12
12
|
export declare class User extends BaseUser {
|
13
13
|
subscriptions: ServiceSubscription[];
|
@@ -1,8 +1,7 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { Property, User } from '../../models';
|
2
|
+
import { AllocationRuleService, BankAccountService, BankConnectionService, ClientInviteService, ClientMovementService, DepreciationService, EmployeeInviteService, EmployeeService, FirmService, HoldingTradeService, HomeOfficeClaimService, IncomeSourceService, LoanService, PropertyService, PropertyShareService, SharesightDetailsService, SoleBusinessService, TransactionAllocationService, TransactionService, UserService, VehicleClaimService } from '../http';
|
3
3
|
import { AccountSetupItemCollection } from '../../collections';
|
4
4
|
import { Observable } from 'rxjs';
|
5
|
-
import { SetupItemTypeEnum } from '../../db/Enums/setup-item-type.enum';
|
6
5
|
import { SetupItemService } from '../http/setup-item/setup-item.service';
|
7
6
|
import * as i0 from "@angular/core";
|
8
7
|
/**
|
@@ -13,10 +12,15 @@ export declare class AccountSetupService {
|
|
13
12
|
private setupItemService;
|
14
13
|
private propertyService;
|
15
14
|
private incomeSourceService;
|
15
|
+
private bankConnectionService;
|
16
16
|
private bankAccountsService;
|
17
|
+
private loanService;
|
18
|
+
private allocationRuleService;
|
17
19
|
private transactionAllocationService;
|
18
20
|
private vehicleClaimService;
|
21
|
+
private homeOfficeClaimService;
|
19
22
|
private transactionService;
|
23
|
+
private depreciationService;
|
20
24
|
private soleBusinessService;
|
21
25
|
private holdingService;
|
22
26
|
private userService;
|
@@ -25,32 +29,46 @@ export declare class AccountSetupService {
|
|
25
29
|
private employeeService;
|
26
30
|
private employeeInviteService;
|
27
31
|
private firmService;
|
32
|
+
private sharesightDetailsService;
|
33
|
+
private propertyShareService;
|
28
34
|
items: AccountSetupItemCollection;
|
29
35
|
user: User;
|
30
|
-
constructor(setupItemService: SetupItemService, propertyService: PropertyService, incomeSourceService: IncomeSourceService, bankAccountsService: BankAccountService, transactionAllocationService: TransactionAllocationService, vehicleClaimService: VehicleClaimService, transactionService: TransactionService, soleBusinessService: SoleBusinessService, holdingService: HoldingTradeService, userService: UserService, clientMovementService: ClientMovementService, clientInviteService: ClientInviteService, employeeService: EmployeeService, employeeInviteService: EmployeeInviteService, firmService: FirmService);
|
36
|
+
constructor(setupItemService: SetupItemService, propertyService: PropertyService, incomeSourceService: IncomeSourceService, bankConnectionService: BankConnectionService, bankAccountsService: BankAccountService, loanService: LoanService, allocationRuleService: AllocationRuleService, transactionAllocationService: TransactionAllocationService, vehicleClaimService: VehicleClaimService, homeOfficeClaimService: HomeOfficeClaimService, transactionService: TransactionService, depreciationService: DepreciationService, soleBusinessService: SoleBusinessService, holdingService: HoldingTradeService, userService: UserService, clientMovementService: ClientMovementService, clientInviteService: ClientInviteService, employeeService: EmployeeService, employeeInviteService: EmployeeInviteService, firmService: FirmService, sharesightDetailsService: SharesightDetailsService, propertyShareService: PropertyShareService);
|
31
37
|
/**
|
32
38
|
* Get list of account setup items for current user/firm
|
33
39
|
*/
|
34
|
-
get(
|
35
|
-
|
36
|
-
getFirmItems$(): Observable<AccountSetupItemCollection>;
|
40
|
+
get(property?: Property): Observable<AccountSetupItemCollection>;
|
41
|
+
setItemsStatus(property?: Property): Observable<AccountSetupItemCollection>;
|
37
42
|
/**
|
38
43
|
* Check and update isCompleted flag for passed item
|
39
44
|
*/
|
40
45
|
private setItemStatus;
|
46
|
+
private getProperties;
|
47
|
+
private getTransactions;
|
48
|
+
private getCoOwners;
|
41
49
|
/**
|
42
|
-
*
|
43
|
-
* @TODO Vik: waiting for income sources refactoring
|
50
|
+
* AccountSetupItemsEnum.FIRM_CLIENTS completed when client invites sent or accepted
|
44
51
|
*/
|
45
|
-
private
|
52
|
+
private getClients;
|
53
|
+
/**
|
54
|
+
* AccountSetupItemsEnum.FIRM_EMPLOYEES completed when employee invites sent or accepted
|
55
|
+
*/
|
56
|
+
private getEmployees;
|
46
57
|
/**
|
47
|
-
*
|
58
|
+
* AccountSetupItemsEnum.FIRM_DETAILS when firm data filled
|
48
59
|
*/
|
49
|
-
private
|
60
|
+
private getFirms;
|
50
61
|
/**
|
51
|
-
*
|
62
|
+
* @TODO Alex: work with collection when services refactored
|
63
|
+
* @TODO Vik: waiting for income sources refactoring
|
52
64
|
*/
|
53
|
-
private
|
65
|
+
private getIncomeSources;
|
66
|
+
private getVehicleClaims;
|
67
|
+
private getHomeOfficeClaims;
|
68
|
+
private getBankAccounts;
|
69
|
+
private getDepreciations;
|
70
|
+
private getSharesightDetails;
|
71
|
+
private getBorrowingExpenses;
|
54
72
|
static ɵfac: i0.ɵɵFactoryDeclaration<AccountSetupService, never>;
|
55
73
|
static ɵprov: i0.ɵɵInjectableDeclaration<AccountSetupService>;
|
56
74
|
}
|
@@ -9,10 +9,6 @@ export declare class FirmService {
|
|
9
9
|
firm: Firm;
|
10
10
|
firmSubject: ReplaySubject<Firm>;
|
11
11
|
constructor(http: HttpClient, environment: any);
|
12
|
-
/**
|
13
|
-
* Register new firm
|
14
|
-
* @param data: firm and firm owner data to register
|
15
|
-
*/
|
16
12
|
register(data: Firm): Observable<Firm>;
|
17
13
|
get(): Observable<Firm>;
|
18
14
|
update(firm: Firm): Observable<void>;
|
@@ -2,6 +2,7 @@ import { Observable, ReplaySubject } from 'rxjs';
|
|
2
2
|
import { HttpClient } from '@angular/common/http';
|
3
3
|
import { BorrowingExpense } from '../../../../models/borrowing-expense/borrowing-expense';
|
4
4
|
import { Loan } from '../../../../models/loan/loan';
|
5
|
+
import { BorrowingExpenseLoan } from '../../../../models/borrowing-expense/borrowing-expense-loan';
|
5
6
|
import * as i0 from "@angular/core";
|
6
7
|
/**
|
7
8
|
* @TODO Alex (TT-1777): Refactor with rest service
|
@@ -16,7 +17,7 @@ export declare class BorrowingExpenseService {
|
|
16
17
|
* Get borrowing expenses
|
17
18
|
*/
|
18
19
|
get(): Observable<BorrowingExpense[]>;
|
19
|
-
getLoanBorrowingExpenses(loan?: Loan): Observable<
|
20
|
+
getLoanBorrowingExpenses(loan?: Loan): Observable<BorrowingExpenseLoan[]>;
|
20
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<BorrowingExpenseService, never>;
|
21
22
|
static ɵprov: i0.ɵɵInjectableDeclaration<BorrowingExpenseService>;
|
22
23
|
}
|
@@ -13,6 +13,7 @@ import * as i0 from "@angular/core";
|
|
13
13
|
*/
|
14
14
|
export declare abstract class RestService<BaseModel, Model extends BaseModel> {
|
15
15
|
protected environment: any;
|
16
|
+
private inFlight$?;
|
16
17
|
protected toastService: ToastService;
|
17
18
|
protected http: HttpClient;
|
18
19
|
protected eventDispatcherService: EventDispatcherService;
|
@@ -19,6 +19,7 @@ import * as i0 from "@angular/core";
|
|
19
19
|
*/
|
20
20
|
export declare abstract class RestService<BaseModel, Model extends AbstractModel, CollectionModel extends Collection<Model>> extends DataService<BaseModel, Model, CollectionModel> {
|
21
21
|
protected environment: any;
|
22
|
+
private inFlight$?;
|
22
23
|
/**
|
23
24
|
* Url part for service entity API
|
24
25
|
*/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { AccountSetupItemCollection } from '../../../collections';
|
2
2
|
import { SetupItem } from '../../../db/Models/setup-item';
|
3
|
-
import { AccountSetupItem } from '../../../models
|
3
|
+
import { AccountSetupItem } from '../../../models';
|
4
4
|
import { RestMethod, RestService } from '../rest';
|
5
5
|
import * as i0 from "@angular/core";
|
6
6
|
export declare class SetupItemService extends RestService<SetupItem, AccountSetupItem, AccountSetupItemCollection> {
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import { Observable } from 'rxjs';
|
2
2
|
import { User as UserBase } from '../../../db/Models/user/user';
|
3
|
-
import { User } from '../../../models';
|
3
|
+
import { AccountSetupItem, User } from '../../../models';
|
4
4
|
import { RestMethod, RestService } from '../rest';
|
5
5
|
import { Collection } from '../../../collections';
|
6
|
-
import { AccountSetupItem } from '../../../models/account-setup/account-setup-item';
|
7
6
|
import { IEventListener } from '../../../interfaces';
|
8
7
|
import { MixpanelService } from 'taxtank-core/common';
|
9
8
|
import * as i0 from "@angular/core";
|
@@ -35,6 +34,7 @@ export declare class UserService extends RestService<UserBase, User, Collection<
|
|
35
34
|
updatePhoto(photo: FormData): Observable<void>;
|
36
35
|
createBasiq(): Observable<string>;
|
37
36
|
skipSetupItem(item: AccountSetupItem): Observable<User>;
|
37
|
+
restoreSetupItem(item: AccountSetupItem): Observable<User>;
|
38
38
|
/**
|
39
39
|
* Update cache when user's service subscription is updated
|
40
40
|
*/
|
File without changes
|