taxtank-core 0.29.23 → 0.29.26

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.
@@ -2425,6 +2425,15 @@
2425
2425
  // 6: 6
2426
2426
  // }
2427
2427
 
2428
+ exports.ServicePriceTypeEnum = void 0;
2429
+ (function (ServicePriceTypeEnum) {
2430
+ ServicePriceTypeEnum[ServicePriceTypeEnum["DEPRECATED"] = 0] = "DEPRECATED";
2431
+ ServicePriceTypeEnum[ServicePriceTypeEnum["MONTHLY"] = 1] = "MONTHLY";
2432
+ ServicePriceTypeEnum[ServicePriceTypeEnum["MONTHLY_PACKAGE"] = 2] = "MONTHLY_PACKAGE";
2433
+ ServicePriceTypeEnum[ServicePriceTypeEnum["YEARLY"] = 3] = "YEARLY";
2434
+ ServicePriceTypeEnum[ServicePriceTypeEnum["YEARLY_PACKAGE"] = 4] = "YEARLY_PACKAGE";
2435
+ })(exports.ServicePriceTypeEnum || (exports.ServicePriceTypeEnum = {}));
2436
+
2428
2437
  var ServicePrice = /** @class */ (function (_super) {
2429
2438
  __extends(ServicePrice, _super);
2430
2439
  function ServicePrice() {
@@ -2433,6 +2442,9 @@
2433
2442
  ServicePrice.prototype.toSubscriptionItem = function () {
2434
2443
  return classTransformer.plainToClass(ServiceSubscriptionItem, { price: this, quantity: this.product.minQty });
2435
2444
  };
2445
+ ServicePrice.prototype.isAnnual = function () {
2446
+ return [exports.ServicePriceTypeEnum.YEARLY, exports.ServicePriceTypeEnum.YEARLY_PACKAGE].includes(this.type);
2447
+ };
2436
2448
  return ServicePrice;
2437
2449
  }(ServicePrice$1));
2438
2450
  __decorate([
@@ -5381,15 +5393,6 @@
5381
5393
  return SoleInvoiceCollection;
5382
5394
  }(Collection));
5383
5395
 
5384
- exports.ServicePriceTypeEnum = void 0;
5385
- (function (ServicePriceTypeEnum) {
5386
- ServicePriceTypeEnum[ServicePriceTypeEnum["DEPRECATED"] = 0] = "DEPRECATED";
5387
- ServicePriceTypeEnum[ServicePriceTypeEnum["MONTHLY"] = 1] = "MONTHLY";
5388
- ServicePriceTypeEnum[ServicePriceTypeEnum["MONTHLY_PACKAGE"] = 2] = "MONTHLY_PACKAGE";
5389
- ServicePriceTypeEnum[ServicePriceTypeEnum["YEARLY"] = 3] = "YEARLY";
5390
- ServicePriceTypeEnum[ServicePriceTypeEnum["YEARLY_PACKAGE"] = 4] = "YEARLY_PACKAGE";
5391
- })(exports.ServicePriceTypeEnum || (exports.ServicePriceTypeEnum = {}));
5392
-
5393
5396
  /**
5394
5397
  * @TODO vik refactor
5395
5398
  */
@@ -5493,6 +5496,9 @@
5493
5496
  SubscriptionItemCollection.prototype.hasProduct = function (product) {
5494
5497
  return !!this.findBy('price.product.id', product.id);
5495
5498
  };
5499
+ SubscriptionItemCollection.prototype.getPrices = function () {
5500
+ return new ServicePriceCollection(this.mapBy('price'));
5501
+ };
5496
5502
  return SubscriptionItemCollection;
5497
5503
  }(Collection));
5498
5504
 
@@ -6642,6 +6648,13 @@
6642
6648
  _this.lastTrialDays = 4;
6643
6649
  return _this;
6644
6650
  }
6651
+ Object.defineProperty(ServiceSubscription.prototype, "frequency", {
6652
+ get: function () {
6653
+ return this.isAnnual() ? 'year' : 'month';
6654
+ },
6655
+ enumerable: false,
6656
+ configurable: true
6657
+ });
6645
6658
  Object.defineProperty(ServiceSubscription.prototype, "isTrial", {
6646
6659
  get: function () {
6647
6660
  return !this.stripeId;
@@ -6768,6 +6781,9 @@
6768
6781
  ServiceSubscription.prototype.isPackage = function () {
6769
6782
  return this.items.length === ServiceProduct.quantity;
6770
6783
  };
6784
+ ServiceSubscription.prototype.isAnnual = function () {
6785
+ return !!(this.getItems().getPrices().annual.length || this.getItems().getPrices().annualPackage.length);
6786
+ };
6771
6787
  /**
6772
6788
  * Recommended number of properties to buy,
6773
6789
  * based on the property service product and the number of properties the user has
@@ -10107,7 +10123,8 @@
10107
10123
  PROPERTIES_SALES_GET: new Endpoint('GET', '\\/properties\\/sales'),
10108
10124
  PROPERTIES_SUGGESTIONS_GET: new Endpoint('GET', '/property\\/\\w+\\/v2\\/.*$'),
10109
10125
  PROPERTIES_VALUATIONS_DOCUMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/valuations\\/\\d+\\/documents'),
10110
- PRORATION_COST_POST: new Endpoint('POST', '\\/subscriptions\\/proration-cost'),
10126
+ // @TODO rename
10127
+ PRORATION_COST_POST: new Endpoint('PUT', '\\/service-subscriptions\\/\\d+\\/proration-cost'),
10111
10128
  SALARY_FORECAST_GET: new Endpoint('GET', '\\/salary-forecasts'),
10112
10129
  SALARY_FORECAST_POST: new Endpoint('POST', '\\/salary-forecasts'),
10113
10130
  SALARY_FORECAST_PUT: new Endpoint('PUT', '\\/salary-forecasts'),
@@ -10115,11 +10132,9 @@
10115
10132
  SERVICE_PRODUCTS_GET: new Endpoint('GET', '\\/service-products'),
10116
10133
  SERVICE_PAYMENTS_GET: new Endpoint('GET', '\\/service-payments'),
10117
10134
  SERVICE_SUBSCRIPTIONS_GET: new Endpoint('GET', '\\/service-subscriptions'),
10135
+ SERVICE_SUBSCRIPTIONS_CANCEL: new Endpoint('PUT', '\\/service-subscriptions\\/\\d+\\/cancel'),
10118
10136
  SERVICE_PAYMENT_INVOICE_URL_GET: new Endpoint('GET', '\\/service-payments\\/\\d+\\/invoice-url'),
10119
- STRIPE_BILLING_PORTAL_GET: new Endpoint('GET', '\\/stripe\\/billing-portal-session'),
10120
- STRIPE_CHECKOUT_SESSION_POST: new Endpoint('POST', '\\/stripe\\/checkout-session'),
10121
- SUBSCRIPTION_LAST_GET: new Endpoint('GET', '\\/subscriptions\\/last'),
10122
- SUBSCRIPTION_ITEMS_PUT: new Endpoint('PUT', '\\/subscriptions\\/items'),
10137
+ SUBSCRIPTION_ITEMS_PUT: new Endpoint('PUT', '\\/service-subscriptions\\/\\d+\\/items'),
10123
10138
  SOLE_BUSINESSES_GET: new Endpoint('GET', '\\/sole-businesses'),
10124
10139
  SOLE_BUSINESSES_POST: new Endpoint('POST', '\\/sole-businesses'),
10125
10140
  SOLE_BUSINESSES_PUT: new Endpoint('PUT', '\\/sole-businesses\\/\\d+'),
@@ -16243,6 +16258,7 @@
16243
16258
  return this.getActive().pipe(operators.map(function (subscriptions) { return subscriptions.getTrials(); }));
16244
16259
  };
16245
16260
  /**
16261
+ * @TODO remove
16246
16262
  * redirect to stripe payment page
16247
16263
  */
16248
16264
  SubscriptionService.prototype.checkoutRedirect = function (subscription) {
@@ -16268,6 +16284,7 @@
16268
16284
  });
16269
16285
  };
16270
16286
  /**
16287
+ * @TODO remove
16271
16288
  * redirect to stripe billing page
16272
16289
  */
16273
16290
  SubscriptionService.prototype.billingRedirect = function (returnUrl) {
@@ -16291,6 +16308,9 @@
16291
16308
  SubscriptionService.prototype.changeSubscription = function (subscription) {
16292
16309
  return this.http.put(this.environment.apiV2 + "/service-subscriptions/" + subscription.id, subscription);
16293
16310
  };
16311
+ SubscriptionService.prototype.cancel = function (subscription) {
16312
+ return this.http.put(this.environment.apiV2 + "/service-subscriptions/" + subscription.id + "/cancel", {});
16313
+ };
16294
16314
  SubscriptionService.prototype.listenSubscriptions = function () {
16295
16315
  var _this = this;
16296
16316
  this.sseService.on("serviceSubscriptions")
@@ -18959,8 +18979,8 @@
18959
18979
  searchQuery: new forms.FormControl(address.address ? address.nameLong : null, forms.Validators.required),
18960
18980
  type: new forms.FormControl(address.type | exports.AddressTypeEnum.STREET, forms.Validators.required),
18961
18981
  // Corelogic fields
18962
- corelogicLocId: new forms.FormControl(address.corelogicLocId, conditionalValidator(function () { return isCorelogicRequired; }, forms.Validators.required)),
18963
- corelogicRefId: new forms.FormControl(address.corelogicRefId, conditionalValidator(function () { return isCorelogicRequired; }, forms.Validators.required)),
18982
+ corelogicLocId: new forms.FormControl(address.corelogicLocId),
18983
+ corelogicRefId: new forms.FormControl(address.corelogicRefId),
18964
18984
  // manual fields
18965
18985
  unitNumber: new forms.FormControl({ value: address.unitNumber, disabled: true }),
18966
18986
  address: new forms.FormControl({ value: address.address, disabled: true }, forms.Validators.required),