taxtank-core 0.29.15 → 0.29.18

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.
Files changed (39) hide show
  1. package/bundles/taxtank-core.umd.js +151 -32
  2. package/bundles/taxtank-core.umd.js.map +1 -1
  3. package/esm2015/lib/collections/report/property/property-report-item-depreciation.collection.js +2 -2
  4. package/esm2015/lib/collections/subscription/index.js +4 -1
  5. package/esm2015/lib/collections/subscription/service-price.collection.js +7 -0
  6. package/esm2015/lib/collections/subscription/service-product.collection.js +8 -0
  7. package/esm2015/lib/collections/subscription/service-subscription.collection.js +17 -1
  8. package/esm2015/lib/collections/subscription/subscription-item.collection.js +4 -1
  9. package/esm2015/lib/db/Models/user/client-income-types.js +3 -3
  10. package/esm2015/lib/models/endpoint/endpoints.const.js +3 -1
  11. package/esm2015/lib/models/index.js +2 -1
  12. package/esm2015/lib/models/service-subscription/index.js +6 -0
  13. package/esm2015/lib/models/service-subscription/service-product.js +6 -1
  14. package/esm2015/lib/models/service-subscription/service-subscription.js +12 -2
  15. package/esm2015/lib/services/http/property/property.service.js +1 -2
  16. package/esm2015/lib/services/http/rest/rest.service.js +2 -2
  17. package/esm2015/lib/services/http/subscription/index.js +2 -1
  18. package/esm2015/lib/services/http/subscription/service-price/service-price.service.js +8 -5
  19. package/esm2015/lib/services/http/subscription/service-product/service-product.service.js +24 -0
  20. package/esm2015/lib/services/http/subscription/service-subscription/subscription.service.js +10 -2
  21. package/esm2015/lib/services/http/user/user.service.js +17 -1
  22. package/fesm2015/taxtank-core.js +119 -28
  23. package/fesm2015/taxtank-core.js.map +1 -1
  24. package/lib/collections/subscription/index.d.ts +3 -0
  25. package/lib/collections/subscription/service-price.collection.d.ts +5 -0
  26. package/lib/collections/subscription/service-product.collection.d.ts +5 -0
  27. package/lib/collections/subscription/service-subscription.collection.d.ts +4 -0
  28. package/lib/collections/subscription/subscription-item.collection.d.ts +2 -1
  29. package/lib/db/Models/user/client-income-types.d.ts +2 -2
  30. package/lib/models/index.d.ts +1 -0
  31. package/lib/models/service-subscription/index.d.ts +5 -0
  32. package/lib/models/service-subscription/service-subscription.d.ts +4 -0
  33. package/lib/services/http/rest/rest.service.d.ts +1 -1
  34. package/lib/services/http/subscription/index.d.ts +1 -0
  35. package/lib/services/http/subscription/service-price/service-price.service.d.ts +9 -6
  36. package/lib/services/http/subscription/service-product/service-product.service.d.ts +14 -0
  37. package/lib/services/http/subscription/service-subscription/subscription.service.d.ts +1 -0
  38. package/lib/services/http/user/user.service.d.ts +11 -0
  39. package/package.json +1 -1
@@ -1 +1,4 @@
1
+ export * from './service-price.collection';
2
+ export * from './service-product.collection';
1
3
  export * from './service-subscription.collection';
4
+ export * from './subscription-item.collection';
@@ -0,0 +1,5 @@
1
+ import { Collection } from '../collection';
2
+ import { ServicePrice } from '../../models';
3
+ export declare class ServicePriceCollection extends Collection<ServicePrice> {
4
+ getActive(): this;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { Collection } from '../collection';
2
+ import { ServiceProduct } from '../../models';
3
+ export declare class ServiceProductCollection extends Collection<ServiceProduct> {
4
+ getActive(): this;
5
+ }
@@ -1,6 +1,7 @@
1
1
  import { Collection } from '../collection';
2
2
  import { ServiceSubscription } from '../../models/service-subscription/service-subscription';
3
3
  import { SubscriptionItemCollection } from './subscription-item.collection';
4
+ import { Dictionary, ServiceProduct } from '../../models';
4
5
  export declare class ServiceSubscriptionCollection extends Collection<ServiceSubscription> {
5
6
  getActive(): this;
6
7
  getTrials(): this;
@@ -9,4 +10,7 @@ export declare class ServiceSubscriptionCollection extends Collection<ServiceSub
9
10
  getPaid(): this;
10
11
  getActivePaid(): ServiceSubscription;
11
12
  getItems(): SubscriptionItemCollection;
13
+ groupByProduct(products: Collection<ServiceProduct>): Dictionary<ServiceSubscription>;
14
+ findByProduct(product: ServiceProduct): ServiceSubscription;
15
+ hasPropertyTank(): boolean;
12
16
  }
@@ -1,6 +1,7 @@
1
1
  import { Collection } from '../collection';
2
- import { ServiceSubscriptionItem } from '../../models/service-subscription/service-subscription-item';
2
+ import { ServiceProduct, ServiceSubscriptionItem } from '../../models';
3
3
  export declare class SubscriptionItemCollection extends Collection<ServiceSubscriptionItem> {
4
4
  get propertiesItem(): ServiceSubscriptionItem;
5
5
  get propertyQuantity(): number;
6
+ hasProduct(product: ServiceProduct): boolean;
6
7
  }
@@ -1,6 +1,6 @@
1
1
  import { ClientDetails } from './client-details';
2
- import { AbstractModel } from '../abstract-model';
3
- export declare class ClientIncomeTypes extends AbstractModel {
2
+ import { ObservableModel } from '../observable-model';
3
+ export declare class ClientIncomeTypes extends ObservableModel {
4
4
  salary?: boolean;
5
5
  property?: boolean;
6
6
  sole?: boolean;
@@ -10,6 +10,7 @@ export * from './file';
10
10
  export * from './financial-year';
11
11
  export * from './loan';
12
12
  export * from './notification';
13
+ export * from './service-subscription';
13
14
  export * from './sole';
14
15
  export * from './vehicle';
15
16
  export * from './document';
@@ -0,0 +1,5 @@
1
+ export * from './service-payment';
2
+ export * from './service-price';
3
+ export * from './service-product';
4
+ export * from './service-subscription';
5
+ export * from './service-subscription-item';
@@ -1,11 +1,13 @@
1
1
  import { ServiceSubscription as ServiceSubscriptionBase } from '../../db/Models/subscription/service-subscription';
2
2
  import { ServiceSubscriptionItem } from './service-subscription-item';
3
+ import { ServiceProduct } from './service-product';
3
4
  export declare class ServiceSubscription extends ServiceSubscriptionBase {
4
5
  startDate: Date;
5
6
  endDate: Date;
6
7
  items: ServiceSubscriptionItem[];
7
8
  lastTrialDays: number;
8
9
  get isTrial(): boolean;
10
+ get isPaid(): boolean;
9
11
  get price(): number;
10
12
  /**
11
13
  * get title of subscription
@@ -27,6 +29,7 @@ export declare class ServiceSubscription extends ServiceSubscriptionBase {
27
29
  */
28
30
  get workTankItem(): ServiceSubscriptionItem;
29
31
  get soleTankItem(): ServiceSubscriptionItem;
32
+ get propertyTankItem(): ServiceSubscriptionItem;
30
33
  hasPropertyTank(): boolean;
31
34
  hasWorkTank(): boolean;
32
35
  /**
@@ -42,6 +45,7 @@ export declare class ServiceSubscription extends ServiceSubscriptionBase {
42
45
  * Check if current subscription has provided subscription item
43
46
  */
44
47
  hasItem(itemToCheck: ServiceSubscriptionItem): boolean;
48
+ hasProduct(product: ServiceProduct): boolean;
45
49
  /**
46
50
  * Recommended number of properties to buy,
47
51
  * based on the property service product and the number of properties the user has
@@ -115,7 +115,7 @@ export declare abstract class RestService<BaseModel extends AbstractModel, Model
115
115
  /**
116
116
  * Subscribe to http events and run callback.
117
117
  * CSE - Cleint Sent Events
118
- * @param type The class whose changes should be listened for
118
+ * @param modelClass
119
119
  * @param methods The list of http methods should be listened for
120
120
  * @param callback The function to be called when event triggered
121
121
  */
@@ -1,3 +1,4 @@
1
1
  export * from './service-price/service-price.service';
2
2
  export * from './service-payment/service-payment.service';
3
3
  export * from './service-subscription/subscription.service';
4
+ export * from './service-product/service-product.service';
@@ -1,14 +1,17 @@
1
- import { ServicePrice as ServicePriceBase } from '../../../../db/Models/subscription/service-price';
2
- import { ServicePrice } from '../../../../models/service-subscription/service-price';
3
- import { RestService } from '../../rest/rest-old.service';
1
+ import { ServicePrice as ServicePriceBase } from '../../../../db/Models';
2
+ import { ServicePrice } from '../../../../models';
3
+ import { RestMethod, RestService } from '../../rest';
4
+ import { ServicePriceCollection } from '../../../../collections';
4
5
  import * as i0 from "@angular/core";
5
6
  /**
6
7
  * Service that handling banks logic
7
8
  */
8
- export declare class ServicePriceService extends RestService<ServicePriceBase, ServicePrice> {
9
+ export declare class ServicePriceService extends RestService<ServicePriceBase, ServicePrice, ServicePriceCollection> {
10
+ protected endpointUri: string;
9
11
  modelClass: typeof ServicePrice;
10
- url: string;
11
- isHydra: boolean;
12
+ isApiPlatform: boolean;
13
+ collectionClass: typeof ServicePriceCollection;
14
+ disabledMethods: RestMethod[];
12
15
  static ɵfac: i0.ɵɵFactoryDeclaration<ServicePriceService, never>;
13
16
  static ɵprov: i0.ɵɵInjectableDeclaration<ServicePriceService>;
14
17
  }
@@ -0,0 +1,14 @@
1
+ import { RestMethod, RestService } from '../../rest';
2
+ import { ServiceProduct as ServiceProductBase } from '../../../../db/Models';
3
+ import { ServiceProduct } from '../../../../models';
4
+ import { ServiceProductCollection } from '../../../../collections';
5
+ import * as i0 from "@angular/core";
6
+ export declare class ServiceProductService extends RestService<ServiceProductBase, ServiceProduct, ServiceProductCollection> {
7
+ collectionClass: typeof ServiceProductCollection;
8
+ modelClass: typeof ServiceProduct;
9
+ protected endpointUri: string;
10
+ disabledMethods: RestMethod[];
11
+ isApiPlatform: boolean;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<ServiceProductService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<ServiceProductService>;
14
+ }
@@ -23,6 +23,7 @@ export declare class SubscriptionService extends RestService<ServiceSubscription
23
23
  collectionClass: typeof ServiceSubscriptionCollection;
24
24
  disabledMethods: RestMethod[];
25
25
  constructor(http: HttpClient, eventDispatcherService: EventDispatcherService, sseService: SseService, toastService: ToastService, environment: any);
26
+ startTrial(subscription: ServiceSubscription): Observable<ServiceSubscription>;
26
27
  getActive(): Observable<ServiceSubscriptionCollection>;
27
28
  getTrials(): Observable<ServiceSubscriptionCollection>;
28
29
  getActiveTrials(): Observable<ServiceSubscriptionCollection>;
@@ -4,6 +4,8 @@ import { User } from '../../../models';
4
4
  import { EventDispatcherService, SseService } from '../../event';
5
5
  import { JwtService } from '../../auth';
6
6
  import { IEventListener } from '../../../interfaces';
7
+ import { ObservableModel } from '../../../db/Models';
8
+ import { HttpMethod } from '../rest';
7
9
  import * as i0 from "@angular/core";
8
10
  /**
9
11
  * Service to work with user
@@ -81,6 +83,15 @@ export declare class UserService implements IEventListener {
81
83
  * capital losses updates on property sale
82
84
  */
83
85
  private listenPropertySale;
86
+ /**
87
+ * @TODO remove when the class refactored on RestService
88
+ * Subscribe to http events and run callback.
89
+ * CSE - Cleint Sent Events
90
+ * @param modelClass
91
+ * @param methods The list of http methods should be listened for
92
+ * @param callback The function to be called when event triggered
93
+ */
94
+ protected listenCSE(modelClass: typeof ObservableModel, methods: HttpMethod[], callback: Function): void;
84
95
  static ɵfac: i0.ɵɵFactoryDeclaration<UserService, never>;
85
96
  static ɵprov: i0.ɵɵInjectableDeclaration<UserService>;
86
97
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taxtank-core",
3
- "version": "0.29.15",
3
+ "version": "0.29.18",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^12.2.3 || ~13.0.0",