taxtank-core 0.23.6 → 0.23.9
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 +32 -40
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/models/chart-accounts/chart-accounts-categories.const.js +3 -7
- package/esm2015/lib/models/service-subscription/service-subscription.js +11 -4
- package/esm2015/lib/services/http/transaction/transaction.service.js +1 -5
- package/fesm2015/taxtank-core.js +32 -40
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/models/service-subscription/service-subscription.d.ts +5 -2
- package/package.json +1 -1
- package/esm2015/lib/services/http/transaction/messages.enum.js +0 -7
- package/lib/services/http/transaction/messages.enum.d.ts +0 -5
|
@@ -2062,6 +2062,16 @@
|
|
|
2062
2062
|
_a$2[exports.SubscriptionTypeEnum.INVESTOR_PLUS] = 'Add your whole portfolio, including investment properties, home and properties in trusts. For 3+ properties an extra $6 will be charged per property.',
|
|
2063
2063
|
_a$2);
|
|
2064
2064
|
|
|
2065
|
+
exports.ServiceSubscriptionStatusEnum = void 0;
|
|
2066
|
+
(function (ServiceSubscriptionStatusEnum) {
|
|
2067
|
+
ServiceSubscriptionStatusEnum[ServiceSubscriptionStatusEnum["ACTIVE"] = 1] = "ACTIVE";
|
|
2068
|
+
ServiceSubscriptionStatusEnum[ServiceSubscriptionStatusEnum["INCOMPLETE"] = 2] = "INCOMPLETE";
|
|
2069
|
+
ServiceSubscriptionStatusEnum[ServiceSubscriptionStatusEnum["INCOMPLETE_EXPIRED"] = 3] = "INCOMPLETE_EXPIRED";
|
|
2070
|
+
ServiceSubscriptionStatusEnum[ServiceSubscriptionStatusEnum["PAST_DUE"] = 4] = "PAST_DUE";
|
|
2071
|
+
ServiceSubscriptionStatusEnum[ServiceSubscriptionStatusEnum["CANCELED"] = 5] = "CANCELED";
|
|
2072
|
+
ServiceSubscriptionStatusEnum[ServiceSubscriptionStatusEnum["UNPAID"] = 6] = "UNPAID";
|
|
2073
|
+
})(exports.ServiceSubscriptionStatusEnum || (exports.ServiceSubscriptionStatusEnum = {}));
|
|
2074
|
+
|
|
2065
2075
|
var PROPERTY_INVESTOR_MAX_PROPERTIES = 2;
|
|
2066
2076
|
var ServiceSubscription = /** @class */ (function (_super) {
|
|
2067
2077
|
__extends(ServiceSubscription, _super);
|
|
@@ -2139,11 +2149,11 @@
|
|
|
2139
2149
|
});
|
|
2140
2150
|
Object.defineProperty(ServiceSubscription.prototype, "isActive", {
|
|
2141
2151
|
/**
|
|
2142
|
-
*
|
|
2143
|
-
* and for user we add check for endDate
|
|
2152
|
+
* A subscription is considered active if the end date has not yet arrived and its status is "Active" or "Past due"
|
|
2144
2153
|
*/
|
|
2145
2154
|
get: function () {
|
|
2146
|
-
|
|
2155
|
+
var isExpired = new Date(this.endDate).getTime() < new Date().getTime();
|
|
2156
|
+
return isExpired && ([exports.ServiceSubscriptionStatusEnum.ACTIVE, exports.ServiceSubscriptionStatusEnum.PAST_DUE].includes(this.status));
|
|
2147
2157
|
},
|
|
2148
2158
|
enumerable: false,
|
|
2149
2159
|
configurable: true
|
|
@@ -2234,6 +2244,12 @@
|
|
|
2234
2244
|
// subscription with at least one archived product considered as archived
|
|
2235
2245
|
return !!this.items.filter(function (item) { return item.price.product.isArchived(); }).length;
|
|
2236
2246
|
};
|
|
2247
|
+
/**
|
|
2248
|
+
* Case when payment was failed, but user has a time to update payment method
|
|
2249
|
+
*/
|
|
2250
|
+
ServiceSubscription.prototype.isPastDue = function () {
|
|
2251
|
+
return this.status === exports.ServiceSubscriptionStatusEnum.PAST_DUE;
|
|
2252
|
+
};
|
|
2237
2253
|
return ServiceSubscription;
|
|
2238
2254
|
}(ServiceSubscription$1));
|
|
2239
2255
|
__decorate([
|
|
@@ -2516,15 +2532,11 @@
|
|
|
2516
2532
|
],
|
|
2517
2533
|
workExpense: [
|
|
2518
2534
|
exports.ChartAccountsCategoryEnum.WORK_EXPENSE,
|
|
2519
|
-
exports.ChartAccountsCategoryEnum.OTHER_EXPENSE
|
|
2520
|
-
// @TODO Alex why?
|
|
2521
|
-
exports.ChartAccountsCategoryEnum.PERSONAL_EXPENSE
|
|
2535
|
+
exports.ChartAccountsCategoryEnum.OTHER_EXPENSE
|
|
2522
2536
|
],
|
|
2523
2537
|
workIncome: [
|
|
2524
2538
|
exports.ChartAccountsCategoryEnum.WORK_INCOME,
|
|
2525
|
-
exports.ChartAccountsCategoryEnum.OTHER_INCOME
|
|
2526
|
-
// @TODO Alex why?
|
|
2527
|
-
exports.ChartAccountsCategoryEnum.PERSONAL_INCOME
|
|
2539
|
+
exports.ChartAccountsCategoryEnum.OTHER_INCOME
|
|
2528
2540
|
],
|
|
2529
2541
|
soleExpense: [
|
|
2530
2542
|
exports.ChartAccountsCategoryEnum.SOLE_EXPENSE,
|
|
@@ -7830,16 +7842,6 @@
|
|
|
7830
7842
|
ServicePriceTypeEnum[ServicePriceTypeEnum["RECURRING"] = 2] = "RECURRING";
|
|
7831
7843
|
})(exports.ServicePriceTypeEnum || (exports.ServicePriceTypeEnum = {}));
|
|
7832
7844
|
|
|
7833
|
-
exports.ServiceSubscriptionStatusEnum = void 0;
|
|
7834
|
-
(function (ServiceSubscriptionStatusEnum) {
|
|
7835
|
-
ServiceSubscriptionStatusEnum[ServiceSubscriptionStatusEnum["ACTIVE"] = 1] = "ACTIVE";
|
|
7836
|
-
ServiceSubscriptionStatusEnum[ServiceSubscriptionStatusEnum["INCOMPLETE"] = 2] = "INCOMPLETE";
|
|
7837
|
-
ServiceSubscriptionStatusEnum[ServiceSubscriptionStatusEnum["INCOMPLETE_EXPIRED"] = 3] = "INCOMPLETE_EXPIRED";
|
|
7838
|
-
ServiceSubscriptionStatusEnum[ServiceSubscriptionStatusEnum["PAST_DUE"] = 4] = "PAST_DUE";
|
|
7839
|
-
ServiceSubscriptionStatusEnum[ServiceSubscriptionStatusEnum["CANCELED"] = 5] = "CANCELED";
|
|
7840
|
-
ServiceSubscriptionStatusEnum[ServiceSubscriptionStatusEnum["UNPAID"] = 6] = "UNPAID";
|
|
7841
|
-
})(exports.ServiceSubscriptionStatusEnum || (exports.ServiceSubscriptionStatusEnum = {}));
|
|
7842
|
-
|
|
7843
7845
|
exports.SpareDocumentSpareTypeEnum = void 0;
|
|
7844
7846
|
(function (SpareDocumentSpareTypeEnum) {
|
|
7845
7847
|
SpareDocumentSpareTypeEnum[SpareDocumentSpareTypeEnum["DOCUMENT"] = 1] = "DOCUMENT";
|
|
@@ -11378,7 +11380,7 @@
|
|
|
11378
11380
|
}]
|
|
11379
11381
|
}] });
|
|
11380
11382
|
|
|
11381
|
-
var MessagesEnum
|
|
11383
|
+
var MessagesEnum;
|
|
11382
11384
|
(function (MessagesEnum) {
|
|
11383
11385
|
MessagesEnum["VEHICLE_CREATED"] = "Vehicle created successfully";
|
|
11384
11386
|
MessagesEnum["VEHICLE_UPDATED"] = "Vehicle updated successfully";
|
|
@@ -11389,7 +11391,7 @@
|
|
|
11389
11391
|
MessagesEnum["VEHICLE_LOGBOOK_CREATED"] = "Vehicle logbook created successfully";
|
|
11390
11392
|
MessagesEnum["VEHICLE_LOGBOOK_UPDATED"] = "Vehicle logbook updated successfully";
|
|
11391
11393
|
MessagesEnum["VEHICLE_LOGBOOK_DELETED"] = "Vehicle logbook deleted successfully";
|
|
11392
|
-
})(MessagesEnum
|
|
11394
|
+
})(MessagesEnum || (MessagesEnum = {}));
|
|
11393
11395
|
|
|
11394
11396
|
var VehicleClaimService = /** @class */ (function (_super) {
|
|
11395
11397
|
__extends(VehicleClaimService, _super);
|
|
@@ -11397,9 +11399,9 @@
|
|
|
11397
11399
|
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
11398
11400
|
_this.modelClass = VehicleClaim;
|
|
11399
11401
|
_this.url = 'vehicle-claims';
|
|
11400
|
-
_this.messageCreated = MessagesEnum
|
|
11401
|
-
_this.messageUpdated = MessagesEnum
|
|
11402
|
-
_this.messageDeleted = MessagesEnum
|
|
11402
|
+
_this.messageCreated = MessagesEnum.VEHICLE_CLAIM_CREATED;
|
|
11403
|
+
_this.messageUpdated = MessagesEnum.VEHICLE_CLAIM_UPDATED;
|
|
11404
|
+
_this.messageDeleted = MessagesEnum.VEHICLE_CLAIM_DELETED;
|
|
11403
11405
|
return _this;
|
|
11404
11406
|
}
|
|
11405
11407
|
return VehicleClaimService;
|
|
@@ -11426,13 +11428,6 @@
|
|
|
11426
11428
|
return list;
|
|
11427
11429
|
}
|
|
11428
11430
|
|
|
11429
|
-
var MessagesEnum;
|
|
11430
|
-
(function (MessagesEnum) {
|
|
11431
|
-
MessagesEnum["DELETED_MESSAGE"] = "Transaction deleted";
|
|
11432
|
-
MessagesEnum["UPDATED_MESSAGE"] = "Transaction updated";
|
|
11433
|
-
MessagesEnum["CREATED_MESSAGE"] = "Transaction(s) created";
|
|
11434
|
-
})(MessagesEnum || (MessagesEnum = {}));
|
|
11435
|
-
|
|
11436
11431
|
/**
|
|
11437
11432
|
* Service for transactions business logic
|
|
11438
11433
|
*/
|
|
@@ -11570,7 +11565,6 @@
|
|
|
11570
11565
|
_this.updateCache();
|
|
11571
11566
|
}
|
|
11572
11567
|
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.TRANSACTIONS_CREATED, addedTransactions));
|
|
11573
|
-
_this.toastService.success(MessagesEnum.CREATED_MESSAGE);
|
|
11574
11568
|
return addedTransactions;
|
|
11575
11569
|
}));
|
|
11576
11570
|
};
|
|
@@ -11608,7 +11602,6 @@
|
|
|
11608
11602
|
_this.addBatch(childTransactionsToAdd).subscribe();
|
|
11609
11603
|
}
|
|
11610
11604
|
}
|
|
11611
|
-
_this.toastService.success(MessagesEnum.UPDATED_MESSAGE);
|
|
11612
11605
|
replace(_this.cache, updatedTransaction);
|
|
11613
11606
|
_this.updateCache();
|
|
11614
11607
|
return updatedTransaction;
|
|
@@ -11657,7 +11650,6 @@
|
|
|
11657
11650
|
return transaction.id !== model.id && ((_a = transaction.parentTransaction) === null || _a === void 0 ? void 0 : _a.id) !== model.id;
|
|
11658
11651
|
});
|
|
11659
11652
|
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.TRANSACTION_DELETED, model));
|
|
11660
|
-
_this.toastService.success(MessagesEnum.DELETED_MESSAGE);
|
|
11661
11653
|
_this.updateCache();
|
|
11662
11654
|
_this.transactionDeleted.emit(model);
|
|
11663
11655
|
}));
|
|
@@ -15280,9 +15272,9 @@
|
|
|
15280
15272
|
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
15281
15273
|
_this.url = 'vehicles';
|
|
15282
15274
|
_this.modelClass = Vehicle;
|
|
15283
|
-
_this.messageCreated = MessagesEnum
|
|
15284
|
-
_this.messageUpdated = MessagesEnum
|
|
15285
|
-
_this.messageDeleted = MessagesEnum
|
|
15275
|
+
_this.messageCreated = MessagesEnum.VEHICLE_CREATED;
|
|
15276
|
+
_this.messageUpdated = MessagesEnum.VEHICLE_UPDATED;
|
|
15277
|
+
_this.messageDeleted = MessagesEnum.VEHICLE_DELETED;
|
|
15286
15278
|
return _this;
|
|
15287
15279
|
}
|
|
15288
15280
|
VehicleService.prototype.listenEvents = function () {
|
|
@@ -15358,7 +15350,7 @@
|
|
|
15358
15350
|
.pipe(operators.map(function (vehicleLogbookBase) {
|
|
15359
15351
|
var newVehicleLogbook = classTransformer.plainToClass(VehicleLogbook, vehicleLogbookBase);
|
|
15360
15352
|
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.VEHICLE_LOGBOOK_CREATED, { logbook: newVehicleLogbook, vehicleId: vehicleId }));
|
|
15361
|
-
_this.toastService.success(MessagesEnum
|
|
15353
|
+
_this.toastService.success(MessagesEnum.VEHICLE_LOGBOOK_CREATED);
|
|
15362
15354
|
return newVehicleLogbook;
|
|
15363
15355
|
}));
|
|
15364
15356
|
};
|
|
@@ -15367,7 +15359,7 @@
|
|
|
15367
15359
|
return this.http.put(this.environment.apiV2 + "/vehicles/" + vehicleId + "/logbooks/" + logbook.id, logbook).pipe(operators.map(function (vehicleLogbookBase) {
|
|
15368
15360
|
var updatedVehicleLogbook = classTransformer.plainToClass(VehicleLogbook, vehicleLogbookBase);
|
|
15369
15361
|
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.VEHICLE_LOGBOOK_UPDATED, { logbook: updatedVehicleLogbook, vehicleId: vehicleId }));
|
|
15370
|
-
_this.toastService.success(MessagesEnum
|
|
15362
|
+
_this.toastService.success(MessagesEnum.VEHICLE_LOGBOOK_UPDATED);
|
|
15371
15363
|
return classTransformer.plainToClass(VehicleLogbook, updatedVehicleLogbook);
|
|
15372
15364
|
}));
|
|
15373
15365
|
};
|
|
@@ -15376,7 +15368,7 @@
|
|
|
15376
15368
|
return this.http.delete(this.environment.apiV2 + "/vehicles/" + vehicleId + "/logbooks/" + logbook.id)
|
|
15377
15369
|
.pipe(operators.map(function () {
|
|
15378
15370
|
_this.eventDispatcherService.dispatch(new AppEvent(exports.AppEventTypeEnum.VEHICLE_LOGBOOK_DELETED, { logbook: logbook, vehicleId: vehicleId }));
|
|
15379
|
-
_this.toastService.success(MessagesEnum
|
|
15371
|
+
_this.toastService.success(MessagesEnum.VEHICLE_LOGBOOK_DELETED);
|
|
15380
15372
|
}));
|
|
15381
15373
|
};
|
|
15382
15374
|
return VehicleLogbookService;
|