taxtank-core 0.30.3 → 0.30.7

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 (29) hide show
  1. package/esm2020/lib/db-static/chart-accounts/chart-accounts-values.mjs +4 -1
  2. package/esm2020/lib/forms/abstract.form.mjs +6 -1
  3. package/esm2020/lib/forms/sole/sole-invoice.form.mjs +3 -3
  4. package/esm2020/lib/forms/transaction/work/work-expense.form.mjs +9 -2
  5. package/esm2020/lib/forms/transaction/work/work-transaction.form.mjs +1 -2
  6. package/esm2020/lib/models/chart-accounts/chart-accounts.mjs +5 -11
  7. package/esm2020/lib/models/depreciation/depreciation-forecast.mjs +2 -2
  8. package/esm2020/lib/models/endpoint/endpoints.const.mjs +2 -1
  9. package/esm2020/lib/models/property/property.mjs +6 -6
  10. package/esm2020/lib/services/http/income-source/income-source.service.mjs +2 -2
  11. package/esm2020/lib/services/http/rest/rest-old.service.mjs +14 -24
  12. package/esm2020/lib/services/http/rest/rest.service.mjs +16 -16
  13. package/esm2020/lib/services/http/transaction/transaction.service.mjs +11 -12
  14. package/esm2020/lib/services/pdf/js-pdf.mjs +3 -1
  15. package/esm2020/lib/services/pdf/pdf-from-dom-element/pdf-from-dom-element.service.mjs +2 -2
  16. package/esm2020/lib/services/pdf/pdf-from-table/pdf-from-table.service.mjs +1 -1
  17. package/fesm2015/taxtank-core.mjs +60 -61
  18. package/fesm2015/taxtank-core.mjs.map +1 -1
  19. package/fesm2020/taxtank-core.mjs +60 -61
  20. package/fesm2020/taxtank-core.mjs.map +1 -1
  21. package/lib/db-static/chart-accounts/chart-accounts-values.d.ts +3 -0
  22. package/lib/forms/abstract.form.d.ts +5 -1
  23. package/lib/forms/transaction/work/work-expense.form.d.ts +5 -0
  24. package/lib/models/property/property.d.ts +6 -8
  25. package/lib/services/http/rest/rest-old.service.d.ts +6 -14
  26. package/lib/services/http/rest/rest.service.d.ts +3 -3
  27. package/lib/services/http/transaction/transaction.service.d.ts +1 -1
  28. package/lib/services/pdf/pdf-from-table/pdf-from-table.service.d.ts +4 -4
  29. package/package.json +1 -1
@@ -1,3 +1,6 @@
1
1
  import { ChartAccountsValue } from '../../db/Models';
2
2
  import { Collection, CollectionDictionary } from '../../collections';
3
+ /**
4
+ * @TODO vik performance problems, try https://angular.io/guide/dependency-injection-providers?
5
+ */
3
6
  export declare const CHART_ACCOUNTS_VALUES: CollectionDictionary<Collection<ChartAccountsValue>>;
@@ -36,6 +36,10 @@ export declare abstract class AbstractForm<Model> extends UntypedFormGroup {
36
36
  }): this;
37
37
  markAsUnsaved(): void;
38
38
  markAsSaved(): void;
39
- private createModelInstance;
39
+ /**
40
+ * @TODO use excludeExtraneousValues when all models refactored (exposed all needed properties)
41
+ * @param data
42
+ */
43
+ createModelInstance(data?: object): Model;
40
44
  private listenValueChanges;
41
45
  }
@@ -1,6 +1,11 @@
1
1
  import { IEventListener } from '../../../interfaces';
2
+ import { Transaction, TransactionAllocation } from '../../../models';
2
3
  import { WorkTransactionForm } from './work-transaction.form';
4
+ import { AbstractControl } from '@angular/forms';
3
5
  export declare class WorkExpenseForm extends WorkTransactionForm implements IEventListener {
6
+ constructor(transaction: Transaction, registeredForGst: boolean, allocations: TransactionAllocation[], controls?: {
7
+ [key: string]: AbstractControl;
8
+ });
4
9
  listenEvents(): void;
5
10
  watchChartAccountsMetadata(): void;
6
11
  }
@@ -1,19 +1,17 @@
1
1
  import { Property as PropertyBase } from '../../db/Models/property/property';
2
- import { Documentable } from '../../interfaces/documentable.interface';
3
- import { PropertyShare } from '../../db/Models/property/property-share';
2
+ import { Documentable, Photoable } from '../../interfaces';
3
+ import { PropertyShare } from '../../db/Models';
4
4
  import { PropertySubscription } from './property-subscription';
5
- import { Photoable } from '../../interfaces/photoable';
6
- import { Address } from '../address/address';
5
+ import { Address } from '../address';
7
6
  import { PropertyCategory } from './property-category';
8
7
  import { PropertyValuation } from './property-valuation';
9
8
  import { PropertyForecast } from './property-forecast';
10
9
  import { PropertyCategoryMovement } from './property-category-movement';
11
- import { User } from '../user/user';
10
+ import { User } from '../user';
12
11
  import { TaxExemptionEnum } from '../../db/Enums/property/property-sale/tax-exemption.enum';
13
- import { PropertySale } from './property-sale/property-sale';
12
+ import { PropertySale } from './property-sale';
14
13
  import { unitOfTime } from 'moment';
15
- import { TransactionCollection } from '../../collections/transaction/transaction.collection';
16
- import { DepreciationCollection } from '../../collections/depreciation.collection';
14
+ import { TransactionCollection, DepreciationCollection } from '../../collections';
17
15
  /**
18
16
  * propertySale docs - https://taxtank.atlassian.net/wiki/spaces/TAXTANK/pages/4209508353/Property+Sold+button
19
17
  */
@@ -1,8 +1,8 @@
1
1
  import { Observable, ReplaySubject } from 'rxjs';
2
2
  import { HttpClient } from '@angular/common/http';
3
- import { EventDispatcherService } from '../../event/event-dispatcher.service';
4
- import { ToastService } from '../../toast/toast.service';
5
- import { IEventListener } from '../../../interfaces/event-listener.interface';
3
+ import { EventDispatcherService } from '../../event';
4
+ import { ToastService } from '../../toast';
5
+ import { IEventListener } from '../../../interfaces';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Abstract base service that implements common services functionality
@@ -96,19 +96,11 @@ export declare abstract class RestService<BaseModel, Model extends BaseModel> im
96
96
  */
97
97
  protected updateCache(): void;
98
98
  /**
99
+ * @TODO use excludeExtraneousValues when all models refactored (exposed all needed properties)
99
100
  * Create new instance of class
100
- * @param model The class for which you want to create an instance
101
- * @param baseModel base model instance that we will use as constructor options
102
- * @param data additional data
101
+ * @param model instance that we will use as constructor options
103
102
  */
104
- protected createModelInstance(model: new (bm: BaseModel) => Model, baseModel: BaseModel, data?: object): Model;
105
- /**
106
- * @TODO Alex is there any point to pass model param instead of this.modelClass?
107
- * Create new instance of class
108
- * @param baseModel base model instance that we will use as constructor options
109
- * @param data additional data
110
- */
111
- protected createModelInstance2(baseModel: object, data?: object): Model;
103
+ protected createModelInstance(model: BaseModel | object): Model;
112
104
  /**
113
105
  * Method that call all listeners. Empty by default. Should be redefined by child services if required
114
106
  */
@@ -101,11 +101,11 @@ export declare abstract class RestService<BaseModel extends AbstractModel, Model
101
101
  */
102
102
  protected dispatchEvent(method: HttpMethod, items: Model[]): void;
103
103
  /**
104
+ * @TODO use excludeExtraneousValues when all models refactored (exposed all needed properties)
104
105
  * Create new instance of class
105
- * @param model The class whose instance to be created
106
- * @param plain Single object or array from which will be created model instance(s)
106
+ * @param model Single object or array from which will be created model instance(s)
107
107
  */
108
- protected createModelInstance(model: new (bm: BaseModel) => Model, plain: BaseModel): Model;
108
+ protected createModelInstance(model: BaseModel): Model;
109
109
  protected createCollectionInstance(collectionClass: new (items: Model[]) => CollectionModel, items: Model[]): CollectionModel;
110
110
  /**
111
111
  * Check if method is not disabled. Throw exception otherwise.
@@ -72,6 +72,7 @@ export declare class TransactionService extends RestService<TransactionBase, Tra
72
72
  */
73
73
  delete(model: Transaction): Observable<void>;
74
74
  /**
75
+ * @TODO Alex wrong place for this logic, move to model
75
76
  * calculate gross income amount based on transaction amount and taxes (fees)
76
77
  * @param transaction Transaction instance for calculation
77
78
  */
@@ -94,7 +95,6 @@ export declare class TransactionService extends RestService<TransactionBase, Tra
94
95
  private listenPropertyForecastUpdate;
95
96
  private replaceInCache;
96
97
  private listenInvoicesPublish;
97
- protected createModelInstance2(baseModel: object, data?: object): Transaction;
98
98
  static ɵfac: i0.ɵɵFactoryDeclaration<TransactionService, never>;
99
99
  static ɵprov: i0.ɵɵInjectableDeclaration<TransactionService>;
100
100
  }
@@ -1,4 +1,4 @@
1
- import jsPDF from 'jspdf';
1
+ import { JsPdf } from '../js-pdf';
2
2
  import * as i0 from "@angular/core";
3
3
  /**
4
4
  * Service with base functionality to export tables (HTML table, data-table, e.t.c.) as PDF file
@@ -8,9 +8,9 @@ export declare class PdfFromTableService {
8
8
  /**
9
9
  * Set basic options for PDF table
10
10
  */
11
- protected setTableOptions(pdf: jsPDF, tableCaption?: string): object;
12
- protected setDocumentTitle(doc: jsPDF, title?: string): void;
13
- protected setDocumentLogo(doc: jsPDF): void;
11
+ protected setTableOptions(pdf: JsPdf, tableCaption?: string): object;
12
+ protected setDocumentTitle(doc: JsPdf, title?: string): void;
13
+ protected setDocumentLogo(doc: JsPdf): void;
14
14
  static ɵfac: i0.ɵɵFactoryDeclaration<PdfFromTableService, never>;
15
15
  static ɵprov: i0.ɵɵInjectableDeclaration<PdfFromTableService>;
16
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.30.3",
3
+ "version": "0.30.7",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/compiler": "^15.1.5",