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.
- package/bundles/taxtank-core.umd.js +36 -16
- package/bundles/taxtank-core.umd.js.map +1 -1
- package/esm2015/lib/collections/subscription/subscription-item.collection.js +5 -1
- package/esm2015/lib/db/Models/subscription/service-subscription.js +1 -1
- package/esm2015/lib/forms/address/address.form.js +3 -3
- package/esm2015/lib/models/endpoint/endpoints.const.js +5 -6
- package/esm2015/lib/models/service-subscription/service-price.js +5 -1
- package/esm2015/lib/models/service-subscription/service-subscription.js +7 -1
- package/esm2015/lib/services/http/subscription/service-subscription/subscription.service.js +6 -1
- package/fesm2015/taxtank-core.js +32 -16
- package/fesm2015/taxtank-core.js.map +1 -1
- package/lib/collections/subscription/subscription-item.collection.d.ts +2 -0
- package/lib/db/Models/subscription/service-subscription.d.ts +1 -0
- package/lib/models/service-subscription/service-price.d.ts +1 -0
- package/lib/models/service-subscription/service-subscription.d.ts +2 -0
- package/lib/services/http/subscription/service-subscription/subscription.service.d.ts +3 -0
- package/package.json +1 -1
package/fesm2015/taxtank-core.js
CHANGED
|
@@ -1375,10 +1375,22 @@ ServiceProduct.quantity = 3;
|
|
|
1375
1375
|
// 6: 6
|
|
1376
1376
|
// }
|
|
1377
1377
|
|
|
1378
|
+
var ServicePriceTypeEnum;
|
|
1379
|
+
(function (ServicePriceTypeEnum) {
|
|
1380
|
+
ServicePriceTypeEnum[ServicePriceTypeEnum["DEPRECATED"] = 0] = "DEPRECATED";
|
|
1381
|
+
ServicePriceTypeEnum[ServicePriceTypeEnum["MONTHLY"] = 1] = "MONTHLY";
|
|
1382
|
+
ServicePriceTypeEnum[ServicePriceTypeEnum["MONTHLY_PACKAGE"] = 2] = "MONTHLY_PACKAGE";
|
|
1383
|
+
ServicePriceTypeEnum[ServicePriceTypeEnum["YEARLY"] = 3] = "YEARLY";
|
|
1384
|
+
ServicePriceTypeEnum[ServicePriceTypeEnum["YEARLY_PACKAGE"] = 4] = "YEARLY_PACKAGE";
|
|
1385
|
+
})(ServicePriceTypeEnum || (ServicePriceTypeEnum = {}));
|
|
1386
|
+
|
|
1378
1387
|
class ServicePrice extends ServicePrice$1 {
|
|
1379
1388
|
toSubscriptionItem() {
|
|
1380
1389
|
return plainToClass(ServiceSubscriptionItem, { price: this, quantity: this.product.minQty });
|
|
1381
1390
|
}
|
|
1391
|
+
isAnnual() {
|
|
1392
|
+
return [ServicePriceTypeEnum.YEARLY, ServicePriceTypeEnum.YEARLY_PACKAGE].includes(this.type);
|
|
1393
|
+
}
|
|
1382
1394
|
}
|
|
1383
1395
|
__decorate([
|
|
1384
1396
|
Type(() => ServiceProduct)
|
|
@@ -3872,15 +3884,6 @@ class SoleInvoiceCollection extends Collection {
|
|
|
3872
3884
|
}
|
|
3873
3885
|
}
|
|
3874
3886
|
|
|
3875
|
-
var ServicePriceTypeEnum;
|
|
3876
|
-
(function (ServicePriceTypeEnum) {
|
|
3877
|
-
ServicePriceTypeEnum[ServicePriceTypeEnum["DEPRECATED"] = 0] = "DEPRECATED";
|
|
3878
|
-
ServicePriceTypeEnum[ServicePriceTypeEnum["MONTHLY"] = 1] = "MONTHLY";
|
|
3879
|
-
ServicePriceTypeEnum[ServicePriceTypeEnum["MONTHLY_PACKAGE"] = 2] = "MONTHLY_PACKAGE";
|
|
3880
|
-
ServicePriceTypeEnum[ServicePriceTypeEnum["YEARLY"] = 3] = "YEARLY";
|
|
3881
|
-
ServicePriceTypeEnum[ServicePriceTypeEnum["YEARLY_PACKAGE"] = 4] = "YEARLY_PACKAGE";
|
|
3882
|
-
})(ServicePriceTypeEnum || (ServicePriceTypeEnum = {}));
|
|
3883
|
-
|
|
3884
3887
|
/**
|
|
3885
3888
|
* @TODO vik refactor
|
|
3886
3889
|
*/
|
|
@@ -3938,6 +3941,9 @@ class SubscriptionItemCollection extends Collection {
|
|
|
3938
3941
|
hasProduct(product) {
|
|
3939
3942
|
return !!this.findBy('price.product.id', product.id);
|
|
3940
3943
|
}
|
|
3944
|
+
getPrices() {
|
|
3945
|
+
return new ServicePriceCollection(this.mapBy('price'));
|
|
3946
|
+
}
|
|
3941
3947
|
}
|
|
3942
3948
|
|
|
3943
3949
|
class ServiceSubscriptionCollection extends Collection {
|
|
@@ -4866,6 +4872,9 @@ class ServiceSubscription extends ServiceSubscription$1 {
|
|
|
4866
4872
|
// Number of days after which the trial time will be expired
|
|
4867
4873
|
this.lastTrialDays = 4;
|
|
4868
4874
|
}
|
|
4875
|
+
get frequency() {
|
|
4876
|
+
return this.isAnnual() ? 'year' : 'month';
|
|
4877
|
+
}
|
|
4869
4878
|
get isTrial() {
|
|
4870
4879
|
return !this.stripeId;
|
|
4871
4880
|
}
|
|
@@ -4956,6 +4965,9 @@ class ServiceSubscription extends ServiceSubscription$1 {
|
|
|
4956
4965
|
isPackage() {
|
|
4957
4966
|
return this.items.length === ServiceProduct.quantity;
|
|
4958
4967
|
}
|
|
4968
|
+
isAnnual() {
|
|
4969
|
+
return !!(this.getItems().getPrices().annual.length || this.getItems().getPrices().annualPackage.length);
|
|
4970
|
+
}
|
|
4959
4971
|
/**
|
|
4960
4972
|
* Recommended number of properties to buy,
|
|
4961
4973
|
* based on the property service product and the number of properties the user has
|
|
@@ -7737,7 +7749,8 @@ const ENDPOINTS = {
|
|
|
7737
7749
|
PROPERTIES_SALES_GET: new Endpoint('GET', '\\/properties\\/sales'),
|
|
7738
7750
|
PROPERTIES_SUGGESTIONS_GET: new Endpoint('GET', '/property\\/\\w+\\/v2\\/.*$'),
|
|
7739
7751
|
PROPERTIES_VALUATIONS_DOCUMENTS_POST: new Endpoint('POST', '\\/properties\\/\\d+\\/valuations\\/\\d+\\/documents'),
|
|
7740
|
-
|
|
7752
|
+
// @TODO rename
|
|
7753
|
+
PRORATION_COST_POST: new Endpoint('PUT', '\\/service-subscriptions\\/\\d+\\/proration-cost'),
|
|
7741
7754
|
SALARY_FORECAST_GET: new Endpoint('GET', '\\/salary-forecasts'),
|
|
7742
7755
|
SALARY_FORECAST_POST: new Endpoint('POST', '\\/salary-forecasts'),
|
|
7743
7756
|
SALARY_FORECAST_PUT: new Endpoint('PUT', '\\/salary-forecasts'),
|
|
@@ -7745,11 +7758,9 @@ const ENDPOINTS = {
|
|
|
7745
7758
|
SERVICE_PRODUCTS_GET: new Endpoint('GET', '\\/service-products'),
|
|
7746
7759
|
SERVICE_PAYMENTS_GET: new Endpoint('GET', '\\/service-payments'),
|
|
7747
7760
|
SERVICE_SUBSCRIPTIONS_GET: new Endpoint('GET', '\\/service-subscriptions'),
|
|
7761
|
+
SERVICE_SUBSCRIPTIONS_CANCEL: new Endpoint('PUT', '\\/service-subscriptions\\/\\d+\\/cancel'),
|
|
7748
7762
|
SERVICE_PAYMENT_INVOICE_URL_GET: new Endpoint('GET', '\\/service-payments\\/\\d+\\/invoice-url'),
|
|
7749
|
-
|
|
7750
|
-
STRIPE_CHECKOUT_SESSION_POST: new Endpoint('POST', '\\/stripe\\/checkout-session'),
|
|
7751
|
-
SUBSCRIPTION_LAST_GET: new Endpoint('GET', '\\/subscriptions\\/last'),
|
|
7752
|
-
SUBSCRIPTION_ITEMS_PUT: new Endpoint('PUT', '\\/subscriptions\\/items'),
|
|
7763
|
+
SUBSCRIPTION_ITEMS_PUT: new Endpoint('PUT', '\\/service-subscriptions\\/\\d+\\/items'),
|
|
7753
7764
|
SOLE_BUSINESSES_GET: new Endpoint('GET', '\\/sole-businesses'),
|
|
7754
7765
|
SOLE_BUSINESSES_POST: new Endpoint('POST', '\\/sole-businesses'),
|
|
7755
7766
|
SOLE_BUSINESSES_PUT: new Endpoint('PUT', '\\/sole-businesses\\/\\d+'),
|
|
@@ -13381,6 +13392,7 @@ class SubscriptionService extends RestService$1 {
|
|
|
13381
13392
|
return this.getActive().pipe(map((subscriptions) => subscriptions.getTrials()));
|
|
13382
13393
|
}
|
|
13383
13394
|
/**
|
|
13395
|
+
* @TODO remove
|
|
13384
13396
|
* redirect to stripe payment page
|
|
13385
13397
|
*/
|
|
13386
13398
|
checkoutRedirect(subscription) {
|
|
@@ -13398,6 +13410,7 @@ class SubscriptionService extends RestService$1 {
|
|
|
13398
13410
|
});
|
|
13399
13411
|
}
|
|
13400
13412
|
/**
|
|
13413
|
+
* @TODO remove
|
|
13401
13414
|
* redirect to stripe billing page
|
|
13402
13415
|
*/
|
|
13403
13416
|
billingRedirect(returnUrl) {
|
|
@@ -13421,6 +13434,9 @@ class SubscriptionService extends RestService$1 {
|
|
|
13421
13434
|
changeSubscription(subscription) {
|
|
13422
13435
|
return this.http.put(`${this.environment.apiV2}/service-subscriptions/${subscription.id}`, subscription);
|
|
13423
13436
|
}
|
|
13437
|
+
cancel(subscription) {
|
|
13438
|
+
return this.http.put(`${this.environment.apiV2}/service-subscriptions/${subscription.id}/cancel`, {});
|
|
13439
|
+
}
|
|
13424
13440
|
listenSubscriptions() {
|
|
13425
13441
|
this.sseService.on(`serviceSubscriptions`)
|
|
13426
13442
|
.subscribe((serviceSubscription) => {
|
|
@@ -15899,8 +15915,8 @@ class AddressForm extends AbstractForm {
|
|
|
15899
15915
|
searchQuery: new FormControl(address.address ? address.nameLong : null, Validators.required),
|
|
15900
15916
|
type: new FormControl(address.type | AddressTypeEnum.STREET, Validators.required),
|
|
15901
15917
|
// Corelogic fields
|
|
15902
|
-
corelogicLocId: new FormControl(address.corelogicLocId
|
|
15903
|
-
corelogicRefId: new FormControl(address.corelogicRefId
|
|
15918
|
+
corelogicLocId: new FormControl(address.corelogicLocId),
|
|
15919
|
+
corelogicRefId: new FormControl(address.corelogicRefId),
|
|
15904
15920
|
// manual fields
|
|
15905
15921
|
unitNumber: new FormControl({ value: address.unitNumber, disabled: true }),
|
|
15906
15922
|
address: new FormControl({ value: address.address, disabled: true }, Validators.required),
|