@esolve/ng-esolve-connect 0.21.2 → 0.22.2

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 (35) hide show
  1. package/esm2020/lib/cart/index.mjs +2 -1
  2. package/esm2020/lib/stock/classes/esolve-stock-item-base.model.mjs +2 -2
  3. package/esm2020/lib/stock/classes/esolve-stock-price.model.mjs +8 -2
  4. package/esm2020/lib/wishlist/classes/esolve-empty-wishlist-result.model.mjs +4 -0
  5. package/esm2020/lib/wishlist/classes/esolve-wishlist-item.model.mjs +14 -0
  6. package/esm2020/lib/wishlist/classes/index.mjs +3 -0
  7. package/esm2020/lib/wishlist/esolve-wishlist.service.mjs +116 -0
  8. package/esm2020/lib/wishlist/index.mjs +6 -0
  9. package/esm2020/lib/wishlist/interfaces/esolve-wishlist-item-record.interface.mjs +2 -0
  10. package/esm2020/lib/wishlist/interfaces/esolve-wishlist-item-response.interface.mjs +2 -0
  11. package/esm2020/lib/wishlist/interfaces/esolve-wishlist-set-item.interface.mjs +2 -0
  12. package/esm2020/lib/wishlist/interfaces/index.mjs +4 -0
  13. package/esm2020/lib/wishlist/types/esolve-wishlist-set-action.type.mjs +2 -0
  14. package/esm2020/lib/wishlist/types/esolve-wishlist.type.mjs +2 -0
  15. package/esm2020/lib/wishlist/types/index.mjs +3 -0
  16. package/esm2020/public-api.mjs +3 -1
  17. package/fesm2015/esolve-ng-esolve-connect.mjs +137 -3
  18. package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
  19. package/fesm2020/esolve-ng-esolve-connect.mjs +135 -3
  20. package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
  21. package/lib/stock/classes/esolve-stock-price.model.d.ts +10 -1
  22. package/lib/wishlist/classes/esolve-empty-wishlist-result.model.d.ts +3 -0
  23. package/lib/wishlist/classes/esolve-wishlist-item.model.d.ts +13 -0
  24. package/lib/wishlist/classes/index.d.ts +2 -0
  25. package/lib/wishlist/esolve-wishlist.service.d.ts +54 -0
  26. package/lib/wishlist/index.d.ts +4 -0
  27. package/lib/wishlist/interfaces/esolve-wishlist-item-record.interface.d.ts +13 -0
  28. package/lib/wishlist/interfaces/esolve-wishlist-item-response.interface.d.ts +6 -0
  29. package/lib/wishlist/interfaces/esolve-wishlist-set-item.interface.d.ts +7 -0
  30. package/lib/wishlist/interfaces/index.d.ts +3 -0
  31. package/lib/wishlist/types/esolve-wishlist-set-action.type.d.ts +1 -0
  32. package/lib/wishlist/types/esolve-wishlist.type.d.ts +2 -0
  33. package/lib/wishlist/types/index.d.ts +2 -0
  34. package/package.json +1 -1
  35. package/public-api.d.ts +1 -0
@@ -18,6 +18,10 @@ export declare class EsolveStockPrice {
18
18
  * Price with tax and with discounts applied if applicable
19
19
  */
20
20
  sell_price_with_tax: number;
21
+ /**
22
+ * Vat Rate for the item
23
+ */
24
+ tax_rate: number;
21
25
  taxed: boolean;
22
26
  /**
23
27
  * Create stock price instance
@@ -26,6 +30,7 @@ export declare class EsolveStockPrice {
26
30
  * @param base_price_with_tax Price with tax
27
31
  * @param sell_price Price without tax and with discounts applied if applicable
28
32
  * @param sell_price_with_tax Price with tax and with discounts applied if applicable
33
+ * @param tax_rate Tax rate of the item
29
34
  * @param taxed Whether tax has been applied
30
35
  */
31
36
  constructor(
@@ -44,5 +49,9 @@ export declare class EsolveStockPrice {
44
49
  /**
45
50
  * Price with tax and with discounts applied if applicable
46
51
  */
47
- sell_price_with_tax?: number, taxed?: boolean);
52
+ sell_price_with_tax?: number,
53
+ /**
54
+ * Vat Rate for the item
55
+ */
56
+ tax_rate?: number, taxed?: boolean);
48
57
  }
@@ -0,0 +1,3 @@
1
+ import { EsolveResponseResult } from '../../shared/response';
2
+ export declare class EsolveEmptyWishlistResult extends EsolveResponseResult {
3
+ }
@@ -0,0 +1,13 @@
1
+ import { EsolveStockItem } from '../../stock';
2
+ export declare class EsolveWishlistItem {
3
+ id: number;
4
+ qty: number;
5
+ vat_rate: number;
6
+ price: number;
7
+ price_incl: number;
8
+ vat_total: number;
9
+ total: number;
10
+ total_incl: number;
11
+ stock_item?: EsolveStockItem<import("@esolve/ng-esolve-connect").EsolveCustomFields> | undefined;
12
+ constructor(id: number, qty: number, vat_rate: number, price: number, price_incl: number, vat_total: number, total: number, total_incl: number, stock_item?: EsolveStockItem<import("@esolve/ng-esolve-connect").EsolveCustomFields> | undefined);
13
+ }
@@ -0,0 +1,2 @@
1
+ export * from './esolve-wishlist-item.model';
2
+ export * from './esolve-empty-wishlist-result.model';
@@ -0,0 +1,54 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { EsolveConnectConfig } from '../esolve-connect.config';
4
+ import { EsolveResponseHandlerService } from '../shared/response';
5
+ import { EsolveErrorHandlerService } from '../shared/errors';
6
+ import { EsolveWishlistSetItem } from './interfaces';
7
+ import { EsolveWishlist, EsolveWishlistSetAction } from './types';
8
+ import { EsolveEmptyWishlistResult } from './classes';
9
+ import { EsolveWishlistItemResponse } from './interfaces';
10
+ import * as i0 from "@angular/core";
11
+ export declare class EsolveWishlistService {
12
+ private config;
13
+ private http;
14
+ private errorHandler;
15
+ private responseHandler;
16
+ constructor(config: EsolveConnectConfig, http: HttpClient, errorHandler: EsolveErrorHandlerService, responseHandler: EsolveResponseHandlerService);
17
+ /**
18
+ * Retrieves the current wishlist
19
+ *
20
+ * @returns An `Observable` with an array of cart items
21
+ */
22
+ getWishlist(): Observable<EsolveWishlist>;
23
+ /**
24
+ * Updates the wishlist by preforming various actions, such as adding, editing or removing items from the list.
25
+ *
26
+ * @param items An array of options to update the wishlist
27
+ * @param default_action The default action to preform
28
+ *
29
+ * @returns An `Observable` with an array of responses that gives feedback on the requested changes
30
+ */
31
+ setWishlist(items: EsolveWishlistSetItem[], default_action?: EsolveWishlistSetAction): Observable<EsolveWishlistItemResponse[]>;
32
+ /**
33
+ * Empties the wishlist for the logged in user.
34
+ *
35
+ * @returns Observable of type EsolveEmptyWishlistResult
36
+ */
37
+ setWishlistEmpty(): Observable<EsolveEmptyWishlistResult>;
38
+ /**
39
+ * Processes the eSolve wishlist records
40
+ *
41
+ * @param wishlist_item_records Records to process
42
+ *
43
+ * @returns An array of processed cart items
44
+ */
45
+ private processWishlist;
46
+ /**
47
+ * Retrieves stock records from HTTP params.
48
+ *
49
+ * @param params HTTP client parameters
50
+ */
51
+ private getWishlistRecords;
52
+ static ɵfac: i0.ɵɵFactoryDeclaration<EsolveWishlistService, never>;
53
+ static ɵprov: i0.ɵɵInjectableDeclaration<EsolveWishlistService>;
54
+ }
@@ -0,0 +1,4 @@
1
+ export * from './types';
2
+ export * from './classes';
3
+ export * from './interfaces';
4
+ export * from './esolve-wishlist.service';
@@ -0,0 +1,13 @@
1
+ import { EsolveStockRecord } from '../../stock';
2
+ export interface EsolveWishlistItemRecord {
3
+ id: number;
4
+ qty: number;
5
+ vat_rate: number;
6
+ price: number;
7
+ price_description: string;
8
+ price_incl: number;
9
+ vat_total: number;
10
+ line_total: number;
11
+ line_total_incl: number;
12
+ stock_item: EsolveStockRecord;
13
+ }
@@ -0,0 +1,6 @@
1
+ import { EsolvePostResponseItem } from '../../shared/response';
2
+ export interface EsolveWishlistItemResponse extends EsolvePostResponseItem {
3
+ esolve_id: number;
4
+ updated: boolean;
5
+ current_qty: number;
6
+ }
@@ -0,0 +1,7 @@
1
+ import { EsolveWishlistSetAction } from '../types';
2
+ export interface EsolveWishlistSetItem {
3
+ code: string;
4
+ id?: number;
5
+ qty?: number;
6
+ action?: EsolveWishlistSetAction;
7
+ }
@@ -0,0 +1,3 @@
1
+ export * from './esolve-wishlist-item-record.interface';
2
+ export * from './esolve-wishlist-item-response.interface';
3
+ export * from './esolve-wishlist-set-item.interface';
@@ -0,0 +1 @@
1
+ export declare type EsolveWishlistSetAction = 'add' | 'edit' | 'remove';
@@ -0,0 +1,2 @@
1
+ import { EsolveWishlistItem } from '../classes';
2
+ export declare type EsolveWishlist = EsolveWishlistItem[];
@@ -0,0 +1,2 @@
1
+ export * from './esolve-wishlist-set-action.type';
2
+ export * from './esolve-wishlist.type';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esolve/ng-esolve-connect",
3
- "version": "0.21.2",
3
+ "version": "0.22.2",
4
4
  "description": "An Angular library that speaks to an eSolve instance's API",
5
5
  "ng-add": {
6
6
  "save": "true"
package/public-api.d.ts CHANGED
@@ -31,3 +31,4 @@ export * from './lib/payment';
31
31
  export * from './lib/shipping';
32
32
  export * from './lib/locations';
33
33
  export * from './lib/enquiry';
34
+ export * from './lib/wishlist';