taxtank-core 0.33.41 → 0.33.43

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,7 +23,7 @@ export class SoleInvoiceCollection extends Collection {
23
23
  const unpaidInvoices = this.getUnpaid(transactions);
24
24
  invoicesByState.add(SoleInvoiceStateEnum.FULLY_PAID, this.getPaid(transactions));
25
25
  invoicesByState.add(SoleInvoiceStateEnum.PAID, this.filterBy('id', transactions.filterByFinancialYear('date').map(transaction => transaction.invoiceId)));
26
- invoicesByState.add(SoleInvoiceStatusesEnum.OPEN, invoicesByState.get(SoleInvoiceStatusesEnum.OPEN).remove(invoicesByState.get(SoleInvoiceStateEnum.PAID).toArray()));
26
+ invoicesByState.add(SoleInvoiceStatusesEnum.OPEN, invoicesByState.get(SoleInvoiceStatusesEnum.OPEN).remove(invoicesByState.get(SoleInvoiceStateEnum.FULLY_PAID).toArray()));
27
27
  invoicesByState.add(SoleInvoiceStateEnum.OVERDUE, unpaidInvoices.getOverdue());
28
28
  return invoicesByState;
29
29
  }
@@ -34,4 +34,4 @@ export class SoleInvoiceCollection extends Collection {
34
34
  return flatten(this.map(invoice => invoice.allocate(bankTransaction, amount)));
35
35
  }
36
36
  }
37
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic29sZS1pbnZvaWNlLmNvbGxlY3Rpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvY29sbGVjdGlvbnMvc29sZS9zb2xlLWludm9pY2UuY29sbGVjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTNDLE9BQU8sT0FBTyxNQUFNLGdCQUFnQixDQUFDO0FBRXJDLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSx1QkFBdUIsRUFBRSxNQUFNLGdCQUFnQ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ZS5hZGQoXG4gICAgICBTb2xlSW52b2ljZVN0YXR1c2VzRW51bS5PUEVOLFxuICAgICAgaW52b2ljZXNCeVN0YXRlLmdldChTb2xlSW52b2ljZVN0YXR1c2VzRW51bS5PUEVOKS5yZW1vdmUoaW52b2ljZXNCeVN0YXRlLmdldChTb2xlSW52b2ljZVN0YXRlRW51bS5GVUxMWV9QQUlEKS50b0FycmF5KCkpXG4gICAgKTtcbiAgICBpbnZvaWNlc0J5U3RhdGUuYWRkKFNvbGVJbnZvaWNlU3RhdGVFbnVtLk9WRVJEVUUsIHVucGFpZEludm9pY2VzLmdldE92ZXJkdWUoKSk7XG5cbiAgICByZXR1cm4gaW52b2ljZXNCeVN0YXRlXG4gIH1cblxuICBnZXRVbnBhaWRBbW91bnQodHJhbnNhY3Rpb25zOiBUcmFuc2FjdGlvbkNvbGxlY3Rpb24pOiBudW1iZXIge1xuICAgIHJldHVybiB0aGlzLnN1bUJ5KCdncm9zc1ByaWNlJykgLSB0cmFuc2FjdGlvbnMuZ2V0QnlJbnZvaWNlcyh0aGlzKS5zdW1CeSgnZ3Jvc3NBbW91bnQnKTtcbiAgfVxuXG4gIGFsbG9jYXRlKGJhbmtUcmFuc2FjdGlvbjogQmFua1RyYW5zYWN0aW9uLCBhbW91bnQ/OiBudW1iZXIpOiBUcmFuc2FjdGlvbltdIHtcbiAgICByZXR1cm4gZmxhdHRlbih0aGlzLm1hcChpbnZvaWNlID0+IGludm9pY2UuYWxsb2NhdGUoYmFua1RyYW5zYWN0aW9uLCBhbW91bnQpKSk7XG4gIH1cbn1cbiJdfQ==
@@ -12,7 +12,6 @@ export class TransactionForm extends TransactionBaseForm {
12
12
  source: new UntypedFormControl(transaction.source || TransactionSourceEnum.BANK_TRANSACTION, Validators.required)
13
13
  }));
14
14
  this.get('date').addValidators([currentFinYearValidator()]);
15
- console.log(transaction);
16
15
  // convert child transactions to controls
17
16
  transaction.transactions.map((transaction) => {
18
17
  this.addTransactionControl(transaction);
@@ -60,4 +59,4 @@ export class TransactionForm extends TransactionBaseForm {
60
59
  return super.submit(Object.assign(data, { transactions: this.buildTransactions(this.currentValue) }), true);
61
60
  }
62
61
  }
63
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNhY3Rpb24uZm9ybS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3R0LWNvcmUvc3JjL2xpYi9mb3Jtcy90cmFuc2FjdGlvbi90cmFuc2FjdGlvbi5mb3JtLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQXlCLE1BQU0sY0FBYyxDQUFDO0FBQ2xFLE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzlELE9BQU8sRUFBRSxxQkFBcUIsRUFBRSx1QkFBdUIsRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQ3BHLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQW1CLGdCQUFnQixFQUFFLGtCQUFrQixFQUFFLGdCQUFnQixFQUFFLFVBQVUsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3JILE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUNqRCxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSx3Q0FBd0MsQ0FBQztBQUUvRSxNQUFNLE9BQU8sZUFBZ0IsU0FBUSxtQkFBZ0M7SUFDbkUsWUFBWSxXQUF3QixFQUFFLGdCQUF5QixFQUFFLFdBQW9DLEVBQUUsV0FFbkcsRUFBRTtRQUNKLEtBQUssQ0FBQyxXQUFXLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxDQUFDLE1BQU0sQ0FBQ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NoYXJ0QWNjb3VudHM/LnRheGFibGVQZXJjZW50KSAvIDEwMCxcbiAgICAgICAgc291cmNlOiBUcmFuc2FjdGlvblNvdXJjZUVudW0uQkFOS19UUkFOU0FDVElPTixcbiAgICAgICAgaW5jb21lU291cmNlOiB0cmFuc2FjdGlvbi5pbmNvbWVTb3VyY2UsXG4gICAgICAgIHByb3BlcnR5OiB0cmFuc2FjdGlvbi5wcm9wZXJ0eVxuICAgICAgfSxcbiAgICAgIHRoaXMubW9kZWwudHJhbnNhY3Rpb25zLmZpbmQoKHRyYW5zYWN0aW9uKSA9PiB0cmFuc2FjdGlvbi5pZCA9PT0gY2hpbGRUcmFuc2FjdGlvblsnaWQnXSkgfHwge30sXG4gICAgICBjaGlsZFRyYW5zYWN0aW9uLFxuICAgICkpO1xuICB9XG5cbiAgc3VibWl0KGRhdGE6IG9iamVjdCA9IHt9KTogVHJhbnNhY3Rpb24ge1xuICAgIHJldHVybiBzdXBlci5zdWJtaXQoT2JqZWN0LmFzc2lnbihkYXRhLCB7IHRyYW5zYWN0aW9uczogdGhpcy5idWlsZFRyYW5zYWN0aW9ucyh0aGlzLmN1cnJlbnRWYWx1ZSkgfSksIHRydWUpO1xuICB9XG59XG4iXX0=
@@ -2,7 +2,7 @@ import { Inject, Injectable } from '@angular/core';
2
2
  import { ReplaySubject } from 'rxjs';
3
3
  import { map } from 'rxjs/operators';
4
4
  import { plainToClass } from 'class-transformer';
5
- import { CorelogicSuggestion } from '../../../models/property/corelogic-suggestion';
5
+ import { CorelogicSuggestion } from '../../../models';
6
6
  import * as i0 from "@angular/core";
7
7
  import * as i1 from "@angular/common/http";
8
8
  export class CorelogicService {
@@ -13,7 +13,7 @@ export class CorelogicService {
13
13
  }
14
14
  getAccessToken(force = false) {
15
15
  if (!this._accessToken || force) {
16
- this.http.get(`${this.environment.coreLogicUrl}/access/oauth/token?grant_type=client_credentials&client_id=${this.environment.coreLogicId}&client_secret=${this.environment.coreLogicSecret}`)
16
+ this.http.get(`${this.environment.apiV2}/corelogic/tokens`)
17
17
  .pipe(map((response) => response.access_token))
18
18
  .subscribe((token) => {
19
19
  this._accessToken = token;
@@ -39,4 +39,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
39
39
  type: Inject,
40
40
  args: ['environment']
41
41
  }] }] });
42
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZWxvZ2ljLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvc2VydmljZXMvcHJvcGVydHkvY29yZWxvZ2ljL2NvcmVsb2dpYy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRW5ELE9BQU8sRUFBYyxhQUFhLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFDakQsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3JDLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUNqRCxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSwrQ0FBK0MsQ0FBQzs7O0FBS3BGLE1BQU0sT0FBTyxnQkFBZ0I7SUFJM0IsWUFDVSxJQUFnQixFQUNPLFdBQWdCO1FBRHZDLFNBQUksR0FBSixJQUFJLENBQVk7UUFDTyxnQkFBVyxHQUFYLFdBQVcsQ0FBSztRQUpqRCx1QkFBa0IsR0FBMEIsSUFBSSxhQUFhLENBQVMsQ0FBQyxDQUFDLENBQUM7SUFNekUsQ0FBQztJQUVELGNBQWMsQ0FBQyxLQUFLLEdBQUcsS0FBSztRQUMxQixJQUFJLENBQUMsSUFBSSxDQ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AgICAgdGhpcy5odHRwLmdldChgJHt0aGlzLmVudmlyb25tZW50LmFwaVYyfS9jb3JlbG9naWMvdG9rZW5zYClcbiAgICAgICAgLnBpcGUobWFwKChyZXNwb25zZTogYW55KSA9PiByZXNwb25zZS5hY2Nlc3NfdG9rZW4pKVxuICAgICAgICAuc3Vic2NyaWJlKCh0b2tlbjogc3RyaW5nKSA9PiB7XG4gICAgICAgICAgdGhpcy5fYWNjZXNzVG9rZW4gPSB0b2tlbjtcbiAgICAgICAgICB0aGlzLmFjY2Vzc1Rva2VuU3ViamVjdC5uZXh0KHRoaXMuX2FjY2Vzc1Rva2VuKTtcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHRoaXMuYWNjZXNzVG9rZW5TdWJqZWN0LmFzT2JzZXJ2YWJsZSgpO1xuICB9XG5cbiAgZ2V0U3VnZ2VzdGlvbnMocXVlcnk6IHN0cmluZywgY291bnRyeSA9ICdhdScpOiBPYnNlcnZhYmxlPENvcmVsb2dpY1N1Z2dlc3Rpb25bXT4ge1xuICAgIC8vIEBUT0RPIGhhbmRsZSBkaWZmZXJlbnQgY291bnRyaWVzIGluIGZ1dHVyZVxuICAgIHJldHVybiB0aGlzLmh0dHAuZ2V0KGAke3RoaXMuZW52aXJvbm1lbnQuY29yZUxvZ2ljVXJsfS9wcm9wZXJ0eS8ke2NvdW50cnl9L3YyL3N1Z2dlc3QuanNvbj9xPSR7cXVlcnl9YClcbiAgICAgIC5waXBlKFxuICAgICAgICBtYXAoKHJlc3BvbnNlOiBhbnkpID0+IHJlc3BvbnNlLnN1Z2dlc3Rpb25zLm1hcCgoaXRlbTogb2JqZWN0KSA9PiBwbGFpblRvQ2xhc3MoQ29yZWxvZ2ljU3VnZ2VzdGlvbiwgaXRlbSkpKVxuICAgICAgKTtcbiAgfVxufVxuIl19
@@ -7,8 +7,8 @@ import { HttpParams, HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http'
7
7
  import { map, mergeMap, filter, first as first$1, catchError, finalize, debounceTime, distinctUntilChanged, startWith } from 'rxjs/operators';
8
8
  import { ReplaySubject, Subject, Observable, throwError, combineLatest, BehaviorSubject, forkJoin, of, from, merge as merge$1 } from 'rxjs';
9
9
  import { plainToClass, Type, Transform, Exclude, Expose, classToPlain } from 'class-transformer';
10
- import get from 'lodash/get';
11
10
  import { __decorate } from 'tslib';
11
+ import get from 'lodash/get';
12
12
  import flatten from 'lodash/flatten';
13
13
  import hasIn from 'lodash/hasIn';
14
14
  import intersection from 'lodash/intersection';
@@ -41,124 +41,6 @@ import * as i1$2 from '@angular/platform-browser';
41
41
  import isEqual from 'lodash/isEqual';
42
42
  import { RxwebValidators } from '@rxweb/reactive-form-validators';
43
43
 
44
- /**
45
- * https://api-uat.corelogic.asia/property/au/v2/suggest.json
46
- * address suggestion from corelogic service
47
- */
48
- class CorelogicSuggestion {
49
- }
50
-
51
- class CorelogicService {
52
- constructor(http, environment) {
53
- this.http = http;
54
- this.environment = environment;
55
- this.accessTokenSubject = new ReplaySubject(1);
56
- }
57
- getAccessToken(force = false) {
58
- if (!this._accessToken || force) {
59
- this.http.get(`${this.environment.coreLogicUrl}/access/oauth/token?grant_type=client_credentials&client_id=${this.environment.coreLogicId}&client_secret=${this.environment.coreLogicSecret}`)
60
- .pipe(map((response) => response.access_token))
61
- .subscribe((token) => {
62
- this._accessToken = token;
63
- this.accessTokenSubject.next(this._accessToken);
64
- });
65
- }
66
- return this.accessTokenSubject.asObservable();
67
- }
68
- getSuggestions(query, country = 'au') {
69
- // @TODO handle different countries in future
70
- return this.http.get(`${this.environment.coreLogicUrl}/property/${country}/v2/suggest.json?q=${query}`)
71
- .pipe(map((response) => response.suggestions.map((item) => plainToClass(CorelogicSuggestion, item))));
72
- }
73
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CorelogicService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
74
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CorelogicService, providedIn: 'root' }); }
75
- }
76
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CorelogicService, decorators: [{
77
- type: Injectable,
78
- args: [{
79
- providedIn: 'root'
80
- }]
81
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
82
- type: Inject,
83
- args: ['environment']
84
- }] }] });
85
-
86
- /**
87
- * Corelogic interceptor add Core Logic access token for each search requests related with Core Logic API
88
- */
89
- class CorelogicInterceptor {
90
- constructor(corelogicService, environment) {
91
- this.corelogicService = corelogicService;
92
- this.environment = environment;
93
- }
94
- intercept(request, next) {
95
- // skip non-corelogic requests
96
- if (!request.url.includes(this.environment.coreLogicUrl)) {
97
- return next.handle(request);
98
- }
99
- // don't need token for this endpoint
100
- if (request.url.includes(`${this.environment.coreLogicUrl}/access/oauth/token`)) {
101
- return next.handle(request);
102
- }
103
- return this.corelogicService.getAccessToken()
104
- .pipe(mergeMap((token) => next.handle(this.addToken(request, token))));
105
- }
106
- addToken(request, token) {
107
- return request.clone({
108
- setHeaders: {
109
- Authorization: 'Bearer ' + token
110
- }
111
- });
112
- }
113
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CorelogicInterceptor, deps: [{ token: CorelogicService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
114
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CorelogicInterceptor }); }
115
- }
116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CorelogicInterceptor, decorators: [{
117
- type: Injectable
118
- }], ctorParameters: () => [{ type: CorelogicService }, { type: undefined, decorators: [{
119
- type: Inject,
120
- args: ['environment']
121
- }] }] });
122
-
123
- /**
124
- * Financial Year interceptor add financialYear parameter to requests because a lot of POST and GET requests require this parameter
125
- * @TODO now we can get current fin year from user on backend. So we can remove this interceptor
126
- */
127
- class FinancialYearInterceptor {
128
- constructor(environment) {
129
- this.environment = environment;
130
- }
131
- intercept(request, next) {
132
- // skip third party requests
133
- // @TODO Alex: Also check and ignore requests we don't need financial year
134
- if (!request.url.includes(this.environment.api_uri)) {
135
- return next.handle(request);
136
- }
137
- // Set financial year parameter to requests
138
- let params = new HttpParams({
139
- fromString: request.params.toString()
140
- });
141
- // clone request to add new parameters
142
- let clonedReq = request.clone();
143
- // @TODO query params should be passed using second param of get request and HttpParams object
144
- if (!params.get('financialYear') && !request.urlWithParams.includes('?financialYear') && !request.urlWithParams.includes('&financialYear')) {
145
- params = params.set('financialYear', localStorage.getItem('financialYear'));
146
- clonedReq = request.clone({
147
- params: params
148
- });
149
- }
150
- return next.handle(clonedReq);
151
- }
152
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FinancialYearInterceptor, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
153
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FinancialYearInterceptor }); }
154
- }
155
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FinancialYearInterceptor, decorators: [{
156
- type: Injectable
157
- }], ctorParameters: () => [{ type: undefined, decorators: [{
158
- type: Inject,
159
- args: ['environment']
160
- }] }] });
161
-
162
44
  /**
163
45
  * @TODO move from db folder when refactored base models
164
46
  */
@@ -174,6 +56,9 @@ class AbstractModel {
174
56
  }
175
57
  }
176
58
 
59
+ let Address$1 = class Address extends AbstractModel {
60
+ };
61
+
177
62
  let Country$1 = class Country extends AbstractModel {
178
63
  };
179
64
 
@@ -193,66 +78,6 @@ class Country extends Country$1 {
193
78
  }
194
79
  }
195
80
 
196
- class AddressService {
197
- constructor(http, environment) {
198
- this.http = http;
199
- this.environment = environment;
200
- this.countriesSubject = new ReplaySubject(1);
201
- }
202
- getCountries() {
203
- if (!this._countries) {
204
- this.http.get(`${this.environment.apiV2}/countries`)
205
- .pipe(map((response) => response.map((item) => plainToClass(Country, item))))
206
- .subscribe((countries) => {
207
- this._countries = countries;
208
- this.countriesSubject.next(countries);
209
- });
210
- }
211
- return this.countriesSubject.asObservable();
212
- }
213
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddressService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
214
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddressService, providedIn: 'root' }); }
215
- }
216
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddressService, decorators: [{
217
- type: Injectable,
218
- args: [{
219
- providedIn: 'root'
220
- }]
221
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
222
- type: Inject,
223
- args: ['environment']
224
- }] }] });
225
-
226
- /**
227
- * @TODO TT-3846 upgrade
228
- */
229
- class PdfService {
230
- constructor(http, environment) {
231
- this.http = http;
232
- this.environment = environment;
233
- }
234
- fromHTMLElements(elements, landscape) {
235
- const formData = new FormData();
236
- formData.append('file', new Blob([...Array.from(elements).map(element => element.outerHTML)], { type: 'text/html' }));
237
- formData.append('landscape', landscape ? '1' : '0');
238
- return this.http.post(`${this.environment.apiV2}/pdf/html`, formData, { responseType: 'blob' });
239
- }
240
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PdfService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
241
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PdfService, providedIn: 'root' }); }
242
- }
243
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PdfService, decorators: [{
244
- type: Injectable,
245
- args: [{
246
- providedIn: 'root'
247
- }]
248
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
249
- type: Inject,
250
- args: ['environment']
251
- }] }] });
252
-
253
- let Address$1 = class Address extends AbstractModel {
254
- };
255
-
256
81
  var AddressTypeEnum;
257
82
  (function (AddressTypeEnum) {
258
83
  AddressTypeEnum[AddressTypeEnum["STREET"] = 1] = "STREET";
@@ -6111,6 +5936,13 @@ const CAPITAL_COSTS_ITEMS = [
6111
5936
  }),
6112
5937
  ];
6113
5938
 
5939
+ /**
5940
+ * https://api-uat.corelogic.asia/property/au/v2/suggest.json
5941
+ * address suggestion from corelogic service
5942
+ */
5943
+ class CorelogicSuggestion {
5944
+ }
5945
+
6114
5946
  /**
6115
5947
  * class contains equity information for passed financial year
6116
5948
  */
@@ -8452,7 +8284,7 @@ class SoleInvoiceCollection extends Collection {
8452
8284
  const unpaidInvoices = this.getUnpaid(transactions);
8453
8285
  invoicesByState.add(SoleInvoiceStateEnum.FULLY_PAID, this.getPaid(transactions));
8454
8286
  invoicesByState.add(SoleInvoiceStateEnum.PAID, this.filterBy('id', transactions.filterByFinancialYear('date').map(transaction => transaction.invoiceId)));
8455
- invoicesByState.add(SoleInvoiceStatusesEnum.OPEN, invoicesByState.get(SoleInvoiceStatusesEnum.OPEN).remove(invoicesByState.get(SoleInvoiceStateEnum.PAID).toArray()));
8287
+ invoicesByState.add(SoleInvoiceStatusesEnum.OPEN, invoicesByState.get(SoleInvoiceStatusesEnum.OPEN).remove(invoicesByState.get(SoleInvoiceStateEnum.FULLY_PAID).toArray()));
8456
8288
  invoicesByState.add(SoleInvoiceStateEnum.OVERDUE, unpaidInvoices.getOverdue());
8457
8289
  return invoicesByState;
8458
8290
  }
@@ -10827,6 +10659,174 @@ __decorate([
10827
10659
  Type(() => TaxReturnItem)
10828
10660
  ], TaxReturn.prototype, "taxReturnItems", void 0);
10829
10661
 
10662
+ class CorelogicService {
10663
+ constructor(http, environment) {
10664
+ this.http = http;
10665
+ this.environment = environment;
10666
+ this.accessTokenSubject = new ReplaySubject(1);
10667
+ }
10668
+ getAccessToken(force = false) {
10669
+ if (!this._accessToken || force) {
10670
+ this.http.get(`${this.environment.apiV2}/corelogic/tokens`)
10671
+ .pipe(map((response) => response.access_token))
10672
+ .subscribe((token) => {
10673
+ this._accessToken = token;
10674
+ this.accessTokenSubject.next(this._accessToken);
10675
+ });
10676
+ }
10677
+ return this.accessTokenSubject.asObservable();
10678
+ }
10679
+ getSuggestions(query, country = 'au') {
10680
+ // @TODO handle different countries in future
10681
+ return this.http.get(`${this.environment.coreLogicUrl}/property/${country}/v2/suggest.json?q=${query}`)
10682
+ .pipe(map((response) => response.suggestions.map((item) => plainToClass(CorelogicSuggestion, item))));
10683
+ }
10684
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CorelogicService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
10685
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CorelogicService, providedIn: 'root' }); }
10686
+ }
10687
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CorelogicService, decorators: [{
10688
+ type: Injectable,
10689
+ args: [{
10690
+ providedIn: 'root'
10691
+ }]
10692
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
10693
+ type: Inject,
10694
+ args: ['environment']
10695
+ }] }] });
10696
+
10697
+ /**
10698
+ * Corelogic interceptor add Core Logic access token for each search requests related with Core Logic API
10699
+ */
10700
+ class CorelogicInterceptor {
10701
+ constructor(corelogicService, environment) {
10702
+ this.corelogicService = corelogicService;
10703
+ this.environment = environment;
10704
+ }
10705
+ intercept(request, next) {
10706
+ // skip non-corelogic requests
10707
+ if (!request.url.includes(this.environment.coreLogicUrl)) {
10708
+ return next.handle(request);
10709
+ }
10710
+ // don't need token for this endpoint
10711
+ if (request.url.includes(`${this.environment.coreLogicUrl}/access/oauth/token`)) {
10712
+ return next.handle(request);
10713
+ }
10714
+ return this.corelogicService.getAccessToken()
10715
+ .pipe(mergeMap((token) => next.handle(this.addToken(request, token))));
10716
+ }
10717
+ addToken(request, token) {
10718
+ return request.clone({
10719
+ setHeaders: {
10720
+ Authorization: 'Bearer ' + token
10721
+ }
10722
+ });
10723
+ }
10724
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CorelogicInterceptor, deps: [{ token: CorelogicService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
10725
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CorelogicInterceptor }); }
10726
+ }
10727
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CorelogicInterceptor, decorators: [{
10728
+ type: Injectable
10729
+ }], ctorParameters: () => [{ type: CorelogicService }, { type: undefined, decorators: [{
10730
+ type: Inject,
10731
+ args: ['environment']
10732
+ }] }] });
10733
+
10734
+ /**
10735
+ * Financial Year interceptor add financialYear parameter to requests because a lot of POST and GET requests require this parameter
10736
+ * @TODO now we can get current fin year from user on backend. So we can remove this interceptor
10737
+ */
10738
+ class FinancialYearInterceptor {
10739
+ constructor(environment) {
10740
+ this.environment = environment;
10741
+ }
10742
+ intercept(request, next) {
10743
+ // skip third party requests
10744
+ // @TODO Alex: Also check and ignore requests we don't need financial year
10745
+ if (!request.url.includes(this.environment.api_uri)) {
10746
+ return next.handle(request);
10747
+ }
10748
+ // Set financial year parameter to requests
10749
+ let params = new HttpParams({
10750
+ fromString: request.params.toString()
10751
+ });
10752
+ // clone request to add new parameters
10753
+ let clonedReq = request.clone();
10754
+ // @TODO query params should be passed using second param of get request and HttpParams object
10755
+ if (!params.get('financialYear') && !request.urlWithParams.includes('?financialYear') && !request.urlWithParams.includes('&financialYear')) {
10756
+ params = params.set('financialYear', localStorage.getItem('financialYear'));
10757
+ clonedReq = request.clone({
10758
+ params: params
10759
+ });
10760
+ }
10761
+ return next.handle(clonedReq);
10762
+ }
10763
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FinancialYearInterceptor, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
10764
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FinancialYearInterceptor }); }
10765
+ }
10766
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FinancialYearInterceptor, decorators: [{
10767
+ type: Injectable
10768
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
10769
+ type: Inject,
10770
+ args: ['environment']
10771
+ }] }] });
10772
+
10773
+ class AddressService {
10774
+ constructor(http, environment) {
10775
+ this.http = http;
10776
+ this.environment = environment;
10777
+ this.countriesSubject = new ReplaySubject(1);
10778
+ }
10779
+ getCountries() {
10780
+ if (!this._countries) {
10781
+ this.http.get(`${this.environment.apiV2}/countries`)
10782
+ .pipe(map((response) => response.map((item) => plainToClass(Country, item))))
10783
+ .subscribe((countries) => {
10784
+ this._countries = countries;
10785
+ this.countriesSubject.next(countries);
10786
+ });
10787
+ }
10788
+ return this.countriesSubject.asObservable();
10789
+ }
10790
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddressService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
10791
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddressService, providedIn: 'root' }); }
10792
+ }
10793
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddressService, decorators: [{
10794
+ type: Injectable,
10795
+ args: [{
10796
+ providedIn: 'root'
10797
+ }]
10798
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
10799
+ type: Inject,
10800
+ args: ['environment']
10801
+ }] }] });
10802
+
10803
+ /**
10804
+ * @TODO TT-3846 upgrade
10805
+ */
10806
+ class PdfService {
10807
+ constructor(http, environment) {
10808
+ this.http = http;
10809
+ this.environment = environment;
10810
+ }
10811
+ fromHTMLElements(elements, landscape) {
10812
+ const formData = new FormData();
10813
+ formData.append('file', new Blob([...Array.from(elements).map(element => element.outerHTML)], { type: 'text/html' }));
10814
+ formData.append('landscape', landscape ? '1' : '0');
10815
+ return this.http.post(`${this.environment.apiV2}/pdf/html`, formData, { responseType: 'blob' });
10816
+ }
10817
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PdfService, deps: [{ token: i1.HttpClient }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
10818
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PdfService, providedIn: 'root' }); }
10819
+ }
10820
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PdfService, decorators: [{
10821
+ type: Injectable,
10822
+ args: [{
10823
+ providedIn: 'root'
10824
+ }]
10825
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
10826
+ type: Inject,
10827
+ args: ['environment']
10828
+ }] }] });
10829
+
10830
10830
  /**
10831
10831
  * @TODO Alex (TT-1777): replace old logic with the new when all services ready
10832
10832
  * @TODO Alex (TT-1777): rename old logic and keep it for custom events
@@ -23706,7 +23706,6 @@ class TransactionForm extends TransactionBaseForm {
23706
23706
  source: new UntypedFormControl(transaction.source || TransactionSourceEnum.BANK_TRANSACTION, Validators.required)
23707
23707
  }));
23708
23708
  this.get('date').addValidators([currentFinYearValidator()]);
23709
- console.log(transaction);
23710
23709
  // convert child transactions to controls
23711
23710
  transaction.transactions.map((transaction) => {
23712
23711
  this.addTransactionControl(transaction);