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.
@@ -11526,6 +11526,10 @@ class ChatService extends RestService$1 {
11526
11526
  this.listenChats();
11527
11527
  this.listenMessages();
11528
11528
  }
11529
+ get(path = this.apiUrl) {
11530
+ // users contact ttAdvisor through intercom support
11531
+ return super.get(path).pipe(map((chats) => chats.filter((chat) => chat.employee.email !== this.environment.ttAdvisor)));
11532
+ }
11529
11533
  /**
11530
11534
  * Listen chats events
11531
11535
  */
@@ -15508,11 +15512,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
15508
15512
  }] });
15509
15513
 
15510
15514
  class UserService extends RestService$1 {
15511
- constructor(http, eventDispatcherService, environment) {
15512
- super(http, eventDispatcherService, environment);
15513
- this.http = http;
15514
- this.eventDispatcherService = eventDispatcherService;
15515
- this.environment = environment;
15515
+ constructor() {
15516
+ super(...arguments);
15516
15517
  this.modelClass = User;
15517
15518
  this.collectionClass = Collection;
15518
15519
  this.endpointUri = 'users';
@@ -15622,17 +15623,14 @@ class UserService extends RestService$1 {
15622
15623
  this.eventDispatcherService.on(AppEventTypeEnum.BASIQ_CONSENT_UPDATED).subscribe(() => this.refreshCache());
15623
15624
  }
15624
15625
  }
15625
- 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 });
15626
+ UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
15626
15627
  UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, providedIn: 'root' });
15627
15628
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: UserService, decorators: [{
15628
15629
  type: Injectable,
15629
15630
  args: [{
15630
15631
  providedIn: 'root'
15631
15632
  }]
15632
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: EventDispatcherService }, { type: undefined, decorators: [{
15633
- type: Inject,
15634
- args: ['environment']
15635
- }] }]; } });
15633
+ }] });
15636
15634
 
15637
15635
  class FinancialYearService {
15638
15636
  constructor(http, environment, mpService) {
@@ -19898,7 +19896,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImpor
19898
19896
  class AppCurrencyPipe extends CurrencyPipe {
19899
19897
  transform(value, currencyCode, display, digitsInfo, locale) {
19900
19898
  // 2 non-zero decimals by default (43.43344 => 43.43, 0.0000114201553151 => $0.000011)
19901
- digitsInfo = digitsInfo ?? '1.0-' + (value.toString().match(/[1-9]/).index || 2);
19899
+ digitsInfo = digitsInfo ?? '1.0-' + (value.toString().match(/[1-9]/)?.index || 2);
19902
19900
  return super.transform(value, currencyCode, display, digitsInfo, locale);
19903
19901
  }
19904
19902
  }
@@ -20439,29 +20437,6 @@ class AbstractForm extends UntypedFormGroup {
20439
20437
  }
20440
20438
  }
20441
20439
 
20442
- /**
20443
- * Validator for address, check if corelogic suggestion selected correctly
20444
- */
20445
- function addressCorelogicValidator() {
20446
- return (form) => {
20447
- // we are interested in corelogic ids only for Australian addresses
20448
- if (!form.isAustraliaSelected()) {
20449
- return null;
20450
- }
20451
- // we need at least corelogic locality id to get growth percent
20452
- const locIdControl = form.get('corelogicLocId');
20453
- const refIdControl = form.get('corelogicRefId');
20454
- if (locIdControl.enabled && locIdControl.hasError('required')) {
20455
- return { address: 'City, state or postal code not specified' };
20456
- }
20457
- // @TODO Artem why?
20458
- // if (refIdControl.enabled && refIdControl.hasError('required')) {
20459
- // return { address: 'Street number not specified' };
20460
- // }
20461
- return null;
20462
- };
20463
- }
20464
-
20465
20440
  /**
20466
20441
  * Address form. Works with corelogic or manual address
20467
20442
  */
@@ -20475,20 +20450,19 @@ class AddressForm extends AbstractForm {
20475
20450
  searchQuery: new UntypedFormControl(address?.address ? address.nameLong : null, Validators.required),
20476
20451
  type: new UntypedFormControl(address?.type || AddressTypeEnum.STREET, Validators.required),
20477
20452
  // corelogic fields (required for Australia and disabled for other countries)
20478
- corelogicLocId: new UntypedFormControl({ value: address?.corelogicLocId, disabled: true }, Validators.required),
20453
+ // @TODO not required temporary, waiting for corelogic support response why it can't find some suburbs (like Hamilton Island)
20454
+ corelogicLocId: new UntypedFormControl({ value: address?.corelogicLocId, disabled: true }),
20479
20455
  corelogicRefId: new UntypedFormControl({ value: address?.corelogicRefId, disabled: true }),
20480
- // @TODO Artem why?
20481
- // corelogicRefId: new UntypedFormControl({value: address?.corelogicRefId, disabled: true}, Validators.required),
20482
20456
  // manual fields (using when address not found in corelogic)
20483
20457
  unitNumber: new UntypedFormControl({ value: address?.unitNumber, disabled: true }),
20484
- address: new UntypedFormControl({ value: address?.address, disabled: true }, Validators.required),
20458
+ address: new UntypedFormControl({ value: address?.address, disabled: true }),
20485
20459
  streetNumber: new UntypedFormControl({ value: address?.streetNumber, disabled: true }, [Validators.required, Validators.pattern(AddressForm.streetNumberPattern)]),
20486
20460
  street: new UntypedFormControl({ value: address?.street, disabled: true }, Validators.required),
20487
20461
  city: new UntypedFormControl({ value: address?.city, disabled: true }, Validators.required),
20488
20462
  state: new UntypedFormControl({ value: address?.state, disabled: true }, Validators.required),
20489
20463
  postcode: new UntypedFormControl({ value: address?.postcode, disabled: true }, Validators.required),
20490
20464
  country: new UntypedFormControl({ value: address?.country || Country.australia, disabled: true }, Validators.required)
20491
- }, address, addressCorelogicValidator());
20465
+ }, address);
20492
20466
  /**
20493
20467
  * Emit event to search address in corelogic when user filled enough data for corelogic
20494
20468
  */
@@ -20517,13 +20491,13 @@ class AddressForm extends AbstractForm {
20517
20491
  */
20518
20492
  onSelectSuggestion(suggestion) {
20519
20493
  // if no suggestion then 'Add manually' option selected
20520
- if (!suggestion) {
20494
+ if (!suggestion && !this.isManual) {
20521
20495
  this.switchToManual();
20522
20496
  return;
20523
20497
  }
20524
20498
  this.patchValue({
20525
- corelogicLocId: suggestion.localityId,
20526
- corelogicRefId: suggestion.propertyId
20499
+ corelogicLocId: suggestion?.localityId ?? null,
20500
+ corelogicRefId: suggestion?.propertyId ?? null
20527
20501
  });
20528
20502
  }
20529
20503
  /**
@@ -20714,7 +20688,7 @@ class DocumentForm extends AbstractForm {
20714
20688
  constructor(document) {
20715
20689
  super({
20716
20690
  folder: new FormControl(document.folder, Validators.required),
20717
- file: new FormControl(document.file)
20691
+ file: new FormControl(document.file, Validators.required),
20718
20692
  }, document);
20719
20693
  }
20720
20694
  }