taxtank-core 0.3.2 → 0.4.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 +75 -13
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/models/event/app-event-type.enum.js +17 -14
- package/esm2015/lib/services/property/property-category-movement.service.js +47 -0
- package/esm2015/lib/services/property/property.service.js +12 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/taxtank-core.js +68 -14
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/models/event/app-event-type.enum.d.ts +16 -13
- package/lib/services/property/property-category-movement.service.d.ts +15 -0
- package/lib/services/property/property.service.d.ts +4 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -6699,19 +6699,22 @@
|
|
|
6699
6699
|
AppEventTypeEnum[AppEventTypeEnum["NOTIFICATION_ADDED"] = 19] = "NOTIFICATION_ADDED";
|
|
6700
6700
|
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_UPDATED_WITH_DOCUMENT"] = 20] = "PROPERTY_UPDATED_WITH_DOCUMENT";
|
|
6701
6701
|
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_DOCUMENT_ADDED"] = 21] = "PROPERTY_DOCUMENT_ADDED";
|
|
6702
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6703
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6704
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6705
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6706
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6707
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6708
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6709
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6710
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6711
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6712
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6713
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6714
|
-
AppEventTypeEnum[AppEventTypeEnum["
|
|
6702
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_CREATED"] = 22] = "PROPERTY_MOVEMENT_CREATED";
|
|
6703
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_UPDATED"] = 23] = "PROPERTY_MOVEMENT_UPDATED";
|
|
6704
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_MOVEMENT_DELETED"] = 24] = "PROPERTY_MOVEMENT_DELETED";
|
|
6705
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_OWNER_UPDATED"] = 25] = "PROPERTY_OWNER_UPDATED";
|
|
6706
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_ADDED"] = 26] = "PROPERTY_SUBSCRIPTION_ADDED";
|
|
6707
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_SUBSCRIPTION_DELETED"] = 27] = "PROPERTY_SUBSCRIPTION_DELETED";
|
|
6708
|
+
AppEventTypeEnum[AppEventTypeEnum["PROPERTY_VALUATION_DOCUMENT_CREATED"] = 28] = "PROPERTY_VALUATION_DOCUMENT_CREATED";
|
|
6709
|
+
AppEventTypeEnum[AppEventTypeEnum["SERVICE_SUBSCRIPTION_UPDATED"] = 29] = "SERVICE_SUBSCRIPTION_UPDATED";
|
|
6710
|
+
AppEventTypeEnum[AppEventTypeEnum["TAX_REVIEW_UPDATED"] = 30] = "TAX_REVIEW_UPDATED";
|
|
6711
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_CREATED"] = 31] = "TRANSACTION_CREATED";
|
|
6712
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_DELETED"] = 32] = "TRANSACTION_DELETED";
|
|
6713
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTION_UPDATED"] = 33] = "TRANSACTION_UPDATED";
|
|
6714
|
+
AppEventTypeEnum[AppEventTypeEnum["TRANSACTIONS_CREATED"] = 34] = "TRANSACTIONS_CREATED";
|
|
6715
|
+
AppEventTypeEnum[AppEventTypeEnum["USER_UPDATED"] = 35] = "USER_UPDATED";
|
|
6716
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_UPDATED"] = 36] = "VEHICLE_CLAIM_UPDATED";
|
|
6717
|
+
AppEventTypeEnum[AppEventTypeEnum["VEHICLE_CLAIM_CREATED"] = 37] = "VEHICLE_CLAIM_CREATED";
|
|
6715
6718
|
})(exports.AppEventTypeEnum || (exports.AppEventTypeEnum = {}));
|
|
6716
6719
|
|
|
6717
6720
|
exports.IconsFileEnum = void 0;
|
|
@@ -10494,6 +10497,8 @@
|
|
|
10494
10497
|
PropertyService.prototype.listenEvents = function () {
|
|
10495
10498
|
this.listenCoOwnerInviteAccepted();
|
|
10496
10499
|
this.listenServiceSubscriptionUpdated();
|
|
10500
|
+
// @TODO Alex: consider to refactor property movements logic similar to client-movements
|
|
10501
|
+
this.listenMovementsChanged();
|
|
10497
10502
|
};
|
|
10498
10503
|
/**
|
|
10499
10504
|
* Update cache when owner invitation accepted
|
|
@@ -10509,6 +10514,16 @@
|
|
|
10509
10514
|
var _this = this;
|
|
10510
10515
|
this.eventDispatcherService.on(exports.AppEventTypeEnum.SERVICE_SUBSCRIPTION_UPDATED).subscribe(function () { return _this.resetCache(); });
|
|
10511
10516
|
};
|
|
10517
|
+
/**
|
|
10518
|
+
* Update cache when property category changed
|
|
10519
|
+
*/
|
|
10520
|
+
PropertyService.prototype.listenMovementsChanged = function () {
|
|
10521
|
+
var _this = this;
|
|
10522
|
+
// @TODO change dispatcher logic to work with multiple events
|
|
10523
|
+
this.eventDispatcherService.on(exports.AppEventTypeEnum.PROPERTY_MOVEMENT_CREATED).subscribe(function () { return _this.resetCache(); });
|
|
10524
|
+
this.eventDispatcherService.on(exports.AppEventTypeEnum.PROPERTY_MOVEMENT_UPDATED).subscribe(function () { return _this.resetCache(); });
|
|
10525
|
+
this.eventDispatcherService.on(exports.AppEventTypeEnum.PROPERTY_MOVEMENT_DELETED).subscribe(function () { return _this.resetCache(); });
|
|
10526
|
+
};
|
|
10512
10527
|
PropertyService.prototype.update = function (property) {
|
|
10513
10528
|
var _this = this;
|
|
10514
10529
|
return _super.prototype.update.call(this, property).pipe(operators.map(function (updatedProperty) {
|
|
@@ -10785,6 +10800,52 @@
|
|
|
10785
10800
|
}]
|
|
10786
10801
|
}] });
|
|
10787
10802
|
|
|
10803
|
+
var PropertyCategoryMovementService = /** @class */ (function (_super) {
|
|
10804
|
+
__extends(PropertyCategoryMovementService, _super);
|
|
10805
|
+
function PropertyCategoryMovementService() {
|
|
10806
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
10807
|
+
_this.modelClass = PropertyCategoryMovement;
|
|
10808
|
+
_this.url = 'properties/category-movements';
|
|
10809
|
+
return _this;
|
|
10810
|
+
}
|
|
10811
|
+
PropertyCategoryMovementService.prototype.add = function (model) {
|
|
10812
|
+
var _this = this;
|
|
10813
|
+
return _super.prototype.add.call(this, model).pipe(operators.map(function (newMovement) {
|
|
10814
|
+
// @TODO Alex: we need to teach restService to dispatch events + limit list of methods (not all services have all 4 or even more considering batch requests) + collections
|
|
10815
|
+
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.PROPERTY_MOVEMENT_CREATED, null));
|
|
10816
|
+
return newMovement;
|
|
10817
|
+
}));
|
|
10818
|
+
};
|
|
10819
|
+
PropertyCategoryMovementService.prototype.update = function (model) {
|
|
10820
|
+
var _this = this;
|
|
10821
|
+
return _super.prototype.update.call(this, model).pipe(operators.map(function (updatedMovement) {
|
|
10822
|
+
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.PROPERTY_MOVEMENT_CREATED, null));
|
|
10823
|
+
return updatedMovement;
|
|
10824
|
+
}));
|
|
10825
|
+
};
|
|
10826
|
+
PropertyCategoryMovementService.prototype.delete = function (model) {
|
|
10827
|
+
var _this = this;
|
|
10828
|
+
return _super.prototype.delete.call(this, model).pipe(operators.map(function () {
|
|
10829
|
+
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.PROPERTY_MOVEMENT_CREATED, null));
|
|
10830
|
+
}));
|
|
10831
|
+
};
|
|
10832
|
+
// @TODO Alex: Move to collection
|
|
10833
|
+
PropertyCategoryMovementService.prototype.getByPropertyId = function (id) {
|
|
10834
|
+
return this.get().pipe(operators.map(function (movements) {
|
|
10835
|
+
return movements.filter(function (movement) { return movement.property.id === id; });
|
|
10836
|
+
}));
|
|
10837
|
+
};
|
|
10838
|
+
return PropertyCategoryMovementService;
|
|
10839
|
+
}(BaseRestService));
|
|
10840
|
+
PropertyCategoryMovementService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PropertyCategoryMovementService, deps: null, target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
10841
|
+
PropertyCategoryMovementService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PropertyCategoryMovementService, providedIn: 'root' });
|
|
10842
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: PropertyCategoryMovementService, decorators: [{
|
|
10843
|
+
type: i0.Injectable,
|
|
10844
|
+
args: [{
|
|
10845
|
+
providedIn: 'root'
|
|
10846
|
+
}]
|
|
10847
|
+
}] });
|
|
10848
|
+
|
|
10788
10849
|
/**
|
|
10789
10850
|
* Class for work with Property Documents
|
|
10790
10851
|
*/
|
|
@@ -12532,6 +12593,7 @@
|
|
|
12532
12593
|
exports.PropertyCapitalCostService = PropertyCapitalCostService;
|
|
12533
12594
|
exports.PropertyCategory = PropertyCategory;
|
|
12534
12595
|
exports.PropertyCategoryMovement = PropertyCategoryMovement;
|
|
12596
|
+
exports.PropertyCategoryMovementService = PropertyCategoryMovementService;
|
|
12535
12597
|
exports.PropertyCategoryService = PropertyCategoryService;
|
|
12536
12598
|
exports.PropertyCollection = PropertyCollection;
|
|
12537
12599
|
exports.PropertyDocument = PropertyDocument;
|