taxtank-core 0.29.18 → 0.29.20

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.
@@ -1,5 +1,15 @@
1
1
  import { Collection } from '../collection';
2
2
  import { ServicePrice } from '../../models';
3
+ /**
4
+ * @TODO vik refactor
5
+ */
3
6
  export declare class ServicePriceCollection extends Collection<ServicePrice> {
4
7
  getActive(): this;
8
+ get monthly(): this;
9
+ get monthlyPackage(): this;
10
+ get monthlyPackageSum(): number;
11
+ get annual(): this;
12
+ get annualPackage(): this;
13
+ get annualPackageSum(): number;
14
+ getProperty(isAnnual: boolean, isPackage: boolean): ServicePrice;
5
15
  }
@@ -1,4 +1,7 @@
1
1
  export declare enum ServicePriceTypeEnum {
2
- ONE_TIME = 1,
3
- RECURRING = 2
2
+ DEPRECATED = 0,
3
+ MONTHLY = 1,
4
+ MONTHLY_PACKAGE = 2,
5
+ YEARLY = 3,
6
+ YEARLY_PACKAGE = 4
4
7
  }
@@ -6,6 +6,7 @@ export declare class ServicePrice extends AbstractModel {
6
6
  id?: number;
7
7
  stripeId?: string;
8
8
  amount?: number;
9
+ isRecurring?: boolean;
9
10
  type?: ServicePriceTypeEnum;
10
11
  recurringInterval?: ServicePriceRecurringIntervalEnum;
11
12
  recurringIntervalCount?: number;
@@ -1,5 +1,6 @@
1
1
  import { ServiceProduct as BaseServiceProduct } from '../../db/Models/subscription/service-product';
2
2
  export declare class ServiceProduct extends BaseServiceProduct {
3
+ static quantity: number;
3
4
  isProperties(): boolean;
4
5
  isWorkTank(): boolean;
5
6
  isSoleTank(): boolean;
@@ -1,6 +1,7 @@
1
1
  import { ServiceSubscription as ServiceSubscriptionBase } from '../../db/Models/subscription/service-subscription';
2
2
  import { ServiceSubscriptionItem } from './service-subscription-item';
3
3
  import { ServiceProduct } from './service-product';
4
+ import { SubscriptionItemCollection } from '../../collections';
4
5
  export declare class ServiceSubscription extends ServiceSubscriptionBase {
5
6
  startDate: Date;
6
7
  endDate: Date;
@@ -24,6 +25,7 @@ export declare class ServiceSubscription extends ServiceSubscriptionBase {
24
25
  isTrialExpired(): boolean;
25
26
  isTrialExpiring(): boolean;
26
27
  isRenewable(): boolean;
28
+ getItems(): SubscriptionItemCollection;
27
29
  /**
28
30
  * @TODO move to collection
29
31
  */
@@ -46,6 +48,7 @@ export declare class ServiceSubscription extends ServiceSubscriptionBase {
46
48
  */
47
49
  hasItem(itemToCheck: ServiceSubscriptionItem): boolean;
48
50
  hasProduct(product: ServiceProduct): boolean;
51
+ isPackage(): boolean;
49
52
  /**
50
53
  * Recommended number of properties to buy,
51
54
  * based on the property service product and the number of properties the user has
@@ -2,7 +2,6 @@ import { HttpClient } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
3
  import { ServiceSubscription } from '../../../../models/service-subscription/service-subscription';
4
4
  import { EventDispatcherService, SseService } from '../../../event';
5
- import { ServiceSubscriptionItem } from '../../../../models/service-subscription/service-subscription-item';
6
5
  import { ToastService } from '../../../toast';
7
6
  import { RestMethod, RestService } from '../../rest';
8
7
  import { ServiceSubscription as ServiceSubscriptionBase } from '../../../../db/Models';
@@ -38,11 +37,11 @@ export declare class SubscriptionService extends RestService<ServiceSubscription
38
37
  /**
39
38
  * Get difference between current subscription and selected new subscription
40
39
  */
41
- getProrationCost(items: ServiceSubscriptionItem[]): Observable<number>;
40
+ getProrationCost(subscription: ServiceSubscription): Observable<number>;
42
41
  /**
43
42
  * Change subscription plan
44
43
  */
45
- changeSubscription(items: ServiceSubscriptionItem[]): Observable<object>;
44
+ changeSubscription(subscription: ServiceSubscription): Observable<object>;
46
45
  private listenSubscriptions;
47
46
  static ɵfac: i0.ɵɵFactoryDeclaration<SubscriptionService, never>;
48
47
  static ɵprov: i0.ɵɵInjectableDeclaration<SubscriptionService>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.29.18",
3
+ "version": "0.29.20",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",