taxtank-core 0.13.2 → 0.13.5

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.
@@ -1354,7 +1354,8 @@
1354
1354
  return this.items.find(function (item) { return get__default["default"](item, path) === value; });
1355
1355
  };
1356
1356
  Collection.prototype.findIndexBy = function (path, value) {
1357
- return this.items.findIndex(function (item) { return get__default["default"](item, path) === value; });
1357
+ var _a;
1358
+ return (_a = this.items.findIndex(function (item) { return get__default["default"](item, path) === value; })) !== null && _a !== void 0 ? _a : null;
1358
1359
  };
1359
1360
  /**
1360
1361
  * Get total sum of items by field
@@ -3263,7 +3264,7 @@
3263
3264
  ServiceProductStatusEnum[ServiceProductStatusEnum["ACTIVE"] = 1] = "ACTIVE";
3264
3265
  })(exports.ServiceProductStatusEnum || (exports.ServiceProductStatusEnum = {}));
3265
3266
 
3266
- var ServiceProductIdEnum;
3267
+ exports.ServiceProductIdEnum = void 0;
3267
3268
  (function (ServiceProductIdEnum) {
3268
3269
  ServiceProductIdEnum[ServiceProductIdEnum["WORK_TANK_OLD"] = 1] = "WORK_TANK_OLD";
3269
3270
  ServiceProductIdEnum[ServiceProductIdEnum["PROPERTY_OLD"] = 2] = "PROPERTY_OLD";
@@ -3271,7 +3272,7 @@
3271
3272
  ServiceProductIdEnum[ServiceProductIdEnum["WORK_TANK"] = 4] = "WORK_TANK";
3272
3273
  ServiceProductIdEnum[ServiceProductIdEnum["PROPERTIES"] = 5] = "PROPERTIES";
3273
3274
  ServiceProductIdEnum[ServiceProductIdEnum["SOLE_TANK"] = 6] = "SOLE_TANK";
3274
- })(ServiceProductIdEnum || (ServiceProductIdEnum = {}));
3275
+ })(exports.ServiceProductIdEnum || (exports.ServiceProductIdEnum = {}));
3275
3276
 
3276
3277
  var ServiceProduct = /** @class */ (function (_super) {
3277
3278
  __extends(ServiceProduct, _super);
@@ -3279,13 +3280,13 @@
3279
3280
  return _super !== null && _super.apply(this, arguments) || this;
3280
3281
  }
3281
3282
  ServiceProduct.prototype.isProperties = function () {
3282
- return [ServiceProductIdEnum.PROPERTY_OLD, ServiceProductIdEnum.PROPERTIES].includes(this.id);
3283
+ return [exports.ServiceProductIdEnum.PROPERTY_OLD, exports.ServiceProductIdEnum.PROPERTIES].includes(this.id);
3283
3284
  };
3284
3285
  ServiceProduct.prototype.isWorkTank = function () {
3285
- return [ServiceProductIdEnum.WORK_TANK_OLD, ServiceProductIdEnum.WORK_TANK].includes(this.id);
3286
+ return [exports.ServiceProductIdEnum.WORK_TANK_OLD, exports.ServiceProductIdEnum.WORK_TANK].includes(this.id);
3286
3287
  };
3287
3288
  ServiceProduct.prototype.isSoleTank = function () {
3288
- return this.id === ServiceProductIdEnum.SOLE_TANK;
3289
+ return this.id === exports.ServiceProductIdEnum.SOLE_TANK;
3289
3290
  };
3290
3291
  ServiceProduct.prototype.isArchived = function () {
3291
3292
  return this.status === exports.ServiceProductStatusEnum.ARCHIVED;
@@ -3298,17 +3299,15 @@
3298
3299
  function ServicePrice() {
3299
3300
  return _super !== null && _super.apply(this, arguments) || this;
3300
3301
  }
3302
+ ServicePrice.prototype.toSubscriptionItem = function () {
3303
+ return classTransformer.plainToClass(ServiceSubscriptionItem, { price: this, quantity: this.product.minQty });
3304
+ };
3301
3305
  return ServicePrice;
3302
3306
  }(ServicePrice$1));
3303
3307
  __decorate([
3304
3308
  classTransformer.Type(function () { return ServiceProduct; })
3305
3309
  ], ServicePrice.prototype, "product", void 0);
3306
3310
 
3307
- var ServicePriceListEnum;
3308
- (function (ServicePriceListEnum) {
3309
- ServicePriceListEnum[ServicePriceListEnum["PROPERTIES"] = 5] = "PROPERTIES";
3310
- })(ServicePriceListEnum || (ServicePriceListEnum = {}));
3311
-
3312
3311
  /**
3313
3312
  * backend bd doesn't support dynamic prices, as far as we have just one product like that we keep it hardcoded
3314
3313
  */
@@ -3321,7 +3320,7 @@
3321
3320
  Object.defineProperty(ServiceSubscriptionItem.prototype, "total", {
3322
3321
  get: function () {
3323
3322
  var price = this.price.amount * this.quantity;
3324
- if (this.price.id === ServicePriceListEnum.PROPERTIES) {
3323
+ if (this.price.product.id === exports.ServiceProductIdEnum.PROPERTIES) {
3325
3324
  price += PROPERTY_TANK_PRICE;
3326
3325
  }
3327
3326
  return price;
@@ -3487,7 +3486,7 @@
3487
3486
  return this.daysRemain > 0 && this.daysRemain <= this.lastTrialDays;
3488
3487
  };
3489
3488
  ServiceSubscription.prototype.isRenewable = function () {
3490
- return !this.isTrial && !this.isArchived() && this.isActive;
3489
+ return !this.isTrial && this.isActive;
3491
3490
  };
3492
3491
  Object.defineProperty(ServiceSubscription.prototype, "workTankItem", {
3493
3492
  /**
@@ -3529,7 +3528,7 @@
3529
3528
  */
3530
3529
  ServiceSubscription.prototype.isArchived = function () {
3531
3530
  // subscription with at least one archived product considered as archived
3532
- return !!this.items.map(function (item) { return item.price.product.isArchived(); }).length;
3531
+ return !!this.items.filter(function (item) { return item.price.product.isArchived(); }).length;
3533
3532
  };
3534
3533
  return ServiceSubscription;
3535
3534
  }(ServiceSubscription$1));
@@ -8804,41 +8803,48 @@
8804
8803
  _a[AccountSetupItemsEnum.SALARY] = classTransformer.plainToClass(AccountSetupItem, {
8805
8804
  title: 'Add your work income forecast',
8806
8805
  description: 'One the most important steps is to add your salary or wage incomes so we can automatically calculate tax withheld and your forecasted tax position.',
8807
- url: '/client/work-tank/forecasting#salaryProductTour',
8806
+ url: '/client/work-tank/forecasting',
8807
+ urlFragment: 'salaryProductTour',
8808
8808
  clientIncomeTypes: ['salary']
8809
8809
  }),
8810
8810
  _a[AccountSetupItemsEnum.OTHER_INCOME] = classTransformer.plainToClass(AccountSetupItem, {
8811
8811
  title: 'Add any other expected incomes',
8812
8812
  description: 'To ensure an accurate tax position forecast, add estimates for any other income types, like dividends, interest, trusts, annuities, director payments etc.',
8813
- url: '/client/work-tank/forecasting#otherIncomeProductTour',
8813
+ url: '/client/work-tank/forecasting',
8814
+ urlFragment: 'otherIncomeProductTour',
8814
8815
  clientIncomeTypes: ['dividends', 'other']
8815
8816
  }),
8816
8817
  _a[AccountSetupItemsEnum.PROPERTY] = classTransformer.plainToClass(AccountSetupItem, {
8817
8818
  title: 'Add your properties',
8818
8819
  description: 'Add your properties to seamlessly manage your rental incomes and expenses, whilst tracking your cash position, tax positions and equity forecasts in real time.',
8819
- url: '/client/property-tank#productTour',
8820
+ url: '/client/property-tank',
8821
+ urlFragment: 'productTour',
8820
8822
  clientIncomeTypes: ['property']
8821
8823
  }),
8822
8824
  _a[AccountSetupItemsEnum.BANK_FEEDS] = classTransformer.plainToClass(AccountSetupItem, {
8823
8825
  title: 'Link banks and select accounts',
8824
8826
  description: 'Link banks to automatically feed your account transactions to save you time and money. Allocating live transactions ensures nothing is missed, lost or forgotten!',
8825
- url: '/client/bank-feeds#bankAccountProductTour'
8827
+ url: '/client/bank-feeds',
8828
+ urlFragment: 'bankAccountProductTour',
8826
8829
  }),
8827
8830
  _a[AccountSetupItemsEnum.WORK_LOGBOOK] = classTransformer.plainToClass(AccountSetupItem, {
8828
8831
  title: 'Set up your logbook method',
8829
8832
  description: 'Do you use your vehicle for work? Select your method and the klms or logbook % to automate accurately all vehicle expenses throughout the year.',
8830
- url: '/client/work-tank/logbook#productTour'
8833
+ url: '/client/work-tank/logbook',
8834
+ urlFragment: 'productTour'
8831
8835
  }),
8832
8836
  _a[AccountSetupItemsEnum.SOLE_INCOME] = classTransformer.plainToClass(AccountSetupItem, {
8833
8837
  title: 'Add your business details',
8834
8838
  description: 'Add your business details, logo and payment terms to create invoice templates in minutes.',
8835
- url: '/client/sole-tank/forecasting#productTour',
8839
+ url: '/client/sole-tank/forecasting',
8840
+ urlFragment: 'productTour',
8836
8841
  clientIncomeTypes: ['sole']
8837
8842
  }),
8838
8843
  _a[AccountSetupItemsEnum.TRANSACTION] = classTransformer.plainToClass(AccountSetupItem, {
8839
8844
  title: 'Allocation transactions',
8840
8845
  description: 'Select one or multiple transactions, the category from the dropdown and attach your receipt. It’s that simple to capture every possible deduction, and keep organised all throughout the year.',
8841
- url: '/client/bank-feeds#allocationProductTour'
8846
+ url: '/client/bank-feeds',
8847
+ urlFragment: 'allocationProductTour',
8842
8848
  }),
8843
8849
  _a);
8844
8850