@zeniai/client-epic-state 4.14.59 → 4.14.61
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/lib/entity/address/addressReducer.d.ts +2 -1
- package/lib/entity/address/addressReducer.js +1 -0
- package/lib/entity/company/companyPayload.d.ts +1 -0
- package/lib/entity/company/companyPayload.js +1 -0
- package/lib/entity/company/companyStateTypes.d.ts +3 -2
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/epic.d.ts +3 -1
- package/lib/epic.js +3 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +23 -21
- package/lib/init.d.ts +2 -2
- package/lib/init.js +17 -9
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +1 -0
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +1 -0
- package/lib/view/addressView/addressViewState.d.ts +1 -1
- package/lib/view/addressView/epic/saveNewAddressEpic.js +1 -0
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +37 -18
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.d.ts +2 -2
- package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewLocalStoreDataEpic.js +13 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +3 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +3 -2
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +2 -0
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +10 -8
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +2 -0
- package/lib/view/settingsView/epic/fetchBillingAccountsViewEpic.d.ts +2 -2
- package/lib/view/settingsView/epic/fetchBillingAccountsViewEpic.js +3 -1
- package/lib/view/settingsView/epic/fetchCompanyBillingAddressEpic.d.ts +11 -0
- package/lib/view/settingsView/epic/fetchCompanyBillingAddressEpic.js +57 -0
- package/lib/view/settingsView/epic/saveCompanyBillingAddressEpic.d.ts +10 -0
- package/lib/view/settingsView/epic/saveCompanyBillingAddressEpic.js +65 -0
- package/lib/view/settingsView/settingsViewPayload.d.ts +6 -0
- package/lib/view/settingsView/settingsViewReducer.d.ts +10 -2
- package/lib/view/settingsView/settingsViewReducer.js +59 -4
- package/lib/view/settingsView/settingsViewSelector.js +5 -1
- package/lib/view/settingsView/settingsViewState.d.ts +4 -0
- package/lib/view/settingsView/types/settingsViewSelectorTypes.d.ts +3 -1
- package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +5 -1
- package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +1 -0
- package/package.json +3 -2
- package/lib/initialize3rdPartyExtensions.d.ts +0 -1
- package/lib/initialize3rdPartyExtensions.js +0 -14
|
@@ -15,8 +15,8 @@ const getCompanyView_1 = require("../../companyView/selectorHelpers/getCompanyVi
|
|
|
15
15
|
const setupViewSelector_1 = require("../../spendManagement/commonSetup/setupViewSelector");
|
|
16
16
|
const onboardingCustomerViewState_1 = require("./onboardingCustomerViewState");
|
|
17
17
|
function getOnboardingCustomerView(state, companyId) {
|
|
18
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
19
|
-
const { fileState, paymentAccountState, onboardingCustomerViewState, userState, userRoleState, subscriptionPaymentAccountState, companyConfigState, cardPaymentViewState, countryListState, } = state;
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
19
|
+
const { fileState, paymentAccountState, onboardingCustomerViewState, userState, userRoleState, subscriptionPaymentAccountState, companyConfigState, cardPaymentViewState, countryListState, addressViewState, } = state;
|
|
20
20
|
const { companyDetails, companyOfficerUpdateStatus, primaryContactDetails, subscriptionPaymentAccountIds, paymentAccountDetails, plaidConnectionDetails, updateStatus, saveStatus, currentStep, uiState, fetchState, error, } = onboardingCustomerViewState;
|
|
21
21
|
const { paymentAccountIds } = paymentAccountDetails;
|
|
22
22
|
let subscriptionPaymentAccount;
|
|
@@ -49,10 +49,11 @@ function getOnboardingCustomerView(state, companyId) {
|
|
|
49
49
|
const companyView = (0, getCompanyView_1.getCompanyView)(state, companyId, []);
|
|
50
50
|
const accountingConnectionCreationMode = (_e = companyView === null || companyView === void 0 ? void 0 : companyView.company.company.companyOnboardingInfo.onboardingInfo) === null || _e === void 0 ? void 0 : _e.accountingConnectionCreationMode;
|
|
51
51
|
const companyOfficerIds = companyView === null || companyView === void 0 ? void 0 : companyView.companyOfficers.map((officer) => officer.user.userId);
|
|
52
|
+
const subscriptionBillingAddress = (_g = (_f = addressViewState.newAddressState) === null || _f === void 0 ? void 0 : _f.subscription_billing_address) === null || _g === void 0 ? void 0 : _g.addressToCreate;
|
|
52
53
|
const companyOfficers = (0, userSelector_1.getUsersByUserIds)(userState, companyOfficerIds !== null && companyOfficerIds !== void 0 ? companyOfficerIds : []);
|
|
53
54
|
const companyOfficerRoles = (0, userRoleSelector_1.getUserRoleByUserIds)(userRoleState, companyOfficerIds !== null && companyOfficerIds !== void 0 ? companyOfficerIds : []);
|
|
54
|
-
const primaryContact = ((
|
|
55
|
-
? (0, userSelector_1.getUserByUserId)(userState, (
|
|
55
|
+
const primaryContact = ((_h = companyView === null || companyView === void 0 ? void 0 : companyView.primaryContact) === null || _h === void 0 ? void 0 : _h.user.userId) != null
|
|
56
|
+
? (0, userSelector_1.getUserByUserId)(userState, (_j = companyView === null || companyView === void 0 ? void 0 : companyView.primaryContact) === null || _j === void 0 ? void 0 : _j.user.userId)
|
|
56
57
|
: undefined;
|
|
57
58
|
const { companyDetailsLocalData, companyOfficerLocalData } = (0, setupViewSelector_1.getCompanyAndIdentityDetails)(state, companyId, {
|
|
58
59
|
companyDetails,
|
|
@@ -60,14 +61,14 @@ function getOnboardingCustomerView(state, companyId) {
|
|
|
60
61
|
primaryContactDetails,
|
|
61
62
|
});
|
|
62
63
|
const completedSteps = [];
|
|
63
|
-
if ((((
|
|
64
|
+
if ((((_l = (_k = paymentAccount === null || paymentAccount === void 0 ? void 0 : paymentAccount.providerVerificationStatus) === null || _k === void 0 ? void 0 : _k.code) === null || _l === void 0 ? void 0 : _l.includes('verified')) ===
|
|
64
65
|
true &&
|
|
65
66
|
(paymentAccount === null || paymentAccount === void 0 ? void 0 : paymentAccount.isLoginRequired) === false) ||
|
|
66
|
-
((
|
|
67
|
+
((_o = (_m = subscriptionPaymentAccount === null || subscriptionPaymentAccount === void 0 ? void 0 : subscriptionPaymentAccount.providerVerificationStatus) === null || _m === void 0 ? void 0 : _m.code) === null || _o === void 0 ? void 0 : _o.includes('verified')) === true ||
|
|
67
68
|
cardPaymentViewState.cardPaymentsIds.length > 0) {
|
|
68
69
|
completedSteps.push('link_payment_account');
|
|
69
70
|
}
|
|
70
|
-
const isValidConnection = (
|
|
71
|
+
const isValidConnection = (_q = (_p = externalConnections === null || externalConnections === void 0 ? void 0 : externalConnections.accounting[0]) === null || _p === void 0 ? void 0 : _p.isValid) !== null && _q !== void 0 ? _q : false;
|
|
71
72
|
if (isValidConnection) {
|
|
72
73
|
completedSteps.push('qbo_connection');
|
|
73
74
|
}
|
|
@@ -84,7 +85,7 @@ function getOnboardingCustomerView(state, companyId) {
|
|
|
84
85
|
isOfficerDetailsCompleted(companyOfficers, companyOfficerRoles, companyOfficerLocalData[selectedOfficerType], fileState)) {
|
|
85
86
|
completedSteps.push('company_officer');
|
|
86
87
|
}
|
|
87
|
-
const { allStepsData, requiredStepsData } = (0, exports.onboardingStepsData)(isValidConnection, (
|
|
88
|
+
const { allStepsData, requiredStepsData } = (0, exports.onboardingStepsData)(isValidConnection, (_r = currentTenant === null || currentTenant === void 0 ? void 0 : currentTenant.productSettings) !== null && _r !== void 0 ? _r : [], accountingConnectionCreationMode, subscriptionPaymentAccount);
|
|
88
89
|
const allRequiredStepsCompleted = requiredStepsData.every((step) => {
|
|
89
90
|
return completedSteps.includes(step);
|
|
90
91
|
});
|
|
@@ -100,6 +101,7 @@ function getOnboardingCustomerView(state, companyId) {
|
|
|
100
101
|
return {
|
|
101
102
|
companyDetailsLocalData,
|
|
102
103
|
companyOfficerLocalData,
|
|
104
|
+
subscriptionBillingAddress,
|
|
103
105
|
companyView,
|
|
104
106
|
allNationalityCountries,
|
|
105
107
|
pendingSaveDetails: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
|
|
2
|
+
import { Address } from '../../../entity/address/addressState';
|
|
2
3
|
import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
|
|
3
4
|
import { CompanyDetailsLocalData, CompanyOfficerLocalData, PrimaryContactLocalData, SetupViewLocalData } from '../../spendManagement/commonSetup/setupViewState';
|
|
4
5
|
import { PlaidConnectionDetails } from '../../spendManagement/plaidAccount/plaidAccountViewState';
|
|
@@ -42,4 +43,5 @@ export interface OnboardingCustomerViewState extends FetchedState {
|
|
|
42
43
|
plaidConnectionDetails: PlaidConnectionDetails;
|
|
43
44
|
currentStep: OnboardingStep;
|
|
44
45
|
uiState: OnboardingCustomerViewUIState;
|
|
46
|
+
subscriptionBillingAddress?: Address;
|
|
45
47
|
}
|
|
@@ -2,6 +2,6 @@ import { ActionsObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { fetchPaymentSources } from '../../cardPayment/cardPaymentViewReducer';
|
|
4
4
|
import { getPaymentAccounts } from '../../spendManagement/plaidAccount/plaidAccountViewReducer';
|
|
5
|
-
import { fetchBillingAccountsView } from '../settingsViewReducer';
|
|
6
|
-
export type ActionType = ReturnType<typeof fetchBillingAccountsView> | ReturnType<typeof fetchPaymentSources> | ReturnType<typeof getPaymentAccounts>;
|
|
5
|
+
import { fetchBillingAccountsView, fetchCompanyBillingAddress } from '../settingsViewReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchBillingAccountsView> | ReturnType<typeof fetchCompanyBillingAddress> | ReturnType<typeof fetchPaymentSources> | ReturnType<typeof getPaymentAccounts>;
|
|
7
7
|
export declare const fetchBillingAccountsListEpic: (actions$: ActionsObservable<ActionType>) => Observable<ActionType>;
|
|
@@ -6,10 +6,12 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const cardPaymentViewReducer_1 = require("../../cardPayment/cardPaymentViewReducer");
|
|
7
7
|
const plaidAccountViewReducer_1 = require("../../spendManagement/plaidAccount/plaidAccountViewReducer");
|
|
8
8
|
const settingsViewReducer_1 = require("../settingsViewReducer");
|
|
9
|
-
const fetchBillingAccountsListEpic = (actions$) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchBillingAccountsView.match), (0, operators_1.switchMap)(() => {
|
|
9
|
+
const fetchBillingAccountsListEpic = (actions$) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchBillingAccountsView.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
+
const { companyId } = action.payload;
|
|
10
11
|
return (0, rxjs_1.from)([
|
|
11
12
|
(0, cardPaymentViewReducer_1.fetchPaymentSources)(),
|
|
12
13
|
(0, plaidAccountViewReducer_1.getPaymentAccounts)('billing', 'billing_setup', false),
|
|
14
|
+
(0, settingsViewReducer_1.fetchCompanyBillingAddress)(companyId, false),
|
|
13
15
|
]);
|
|
14
16
|
}));
|
|
15
17
|
exports.fetchBillingAccountsListEpic = fetchBillingAccountsListEpic;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
|
+
import { updateCompanies } from '../../../entity/company/companyReducer';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
|
+
import { RootState } from '../../../reducer';
|
|
7
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
8
|
+
import { newAddressInLocalStore } from '../../addressView/addressViewReducer';
|
|
9
|
+
import { fetchCompanyBillingAddress, fetchCompanyBillingAddressFailure, fetchCompanyBillingAddressSuccess } from '../settingsViewReducer';
|
|
10
|
+
export type ActionType = ReturnType<typeof fetchCompanyBillingAddress> | ReturnType<typeof fetchCompanyBillingAddressSuccess> | ReturnType<typeof fetchCompanyBillingAddressFailure> | ReturnType<typeof openSnackbar> | ReturnType<typeof newAddressInLocalStore> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateAddresses>;
|
|
11
|
+
export declare const fetchCompanyBillingAddressEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchCompanyBillingAddressEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const addressReducer_1 = require("../../../entity/address/addressReducer");
|
|
7
|
+
const companyReducer_1 = require("../../../entity/company/companyReducer");
|
|
8
|
+
const companySelector_1 = require("../../../entity/company/companySelector");
|
|
9
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
10
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
11
|
+
const addressViewReducer_1 = require("../../addressView/addressViewReducer");
|
|
12
|
+
const settingsViewReducer_1 = require("../settingsViewReducer");
|
|
13
|
+
const fetchCompanyBillingAddressEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.fetchCompanyBillingAddress.match), (0, operators_1.switchMap)((action) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const { companyId, cacheOverride } = action.payload;
|
|
16
|
+
const { settingsViewState, companyState } = state$.value;
|
|
17
|
+
const company = (_a = (0, companySelector_1.getCompanyByCompanyId)(companyState, companyId)) === null || _a === void 0 ? void 0 : _a.company;
|
|
18
|
+
if (cacheOverride === true ||
|
|
19
|
+
company == null ||
|
|
20
|
+
settingsViewState.billingAddress.fetchState !== 'In-Progress') {
|
|
21
|
+
return zeniAPI
|
|
22
|
+
.getJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}?query={"view":"subscription_billing_address"}`)
|
|
23
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
24
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
25
|
+
const actions = [
|
|
26
|
+
(0, companyReducer_1.updateCompanies)({
|
|
27
|
+
payload: response.data.companies,
|
|
28
|
+
schema: {},
|
|
29
|
+
}),
|
|
30
|
+
(0, addressReducer_1.updateAddresses)(response.data.addresses),
|
|
31
|
+
(0, settingsViewReducer_1.fetchCompanyBillingAddressSuccess)(),
|
|
32
|
+
];
|
|
33
|
+
const subscriptionBillingAddressId = response.data.companies[0].subscription_billing_address_id;
|
|
34
|
+
const subscriptionBillingAddress = response.data.addresses.find((address) => address.address_id === subscriptionBillingAddressId);
|
|
35
|
+
if (subscriptionBillingAddress != null) {
|
|
36
|
+
actions.push((0, addressViewReducer_1.newAddressInLocalStore)({
|
|
37
|
+
addressType: 'subscription_billing_address',
|
|
38
|
+
addressToCreate: (0, addressReducer_1.mapAddressPayloadToAddress)(subscriptionBillingAddress),
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
return (0, rxjs_1.from)(actions);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
45
|
+
messageSection: 'billing_address_view',
|
|
46
|
+
messageText: 'failed',
|
|
47
|
+
type: 'error',
|
|
48
|
+
}), (0, settingsViewReducer_1.fetchCompanyBillingAddressFailure)(response.status));
|
|
49
|
+
}
|
|
50
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, settingsViewReducer_1.fetchCompanyBillingAddressFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Billing Address View errored out' +
|
|
51
|
+
JSON.stringify(error))))));
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
return (0, rxjs_1.of)((0, settingsViewReducer_1.fetchCompanyBillingAddressSuccess)());
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
exports.fetchCompanyBillingAddressEpic = fetchCompanyBillingAddressEpic;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { updateAddresses } from '../../../entity/address/addressReducer';
|
|
4
|
+
import { updateCompanies } from '../../../entity/company/companyReducer';
|
|
5
|
+
import { openSnackbar } from '../../../entity/snackbar/snackbarReducer';
|
|
6
|
+
import { RootState } from '../../../reducer';
|
|
7
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
8
|
+
import { saveCompanyBillingAddress, saveCompanyBillingAddressFailure, saveCompanyBillingAddressSuccess } from '../settingsViewReducer';
|
|
9
|
+
export type ActionType = ReturnType<typeof saveCompanyBillingAddress> | ReturnType<typeof saveCompanyBillingAddressFailure> | ReturnType<typeof saveCompanyBillingAddressSuccess> | ReturnType<typeof updateCompanies> | ReturnType<typeof updateAddresses> | ReturnType<typeof openSnackbar>;
|
|
10
|
+
export declare const saveCompanyBillingAddressEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.saveCompanyBillingAddressEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const addressReducer_1 = require("../../../entity/address/addressReducer");
|
|
7
|
+
const companyReducer_1 = require("../../../entity/company/companyReducer");
|
|
8
|
+
const snackbarReducer_1 = require("../../../entity/snackbar/snackbarReducer");
|
|
9
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
10
|
+
const addressViewPayload_1 = require("../../addressView/addressViewPayload");
|
|
11
|
+
const getCompanyView_1 = require("../../companyView/selectorHelpers/getCompanyView");
|
|
12
|
+
const settingsViewReducer_1 = require("../settingsViewReducer");
|
|
13
|
+
const saveCompanyBillingAddressEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(settingsViewReducer_1.saveCompanyBillingAddress.match), (0, operators_1.mergeMap)((action) => {
|
|
14
|
+
const { companyId } = action.payload;
|
|
15
|
+
let payload;
|
|
16
|
+
const { newAddressState } = state$.value.addressViewState;
|
|
17
|
+
const companyView = (0, getCompanyView_1.getCompanyView)(state$.value, companyId, []);
|
|
18
|
+
if (companyView != null &&
|
|
19
|
+
(newAddressState === null || newAddressState === void 0 ? void 0 : newAddressState.subscription_billing_address.addressToCreate) != null) {
|
|
20
|
+
payload = prepareEditBillingAddressPayload(newAddressState.subscription_billing_address.addressToCreate, companyView.company.company.companyInfo.syncToken);
|
|
21
|
+
return zeniAPI
|
|
22
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, payload)
|
|
23
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
24
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
25
|
+
const actions = [
|
|
26
|
+
(0, companyReducer_1.updateCompanies)({
|
|
27
|
+
payload: response.data.companies,
|
|
28
|
+
schema: {},
|
|
29
|
+
}),
|
|
30
|
+
(0, addressReducer_1.updateAddresses)(response.data.addresses),
|
|
31
|
+
];
|
|
32
|
+
actions.push((0, snackbarReducer_1.openSnackbar)({
|
|
33
|
+
messageSection: 'billing_address_view',
|
|
34
|
+
messageText: 'success',
|
|
35
|
+
type: 'success',
|
|
36
|
+
}), (0, settingsViewReducer_1.saveCompanyBillingAddressSuccess)());
|
|
37
|
+
return (0, rxjs_1.from)(actions);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return (0, rxjs_1.of)((0, snackbarReducer_1.openSnackbar)({
|
|
41
|
+
messageSection: 'billing_address_view',
|
|
42
|
+
messageText: 'failed',
|
|
43
|
+
type: 'error',
|
|
44
|
+
}), (0, settingsViewReducer_1.saveCompanyBillingAddressFailure)(response.status));
|
|
45
|
+
}
|
|
46
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, settingsViewReducer_1.saveCompanyBillingAddressFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Save Billing Address Details errored out' +
|
|
47
|
+
JSON.stringify(error))))));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return (0, rxjs_1.from)([]);
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
exports.saveCompanyBillingAddressEpic = saveCompanyBillingAddressEpic;
|
|
54
|
+
/**
|
|
55
|
+
* Helpers
|
|
56
|
+
*/
|
|
57
|
+
const prepareEditBillingAddressPayload = (address, syncToken) => {
|
|
58
|
+
const addressPayload = (0, addressViewPayload_1.toAddressUpdatableInfoPayload)(address);
|
|
59
|
+
return {
|
|
60
|
+
company: {
|
|
61
|
+
sync_token: syncToken,
|
|
62
|
+
subscription_billing_address: addressPayload,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AddressPayload } from '../../entity/address/addressPayload';
|
|
2
|
+
import { CompanyPayload } from '../../entity/company/companyPayload';
|
|
2
3
|
import { UserPayload } from '../../entity/user/userPayload';
|
|
3
4
|
import { UserRolePayload } from '../../entity/userRole/userRolePayload';
|
|
4
5
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
@@ -38,5 +39,10 @@ export type NotificationSettingsResponse = ZeniAPIResponse<NotificationSettingsP
|
|
|
38
39
|
interface RefreshQBOPayload {
|
|
39
40
|
message: string;
|
|
40
41
|
}
|
|
42
|
+
export interface BillingAddressViewPayload {
|
|
43
|
+
addresses: AddressPayload[];
|
|
44
|
+
companies: CompanyPayload[];
|
|
45
|
+
}
|
|
46
|
+
export type BillingAddressViewResponse = ZeniAPIResponse<BillingAddressViewPayload>;
|
|
41
47
|
export type RefreshQBOResponse = ZeniAPIResponse<RefreshQBOPayload>;
|
|
42
48
|
export {};
|
|
@@ -14,7 +14,10 @@ export declare const fetchMyProfileView: import("@reduxjs/toolkit").ActionCreato
|
|
|
14
14
|
userId: string;
|
|
15
15
|
}, "settings/updateMyProfileOnSuccess", never, never>, updateMyProfileOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "settings/updateMyProfileOnFailure">, fetchBankConnectionsView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride: any], {
|
|
16
16
|
cacheOverride: any;
|
|
17
|
-
}, "settings/fetchBankConnectionsView", never, never>, fetchBillingAccountsView: import("@reduxjs/toolkit").
|
|
17
|
+
}, "settings/fetchBankConnectionsView", never, never>, fetchBillingAccountsView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, cacheOverride: boolean], {
|
|
18
|
+
companyId: string;
|
|
19
|
+
cacheOverride: boolean;
|
|
20
|
+
}, "settings/fetchBillingAccountsView", never, never>, updateBankConnectionOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
21
|
bankAccountIds: ID[];
|
|
19
22
|
}, "settings/updateBankConnectionOnSuccess">, updateBankConnectionOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "settings/updateBankConnectionOnFailure">, fetchBankAccountsList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/fetchBankAccountsList">, fetchNotificationSettings: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/fetchNotificationSettings">, updateNotificationSettingsOnSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[data: NotificationSettingsPayload, loggedInUserEmail: string], {
|
|
20
23
|
data: NotificationSettingsPayload;
|
|
@@ -33,6 +36,11 @@ export declare const fetchMyProfileView: import("@reduxjs/toolkit").ActionCreato
|
|
|
33
36
|
address: AddressUpdatableInfo | undefined;
|
|
34
37
|
}, "settings/updateMyProfile", never, never>, updateMyProfileFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "settings/updateMyProfileFailure">, updateMyProfileSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/updateMyProfileSuccess">, sendOtpMyProfile: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/sendOtpMyProfile">, sendOtpMyProfileFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "settings/sendOtpMyProfileFailure">, sendOtpMyProfileSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
35
38
|
otpChallenge: string;
|
|
36
|
-
}, "settings/sendOtpMyProfileSuccess">, resendOtpMyProfile: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/resendOtpMyProfile">, verifyOtpMyProfile: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/verifyOtpMyProfile">, verifyOtpMyProfileFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "settings/verifyOtpMyProfileFailure">, verifyOtpMyProfileSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/verifyOtpMyProfileSuccess">,
|
|
39
|
+
}, "settings/sendOtpMyProfileSuccess">, resendOtpMyProfile: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/resendOtpMyProfile">, verifyOtpMyProfile: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/verifyOtpMyProfile">, verifyOtpMyProfileFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "settings/verifyOtpMyProfileFailure">, verifyOtpMyProfileSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/verifyOtpMyProfileSuccess">, fetchCompanyBillingAddress: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, cacheOverride: boolean], {
|
|
40
|
+
companyId: string;
|
|
41
|
+
cacheOverride: boolean;
|
|
42
|
+
}, "settings/fetchCompanyBillingAddress", never, never>, fetchCompanyBillingAddressSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/fetchCompanyBillingAddressSuccess">, fetchCompanyBillingAddressFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "settings/fetchCompanyBillingAddressFailure">, saveCompanyBillingAddress: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
43
|
+
companyId: string;
|
|
44
|
+
}, "settings/saveCompanyBillingAddress", never, never>, saveCompanyBillingAddressSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/saveCompanyBillingAddressSuccess">, saveCompanyBillingAddressFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "settings/saveCompanyBillingAddressFailure">, clearSettingsView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"settings/clearSettingsView">;
|
|
37
45
|
declare const _default: import("redux").Reducer<SettingsViewState>;
|
|
38
46
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearSettingsView = exports.verifyOtpMyProfileSuccess = exports.verifyOtpMyProfileFailure = exports.verifyOtpMyProfile = exports.resendOtpMyProfile = exports.sendOtpMyProfileSuccess = exports.sendOtpMyProfileFailure = exports.sendOtpMyProfile = exports.updateMyProfileSuccess = exports.updateMyProfileFailure = exports.updateMyProfile = exports.updateMyProfileLocalData = exports.initializeMyProfileLocalData = exports.updateSettingsViewUIState = exports.refreshQBODataFailure = exports.refreshQBODataSuccess = exports.refreshQBOData = exports.resetNotificationSettingsUpdateStatus = exports.updateNotificationSettingsOnSaveFailure = exports.updateNotificationSettingsOnSaveSuccess = exports.saveNotificationSettings = exports.resetNotificationSettingsLocalData = exports.updateNotificationSettingsLocalData = exports.updateNotificationSettingsOnFailure = exports.updateNotificationSettingsOnSuccess = exports.fetchNotificationSettings = exports.fetchBankAccountsList = exports.updateBankConnectionOnFailure = exports.updateBankConnectionOnSuccess = exports.fetchBillingAccountsView = exports.fetchBankConnectionsView = exports.updateMyProfileOnFailure = exports.updateMyProfileOnSuccess = exports.fetchNotificationSettingsView = exports.fetchMyProfile = exports.fetchMyProfileView = exports.initialState = void 0;
|
|
4
|
+
exports.clearSettingsView = exports.saveCompanyBillingAddressFailure = exports.saveCompanyBillingAddressSuccess = exports.saveCompanyBillingAddress = exports.fetchCompanyBillingAddressFailure = exports.fetchCompanyBillingAddressSuccess = exports.fetchCompanyBillingAddress = exports.verifyOtpMyProfileSuccess = exports.verifyOtpMyProfileFailure = exports.verifyOtpMyProfile = exports.resendOtpMyProfile = exports.sendOtpMyProfileSuccess = exports.sendOtpMyProfileFailure = exports.sendOtpMyProfile = exports.updateMyProfileSuccess = exports.updateMyProfileFailure = exports.updateMyProfile = exports.updateMyProfileLocalData = exports.initializeMyProfileLocalData = exports.updateSettingsViewUIState = exports.refreshQBODataFailure = exports.refreshQBODataSuccess = exports.refreshQBOData = exports.resetNotificationSettingsUpdateStatus = exports.updateNotificationSettingsOnSaveFailure = exports.updateNotificationSettingsOnSaveSuccess = exports.saveNotificationSettings = exports.resetNotificationSettingsLocalData = exports.updateNotificationSettingsLocalData = exports.updateNotificationSettingsOnFailure = exports.updateNotificationSettingsOnSuccess = exports.fetchNotificationSettings = exports.fetchBankAccountsList = exports.updateBankConnectionOnFailure = exports.updateBankConnectionOnSuccess = exports.fetchBillingAccountsView = exports.fetchBankConnectionsView = exports.updateMyProfileOnFailure = exports.updateMyProfileOnSuccess = exports.fetchNotificationSettingsView = exports.fetchMyProfile = exports.fetchMyProfileView = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const settingsViewState_1 = require("./settingsViewState");
|
|
7
7
|
const initialNotificationSettingsData = {
|
|
@@ -52,6 +52,14 @@ const initialNotificationSettingsLocalData = {
|
|
|
52
52
|
};
|
|
53
53
|
exports.initialState = {
|
|
54
54
|
profile: initialMyProfileState,
|
|
55
|
+
billingAddress: {
|
|
56
|
+
fetchState: 'Not-Started',
|
|
57
|
+
error: undefined,
|
|
58
|
+
subscriptionBillingAddressSaveStatus: {
|
|
59
|
+
fetchState: 'Not-Started',
|
|
60
|
+
error: undefined,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
55
63
|
bankConnection: {
|
|
56
64
|
fetchState: 'Not-Started',
|
|
57
65
|
error: undefined,
|
|
@@ -120,8 +128,18 @@ const settings = (0, toolkit_1.createSlice)({
|
|
|
120
128
|
};
|
|
121
129
|
},
|
|
122
130
|
},
|
|
123
|
-
fetchBillingAccountsView
|
|
124
|
-
|
|
131
|
+
fetchBillingAccountsView: {
|
|
132
|
+
reducer() {
|
|
133
|
+
// do nothing
|
|
134
|
+
},
|
|
135
|
+
prepare(companyId, cacheOverride) {
|
|
136
|
+
return {
|
|
137
|
+
payload: {
|
|
138
|
+
companyId,
|
|
139
|
+
cacheOverride,
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
},
|
|
125
143
|
},
|
|
126
144
|
fetchBankAccountsList(draft) {
|
|
127
145
|
draft.bankConnection.fetchState = 'In-Progress';
|
|
@@ -278,12 +296,49 @@ const settings = (0, toolkit_1.createSlice)({
|
|
|
278
296
|
draft.profile.verifyOtpStatus.fetchState = 'Error';
|
|
279
297
|
draft.profile.verifyOtpStatus.error = action.payload;
|
|
280
298
|
},
|
|
299
|
+
fetchCompanyBillingAddress: {
|
|
300
|
+
reducer() {
|
|
301
|
+
// Do nothing.
|
|
302
|
+
},
|
|
303
|
+
prepare(companyId, cacheOverride) {
|
|
304
|
+
return { payload: { companyId, cacheOverride } };
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
fetchCompanyBillingAddressSuccess(draft) {
|
|
308
|
+
draft.billingAddress.fetchState = 'Completed';
|
|
309
|
+
draft.billingAddress.error = undefined;
|
|
310
|
+
},
|
|
311
|
+
fetchCompanyBillingAddressFailure(draft, action) {
|
|
312
|
+
draft.billingAddress.fetchState = 'Error';
|
|
313
|
+
draft.billingAddress.error = action.payload;
|
|
314
|
+
},
|
|
315
|
+
saveCompanyBillingAddress: {
|
|
316
|
+
reducer(draft) {
|
|
317
|
+
draft.billingAddress.subscriptionBillingAddressSaveStatus.fetchState =
|
|
318
|
+
'In-Progress';
|
|
319
|
+
},
|
|
320
|
+
prepare(companyId) {
|
|
321
|
+
return { payload: { companyId } };
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
saveCompanyBillingAddressSuccess(draft) {
|
|
325
|
+
draft.billingAddress.subscriptionBillingAddressSaveStatus.fetchState =
|
|
326
|
+
'Completed';
|
|
327
|
+
draft.billingAddress.subscriptionBillingAddressSaveStatus.error =
|
|
328
|
+
undefined;
|
|
329
|
+
},
|
|
330
|
+
saveCompanyBillingAddressFailure(draft, action) {
|
|
331
|
+
draft.billingAddress.subscriptionBillingAddressSaveStatus.fetchState =
|
|
332
|
+
'Error';
|
|
333
|
+
draft.billingAddress.subscriptionBillingAddressSaveStatus.error =
|
|
334
|
+
action.payload;
|
|
335
|
+
},
|
|
281
336
|
clearSettingsView(draft) {
|
|
282
337
|
Object.assign(draft, exports.initialState);
|
|
283
338
|
},
|
|
284
339
|
},
|
|
285
340
|
});
|
|
286
|
-
_a = settings.actions, exports.fetchMyProfileView = _a.fetchMyProfileView, exports.fetchMyProfile = _a.fetchMyProfile, exports.fetchNotificationSettingsView = _a.fetchNotificationSettingsView, exports.updateMyProfileOnSuccess = _a.updateMyProfileOnSuccess, exports.updateMyProfileOnFailure = _a.updateMyProfileOnFailure, exports.fetchBankConnectionsView = _a.fetchBankConnectionsView, exports.fetchBillingAccountsView = _a.fetchBillingAccountsView, exports.updateBankConnectionOnSuccess = _a.updateBankConnectionOnSuccess, exports.updateBankConnectionOnFailure = _a.updateBankConnectionOnFailure, exports.fetchBankAccountsList = _a.fetchBankAccountsList, exports.fetchNotificationSettings = _a.fetchNotificationSettings, exports.updateNotificationSettingsOnSuccess = _a.updateNotificationSettingsOnSuccess, exports.updateNotificationSettingsOnFailure = _a.updateNotificationSettingsOnFailure, exports.updateNotificationSettingsLocalData = _a.updateNotificationSettingsLocalData, exports.resetNotificationSettingsLocalData = _a.resetNotificationSettingsLocalData, exports.saveNotificationSettings = _a.saveNotificationSettings, exports.updateNotificationSettingsOnSaveSuccess = _a.updateNotificationSettingsOnSaveSuccess, exports.updateNotificationSettingsOnSaveFailure = _a.updateNotificationSettingsOnSaveFailure, exports.resetNotificationSettingsUpdateStatus = _a.resetNotificationSettingsUpdateStatus, exports.refreshQBOData = _a.refreshQBOData, exports.refreshQBODataSuccess = _a.refreshQBODataSuccess, exports.refreshQBODataFailure = _a.refreshQBODataFailure, exports.updateSettingsViewUIState = _a.updateSettingsViewUIState, exports.initializeMyProfileLocalData = _a.initializeMyProfileLocalData, exports.updateMyProfileLocalData = _a.updateMyProfileLocalData, exports.updateMyProfile = _a.updateMyProfile, exports.updateMyProfileFailure = _a.updateMyProfileFailure, exports.updateMyProfileSuccess = _a.updateMyProfileSuccess, exports.sendOtpMyProfile = _a.sendOtpMyProfile, exports.sendOtpMyProfileFailure = _a.sendOtpMyProfileFailure, exports.sendOtpMyProfileSuccess = _a.sendOtpMyProfileSuccess, exports.resendOtpMyProfile = _a.resendOtpMyProfile, exports.verifyOtpMyProfile = _a.verifyOtpMyProfile, exports.verifyOtpMyProfileFailure = _a.verifyOtpMyProfileFailure, exports.verifyOtpMyProfileSuccess = _a.verifyOtpMyProfileSuccess, exports.clearSettingsView = _a.clearSettingsView;
|
|
341
|
+
_a = settings.actions, exports.fetchMyProfileView = _a.fetchMyProfileView, exports.fetchMyProfile = _a.fetchMyProfile, exports.fetchNotificationSettingsView = _a.fetchNotificationSettingsView, exports.updateMyProfileOnSuccess = _a.updateMyProfileOnSuccess, exports.updateMyProfileOnFailure = _a.updateMyProfileOnFailure, exports.fetchBankConnectionsView = _a.fetchBankConnectionsView, exports.fetchBillingAccountsView = _a.fetchBillingAccountsView, exports.updateBankConnectionOnSuccess = _a.updateBankConnectionOnSuccess, exports.updateBankConnectionOnFailure = _a.updateBankConnectionOnFailure, exports.fetchBankAccountsList = _a.fetchBankAccountsList, exports.fetchNotificationSettings = _a.fetchNotificationSettings, exports.updateNotificationSettingsOnSuccess = _a.updateNotificationSettingsOnSuccess, exports.updateNotificationSettingsOnFailure = _a.updateNotificationSettingsOnFailure, exports.updateNotificationSettingsLocalData = _a.updateNotificationSettingsLocalData, exports.resetNotificationSettingsLocalData = _a.resetNotificationSettingsLocalData, exports.saveNotificationSettings = _a.saveNotificationSettings, exports.updateNotificationSettingsOnSaveSuccess = _a.updateNotificationSettingsOnSaveSuccess, exports.updateNotificationSettingsOnSaveFailure = _a.updateNotificationSettingsOnSaveFailure, exports.resetNotificationSettingsUpdateStatus = _a.resetNotificationSettingsUpdateStatus, exports.refreshQBOData = _a.refreshQBOData, exports.refreshQBODataSuccess = _a.refreshQBODataSuccess, exports.refreshQBODataFailure = _a.refreshQBODataFailure, exports.updateSettingsViewUIState = _a.updateSettingsViewUIState, exports.initializeMyProfileLocalData = _a.initializeMyProfileLocalData, exports.updateMyProfileLocalData = _a.updateMyProfileLocalData, exports.updateMyProfile = _a.updateMyProfile, exports.updateMyProfileFailure = _a.updateMyProfileFailure, exports.updateMyProfileSuccess = _a.updateMyProfileSuccess, exports.sendOtpMyProfile = _a.sendOtpMyProfile, exports.sendOtpMyProfileFailure = _a.sendOtpMyProfileFailure, exports.sendOtpMyProfileSuccess = _a.sendOtpMyProfileSuccess, exports.resendOtpMyProfile = _a.resendOtpMyProfile, exports.verifyOtpMyProfile = _a.verifyOtpMyProfile, exports.verifyOtpMyProfileFailure = _a.verifyOtpMyProfileFailure, exports.verifyOtpMyProfileSuccess = _a.verifyOtpMyProfileSuccess, exports.fetchCompanyBillingAddress = _a.fetchCompanyBillingAddress, exports.fetchCompanyBillingAddressSuccess = _a.fetchCompanyBillingAddressSuccess, exports.fetchCompanyBillingAddressFailure = _a.fetchCompanyBillingAddressFailure, exports.saveCompanyBillingAddress = _a.saveCompanyBillingAddress, exports.saveCompanyBillingAddressSuccess = _a.saveCompanyBillingAddressSuccess, exports.saveCompanyBillingAddressFailure = _a.saveCompanyBillingAddressFailure, exports.clearSettingsView = _a.clearSettingsView;
|
|
287
342
|
exports.default = settings.reducer;
|
|
288
343
|
/**
|
|
289
344
|
* Helpers
|
|
@@ -112,15 +112,19 @@ function getBankConnectionsSetupViewDetails(state, companyId, isBillPayEnabled,
|
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
function getBillingAccountsViewDetails(state, companyId) {
|
|
115
|
-
|
|
115
|
+
var _a;
|
|
116
|
+
const { plaidAccountViewState, settingsViewState, addressViewState } = state;
|
|
116
117
|
const { uiState } = settingsViewState;
|
|
117
118
|
const fetchState = (0, reduceFetchState_1.reduceAnyFetchState)([
|
|
118
119
|
settingsViewState.bankConnection,
|
|
119
120
|
plaidAccountViewState['billing_setup'].accountDetails.fetchStatus,
|
|
120
121
|
]);
|
|
122
|
+
const subscriptionBillingAddress = (_a = addressViewState.newAddressState) === null || _a === void 0 ? void 0 : _a.subscription_billing_address.addressToCreate;
|
|
121
123
|
return {
|
|
122
124
|
setupView: Object.assign({}, (0, setupViewSelector_1.getCommonSetupViewDetails)(state, companyId, 'billing', 'billing_setup')),
|
|
123
125
|
uiState,
|
|
126
|
+
subscriptionBillingAddress: subscriptionBillingAddress,
|
|
127
|
+
subscriptionBillingAddressSaveStatus: settingsViewState.billingAddress.subscriptionBillingAddressSaveStatus,
|
|
124
128
|
cardPaymentView: (0, cardPaymentViewSelector_1.getAllCardsAndBankPaymentMethods)(state),
|
|
125
129
|
fetchState: fetchState.fetchState,
|
|
126
130
|
};
|
|
@@ -3,6 +3,9 @@ import { ZeniDate } from '../../zeniDayJS';
|
|
|
3
3
|
interface BankConnection extends FetchStateAndError {
|
|
4
4
|
bankAccountIds: ID[];
|
|
5
5
|
}
|
|
6
|
+
interface BillingAddress extends FetchStateAndError {
|
|
7
|
+
subscriptionBillingAddressSaveStatus: FetchStateAndError;
|
|
8
|
+
}
|
|
6
9
|
export interface IntegrationsSettings {
|
|
7
10
|
refreshQBO: FetchStateAndError;
|
|
8
11
|
}
|
|
@@ -66,6 +69,7 @@ export interface SettingsViewState {
|
|
|
66
69
|
notification: NotificationSettings;
|
|
67
70
|
integrations: IntegrationsSettings;
|
|
68
71
|
uiState: SettingsViewUIState;
|
|
72
|
+
billingAddress: BillingAddress;
|
|
69
73
|
}
|
|
70
74
|
export type SettingsViewUIState = {
|
|
71
75
|
isCardPaymentPopupOpen: boolean;
|
|
@@ -9,7 +9,7 @@ import { PaymentAccount } from '../../../entity/paymentAccount/paymentAccountSta
|
|
|
9
9
|
import { TenantExternalConnections } from '../../../entity/tenant/tenantState';
|
|
10
10
|
import { User } from '../../../entity/user/userState';
|
|
11
11
|
import { UserRole } from '../../../entity/userRole/userRoleState';
|
|
12
|
-
import { NewAddressData } from '../../addressView/addressViewState';
|
|
12
|
+
import { AddressUpdatableInfo, NewAddressData } from '../../addressView/addressViewState';
|
|
13
13
|
import { CardPaymentSelectorView } from '../../cardPayment/cardPaymentViewSelector';
|
|
14
14
|
import { Person } from '../../people/peopleSelectorTypes';
|
|
15
15
|
import { FundingAccount, SetupView } from '../../spendManagement/commonSetup/setupViewSelector';
|
|
@@ -50,6 +50,8 @@ export interface BillingView extends FetchStateAndError {
|
|
|
50
50
|
setupView: SetupView;
|
|
51
51
|
cardPaymentView: CardPaymentSelectorView;
|
|
52
52
|
uiState: SettingsViewUIState;
|
|
53
|
+
subscriptionBillingAddressSaveStatus: FetchStateAndError;
|
|
54
|
+
subscriptionBillingAddress?: AddressUpdatableInfo;
|
|
53
55
|
}
|
|
54
56
|
export interface ProductWisePrimaryAccount extends SetupView {
|
|
55
57
|
productType: SpendManagementEntityType;
|
package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js
CHANGED
|
@@ -134,5 +134,9 @@ function toSetupViewLocalData(company, users, userRoles, primaryContact) {
|
|
|
134
134
|
areAdditionalDocumentsSubmittedForVerification: false,
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
|
-
return {
|
|
137
|
+
return {
|
|
138
|
+
companyDetails,
|
|
139
|
+
officers,
|
|
140
|
+
primaryContactDetails,
|
|
141
|
+
};
|
|
138
142
|
}
|
|
@@ -62,6 +62,7 @@ export interface CompanyDetailsVerificationPayload {
|
|
|
62
62
|
company_inc_type: string;
|
|
63
63
|
company_inc_date: string | null;
|
|
64
64
|
is_new_company_industry_verified: boolean;
|
|
65
|
+
subscription_billing_address?: AddressUpdatableInfoPayload;
|
|
65
66
|
}
|
|
66
67
|
export interface BusinessVerificationDataPayload {
|
|
67
68
|
company_officer: Partial<CompanyOfficerVerificationPayload> | Partial<NewCompanyOfficerVerificationPayload>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.14.
|
|
3
|
+
"version": "4.14.61",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -96,6 +96,7 @@
|
|
|
96
96
|
"create-release-branch": "chmod +x ./scripts/create_release_branch.sh && ./scripts/create_release_branch.sh",
|
|
97
97
|
"bump-update-web-app-cockpit-beta": "chmod +x ./scripts/bump_and_update_web_app_ui_beta.sh && ./scripts/bump_and_update_web_app_ui_beta.sh",
|
|
98
98
|
"send-release-notes": "chmod +x ./scripts/send_release_notes.sh && ./scripts/send_release_notes.sh",
|
|
99
|
-
"update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh"
|
|
99
|
+
"update-slack-group-topic": "chmod +x ./scripts/update-slack-group-topic.sh && ./scripts/update-slack-group-topic.sh",
|
|
100
|
+
"build-beta-and-copy": "chmod +x ./scripts/build_and_copy.sh && ./scripts/build_and_copy.sh"
|
|
100
101
|
}
|
|
101
102
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function initialize3rdPartyExtensions(): void;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initialize3rdPartyExtensions = initialize3rdPartyExtensions;
|
|
4
|
-
/**
|
|
5
|
-
* Exported for testing purpose. Not intended to be used in any other place!
|
|
6
|
-
*/
|
|
7
|
-
let thirdPartyExtensionsInitialized = false;
|
|
8
|
-
function initialize3rdPartyExtensions() {
|
|
9
|
-
if (thirdPartyExtensionsInitialized) {
|
|
10
|
-
console.warn('3rd party extensions already initialized!');
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
thirdPartyExtensionsInitialized = true;
|
|
14
|
-
}
|