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.
- package/bundles/taxtank-core.umd.js +196 -159
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/collection.js +13 -4
- 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/client-details.js +1 -1
- package/esm2015/lib/db/Models/property/property-sale/property-sale.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 +9 -8
- 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 +167 -130
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/collection.d.ts +6 -1
- 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/client-details.d.ts +1 -0
- package/lib/db/Models/property/property-sale/property-sale.d.ts +4 -3
- 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'),
|
|
@@ -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.
|
|
3289
|
-
(function (
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
})(exports.
|
|
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.
|
|
3295
|
-
(function (
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
})(exports.
|
|
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["
|
|
3523
|
-
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["
|
|
3524
|
-
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["
|
|
3525
|
-
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["
|
|
3526
|
-
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["
|
|
3527
|
-
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["
|
|
3528
|
-
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["
|
|
3529
|
-
UserEventTypeClientTypeEnum[UserEventTypeClientTypeEnum["
|
|
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.
|
|
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, "
|
|
4685
|
+
Object.defineProperty(Property.prototype, "shareClaimPercent", {
|
|
4680
4686
|
/**
|
|
4681
|
-
* exact claim
|
|
4687
|
+
* exact claim including share percent
|
|
4682
4688
|
*/
|
|
4683
4689
|
get: function () {
|
|
4684
|
-
return this.
|
|
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, "
|
|
4704
|
+
Object.defineProperty(Property.prototype, "sharePercent", {
|
|
4699
4705
|
get: function () {
|
|
4700
|
-
return this.myShare.
|
|
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.
|
|
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 &&
|
|
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["
|
|
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.
|
|
7214
|
-
// return '/client/users/
|
|
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.
|
|
7307
|
-
(function (
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
|
|
7311
|
-
})(exports.
|
|
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
|
|
7504
|
-
function
|
|
7520
|
+
var PropertyShare$1 = /** @class */ (function () {
|
|
7521
|
+
function PropertyShare() {
|
|
7505
7522
|
}
|
|
7506
|
-
return
|
|
7523
|
+
return PropertyShare;
|
|
7507
7524
|
}());
|
|
7508
7525
|
|
|
7509
|
-
var
|
|
7510
|
-
__extends(
|
|
7511
|
-
function
|
|
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
|
-
|
|
7515
|
-
return this.status === exports.
|
|
7531
|
+
PropertyShare.prototype.isAccepted = function () {
|
|
7532
|
+
return this.status === exports.PropertyShareStatusEnum.APPROVED;
|
|
7516
7533
|
};
|
|
7517
|
-
|
|
7518
|
-
return this.status === exports.
|
|
7534
|
+
PropertyShare.prototype.isPending = function () {
|
|
7535
|
+
return this.status === exports.PropertyShareStatusEnum.PENDING;
|
|
7519
7536
|
};
|
|
7520
|
-
|
|
7521
|
-
return this.status === exports.
|
|
7537
|
+
PropertyShare.prototype.isRejected = function () {
|
|
7538
|
+
return this.status === exports.PropertyShareStatusEnum.REJECTED;
|
|
7522
7539
|
};
|
|
7523
|
-
Object.defineProperty(
|
|
7540
|
+
Object.defineProperty(PropertyShare.prototype, "statusName", {
|
|
7524
7541
|
get: function () {
|
|
7525
7542
|
var _a;
|
|
7526
|
-
return (_a = exports.
|
|
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(
|
|
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
|
|
7543
|
-
}(
|
|
7559
|
+
return PropertyShare;
|
|
7560
|
+
}(PropertyShare$1));
|
|
7544
7561
|
__decorate([
|
|
7545
7562
|
classTransformer.Type(function () { return Date; })
|
|
7546
|
-
],
|
|
7563
|
+
], PropertyShare.prototype, "fromDate", void 0);
|
|
7547
7564
|
__decorate([
|
|
7548
7565
|
classTransformer.Type(function () { return Date; })
|
|
7549
|
-
],
|
|
7566
|
+
], PropertyShare.prototype, "toDate", void 0);
|
|
7550
7567
|
__decorate([
|
|
7551
7568
|
classTransformer.Type(function () { return User; })
|
|
7552
|
-
],
|
|
7569
|
+
], PropertyShare.prototype, "user", void 0);
|
|
7553
7570
|
__decorate([
|
|
7554
7571
|
classTransformer.Type(function () { return RegistrationInvite; })
|
|
7555
|
-
],
|
|
7572
|
+
], PropertyShare.prototype, "invite", void 0);
|
|
7556
7573
|
__decorate([
|
|
7557
7574
|
classTransformer.Type(function () { return Property; })
|
|
7558
|
-
],
|
|
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
|
-
],
|
|
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.
|
|
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.
|
|
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
|
-
|
|
10682
|
-
|
|
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
|
|
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(
|
|
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((
|
|
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.
|
|
10734
|
-
textColor: PDF_CONFIG.text.
|
|
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.
|
|
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
|
|
10853
|
+
* Update cache when share invitation accepted
|
|
10809
10854
|
*/
|
|
10810
|
-
PropertyService.prototype.
|
|
10855
|
+
PropertyService.prototype.listenShareInviteAccepted = function () {
|
|
10811
10856
|
var _this = this;
|
|
10812
|
-
this.eventDispatcherService.on(exports.AppEventTypeEnum.
|
|
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.
|
|
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
|
|
11134
|
-
__extends(
|
|
11135
|
-
function
|
|
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
|
|
11141
|
-
_this.url = 'properties/
|
|
11142
|
-
_this.modelClass =
|
|
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
|
-
|
|
11194
|
+
PropertyShareService.prototype.listenEvents = function () {
|
|
11150
11195
|
this.listenUserUpdated();
|
|
11151
11196
|
};
|
|
11152
11197
|
/**
|
|
11153
11198
|
* Updated loan
|
|
11154
11199
|
*/
|
|
11155
|
-
|
|
11200
|
+
PropertyShareService.prototype.update = function (propertyShare) {
|
|
11156
11201
|
var _this = this;
|
|
11157
|
-
return this.http.put(this.environment.apiV2 + "/" + this.url + "/" +
|
|
11158
|
-
.pipe(operators.map(function (
|
|
11159
|
-
var
|
|
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.
|
|
11162
|
-
replace(_this.cache,
|
|
11206
|
+
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.PROPERTY_SHARE_UPDATED, null));
|
|
11207
|
+
replace(_this.cache, updatedPropertyShare);
|
|
11163
11208
|
_this.updateCache();
|
|
11164
|
-
return
|
|
11209
|
+
return updatedPropertyShare;
|
|
11165
11210
|
}));
|
|
11166
11211
|
};
|
|
11167
11212
|
/**
|
|
11168
|
-
* Re-invite property
|
|
11213
|
+
* Re-invite property share
|
|
11169
11214
|
* @param share user to share property
|
|
11170
11215
|
*/
|
|
11171
|
-
|
|
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 (
|
|
11180
|
-
var
|
|
11181
|
-
|
|
11221
|
+
.pipe(operators.map(function (propertyShares) {
|
|
11222
|
+
var propertySharesIncoming = [];
|
|
11223
|
+
propertyShares.forEach(function (propertyShare) {
|
|
11182
11224
|
var _a;
|
|
11183
|
-
if (((_a =
|
|
11184
|
-
|
|
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
|
|
11229
|
+
return propertySharesIncoming;
|
|
11188
11230
|
}));
|
|
11189
11231
|
};
|
|
11190
11232
|
/**
|
|
11191
|
-
* Get outcoming property
|
|
11233
|
+
* Get outcoming property shares list
|
|
11192
11234
|
*/
|
|
11193
|
-
|
|
11235
|
+
PropertyShareService.prototype.getOutcoming = function () {
|
|
11194
11236
|
var _this = this;
|
|
11195
|
-
return this.get().pipe(operators.map(function (
|
|
11196
|
-
return _this.filterOutcoming(
|
|
11237
|
+
return this.get().pipe(operators.map(function (propertyShares) {
|
|
11238
|
+
return _this.filterOutcoming(propertyShares);
|
|
11197
11239
|
}));
|
|
11198
11240
|
};
|
|
11199
11241
|
/**
|
|
11200
|
-
* Filter outcoming property
|
|
11201
|
-
* @param propertyOwners which should be filtered
|
|
11242
|
+
* Filter outcoming property shares
|
|
11202
11243
|
*/
|
|
11203
|
-
|
|
11204
|
-
var
|
|
11205
|
-
|
|
11244
|
+
PropertyShareService.prototype.filterOutcoming = function (propertyShares) {
|
|
11245
|
+
var propertySharesOutcoming = [];
|
|
11246
|
+
propertyShares.forEach(function (propertyShare) {
|
|
11206
11247
|
var _a;
|
|
11207
|
-
if (!((_a =
|
|
11208
|
-
|
|
11248
|
+
if (!((_a = propertyShare.user) === null || _a === void 0 ? void 0 : _a.isLoggedIn())) {
|
|
11249
|
+
propertySharesOutcoming.push(propertyShare);
|
|
11209
11250
|
}
|
|
11210
11251
|
});
|
|
11211
|
-
return
|
|
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 (
|
|
11220
|
-
return
|
|
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
|
-
|
|
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 (
|
|
11231
|
-
_this.cache =
|
|
11267
|
+
_this.fetch().subscribe(function (propertyShares) {
|
|
11268
|
+
_this.cache = propertyShares;
|
|
11232
11269
|
_this.updateCache();
|
|
11233
11270
|
});
|
|
11234
11271
|
});
|
|
11235
11272
|
};
|
|
11236
|
-
return
|
|
11273
|
+
return PropertyShareService;
|
|
11237
11274
|
}(BaseRestService));
|
|
11238
|
-
|
|
11239
|
-
|
|
11240
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type:
|
|
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;
|