@esolve/ng-esolve-connect 0.26.3 → 0.27.0
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/esm2020/lib/account/esolve-account.service.mjs +3 -12
- package/esm2020/lib/account/user-account/classes/esolve-statement-ageing.model.mjs +9 -0
- package/esm2020/lib/account/user-account/classes/esolve-statement-balances.model.mjs +10 -0
- package/esm2020/lib/account/user-account/classes/esolve-statement-transaction.model.mjs +15 -0
- package/esm2020/lib/account/user-account/classes/esolve-statement.model.mjs +11 -0
- package/esm2020/lib/account/user-account/classes/esolve-user-account-business.model.mjs +11 -0
- package/esm2020/lib/account/user-account/classes/esolve-user-account-contact.model.mjs +10 -0
- package/esm2020/lib/account/user-account/classes/esolve-user-account-result.model.mjs +9 -0
- package/esm2020/lib/account/user-account/classes/esolve-user-account.model.mjs +22 -0
- package/esm2020/lib/account/user-account/classes/esolve-user-client-account-balances.model.mjs +13 -0
- package/esm2020/lib/account/user-account/classes/esolve-user-client-account.model.mjs +46 -0
- package/esm2020/lib/account/user-account/classes/index.mjs +7 -0
- package/esm2020/lib/account/user-account/index.mjs +3 -11
- package/esm2020/lib/account/user-account/interfaces/esolve-statement-ageing-record.interface.mjs +2 -0
- package/esm2020/lib/account/user-account/interfaces/esolve-statement-balances-record.interface.mjs +2 -0
- package/esm2020/lib/account/user-account/interfaces/esolve-statement-record.interface.mjs +2 -0
- package/esm2020/lib/account/user-account/interfaces/esolve-statement-transaction-record.interface.mjs +2 -0
- package/esm2020/lib/account/user-account/interfaces/esolve-user-account-data.interface.mjs +2 -0
- package/esm2020/lib/account/user-account/interfaces/esolve-user-account-record.interface.mjs +2 -0
- package/esm2020/lib/account/user-account/interfaces/esolve-user-client-account-balances-record.interface.mjs +2 -0
- package/esm2020/lib/account/user-account/interfaces/esolve-user-client-account-record.interface.mjs +2 -0
- package/esm2020/lib/account/user-account/interfaces/index.mjs +9 -0
- package/esm2020/lib/cart/esolve-cart.service.mjs +16 -5
- package/esm2020/lib/coupons/classes/esolve-coupon.model.mjs +29 -0
- package/esm2020/lib/coupons/classes/index.mjs +2 -0
- package/esm2020/lib/coupons/esolve-coupons.service.mjs +183 -0
- package/esm2020/lib/coupons/index.mjs +9 -0
- package/esm2020/lib/coupons/interfaces/esolve-coupon-record.interface.mjs +2 -0
- package/esm2020/lib/coupons/interfaces/esolve-coupon-validation-error.interface.mjs +2 -0
- package/esm2020/lib/coupons/interfaces/esolve-coupon-validation-result.interface.mjs +3 -0
- package/esm2020/lib/coupons/interfaces/esolve-coupon-validation.interface.mjs +2 -0
- package/esm2020/lib/coupons/interfaces/index.mjs +5 -0
- package/esm2020/lib/coupons/types/esolve-coupons-cache.type.mjs +2 -0
- package/esm2020/lib/coupons/types/index.mjs +2 -0
- package/esm2020/lib/esolve-connect.config.mjs +1 -1
- package/esm2020/lib/stock/classes/esolve-stock-item-base.model.mjs +7 -1
- package/esm2020/lib/stock/classes/esolve-stock-transaction-history.model.mjs +7 -0
- package/esm2020/lib/stock/esolve-stock.service.mjs +59 -2
- package/esm2020/lib/stock/interfaces/esolve-stock-base-record.interface.mjs +1 -1
- package/esm2020/public-api.mjs +3 -1
- package/fesm2015/esolve-ng-esolve-connect.mjs +433 -87
- package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
- package/fesm2020/esolve-ng-esolve-connect.mjs +417 -83
- package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
- package/lib/account/esolve-account.service.d.ts +1 -2
- package/lib/account/user-account/classes/esolve-statement-ageing.model.d.ts +6 -0
- package/lib/account/user-account/classes/esolve-statement-balances.model.d.ts +7 -0
- package/lib/account/user-account/classes/esolve-statement-transaction.model.d.ts +12 -0
- package/lib/account/user-account/classes/esolve-statement.model.d.ts +8 -0
- package/lib/account/user-account/classes/esolve-user-account-business.model.d.ts +8 -0
- package/lib/account/user-account/classes/esolve-user-account-contact.model.d.ts +7 -0
- package/lib/account/user-account/{esolve-user-account-result.model.d.ts → classes/esolve-user-account-result.model.d.ts} +1 -1
- package/lib/account/user-account/classes/esolve-user-account.model.d.ts +19 -0
- package/lib/account/user-account/{esolve-user-client-account-balances.model.d.ts → classes/esolve-user-client-account-balances.model.d.ts} +1 -1
- package/lib/account/user-account/classes/esolve-user-client-account.model.d.ts +43 -0
- package/lib/account/user-account/classes/index.d.ts +6 -0
- package/lib/account/user-account/index.d.ts +2 -10
- package/lib/account/user-account/interfaces/esolve-statement-ageing-record.interface.d.ts +4 -0
- package/lib/account/user-account/interfaces/esolve-statement-balances-record.interface.d.ts +5 -0
- package/lib/account/user-account/interfaces/esolve-statement-record.interface.d.ts +6 -0
- package/lib/account/user-account/interfaces/esolve-statement-transaction-record.interface.d.ts +10 -0
- package/lib/account/user-account/{esolve-user-account-data.interface.d.ts → interfaces/esolve-user-account-data.interface.d.ts} +0 -0
- package/lib/account/user-account/{esolve-user-account-record.interface.d.ts → interfaces/esolve-user-account-record.interface.d.ts} +0 -0
- package/lib/account/user-account/{esolve-user-client-account-balances-record.interface.d.ts → interfaces/esolve-user-client-account-balances-record.interface.d.ts} +1 -1
- package/lib/account/user-account/{esolve-user-client-account-record.interface.d.ts → interfaces/esolve-user-client-account-record.interface.d.ts} +2 -0
- package/lib/account/user-account/interfaces/index.d.ts +8 -0
- package/lib/cart/esolve-cart.service.d.ts +5 -1
- package/lib/coupons/classes/esolve-coupon.model.d.ts +20 -0
- package/lib/coupons/classes/index.d.ts +1 -0
- package/lib/coupons/esolve-coupons.service.d.ts +35 -0
- package/lib/coupons/index.d.ts +4 -0
- package/lib/coupons/interfaces/esolve-coupon-record.interface.d.ts +8 -0
- package/lib/coupons/interfaces/esolve-coupon-validation-error.interface.d.ts +4 -0
- package/lib/coupons/interfaces/esolve-coupon-validation-result.interface.d.ts +4 -0
- package/lib/coupons/interfaces/esolve-coupon-validation.interface.d.ts +6 -0
- package/lib/coupons/interfaces/index.d.ts +4 -0
- package/lib/coupons/types/esolve-coupons-cache.type.d.ts +1 -0
- package/lib/coupons/types/index.d.ts +1 -0
- package/lib/esolve-connect.config.d.ts +4 -0
- package/lib/stock/classes/esolve-stock-item-base.model.d.ts +5 -0
- package/lib/stock/classes/esolve-stock-transaction-history.model.d.ts +5 -0
- package/lib/stock/esolve-stock.service.d.ts +11 -0
- package/lib/stock/interfaces/esolve-stock-base-record.interface.d.ts +2 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/esm2020/lib/account/user-account/esolve-user-account-business.model.mjs +0 -9
- package/esm2020/lib/account/user-account/esolve-user-account-contact.model.mjs +0 -8
- package/esm2020/lib/account/user-account/esolve-user-account-data.interface.mjs +0 -2
- package/esm2020/lib/account/user-account/esolve-user-account-record.interface.mjs +0 -2
- package/esm2020/lib/account/user-account/esolve-user-account-result.model.mjs +0 -9
- package/esm2020/lib/account/user-account/esolve-user-account.model.mjs +0 -14
- package/esm2020/lib/account/user-account/esolve-user-client-account-balances-record.interface.mjs +0 -2
- package/esm2020/lib/account/user-account/esolve-user-client-account-balances.model.mjs +0 -13
- package/esm2020/lib/account/user-account/esolve-user-client-account-record.interface.mjs +0 -2
- package/esm2020/lib/account/user-account/esolve-user-client-account.model.mjs +0 -42
- package/lib/account/user-account/esolve-user-account-business.model.d.ts +0 -7
- package/lib/account/user-account/esolve-user-account-contact.model.d.ts +0 -6
- package/lib/account/user-account/esolve-user-account.model.d.ts +0 -20
- package/lib/account/user-account/esolve-user-client-account.model.d.ts +0 -40
|
@@ -5,7 +5,7 @@ import * as i1$2 from '@angular/common/http';
|
|
|
5
5
|
import { HTTP_INTERCEPTORS, HttpClientModule, HttpErrorResponse, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
6
6
|
import * as i1 from 'ngx-cookie-service';
|
|
7
7
|
import { CookieService } from 'ngx-cookie-service';
|
|
8
|
-
import { BehaviorSubject, throwError, of, iif } from 'rxjs';
|
|
8
|
+
import { BehaviorSubject, throwError, of, Subject, firstValueFrom, iif } from 'rxjs';
|
|
9
9
|
import * as i1$1 from '@angular/platform-browser';
|
|
10
10
|
import { map, catchError, tap, switchMap } from 'rxjs/operators';
|
|
11
11
|
import { __awaiter } from 'tslib';
|
|
@@ -1873,17 +1873,26 @@ class EsolveAddressResult extends EsolveResponseResult {
|
|
|
1873
1873
|
}
|
|
1874
1874
|
}
|
|
1875
1875
|
|
|
1876
|
-
class
|
|
1877
|
-
constructor(
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1876
|
+
class EsolveUserAccountBusiness {
|
|
1877
|
+
constructor(record) {
|
|
1878
|
+
var _a, _b, _c, _d;
|
|
1879
|
+
if (record) {
|
|
1880
|
+
this.name = (_a = record.busname) !== null && _a !== void 0 ? _a : '';
|
|
1881
|
+
this.vat_number = (_b = record.vatnum) !== null && _b !== void 0 ? _b : '';
|
|
1882
|
+
this.description = (_c = record.busdescript) !== null && _c !== void 0 ? _c : '';
|
|
1883
|
+
this.type = (_d = record.business_type) !== null && _d !== void 0 ? _d : '';
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
class EsolveUserAccountContact {
|
|
1889
|
+
constructor(record) {
|
|
1890
|
+
var _a, _b, _c;
|
|
1891
|
+
if (record) {
|
|
1892
|
+
this.tel_number = (_a = record.telnumber) !== null && _a !== void 0 ? _a : '';
|
|
1893
|
+
this.cell_number = (_b = record.cellnumber) !== null && _b !== void 0 ? _b : '';
|
|
1894
|
+
this.fax_number = (_c = record.fax) !== null && _c !== void 0 ? _c : '';
|
|
1895
|
+
}
|
|
1887
1896
|
}
|
|
1888
1897
|
}
|
|
1889
1898
|
|
|
@@ -1895,62 +1904,25 @@ class EsolveUserAccountResult extends EsolveResponseResult {
|
|
|
1895
1904
|
}
|
|
1896
1905
|
}
|
|
1897
1906
|
|
|
1898
|
-
class
|
|
1899
|
-
constructor(
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
this.account = account;
|
|
1918
|
-
this.branch_code = branch_code;
|
|
1919
|
-
this.account_group = account_group;
|
|
1920
|
-
this.pricing_group = pricing_group;
|
|
1921
|
-
this.price_list = price_list;
|
|
1922
|
-
this.loyalty_classification_id = loyalty_classification_id;
|
|
1923
|
-
this.company_name = company_name;
|
|
1924
|
-
this.client_contact_person = client_contact_person;
|
|
1925
|
-
this.client_firstname = client_firstname;
|
|
1926
|
-
this.client_surname = client_surname;
|
|
1927
|
-
this.client_email = client_email;
|
|
1928
|
-
this.client_contact_number = client_contact_number;
|
|
1929
|
-
this.client_fax_number = client_fax_number;
|
|
1930
|
-
this.client_cellphone_number = client_cellphone_number;
|
|
1931
|
-
this.client_id_number = client_id_number;
|
|
1932
|
-
this.address_description = address_description;
|
|
1933
|
-
this.street = street;
|
|
1934
|
-
this.suburb = suburb;
|
|
1935
|
-
this.city = city;
|
|
1936
|
-
this.province = province;
|
|
1937
|
-
this.country = country;
|
|
1938
|
-
this.postal_code = postal_code;
|
|
1939
|
-
this.postal_address = postal_address;
|
|
1940
|
-
this.delivery_address = delivery_address;
|
|
1941
|
-
this.latitude = latitude;
|
|
1942
|
-
this.longitude = longitude;
|
|
1943
|
-
this.vat_number = vat_number;
|
|
1944
|
-
this.credit_limit = credit_limit;
|
|
1945
|
-
this.pending_invoice_balance = pending_invoice_balance;
|
|
1946
|
-
this.external_account_balance = external_account_balance;
|
|
1947
|
-
this.ageing = ageing;
|
|
1948
|
-
this.balance_last_updated = balance_last_updated;
|
|
1949
|
-
this.default_sellprice = default_sellprice;
|
|
1950
|
-
this.client_classification = client_classification;
|
|
1951
|
-
this.override_stock_listing_identifiers = override_stock_listing_identifiers;
|
|
1952
|
-
this.requires_transaction_approval = requires_transaction_approval;
|
|
1953
|
-
this.is_active = is_active;
|
|
1907
|
+
class EsolveUserAccount {
|
|
1908
|
+
constructor(record) {
|
|
1909
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1910
|
+
if (record) {
|
|
1911
|
+
this.esolve_id = +((_a = record.userid) !== null && _a !== void 0 ? _a : 0);
|
|
1912
|
+
this.email = (_b = record.email) !== null && _b !== void 0 ? _b : '';
|
|
1913
|
+
this.registration_type = (_c = record.registration_type) !== null && _c !== void 0 ? _c : '';
|
|
1914
|
+
this.title = (_d = record.title) !== null && _d !== void 0 ? _d : '';
|
|
1915
|
+
this.first_name = (_e = record.firstname) !== null && _e !== void 0 ? _e : '';
|
|
1916
|
+
this.last_name = (_f = record.surname) !== null && _f !== void 0 ? _f : '';
|
|
1917
|
+
this.initials = (_g = record.initials) !== null && _g !== void 0 ? _g : '';
|
|
1918
|
+
this.gender = (_h = record.gender) !== null && _h !== void 0 ? _h : '';
|
|
1919
|
+
this.identification_number = (_j = record.idnumber) !== null && _j !== void 0 ? _j : '';
|
|
1920
|
+
this.contact_details = new EsolveUserAccountContact(record);
|
|
1921
|
+
this.business_details = new EsolveUserAccountBusiness(record);
|
|
1922
|
+
if (record.client_details && (record.client_details.account !== '')) {
|
|
1923
|
+
this.client_details = new EsolveUserClientAccount(record.client_details);
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1954
1926
|
}
|
|
1955
1927
|
}
|
|
1956
1928
|
|
|
@@ -1967,6 +1939,98 @@ class EsolveUserClientAccountBalances {
|
|
|
1967
1939
|
}
|
|
1968
1940
|
}
|
|
1969
1941
|
|
|
1942
|
+
class EsolveStatementAgeing {
|
|
1943
|
+
constructor(record) {
|
|
1944
|
+
var _a, _b;
|
|
1945
|
+
if (record) {
|
|
1946
|
+
this.days = +((_a = record.days) !== null && _a !== void 0 ? _a : 0);
|
|
1947
|
+
this.amount = +((_b = record.amount) !== null && _b !== void 0 ? _b : 0);
|
|
1948
|
+
}
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
class EsolveStatementBalances {
|
|
1953
|
+
constructor(record) {
|
|
1954
|
+
var _a, _b, _c;
|
|
1955
|
+
if (record) {
|
|
1956
|
+
this.total = +((_a = record.total) !== null && _a !== void 0 ? _a : 0);
|
|
1957
|
+
this.ageing = (_c = (_b = record.ageing) === null || _b === void 0 ? void 0 : _b.map((e) => new EsolveStatementAgeing(e))) !== null && _c !== void 0 ? _c : [];
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
class EsolveStatementTransaction {
|
|
1963
|
+
constructor(record) {
|
|
1964
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1965
|
+
if (record) {
|
|
1966
|
+
this.order_date = (_a = record.order_date) !== null && _a !== void 0 ? _a : '';
|
|
1967
|
+
this.order_number = (_b = record.order_number) !== null && _b !== void 0 ? _b : '';
|
|
1968
|
+
this.comment = (_c = record.comment) !== null && _c !== void 0 ? _c : '';
|
|
1969
|
+
this.account = (_d = record.account) !== null && _d !== void 0 ? _d : '';
|
|
1970
|
+
this.iq_reference = (_e = record.iq_reference) !== null && _e !== void 0 ? _e : '';
|
|
1971
|
+
this.total = +((_f = record.total) !== null && _f !== void 0 ? _f : 0);
|
|
1972
|
+
this.amount_due = +((_g = record.amount_due) !== null && _g !== void 0 ? _g : 0);
|
|
1973
|
+
this.is_debit = !!+((_h = record.is_debit) !== null && _h !== void 0 ? _h : true);
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
class EsolveStatement {
|
|
1979
|
+
constructor(record) {
|
|
1980
|
+
var _a, _b;
|
|
1981
|
+
if (record) {
|
|
1982
|
+
this.balances = new EsolveStatementBalances(record.balances);
|
|
1983
|
+
this.transactions = (_b = (_a = record.transactions) === null || _a === void 0 ? void 0 : _a.map((e) => new EsolveStatementTransaction(e))) !== null && _b !== void 0 ? _b : [];
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
class EsolveUserClientAccount {
|
|
1989
|
+
constructor(record) {
|
|
1990
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
|
|
1991
|
+
if (record) {
|
|
1992
|
+
this.account = (_a = record.account) !== null && _a !== void 0 ? _a : '';
|
|
1993
|
+
this.branch_code = (_b = record.branch_code) !== null && _b !== void 0 ? _b : '';
|
|
1994
|
+
this.account_group = (_c = record.account_group) !== null && _c !== void 0 ? _c : '';
|
|
1995
|
+
this.pricing_group = (_d = record.pricing_group) !== null && _d !== void 0 ? _d : '';
|
|
1996
|
+
this.company_name = (_e = record.company_name) !== null && _e !== void 0 ? _e : '';
|
|
1997
|
+
this.client_contact_person = (_f = record.client_contact_person) !== null && _f !== void 0 ? _f : '';
|
|
1998
|
+
this.client_firstname = (_g = record.client_firstname) !== null && _g !== void 0 ? _g : '';
|
|
1999
|
+
this.client_surname = (_h = record.client_surname) !== null && _h !== void 0 ? _h : '';
|
|
2000
|
+
this.client_email = (_j = record.client_email) !== null && _j !== void 0 ? _j : '';
|
|
2001
|
+
this.client_contact_number = (_k = record.client_contact_number) !== null && _k !== void 0 ? _k : '';
|
|
2002
|
+
this.client_fax_number = (_l = record.client_fax_number) !== null && _l !== void 0 ? _l : '';
|
|
2003
|
+
this.client_cellphone_number = (_m = record.client_cellphone_number) !== null && _m !== void 0 ? _m : '';
|
|
2004
|
+
this.client_id_number = (_o = record.client_id_number) !== null && _o !== void 0 ? _o : '';
|
|
2005
|
+
this.address_description = (_p = record.address_description) !== null && _p !== void 0 ? _p : '';
|
|
2006
|
+
this.street = (_q = record.street) !== null && _q !== void 0 ? _q : '';
|
|
2007
|
+
this.suburb = record.suburb;
|
|
2008
|
+
this.city = (_r = record.city) !== null && _r !== void 0 ? _r : '';
|
|
2009
|
+
this.province = (_s = record.province) !== null && _s !== void 0 ? _s : '';
|
|
2010
|
+
this.country = (_t = record.country) !== null && _t !== void 0 ? _t : '';
|
|
2011
|
+
this.postal_code = (_u = record.postal_code) !== null && _u !== void 0 ? _u : '';
|
|
2012
|
+
this.postal_address = (_v = record.postal_address) !== null && _v !== void 0 ? _v : '';
|
|
2013
|
+
this.delivery_address = (_w = record.delivery_address) !== null && _w !== void 0 ? _w : '';
|
|
2014
|
+
this.vat_number = (_x = record.vat_number) !== null && _x !== void 0 ? _x : '';
|
|
2015
|
+
this.ageing = (_y = record.ageing) !== null && _y !== void 0 ? _y : '';
|
|
2016
|
+
this.balance_last_updated = (_z = record.balance_last_updated) !== null && _z !== void 0 ? _z : '';
|
|
2017
|
+
this.client_classification = (_0 = record.client_classification) !== null && _0 !== void 0 ? _0 : '';
|
|
2018
|
+
this.override_stock_listing_identifiers = (_1 = record.override_stock_listing_identifiers) !== null && _1 !== void 0 ? _1 : '';
|
|
2019
|
+
this.requires_transaction_approval = (_2 = record.requires_transaction_approval) !== null && _2 !== void 0 ? _2 : '';
|
|
2020
|
+
this.latitude = +((_3 = record.latitude) !== null && _3 !== void 0 ? _3 : 0);
|
|
2021
|
+
this.longitude = +((_4 = record.longitude) !== null && _4 !== void 0 ? _4 : 0);
|
|
2022
|
+
this.price_list = +((_5 = record.price_list) !== null && _5 !== void 0 ? _5 : 0);
|
|
2023
|
+
this.loyalty_classification_id = +((_6 = record.loyalty_classification_id) !== null && _6 !== void 0 ? _6 : 0);
|
|
2024
|
+
this.credit_limit = +((_7 = record.credit_limit) !== null && _7 !== void 0 ? _7 : 0);
|
|
2025
|
+
this.pending_invoice_balance = +((_8 = record.pending_invoice_balance) !== null && _8 !== void 0 ? _8 : 0);
|
|
2026
|
+
this.external_account_balance = +((_9 = record.external_account_balance) !== null && _9 !== void 0 ? _9 : 0);
|
|
2027
|
+
this.default_sellprice = +((_10 = record.default_sellprice) !== null && _10 !== void 0 ? _10 : 0);
|
|
2028
|
+
this.is_active = !!+((_11 = record.is_active) !== null && _11 !== void 0 ? _11 : false);
|
|
2029
|
+
this.external_statement = new EsolveStatement(record.external_statement);
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
|
|
1970
2034
|
class EsolveTransactionAddress {
|
|
1971
2035
|
constructor(recipient, address_type, address_description, street_number, street, suburb, city, province, country, postal_code, pobox) {
|
|
1972
2036
|
this.recipient = recipient;
|
|
@@ -2490,12 +2554,225 @@ class EsolveTransactionAnalyticsData {
|
|
|
2490
2554
|
}
|
|
2491
2555
|
}
|
|
2492
2556
|
|
|
2557
|
+
class EsolveCoupon {
|
|
2558
|
+
constructor(record) {
|
|
2559
|
+
this.id = 0;
|
|
2560
|
+
this.identifier = '';
|
|
2561
|
+
this.discount = 0;
|
|
2562
|
+
/**
|
|
2563
|
+
* Shows either the short code or the coupon key (if short code is not set)
|
|
2564
|
+
*/
|
|
2565
|
+
this.coupon_code = '';
|
|
2566
|
+
/**
|
|
2567
|
+
* Limit of the number of items it can apply to
|
|
2568
|
+
*/
|
|
2569
|
+
this.apply_on = 0;
|
|
2570
|
+
/**
|
|
2571
|
+
* Indicates if the discount does not apply to specified products, meaning
|
|
2572
|
+
* all items get the discount
|
|
2573
|
+
*/
|
|
2574
|
+
this.apply_to_full_cart = false;
|
|
2575
|
+
if (record) {
|
|
2576
|
+
this.id = +record.id;
|
|
2577
|
+
this.identifier = record.identifier;
|
|
2578
|
+
this.discount = +record.discount;
|
|
2579
|
+
this.coupon_code = record.coupon_code;
|
|
2580
|
+
this.apply_on = +record.apply_on;
|
|
2581
|
+
this.apply_to_full_cart = record.apply_to_full_cart;
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
|
|
2586
|
+
;
|
|
2587
|
+
|
|
2588
|
+
class EsolveCouponsService {
|
|
2589
|
+
constructor(config, http, cookieService) {
|
|
2590
|
+
this.config = config;
|
|
2591
|
+
this.http = http;
|
|
2592
|
+
this.cookieService = cookieService;
|
|
2593
|
+
this.storage_key = '_ng_eslv_coupons';
|
|
2594
|
+
this.coupons_cache = new Map();
|
|
2595
|
+
this.applied = new BehaviorSubject(undefined);
|
|
2596
|
+
this.validation_error = new Subject();
|
|
2597
|
+
this.setStorageKey();
|
|
2598
|
+
this.coupons_cache = this.retrieveCache();
|
|
2599
|
+
}
|
|
2600
|
+
onValidationError() {
|
|
2601
|
+
return this.validation_error.asObservable();
|
|
2602
|
+
}
|
|
2603
|
+
onApplied() {
|
|
2604
|
+
return this.applied.asObservable();
|
|
2605
|
+
}
|
|
2606
|
+
validate(coupon_key) {
|
|
2607
|
+
return this.http
|
|
2608
|
+
.get(`${this.config.api_url}/get-validate-coupon.php`, {
|
|
2609
|
+
params: {
|
|
2610
|
+
coupon_key,
|
|
2611
|
+
},
|
|
2612
|
+
})
|
|
2613
|
+
.pipe(map((response) => {
|
|
2614
|
+
if (response.records === undefined) {
|
|
2615
|
+
throw response;
|
|
2616
|
+
}
|
|
2617
|
+
const valid = response.records.valid;
|
|
2618
|
+
const error = response.records.error;
|
|
2619
|
+
const result = {
|
|
2620
|
+
valid,
|
|
2621
|
+
};
|
|
2622
|
+
if (!valid && error) {
|
|
2623
|
+
this.validation_error.next(error);
|
|
2624
|
+
}
|
|
2625
|
+
else if (valid) {
|
|
2626
|
+
result.id = response.records.id;
|
|
2627
|
+
}
|
|
2628
|
+
return result;
|
|
2629
|
+
}), catchError(() => of({ valid: false })));
|
|
2630
|
+
}
|
|
2631
|
+
applyCoupon(coupon_key) {
|
|
2632
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2633
|
+
try {
|
|
2634
|
+
if (coupon_key.trim() === '') {
|
|
2635
|
+
return false;
|
|
2636
|
+
}
|
|
2637
|
+
const result = yield firstValueFrom(this.validate(coupon_key));
|
|
2638
|
+
if (result.valid && result.id) {
|
|
2639
|
+
this.addCoupon(result.id, coupon_key);
|
|
2640
|
+
}
|
|
2641
|
+
return result.valid;
|
|
2642
|
+
}
|
|
2643
|
+
catch (error) {
|
|
2644
|
+
return false;
|
|
2645
|
+
}
|
|
2646
|
+
});
|
|
2647
|
+
}
|
|
2648
|
+
removeCoupon(id) {
|
|
2649
|
+
this.coupons_cache.delete(id);
|
|
2650
|
+
this.cacheCoupons();
|
|
2651
|
+
this.applied.next();
|
|
2652
|
+
}
|
|
2653
|
+
getAppliedCouponKeys() {
|
|
2654
|
+
return [...this.coupons_cache.values()];
|
|
2655
|
+
}
|
|
2656
|
+
getAppliedCoupons() {
|
|
2657
|
+
const coupon_ids = [...this.coupons_cache.keys()];
|
|
2658
|
+
return this.http
|
|
2659
|
+
.get(`${this.config.api_url}/get-applied-coupons.php`, {
|
|
2660
|
+
params: {
|
|
2661
|
+
coupons: coupon_ids.join(','),
|
|
2662
|
+
},
|
|
2663
|
+
})
|
|
2664
|
+
.pipe(map((response) => {
|
|
2665
|
+
if (response.records === undefined) {
|
|
2666
|
+
throw response;
|
|
2667
|
+
}
|
|
2668
|
+
return this.processCoupons(response.records);
|
|
2669
|
+
}));
|
|
2670
|
+
}
|
|
2671
|
+
reset() {
|
|
2672
|
+
this.deleteCoupons();
|
|
2673
|
+
}
|
|
2674
|
+
retrieveCache() {
|
|
2675
|
+
if (this.cookieService.check(this.storage_key)) {
|
|
2676
|
+
const coupons_json = this.cookieService.get(this.storage_key);
|
|
2677
|
+
try {
|
|
2678
|
+
return this.jsonDecodeMap(coupons_json);
|
|
2679
|
+
}
|
|
2680
|
+
catch (error) {
|
|
2681
|
+
// soft error
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
return new Map();
|
|
2685
|
+
}
|
|
2686
|
+
cacheCoupons() {
|
|
2687
|
+
if (this.coupons_cache.size > 0) {
|
|
2688
|
+
const coupons_json = this.jsonEncodeMap(this.coupons_cache);
|
|
2689
|
+
this.cookieService.set(this.storage_key, coupons_json, undefined, '/');
|
|
2690
|
+
}
|
|
2691
|
+
else {
|
|
2692
|
+
this.deleteCoupons();
|
|
2693
|
+
}
|
|
2694
|
+
}
|
|
2695
|
+
deleteCoupons() {
|
|
2696
|
+
this.coupons_cache.clear();
|
|
2697
|
+
this.cookieService.delete(this.storage_key, '/');
|
|
2698
|
+
}
|
|
2699
|
+
addCoupon(id, key) {
|
|
2700
|
+
if (!this.coupons_cache.has(id)) {
|
|
2701
|
+
this.coupons_cache.set(id, key);
|
|
2702
|
+
this.cacheCoupons();
|
|
2703
|
+
}
|
|
2704
|
+
this.applied.next();
|
|
2705
|
+
}
|
|
2706
|
+
setStorageKey() {
|
|
2707
|
+
if (typeof this.config.coupon_storage_key === 'string' &&
|
|
2708
|
+
this.config.coupon_storage_key !== '') {
|
|
2709
|
+
this.storage_key = this.config.coupon_storage_key;
|
|
2710
|
+
}
|
|
2711
|
+
}
|
|
2712
|
+
jsonEncodeMap(data) {
|
|
2713
|
+
if (!(data instanceof Map)) {
|
|
2714
|
+
throw new Error('Invalid map type');
|
|
2715
|
+
}
|
|
2716
|
+
return JSON.stringify(data, (key, value) => {
|
|
2717
|
+
if (value instanceof Map) {
|
|
2718
|
+
return {
|
|
2719
|
+
dataType: 'Map',
|
|
2720
|
+
value: [...value],
|
|
2721
|
+
};
|
|
2722
|
+
}
|
|
2723
|
+
else {
|
|
2724
|
+
return value;
|
|
2725
|
+
}
|
|
2726
|
+
});
|
|
2727
|
+
}
|
|
2728
|
+
jsonDecodeMap(json_data) {
|
|
2729
|
+
const data = JSON.parse(json_data, (key, value) => {
|
|
2730
|
+
if (typeof value === 'object' && value !== null) {
|
|
2731
|
+
if (value.dataType === 'Map') {
|
|
2732
|
+
return new Map(value.value);
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
return value;
|
|
2736
|
+
});
|
|
2737
|
+
if (data instanceof Map) {
|
|
2738
|
+
return data;
|
|
2739
|
+
}
|
|
2740
|
+
throw new Error('Invalid map type');
|
|
2741
|
+
}
|
|
2742
|
+
processCoupons(records) {
|
|
2743
|
+
const coupons = [];
|
|
2744
|
+
if (records) {
|
|
2745
|
+
for (const record of records) {
|
|
2746
|
+
const coupon = new EsolveCoupon(record);
|
|
2747
|
+
coupons.push(coupon);
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
return coupons;
|
|
2751
|
+
}
|
|
2752
|
+
}
|
|
2753
|
+
EsolveCouponsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EsolveCouponsService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveCookieService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2754
|
+
EsolveCouponsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EsolveCouponsService, providedIn: 'root' });
|
|
2755
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EsolveCouponsService, decorators: [{
|
|
2756
|
+
type: Injectable,
|
|
2757
|
+
args: [{
|
|
2758
|
+
providedIn: 'root',
|
|
2759
|
+
}]
|
|
2760
|
+
}], ctorParameters: function () {
|
|
2761
|
+
return [{ type: undefined, decorators: [{
|
|
2762
|
+
type: Inject,
|
|
2763
|
+
args: [ESOLVE_CONNECT_CONFIG]
|
|
2764
|
+
}] }, { type: i1$2.HttpClient }, { type: EsolveCookieService }];
|
|
2765
|
+
} });
|
|
2766
|
+
|
|
2767
|
+
// Classes
|
|
2768
|
+
|
|
2493
2769
|
class EsolveCartService {
|
|
2494
|
-
constructor(config, http, errorHandler, responseHandler) {
|
|
2770
|
+
constructor(config, http, errorHandler, responseHandler, coupons) {
|
|
2495
2771
|
this.config = config;
|
|
2496
2772
|
this.http = http;
|
|
2497
2773
|
this.errorHandler = errorHandler;
|
|
2498
2774
|
this.responseHandler = responseHandler;
|
|
2775
|
+
this.coupons = coupons;
|
|
2499
2776
|
this._cached_tracking = 0;
|
|
2500
2777
|
}
|
|
2501
2778
|
/**
|
|
@@ -2504,8 +2781,13 @@ class EsolveCartService {
|
|
|
2504
2781
|
* @returns An `Observable` with an array of cart items
|
|
2505
2782
|
*/
|
|
2506
2783
|
getCart() {
|
|
2784
|
+
let params = new HttpParams();
|
|
2785
|
+
const coupons = this.coupons.getAppliedCouponKeys();
|
|
2786
|
+
if (coupons.length > 0) {
|
|
2787
|
+
params = params.set('coupons', coupons.join(','));
|
|
2788
|
+
}
|
|
2507
2789
|
return this.http
|
|
2508
|
-
.get(`${this.config.api_url}/get-cart.php
|
|
2790
|
+
.get(`${this.config.api_url}/get-cart.php`, { params })
|
|
2509
2791
|
.pipe(map((response) => {
|
|
2510
2792
|
if (response.records === undefined) {
|
|
2511
2793
|
throw response;
|
|
@@ -2518,6 +2800,7 @@ class EsolveCartService {
|
|
|
2518
2800
|
*
|
|
2519
2801
|
* @param items An array of options to update the cart
|
|
2520
2802
|
* @param action The default action to preform
|
|
2803
|
+
*
|
|
2521
2804
|
* @returns An `Observable` with an array of responses that gives feedback on the requested changes
|
|
2522
2805
|
*/
|
|
2523
2806
|
setCart(items, action = 'add') {
|
|
@@ -2625,6 +2908,7 @@ class EsolveCartService {
|
|
|
2625
2908
|
* @param payment_method_id The ID of the selected payment method
|
|
2626
2909
|
* @param location_id The ID of the selected branch from with shipping needs to be calculated
|
|
2627
2910
|
* @param comments Additional comments on the cart
|
|
2911
|
+
*
|
|
2628
2912
|
* @returns An `Observable` with the transaction ID
|
|
2629
2913
|
*/
|
|
2630
2914
|
checkout(type, addresses_id, shipping_id, payment_method_id = 0, location_id = 0, comments = '') {
|
|
@@ -2652,6 +2936,7 @@ class EsolveCartService {
|
|
|
2652
2936
|
})
|
|
2653
2937
|
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
2654
2938
|
this._cached_tracking = 0;
|
|
2939
|
+
this.coupons.reset();
|
|
2655
2940
|
return new EsolveCheckoutResult(response);
|
|
2656
2941
|
})), catchError((errorRes) => {
|
|
2657
2942
|
return this.errorHandler.handleHttpPostError('set-checkout', errorRes);
|
|
@@ -2685,7 +2970,7 @@ class EsolveCartService {
|
|
|
2685
2970
|
return cart_totals;
|
|
2686
2971
|
}
|
|
2687
2972
|
}
|
|
2688
|
-
EsolveCartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EsolveCartService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2973
|
+
EsolveCartService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EsolveCartService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }, { token: EsolveErrorHandlerService }, { token: EsolveResponseHandlerService }, { token: EsolveCouponsService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2689
2974
|
EsolveCartService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EsolveCartService, providedIn: 'root' });
|
|
2690
2975
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EsolveCartService, decorators: [{
|
|
2691
2976
|
type: Injectable,
|
|
@@ -2696,7 +2981,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
2696
2981
|
return [{ type: undefined, decorators: [{
|
|
2697
2982
|
type: Inject,
|
|
2698
2983
|
args: [ESOLVE_CONNECT_CONFIG]
|
|
2699
|
-
}] }, { type: i1$2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }];
|
|
2984
|
+
}] }, { type: i1$2.HttpClient }, { type: EsolveErrorHandlerService }, { type: EsolveResponseHandlerService }, { type: EsolveCouponsService }];
|
|
2700
2985
|
} });
|
|
2701
2986
|
|
|
2702
2987
|
class EsolveAccountService {
|
|
@@ -2992,22 +3277,13 @@ class EsolveAccountService {
|
|
|
2992
3277
|
}
|
|
2993
3278
|
}
|
|
2994
3279
|
processUserAccount(record) {
|
|
2995
|
-
var _a;
|
|
2996
3280
|
if (!record) {
|
|
2997
3281
|
throw new Error('Invalid record');
|
|
2998
3282
|
}
|
|
2999
3283
|
if (+record.userid !== this._user_id) {
|
|
3000
3284
|
throw new Error('Invalid user account retrieved');
|
|
3001
3285
|
}
|
|
3002
|
-
|
|
3003
|
-
user_account.contact_details = new EsolveUserAccountContact(record.telnumber, record.cellnumber, record.fax);
|
|
3004
|
-
user_account.business_details = new EsolveUserAccountBusiness(record.busname, record.vatnum, record.busdescript, record.business_type);
|
|
3005
|
-
if (record.client_details != undefined) {
|
|
3006
|
-
if (((_a = record.client_details) === null || _a === void 0 ? void 0 : _a.account) !== '') {
|
|
3007
|
-
user_account.client_details = new EsolveUserClientAccount(record.client_details.account, record.client_details.branch_code, record.client_details.account_group, record.client_details.pricing_group, +record.client_details.price_list, +record.client_details.loyalty_classification_id, record.client_details.company_name, record.client_details.client_contact_person, record.client_details.client_firstname, record.client_details.client_surname, record.client_details.client_email, record.client_details.client_contact_number, record.client_details.client_fax_number, record.client_details.client_cellphone_number, record.client_details.client_id_number, record.client_details.address_description, record.client_details.street, record.client_details.suburb, record.client_details.city, record.client_details.province, record.client_details.country, record.client_details.postal_code, record.client_details.postal_address, record.client_details.delivery_address, +record.client_details.latitude, +record.client_details.longitude, record.client_details.vat_number, +record.client_details.credit_limit, +record.client_details.pending_invoice_balance, +record.client_details.external_account_balance, record.client_details.ageing, record.client_details.balance_last_updated, +record.client_details.default_sellprice, record.client_details.client_classification, record.client_details.override_stock_listing_identifiers, record.client_details.requires_transaction_approval, record.client_details.is_active);
|
|
3008
|
-
}
|
|
3009
|
-
}
|
|
3010
|
-
return user_account;
|
|
3286
|
+
return new EsolveUserAccount(record);
|
|
3011
3287
|
}
|
|
3012
3288
|
processUserAddress(records) {
|
|
3013
3289
|
const user_addresses = [];
|
|
@@ -3542,9 +3818,16 @@ class EsolveStockLeadTimes {
|
|
|
3542
3818
|
}
|
|
3543
3819
|
}
|
|
3544
3820
|
|
|
3821
|
+
class EsolveStockTransactionHistory {
|
|
3822
|
+
constructor(total_order_qty = 0, total_quote_qty = 0) {
|
|
3823
|
+
this.total_order_qty = total_order_qty;
|
|
3824
|
+
this.total_quote_qty = total_quote_qty;
|
|
3825
|
+
}
|
|
3826
|
+
}
|
|
3827
|
+
|
|
3545
3828
|
class EsolveStockItemBase {
|
|
3546
3829
|
constructor(record = {}) {
|
|
3547
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
3830
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
3548
3831
|
/**
|
|
3549
3832
|
* eSolve Generated ID
|
|
3550
3833
|
*/
|
|
@@ -3745,8 +4028,13 @@ class EsolveStockItemBase {
|
|
|
3745
4028
|
if (record.custom_fields) {
|
|
3746
4029
|
this.custom_fields = record.custom_fields;
|
|
3747
4030
|
}
|
|
3748
|
-
|
|
3749
|
-
|
|
4031
|
+
if ((record.total_order_qty) || ((record.total_quote_qty))) {
|
|
4032
|
+
const total_order_qty = +((_4 = record.total_order_qty) !== null && _4 !== void 0 ? _4 : 0);
|
|
4033
|
+
const total_quote_qty = +((_5 = record.total_quote_qty) !== null && _5 !== void 0 ? _5 : 0);
|
|
4034
|
+
this.history = new EsolveStockTransactionHistory(total_order_qty, total_quote_qty);
|
|
4035
|
+
}
|
|
4036
|
+
seo_title = (_6 = record.seo_page_title) !== null && _6 !== void 0 ? _6 : '';
|
|
4037
|
+
seo_keywords = (_7 = record.seo_keywords) !== null && _7 !== void 0 ? _7 : '';
|
|
3750
4038
|
}
|
|
3751
4039
|
this.price = new EsolveStockPrice(base_price, base_price_with_tax, sell_price, sell_price_with_tax, record.vat_rate, record.vat_item);
|
|
3752
4040
|
if (seo_title.trim() === '') {
|
|
@@ -4029,6 +4317,57 @@ class EsolveStockService {
|
|
|
4029
4317
|
* @param options Stock filter options
|
|
4030
4318
|
*/
|
|
4031
4319
|
getStockItems(options) {
|
|
4320
|
+
let params = new HttpParams();
|
|
4321
|
+
if (options.page) {
|
|
4322
|
+
params = params.set('page', options.page);
|
|
4323
|
+
}
|
|
4324
|
+
if (options.rows) {
|
|
4325
|
+
params = params.set('rows', options.rows);
|
|
4326
|
+
}
|
|
4327
|
+
if (options.sort) {
|
|
4328
|
+
const sort = options.sort;
|
|
4329
|
+
if (sort.field) {
|
|
4330
|
+
params = params.set('sort', sort.field);
|
|
4331
|
+
}
|
|
4332
|
+
if (sort.order) {
|
|
4333
|
+
params = params.set('order', sort.order);
|
|
4334
|
+
}
|
|
4335
|
+
}
|
|
4336
|
+
if (options.search_phrase) {
|
|
4337
|
+
params = params.set('search_phrase', options.search_phrase);
|
|
4338
|
+
}
|
|
4339
|
+
if (options.display_only) {
|
|
4340
|
+
params = params.set('display_only', options.display_only);
|
|
4341
|
+
}
|
|
4342
|
+
if (options.is_active) {
|
|
4343
|
+
params = params.set('is_active', options.is_active);
|
|
4344
|
+
}
|
|
4345
|
+
if (options.filters) {
|
|
4346
|
+
let filters = options.filters;
|
|
4347
|
+
if (!Array.isArray(filters)) {
|
|
4348
|
+
filters = EsolveFilterFactory.covertFromObj(filters);
|
|
4349
|
+
}
|
|
4350
|
+
params = EsolveFilterFactory.convertToHttpParams(filters, params);
|
|
4351
|
+
}
|
|
4352
|
+
return this.getStockRecords(params).pipe(map((response) => {
|
|
4353
|
+
var _a;
|
|
4354
|
+
if ((response.records === undefined) ||
|
|
4355
|
+
(response.records.length <= 0)) {
|
|
4356
|
+
throw response;
|
|
4357
|
+
}
|
|
4358
|
+
const stockItems = [];
|
|
4359
|
+
response.records.forEach((stockRecord) => {
|
|
4360
|
+
stockItems.push(this.processStockItem(stockRecord));
|
|
4361
|
+
});
|
|
4362
|
+
return new EsolveStockItemList(stockItems, +response.additional_data.total_records, (_a = options.page) !== null && _a !== void 0 ? _a : 0);
|
|
4363
|
+
}));
|
|
4364
|
+
}
|
|
4365
|
+
/**
|
|
4366
|
+
* Retrieves list of stock from the eSolve instance using info provided
|
|
4367
|
+
*
|
|
4368
|
+
* @param options Stock filter options
|
|
4369
|
+
*/
|
|
4370
|
+
getStockItemsTransactionHistory(options) {
|
|
4032
4371
|
let params = new HttpParams();
|
|
4033
4372
|
if (options.page) {
|
|
4034
4373
|
params = params.set('page', options.page);
|
|
@@ -4082,7 +4421,7 @@ class EsolveStockService {
|
|
|
4082
4421
|
}
|
|
4083
4422
|
params = EsolveFilterFactory.convertToHttpParams(filters, params);
|
|
4084
4423
|
}
|
|
4085
|
-
return this.
|
|
4424
|
+
return this.getStockHistoryRecords(params).pipe(map((response) => {
|
|
4086
4425
|
var _a;
|
|
4087
4426
|
if ((response.records === undefined) ||
|
|
4088
4427
|
(response.records.length <= 0)) {
|
|
@@ -4297,6 +4636,13 @@ class EsolveStockService {
|
|
|
4297
4636
|
getStockRecords(params) {
|
|
4298
4637
|
return this.http.get(`${this.config.api_url}/get-items.php`, { params });
|
|
4299
4638
|
}
|
|
4639
|
+
/**
|
|
4640
|
+
* Retrieves stock transaction history records from HTTP params.
|
|
4641
|
+
* @param params HTTP client parameters
|
|
4642
|
+
*/
|
|
4643
|
+
getStockHistoryRecords(params) {
|
|
4644
|
+
return this.http.get(`${this.config.api_url}/get-items-transaction-history.php`, { params });
|
|
4645
|
+
}
|
|
4300
4646
|
}
|
|
4301
4647
|
EsolveStockService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EsolveStockService, deps: [{ token: ESOLVE_CONNECT_CONFIG }, { token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4302
4648
|
EsolveStockService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: EsolveStockService, providedIn: 'root' });
|
|
@@ -5237,5 +5583,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
5237
5583
|
* Generated bundle index. Do not edit.
|
|
5238
5584
|
*/
|
|
5239
5585
|
|
|
5240
|
-
export { ESOLVE_CONNECT_CONFIG, EsolveAccountConfirmationResult, EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAsset, EsolveAssetsService, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveCartItem, EsolveCartService, EsolveCartStockItem, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveChangePasswordResult, EsolveCheckoutResult, EsolveColour, EsolveCookieService, EsolveDependantItem, EsolveEmptyCartResult, EsolveEmptyWishlistResult, EsolveEnquiryResult, EsolveEnquiryService, EsolveErrorHandlerService, EsolveFilterFactory, EsolveGeocodeAddressResult, EsolveGeocodeCoordsResult, EsolveGeocodeResult, EsolveGeocoderService, EsolveHttpError, EsolveLinkedAsset, EsolveLinkedStockItem, EsolveList, EsolveLocation, EsolveLocationAddress, EsolveLocationContactInfo, EsolveLocationGEO, EsolveLocationPOBoxAddress, EsolveLocationTradingDay, EsolveLocationTradingTimes, EsolveLocationsService, EsolveManufacturer, EsolveManufacturersService, EsolveMediaStockItem, EsolveMenuItem, EsolveMenuService, EsolveMultipleSelectFilter, EsolveNewsArticle, EsolveNewsArticleAuthor, EsolveNewsArticleList, EsolveNewsGroup, EsolveNewsService, EsolvePaymentMethod, EsolvePaymentResult, EsolvePaymentService, EsolveRange, EsolveRangeFilter, EsolveRangesService, EsolveRecipeStockItem, EsolveRegistrationResult, EsolveResetPasswordResult, EsolveResponseHandlerService, EsolveResponseResult, EsolveResult, EsolveSeoInfo, EsolveSeoService, EsolveSession, EsolveSessionService, EsolveShippingCost, EsolveShippingMethod, EsolveShippingService, EsolveShippingTotals, EsolveSingleSelectFilter, EsolveSpecial, EsolveSpecialDates, EsolveSpecialImage, EsolveSpecialImageCollection, EsolveSpecialsService, EsolveStockBadge, EsolveStockGroup, EsolveStockGroupItem, EsolveStockImage, EsolveStockImageCollection, EsolveStockItem, EsolveStockItemBase, EsolveStockItemList, EsolveStockLeadTimes, EsolveStockPrice, EsolveStockService, EsolveSupplier, EsolveSuppliersService, EsolveTag, EsolveTagsService, EsolveTopic, EsolveTopicService, EsolveTransaction, EsolveTransactionAddress, EsolveTransactionAnalyticsData, EsolveTransactionClient, EsolveTransactionItem, EsolveTransactionItemPrice, EsolveTransactionList, EsolveTransactionLocation, EsolveTransactionPaymentMethod, EsolveTransactionShippingMethod, EsolveTransactionUser, EsolveUserAccount, EsolveUserAccountBusiness, EsolveUserAccountContact, EsolveUserAccountResult, EsolveUserClientAccount, EsolveUserClientAccountBalances, EsolveVaultItem, EsolveVaultItemResult, EsolveWishlistItem, EsolveWishlistService, NgEsolveConnectModule };
|
|
5586
|
+
export { ESOLVE_CONNECT_CONFIG, EsolveAccountConfirmationResult, EsolveAccountService, EsolveAdditionalStockImage, EsolveAddress, EsolveAddressResult, EsolveAsset, EsolveAssetsService, EsolveAuthService, EsolveBankingDetails, EsolveBanner, EsolveBannerImage, EsolveBannerImageHotspot, EsolveBannerService, EsolveCartItem, EsolveCartService, EsolveCartStockItem, EsolveCartTotals, EsolveCategoryTreeItem, EsolveCategoryTreeService, EsolveChangePasswordResult, EsolveCheckoutResult, EsolveColour, EsolveCookieService, EsolveCoupon, EsolveCouponsService, EsolveDependantItem, EsolveEmptyCartResult, EsolveEmptyWishlistResult, EsolveEnquiryResult, EsolveEnquiryService, EsolveErrorHandlerService, EsolveFilterFactory, EsolveGeocodeAddressResult, EsolveGeocodeCoordsResult, EsolveGeocodeResult, EsolveGeocoderService, EsolveHttpError, EsolveLinkedAsset, EsolveLinkedStockItem, EsolveList, EsolveLocation, EsolveLocationAddress, EsolveLocationContactInfo, EsolveLocationGEO, EsolveLocationPOBoxAddress, EsolveLocationTradingDay, EsolveLocationTradingTimes, EsolveLocationsService, EsolveManufacturer, EsolveManufacturersService, EsolveMediaStockItem, EsolveMenuItem, EsolveMenuService, EsolveMultipleSelectFilter, EsolveNewsArticle, EsolveNewsArticleAuthor, EsolveNewsArticleList, EsolveNewsGroup, EsolveNewsService, EsolvePaymentMethod, EsolvePaymentResult, EsolvePaymentService, EsolveRange, EsolveRangeFilter, EsolveRangesService, EsolveRecipeStockItem, EsolveRegistrationResult, EsolveResetPasswordResult, EsolveResponseHandlerService, EsolveResponseResult, EsolveResult, EsolveSeoInfo, EsolveSeoService, EsolveSession, EsolveSessionService, EsolveShippingCost, EsolveShippingMethod, EsolveShippingService, EsolveShippingTotals, EsolveSingleSelectFilter, EsolveSpecial, EsolveSpecialDates, EsolveSpecialImage, EsolveSpecialImageCollection, EsolveSpecialsService, EsolveStockBadge, EsolveStockGroup, EsolveStockGroupItem, EsolveStockImage, EsolveStockImageCollection, EsolveStockItem, EsolveStockItemBase, EsolveStockItemList, EsolveStockLeadTimes, EsolveStockPrice, EsolveStockService, EsolveSupplier, EsolveSuppliersService, EsolveTag, EsolveTagsService, EsolveTopic, EsolveTopicService, EsolveTransaction, EsolveTransactionAddress, EsolveTransactionAnalyticsData, EsolveTransactionClient, EsolveTransactionItem, EsolveTransactionItemPrice, EsolveTransactionList, EsolveTransactionLocation, EsolveTransactionPaymentMethod, EsolveTransactionShippingMethod, EsolveTransactionUser, EsolveUserAccount, EsolveUserAccountBusiness, EsolveUserAccountContact, EsolveUserAccountResult, EsolveUserClientAccount, EsolveUserClientAccountBalances, EsolveVaultItem, EsolveVaultItemResult, EsolveWishlistItem, EsolveWishlistService, NgEsolveConnectModule };
|
|
5241
5587
|
//# sourceMappingURL=esolve-ng-esolve-connect.mjs.map
|