@zeniai/client-epic-state 4.18.27 → 4.18.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/lib/commonStateTypes/accountView/getNestedAccountIDHierarchyForReport.js +0 -2
  2. package/lib/commonStateTypes/accountView/nestedAccountID.d.ts +0 -1
  3. package/lib/commonStateTypes/viewAndReport/viewAndReport.d.ts +2 -2
  4. package/lib/commonStateTypes/viewAndReport/viewAndReport.js +0 -1
  5. package/lib/entity/account/accountPayload.d.ts +0 -1
  6. package/lib/entity/account/accountPayload.js +1 -2
  7. package/lib/entity/account/accountSelector.d.ts +0 -3
  8. package/lib/entity/account/accountSelector.js +0 -2
  9. package/lib/entity/account/accountState.d.ts +1 -2
  10. package/lib/entity/account/pickAndMergeForecastAccountReport.d.ts +0 -1
  11. package/lib/entity/accountGroup/accountGroupSelector.d.ts +0 -22
  12. package/lib/entity/accountGroup/accountGroupState.d.ts +1 -1
  13. package/lib/entity/class/classReducer.d.ts +4 -4
  14. package/lib/entity/class/classState.d.ts +1 -1
  15. package/lib/entity/company/companyPayload.d.ts +0 -1
  16. package/lib/entity/company/companyPayload.js +4 -5
  17. package/lib/entity/company/companyStateTypes.d.ts +0 -1
  18. package/lib/entity/forecast/forecastState.d.ts +1 -1
  19. package/lib/entity/sectionAccountsView/sectionAccountsView.d.ts +1 -1
  20. package/lib/entity/sectionClassesViewV2/sectionClassesView.d.ts +1 -1
  21. package/lib/entity/sectionClassesViewV2/sectionClassesViewReducer.d.ts +2 -2
  22. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  23. package/lib/entity/snackbar/snackbarTypes.js +0 -1
  24. package/lib/epic.d.ts +2 -3
  25. package/lib/epic.js +2 -3
  26. package/lib/index.d.ts +4 -4
  27. package/lib/index.js +15 -16
  28. package/lib/reducer.d.ts +1 -1
  29. package/lib/reducer.js +1 -1
  30. package/lib/view/accountMappingView/__mocks__/accountMappingSelectorMock.js +0 -29
  31. package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +0 -1
  32. package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +0 -2
  33. package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
  34. package/lib/view/billPayCard/billPayCardSelector.d.ts +1 -1
  35. package/lib/view/cardBalance/cardBalanceSelector.d.ts +1 -2
  36. package/lib/view/cashBalance/cashBalanceSelector.d.ts +1 -2
  37. package/lib/view/cashInCashOut/cashInCashOutSelector.d.ts +1 -1
  38. package/lib/view/cashPosition/cashPositionSelector.d.ts +1 -1
  39. package/lib/view/dashboard/dashboardReducer.d.ts +2 -2
  40. package/lib/view/dashboard/dashboardSelector.d.ts +1 -1
  41. package/lib/view/dashboard/dashboardSelector.js +12 -29
  42. package/lib/view/financeStatement/financeStatementReducer.d.ts +1 -1
  43. package/lib/view/globalMerchantView/globalMerchantViewReducer.d.ts +2 -2
  44. package/lib/view/reimbursementCard/reimbursementCardSelector.d.ts +1 -1
  45. package/lib/view/reportsResync/reportsResyncEpic.js +4 -11
  46. package/lib/view/reportsResync/reportsResyncSelector.d.ts +1 -1
  47. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.d.ts +1 -3
  48. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewReducer.js +2 -31
  49. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.d.ts +1 -2
  50. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewSelector.js +2 -3
  51. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/chargeCardSetUpViewState.d.ts +0 -1
  52. package/lib/view/tasksCard/tasksCardSelector.d.ts +1 -1
  53. package/lib/view/topEx/topExSelector.d.ts +1 -1
  54. package/package.json +1 -1
  55. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/expressInterestChargeCardEpic.d.ts +0 -11
  56. package/lib/view/spendManagement/chargeCards/chargeCardSetUp/epic/expressInterestChargeCardEpic.js +0 -48
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearChargeCardSetupView = exports.expressInterestInChargeCardFailure = exports.expressInterestInChargeCardSuccess = exports.expressInterestInChargeCard = exports.acceptChargeCardTermsFailure = exports.acceptChargeCardTermsSuccess = exports.acceptChargeCardTerms = exports.enableChargeCardAutoPayFailure = exports.enableChargeCardAutoPaySuccess = exports.enableChargeCardAutoPay = exports.fetchChargeCardSetupViewFailure = exports.fetchChargeCardSetupViewSuccess = exports.fetchChargeCardSetupView = exports.initialState = void 0;
4
+ exports.clearChargeCardSetupView = exports.acceptChargeCardTermsFailure = exports.acceptChargeCardTermsSuccess = exports.acceptChargeCardTerms = exports.enableChargeCardAutoPayFailure = exports.enableChargeCardAutoPaySuccess = exports.enableChargeCardAutoPay = exports.fetchChargeCardSetupViewFailure = exports.fetchChargeCardSetupViewSuccess = exports.fetchChargeCardSetupView = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  exports.initialState = {
7
7
  fetchState: 'Not-Started',
8
8
  error: undefined,
9
9
  isRefreshingViewInBackground: false,
10
- expressInterestInChargeCardStatus: {
11
- fetchState: 'Not-Started',
12
- error: undefined,
13
- },
14
10
  earlyPayFetchStatus: {
15
11
  fetchState: 'Not-Started',
16
12
  error: undefined,
@@ -121,35 +117,10 @@ const chargeCardSetupView = (0, toolkit_1.createSlice)({
121
117
  };
122
118
  },
123
119
  },
124
- expressInterestInChargeCard: {
125
- reducer(draft) {
126
- draft.expressInterestInChargeCardStatus = {
127
- fetchState: 'In-Progress',
128
- error: undefined,
129
- };
130
- },
131
- prepare(companyId) {
132
- return {
133
- payload: { companyId },
134
- };
135
- },
136
- },
137
- expressInterestInChargeCardSuccess(draft) {
138
- draft.expressInterestInChargeCardStatus = {
139
- fetchState: 'Completed',
140
- error: undefined,
141
- };
142
- },
143
- expressInterestInChargeCardFailure(draft, action) {
144
- draft.expressInterestInChargeCardStatus = {
145
- fetchState: 'Error',
146
- error: action.payload,
147
- };
148
- },
149
120
  clearChargeCardSetupView(draft) {
150
121
  Object.assign(draft, exports.initialState);
151
122
  },
152
123
  },
153
124
  });
154
- _a = chargeCardSetupView.actions, exports.fetchChargeCardSetupView = _a.fetchChargeCardSetupView, exports.fetchChargeCardSetupViewSuccess = _a.fetchChargeCardSetupViewSuccess, exports.fetchChargeCardSetupViewFailure = _a.fetchChargeCardSetupViewFailure, exports.enableChargeCardAutoPay = _a.enableChargeCardAutoPay, exports.enableChargeCardAutoPaySuccess = _a.enableChargeCardAutoPaySuccess, exports.enableChargeCardAutoPayFailure = _a.enableChargeCardAutoPayFailure, exports.acceptChargeCardTerms = _a.acceptChargeCardTerms, exports.acceptChargeCardTermsSuccess = _a.acceptChargeCardTermsSuccess, exports.acceptChargeCardTermsFailure = _a.acceptChargeCardTermsFailure, exports.expressInterestInChargeCard = _a.expressInterestInChargeCard, exports.expressInterestInChargeCardSuccess = _a.expressInterestInChargeCardSuccess, exports.expressInterestInChargeCardFailure = _a.expressInterestInChargeCardFailure, exports.clearChargeCardSetupView = _a.clearChargeCardSetupView;
125
+ _a = chargeCardSetupView.actions, exports.fetchChargeCardSetupView = _a.fetchChargeCardSetupView, exports.fetchChargeCardSetupViewSuccess = _a.fetchChargeCardSetupViewSuccess, exports.fetchChargeCardSetupViewFailure = _a.fetchChargeCardSetupViewFailure, exports.enableChargeCardAutoPay = _a.enableChargeCardAutoPay, exports.enableChargeCardAutoPaySuccess = _a.enableChargeCardAutoPaySuccess, exports.enableChargeCardAutoPayFailure = _a.enableChargeCardAutoPayFailure, exports.acceptChargeCardTerms = _a.acceptChargeCardTerms, exports.acceptChargeCardTermsSuccess = _a.acceptChargeCardTermsSuccess, exports.acceptChargeCardTermsFailure = _a.acceptChargeCardTermsFailure, exports.clearChargeCardSetupView = _a.clearChargeCardSetupView;
155
126
  exports.default = chargeCardSetupView.reducer;
@@ -1,10 +1,9 @@
1
- import { FetchState, FetchStateAndError, ID } from '../../../../commonStateTypes/common';
1
+ import { FetchStateAndError, ID } from '../../../../commonStateTypes/common';
2
2
  import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
3
3
  import { CompanyChargeCardInfo, CompanyDebitCardInfo, CompanyLocaleInfo } from '../../../../entity/company/companyStateTypes';
4
4
  import { RootState } from '../../../../reducer';
5
5
  import { BusinessVerificationDetails, CompanyOfficersDetails, SetupView } from '../../commonSetup/setupViewSelector';
6
6
  export interface ChargeCardSetupView extends SetupView, SelectorView {
7
- expressInterestInChargeCardFetchState: FetchState;
8
7
  isRefreshingViewInBackground: boolean;
9
8
  chargeCardTermsDetails?: {
10
9
  fetchStatus: FetchStateAndError;
@@ -14,7 +14,7 @@ function getChargeCardSetupViewDetails(state, companyId) {
14
14
  const { chargeCardSetupViewState, setupViewState } = state;
15
15
  const { chargeCardTermsDetails, isRefreshingViewInBackground } = chargeCardSetupViewState;
16
16
  const { updateStatus } = setupViewState;
17
- const { fetchState, error, expressInterestInChargeCardStatus: { fetchState: expressInterestInChargeCardFetchState, }, } = chargeCardSetupViewState;
17
+ const { fetchState, error } = chargeCardSetupViewState;
18
18
  const businessVerificationDetails = getChargeCardBusinessVerificationDetails(state, companyId);
19
19
  const selectedCompanyOfficer = (0, helpers_1.getSelectedCompanyOfficer)(businessVerificationDetails);
20
20
  return Object.assign(Object.assign({}, chargeCardSetupViewDetails), { chargeCardTermsDetails,
@@ -24,8 +24,7 @@ function getChargeCardSetupViewDetails(state, companyId) {
24
24
  error,
25
25
  updateStatus,
26
26
  selectedCompanyOfficer,
27
- isRefreshingViewInBackground,
28
- expressInterestInChargeCardFetchState });
27
+ isRefreshingViewInBackground });
29
28
  }
30
29
  function getChargeCardBusinessVerificationDetails(state, companyId) {
31
30
  const chargeCardBusinessVerificationDetails = (0, setupViewSelector_1.getBusinessVerificationDetails)(state, companyId);
@@ -1,7 +1,6 @@
1
1
  import { FetchStateAndError, FetchedState } from '../../../../commonStateTypes/common';
2
2
  export interface ChargeCardSetupViewState extends FetchedState {
3
3
  earlyPayFetchStatus: FetchStateAndError;
4
- expressInterestInChargeCardStatus: FetchStateAndError;
5
4
  isRefreshingViewInBackground: boolean;
6
5
  chargeCardTermsDetails?: {
7
6
  fetchStatus: FetchStateAndError;
@@ -1,6 +1,6 @@
1
1
  import { RootState } from '../../reducer';
2
2
  export declare const getTasksCardReport: (state: RootState) => {
3
- reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card";
3
+ reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation";
4
4
  reportTitle: string;
5
5
  version: string | number | undefined;
6
6
  status: import("../..").Status | undefined;
@@ -4,7 +4,7 @@ import { RootState } from '../../reducer';
4
4
  import { TopExReport, TopExTimePeriodWithMetaData } from './topExSelectorTypes';
5
5
  import { TopExState } from './topExState';
6
6
  export declare const getTopExpenses: (accountState: AccountState, topExState: TopExState, numberOfExpenses?: number) => {
7
- reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card";
7
+ reportId: "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation";
8
8
  reportTitle: string;
9
9
  version: string | number | undefined;
10
10
  status: import("../..").Status | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.18.27",
3
+ "version": "4.18.28",
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",
@@ -1,11 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateCompanies } from '../../../../../entity/company/companyReducer';
4
- import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
5
- import { updateAllUsers } from '../../../../../entity/user/userReducer';
6
- import { updateUserRoles } from '../../../../../entity/userRole/userRoleReducer';
7
- import { RootState } from '../../../../../reducer';
8
- import { ZeniAPI } from '../../../../../zeniAPI';
9
- import { expressInterestInChargeCard, expressInterestInChargeCardFailure, expressInterestInChargeCardSuccess } from '../chargeCardSetUpViewReducer';
10
- export type ActionType = ReturnType<typeof expressInterestInChargeCard> | ReturnType<typeof updateAllUsers> | ReturnType<typeof updateUserRoles> | ReturnType<typeof updateCompanies> | ReturnType<typeof expressInterestInChargeCardSuccess> | ReturnType<typeof expressInterestInChargeCardFailure> | ReturnType<typeof openSnackbar>;
11
- export declare const expressInterestChargeCardEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.expressInterestChargeCardEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const companyReducer_1 = require("../../../../../entity/company/companyReducer");
7
- const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
8
- const userReducer_1 = require("../../../../../entity/user/userReducer");
9
- const userRoleReducer_1 = require("../../../../../entity/userRole/userRoleReducer");
10
- const responsePayload_1 = require("../../../../../responsePayload");
11
- const chargeCardSetUpViewReducer_1 = require("../chargeCardSetUpViewReducer");
12
- const expressInterestChargeCardEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(chargeCardSetUpViewReducer_1.expressInterestInChargeCard.match), (0, operators_1.mergeMap)((action) => {
13
- const { companyId } = action.payload;
14
- const payload = {
15
- is_company_interested_in_charge_card: true,
16
- };
17
- return zeniAPI
18
- .putAndGetJSON(`${zeniAPI.apiEndPoints.tenantMicroServiceBaseUrl}/1.0/companies/${companyId}`, payload)
19
- .pipe((0, operators_1.mergeMap)((response) => {
20
- if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
21
- const actions = [
22
- (0, userReducer_1.updateAllUsers)({ users: response.data.users }),
23
- (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles),
24
- (0, companyReducer_1.updateCompanies)({
25
- payload: response.data.companies,
26
- schema: {},
27
- }),
28
- (0, chargeCardSetUpViewReducer_1.expressInterestInChargeCardSuccess)(),
29
- ];
30
- return (0, rxjs_1.from)(actions);
31
- }
32
- else {
33
- return (0, rxjs_1.of)((0, chargeCardSetUpViewReducer_1.expressInterestInChargeCardFailure)(response.status), (0, snackbarReducer_1.openSnackbar)({
34
- messageSection: 'charge_card_express_interest',
35
- messageText: 'failed',
36
- type: 'error',
37
- variables: [
38
- {
39
- variableName: '_api-error_',
40
- variableValue: response.status.message,
41
- },
42
- ],
43
- }));
44
- }
45
- }), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, chargeCardSetUpViewReducer_1.expressInterestInChargeCardFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Express Interest in Charge Card errored out' +
46
- JSON.stringify(error))))));
47
- }));
48
- exports.expressInterestChargeCardEpic = expressInterestChargeCardEpic;