taxtank-core 0.8.7 → 0.9.2

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.
@@ -1,7 +1,6 @@
1
1
  import { Collection } from './collection';
2
2
  import { Transaction } from '../models/transaction/transaction';
3
3
  import { TransactionAllocationCollection } from './transaction-allocation.collection';
4
- import { TankTypeEnum } from '../db/Enums/tank-type.enum';
5
4
  import { ChartAccountsCategoryEnum } from '../db/Enums/chart-accounts-category.enum';
6
5
  /**
7
6
  * Collection of transactions
@@ -21,11 +20,6 @@ export declare class TransactionCollection extends Collection<Transaction> {
21
20
  * Cash position is equal to Total Amount because income is positive and expense is negative,
22
21
  */
23
22
  get cashPosition(): number;
24
- /**
25
- * Get new collection of transactions filtered by tank type
26
- * @param tankType
27
- */
28
- getByTankType(tankType: TankTypeEnum): TransactionCollection;
29
23
  /**
30
24
  * get date of the last transaction
31
25
  */
@@ -1,6 +1,5 @@
1
1
  import { Property } from './property/property';
2
2
  import { ChartAccounts } from './chart-accounts';
3
- import { TankTypeEnum } from '../Enums/tank-type.enum';
4
3
  export declare class TransactionBase {
5
4
  id?: number;
6
5
  amount?: number;
@@ -10,7 +9,6 @@ export declare class TransactionBase {
10
9
  description?: string;
11
10
  file?: File;
12
11
  claimPercent?: number;
13
- tankType: TankTypeEnum;
14
12
  /**
15
13
  * Check if current tank is Property
16
14
  */
@@ -19,4 +17,8 @@ export declare class TransactionBase {
19
17
  * Check if current tank is Work
20
18
  */
21
19
  isWorkTank(): boolean;
20
+ /**
21
+ * Check if current tank is Sole
22
+ */
23
+ isSoleTank(): boolean;
22
24
  }
@@ -1,4 +1,8 @@
1
1
  import { ChartAccountsCategoryEnum } from '../../db/Enums/chart-accounts-category.enum';
2
+ /**
3
+ * Grouped chart accounts categories for fast work
4
+ * @TODO Alex: Clean up and/or remove some groups
5
+ */
2
6
  export declare const CHART_ACCOUNTS_CATEGORIES: {
3
7
  [key: string]: ChartAccountsCategoryEnum[];
4
8
  };
@@ -48,6 +48,7 @@ export declare class ChartAccounts extends ChartAccountsBase {
48
48
  isIncome(): boolean;
49
49
  isProperty(): boolean;
50
50
  isWorkExpense(): boolean;
51
+ isSoleExpense(): boolean;
51
52
  /**
52
53
  * Check if chart accounts is property expense
53
54
  */
@@ -0,0 +1,6 @@
1
+ export declare enum ToastTypeEnum {
2
+ INFO = 0,
3
+ SUCCESS = 1,
4
+ WARNING = 2,
5
+ ERROR = 3
6
+ }
@@ -0,0 +1,10 @@
1
+ import { ToastTypeEnum } from './toast-type.enum';
2
+ /**
3
+ * Common toast message class
4
+ */
5
+ export declare class Toast {
6
+ type: ToastTypeEnum;
7
+ title: string;
8
+ message: string;
9
+ duration: number;
10
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum MessagesEnum {
2
+ DELETED_MESSAGE = "Transaction deleted",
3
+ UPDATED_MESSAGE = "Transaction updated",
4
+ CREATED_MESSAGE = "Transaction(s) created"
5
+ }
@@ -7,6 +7,7 @@ import { RestService } from '../rest/rest.service';
7
7
  import { Transaction } from '../../../models/transaction/transaction';
8
8
  import { ChartAccounts } from '../../../models/chart-accounts/chart-accounts';
9
9
  import { ChartAccountsTaxLabelsEnum } from '../../../models/chart-accounts/chart-accounts-tax-labels.enum';
10
+ import { ToastService } from '../../toast/toast.service';
10
11
  import * as i0 from "@angular/core";
11
12
  /**
12
13
  * Service for transactions business logic
@@ -15,10 +16,11 @@ export declare class TransactionService extends RestService<TransactionBase, Tra
15
16
  protected http: HttpClient;
16
17
  protected eventDispatcherService: EventDispatcherService;
17
18
  protected environment: any;
19
+ protected toastService: ToastService;
18
20
  url: string;
19
21
  modelClass: typeof Transaction;
20
22
  transactionDeleted: EventEmitter<Transaction>;
21
- constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any);
23
+ constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, environment: any, toastService: ToastService);
22
24
  /**
23
25
  * Listen events from Event Dispatcher services
24
26
  */
@@ -87,6 +89,10 @@ export declare class TransactionService extends RestService<TransactionBase, Tra
87
89
  * Listen to EventDispatcherService event related to Depreciation changing
88
90
  */
89
91
  private listenDepreciationChange;
92
+ /**
93
+ * Listen to EventDispatcherService event related to Property Share changing
94
+ */
95
+ private listenPropertyShareUpdate;
90
96
  static ɵfac: i0.ɵɵFactoryDeclaration<TransactionService, never>;
91
97
  static ɵprov: i0.ɵɵInjectableDeclaration<TransactionService>;
92
98
  }
@@ -0,0 +1,17 @@
1
+ import { Observable, ReplaySubject } from 'rxjs';
2
+ import { Toast } from '../../models/toast/toast';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * popup notifications service (toast, snackbar).
6
+ */
7
+ export declare class ToastService {
8
+ toast$: ReplaySubject<Toast>;
9
+ get(): Observable<Toast>;
10
+ add(toast: Toast): void;
11
+ success(message: string): void;
12
+ warning(message: string): void;
13
+ error(message: string): void;
14
+ info(message: string): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToastService, never>;
16
+ static ɵprov: i0.ɵɵInjectableDeclaration<ToastService>;
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.8.7",
3
+ "version": "0.9.2",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",
package/public-api.d.ts CHANGED
@@ -235,6 +235,8 @@ export * from './lib/models/tax-summary/report-item-details';
235
235
  export * from './lib/models/tax-summary/tax-summary';
236
236
  export * from './lib/models/tax-summary/tax-summary-section';
237
237
  export * from './lib/models/tax-summary/tax-summary-type.enum';
238
+ export * from './lib/models/toast/toast';
239
+ export * from './lib/models/toast/toast-type.enum';
238
240
  export * from './lib/models/transaction/income-amount-type.enum';
239
241
  export * from './lib/models/transaction/transaction';
240
242
  export * from './lib/models/transaction/transaction-allocation';
@@ -308,6 +310,7 @@ export * from './lib/services/http/subscription/subscription.service';
308
310
  export * from './lib/services/http/tax-review/tax-review.service';
309
311
  export * from './lib/services/http/tax-review/tax-review-history/tax-review-history.service';
310
312
  export * from './lib/services/http/tax-summary/tax-summary.service';
313
+ export * from './lib/services/toast/toast.service';
311
314
  export * from './lib/services/http/transaction/transaction.service';
312
315
  export * from './lib/services/http/transaction/transaction-allocation/transaction-allocation.service';
313
316
  export * from './lib/services/transaction/transaction-calculation.service';