@zeniai/client-epic-state 4.16.0 → 4.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonStateTypes/animations.d.ts +1 -1
- package/lib/commonStateTypes/animations.js +1 -1
- package/lib/entity/chargeCard/chargeCard.d.ts +26 -8
- package/lib/entity/chargeCard/chargeCard.js +25 -6
- package/lib/entity/chargeCard/chargeCardPayload.d.ts +41 -5
- package/lib/entity/chargeCard/chargeCardPayload.js +20 -8
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.d.ts +1 -1
- package/lib/entity/chargeCardTransaction/chargeCardTransaction.js +5 -1
- package/lib/entity/company/companyPayload.d.ts +12 -1
- package/lib/entity/company/companyPayload.js +14 -0
- package/lib/entity/company/companyStateTypes.d.ts +11 -0
- package/lib/entity/connectedAccount/connectedAccount.d.ts +19 -0
- package/lib/entity/connectedAccount/connectedAccount.js +10 -0
- package/lib/entity/connectedAccount/connectedAccountPayload.d.ts +11 -0
- package/lib/entity/connectedAccount/connectedAccountPayload.js +15 -0
- package/lib/entity/connectedAccount/connectedAccountReducer.d.ts +6 -0
- package/lib/entity/connectedAccount/connectedAccountReducer.js +27 -0
- package/lib/entity/connectedAccount/connectedAccountSelector.d.ts +4 -0
- package/lib/entity/connectedAccount/connectedAccountSelector.js +17 -0
- package/lib/entity/depositAccount/depositAccount.d.ts +20 -2
- package/lib/entity/depositAccount/depositAccountPayload.d.ts +22 -1
- package/lib/entity/depositAccount/depositAccountPayload.js +39 -1
- package/lib/entity/depositAccount/depositAccountReducer.d.ts +2 -2
- package/lib/entity/depositAccount/depositAccountReducer.js +8 -2
- package/lib/entity/depositAccount/depositAccountSelector.d.ts +3 -1
- package/lib/entity/depositAccount/depositAccountSelector.js +10 -0
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +2 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +2 -1
- package/lib/entity/tenant/clearAllEpic.js +2 -0
- package/lib/entity/tenant/tenantSelector.d.ts +6 -2
- package/lib/entity/tenant/tenantSelector.js +10 -2
- package/lib/epic.d.ts +5 -1
- package/lib/epic.js +5 -1
- package/lib/index.d.ts +18 -18
- package/lib/index.js +26 -17
- package/lib/reducer.d.ts +3 -0
- package/lib/reducer.js +3 -0
- package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +8 -0
- package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +16 -0
- package/lib/view/addressView/addressViewState.d.ts +1 -1
- package/lib/view/dashboard/dashboardSelector.js +7 -6
- package/lib/view/expenseAutomationView/epics/accountRecon/updateReconcileTabLocalDataEpic.js +5 -4
- package/lib/view/expenseAutomationView/epics/common/fetchAllExpenseAutomationTabsEpic.js +1 -2
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/fetchFluxAnalysisViewEpic.js +18 -6
- package/lib/view/expenseAutomationView/epics/fluxAnalysis/reviewFluxAnalysisEpic.js +1 -4
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +7 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/initializeTransactionCategorizationLocalDataEpic.js +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/markTransactionAsNotMiscatgorizedEpic.js +3 -3
- package/lib/view/expenseAutomationView/helpers/helpers.js +4 -4
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +2 -2
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.js +27 -24
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.d.ts +22 -9
- package/lib/view/expenseAutomationView/payload/fluxAnalysisPayload.js +2 -2
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.d.ts +13 -5
- package/lib/view/expenseAutomationView/reducers/fluxAnalysisViewReducer.js +245 -115
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +4 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +14 -19
- package/lib/view/expenseAutomationView/selectorTypes/fluxAnalysisViewSelectorTypes.d.ts +29 -9
- package/lib/view/expenseAutomationView/selectors/fluxAnalysisViewSelector.js +108 -40
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +9 -1
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.d.ts +40 -15
- package/lib/view/expenseAutomationView/types/fluxAnalysisViewState.js +1 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -0
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -0
- package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js +4 -4
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.d.ts +2 -1
- package/lib/view/onboardingView/cockpitView/onboardingCockpitViewReducer.js +2 -2
- package/lib/view/settingsView/settingsViewHelpers.d.ts +4 -4
- package/lib/view/settingsView/settingsViewHelpers.js +9 -8
- package/lib/view/spendManagement/billPay/billPayReview/billPayReviewSelector.js +1 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.d.ts +6 -1
- package/lib/view/spendManagement/billPay/editBillView/editBillViewReducer.js +20 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +5 -0
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +9 -2
- package/lib/view/spendManagement/billPay/editBillView/editBillViewState.d.ts +1 -0
- package/lib/view/spendManagement/chargeCards/cardUserOnboarding/cardUserOnboardingSelector.js +4 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.d.ts +5 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigPayload.js +4 -2
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +8 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigState.d.ts +4 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.d.ts +12 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetail.js +26 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailPayload.d.ts +2 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.d.ts +43 -4
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +104 -9
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector.js +70 -16
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +12 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardTransactionListEpic.js +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchDepositAccountLimitEpic.js +41 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateChargeCardLimitEpic.js +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/updateDebitCardPinAttemptEpic.js +42 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +11 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +20 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListPayload.d.ts +16 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +6 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +30 -4
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +5 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +26 -14
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +20 -5
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.d.ts +7 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchDebitCardSummaryEpic.js +23 -0
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +4 -2
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts +2 -1
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +2 -0
- package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/acceptChargeCardTermsEpic.js +19 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.d.ts +6 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/depositAccountWithLimitPayload.js +2 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.d.ts +8 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchDepositAccountListForCardsEpic.js +31 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/fetchIssueCardPageEpic.js +15 -3
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +65 -25
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +11 -3
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +45 -11
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +6 -3
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +33 -18
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +41 -8
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.js +0 -21
- package/lib/view/spendManagement/commonSetup/epic/setup/enableSetupEpic.js +9 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +8 -3
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +4 -4
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -1
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +3 -1
- package/lib/view/spendManagement/commonSetup/setupViewState.js +13 -1
- package/lib/view/spendManagement/helpers.d.ts +3 -0
- package/lib/view/spendManagement/helpers.js +13 -1
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/getPaymentAccountsEpic.js +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountEpic.js +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountLoginStatusEpic.js +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/paymentAccounts/updatePaymentAccountStatusEpic.js +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.d.ts +2 -1
- package/lib/view/spendManagement/plaidAccount/epic/plaidConnection/establishPlaidConnectionEpic.js +6 -1
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.d.ts +10 -10
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewReducer.js +1 -0
- package/lib/view/spendManagement/plaidAccount/plaidAccountViewState.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/checkDeposit/checkDepositSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.d.ts +1 -1
- package/lib/view/spendManagement/zeniAccounts/depositAccountList/depositAccountListSelector.js +3 -3
- package/lib/view/spendManagement/zeniAccounts/expressPay/expressPaySelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/transferDetail/transferDetailSelector.js +1 -1
- package/lib/view/spendManagement/zeniAccounts/zeniAccountList/zeniAccountListSelector.js +1 -1
- package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.d.ts +4 -3
- package/lib/view/transactionDetail/epics/markTransactionAsNotMiscategorizedEpic.js +25 -1
- package/lib/view/transactionDetail/epics/saveTransactionDetailEpic.js +1 -1
- package/lib/view/transactionDetail/epics/updateTransactionDetailEpic.js +1 -1
- package/lib/view/transactionDetail/transactionDetailReducer.d.ts +4 -2
- package/lib/view/transactionDetail/transactionDetailReducer.js +4 -2
- package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +3 -2
- package/lib/view/twoFactorAuthentication/resendOtpEpic.js +44 -19
- package/lib/view/twoFactorAuthentication/sendOtpEpic.d.ts +2 -1
- package/lib/view/twoFactorAuthentication/sendOtpEpic.js +45 -18
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.d.ts +17 -5
- package/lib/view/twoFactorAuthentication/twoFactorAuthentication.js +33 -0
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.d.ts +7 -7
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationPayload.js +6 -6
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.d.ts +22 -6
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationReducer.js +176 -60
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.d.ts +5 -3
- package/lib/view/twoFactorAuthentication/twoFactorAuthenticationSelector.js +13 -2
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.d.ts +5 -2
- package/lib/view/twoFactorAuthentication/verifyOtpEpic.js +46 -5
- package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +2 -2
- package/lib/view/userListView/fetchUserListByTypeEpic.js +4 -3
- package/lib/view/userListView/userListViewPayload.d.ts +11 -0
- package/package.json +5 -4
|
@@ -5,28 +5,48 @@ import { ClassBase } from '../../../entity/class/classState';
|
|
|
5
5
|
import { User } from '../../../entity/user/userState';
|
|
6
6
|
import { Vendor } from '../../../entity/vendor/vendorState';
|
|
7
7
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
8
|
-
import { FluxAnalysisReviewStatus, FluxAnalysisViewUIState, FluxBalancesByMonth } from '../types/fluxAnalysisViewState';
|
|
9
|
-
export interface
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import { BalancesAndVariance, FluxAnalysisReviewStatus, FluxAnalysisViewUIState, FluxBalancesByMonth } from '../types/fluxAnalysisViewState';
|
|
9
|
+
export interface FluxVendorAccountsAndClassesView {
|
|
10
|
+
varianceAmount: number;
|
|
11
|
+
variancePercentage: number;
|
|
12
12
|
accountBase: AccountBase | undefined;
|
|
13
13
|
classBase: ClassBase | undefined;
|
|
14
|
+
currency: Currency;
|
|
15
|
+
balancesByMonth?: FluxBalancesByMonth;
|
|
16
|
+
}
|
|
17
|
+
export interface FluxAnalysisOperatingExpenseView extends BalancesAndVariance {
|
|
18
|
+
fluxAnalysisEntityId: ID;
|
|
19
|
+
vendorAccountsAndClasses: FluxVendorAccountsAndClassesView[];
|
|
14
20
|
reviewedByUser: User | undefined;
|
|
15
|
-
varianceAmount: number;
|
|
16
|
-
variancePercentage: number;
|
|
17
21
|
currency: Currency;
|
|
18
22
|
anomalyReason: string;
|
|
19
23
|
status: FluxAnalysisReviewStatus;
|
|
20
|
-
balancesByMonth?: FluxBalancesByMonth;
|
|
21
|
-
reviewStatus: FetchStateAndError;
|
|
22
24
|
}
|
|
25
|
+
export interface FluxAnalysisVendorView extends BalancesAndVariance {
|
|
26
|
+
fluxAnalysisEntityId: ID;
|
|
27
|
+
vendor: Vendor;
|
|
28
|
+
reviewedByUser: User | undefined;
|
|
29
|
+
currency: Currency;
|
|
30
|
+
anomalyReason: string;
|
|
31
|
+
status: FluxAnalysisReviewStatus;
|
|
32
|
+
vendorAccountsAndClasses: FluxVendorAccountsAndClassesView[];
|
|
33
|
+
}
|
|
34
|
+
export interface FluxAnalysisViewSectionReport extends BalancesAndVariance {
|
|
35
|
+
sectionId: FluxAnalysisSectionType;
|
|
36
|
+
vendors: FluxAnalysisVendorView[];
|
|
37
|
+
fetchStatus: FetchStateAndError;
|
|
38
|
+
}
|
|
39
|
+
export type FluxAnalysisSectionType = 'generalExpense' | 'reimbursement';
|
|
23
40
|
export interface ExpenseAutomationFluxAnalysisViewSelector {
|
|
24
|
-
|
|
41
|
+
sections: Record<FluxAnalysisSectionType, FluxAnalysisViewSectionReport>;
|
|
42
|
+
totalBalancesAndVariance: BalancesAndVariance | undefined;
|
|
25
43
|
reviewOperatingExpensesIds: ID[];
|
|
44
|
+
selectedSectionIds: FluxAnalysisSectionType[];
|
|
26
45
|
fetchStatus: FetchStateAndError;
|
|
27
46
|
refreshStatus: FetchStateAndError;
|
|
28
47
|
bulkReviewStatus: FetchStateAndError;
|
|
29
48
|
uiState: FluxAnalysisViewUIState;
|
|
49
|
+
currency: Currency;
|
|
30
50
|
lastRefreshSuccessTime?: ZeniDate;
|
|
31
51
|
completionStatus: CompletionStatusType;
|
|
32
52
|
}
|
|
@@ -9,9 +9,9 @@ const userSelector_1 = require("../../../entity/user/userSelector");
|
|
|
9
9
|
const vendorSelector_1 = require("../../../entity/vendor/vendorSelector");
|
|
10
10
|
const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAutomationViewSelectorTypes");
|
|
11
11
|
function getExpenseAutomationFluxAnalysisView(state) {
|
|
12
|
-
var _a;
|
|
12
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
13
13
|
const { expenseAutomationFluxAnalysisViewState, monthEndCloseChecksState } = state;
|
|
14
|
-
const { fetchState, error, refreshStatus, uiState,
|
|
14
|
+
const { fetchState, error, refreshStatus, uiState, reviewOperatingExpenseIdsByPeriod, selectedSectionIdsByPeriod, groupsBySelectedPeriod, fluxAnalysisEntities, bulkReviewStatus, currency, totalBalancesAndVariance, } = expenseAutomationFluxAnalysisViewState;
|
|
15
15
|
const fetchStateAndError = {
|
|
16
16
|
fetchState,
|
|
17
17
|
error,
|
|
@@ -20,57 +20,125 @@ function getExpenseAutomationFluxAnalysisView(state) {
|
|
|
20
20
|
const { selectedPeriodByTenantId } = state.expenseAutomationViewState;
|
|
21
21
|
const selectedPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
22
22
|
const monthYearPeriodId = selectedPeriod != null ? (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod) : null;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
const reviewOperatingExpensesIds = selectedPeriod != null &&
|
|
24
|
+
reviewOperatingExpenseIdsByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)] !=
|
|
25
|
+
null
|
|
26
|
+
? reviewOperatingExpenseIdsByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
|
|
27
|
+
: [];
|
|
28
|
+
const selectedSectionIds = selectedPeriod != null
|
|
29
|
+
? ((_a = selectedSectionIdsByPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]) !== null && _a !== void 0 ? _a : [])
|
|
30
|
+
: [];
|
|
31
|
+
const generalExpenseState = selectedPeriod != null
|
|
32
|
+
? (_b = groupsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]) === null || _b === void 0 ? void 0 : _b.generalExpense
|
|
33
|
+
: undefined;
|
|
34
|
+
const reimbursementOpExState = selectedPeriod != null
|
|
35
|
+
? (_c = groupsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]) === null || _c === void 0 ? void 0 : _c.reimbursement
|
|
36
|
+
: undefined;
|
|
37
|
+
const generalExpenseIdsForCurrentPeriod = monthYearPeriodId != null && generalExpenseState != null
|
|
38
|
+
? generalExpenseState.operatingExpenseIds
|
|
39
|
+
: [];
|
|
40
|
+
const reimbursementIdsForCurrentPeriod = monthYearPeriodId != null && reimbursementOpExState != null
|
|
41
|
+
? reimbursementOpExState.operatingExpenseIds
|
|
42
|
+
: [];
|
|
43
|
+
const generalExpenses = [];
|
|
44
|
+
const reimbursements = [];
|
|
45
|
+
const expenseMap = new Map(fluxAnalysisEntities.operatingExpenses.map((e) => [
|
|
46
|
+
e.fluxAnalysisEntityId,
|
|
47
|
+
e,
|
|
48
|
+
]));
|
|
49
|
+
generalExpenseIdsForCurrentPeriod.forEach((opExId) => {
|
|
50
|
+
const fluxEntity = expenseMap.get(opExId);
|
|
51
|
+
if (fluxEntity != null) {
|
|
52
|
+
generalExpenses.push(fluxEntity);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
reimbursementIdsForCurrentPeriod.forEach((opExId) => {
|
|
56
|
+
const fluxEntity = fluxAnalysisEntities.operatingExpenses.find((fluxEntity) => fluxEntity.fluxAnalysisEntityId === opExId);
|
|
29
57
|
if (fluxEntity != null) {
|
|
30
|
-
|
|
58
|
+
reimbursements.push(fluxEntity);
|
|
31
59
|
}
|
|
32
60
|
});
|
|
33
61
|
const allSteps = monthYearPeriodId != null
|
|
34
62
|
? (0, expenseAutomationViewSelectorTypes_1.getAllSteps)(monthEndCloseChecksState, monthYearPeriodId, currentTenant.tenantId)
|
|
35
63
|
: [];
|
|
36
|
-
const fluxCompletionStatus = (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
const fluxCompletionStatus = (_d = allSteps.find((step) => step.step === 'flux_analysis')) === null || _d === void 0 ? void 0 : _d.completionStatus;
|
|
65
|
+
// Get general expense vendors using map and filter
|
|
66
|
+
const generalExpenseVendors = generalExpenses
|
|
67
|
+
.map((operatingExpense) => mapOperatingExpenseToVendorView(state, operatingExpense))
|
|
68
|
+
.filter((vendorView) => vendorView !== null);
|
|
69
|
+
// Get reimbursement vendors using map and filter
|
|
70
|
+
const reimbursementVendors = reimbursements
|
|
71
|
+
.map((operatingExpense) => mapOperatingExpenseToVendorView(state, operatingExpense))
|
|
72
|
+
.filter((vendorView) => vendorView !== null);
|
|
73
|
+
const sections = {
|
|
74
|
+
generalExpense: {
|
|
75
|
+
sectionId: 'generalExpense',
|
|
76
|
+
vendors: generalExpenseVendors,
|
|
77
|
+
fetchStatus: (_e = generalExpenseState === null || generalExpenseState === void 0 ? void 0 : generalExpenseState.fetchStatus) !== null && _e !== void 0 ? _e : {
|
|
78
|
+
fetchState: 'Not-Started',
|
|
79
|
+
},
|
|
80
|
+
balancesByMonth: (_f = generalExpenseState === null || generalExpenseState === void 0 ? void 0 : generalExpenseState.total) === null || _f === void 0 ? void 0 : _f.balancesByMonth,
|
|
81
|
+
varianceAmount: (_h = (_g = generalExpenseState === null || generalExpenseState === void 0 ? void 0 : generalExpenseState.total) === null || _g === void 0 ? void 0 : _g.varianceAmount) !== null && _h !== void 0 ? _h : 0,
|
|
82
|
+
variancePercentage: (_k = (_j = generalExpenseState === null || generalExpenseState === void 0 ? void 0 : generalExpenseState.total) === null || _j === void 0 ? void 0 : _j.variancePercentage) !== null && _k !== void 0 ? _k : 0,
|
|
83
|
+
},
|
|
84
|
+
reimbursement: {
|
|
85
|
+
sectionId: 'reimbursement',
|
|
86
|
+
vendors: reimbursementVendors,
|
|
87
|
+
fetchStatus: (_l = reimbursementOpExState === null || reimbursementOpExState === void 0 ? void 0 : reimbursementOpExState.fetchStatus) !== null && _l !== void 0 ? _l : {
|
|
88
|
+
fetchState: 'Not-Started',
|
|
89
|
+
},
|
|
90
|
+
balancesByMonth: (_m = reimbursementOpExState === null || reimbursementOpExState === void 0 ? void 0 : reimbursementOpExState.total) === null || _m === void 0 ? void 0 : _m.balancesByMonth,
|
|
91
|
+
varianceAmount: (_p = (_o = reimbursementOpExState === null || reimbursementOpExState === void 0 ? void 0 : reimbursementOpExState.total) === null || _o === void 0 ? void 0 : _o.varianceAmount) !== null && _p !== void 0 ? _p : 0,
|
|
92
|
+
variancePercentage: (_r = (_q = reimbursementOpExState === null || reimbursementOpExState === void 0 ? void 0 : reimbursementOpExState.total) === null || _q === void 0 ? void 0 : _q.variancePercentage) !== null && _r !== void 0 ? _r : 0,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
66
95
|
const completionStatus = fluxCompletionStatus != null ? fluxCompletionStatus : 'incomplete';
|
|
67
96
|
return {
|
|
97
|
+
sections,
|
|
98
|
+
totalBalancesAndVariance,
|
|
68
99
|
fetchStatus: fetchStateAndError,
|
|
69
|
-
operatingExpensesView,
|
|
70
100
|
bulkReviewStatus,
|
|
71
101
|
reviewOperatingExpensesIds,
|
|
102
|
+
selectedSectionIds,
|
|
72
103
|
uiState,
|
|
73
104
|
refreshStatus,
|
|
105
|
+
currency,
|
|
74
106
|
completionStatus,
|
|
75
107
|
};
|
|
76
108
|
}
|
|
109
|
+
// Helper function to transform operating expense to vendor view
|
|
110
|
+
const mapOperatingExpenseToVendorView = (state, operatingExpense) => {
|
|
111
|
+
const vendor = (0, vendorSelector_1.getVendorByVendorId)(state.vendorState, operatingExpense.vendorId);
|
|
112
|
+
if (!vendor) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const vendorAccountsAndClasses = operatingExpense.vendorAccountsAndClasses.map((accAndClass) => ({
|
|
116
|
+
varianceAmount: accAndClass.varianceAmount,
|
|
117
|
+
variancePercentage: accAndClass.variancePercentage,
|
|
118
|
+
currency: operatingExpense.currency,
|
|
119
|
+
accountBase: accAndClass.accountId != null
|
|
120
|
+
? (0, accountSelector_1.getAccountBase)(state.accountState, accAndClass.accountId, 'account_list')
|
|
121
|
+
: undefined,
|
|
122
|
+
classBase: accAndClass.classId != null
|
|
123
|
+
? (0, classSelector_1.getClassById)(state.classState, {
|
|
124
|
+
classId: accAndClass.classId,
|
|
125
|
+
reportId: 'class_list',
|
|
126
|
+
})
|
|
127
|
+
: undefined,
|
|
128
|
+
balancesByMonth: accAndClass.balancesByMonth,
|
|
129
|
+
}));
|
|
130
|
+
return {
|
|
131
|
+
fluxAnalysisEntityId: operatingExpense.fluxAnalysisEntityId,
|
|
132
|
+
vendor,
|
|
133
|
+
reviewedByUser: operatingExpense.userId != null
|
|
134
|
+
? (0, userSelector_1.getUserByUserId)(state.userState, operatingExpense.userId)
|
|
135
|
+
: undefined,
|
|
136
|
+
varianceAmount: operatingExpense.varianceAmount,
|
|
137
|
+
variancePercentage: operatingExpense.variancePercentage,
|
|
138
|
+
currency: operatingExpense.currency,
|
|
139
|
+
anomalyReason: operatingExpense.anomalyReason,
|
|
140
|
+
status: operatingExpense.status,
|
|
141
|
+
balancesByMonth: operatingExpense.balancesByMonth,
|
|
142
|
+
vendorAccountsAndClasses,
|
|
143
|
+
};
|
|
144
|
+
};
|
|
@@ -37,9 +37,17 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
37
37
|
.map((transactionId) => {
|
|
38
38
|
const transactionData = transactionReviewLocalDataById[transactionId];
|
|
39
39
|
if (transactionData != null) {
|
|
40
|
+
const { tabSpecificLineItems } = transactionData.transactionReviewLocalData;
|
|
41
|
+
const lineItemById = structuredClone(transactionData.transactionReviewLocalData.lineItemById);
|
|
42
|
+
Object.keys(lineItemById).forEach((lineItemId) => {
|
|
43
|
+
var _a;
|
|
44
|
+
if (((_a = tabSpecificLineItems[selectedTransactionCategorizationTab]) === null || _a === void 0 ? void 0 : _a.indexOf(lineItemId.toString())) === -1) {
|
|
45
|
+
delete lineItemById[lineItemId];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
40
48
|
return {
|
|
41
49
|
transactionId,
|
|
42
|
-
transactionReviewLocalData: transactionData.transactionReviewLocalData,
|
|
50
|
+
transactionReviewLocalData: Object.assign(Object.assign({}, transactionData.transactionReviewLocalData), { lineItemById }),
|
|
43
51
|
};
|
|
44
52
|
}
|
|
45
53
|
return null;
|
|
@@ -4,7 +4,8 @@ import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/
|
|
|
4
4
|
import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
|
|
5
5
|
import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
6
6
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
7
|
-
|
|
7
|
+
import { FluxAnalysisSectionType } from '../selectorTypes/fluxAnalysisViewSelectorTypes';
|
|
8
|
+
declare const toFluxAnalysisSortKey: (v: string) => "vendor" | "status" | "variance";
|
|
8
9
|
export type FluxAnalysisSortKey = ReturnType<typeof toFluxAnalysisSortKey>;
|
|
9
10
|
export type FluxAnalysisActionType = 'review' | 'unreview';
|
|
10
11
|
export type FluxAnalysisReviewStatus = 'Pending Review' | 'Reviewed';
|
|
@@ -12,21 +13,32 @@ export interface FluxBalancesByMonth {
|
|
|
12
13
|
month1: COABalance;
|
|
13
14
|
month2: COABalance;
|
|
14
15
|
}
|
|
16
|
+
export interface BalancesAndVariance {
|
|
17
|
+
balancesByMonth: FluxBalancesByMonth | undefined;
|
|
18
|
+
varianceAmount: number;
|
|
19
|
+
variancePercentage: number;
|
|
20
|
+
}
|
|
15
21
|
export interface FluxAnalysisEntities {
|
|
16
22
|
operatingExpenses: FluxAnalysisOperatingExpense[];
|
|
17
23
|
}
|
|
18
|
-
export interface
|
|
19
|
-
operatingExpenseId: ID;
|
|
20
|
-
vendorId: ID;
|
|
24
|
+
export interface FluxVendorAccountsAndClasses extends BalancesAndVariance {
|
|
21
25
|
accountId: ID | undefined;
|
|
22
26
|
classId: ID | undefined;
|
|
27
|
+
}
|
|
28
|
+
export interface FluxAnalysisOperatingExpense extends BalancesAndVariance {
|
|
29
|
+
fluxAnalysisEntityId: ID;
|
|
30
|
+
vendorId: ID;
|
|
31
|
+
vendorAccountsAndClasses: FluxVendorAccountsAndClasses[];
|
|
23
32
|
userId: ID | undefined;
|
|
24
|
-
varianceAmount: number;
|
|
25
|
-
variancePercentage: number;
|
|
26
33
|
currency: Currency;
|
|
27
34
|
anomalyReason: string;
|
|
28
35
|
status: FluxAnalysisReviewStatus;
|
|
29
|
-
|
|
36
|
+
}
|
|
37
|
+
interface GroupPaginationInfo {
|
|
38
|
+
pageToken: PageToken;
|
|
39
|
+
hasMore: boolean;
|
|
40
|
+
limit?: number;
|
|
41
|
+
totalCount: number;
|
|
30
42
|
}
|
|
31
43
|
export interface FluxAnalysisViewUIState {
|
|
32
44
|
sortKey: FluxAnalysisSortKey;
|
|
@@ -36,19 +48,32 @@ export interface FluxAnalysisViewUIState {
|
|
|
36
48
|
scrollTop: number;
|
|
37
49
|
scrollLeft?: number;
|
|
38
50
|
} | undefined;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
51
|
+
paginationInfoByGroup: {
|
|
52
|
+
generalExpense: GroupPaginationInfo;
|
|
53
|
+
reimbursement: GroupPaginationInfo;
|
|
54
|
+
};
|
|
55
|
+
collapsableStatus: {
|
|
56
|
+
[nodeId: string]: boolean;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export interface FluxAnalysisViewGroup {
|
|
60
|
+
fetchStatus: FetchStateAndError;
|
|
61
|
+
operatingExpenseIds: ID[];
|
|
62
|
+
total: BalancesAndVariance | undefined;
|
|
63
|
+
}
|
|
64
|
+
export interface FluxAnalysisViewGroups {
|
|
65
|
+
generalExpense: FluxAnalysisViewGroup;
|
|
66
|
+
reimbursement: FluxAnalysisViewGroup;
|
|
43
67
|
}
|
|
44
68
|
export interface FluxAnalysisViewState extends FetchedState {
|
|
45
|
-
fluxAnalysisReportGenerated: boolean;
|
|
46
69
|
fluxAnalysisEntities: FluxAnalysisEntities;
|
|
47
|
-
|
|
48
|
-
|
|
70
|
+
groupsBySelectedPeriod: Record<MonthYearPeriodId, FluxAnalysisViewGroups>;
|
|
71
|
+
totalBalancesAndVariance: BalancesAndVariance | undefined;
|
|
49
72
|
bulkReviewStatus: FetchStateAndError;
|
|
50
73
|
refreshStatus: FetchStateAndError;
|
|
51
74
|
uiState: FluxAnalysisViewUIState;
|
|
52
|
-
|
|
75
|
+
currency: Currency;
|
|
76
|
+
reviewOperatingExpenseIdsByPeriod: Record<MonthYearPeriodId, ID[]>;
|
|
77
|
+
selectedSectionIdsByPeriod: Record<MonthYearPeriodId, FluxAnalysisSectionType[]>;
|
|
53
78
|
}
|
|
54
79
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
|
|
4
|
-
const FLUX_ANALYSIS_SORT_KEYS = ['vendor', '
|
|
4
|
+
const FLUX_ANALYSIS_SORT_KEYS = ['vendor', 'variance', 'status'];
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
6
|
const toFluxAnalysisSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, FLUX_ANALYSIS_SORT_KEYS);
|
|
@@ -79,6 +79,7 @@ export interface TransactionReviewLocalData {
|
|
|
79
79
|
vendorUpdates?: TransactionVendorUpdates;
|
|
80
80
|
customerUpdates?: TransactionVendorUpdates;
|
|
81
81
|
selectedEntity?: Entity;
|
|
82
|
+
tabSpecificLineItems: Partial<Record<TransactionsTab, string[]>>;
|
|
82
83
|
}
|
|
83
84
|
export interface SupportedTransactionCategorization {
|
|
84
85
|
transactionReviewLocalData: TransactionReviewLocalData;
|
package/lib/view/onboardingView/cockpitView/epic/initializeOnboardingCustomerViewUpdateDataEpic.js
CHANGED
|
@@ -13,7 +13,7 @@ const addressViewReducer_1 = require("../../../addressView/addressViewReducer");
|
|
|
13
13
|
const onboardingCockpitViewReducer_1 = require("../onboardingCockpitViewReducer");
|
|
14
14
|
const initializeOnboardingCustomerViewUpdateDataEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(onboardingCockpitViewReducer_1.initializeOnboardingCustomerViewUpdateData.match), (0, operators_1.mergeMap)((action) => {
|
|
15
15
|
var _a, _b, _c;
|
|
16
|
-
const { companyId } = action.payload;
|
|
16
|
+
const { companyId, isDebitCardFlagEnabled } = action.payload;
|
|
17
17
|
const fetchActions = [];
|
|
18
18
|
if (companyId != null) {
|
|
19
19
|
const onboardingCustomerInfo = (0, onboardingCustomerSelector_1.getOnboardingCustomersByCompanyId)(state$.value.onboardingCustomerState, companyId);
|
|
@@ -57,7 +57,7 @@ const initializeOnboardingCustomerViewUpdateDataEpic = (actions$, state$) => act
|
|
|
57
57
|
accountingConnectionCreationMode: ((_b = company.company.companyOnboardingInfo.onboardingInfo) === null || _b === void 0 ? void 0 : _b.accountingConnectionCreationMode) != null
|
|
58
58
|
? (0, companyStateTypes_1.toAccountingConnectionCreationModeStrict)((_c = company.company.companyOnboardingInfo.onboardingInfo) === null || _c === void 0 ? void 0 : _c.accountingConnectionCreationMode)
|
|
59
59
|
: undefined,
|
|
60
|
-
selectedProducts: getSelectedProducts(tenant),
|
|
60
|
+
selectedProducts: getSelectedProducts(isDebitCardFlagEnabled, tenant),
|
|
61
61
|
};
|
|
62
62
|
if (onboardingCustomerId != null) {
|
|
63
63
|
const onboardingCustomerDetails = (0, userSelector_1.getUserByUserId)(state$.value.userState, onboardingCustomerId);
|
|
@@ -106,11 +106,11 @@ const initializeOnboardingCustomerViewUpdateDataEpic = (actions$, state$) => act
|
|
|
106
106
|
return (0, rxjs_1.from)(fetchActions);
|
|
107
107
|
}));
|
|
108
108
|
exports.initializeOnboardingCustomerViewUpdateDataEpic = initializeOnboardingCustomerViewUpdateDataEpic;
|
|
109
|
-
const getSelectedProducts = (tenant) => {
|
|
109
|
+
const getSelectedProducts = (isDebitCardFlagEnabled, tenant) => {
|
|
110
110
|
if (tenant == null) {
|
|
111
111
|
return [];
|
|
112
112
|
}
|
|
113
|
-
const isBankingOnly = (0, tenantSelector_1.isTenantBankingOnly)(tenant);
|
|
113
|
+
const isBankingOnly = (0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, tenant);
|
|
114
114
|
const isBookkeepingEnabled = (0, tenantSelector_1.isTenantBookkeepingEnabled)(tenant);
|
|
115
115
|
const isOtherProductsEnabled = (0, tenantSelector_1.isOtherProductsEnabledForTenant)(tenant);
|
|
116
116
|
const isCardsEnabled = (0, tenantSelector_1.isTenantCardsOnly)(tenant);
|
|
@@ -30,8 +30,9 @@ export declare const fetchCompanyOnboardingView: import("@reduxjs/toolkit").Acti
|
|
|
30
30
|
onboardingEmailGroup: OnboardingEmailGroupPayload;
|
|
31
31
|
}, "onboardingCockpitView/updateOnboardingEmailGroupOnSuccess", never, never>, updateOnboardingEmailGroupOnFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], {
|
|
32
32
|
error: ZeniAPIStatus<Record<string, unknown>>;
|
|
33
|
-
}, "onboardingCockpitView/updateOnboardingEmailGroupOnFailure", never, never>, initializeOnboardingCustomerViewUpdateData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId?: string | undefined], {
|
|
33
|
+
}, "onboardingCockpitView/updateOnboardingEmailGroupOnFailure", never, never>, initializeOnboardingCustomerViewUpdateData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[isDebitCardFlagEnabled: boolean, companyId?: string | undefined], {
|
|
34
34
|
companyId: string | undefined;
|
|
35
|
+
isDebitCardFlagEnabled: boolean;
|
|
35
36
|
}, "onboardingCockpitView/initializeOnboardingCustomerViewUpdateData", never, never>, saveOnboardingCustomerViewUpdateData: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[newOnboardingCustomer: Partial<NewOnboardingCustomer>], {
|
|
36
37
|
newOnboardingCustomer: Partial<NewOnboardingCustomer>;
|
|
37
38
|
}, "onboardingCockpitView/saveOnboardingCustomerViewUpdateData", never, never>, clearOnboardingCustomerViewUpdateData: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCockpitView/clearOnboardingCustomerViewUpdateData">, saveOnboardingCustomerViewUpdates: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[sendInvite: boolean, skipSnackbarOnSuccess?: boolean | undefined], {
|
|
@@ -130,8 +130,8 @@ const onboardingCockpitView = (0, toolkit_1.createSlice)({
|
|
|
130
130
|
reducer(draft) {
|
|
131
131
|
draft.customerLocalStoreInitState = 'In-Progress';
|
|
132
132
|
},
|
|
133
|
-
prepare(companyId) {
|
|
134
|
-
return { payload: { companyId } };
|
|
133
|
+
prepare(isDebitCardFlagEnabled, companyId) {
|
|
134
|
+
return { payload: { companyId, isDebitCardFlagEnabled } };
|
|
135
135
|
},
|
|
136
136
|
},
|
|
137
137
|
saveOnboardingCustomerViewUpdateData: {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { CurrentTenant } from '../../entity/tenant/tenantSelector';
|
|
2
2
|
import { RoleMap, UserRoleType } from '../../entity/userRole/userRoleType';
|
|
3
3
|
import { MonthEndInsightsNotificationSettingsData, NotificationSettingsData, ReminderNotificationSettingsData } from './settingsViewState';
|
|
4
|
-
export declare const isAccountingTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
5
|
-
export declare const isApprovalRulesTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
4
|
+
export declare const isAccountingTabVisible: (userRole: UserRoleType[], isDebitCardFlagEnabled: boolean, currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
5
|
+
export declare const isApprovalRulesTabVisible: (userRole: UserRoleType[], isDebitCardFlagEnabled: boolean, currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
6
6
|
export declare const isBillingTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined) => boolean;
|
|
7
7
|
export declare const isBankConnectionsTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
8
8
|
export declare const isBusinessVerificationTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
9
9
|
export declare const isCompanyDetailsTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
10
|
-
export declare const isIntegrationsTabVisible: (userRole: UserRoleType[], currentTenant: CurrentTenant | undefined) => boolean;
|
|
10
|
+
export declare const isIntegrationsTabVisible: (userRole: UserRoleType[], isDebitCardFlagEnabled: boolean, currentTenant: CurrentTenant | undefined) => boolean;
|
|
11
11
|
export declare const isSettingsVisible: (currentTenant: CurrentTenant | undefined) => boolean;
|
|
12
12
|
export declare const isMyBankConnectionsTabVisible: (currentTenant: CurrentTenant | undefined, userRoleMap?: RoleMap) => boolean;
|
|
13
13
|
export declare const isRemindersSectionVisibleOnSettingsPage: (reminderNotificationSettings: ReminderNotificationSettingsData) => boolean;
|
|
14
14
|
export declare const isMonthEndNotificationsSectionVisibleOnSettingsPage: (monthEndInsightsNotificationSettings: MonthEndInsightsNotificationSettingsData, signedInUseEmail: string) => boolean;
|
|
15
|
-
export declare const isNotificationsTabVisible: (notificationSettings: NotificationSettingsData, signedInUseEmail: string, currentTenant: CurrentTenant | undefined) => boolean;
|
|
15
|
+
export declare const isNotificationsTabVisible: (notificationSettings: NotificationSettingsData, isDebitCardFlagEnabled: boolean, signedInUseEmail: string, currentTenant: CurrentTenant | undefined) => boolean;
|
|
@@ -4,7 +4,7 @@ exports.isNotificationsTabVisible = exports.isMonthEndNotificationsSectionVisibl
|
|
|
4
4
|
const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
|
|
5
5
|
const userRoleType_1 = require("../../entity/userRole/userRoleType");
|
|
6
6
|
const vendorListSelector_1 = require("../vendorList/vendorListSelector");
|
|
7
|
-
const isAccountingTabVisible = (userRole, currentTenant, userRoleMap) => {
|
|
7
|
+
const isAccountingTabVisible = (userRole, isDebitCardFlagEnabled, currentTenant, userRoleMap) => {
|
|
8
8
|
if (currentTenant == null) {
|
|
9
9
|
return false;
|
|
10
10
|
}
|
|
@@ -13,7 +13,7 @@ const isAccountingTabVisible = (userRole, currentTenant, userRoleMap) => {
|
|
|
13
13
|
(0, userRoleType_1.hasBillPayAccessible)(currentTenant, userRoleMap) ||
|
|
14
14
|
(0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
|
|
15
15
|
(0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole)) &&
|
|
16
|
-
(0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
|
|
16
|
+
(0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
|
|
17
17
|
(0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
|
|
18
18
|
}
|
|
19
19
|
else {
|
|
@@ -21,7 +21,7 @@ const isAccountingTabVisible = (userRole, currentTenant, userRoleMap) => {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
exports.isAccountingTabVisible = isAccountingTabVisible;
|
|
24
|
-
const isApprovalRulesTabVisible = (userRole, currentTenant, userRoleMap) => {
|
|
24
|
+
const isApprovalRulesTabVisible = (userRole, isDebitCardFlagEnabled, currentTenant, userRoleMap) => {
|
|
25
25
|
var _a, _b;
|
|
26
26
|
if (currentTenant == null || userRoleMap == null) {
|
|
27
27
|
return false;
|
|
@@ -33,7 +33,7 @@ const isApprovalRulesTabVisible = (userRole, currentTenant, userRoleMap) => {
|
|
|
33
33
|
(0, userRoleType_1.hasReimbursementAccessible)(currentTenant, userRoleMap) ||
|
|
34
34
|
((isBillPayTOSAccepted || isReimbursementTOSAccepted) &&
|
|
35
35
|
(0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole))) &&
|
|
36
|
-
(0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
|
|
36
|
+
(0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
|
|
37
37
|
(0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
@@ -97,13 +97,14 @@ const isCompanyDetailsTabVisible = (userRole, currentTenant, userRoleMap) => {
|
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
exports.isCompanyDetailsTabVisible = isCompanyDetailsTabVisible;
|
|
100
|
-
const isIntegrationsTabVisible = (userRole, currentTenant) => {
|
|
100
|
+
const isIntegrationsTabVisible = (userRole, isDebitCardFlagEnabled, currentTenant) => {
|
|
101
101
|
if (currentTenant == null) {
|
|
102
102
|
return false;
|
|
103
103
|
}
|
|
104
104
|
if ((0, exports.isSettingsVisible)(currentTenant)) {
|
|
105
105
|
return ((0, userRoleType_1.hasFullOrAdminLevelAccess)(userRole) &&
|
|
106
|
-
!((0, tenantSelector_1.isTenantBankingOnly)(currentTenant) ||
|
|
106
|
+
!((0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) ||
|
|
107
|
+
(0, tenantSelector_1.isTenantCardsOnly)(currentTenant)));
|
|
107
108
|
}
|
|
108
109
|
else {
|
|
109
110
|
return false;
|
|
@@ -145,14 +146,14 @@ const isMonthEndNotificationsSectionVisibleOnSettingsPage = (monthEndInsightsNot
|
|
|
145
146
|
monthEndInsightsNotificationSettings.recipientEmailIds.includes(signedInUseEmail));
|
|
146
147
|
};
|
|
147
148
|
exports.isMonthEndNotificationsSectionVisibleOnSettingsPage = isMonthEndNotificationsSectionVisibleOnSettingsPage;
|
|
148
|
-
const isNotificationsTabVisible = (notificationSettings, signedInUseEmail, currentTenant) => {
|
|
149
|
+
const isNotificationsTabVisible = (notificationSettings, isDebitCardFlagEnabled, signedInUseEmail, currentTenant) => {
|
|
149
150
|
if (currentTenant == null) {
|
|
150
151
|
return false;
|
|
151
152
|
}
|
|
152
153
|
const { reminderNotificationSettings, monthEndInsightsNotificationSettings } = notificationSettings;
|
|
153
154
|
return (((0, exports.isRemindersSectionVisibleOnSettingsPage)(reminderNotificationSettings) ||
|
|
154
155
|
(0, exports.isMonthEndNotificationsSectionVisibleOnSettingsPage)(monthEndInsightsNotificationSettings, signedInUseEmail)) &&
|
|
155
|
-
(0, tenantSelector_1.isTenantBankingOnly)(currentTenant) === false &&
|
|
156
|
+
(0, tenantSelector_1.isTenantBankingOnly)(isDebitCardFlagEnabled, currentTenant) === false &&
|
|
156
157
|
(0, tenantSelector_1.isTenantCardsOnly)(currentTenant) === false);
|
|
157
158
|
};
|
|
158
159
|
exports.isNotificationsTabVisible = isNotificationsTabVisible;
|
|
@@ -48,7 +48,7 @@ const getReviewPageBillDetail = (state, billId) => {
|
|
|
48
48
|
let file;
|
|
49
49
|
let contactDetails = [];
|
|
50
50
|
const primaryPaymentAccount = (0, paymentAccountSelector_1.getPaymentAccountsByPaymentAccountIds)(paymentAccountState, paymentAccountListState.paymentAccountIds);
|
|
51
|
-
const allDepositAccounts = (0, depositAccountListSelector_1.
|
|
51
|
+
const allDepositAccounts = (0, depositAccountListSelector_1.getAllDepositAccounts)(depositAccountState, depositAccountListState).depositAccounts;
|
|
52
52
|
const withdrawFromList = (0, setupViewSelector_1.getAllFundingAccounts)(allDepositAccounts, primaryPaymentAccount, paymentAccountListState.paymentAccountBalanceFetchStatus);
|
|
53
53
|
let fetchState = 'Not-Started';
|
|
54
54
|
let sourceBillDetailFetchState = 'Not-Started';
|
|
@@ -2,6 +2,7 @@ import { Amount } from '../../../../commonStateTypes/amount';
|
|
|
2
2
|
import { FetchState, FetchStateAndError, ID } from '../../../../commonStateTypes/common';
|
|
3
3
|
import { AmountPayload } from '../../../../entity/reimbursement/reimbursementPayload';
|
|
4
4
|
import { ZeniAPIStatus } from '../../../../responsePayload';
|
|
5
|
+
import { FundingAccount } from '../../commonSetup/setupViewSelector';
|
|
5
6
|
import { InvoiceProcessingPayload } from './editBillViewPayload';
|
|
6
7
|
import { AddBillAutoFields, BillDetailLocalData, EditBillDetailViewState, OutsideZeniPaymentLocalData } from './editBillViewState';
|
|
7
8
|
export declare const initialState: EditBillDetailViewState;
|
|
@@ -82,6 +83,10 @@ export declare const fetchEditBillDetailPage: import("@reduxjs/toolkit").ActionC
|
|
|
82
83
|
billId?: ID;
|
|
83
84
|
}, "editBillView/updateOutsideZeniPaymentLocalData">, discardOutsideZeniPaymentLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
84
85
|
billId?: ID;
|
|
85
|
-
}, "editBillView/discardOutsideZeniPaymentLocalData"
|
|
86
|
+
}, "editBillView/discardOutsideZeniPaymentLocalData">, updateNewAddedBillPaymentAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "editBillView/updateNewAddedBillPaymentAccount">, updateWithdrawFromAccountId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
87
|
+
billId?: ID;
|
|
88
|
+
withdrawFromAccountId?: ID;
|
|
89
|
+
withdrawFromList: FundingAccount[];
|
|
90
|
+
}, "editBillView/updateWithdrawFromAccountId">;
|
|
86
91
|
declare const _default: import("redux").Reducer<EditBillDetailViewState>;
|
|
87
92
|
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.discardOutsideZeniPaymentLocalData = exports.updateOutsideZeniPaymentLocalData = exports.markBillForRetry = exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = exports.fetchVendorAndUpdateBillLocalData = exports.updateHomeCurrencyConversion = exports.currencyConversionValueSuccessOrFailure = exports.convertAmountToHomeCurrency = exports.updateVendorContactSuccessOrFailure = exports.updateVendorContact = exports.updateSuggestedVendorIdFromParsedInvoice = exports.updateRecommendedVendorId = exports.updateBillUploadFetchState = exports.updateAddBillAutoFields = exports.updateShowAutofill = exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = exports.waitForVendorByNameThenParsetoLocalStore = exports.waitForBillDetailThenInitializeLocalStore = exports.clearEditBillViewDetail = exports.parseInvoiceToBill = exports.updateEditBillFetchStateCompleted = exports.saveBillSuccessOrFailure = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.saveBillUpdatesToLocalStore = exports.initializeBillToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.fetchBillAndInitializeLocalStore = exports.fetchEditBillDetailPage = exports.initialState = void 0;
|
|
4
|
+
exports.updateWithdrawFromAccountId = exports.updateNewAddedBillPaymentAccount = exports.discardOutsideZeniPaymentLocalData = exports.updateOutsideZeniPaymentLocalData = exports.markBillForRetry = exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = exports.fetchVendorAndUpdateBillLocalData = exports.updateHomeCurrencyConversion = exports.currencyConversionValueSuccessOrFailure = exports.convertAmountToHomeCurrency = exports.updateVendorContactSuccessOrFailure = exports.updateVendorContact = exports.updateSuggestedVendorIdFromParsedInvoice = exports.updateRecommendedVendorId = exports.updateBillUploadFetchState = exports.updateAddBillAutoFields = exports.updateShowAutofill = exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = exports.waitForVendorByNameThenParsetoLocalStore = exports.waitForBillDetailThenInitializeLocalStore = exports.clearEditBillViewDetail = exports.parseInvoiceToBill = exports.updateEditBillFetchStateCompleted = exports.saveBillSuccessOrFailure = exports.saveBillDetail = exports.discardBillUpdatesInLocalStore = exports.saveBillUpdatesToLocalStore = exports.initializeBillToLocalStore = exports.fetchVendorByNameAndParseInvoice = exports.fetchBillAndInitializeLocalStore = exports.fetchEditBillDetailPage = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const amount_1 = require("../../../../commonStateTypes/amount");
|
|
7
7
|
const helpers_1 = require("../../helpers");
|
|
@@ -14,6 +14,7 @@ exports.initialState = {
|
|
|
14
14
|
fetchState: 'Not-Started',
|
|
15
15
|
error: undefined,
|
|
16
16
|
},
|
|
17
|
+
newAddedBillPaymentAccountId: undefined,
|
|
17
18
|
};
|
|
18
19
|
const editBillView = (0, toolkit_1.createSlice)({
|
|
19
20
|
name: 'editBillView',
|
|
@@ -366,12 +367,29 @@ const editBillView = (0, toolkit_1.createSlice)({
|
|
|
366
367
|
const key = (0, billDetailViewState_1.getBillTransactionDetailKey)(action.payload.billId);
|
|
367
368
|
draft.editBillStateById[key].isBillMarkedForRetry = true;
|
|
368
369
|
},
|
|
370
|
+
updateNewAddedBillPaymentAccount(draft, action) {
|
|
371
|
+
draft.newAddedBillPaymentAccountId = action.payload;
|
|
372
|
+
},
|
|
373
|
+
updateWithdrawFromAccountId(draft, action) {
|
|
374
|
+
const { billId, withdrawFromAccountId, withdrawFromList } = action.payload;
|
|
375
|
+
if (withdrawFromAccountId != null && withdrawFromList.length > 0) {
|
|
376
|
+
const newAddedAccount = withdrawFromList.find((account) => account.id === withdrawFromAccountId);
|
|
377
|
+
if (billId != null) {
|
|
378
|
+
const billKey = (0, billDetailViewState_1.getBillTransactionDetailKey)(billId);
|
|
379
|
+
draft.editBillStateById[billKey].billDetailLocalData.paymentDetailsSection = Object.assign(Object.assign({}, draft.editBillStateById[billKey].billDetailLocalData
|
|
380
|
+
.paymentDetailsSection), { withdrawFrom: newAddedAccount });
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
draft.newBillState.billDetailLocalData.paymentDetailsSection = Object.assign(Object.assign({}, draft.newBillState.billDetailLocalData.paymentDetailsSection), { withdrawFrom: newAddedAccount });
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
},
|
|
369
387
|
clearEditBillViewDetail(draft) {
|
|
370
388
|
Object.assign(draft, exports.initialState);
|
|
371
389
|
},
|
|
372
390
|
},
|
|
373
391
|
});
|
|
374
|
-
_a = editBillView.actions, exports.fetchEditBillDetailPage = _a.fetchEditBillDetailPage, exports.fetchBillAndInitializeLocalStore = _a.fetchBillAndInitializeLocalStore, exports.fetchVendorByNameAndParseInvoice = _a.fetchVendorByNameAndParseInvoice, exports.initializeBillToLocalStore = _a.initializeBillToLocalStore, exports.saveBillUpdatesToLocalStore = _a.saveBillUpdatesToLocalStore, exports.discardBillUpdatesInLocalStore = _a.discardBillUpdatesInLocalStore, exports.saveBillDetail = _a.saveBillDetail, exports.saveBillSuccessOrFailure = _a.saveBillSuccessOrFailure, exports.updateEditBillFetchStateCompleted = _a.updateEditBillFetchStateCompleted, exports.parseInvoiceToBill = _a.parseInvoiceToBill, exports.clearEditBillViewDetail = _a.clearEditBillViewDetail, exports.waitForBillDetailThenInitializeLocalStore = _a.waitForBillDetailThenInitializeLocalStore, exports.waitForVendorByNameThenParsetoLocalStore = _a.waitForVendorByNameThenParsetoLocalStore, exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = _a.updateInternationalTransferFeeBearerPaymentMethodInLocalData, exports.updateShowAutofill = _a.updateShowAutofill, exports.updateAddBillAutoFields = _a.updateAddBillAutoFields, exports.updateBillUploadFetchState = _a.updateBillUploadFetchState, exports.updateRecommendedVendorId = _a.updateRecommendedVendorId, exports.updateSuggestedVendorIdFromParsedInvoice = _a.updateSuggestedVendorIdFromParsedInvoice, exports.updateVendorContact = _a.updateVendorContact, exports.updateVendorContactSuccessOrFailure = _a.updateVendorContactSuccessOrFailure, exports.convertAmountToHomeCurrency = _a.convertAmountToHomeCurrency, exports.currencyConversionValueSuccessOrFailure = _a.currencyConversionValueSuccessOrFailure, exports.updateHomeCurrencyConversion = _a.updateHomeCurrencyConversion, exports.fetchVendorAndUpdateBillLocalData = _a.fetchVendorAndUpdateBillLocalData, exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = _a.waitForVendorByIdThenSaveBillUpdatetoLocalStore, exports.markBillForRetry = _a.markBillForRetry, exports.updateOutsideZeniPaymentLocalData = _a.updateOutsideZeniPaymentLocalData, exports.discardOutsideZeniPaymentLocalData = _a.discardOutsideZeniPaymentLocalData;
|
|
392
|
+
_a = editBillView.actions, exports.fetchEditBillDetailPage = _a.fetchEditBillDetailPage, exports.fetchBillAndInitializeLocalStore = _a.fetchBillAndInitializeLocalStore, exports.fetchVendorByNameAndParseInvoice = _a.fetchVendorByNameAndParseInvoice, exports.initializeBillToLocalStore = _a.initializeBillToLocalStore, exports.saveBillUpdatesToLocalStore = _a.saveBillUpdatesToLocalStore, exports.discardBillUpdatesInLocalStore = _a.discardBillUpdatesInLocalStore, exports.saveBillDetail = _a.saveBillDetail, exports.saveBillSuccessOrFailure = _a.saveBillSuccessOrFailure, exports.updateEditBillFetchStateCompleted = _a.updateEditBillFetchStateCompleted, exports.parseInvoiceToBill = _a.parseInvoiceToBill, exports.clearEditBillViewDetail = _a.clearEditBillViewDetail, exports.waitForBillDetailThenInitializeLocalStore = _a.waitForBillDetailThenInitializeLocalStore, exports.waitForVendorByNameThenParsetoLocalStore = _a.waitForVendorByNameThenParsetoLocalStore, exports.updateInternationalTransferFeeBearerPaymentMethodInLocalData = _a.updateInternationalTransferFeeBearerPaymentMethodInLocalData, exports.updateShowAutofill = _a.updateShowAutofill, exports.updateAddBillAutoFields = _a.updateAddBillAutoFields, exports.updateBillUploadFetchState = _a.updateBillUploadFetchState, exports.updateRecommendedVendorId = _a.updateRecommendedVendorId, exports.updateSuggestedVendorIdFromParsedInvoice = _a.updateSuggestedVendorIdFromParsedInvoice, exports.updateVendorContact = _a.updateVendorContact, exports.updateVendorContactSuccessOrFailure = _a.updateVendorContactSuccessOrFailure, exports.convertAmountToHomeCurrency = _a.convertAmountToHomeCurrency, exports.currencyConversionValueSuccessOrFailure = _a.currencyConversionValueSuccessOrFailure, exports.updateHomeCurrencyConversion = _a.updateHomeCurrencyConversion, exports.fetchVendorAndUpdateBillLocalData = _a.fetchVendorAndUpdateBillLocalData, exports.waitForVendorByIdThenSaveBillUpdatetoLocalStore = _a.waitForVendorByIdThenSaveBillUpdatetoLocalStore, exports.markBillForRetry = _a.markBillForRetry, exports.updateOutsideZeniPaymentLocalData = _a.updateOutsideZeniPaymentLocalData, exports.discardOutsideZeniPaymentLocalData = _a.discardOutsideZeniPaymentLocalData, exports.updateNewAddedBillPaymentAccount = _a.updateNewAddedBillPaymentAccount, exports.updateWithdrawFromAccountId = _a.updateWithdrawFromAccountId;
|
|
375
393
|
exports.default = editBillView.reducer;
|
|
376
394
|
function doUpdateRecurringBillLocalData(billDetail, currentConfig, prevConfig) {
|
|
377
395
|
var _a, _b, _c, _d;
|