taxtank-core 0.10.7 → 0.11.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.
Files changed (43) hide show
  1. package/bundles/taxtank-core.umd.js +2869 -2564
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/account-setup-item.collection.js +11 -0
  4. package/esm2015/lib/collections/bank-transaction.collection.js +2 -2
  5. package/esm2015/lib/collections/collection-dictionary.js +4 -4
  6. package/esm2015/lib/collections/transaction-allocation.collection.js +2 -2
  7. package/esm2015/lib/db/Enums/user-status.enum.js +1 -2
  8. package/esm2015/lib/db/Models/client-details.js +1 -1
  9. package/esm2015/lib/db/Models/client-income-types.js +3 -0
  10. package/esm2015/lib/forms/client/client-income-types.form.js +22 -0
  11. package/esm2015/lib/forms/index.js +2 -1
  12. package/esm2015/lib/models/account-setup/account-setup-item.js +6 -0
  13. package/esm2015/lib/models/account-setup/account-setup-items.const.js +44 -0
  14. package/esm2015/lib/models/account-setup/account-setup-items.enum.js +14 -0
  15. package/esm2015/lib/models/client/client-income-types.js +10 -0
  16. package/esm2015/lib/models/pdf/pdf-config.js +2 -2
  17. package/esm2015/lib/models/pdf/pdf-orientation.enum.js +6 -0
  18. package/esm2015/lib/services/account-setup/account-setup.service.js +124 -0
  19. package/esm2015/lib/services/http/firm/client-income/client-income-types.service.js +50 -0
  20. package/esm2015/lib/services/pdf/pdf.service.js +6 -6
  21. package/esm2015/lib/validators/at-least-one.validator.js +11 -0
  22. package/esm2015/lib/validators/index.js +2 -0
  23. package/esm2015/public-api.js +7 -1
  24. package/fesm2015/taxtank-core.js +2567 -2297
  25. package/fesm2015/taxtank-core.js.map +1 -1
  26. package/lib/collections/account-setup-item.collection.d.ts +6 -0
  27. package/lib/db/Enums/user-status.enum.d.ts +1 -2
  28. package/lib/db/Models/client-details.d.ts +5 -1
  29. package/lib/db/Models/client-income-types.d.ts +11 -0
  30. package/lib/forms/client/client-income-types.form.d.ts +7 -0
  31. package/lib/forms/index.d.ts +1 -0
  32. package/lib/models/account-setup/account-setup-item.d.ts +9 -0
  33. package/lib/models/account-setup/account-setup-items.const.d.ts +7 -0
  34. package/lib/models/account-setup/account-setup-items.enum.d.ts +12 -0
  35. package/lib/models/client/client-income-types.d.ts +7 -0
  36. package/lib/models/pdf/pdf-orientation.enum.d.ts +4 -0
  37. package/lib/services/account-setup/account-setup.service.d.ts +47 -0
  38. package/lib/services/http/firm/client-income/client-income-types.service.d.ts +18 -0
  39. package/lib/services/pdf/pdf.service.d.ts +2 -1
  40. package/lib/validators/at-least-one.validator.d.ts +6 -0
  41. package/lib/validators/index.d.ts +1 -0
  42. package/package.json +1 -1
  43. package/public-api.d.ts +6 -0
@@ -0,0 +1,6 @@
1
+ import { AccountSetupItem } from '../models/account-setup/account-setup-item';
2
+ import { Collection } from './collection';
3
+ export declare class AccountSetupItemCollection extends Collection<AccountSetupItem> {
4
+ constructor(items: AccountSetupItem[]);
5
+ isCompleted(): boolean;
6
+ }
@@ -1,6 +1,5 @@
1
1
  export declare enum UserStatusEnum {
2
2
  INACTIVE = 0,
3
3
  ON_BOARDING = 1,
4
- ACTIVE = 2,
5
- TRIAL = 3
4
+ ACTIVE = 2
6
5
  }
@@ -5,8 +5,8 @@ import { User } from './user';
5
5
  import { Occupation } from './occupation';
6
6
  import { Address } from './address';
7
7
  import { Phone } from './phone';
8
+ import { ClientIncomeTypes } from './client-income-types';
8
9
  export declare class ClientDetails {
9
- id?: number;
10
10
  isAustralianResident?: boolean;
11
11
  taxFileNumber?: string;
12
12
  workDepreciationCalculation?: ClientDetailsWorkDepreciationCalculationEnum;
@@ -19,7 +19,10 @@ export declare class ClientDetails {
19
19
  pensionersTax?: boolean;
20
20
  workingHolidayMaker?: ClientDetailsWorkingHolidayMakerEnum;
21
21
  dateOfBirth?: Date;
22
+ abn?: number;
23
+ isGST?: boolean;
22
24
  capitalLoss?: number;
25
+ id?: number;
23
26
  deletedAt?: Date;
24
27
  createdAt?: Date;
25
28
  updatedAt?: Date;
@@ -27,4 +30,5 @@ export declare class ClientDetails {
27
30
  occupation?: Occupation;
28
31
  addresses?: Address[];
29
32
  phones?: Phone[];
33
+ incomeTypes?: ClientIncomeTypes;
30
34
  }
@@ -0,0 +1,11 @@
1
+ import { ClientDetails } from './client-details';
2
+ export declare class ClientIncomeTypes {
3
+ salary?: boolean;
4
+ rental?: boolean;
5
+ soleTrader?: boolean;
6
+ dividends?: boolean;
7
+ other?: boolean;
8
+ id?: number;
9
+ deletedAt?: Date;
10
+ clientDetails?: ClientDetails;
11
+ }
@@ -0,0 +1,7 @@
1
+ import { AbstractForm } from '../abstract.form';
2
+ import { ClientIncomeTypes } from '../../models/client/client-income-types';
3
+ export declare class ClientIncomeTypesForm extends AbstractForm {
4
+ private clientIncomeTypes;
5
+ constructor(clientIncomeTypes: ClientIncomeTypes);
6
+ submit(): object;
7
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './abstract.form';
2
+ export * from './client/client-income-types.form';
2
3
  export * from './login/login.form';
3
4
  export * from './register/register-client.form';
4
5
  export * from './register/register-firm.form';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Account setup item instance is using for account setup checklist
3
+ */
4
+ export declare class AccountSetupItem {
5
+ title: string;
6
+ description: string;
7
+ url: string;
8
+ isCompleted: boolean;
9
+ }
@@ -0,0 +1,7 @@
1
+ import { AccountSetupItem } from './account-setup-item';
2
+ /**
3
+ * List of all possible account setup steps
4
+ */
5
+ export declare const ACCOUNT_SETUP_ITEMS: {
6
+ [key: number]: AccountSetupItem;
7
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Enum list of all possible account setup items. Using with [ACCOUNT_SETUP_ITEMS]{@link ACCOUNT_SETUP_ITEMS}
3
+ */
4
+ export declare enum AccountSetupItemsEnum {
5
+ SALARY = 0,
6
+ OTHER_INCOME = 1,
7
+ PROPERTY = 2,
8
+ BANK_FEEDS = 3,
9
+ WORK_LOGBOOK = 4,
10
+ SOLE_INCOME = 5,
11
+ TRANSACTION = 6
12
+ }
@@ -0,0 +1,7 @@
1
+ import { ClientIncomeTypes as ClientIncomeTypesBase } from '../../db/Models/client-income-types';
2
+ export declare class ClientIncomeTypes extends ClientIncomeTypesBase {
3
+ /**
4
+ * Get count of selected income types
5
+ */
6
+ get length(): number;
7
+ }
@@ -0,0 +1,4 @@
1
+ export declare enum PdfOrientationEnum {
2
+ PORTRAIT = "portrait",
3
+ LANDSCAPE = "landscape"
4
+ }
@@ -0,0 +1,47 @@
1
+ import { BankAccountService } from '../http/bank/bank-account/bank-account.service';
2
+ import { ClientIncomeTypesService } from '../http/firm/client-income/client-income-types.service';
3
+ import { IncomeSourceService } from '../http/income-source/income-source.service';
4
+ import { PropertyService } from '../http/property/property.service';
5
+ import { TransactionAllocationService } from '../http/transaction/transaction-allocation/transaction-allocation.service';
6
+ import { VehicleService } from '../http/vehicle/vehicle.service';
7
+ import { Observable, ReplaySubject } from 'rxjs';
8
+ import { AccountSetupItemCollection } from '../../collections/account-setup-item.collection';
9
+ import * as i0 from "@angular/core";
10
+ /**
11
+ * Service handling user's account setup process.
12
+ * Checks required steps and their completion
13
+ */
14
+ export declare class AccountSetupService {
15
+ private clientIncomeTypesService;
16
+ private propertyService;
17
+ private incomeSourceService;
18
+ private bankAccountsService;
19
+ private transactionAllocationService;
20
+ private vehicleService;
21
+ cache: AccountSetupItemCollection;
22
+ cacheSubject: ReplaySubject<AccountSetupItemCollection>;
23
+ constructor(clientIncomeTypesService: ClientIncomeTypesService, propertyService: PropertyService, incomeSourceService: IncomeSourceService, bankAccountsService: BankAccountService, transactionAllocationService: TransactionAllocationService, vehicleService: VehicleService);
24
+ /**
25
+ * Get list of account setup items for current user
26
+ */
27
+ get(): Observable<AccountSetupItemCollection>;
28
+ /**
29
+ * Get a single AccountSetupItem and check it's completion
30
+ */
31
+ private create;
32
+ /**
33
+ * Get batch of requests to get list of required AccountSetupItem's.
34
+ * Some items are optional and depends of user's client income types
35
+ */
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
+ /**
42
+ * @TODO work with collection when services refactored
43
+ */
44
+ private getIncomeSourcesByType;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<AccountSetupService, never>;
46
+ static ɵprov: i0.ɵɵInjectableDeclaration<AccountSetupService>;
47
+ }
@@ -0,0 +1,18 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable, ReplaySubject } from 'rxjs';
3
+ import { ClientIncomeTypes } from '../../../../models/client/client-income-types';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * @TODO extend rest service when it could work with single objects, not only arrays
7
+ */
8
+ export declare class ClientIncomeTypesService {
9
+ private http;
10
+ private environment;
11
+ cache: ClientIncomeTypes;
12
+ cacheSubject: ReplaySubject<ClientIncomeTypes>;
13
+ constructor(http: HttpClient, environment: any);
14
+ get(): Observable<ClientIncomeTypes>;
15
+ update(incomeTypes: ClientIncomeTypes): Observable<ClientIncomeTypes>;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<ClientIncomeTypesService, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<ClientIncomeTypesService>;
18
+ }
@@ -1,10 +1,11 @@
1
1
  import { ExportDataTable } from '../../models/export/export-data-table';
2
+ import { PdfOrientationEnum } from '../../models/pdf/pdf-orientation.enum';
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class PdfService {
4
5
  /**
5
6
  * Export file from provided HTML tables
6
7
  */
7
- exportTables(tables: NodeListOf<HTMLTableElement>, title: string, fileName: string): void;
8
+ exportTables(tables: NodeListOf<HTMLTableElement>, title: string, fileName: string, orientation: PdfOrientationEnum): void;
8
9
  /**
9
10
  * Export file from provided array-like table data
10
11
  */
@@ -0,0 +1,6 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ /**
3
+ * Check if at least one form field is true, otherwise form is invalid.
4
+ * Use with groups of boolean form controls (checkbox, toggle, etc.)
5
+ */
6
+ export declare function atLeastOneCheckedValidator(): ValidatorFn;
@@ -0,0 +1 @@
1
+ export * from './at-least-one.validator';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.10.7",
3
+ "version": "0.11.0",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",
package/public-api.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from './lib/tt-core.module';
6
6
  * Collections
7
7
  */
8
8
  export * from './lib/collections/collection';
9
+ export * from './lib/collections/account-setup-item.collection';
9
10
  export * from './lib/collections/bank-account.collection';
10
11
  export * from './lib/collections/bank-transaction.collection';
11
12
  export * from './lib/collections/client.collection';
@@ -125,6 +126,7 @@ export * from './lib/db/Enums/property/property-sale/tax-exemption-metadata.enum
125
126
  /**
126
127
  * Models and related enums and consts
127
128
  */
129
+ export * from './lib/models/account-setup/account-setup-item';
128
130
  export * from './lib/models/address/address';
129
131
  export * from './lib/models/address/country';
130
132
  export * from './lib/models/bank/bank';
@@ -155,6 +157,7 @@ export * from './lib/models/chat/chat-view-type.enum';
155
157
  export * from './lib/models/chat/message';
156
158
  export * from './lib/models/chat/message-document';
157
159
  export * from './lib/models/client/client-details';
160
+ export * from './lib/models/client/client-income-types';
158
161
  export * from './lib/models/client/client-invite';
159
162
  export * from './lib/models/client/client-movement';
160
163
  export * from './lib/models/client/client-portfolio-chart-data';
@@ -204,6 +207,7 @@ export * from './lib/models/logbook/vehicle';
204
207
  export * from './lib/models/logbook/vehicle-claim';
205
208
  export * from './lib/models/logbook/vehicle-logbook';
206
209
  export * from './lib/models/notification/notification';
210
+ export * from './lib/models/pdf/pdf-orientation.enum';
207
211
  export * from './lib/models/phone/phone';
208
212
  export * from './lib/models/property/calculation-form-item';
209
213
  export * from './lib/models/property/calculation-form-type.enum';
@@ -268,6 +272,7 @@ export * from './lib/models/user-event/user-event-type';
268
272
  /**
269
273
  * Services
270
274
  */
275
+ export * from './lib/services/account-setup/account-setup.service';
271
276
  export * from './lib/services/http/address/address.service';
272
277
  export * from './lib/services/asset/assets.service';
273
278
  export * from './lib/services/auth/auth.service';
@@ -293,6 +298,7 @@ export * from './lib/services/http/depreciation/depreciation.service';
293
298
  export * from './lib/services/http/document/document-folder/document-folder.service';
294
299
  export * from './lib/services/http/firm/employee/employee.service';
295
300
  export * from './lib/services/http/firm/employee-invite/employee-invite.service';
301
+ export * from './lib/services/http/firm/client-income/client-income-types.service';
296
302
  export * from './lib/services/event/event-dispatcher.service';
297
303
  export * from './lib/services/event/sse.service';
298
304
  export * from './lib/services/http/firm/firm.service';