taxtank-core 0.33.40 → 0.33.42
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/src/lib/functions/mat-options-functions.mjs +2 -2
- package/esm2022/src/lib/services/http/property/property-messages.enum.mjs +4 -1
- package/esm2022/src/lib/services/http/property/property.service.mjs +12 -2
- package/esm2022/src/lib/services/property/corelogic/corelogic.service.mjs +3 -3
- package/fesm2022/taxtank-core.mjs +191 -180
- package/fesm2022/taxtank-core.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/services/http/property/property-messages.enum.d.ts +4 -1
- package/src/lib/services/http/property/property.service.d.ts +1 -0
- package/src/lib/services/property/corelogic/corelogic.service.d.ts +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
export function compareMatOptions(option, value) {
|
2
|
-
if (!option) {
|
2
|
+
if (!option || !value) {
|
3
3
|
return false;
|
4
4
|
}
|
5
5
|
return option.id === value.id;
|
@@ -10,4 +10,4 @@ export function displayMatOptions(option) {
|
|
10
10
|
}
|
11
11
|
return option['name'];
|
12
12
|
}
|
13
|
-
//# sourceMappingURL=data:application/json;base64,
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWF0LW9wdGlvbnMtZnVuY3Rpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdHQtY29yZS9zcmMvbGliL2Z1bmN0aW9ucy9tYXQtb3B0aW9ucy1mdW5jdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxVQUFVLGlCQUFpQixDQUFDLE1BQVcsRUFBRSxLQUFVO0lBQ3ZELElBQUksQ0FBQyxNQUFNLElBQUksQ0FBQyxLQUFLLEVBQUU7UUFDckIsT0FBTyxLQUFLLENBQUM7S0FDZDtJQUVELE9BQU8sTUFBTSxDQUFDLEVBQUUsS0FBSyxLQUFLLENBQUMsRUFBRSxDQUFDO0FBQ2hDLENBQUM7QUFFRCxNQUFNLFVBQVUsaUJBQWlCLENBQUMsTUFBYztJQUM5QyxJQUFJLENBQUMsTUFBTSxFQUFFO1FBQ1gsT0FBTyxFQUFFLENBQUM7S0FDWDtJQUVELE9BQU8sTUFBTSxDQUFDLE1BQU0sQ0FBQyxDQUFDO0FBQ3hCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZnVuY3Rpb24gY29tcGFyZU1hdE9wdGlvbnMob3B0aW9uOiBhbnksIHZhbHVlOiBhbnkpOiBib29sZWFuIHtcclxuICBpZiAoIW9wdGlvbiB8fCAhdmFsdWUpIHtcclxuICAgIHJldHVybiBmYWxzZTtcclxuICB9XHJcblxyXG4gIHJldHVybiBvcHRpb24uaWQgPT09IHZhbHVlLmlkO1xyXG59XHJcblxyXG5leHBvcnQgZnVuY3Rpb24gZGlzcGxheU1hdE9wdGlvbnMob3B0aW9uOiBvYmplY3QpOiBzdHJpbmcge1xyXG4gIGlmICghb3B0aW9uKSB7XHJcbiAgICByZXR1cm4gJyc7XHJcbiAgfVxyXG5cclxuICByZXR1cm4gb3B0aW9uWyduYW1lJ107XHJcbn1cclxuIl19
|
@@ -2,5 +2,8 @@ export var PropertyMessagesEnum;
|
|
2
2
|
(function (PropertyMessagesEnum) {
|
3
3
|
PropertyMessagesEnum["PHOTO_UPDATED"] = "Property photo updated";
|
4
4
|
PropertyMessagesEnum["PROPERTY_UPDATED"] = "Property updated";
|
5
|
+
PropertyMessagesEnum["DELETE_CONFIRM"] = "Are you sure you want to delete property?";
|
6
|
+
PropertyMessagesEnum["DELETE"] = "Property deleted";
|
7
|
+
PropertyMessagesEnum["DELETE_500"] = "Only properties without transactions can be removed";
|
5
8
|
})(PropertyMessagesEnum || (PropertyMessagesEnum = {}));
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvcGVydHktbWVzc2FnZXMuZW51bS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3R0LWNvcmUvc3JjL2xpYi9zZXJ2aWNlcy9odHRwL3Byb3BlcnR5L3Byb3BlcnR5LW1lc3NhZ2VzLmVudW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFOLElBQVksb0JBTVg7QUFORCxXQUFZLG9CQUFvQjtJQUM5QixnRUFBd0MsQ0FBQTtJQUN4Qyw2REFBcUMsQ0FBQTtJQUNyQyxvRkFBNEQsQ0FBQTtJQUM1RCxtREFBMkIsQ0FBQTtJQUMzQiwwRkFBa0UsQ0FBQTtBQUNwRSxDQUFDLEVBTlcsb0JBQW9CLEtBQXBCLG9CQUFvQixRQU0vQiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBlbnVtIFByb3BlcnR5TWVzc2FnZXNFbnVtIHtcbiAgUEhPVE9fVVBEQVRFRCA9ICdQcm9wZXJ0eSBwaG90byB1cGRhdGVkJyxcbiAgUFJPUEVSVFlfVVBEQVRFRCA9ICdQcm9wZXJ0eSB1cGRhdGVkJyxcbiAgREVMRVRFX0NPTkZJUk0gPSAnQXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSBwcm9wZXJ0eT8nLFxuICBERUxFVEUgPSAnUHJvcGVydHkgZGVsZXRlZCcsXG4gIERFTEVURV81MDAgPSAnT25seSBwcm9wZXJ0aWVzIHdpdGhvdXQgdHJhbnNhY3Rpb25zIGNhbiBiZSByZW1vdmVkJ1xufVxuIl19
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import { Inject, Injectable } from '@angular/core';
|
2
|
-
import {
|
2
|
+
import { throwError } from 'rxjs';
|
3
|
+
import { catchError, map } from 'rxjs/operators';
|
3
4
|
import { plainToClass } from 'class-transformer';
|
4
5
|
import { AppEvent, AppEventTypeEnum, Property, PropertyCategoryMovement, PropertySale, PropertyShare, PropertySubscription, PropertyValuation } from '../../../models';
|
5
6
|
import { RestService } from '../rest';
|
6
7
|
import { PropertyCollection } from '../../../collections';
|
7
8
|
import { UserRolesEnum } from 'taxtank-core/common';
|
9
|
+
import { PropertyMessagesEnum } from './property-messages.enum';
|
8
10
|
import * as i0 from "@angular/core";
|
9
11
|
/**
|
10
12
|
* @Todo Alex remove functionality related to PropertyShare
|
@@ -80,6 +82,14 @@ export class PropertyService extends RestService {
|
|
80
82
|
this.updateCache([deactivatedProperty], 'put');
|
81
83
|
}));
|
82
84
|
}
|
85
|
+
delete(property) {
|
86
|
+
return super.delete(property).pipe(catchError((error) => {
|
87
|
+
if (error.status === 500) {
|
88
|
+
this.toastService.error(PropertyMessagesEnum.DELETE_500);
|
89
|
+
}
|
90
|
+
return throwError(() => error);
|
91
|
+
}));
|
92
|
+
}
|
83
93
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PropertyService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
84
94
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PropertyService, providedIn: 'root' }); }
|
85
95
|
}
|
@@ -92,4 +102,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
92
102
|
type: Inject,
|
93
103
|
args: ['environment']
|
94
104
|
}] }] });
|
95
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvcGVydHkuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3R0LWNvcmUvc3JjL2xpYi9zZXJ2aWNlcy9odHRwL3Byb3BlcnR5L3Byb3BlcnR5LnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJ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AgICAgbWFwKCgpID0+IHtcbiAgICAgICAgICBjb25zdCBkZWFjdGl2YXRlZFByb3BlcnR5OiBQcm9wZXJ0eSA9IHBsYWluVG9DbGFzcyhQcm9wZXJ0eSwgT2JqZWN0LmFzc2lnbih7fSwgcHJvcGVydHksIHsgc3Vic2NyaXB0aW9uczogW10gfSkpO1xuXG4gICAgICAgICAgdGhpcy51cGRhdGVDYWNoZShbZGVhY3RpdmF0ZWRQcm9wZXJ0eV0sICdwdXQnKTtcbiAgICAgICAgfSlcbiAgICAgICk7XG4gIH1cblxuICBkZWxldGUocHJvcGVydHk6IFByb3BlcnR5KTogT2JzZXJ2YWJsZTx2b2lkPiB7XG4gICAgcmV0dXJuIHN1cGVyLmRlbGV0ZShwcm9wZXJ0eSkucGlwZShcbiAgICAgIGNhdGNoRXJyb3IoKGVycm9yOiBIdHRwRXJyb3JSZXNwb25zZSkgPT4ge1xuICAgICAgICBpZiAoZXJyb3Iuc3RhdHVzID09PSA1MDApIHtcbiAgICAgICAgICB0aGlzLnRvYXN0U2VydmljZS5lcnJvcihQcm9wZXJ0eU1lc3NhZ2VzRW51bS5ERUxFVEVfNTAwKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aHJvd0Vycm9yKCgpID0+IGVycm9yKTtcbiAgICAgIH0pLFxuICAgIClcbiAgfVxufVxuIl19
|
@@ -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
|
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.
|
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,
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZWxvZ2ljLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy90dC1jb3JlL3NyYy9saWIvc2VydmljZXMvcHJvcGVydHkvY29yZWxvZ2ljL2NvcmVsb2dpYy5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRW5ELE9BQU8sRUFBYyxhQUFhLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFDakQsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3JDLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUNqRCxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQzs7O0FBS3RELE1BQU0sT0FBTyxnQkFBZ0I7SUFJM0IsWUFDVSxJQUFnQixFQUNPLFdBQWdCO1FBRHZDLFNBQUksR0FBSixJQUFJLENBQVk7UUFDTyxnQkFBVyxHQUFYLFdBQVcsQ0FBSztRQUpqRCx1QkFBa0IsR0FBMEIsSUFBSSxhQUFhLENBQVMsQ0FBQyxDQUF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ttpClient, 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
|
*/
|
@@ -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
|
@@ -13946,6 +13946,9 @@ var PropertyMessagesEnum;
|
|
13946
13946
|
(function (PropertyMessagesEnum) {
|
13947
13947
|
PropertyMessagesEnum["PHOTO_UPDATED"] = "Property photo updated";
|
13948
13948
|
PropertyMessagesEnum["PROPERTY_UPDATED"] = "Property updated";
|
13949
|
+
PropertyMessagesEnum["DELETE_CONFIRM"] = "Are you sure you want to delete property?";
|
13950
|
+
PropertyMessagesEnum["DELETE"] = "Property deleted";
|
13951
|
+
PropertyMessagesEnum["DELETE_500"] = "Only properties without transactions can be removed";
|
13949
13952
|
})(PropertyMessagesEnum || (PropertyMessagesEnum = {}));
|
13950
13953
|
|
13951
13954
|
/**
|
@@ -14022,6 +14025,14 @@ class PropertyService extends RestService$1 {
|
|
14022
14025
|
this.updateCache([deactivatedProperty], 'put');
|
14023
14026
|
}));
|
14024
14027
|
}
|
14028
|
+
delete(property) {
|
14029
|
+
return super.delete(property).pipe(catchError((error) => {
|
14030
|
+
if (error.status === 500) {
|
14031
|
+
this.toastService.error(PropertyMessagesEnum.DELETE_500);
|
14032
|
+
}
|
14033
|
+
return throwError(() => error);
|
14034
|
+
}));
|
14035
|
+
}
|
14025
14036
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PropertyService, deps: [{ token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
14026
14037
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PropertyService, providedIn: 'root' }); }
|
14027
14038
|
}
|
@@ -20454,7 +20465,7 @@ function getDocIcon(file) {
|
|
20454
20465
|
}
|
20455
20466
|
|
20456
20467
|
function compareMatOptions(option, value) {
|
20457
|
-
if (!option) {
|
20468
|
+
if (!option || !value) {
|
20458
20469
|
return false;
|
20459
20470
|
}
|
20460
20471
|
return option.id === value.id;
|