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