taxtank-core 0.31.48 → 0.31.50

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.
@@ -11598,6 +11598,10 @@ class ChatService extends RestService$1 {
11598
11598
  this.listenChats();
11599
11599
  this.listenMessages();
11600
11600
  }
11601
+ get(path = this.apiUrl) {
11602
+ // users contact ttAdvisor through intercom support
11603
+ return super.get(path).pipe(map((chats) => chats.filter((chat) => chat.employee.email !== this.environment.ttAdvisor)));
11604
+ }
11601
11605
  /**
11602
11606
  * Listen chats events
11603
11607
  */
@@ -15628,11 +15632,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
15628
15632
  }] });
15629
15633
 
15630
15634
  class UserService extends RestService$1 {
15631
- constructor(http, eventDispatcherService, environment) {
15632
- super(http, eventDispatcherService, environment);
15633
- this.http = http;
15634
- this.eventDispatcherService = eventDispatcherService;
15635
- this.environment = environment;
15635
+ constructor() {
15636
+ super(...arguments);
15636
15637
  this.modelClass = User;
15637
15638
  this.collectionClass = Collection;
15638
15639
  this.endpointUri = 'users';
@@ -15742,19 +15743,14 @@ class UserService extends RestService$1 {
15742
15743
  this.eventDispatcherService.on(AppEventTypeEnum.BASIQ_CONSENT_UPDATED).subscribe(() => this.refreshCache());
15743
15744
  }
15744
15745
  }
15745
- UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, deps: [{ token: i1.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }], target: i0.ɵɵFactoryTarget.Injectable });
15746
+ UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
15746
15747
  UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, providedIn: 'root' });
15747
15748
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, decorators: [{
15748
15749
  type: Injectable,
15749
15750
  args: [{
15750
15751
  providedIn: 'root'
15751
15752
  }]
15752
- }], ctorParameters: function () {
15753
- return [{ type: i1.HttpClient }, { type: EventDispatcherService }, { type: undefined, decorators: [{
15754
- type: Inject,
15755
- args: ['environment']
15756
- }] }];
15757
- } });
15753
+ }] });
15758
15754
 
15759
15755
  class FinancialYearService {
15760
15756
  constructor(http, environment, mpService) {
@@ -20027,8 +20023,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
20027
20023
  */
20028
20024
  class AppCurrencyPipe extends CurrencyPipe {
20029
20025
  transform(value, currencyCode, display, digitsInfo, locale) {
20026
+ var _a;
20030
20027
  // 2 non-zero decimals by default (43.43344 => 43.43, 0.0000114201553151 => $0.000011)
20031
- digitsInfo = digitsInfo !== null && digitsInfo !== void 0 ? digitsInfo : '1.0-' + (value.toString().match(/[1-9]/).index || 2);
20028
+ digitsInfo = digitsInfo !== null && digitsInfo !== void 0 ? digitsInfo : '1.0-' + (((_a = value.toString().match(/[1-9]/)) === null || _a === void 0 ? void 0 : _a.index) || 2);
20032
20029
  return super.transform(value, currencyCode, display, digitsInfo, locale);
20033
20030
  }
20034
20031
  }
@@ -20565,29 +20562,6 @@ class AbstractForm extends UntypedFormGroup {
20565
20562
  }
20566
20563
  }
20567
20564
 
20568
- /**
20569
- * Validator for address, check if corelogic suggestion selected correctly
20570
- */
20571
- function addressCorelogicValidator() {
20572
- return (form) => {
20573
- // we are interested in corelogic ids only for Australian addresses
20574
- if (!form.isAustraliaSelected()) {
20575
- return null;
20576
- }
20577
- // we need at least corelogic locality id to get growth percent
20578
- const locIdControl = form.get('corelogicLocId');
20579
- const refIdControl = form.get('corelogicRefId');
20580
- if (locIdControl.enabled && locIdControl.hasError('required')) {
20581
- return { address: 'City, state or postal code not specified' };
20582
- }
20583
- // @TODO Artem why?
20584
- // if (refIdControl.enabled && refIdControl.hasError('required')) {
20585
- // return { address: 'Street number not specified' };
20586
- // }
20587
- return null;
20588
- };
20589
- }
20590
-
20591
20565
  /**
20592
20566
  * Address form. Works with corelogic or manual address
20593
20567
  */
@@ -20601,20 +20575,19 @@ class AddressForm extends AbstractForm {
20601
20575
  searchQuery: new UntypedFormControl((address === null || address === void 0 ? void 0 : address.address) ? address.nameLong : null, Validators.required),
20602
20576
  type: new UntypedFormControl((address === null || address === void 0 ? void 0 : address.type) || AddressTypeEnum.STREET, Validators.required),
20603
20577
  // corelogic fields (required for Australia and disabled for other countries)
20604
- corelogicLocId: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.corelogicLocId, disabled: true }, Validators.required),
20578
+ // @TODO not required temporary, waiting for corelogic support response why it can't find some suburbs (like Hamilton Island)
20579
+ corelogicLocId: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.corelogicLocId, disabled: true }),
20605
20580
  corelogicRefId: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.corelogicRefId, disabled: true }),
20606
- // @TODO Artem why?
20607
- // corelogicRefId: new UntypedFormControl({value: address?.corelogicRefId, disabled: true}, Validators.required),
20608
20581
  // manual fields (using when address not found in corelogic)
20609
20582
  unitNumber: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.unitNumber, disabled: true }),
20610
- address: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.address, disabled: true }, Validators.required),
20583
+ address: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.address, disabled: true }),
20611
20584
  streetNumber: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.streetNumber, disabled: true }, [Validators.required, Validators.pattern(AddressForm.streetNumberPattern)]),
20612
20585
  street: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.street, disabled: true }, Validators.required),
20613
20586
  city: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.city, disabled: true }, Validators.required),
20614
20587
  state: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.state, disabled: true }, Validators.required),
20615
20588
  postcode: new UntypedFormControl({ value: address === null || address === void 0 ? void 0 : address.postcode, disabled: true }, Validators.required),
20616
20589
  country: new UntypedFormControl({ value: (address === null || address === void 0 ? void 0 : address.country) || Country.australia, disabled: true }, Validators.required)
20617
- }, address, addressCorelogicValidator());
20590
+ }, address);
20618
20591
  /**
20619
20592
  * Emit event to search address in corelogic when user filled enough data for corelogic
20620
20593
  */
@@ -20642,14 +20615,15 @@ class AddressForm extends AbstractForm {
20642
20615
  * Handle corelogic suggestion select
20643
20616
  */
20644
20617
  onSelectSuggestion(suggestion) {
20618
+ var _a, _b;
20645
20619
  // if no suggestion then 'Add manually' option selected
20646
- if (!suggestion) {
20620
+ if (!suggestion && !this.isManual) {
20647
20621
  this.switchToManual();
20648
20622
  return;
20649
20623
  }
20650
20624
  this.patchValue({
20651
- corelogicLocId: suggestion.localityId,
20652
- corelogicRefId: suggestion.propertyId
20625
+ corelogicLocId: (_a = suggestion === null || suggestion === void 0 ? void 0 : suggestion.localityId) !== null && _a !== void 0 ? _a : null,
20626
+ corelogicRefId: (_b = suggestion === null || suggestion === void 0 ? void 0 : suggestion.propertyId) !== null && _b !== void 0 ? _b : null
20653
20627
  });
20654
20628
  }
20655
20629
  /**
@@ -20842,7 +20816,7 @@ class DocumentForm extends AbstractForm {
20842
20816
  constructor(document) {
20843
20817
  super({
20844
20818
  folder: new FormControl(document.folder, Validators.required),
20845
- file: new FormControl(document.file)
20819
+ file: new FormControl(document.file, Validators.required),
20846
20820
  }, document);
20847
20821
  }
20848
20822
  }