taxtank-core 0.32.107 → 0.32.109

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/esm2022/lib/collections/report/property/property-report-item-depreciation.collection.mjs +2 -2
  2. package/esm2022/lib/collections/report/property/property-report-item-transaction.collection.mjs +2 -2
  3. package/esm2022/lib/collections/report/property/property-report-item.collection.mjs +1 -1
  4. package/esm2022/lib/db/Enums/bank/bank-connection-status.enum.mjs +2 -1
  5. package/esm2022/lib/forms/transaction/index.mjs +2 -2
  6. package/esm2022/lib/forms/transaction/transaction-base-filter.form.mjs +35 -0
  7. package/esm2022/lib/models/bank/bank-connection.mjs +4 -1
  8. package/esm2022/lib/models/report/property/property-report-item-transaction.mjs +1 -1
  9. package/esm2022/lib/services/http/bank/bank-connection/bank-connection-messages.enum.mjs +2 -1
  10. package/esm2022/lib/services/http/bank/basiq/basiq.service.mjs +7 -4
  11. package/esm2022/lib/services/http/income-source/income-source.service.mjs +2 -1
  12. package/esm2022/lib/services/http/income-source/sole-forecast/sole-forecast.service.mjs +4 -1
  13. package/esm2022/lib/services/report/property/property-transaction-report.service.mjs +12 -3
  14. package/fesm2022/taxtank-core.mjs +134 -113
  15. package/fesm2022/taxtank-core.mjs.map +1 -1
  16. package/lib/collections/report/property/property-report-item-depreciation.collection.d.ts +2 -2
  17. package/lib/collections/report/property/property-report-item-transaction.collection.d.ts +3 -3
  18. package/lib/collections/report/property/property-report-item.collection.d.ts +1 -1
  19. package/lib/db/Enums/bank/bank-connection-status.enum.d.ts +1 -0
  20. package/lib/forms/transaction/index.d.ts +1 -1
  21. package/lib/forms/transaction/transaction-base-filter.form.d.ts +19 -0
  22. package/lib/models/bank/bank-connection.d.ts +1 -0
  23. package/lib/models/report/property/property-report-item-transaction.d.ts +3 -3
  24. package/lib/services/http/bank/bank-connection/bank-connection-messages.enum.d.ts +1 -0
  25. package/lib/services/http/bank/basiq/basiq.service.d.ts +1 -2
  26. package/lib/services/report/property/property-transaction-report.service.d.ts +4 -3
  27. package/package.json +1 -1
  28. package/esm2022/lib/forms/transaction/transaction-filter.form.mjs +0 -35
  29. package/lib/forms/transaction/transaction-filter.form.d.ts +0 -18
@@ -1,8 +1,8 @@
1
1
  import { Collection } from '../../collection';
2
- import { ChartAccounts } from '../../../models/chart-accounts/chart-accounts';
2
+ import { ChartAccounts } from '../../../models';
3
3
  import { DepreciationCollection } from '../../depreciation.collection';
4
4
  import { PropertyReportItemCollection } from './property-report-item.collection';
5
- import { PropertyCollection } from '../../property/property.collection';
5
+ import { PropertyCollection } from '../../property';
6
6
  /**
7
7
  * Collection to work with depreciation-based property report items
8
8
  */
@@ -1,8 +1,8 @@
1
1
  import { Collection } from '../../collection';
2
- import { TransactionCollection } from '../../transaction/transaction.collection';
3
- import { ChartAccounts } from '../../../models/chart-accounts/chart-accounts';
2
+ import { TransactionCollection } from '../../transaction';
3
+ import { ChartAccounts } from '../../../models';
4
4
  import { PropertyReportItemCollection } from './property-report-item.collection';
5
- import { PropertyCollection } from '../../property/property.collection';
5
+ import { PropertyCollection } from '../../property';
6
6
  /**
7
7
  * Collection to work with transaction-based property report items
8
8
  */
@@ -1,5 +1,5 @@
1
1
  import { Collection } from '../../collection';
2
- import { PropertyReportItem } from '../../../models/report/property/property-report-item';
2
+ import { PropertyReportItem } from '../../../models/report';
3
3
  /**
4
4
  * Base collection to work with property report items
5
5
  */
@@ -1,5 +1,6 @@
1
1
  export declare enum BankConnectionStatusEnum {
2
2
  PENDING = 1,
3
3
  ACTIVE = 2,
4
+ INVALID = 3,
4
5
  RECONNECTING = 4
5
6
  }
@@ -5,4 +5,4 @@ export * from './sole/sole-income.form';
5
5
  export * from './work/work-income.form';
6
6
  export * from './work/work-expense.form';
7
7
  export * from './holding/holding-income.form';
8
- export * from './transaction-filter.form';
8
+ export * from './transaction-base-filter.form';
@@ -0,0 +1,19 @@
1
+ import { FormControl, FormGroup } from '@angular/forms';
2
+ import { ControlsInterface } from '../abstract.form';
3
+ import { Collection } from '../../collections';
4
+ import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
5
+ import { SoleBusiness } from '../../models';
6
+ import { IEventListener } from '../../interfaces';
7
+ import { TransactionBase } from '../../db/Models';
8
+ interface ITransactionBaseFilterControls extends ControlsInterface {
9
+ tankType: FormControl<TankTypeEnum>;
10
+ business: FormControl<SoleBusiness>;
11
+ dateFrom: FormControl<Date>;
12
+ dateTo: FormControl<Date>;
13
+ }
14
+ export declare class TransactionBaseFilterForm extends FormGroup<ITransactionBaseFilterControls> implements IEventListener {
15
+ constructor(tankType?: TankTypeEnum, business?: SoleBusiness);
16
+ listenEvents(): void;
17
+ filter<ModelClass extends TransactionBase, CollectionClass extends Collection<ModelClass>>(collection: CollectionClass): CollectionClass;
18
+ }
19
+ export {};
@@ -11,6 +11,7 @@ export declare class BankConnection extends BankConnectionBase {
11
11
  lastSuccessImportDate: Date;
12
12
  expiryDate?: Date;
13
13
  isPending(): boolean;
14
+ isInvalid(): boolean;
14
15
  isActive(): boolean;
15
16
  isReconnecting(): boolean;
16
17
  setPending(): void;
@@ -1,7 +1,7 @@
1
1
  import { PropertyReportItem } from './property-report-item';
2
- import { TransactionCollection } from '../../../collections/transaction/transaction.collection';
3
- import { Property } from '../../property/property';
4
- import { ChartAccounts } from '../../chart-accounts/chart-accounts';
2
+ import { TransactionCollection } from '../../../collections';
3
+ import { Property } from '../../property';
4
+ import { ChartAccounts } from '../../chart-accounts';
5
5
  /**
6
6
  * Class with transaction-based property transactions report entities
7
7
  */
@@ -5,6 +5,7 @@ export declare enum BankConnectionMessagesEnum {
5
5
  CONFIRM_DEACTIVATE = "We are unable to deliver daily bank transactions to deactivated banks",
6
6
  DEACTIVATED = "Your live bank feeds are deactivated",
7
7
  RECONNECT = "Disconnected, There has been an issue with your bank connection. Please reconnect to continue receiving bank transactions",
8
+ INVALID = "There has been an issue with your bank connection. Please reconnect to continue receiving bank transactions",
8
9
  UPGRADE = "Upgrade needed from traditional feeds to an Open Banking connection to continue receiving bank transactions",
9
10
  CONFIRM_UPGRADE = "Upgrading to open banking improves stability and data integrity",
10
11
  AUTOMATE = "Upgrade from manual imports to an Open Banking connection to receive daily bank transactions",
@@ -65,9 +65,8 @@ export declare class BasiqService extends RestService<BankAccountBase, BankAccou
65
65
  extendConsent(token: string): void;
66
66
  /**
67
67
  * redirect to basiq extend connection date to prolong it
68
- * @TODO TT-4230 &connectionId=${connection.id}
69
68
  */
70
- extendConnection(token: string, connection: BankConnection): void;
69
+ reauthoriseConnection(token: string, connection: BankConnection): void;
71
70
  /**
72
71
  * Open basiq consent ui to allow user to manage basiq access to his bank data
73
72
  * @param token User's basiq token
@@ -1,7 +1,7 @@
1
1
  import { ChartAccountsService, DepreciationService, PropertyService, TransactionService } from '../../http';
2
2
  import { Observable } from 'rxjs';
3
- import { Property } from '../../../models';
4
- import { ChartAccountsCollection, CollectionDictionary, DepreciationCollection, PropertyReportItemCollection, TransactionCollection } from '../../../collections';
3
+ import { ChartAccountsCollection, CollectionDictionary, DepreciationCollection, PropertyCollection, PropertyReportItemCollection, TransactionCollection } from '../../../collections';
4
+ import { TransactionBaseFilterForm } from '../../../forms';
5
5
  import * as i0 from "@angular/core";
6
6
  /**
7
7
  * Service to handle Property transactions report items data (get income / expense report items, e.t.c.)
@@ -11,7 +11,7 @@ export declare class PropertyTransactionReportService {
11
11
  private transactionService;
12
12
  private depreciationService;
13
13
  private chartAccountsService;
14
- properties: Property[];
14
+ properties: PropertyCollection;
15
15
  transactions: TransactionCollection;
16
16
  depreciations: DepreciationCollection;
17
17
  chartAccounts: ChartAccountsCollection;
@@ -20,6 +20,7 @@ export declare class PropertyTransactionReportService {
20
20
  * Get collection of report items based on transactions & depreciations
21
21
  */
22
22
  get(): Observable<CollectionDictionary<PropertyReportItemCollection>>;
23
+ filter(filterForm: TransactionBaseFilterForm): CollectionDictionary<PropertyReportItemCollection>;
23
24
  private create;
24
25
  /**
25
26
  * Get collection of property transactions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.32.107",
3
+ "version": "0.32.109",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/compiler": "^16.2.12",
@@ -1,35 +0,0 @@
1
- import { FormControl, FormGroup } from '@angular/forms';
2
- import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
3
- export class TransactionFilterForm extends FormGroup {
4
- constructor(tankType, business) {
5
- super({
6
- tankType: new FormControl(tankType),
7
- business: new FormControl({ value: business, disabled: true }),
8
- dateFrom: new FormControl(),
9
- dateTo: new FormControl(),
10
- });
11
- this.listenEvents();
12
- }
13
- listenEvents() {
14
- this.get('tankType').valueChanges.subscribe(tankType => {
15
- tankType === TankTypeEnum.SOLE ? this.get('business').enable() : this.get('business').disable();
16
- });
17
- }
18
- filter(collection) {
19
- const value = this.value;
20
- if (value.dateFrom) {
21
- collection = collection.filter(transaction => transaction.date >= value.dateFrom);
22
- }
23
- if (value.dateTo) {
24
- collection = collection.filter(transaction => transaction.date <= value.dateTo);
25
- }
26
- if (value.tankType) {
27
- collection = collection.filterBy('tankType', value.tankType);
28
- }
29
- if (value.business) {
30
- collection = collection.filterBy('business.id', value.business.id);
31
- }
32
- return collection;
33
- }
34
- }
35
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNhY3Rpb24tZmlsdGVyLmZvcm0uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvZm9ybXMvdHJhbnNhY3Rpb24vdHJhbnNhY3Rpb24tZmlsdGVyLmZvcm0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxTQUFTLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUd4RCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1B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pO1xuICB9XG5cbiAgZmlsdGVyKGNvbGxlY3Rpb246IFRyYW5zYWN0aW9uQ29sbGVjdGlvbik6IFRyYW5zYWN0aW9uQ29sbGVjdGlvbiB7XG4gICAgY29uc3QgdmFsdWUgPSB0aGlzLnZhbHVlO1xuXG4gICAgaWYgKHZhbHVlLmRhdGVGcm9tKSB7XG4gICAgICBjb2xsZWN0aW9uID0gY29sbGVjdGlvbi5maWx0ZXIodHJhbnNhY3Rpb24gPT4gdHJhbnNhY3Rpb24uZGF0ZSA+PSB2YWx1ZS5kYXRlRnJvbSk7XG4gICAgfVxuICAgIGlmICh2YWx1ZS5kYXRlVG8pIHtcbiAgICAgIGNvbGxlY3Rpb24gPSBjb2xsZWN0aW9uLmZpbHRlcih0cmFuc2FjdGlvbiA9PiB0cmFuc2FjdGlvbi5kYXRlIDw9IHZhbHVlLmRhdGVUbyk7XG4gICAgfVxuICAgIGlmICh2YWx1ZS50YW5rVHlwZSkge1xuICAgICAgY29sbGVjdGlvbiA9IGNvbGxlY3Rpb24uZmlsdGVyQnkoJ3RhbmtUeXBlJywgdmFsdWUudGFua1R5cGUpO1xuICAgIH1cbiAgICBpZiAodmFsdWUuYnVzaW5lc3MpIHtcbiAgICAgIGNvbGxlY3Rpb24gPSBjb2xsZWN0aW9uLmZpbHRlckJ5KCdidXNpbmVzcy5pZCcsIHZhbHVlLmJ1c2luZXNzLmlkKTtcbiAgICB9XG5cbiAgICByZXR1cm4gY29sbGVjdGlvbjtcbiAgfVxufVxuIl19
@@ -1,18 +0,0 @@
1
- import { FormControl, FormGroup } from '@angular/forms';
2
- import { ControlsInterface } from '../abstract.form';
3
- import { TransactionCollection } from '../../collections';
4
- import { TankTypeEnum } from '../../db/Enums/tank-type.enum';
5
- import { SoleBusiness } from '../../models';
6
- import { IEventListener } from '../../interfaces';
7
- interface ITransactionFilterControls extends ControlsInterface {
8
- tankType: FormControl<TankTypeEnum>;
9
- business: FormControl<SoleBusiness>;
10
- dateFrom: FormControl<Date>;
11
- dateTo: FormControl<Date>;
12
- }
13
- export declare class TransactionFilterForm extends FormGroup<ITransactionFilterControls> implements IEventListener {
14
- constructor(tankType: TankTypeEnum, business?: SoleBusiness);
15
- listenEvents(): void;
16
- filter(collection: TransactionCollection): TransactionCollection;
17
- }
18
- export {};