taxtank-core 0.16.1 → 0.16.4

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.
@@ -0,0 +1,7 @@
1
+ import { ExportRow } from '../models/export/export-row';
2
+ /**
3
+ * Interface for classes which should implement data-table functionality (like create table rows, columns, e.t.c.)
4
+ */
5
+ export interface DataTableExportable {
6
+ toDataTableRows(): ExportRow[];
7
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Enum which shows what type (in terms of business logic) of the data-table row item
3
+ */
4
+ export declare enum ExportRowDataTypeEnum {
5
+ STRING = 0,
6
+ CURRENCY = 1,
7
+ DATE = 2
8
+ }
@@ -0,0 +1,8 @@
1
+ import { ExportRowDataTypeEnum } from './export-row-data-type.enum';
2
+ /**
3
+ * Class with structure of the data-table rows
4
+ */
5
+ export declare class ExportRow {
6
+ data: any;
7
+ type: ExportRowDataTypeEnum;
8
+ }
@@ -1,7 +1,10 @@
1
+ import { DataTableExportable } from '../../interfaces/table-exportable.interface';
2
+ import { ExportRow } from '../export/export-row';
3
+ export declare const EXPORT_DATA_TABLE_COLUMNS: string[];
1
4
  /**
2
5
  * Loan payment class
3
6
  */
4
- export declare class LoanPayment {
7
+ export declare class LoanPayment implements DataTableExportable {
5
8
  date: Date;
6
9
  interestAccrued: number;
7
10
  interestBalance: number;
@@ -9,5 +12,7 @@ export declare class LoanPayment {
9
12
  paymentDue: number;
10
13
  principalBalance: number;
11
14
  principalPaid: number;
15
+ payout: number;
12
16
  totalOwed: number;
17
+ toDataTableRows(): ExportRow[];
13
18
  }
@@ -0,0 +1,19 @@
1
+ import { ExportDataTable } from '../../models/export/export-data-table';
2
+ import { DataTableExportable } from '../../interfaces/table-exportable.interface';
3
+ import { CurrencyPipe, DatePipe } from '@angular/common';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Service to handle array-like data table logic
7
+ */
8
+ export declare class DataTableService {
9
+ private currencyPipe;
10
+ private datePipe;
11
+ constructor(currencyPipe: CurrencyPipe, datePipe: DatePipe);
12
+ initDataTable(exportableModels: DataTableExportable[], headerColumns: string[]): ExportDataTable;
13
+ /**
14
+ * Get data for the exporting table rows
15
+ */
16
+ private getDataTableRows;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<DataTableService, never>;
18
+ static ɵprov: i0.ɵɵInjectableDeclaration<DataTableService>;
19
+ }
@@ -15,10 +15,6 @@ export declare class PropertyService extends RestService<PropertyBase, Property>
15
15
  * Update cache when share invitation accepted
16
16
  */
17
17
  private listenShareInviteAccepted;
18
- /**
19
- * Update cache when user's service subscription is updated
20
- */
21
- private listenServiceSubscriptionUpdated;
22
18
  /**
23
19
  * Update cache when property category changed
24
20
  */
@@ -3,6 +3,7 @@ import { Observable, ReplaySubject } from 'rxjs';
3
3
  import { User } from '../../../models/user/user';
4
4
  import { EventDispatcherService } from '../../event/event-dispatcher.service';
5
5
  import { JwtService } from '../../auth/jwt.service';
6
+ import { SseService } from '../../event/sse.service';
6
7
  import { IEventListener } from '../../../interfaces/event-listener.interface';
7
8
  import * as i0 from "@angular/core";
8
9
  /**
@@ -12,14 +13,17 @@ export declare class UserService implements IEventListener {
12
13
  private http;
13
14
  private jwtService;
14
15
  private eventDispatcherService;
16
+ private sseService;
15
17
  private environment;
16
18
  cache: User;
17
19
  cacheSubject: ReplaySubject<User>;
18
- constructor(http: HttpClient, jwtService: JwtService, eventDispatcherService: EventDispatcherService, environment: any);
20
+ constructor(http: HttpClient, jwtService: JwtService, eventDispatcherService: EventDispatcherService, sseService: SseService, environment: any);
21
+ listenEvents(): void;
22
+ get(): Observable<User>;
19
23
  /**
20
24
  * Get current user
21
25
  */
22
- get(): Observable<User>;
26
+ fetch(): Observable<User>;
23
27
  /**
24
28
  * Register new user
25
29
  */
@@ -56,7 +60,15 @@ export declare class UserService implements IEventListener {
56
60
  * Run forecast update script on backend when user switched financial year
57
61
  */
58
62
  switchFinancialYear(): Observable<object>;
59
- listenEvents(): void;
63
+ /**
64
+ * clear service cache
65
+ */
66
+ resetCache(): void;
67
+ /**
68
+ * Update cache when user's service subscription is updated
69
+ */
70
+ private listenServiceSubscriptionUpdated;
71
+ private listenBasiqConcentUpdated;
60
72
  static ɵfac: i0.ɵɵFactoryDeclaration<UserService, never>;
61
73
  static ɵprov: i0.ɵɵInjectableDeclaration<UserService>;
62
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.16.1",
3
+ "version": "0.16.4",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",
package/public-api.d.ts CHANGED
@@ -310,6 +310,7 @@ export * from './lib/services/http/firm/client-income/client-income-types.servic
310
310
  export * from './lib/services/event/event-dispatcher.service';
311
311
  export * from './lib/services/event/sse.service';
312
312
  export * from './lib/services/http/firm/firm.service';
313
+ export * from './lib/services/data-table/data-table.service';
313
314
  export * from './lib/services/header-title/header-title.service';
314
315
  export * from './lib/services/http/income-source/income-source.service';
315
316
  export * from './lib/services/http/income-source/income-source-forecast/income-source-forecast.service';
@@ -369,6 +370,7 @@ export * from './lib/interfaces/photoable';
369
370
  export * from './lib/interfaces/exportable.interface';
370
371
  export * from './lib/interfaces/receipt.interface';
371
372
  export * from './lib/interfaces/tank.interface';
373
+ export * from './lib/interfaces/table-exportable.interface';
372
374
  export * from './lib/interfaces/updatable.interface';
373
375
  export * from './lib/interfaces/expense.interface';
374
376
  /**