taxtank-core 0.9.1 → 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,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
  */
@@ -8,6 +8,10 @@ export declare class ToastService {
8
8
  toast$: ReplaySubject<Toast>;
9
9
  get(): Observable<Toast>;
10
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;
11
15
  static ɵfac: i0.ɵɵFactoryDeclaration<ToastService, never>;
12
16
  static ɵprov: i0.ɵɵInjectableDeclaration<ToastService>;
13
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",