taxtank-core 0.7.1 → 0.8.1

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 (59) hide show
  1. package/bundles/taxtank-core.umd.js +196 -159
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/collection.js +13 -4
  4. package/esm2015/lib/collections/property/property.collection.js +2 -5
  5. package/esm2015/lib/db/Enums/property/property-share-access.enum.js +6 -0
  6. package/esm2015/lib/db/Enums/property/property-share-status.enum.js +7 -0
  7. package/esm2015/lib/db/Enums/user-event-type-client-type.enum.js +9 -9
  8. package/esm2015/lib/db/Models/client-details.js +1 -1
  9. package/esm2015/lib/db/Models/property/property-sale/property-sale.js +1 -1
  10. package/esm2015/lib/db/Models/property/property-share.js +3 -0
  11. package/esm2015/lib/db/Models/property/property.js +1 -1
  12. package/esm2015/lib/db/Models/user.js +1 -1
  13. package/esm2015/lib/models/depreciation/depreciation-lvp-rate.enum.js +6 -0
  14. package/esm2015/lib/models/depreciation/depreciation.js +6 -3
  15. package/esm2015/lib/models/endpoint/endpoints.const.js +4 -4
  16. package/esm2015/lib/models/event/app-event-type.enum.js +2 -2
  17. package/esm2015/lib/models/notification/notification.js +3 -3
  18. package/esm2015/lib/models/pdf/pdf-config.js +11 -3
  19. package/esm2015/lib/models/property/property-sale/property-sale.js +1 -1
  20. package/esm2015/lib/models/property/{property-owner.js → property-share.js} +15 -15
  21. package/esm2015/lib/models/property/property.js +9 -8
  22. package/esm2015/lib/models/property/share-filter-options.enum.js +11 -0
  23. package/esm2015/lib/services/bank/bank-account.service.js +2 -2
  24. package/esm2015/lib/services/depreciation/depreciation.service.js +2 -2
  25. package/esm2015/lib/services/pdf/pdf.service.js +26 -6
  26. package/esm2015/lib/services/property/property-share/property-share.service.js +115 -0
  27. package/esm2015/lib/services/property/property.service.js +6 -6
  28. package/esm2015/public-api.js +8 -6
  29. package/fesm2015/taxtank-core.js +167 -130
  30. package/fesm2015/taxtank-core.js.map +1 -1
  31. package/lib/collections/collection.d.ts +6 -1
  32. package/lib/collections/property/property.collection.d.ts +1 -4
  33. package/lib/db/Enums/property/property-share-access.enum.d.ts +4 -0
  34. package/lib/db/Enums/property/{property-owner-status.enum.d.ts → property-share-status.enum.d.ts} +1 -1
  35. package/lib/db/Enums/user-event-type-client-type.enum.d.ts +8 -8
  36. package/lib/db/Models/client-details.d.ts +1 -0
  37. package/lib/db/Models/property/property-sale/property-sale.d.ts +4 -3
  38. package/lib/db/Models/property/{property-owner.d.ts → property-share.d.ts} +6 -6
  39. package/lib/db/Models/property/property.d.ts +2 -2
  40. package/lib/db/Models/user.d.ts +2 -2
  41. package/lib/models/depreciation/depreciation-lvp-rate.enum.d.ts +4 -0
  42. package/lib/models/depreciation/depreciation.d.ts +1 -0
  43. package/lib/models/event/app-event-type.enum.d.ts +1 -1
  44. package/lib/models/property/{property-owner.d.ts → property-share.d.ts} +3 -3
  45. package/lib/models/property/property.d.ts +6 -5
  46. package/lib/models/property/share-filter-options.enum.d.ts +9 -0
  47. package/lib/services/pdf/pdf.service.d.ts +1 -0
  48. package/lib/services/property/property-share/property-share.service.d.ts +44 -0
  49. package/lib/services/property/property.service.d.ts +3 -3
  50. package/package.json +1 -1
  51. package/public-api.d.ts +7 -5
  52. package/esm2015/lib/db/Enums/property/property-owner-access.enum.js +0 -6
  53. package/esm2015/lib/db/Enums/property/property-owner-status.enum.js +0 -7
  54. package/esm2015/lib/db/Models/property/property-owner.js +0 -3
  55. package/esm2015/lib/models/property/ownership-filter-options.enum.js +0 -10
  56. package/esm2015/lib/services/property/property-owner/property-owner.service.js +0 -123
  57. package/lib/db/Enums/property/property-owner-access.enum.d.ts +0 -4
  58. package/lib/models/property/ownership-filter-options.enum.d.ts +0 -8
  59. package/lib/services/property/property-owner/property-owner.service.d.ts +0 -52
@@ -895,9 +895,9 @@
895
895
  PROPERTIES_CATEGORIES_POST: new Endpoint('POST', '\\/properties\\/categories'),
896
896
  PROPERTIES_CATEGORY_MOVEMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/category-movements'),
897
897
  PROPERTIES_CATEGORY_MOVEMENTS_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/category-movements\\/\\d+'),
898
- PROPERTIES_CO_OWNERS_PUT: new Endpoint('PUT', '\\/properties\\/co-owners\\/\\d+'),
899
- PROPERTIES_CO_OWNERS_GET: new Endpoint('GET', '\\/properties\\/co-owners'),
900
- PROPERTIES_CO_OWNERS_POST: new Endpoint('POST', '\\/properties\\/co-owners'),
898
+ PROPERTIES_SHARES_PUT: new Endpoint('PUT', '\\/properties\\/shares\\/\\d+'),
899
+ PROPERTIES_SHARES_GET: new Endpoint('GET', '\\/properties\\/shares'),
900
+ PROPERTIES_SHARES_POST: new Endpoint('POST', '\\/properties\\/shares'),
901
901
  PROPERTIES_DEACTIVATE_PUT: new Endpoint('PUT', '\\/properties\\/\\d+\\/deactivate'),
902
902
  PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_GET: new Endpoint('GET', '\\/properties\\/\\d+\\/depreciation-capital-projects'),
903
903
  PROPERTIES_DEPRECIATION_CAPITAL_PROJECT_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/depreciation-capital-projects'),
@@ -1226,9 +1226,6 @@
1226
1226
  if (items === void 0) { items = []; }
1227
1227
  return new this.constructor(items);
1228
1228
  };
1229
- Collection.prototype.getBy = function (field, value) {
1230
- return this.create(this.items.filter(function (item) { return item[field] === value; }));
1231
- };
1232
1229
  Collection.prototype.groupBy = function (path) {
1233
1230
  if (path === void 0) { path = ''; }
1234
1231
  return new CollectionDictionary(this, path);
@@ -1264,6 +1261,12 @@
1264
1261
  Collection.prototype.getIds = function () {
1265
1262
  return this.items.map(function (item) { return item['id']; });
1266
1263
  };
1264
+ Collection.prototype.getOneBy = function (path, value) {
1265
+ return this.items.find(function (item) { return get__default["default"](item, path) === value; });
1266
+ };
1267
+ Collection.prototype.getBy = function (path, value) {
1268
+ return this.create(this.items.filter(function (item) { return get__default["default"](item, path) === value; }));
1269
+ };
1267
1270
  /**
1268
1271
  * Get single item by id
1269
1272
  */
@@ -1283,6 +1286,12 @@
1283
1286
  Collection.prototype.toArray = function () {
1284
1287
  return __spreadArray([], __read(this.items));
1285
1288
  };
1289
+ /**
1290
+ * Filter items by specific provided callback
1291
+ */
1292
+ Collection.prototype.filter = function (callback) {
1293
+ return new Collection(this.items.filter(callback));
1294
+ };
1286
1295
  Object.defineProperty(Collection.prototype, "first", {
1287
1296
  get: function () {
1288
1297
  return first__default["default"](this.items);
@@ -2348,10 +2357,7 @@
2348
2357
  PropertyCollection.prototype.getActiveProperties = function () {
2349
2358
  return new PropertyCollection(this.items.filter(function (property) { return property.isActive; }));
2350
2359
  };
2351
- /**
2352
- * Get new property collection filtered by owner
2353
- */
2354
- PropertyCollection.prototype.getOwnProperties = function () {
2360
+ PropertyCollection.prototype.getCreatedProperties = function () {
2355
2361
  return new PropertyCollection(this.items.filter(function (property) { return property.isOwn(); }));
2356
2362
  };
2357
2363
  /**
@@ -3285,18 +3291,18 @@
3285
3291
  PropertyDepreciationCalculationEnum[PropertyDepreciationCalculationEnum["DIMINISHING"] = 2] = "DIMINISHING";
3286
3292
  })(exports.PropertyDepreciationCalculationEnum || (exports.PropertyDepreciationCalculationEnum = {}));
3287
3293
 
3288
- exports.PropertyOwnerAccessEnum = void 0;
3289
- (function (PropertyOwnerAccessEnum) {
3290
- PropertyOwnerAccessEnum[PropertyOwnerAccessEnum["VIEW"] = 1] = "VIEW";
3291
- PropertyOwnerAccessEnum[PropertyOwnerAccessEnum["EDIT"] = 2] = "EDIT";
3292
- })(exports.PropertyOwnerAccessEnum || (exports.PropertyOwnerAccessEnum = {}));
3294
+ exports.PropertyShareAccessEnum = void 0;
3295
+ (function (PropertyShareAccessEnum) {
3296
+ PropertyShareAccessEnum[PropertyShareAccessEnum["VIEW"] = 1] = "VIEW";
3297
+ PropertyShareAccessEnum[PropertyShareAccessEnum["EDIT"] = 2] = "EDIT";
3298
+ })(exports.PropertyShareAccessEnum || (exports.PropertyShareAccessEnum = {}));
3293
3299
 
3294
- exports.PropertyOwnerStatusEnum = void 0;
3295
- (function (PropertyOwnerStatusEnum) {
3296
- PropertyOwnerStatusEnum[PropertyOwnerStatusEnum["PENDING"] = 1] = "PENDING";
3297
- PropertyOwnerStatusEnum[PropertyOwnerStatusEnum["APPROVED"] = 2] = "APPROVED";
3298
- PropertyOwnerStatusEnum[PropertyOwnerStatusEnum["REJECTED"] = 3] = "REJECTED";
3299
- })(exports.PropertyOwnerStatusEnum || (exports.PropertyOwnerStatusEnum = {}));
3300
+ exports.PropertyShareStatusEnum = void 0;
3301
+ (function (PropertyShareStatusEnum) {
3302
+ PropertyShareStatusEnum[PropertyShareStatusEnum["PENDING"] = 1] = "PENDING";
3303
+ PropertyShareStatusEnum[PropertyShareStatusEnum["APPROVED"] = 2] = "APPROVED";
3304
+ PropertyShareStatusEnum[PropertyShareStatusEnum["REJECTED"] = 3] = "REJECTED";
3305
+ })(exports.PropertyShareStatusEnum || (exports.PropertyShareStatusEnum = {}));
3300
3306
 
3301
3307
  exports.RegistrationInviteStatusEnum = void 0;
3302
3308
  (function (RegistrationInviteStatusEnum) {
@@ -3519,14 +3525,14 @@
3519
3525
  UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_ACCEPTED"] = 2012] = "FIRM_INVITE_ACCEPTED";
3520
3526
  UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_REJECTED"] = 2013] = "FIRM_INVITE_REJECTED";
3521
3527
  UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["FIRM_INVITE_REGISTERED"] = 2014] = "FIRM_INVITE_REGISTERED";
3522
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_INVITE"] = 2020] = "CO_OWNER_INVITE";
3523
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_INVITE_TO_REGISTER"] = 2021] = "CO_OWNER_INVITE_TO_REGISTER";
3524
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_INVITE_ACCEPTED"] = 2022] = "CO_OWNER_INVITE_ACCEPTED";
3525
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_INVITE_REJECTED"] = 2023] = "CO_OWNER_INVITE_REJECTED";
3526
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_INVITE_REGISTERED"] = 2024] = "CO_OWNER_INVITE_REGISTERED";
3527
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_CHANGE_REQUESTED"] = 2025] = "CO_OWNER_CHANGE_REQUESTED";
3528
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_CHANGE_ACCEPTED"] = 2026] = "CO_OWNER_CHANGE_ACCEPTED";
3529
- UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["CO_OWNER_CHANGE_REJECTED"] = 2027] = "CO_OWNER_CHANGE_REJECTED";
3528
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE"] = 2020] = "PROPERTY_SHARE_INVITE";
3529
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_TO_REGISTER"] = 2021] = "PROPERTY_SHARE_INVITE_TO_REGISTER";
3530
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_ACCEPTED"] = 2022] = "PROPERTY_SHARE_INVITE_ACCEPTED";
3531
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_REJECTED"] = 2023] = "PROPERTY_SHARE_INVITE_REJECTED";
3532
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_INVITE_REGISTERED"] = 2024] = "PROPERTY_SHARE_INVITE_REGISTERED";
3533
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_REQUESTED"] = 2025] = "PROPERTY_SHARE_CHANGE_REQUESTED";
3534
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_ACCEPTED"] = 2026] = "PROPERTY_SHARE_CHANGE_ACCEPTED";
3535
+ UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["PROPERTY_SHARE_CHANGE_REJECTED"] = 2027] = "PROPERTY_SHARE_CHANGE_REJECTED";
3530
3536
  UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_NEW_ACCOUNTS"] = 2030] = "BASIQ_NEW_ACCOUNTS";
3531
3537
  UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_FIRST_IMPORT_COMPLETE"] = 2031] = "BASIQ_FIRST_IMPORT_COMPLETE";
3532
3538
  UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["BASIQ_AUTHORIZATION_FAIL"] = 2032] = "BASIQ_AUTHORIZATION_FAIL";
@@ -3601,6 +3607,18 @@
3601
3607
  VehicleLogbookPurposeEnum[VehicleLogbookPurposeEnum["PERSONAL"] = 2] = "PERSONAL";
3602
3608
  })(exports.VehicleLogbookPurposeEnum || (exports.VehicleLogbookPurposeEnum = {}));
3603
3609
 
3610
+ exports.TaxExemptionEnum = void 0;
3611
+ (function (TaxExemptionEnum) {
3612
+ TaxExemptionEnum[TaxExemptionEnum["ONE_YEAR_RULE"] = 1] = "ONE_YEAR_RULE";
3613
+ // principle place of residence
3614
+ TaxExemptionEnum[TaxExemptionEnum["PPR"] = 2] = "PPR";
3615
+ TaxExemptionEnum[TaxExemptionEnum["SIX_YEARS_RULE"] = 3] = "SIX_YEARS_RULE";
3616
+ TaxExemptionEnum[TaxExemptionEnum["INVESTMENT_TO_PPR"] = 4] = "INVESTMENT_TO_PPR";
3617
+ TaxExemptionEnum[TaxExemptionEnum["PPR_TO_INVESTMENT"] = 5] = "PPR_TO_INVESTMENT";
3618
+ TaxExemptionEnum[TaxExemptionEnum["TRANSFER"] = 6] = "TRANSFER";
3619
+ TaxExemptionEnum[TaxExemptionEnum["OTHER"] = 7] = "OTHER";
3620
+ })(exports.TaxExemptionEnum || (exports.TaxExemptionEnum = {}));
3621
+
3604
3622
  exports.TaxExemptionMetadataEnum = void 0;
3605
3623
  (function (TaxExemptionMetadataEnum) {
3606
3624
  // principle place of residence
@@ -4530,18 +4548,6 @@
4530
4548
  classTransformer.Type(function () { return Date; })
4531
4549
  ], PropertyCategoryMovement.prototype, "toDate", void 0);
4532
4550
 
4533
- var TaxExemptionEnum;
4534
- (function (TaxExemptionEnum) {
4535
- TaxExemptionEnum[TaxExemptionEnum["ONE_YEAR_RULE"] = 1] = "ONE_YEAR_RULE";
4536
- // principle place of residence
4537
- TaxExemptionEnum[TaxExemptionEnum["PPR"] = 2] = "PPR";
4538
- TaxExemptionEnum[TaxExemptionEnum["SIX_YEARS_RULE"] = 3] = "SIX_YEARS_RULE";
4539
- TaxExemptionEnum[TaxExemptionEnum["INVESTMENT_TO_PPR"] = 4] = "INVESTMENT_TO_PPR";
4540
- TaxExemptionEnum[TaxExemptionEnum["PPR_TO_INVESTMENT"] = 5] = "PPR_TO_INVESTMENT";
4541
- TaxExemptionEnum[TaxExemptionEnum["TRANSFER"] = 6] = "TRANSFER";
4542
- TaxExemptionEnum[TaxExemptionEnum["OTHER"] = 7] = "OTHER";
4543
- })(TaxExemptionEnum || (TaxExemptionEnum = {}));
4544
-
4545
4551
  var PropertyCategoryListEnum;
4546
4552
  (function (PropertyCategoryListEnum) {
4547
4553
  PropertyCategoryListEnum[PropertyCategoryListEnum["OWNER_OCCUPIED"] = 3] = "OWNER_OCCUPIED";
@@ -4671,17 +4677,17 @@
4671
4677
  });
4672
4678
  Object.defineProperty(Property.prototype, "myShare", {
4673
4679
  get: function () {
4674
- return this.owners.find(function (owner) { return owner.user.id === +localStorage.getItem('userId'); });
4680
+ return this.shares.find(function (share) { return share.user.id === +localStorage.getItem('userId'); });
4675
4681
  },
4676
4682
  enumerable: false,
4677
4683
  configurable: true
4678
4684
  });
4679
- Object.defineProperty(Property.prototype, "ownershipClaimPercent", {
4685
+ Object.defineProperty(Property.prototype, "shareClaimPercent", {
4680
4686
  /**
4681
- * exact claim percent includes ownership
4687
+ * exact claim including share percent
4682
4688
  */
4683
4689
  get: function () {
4684
- return this.ownershipPercent * this.claimPercent / 100;
4690
+ return this.sharePercent * this.claimPercent / 100;
4685
4691
  },
4686
4692
  enumerable: false,
4687
4693
  configurable: true
@@ -4695,9 +4701,9 @@
4695
4701
  enumerable: false,
4696
4702
  configurable: true
4697
4703
  });
4698
- Object.defineProperty(Property.prototype, "ownershipPercent", {
4704
+ Object.defineProperty(Property.prototype, "sharePercent", {
4699
4705
  get: function () {
4700
- return this.myShare.ownershipPercent;
4706
+ return this.myShare.percent;
4701
4707
  },
4702
4708
  enumerable: false,
4703
4709
  configurable: true
@@ -4723,12 +4729,13 @@
4723
4729
  };
4724
4730
  Object.defineProperty(Property.prototype, "isShared", {
4725
4731
  get: function () {
4726
- return this.owners.length > 1;
4732
+ return this.shares.length > 1;
4727
4733
  },
4728
4734
  enumerable: false,
4729
4735
  configurable: true
4730
4736
  });
4731
4737
  /**
4738
+ * @TODO consider to move methods related with propertySale to separated class, since used just in one module yet
4732
4739
  * purchase costs - claimed costs, except `ppr to investment` exemption,
4733
4740
  * in that case it's equal to market value, when property became an investment property
4734
4741
  */
@@ -4761,10 +4768,10 @@
4761
4768
  switch (true) {
4762
4769
  // exemption for main residence properties
4763
4770
  case this.category.id === PropertyCategoryListEnum.OWNER_OCCUPIED:
4764
- return TaxExemptionEnum.PPR;
4771
+ return exports.TaxExemptionEnum.PPR;
4765
4772
  // exemption for investment properties owned for at least one year
4766
4773
  case this.getOwnershipDuration(sale, 'years') >= 1:
4767
- return TaxExemptionEnum.ONE_YEAR_RULE;
4774
+ return exports.TaxExemptionEnum.ONE_YEAR_RULE;
4768
4775
  default:
4769
4776
  return null;
4770
4777
  }
@@ -4777,22 +4784,22 @@
4777
4784
  var metadata = new PropertySaleTaxExemptionMetadataCollection(sale.taxExemptionMetadata);
4778
4785
  switch ((_a = sale.taxExemption) === null || _a === void 0 ? void 0 : _a.id) {
4779
4786
  // 50% exemption for investments owned for at least one year
4780
- case TaxExemptionEnum.ONE_YEAR_RULE:
4787
+ case exports.TaxExemptionEnum.ONE_YEAR_RULE:
4781
4788
  return 0.5;
4782
4789
  // investment property become main residence (exemption for main residence ownership duration)
4783
- case TaxExemptionEnum.INVESTMENT_TO_PPR:
4790
+ case exports.TaxExemptionEnum.INVESTMENT_TO_PPR:
4784
4791
  var ownershipDays = this.getOwnershipDuration(sale);
4785
4792
  return (ownershipDays - metadata.getPPRDays()) / ownershipDays;
4786
4793
  // main residence become investment (exemption for home office percent usage)
4787
- case TaxExemptionEnum.PPR_TO_INVESTMENT:
4794
+ case exports.TaxExemptionEnum.PPR_TO_INVESTMENT:
4788
4795
  // 1 year CGT discount can still apply (on the income producing % if used for 12 months or more)
4789
4796
  var ratio = this.getOwnershipDuration(sale, 'years') >= 1 ? 0.5 : 1;
4790
4797
  return metadata.getClaimPercent() / 100 * ratio;
4791
4798
  // full exemption
4792
- case TaxExemptionEnum.PPR:
4793
- case TaxExemptionEnum.SIX_YEARS_RULE:
4794
- case TaxExemptionEnum.TRANSFER:
4795
- case TaxExemptionEnum.OTHER:
4799
+ case exports.TaxExemptionEnum.PPR:
4800
+ case exports.TaxExemptionEnum.SIX_YEARS_RULE:
4801
+ case exports.TaxExemptionEnum.TRANSFER:
4802
+ case exports.TaxExemptionEnum.OTHER:
4796
4803
  return 0;
4797
4804
  // no exemption
4798
4805
  default:
@@ -5600,7 +5607,7 @@
5600
5607
  * @TODO new FinancialYear(this.writeOffDate) === new FinancialYear()
5601
5608
  */
5602
5609
  Depreciation.prototype.isLowValuePool = function () {
5603
- return this.isAsset && !this.isWrittenOff() &&
5610
+ return this.isAsset &&
5604
5611
  this.calculation === exports.DepreciationCalculationEnum.DIMINISHING &&
5605
5612
  this.amount > Depreciation.WRITTEN_OFF_THRESHOLD &&
5606
5613
  this.amount <= Depreciation.LOW_VALUE_POOL_THRESHOLD;
@@ -5694,7 +5701,7 @@
5694
5701
  * Create a new transaction from current depreciation
5695
5702
  */
5696
5703
  Depreciation.prototype.toTransaction = function () {
5697
- return classTransformer.plainToClass(Transaction, this);
5704
+ return classTransformer.plainToClass(Transaction, Object.assign({}, this, { amount: this.getCurrentYearForecastAmount() }));
5698
5705
  };
5699
5706
  return Depreciation;
5700
5707
  }(Depreciation$1));
@@ -5706,6 +5713,9 @@
5706
5713
  __decorate([
5707
5714
  classTransformer.Type(function () { return Date; })
5708
5715
  ], Depreciation.prototype, "date", void 0);
5716
+ __decorate([
5717
+ classTransformer.Type(function () { return Date; })
5718
+ ], Depreciation.prototype, "lowValuePoolDate", void 0);
5709
5719
  __decorate([
5710
5720
  classTransformer.Type(function () { return Date; })
5711
5721
  ], Depreciation.prototype, "writeOffManualDate", void 0);
@@ -6697,6 +6707,12 @@
6697
6707
  return DataTableColumn;
6698
6708
  }());
6699
6709
 
6710
+ exports.DepreciationLvpRateEnum = void 0;
6711
+ (function (DepreciationLvpRateEnum) {
6712
+ DepreciationLvpRateEnum[DepreciationLvpRateEnum["FIRST_YEAR"] = 0.1875] = "FIRST_YEAR";
6713
+ DepreciationLvpRateEnum[DepreciationLvpRateEnum["DEFAULT"] = 0.375] = "DEFAULT";
6714
+ })(exports.DepreciationLvpRateEnum || (exports.DepreciationLvpRateEnum = {}));
6715
+
6700
6716
  exports.DepreciationGroupEnum = void 0;
6701
6717
  (function (DepreciationGroupEnum) {
6702
6718
  DepreciationGroupEnum[DepreciationGroupEnum["BUILDING_IMPROVEMENTS"] = 0] = "BUILDING_IMPROVEMENTS";
@@ -6920,7 +6936,7 @@
6920
6936
  AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 22] = "PROPERTY_MOVEMENT_CREATED";
6921
6937
  AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 23] = "PROPERTY_MOVEMENT_UPDATED";
6922
6938
  AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 24] = "PROPERTY_MOVEMENT_DELETED";
6923
- AppEventTypeEnum[AppEventTypeEnum["PROPERTY_OWNER_UPDATED"] = 25] = "PROPERTY_OWNER_UPDATED";
6939
+ AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SHARE_UPDATED"] = 25] = "PROPERTY_SHARE_UPDATED";
6924
6940
  AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 26] = "PROPERTY_SUBSCRIPTION_ADDED";
6925
6941
  AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 27] = "PROPERTY_SUBSCRIPTION_DELETED";
6926
6942
  AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 28] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
@@ -7210,8 +7226,8 @@
7210
7226
  // return '/client/bank-feeds';
7211
7227
  // case NOTIFICATION_EVENT_TYPES.clientInvite.includes(obj.eventType):
7212
7228
  // return '/client/users/invitations';
7213
- // case NOTIFICATION_EVENT_TYPES.propertyOwner.includes(obj.eventType):
7214
- // return '/client/users/co-owners';
7229
+ // case NOTIFICATION_EVENT_TYPES.propertyShare.includes(obj.eventType):
7230
+ // return '/client/users/shares';
7215
7231
  // case NOTIFICATION_EVENT_TYPES.employeeInviteFromClient.includes(obj.eventType):
7216
7232
  // return '/firm/clients/invites';
7217
7233
  default:
@@ -7301,14 +7317,15 @@
7301
7317
  ];
7302
7318
 
7303
7319
  /**
7320
+ * @TODO used only on dashboard, move from tt-core
7304
7321
  * Enum with properties ownership filter options
7305
7322
  */
7306
- exports.OwnershipFilterOptionsEnum = void 0;
7307
- (function (OwnershipFilterOptionsEnum) {
7308
- OwnershipFilterOptionsEnum[OwnershipFilterOptionsEnum["ALL_PROPERTIES"] = 1] = "ALL_PROPERTIES";
7309
- OwnershipFilterOptionsEnum[OwnershipFilterOptionsEnum["OWN_PROPERTIES"] = 2] = "OWN_PROPERTIES";
7310
- OwnershipFilterOptionsEnum[OwnershipFilterOptionsEnum["SHARED_PROPERTIES"] = 3] = "SHARED_PROPERTIES";
7311
- })(exports.OwnershipFilterOptionsEnum || (exports.OwnershipFilterOptionsEnum = {}));
7323
+ exports.ShareFilterOptionsEnum = void 0;
7324
+ (function (ShareFilterOptionsEnum) {
7325
+ ShareFilterOptionsEnum[ShareFilterOptionsEnum["ALL"] = 1] = "ALL";
7326
+ ShareFilterOptionsEnum[ShareFilterOptionsEnum["CREATED"] = 2] = "CREATED";
7327
+ ShareFilterOptionsEnum[ShareFilterOptionsEnum["SHARED"] = 3] = "SHARED";
7328
+ })(exports.ShareFilterOptionsEnum || (exports.ShareFilterOptionsEnum = {}));
7312
7329
 
7313
7330
  /**
7314
7331
  * class contains equity information for passed financial year
@@ -7500,35 +7517,35 @@
7500
7517
  return PropertyEquityChartData;
7501
7518
  }());
7502
7519
 
7503
- var PropertyOwner$1 = /** @class */ (function () {
7504
- function PropertyOwner() {
7520
+ var PropertyShare$1 = /** @class */ (function () {
7521
+ function PropertyShare() {
7505
7522
  }
7506
- return PropertyOwner;
7523
+ return PropertyShare;
7507
7524
  }());
7508
7525
 
7509
- var PropertyOwner = /** @class */ (function (_super) {
7510
- __extends(PropertyOwner, _super);
7511
- function PropertyOwner() {
7526
+ var PropertyShare = /** @class */ (function (_super) {
7527
+ __extends(PropertyShare, _super);
7528
+ function PropertyShare() {
7512
7529
  return _super !== null && _super.apply(this, arguments) || this;
7513
7530
  }
7514
- PropertyOwner.prototype.isAccepted = function () {
7515
- return this.status === exports.PropertyOwnerStatusEnum.APPROVED;
7531
+ PropertyShare.prototype.isAccepted = function () {
7532
+ return this.status === exports.PropertyShareStatusEnum.APPROVED;
7516
7533
  };
7517
- PropertyOwner.prototype.isPending = function () {
7518
- return this.status === exports.PropertyOwnerStatusEnum.PENDING;
7534
+ PropertyShare.prototype.isPending = function () {
7535
+ return this.status === exports.PropertyShareStatusEnum.PENDING;
7519
7536
  };
7520
- PropertyOwner.prototype.isRejected = function () {
7521
- return this.status === exports.PropertyOwnerStatusEnum.REJECTED;
7537
+ PropertyShare.prototype.isRejected = function () {
7538
+ return this.status === exports.PropertyShareStatusEnum.REJECTED;
7522
7539
  };
7523
- Object.defineProperty(PropertyOwner.prototype, "statusName", {
7540
+ Object.defineProperty(PropertyShare.prototype, "statusName", {
7524
7541
  get: function () {
7525
7542
  var _a;
7526
- return (_a = exports.PropertyOwnerStatusEnum[this.status]) === null || _a === void 0 ? void 0 : _a.toLowerCase();
7543
+ return (_a = exports.PropertyShareStatusEnum[this.status]) === null || _a === void 0 ? void 0 : _a.toLowerCase();
7527
7544
  },
7528
7545
  enumerable: false,
7529
7546
  configurable: true
7530
7547
  });
7531
- Object.defineProperty(PropertyOwner.prototype, "fullName", {
7548
+ Object.defineProperty(PropertyShare.prototype, "userName", {
7532
7549
  /**
7533
7550
  * Return full user name if user is already registered.
7534
7551
  * Otherwise - return first name from invitation
@@ -7539,29 +7556,29 @@
7539
7556
  enumerable: false,
7540
7557
  configurable: true
7541
7558
  });
7542
- return PropertyOwner;
7543
- }(PropertyOwner$1));
7559
+ return PropertyShare;
7560
+ }(PropertyShare$1));
7544
7561
  __decorate([
7545
7562
  classTransformer.Type(function () { return Date; })
7546
- ], PropertyOwner.prototype, "fromDate", void 0);
7563
+ ], PropertyShare.prototype, "fromDate", void 0);
7547
7564
  __decorate([
7548
7565
  classTransformer.Type(function () { return Date; })
7549
- ], PropertyOwner.prototype, "toDate", void 0);
7566
+ ], PropertyShare.prototype, "toDate", void 0);
7550
7567
  __decorate([
7551
7568
  classTransformer.Type(function () { return User; })
7552
- ], PropertyOwner.prototype, "user", void 0);
7569
+ ], PropertyShare.prototype, "user", void 0);
7553
7570
  __decorate([
7554
7571
  classTransformer.Type(function () { return RegistrationInvite; })
7555
- ], PropertyOwner.prototype, "invite", void 0);
7572
+ ], PropertyShare.prototype, "invite", void 0);
7556
7573
  __decorate([
7557
7574
  classTransformer.Type(function () { return Property; })
7558
- ], PropertyOwner.prototype, "property", void 0);
7575
+ ], PropertyShare.prototype, "property", void 0);
7559
7576
  __decorate([
7560
7577
  classTransformer.Transform(function (_b) {
7561
7578
  var obj = _b.obj;
7562
7579
  return obj.user ? obj.user.email : obj.invite.email;
7563
7580
  })
7564
- ], PropertyOwner.prototype, "email", void 0);
7581
+ ], PropertyShare.prototype, "email", void 0);
7565
7582
 
7566
7583
  var PropertySale$1 = /** @class */ (function () {
7567
7584
  function PropertySale() {
@@ -8531,7 +8548,7 @@
8531
8548
  BankAccountService.prototype.listenToEventDispatcherChanges = function () {
8532
8549
  var _this = this;
8533
8550
  this.eventDispatcherService.on([
8534
- exports.AppEventTypeEnum.PROPERTY_OWNER_UPDATED,
8551
+ exports.AppEventTypeEnum.PROPERTY_SHARE_UPDATED,
8535
8552
  exports.AppEventTypeEnum.LOAN_PAYOUT_UPDATED,
8536
8553
  exports.AppEventTypeEnum.BANK_CONNECTION_ADDED
8537
8554
  ]).subscribe(function () {
@@ -9753,7 +9770,7 @@
9753
9770
  */
9754
9771
  DepreciationService.prototype.listenToUpdatedLoan = function () {
9755
9772
  var _this = this;
9756
- this.eventDispatcherService.on([exports.AppEventTypeEnum.LOAN_UPDATED, exports.AppEventTypeEnum.PROPERTY_OWNER_UPDATED]).subscribe(function () {
9773
+ this.eventDispatcherService.on([exports.AppEventTypeEnum.LOAN_UPDATED, exports.AppEventTypeEnum.PROPERTY_SHARE_UPDATED]).subscribe(function () {
9757
9774
  _this.fetch().subscribe();
9758
9775
  });
9759
9776
  };
@@ -10678,8 +10695,16 @@
10678
10695
  fontWeight: 'bold',
10679
10696
  positionX: 14,
10680
10697
  positionY: 10,
10681
- fillColor: 255,
10682
- textColor: 0
10698
+ colorWhite: '#ffffff',
10699
+ colorBlack: '#000000',
10700
+ colorPrimary: '#00b7f0'
10701
+ },
10702
+ logo: {
10703
+ src: '/assets/img/icons/logo.png',
10704
+ width: 30,
10705
+ height: 7,
10706
+ positionX: 168,
10707
+ positionY: 6
10683
10708
  },
10684
10709
  // coords for file section title (group, table, e.t.c.)
10685
10710
  contentTitleCoords: {
@@ -10718,20 +10743,35 @@
10718
10743
  PdfService.prototype.generateFromTables = function (tables, title) {
10719
10744
  var pdf = new jsPDF__default["default"]();
10720
10745
  this.setDocumentTitle(pdf, title);
10746
+ this.setDocumentLogo(pdf);
10721
10747
  tables.forEach(function (table) {
10722
- var _a, _b;
10748
+ var _a;
10749
+ // Add table caption if not provided
10750
+ if (!table.caption) {
10751
+ table.createCaption();
10752
+ table.caption.innerText = '';
10753
+ }
10723
10754
  // coords of last table
10724
10755
  var lastTableCoords = pdf['lastAutoTable'].finalY || PDF_CONFIG.contentCoords.marginTop;
10725
- pdf.text((_a = table.caption) === null || _a === void 0 ? void 0 : _a.innerText, PDF_CONFIG.contentCoords.marginLeft, lastTableCoords + PDF_CONFIG.contentCoords.marginTop);
10756
+ pdf.text(table.caption.innerText, PDF_CONFIG.contentCoords.marginLeft, lastTableCoords + PDF_CONFIG.contentCoords.marginTop);
10726
10757
  // get caption height based on caption content height
10727
- var captionHeight = pdf.getTextDimensions(pdf.splitTextToSize((_b = table.caption) === null || _b === void 0 ? void 0 : _b.innerText, pdf.internal.pageSize.width)).h;
10758
+ var captionHeight = pdf.getTextDimensions(pdf.splitTextToSize((_a = table.caption) === null || _a === void 0 ? void 0 : _a.innerText, pdf.internal.pageSize.width)).h;
10728
10759
  // table options
10729
10760
  var options = {
10730
10761
  html: table,
10731
10762
  startY: lastTableCoords + captionHeight + PDF_CONFIG.contentTitleCoords.marginTop,
10763
+ headStyles: {
10764
+ fillColor: PDF_CONFIG.text.colorPrimary,
10765
+ },
10732
10766
  footStyles: {
10733
- fillColor: PDF_CONFIG.text.fillColor,
10734
- textColor: PDF_CONFIG.text.textColor
10767
+ fillColor: PDF_CONFIG.text.colorWhite,
10768
+ textColor: PDF_CONFIG.text.colorBlack
10769
+ },
10770
+ didParseCell: function (data) {
10771
+ // Align last column content to right
10772
+ if (data.table.columns.length > 1 && (data.column.index === data.table.columns.length - 1)) {
10773
+ data.cell.styles.halign = 'right';
10774
+ }
10735
10775
  }
10736
10776
  };
10737
10777
  autoTable__default["default"](pdf, options);
@@ -10743,6 +10783,11 @@
10743
10783
  .setFont(PDF_CONFIG.text.fontName, PDF_CONFIG.text.fontStyle, PDF_CONFIG.text.fontWeight)
10744
10784
  .text(title, PDF_CONFIG.text.positionX, PDF_CONFIG.text.positionY);
10745
10785
  };
10786
+ PdfService.prototype.setDocumentLogo = function (doc) {
10787
+ var logo = new Image();
10788
+ logo.src = PDF_CONFIG.logo.src;
10789
+ doc.addImage(logo, 'PNG', PDF_CONFIG.logo.positionX, PDF_CONFIG.logo.positionY, PDF_CONFIG.logo.width, PDF_CONFIG.logo.height);
10790
+ };
10746
10791
  /**
10747
10792
  * @Todo remove/refactor when all DataTable dependent methods will be cleared-up
10748
10793
  * Generate PDF file from provided data
@@ -10799,17 +10844,17 @@
10799
10844
  return _this;
10800
10845
  }
10801
10846
  PropertyService.prototype.listenEvents = function () {
10802
- this.listenCoOwnerInviteAccepted();
10847
+ this.listenShareInviteAccepted();
10803
10848
  this.listenServiceSubscriptionUpdated();
10804
10849
  // @TODO Alex: consider to refactor property movements logic similar to client-movements
10805
10850
  this.listenMovementsChanged();
10806
10851
  };
10807
10852
  /**
10808
- * Update cache when owner invitation accepted
10853
+ * Update cache when share invitation accepted
10809
10854
  */
10810
- PropertyService.prototype.listenCoOwnerInviteAccepted = function () {
10855
+ PropertyService.prototype.listenShareInviteAccepted = function () {
10811
10856
  var _this = this;
10812
- this.eventDispatcherService.on(exports.AppEventTypeEnum.PROPERTY_OWNER_UPDATED).subscribe(function () { return _this.resetCache(); });
10857
+ this.eventDispatcherService.on(exports.AppEventTypeEnum.PROPERTY_SHARE_UPDATED).subscribe(function () { return _this.resetCache(); });
10813
10858
  };
10814
10859
  /**
10815
10860
  * Update cache when user's service subscription is updated
@@ -10882,7 +10927,7 @@
10882
10927
  _this.updateCache();
10883
10928
  }));
10884
10929
  };
10885
- PropertyService.prototype.getByCoOwnerId = function (id) {
10930
+ PropertyService.prototype.getByShareId = function (id) {
10886
10931
  return this.get().pipe(operators.map(function (properties) {
10887
10932
  return properties.filter(function (property) { return property.user.id === id; });
10888
10933
  }));
@@ -11130,114 +11175,106 @@
11130
11175
  } });
11131
11176
 
11132
11177
  // @TODO check and improve logic during refactoring
11133
- var PropertyOwnerService = /** @class */ (function (_super) {
11134
- __extends(PropertyOwnerService, _super);
11135
- function PropertyOwnerService(http, eventDispatcherService, environment) {
11178
+ var PropertyShareService = /** @class */ (function (_super) {
11179
+ __extends(PropertyShareService, _super);
11180
+ function PropertyShareService(http, eventDispatcherService, environment) {
11136
11181
  var _this = _super.call(this, http, eventDispatcherService, environment) || this;
11137
11182
  _this.http = http;
11138
11183
  _this.eventDispatcherService = eventDispatcherService;
11139
11184
  _this.environment = environment;
11140
- // api url parameter for properties co-owners
11141
- _this.url = 'properties/co-owners';
11142
- _this.modelClass = PropertyOwner;
11185
+ // api url parameter for properties shares
11186
+ _this.url = 'properties/shares';
11187
+ _this.modelClass = PropertyShare;
11143
11188
  _this.listenEvents();
11144
11189
  return _this;
11145
11190
  }
11146
11191
  /**
11147
11192
  * Listen to Event Dispatcher events
11148
11193
  */
11149
- PropertyOwnerService.prototype.listenEvents = function () {
11194
+ PropertyShareService.prototype.listenEvents = function () {
11150
11195
  this.listenUserUpdated();
11151
11196
  };
11152
11197
  /**
11153
11198
  * Updated loan
11154
11199
  */
11155
- PropertyOwnerService.prototype.update = function (propertyOwner) {
11200
+ PropertyShareService.prototype.update = function (propertyShare) {
11156
11201
  var _this = this;
11157
- return this.http.put(this.environment.apiV2 + "/" + this.url + "/" + propertyOwner.id, propertyOwner)
11158
- .pipe(operators.map(function (updatedPropertyOwnerBase) {
11159
- var updatedPropertyOwner = classTransformer.plainToClass(PropertyOwner, updatedPropertyOwnerBase);
11202
+ return this.http.put(this.environment.apiV2 + "/" + this.url + "/" + propertyShare.id, propertyShare)
11203
+ .pipe(operators.map(function (updatedPropertyShareBase) {
11204
+ var updatedPropertyShare = classTransformer.plainToClass(PropertyShare, updatedPropertyShareBase);
11160
11205
  // if loan type is NOT vehicle - fire EventDispatcher event
11161
- _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.PROPERTY_OWNER_UPDATED, null));
11162
- replace(_this.cache, updatedPropertyOwner);
11206
+ _this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.PROPERTY_SHARE_UPDATED, null));
11207
+ replace(_this.cache, updatedPropertyShare);
11163
11208
  _this.updateCache();
11164
- return updatedPropertyOwner;
11209
+ return updatedPropertyShare;
11165
11210
  }));
11166
11211
  };
11167
11212
  /**
11168
- * Re-invite property owner
11213
+ * Re-invite property share
11169
11214
  * @param share user to share property
11170
11215
  */
11171
- PropertyOwnerService.prototype.reinvite = function (share) {
11216
+ PropertyShareService.prototype.reinvite = function (share) {
11172
11217
  return this.http.post(this.environment.apiV2 + "/" + this.url + "/" + share.id + "/reinvite", {});
11173
11218
  };
11174
- /**
11175
- * Get incoming property owners list
11176
- */
11177
- PropertyOwnerService.prototype.getIncoming = function () {
11219
+ PropertyShareService.prototype.getIncoming = function () {
11178
11220
  return this.get()
11179
- .pipe(operators.map(function (propertyOwners) {
11180
- var propertyOwnersIncoming = [];
11181
- propertyOwners.forEach(function (propertyOwner) {
11221
+ .pipe(operators.map(function (propertyShares) {
11222
+ var propertySharesIncoming = [];
11223
+ propertyShares.forEach(function (propertyShare) {
11182
11224
  var _a;
11183
- if (((_a = propertyOwner.user) === null || _a === void 0 ? void 0 : _a.isLoggedIn()) && propertyOwner.isPending() && propertyOwner.property.user.id !== +localStorage.getItem('userId')) {
11184
- propertyOwnersIncoming.push(propertyOwner);
11225
+ if (((_a = propertyShare.user) === null || _a === void 0 ? void 0 : _a.isLoggedIn()) && propertyShare.isPending() && propertyShare.property.user.id !== +localStorage.getItem('userId')) {
11226
+ propertySharesIncoming.push(propertyShare);
11185
11227
  }
11186
11228
  });
11187
- return propertyOwnersIncoming;
11229
+ return propertySharesIncoming;
11188
11230
  }));
11189
11231
  };
11190
11232
  /**
11191
- * Get outcoming property owners list
11233
+ * Get outcoming property shares list
11192
11234
  */
11193
- PropertyOwnerService.prototype.getOutcoming = function () {
11235
+ PropertyShareService.prototype.getOutcoming = function () {
11194
11236
  var _this = this;
11195
- return this.get().pipe(operators.map(function (propertyOwners) {
11196
- return _this.filterOutcoming(propertyOwners);
11237
+ return this.get().pipe(operators.map(function (propertyShares) {
11238
+ return _this.filterOutcoming(propertyShares);
11197
11239
  }));
11198
11240
  };
11199
11241
  /**
11200
- * Filter outcoming property owners
11201
- * @param propertyOwners which should be filtered
11242
+ * Filter outcoming property shares
11202
11243
  */
11203
- PropertyOwnerService.prototype.filterOutcoming = function (propertyOwners) {
11204
- var propertyOwnersOutcoming = [];
11205
- propertyOwners.forEach(function (propertyOwner) {
11244
+ PropertyShareService.prototype.filterOutcoming = function (propertyShares) {
11245
+ var propertySharesOutcoming = [];
11246
+ propertyShares.forEach(function (propertyShare) {
11206
11247
  var _a;
11207
- if (!((_a = propertyOwner.user) === null || _a === void 0 ? void 0 : _a.isLoggedIn())) {
11208
- propertyOwnersOutcoming.push(propertyOwner);
11248
+ if (!((_a = propertyShare.user) === null || _a === void 0 ? void 0 : _a.isLoggedIn())) {
11249
+ propertySharesOutcoming.push(propertyShare);
11209
11250
  }
11210
11251
  });
11211
- return propertyOwnersOutcoming;
11252
+ return propertySharesOutcoming;
11212
11253
  };
11213
- /**
11214
- * Get list of co-owners filtered by property id
11215
- * @param propertyId
11216
- */
11217
- PropertyOwnerService.prototype.getByPropertyId = function (propertyId) {
11254
+ PropertyShareService.prototype.getByPropertyId = function (propertyId) {
11218
11255
  return this.get()
11219
- .pipe(operators.map(function (propertyOwners) {
11220
- return propertyOwners.filter(function (propertyOwner) { return propertyOwner.property.id === propertyId; });
11256
+ .pipe(operators.map(function (propertyShares) {
11257
+ return propertyShares.filter(function (propertyShare) { return propertyShare.property.id === propertyId; });
11221
11258
  }));
11222
11259
  };
11223
11260
  /**
11224
11261
  * Listen to User updated event
11225
11262
  */
11226
- PropertyOwnerService.prototype.listenUserUpdated = function () {
11263
+ PropertyShareService.prototype.listenUserUpdated = function () {
11227
11264
  var _this = this;
11228
11265
  this.eventDispatcherService.on(exports.AppEventTypeEnum.USER_UPDATED)
11229
11266
  .subscribe(function () {
11230
- _this.fetch().subscribe(function (propertyOwners) {
11231
- _this.cache = propertyOwners;
11267
+ _this.fetch().subscribe(function (propertyShares) {
11268
+ _this.cache = propertyShares;
11232
11269
  _this.updateCache();
11233
11270
  });
11234
11271
  });
11235
11272
  };
11236
- return PropertyOwnerService;
11273
+ return PropertyShareService;
11237
11274
  }(BaseRestService));
11238
- PropertyOwnerService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PropertyOwnerService, deps: [{ token: i1__namespace.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
11239
- PropertyOwnerService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PropertyOwnerService, providedIn: 'root' });
11240
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PropertyOwnerService, decorators: [{
11275
+ PropertyShareService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PropertyShareService, deps: [{ token: i1__namespace.HttpClient }, { token: EventDispatcherService }, { token: 'environment' }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
11276
+ PropertyShareService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PropertyShareService, providedIn: 'root' });
11277
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PropertyShareService, decorators: [{
11241
11278
  type: i0.Injectable,
11242
11279
  args: [{
11243
11280
  providedIn: 'root'
@@ -13021,12 +13058,12 @@
13021
13058
  exports.PropertyEquityChartData = PropertyEquityChartData;
13022
13059
  exports.PropertyEquityChartItem = PropertyEquityChartItem;
13023
13060
  exports.PropertyForecast = PropertyForecast;
13024
- exports.PropertyOwner = PropertyOwner;
13025
- exports.PropertyOwnerService = PropertyOwnerService;
13026
13061
  exports.PropertySale = PropertySale;
13027
13062
  exports.PropertySaleService = PropertySaleService;
13028
13063
  exports.PropertySaleTaxExemptionMetadata = PropertySaleTaxExemptionMetadata;
13029
13064
  exports.PropertyService = PropertyService;
13065
+ exports.PropertyShare = PropertyShare;
13066
+ exports.PropertyShareService = PropertyShareService;
13030
13067
  exports.PropertySubscription = PropertySubscription;
13031
13068
  exports.PropertyValuation = PropertyValuation;
13032
13069
  exports.RegisterClientForm = RegisterClientForm;