@zeniai/client-epic-state 4.12.96 → 4.12.98

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 (92) hide show
  1. package/lib/commonPayloadTypes/commonPayload.d.ts +0 -7
  2. package/lib/commonPayloadTypes/v2/getSumOfBalancesGroupedByPeriod.d.ts +0 -0
  3. package/lib/commonPayloadTypes/v2/getSumOfBalancesGroupedByPeriod.js +1 -0
  4. package/lib/commonStateTypes/fileType.d.ts +2 -2
  5. package/lib/commonStateTypes/fileType.js +1 -1
  6. package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSectionWithAcOnly.d.ts +0 -0
  7. package/lib/commonStateTypes/selectorTypes/pickAndMergeForecastSectionWithAcOnly.js +1 -0
  8. package/lib/entity/company/companyPayload.d.ts +0 -4
  9. package/lib/entity/company/companyPayload.js +3 -8
  10. package/lib/entity/company/companyReducer.d.ts +1 -4
  11. package/lib/entity/company/companyReducer.js +2 -6
  12. package/lib/entity/company/companyStateTypes.d.ts +0 -4
  13. package/lib/entity/file/fileState.d.ts +3 -3
  14. package/lib/entity/file/fileState.js +0 -2
  15. package/lib/entity/tenant/clearAllEpic.d.ts +1 -3
  16. package/lib/entity/tenant/clearAllEpic.js +0 -4
  17. package/lib/entity/user/userPayload.d.ts +0 -1
  18. package/lib/entity/user/userReducer.js +8 -9
  19. package/lib/entity/user/userState.d.ts +0 -1
  20. package/lib/epic.d.ts +1 -7
  21. package/lib/epic.js +1 -7
  22. package/lib/index.d.ts +8 -16
  23. package/lib/index.js +8 -20
  24. package/lib/reducer.d.ts +0 -6
  25. package/lib/reducer.js +0 -6
  26. package/lib/view/addressView/__mocks__/json/createCompanyAddressSuccess.json +1 -7
  27. package/lib/view/addressView/__mocks__/json/createCompanyUserAddressSuccess.json +1 -7
  28. package/lib/view/addressView/addressViewState.d.ts +1 -1
  29. package/lib/view/addressView/toAddressViewLocalData.js +0 -5
  30. package/lib/view/commonVendorView/vendorView/vendorViewSelector.d.ts +1 -1
  31. package/lib/view/companyView/epic/companyPassport/updateCompanyPassportLocalStoreDataEpic.js +6 -1
  32. package/lib/view/companyView/selectorHelpers/getCompanyView.js +0 -4
  33. package/lib/view/companyView/types/companyPassport/companyUsersLocalData.d.ts +0 -2
  34. package/lib/view/companyView/types/companyPassport/companyUsersLocalData.js +1 -7
  35. package/lib/view/companyView/types/companyView.d.ts +0 -1
  36. package/lib/view/onboardingView/customerView/epic/customerDetails/fetchOnboardingCustomerViewEpic.d.ts +1 -8
  37. package/lib/view/onboardingView/customerView/epic/customerDetails/fetchOnboardingCustomerViewEpic.js +1 -3
  38. package/lib/view/onboardingView/customerView/epic/customerDetails/updateOnboardingCustomerViewEpic.js +4 -5
  39. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +0 -2
  40. package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +3 -6
  41. package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
  42. package/lib/view/spendManagement/billPay/billPayConfig/billPayConfigState.d.ts +4 -1
  43. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.d.ts +0 -2
  44. package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +0 -3
  45. package/lib/view/spendManagement/billPay/internationalWire/internationalWireSelector.d.ts +1 -2
  46. package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.d.ts +1 -1
  47. package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +6 -31
  48. package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.d.ts +2 -2
  49. package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +2 -5
  50. package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +1 -4
  51. package/lib/view/spendManagement/commonSetup/setupViewSelector.js +2 -6
  52. package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -1
  53. package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +0 -4
  54. package/lib/view/vendorFiling1099/__mock__/vendorFiling1099ListMock.js +0 -70
  55. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListPayload.d.ts +0 -22
  56. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListReducer.d.ts +1 -5
  57. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListReducer.js +2 -29
  58. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListSelector.d.ts +0 -2
  59. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListSelector.js +1 -5
  60. package/lib/view/vendorFiling1099/vendorFiling1099List/vendorFiling1099ListState.d.ts +0 -2
  61. package/lib/view/zeniAccountsPromoCard/zeniAccountsPromoCardReducer.js +3 -1
  62. package/package.json +2 -2
  63. package/lib/view/countryList/countryListReducer.d.ts +0 -17
  64. package/lib/view/countryList/countryListReducer.js +0 -58
  65. package/lib/view/countryList/countryListSelector.d.ts +0 -7
  66. package/lib/view/countryList/countryListSelector.js +0 -13
  67. package/lib/view/countryList/countryListState.d.ts +0 -12
  68. package/lib/view/countryList/countryListState.js +0 -2
  69. package/lib/view/countryList/epics/fetchCountryListEpic.d.ts +0 -6
  70. package/lib/view/countryList/epics/fetchCountryListEpic.js +0 -19
  71. package/lib/view/countryList/epics/fetchNationalityCountryListEpic.d.ts +0 -7
  72. package/lib/view/countryList/epics/fetchNationalityCountryListEpic.js +0 -38
  73. package/lib/view/countryList/payloads/countryListPayload.d.ts +0 -6
  74. package/lib/view/countryList/payloads/countryListPayload.js +0 -10
  75. package/lib/view/countryList/payloads/nationalityCountryListPayload.d.ts +0 -11
  76. package/lib/view/countryList/payloads/nationalityCountryListPayload.js +0 -2
  77. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.d.ts +0 -7
  78. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/fetchIntlVerificationFormEpic.js +0 -36
  79. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.d.ts +0 -6
  80. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/initializeIntlVerificationFormEpic.js +0 -28
  81. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.d.ts +0 -9
  82. package/lib/view/spendManagement/billPay/internationalWireVerification/epics/submitIntlVerificationEpic.js +0 -67
  83. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.d.ts +0 -26
  84. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationPayload.js +0 -22
  85. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.d.ts +0 -22
  86. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationReducer.js +0 -89
  87. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.d.ts +0 -15
  88. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationSelector.js +0 -30
  89. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationState.d.ts +0 -20
  90. package/lib/view/spendManagement/billPay/internationalWireVerification/internationalWireVerificationState.js +0 -2
  91. package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099DownloadEpic.d.ts +0 -7
  92. package/lib/view/vendorFiling1099/vendorFiling1099List/fetchVendorsFiling1099DownloadEpic.js +0 -35
@@ -39,7 +39,9 @@ const zeniAccountsPromoCard = (0, toolkit_1.createSlice)({
39
39
  promoPayload.max_cash_balance_available != null
40
40
  ? promoPayload.max_cash_balance_available
41
41
  : undefined;
42
- draft.maxInsuredAmount = promoPayload.max_insured_amount;
42
+ // TODO https://app.clickup.com/t/86cxgce6m - hardcoding this fix for now until
43
+ // platform can fix this value
44
+ draft.maxInsuredAmount = 3000000; ///promoPayload.max_insured_amount;
43
45
  draft.depositAccountId =
44
46
  promoPayload.primary_deposit_account_id != null
45
47
  ? promoPayload.primary_deposit_account_id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.12.96",
3
+ "version": "4.12.98",
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",
@@ -88,7 +88,7 @@
88
88
  "build": "concurrently --kill-others-on-fail \"eslint . --ext .js,.jsx,.ts,.tsx\" \"tsc\" \"jest --config jest.config.json\"",
89
89
  "onlybuild": "concurrently --kill-others-on-fail \"eslint . --ext .js,.jsx,.ts,.tsx\" \"tsc\"",
90
90
  "format": "prettier --write --ignore-unknown \"src/**/*\"",
91
- "format-watch": "(git diff --name-only --diff-filter=ACM && git ls-files --others --exclude-standard) | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
91
+ "format-watch": "git diff --name-only --cached --diff-filter=ACM | grep -E '\\.(ts|tsx)$' | xargs prettier --write",
92
92
  "check-version": "ts-node ./scripts/check-version.ts",
93
93
  "version": "git add -A src",
94
94
  "postversion": "git push && git push --tags",
@@ -1,17 +0,0 @@
1
- import { CountryList, CountryListKeyType, CountryListState } from './countryListState';
2
- import { CountryListPayload } from './payloads/countryListPayload';
3
- import { ZeniAPIStatus } from '../../responsePayload';
4
- export declare const initialCountryList: CountryList;
5
- export declare const initialState: CountryListState;
6
- export declare const fetchCountryList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[countryListKey: "nationalityCountryList", cacheOverride?: any], {
7
- countryListKey: "nationalityCountryList";
8
- cacheOverride: any;
9
- }, string, never, never>, fetchNationalityCountryList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, updateCountryList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
10
- countryListKey: CountryListKeyType;
11
- countryListPayload: CountryListPayload[];
12
- }, string>, updateCountryListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
13
- countryListKey: CountryListKeyType;
14
- status: ZeniAPIStatus;
15
- }, string>, clearCountryList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
16
- declare const _default: import("@reduxjs/toolkit").Reducer<CountryListState, import("@reduxjs/toolkit").AnyAction>;
17
- export default _default;
@@ -1,58 +0,0 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearCountryList = exports.updateCountryListFailure = exports.updateCountryList = exports.fetchNationalityCountryList = exports.fetchCountryList = exports.initialState = exports.initialCountryList = void 0;
5
- const toolkit_1 = require("@reduxjs/toolkit");
6
- const countryListPayload_1 = require("./payloads/countryListPayload");
7
- exports.initialCountryList = {
8
- fetchState: 'Not-Started',
9
- error: undefined,
10
- countries: [],
11
- hasValidState() {
12
- return this.fetchState == 'Completed';
13
- },
14
- };
15
- exports.initialState = {
16
- byCountryListCode: {
17
- nationalityCountryList: exports.initialCountryList,
18
- },
19
- };
20
- const countryList = (0, toolkit_1.createSlice)({
21
- name: 'countryList',
22
- initialState: exports.initialState,
23
- reducers: {
24
- fetchCountryList: {
25
- reducer(draft, action) {
26
- if (action.payload.cacheOverride ||
27
- draft.byCountryListCode[action.payload.countryListKey].fetchState !==
28
- 'Completed') {
29
- draft.byCountryListCode[action.payload.countryListKey] = Object.assign(Object.assign({}, exports.initialCountryList), { fetchState: 'In-Progress', error: undefined });
30
- }
31
- },
32
- prepare(countryListKey, cacheOverride = false) {
33
- return {
34
- payload: {
35
- countryListKey,
36
- cacheOverride,
37
- },
38
- };
39
- },
40
- },
41
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
42
- fetchNationalityCountryList(_draft) {
43
- // do nothing
44
- },
45
- updateCountryList(draft, action) {
46
- const countryList = action.payload.countryListPayload.map((nCountry) => (0, countryListPayload_1.toCountry)(nCountry));
47
- draft.byCountryListCode[action.payload.countryListKey] = Object.assign(Object.assign({}, exports.initialCountryList), { fetchState: 'Completed', error: undefined, countries: countryList });
48
- },
49
- updateCountryListFailure(draft, action) {
50
- draft.byCountryListCode[action.payload.countryListKey] = Object.assign(Object.assign({}, exports.initialCountryList), { fetchState: 'Error', error: action.payload.status });
51
- },
52
- clearCountryList(draft) {
53
- Object.assign(draft, exports.initialState);
54
- },
55
- },
56
- });
57
- _a = countryList.actions, exports.fetchCountryList = _a.fetchCountryList, exports.fetchNationalityCountryList = _a.fetchNationalityCountryList, exports.updateCountryList = _a.updateCountryList, exports.updateCountryListFailure = _a.updateCountryListFailure, exports.clearCountryList = _a.clearCountryList;
58
- exports.default = countryList.reducer;
@@ -1,7 +0,0 @@
1
- import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
2
- import { CountryListKeyType, CountryListState, Country } from './countryListState';
3
- export interface CountryListSelectorView extends SelectorView {
4
- countries: Country[];
5
- countryListKey: CountryListKeyType;
6
- }
7
- export declare const getCountryList: (countryListState: CountryListState, countryListKey: CountryListKeyType) => CountryListSelectorView;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCountryList = void 0;
4
- const getCountryList = (countryListState, countryListKey) => {
5
- return {
6
- countries: countryListState.byCountryListCode[countryListKey].countries,
7
- fetchState: countryListState.byCountryListCode[countryListKey].fetchState,
8
- error: countryListState.byCountryListCode[countryListKey].error,
9
- countryListKey: countryListKey,
10
- version: 1,
11
- };
12
- };
13
- exports.getCountryList = getCountryList;
@@ -1,12 +0,0 @@
1
- import { FetchedState } from '../../commonStateTypes/common';
2
- export declare type CountryListKeyType = 'nationalityCountryList';
3
- export interface Country {
4
- countryCode: string;
5
- countryName: string;
6
- }
7
- export interface CountryList extends FetchedState {
8
- countries: Country[];
9
- }
10
- export interface CountryListState {
11
- byCountryListCode: Record<CountryListKeyType, CountryList>;
12
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { RootState } from '../../../reducer';
4
- import { fetchCountryList, fetchNationalityCountryList } from '../countryListReducer';
5
- export declare type ActionType = ReturnType<typeof fetchCountryList> | ReturnType<typeof fetchNationalityCountryList>;
6
- export declare const fetchCountryListEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchCountryListEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const countryListReducer_1 = require("../countryListReducer");
7
- const fetchCountryListEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(countryListReducer_1.fetchCountryList.match), (0, operators_1.mergeMap)((action) => {
8
- const actions = [];
9
- const draft = state$.value.countryListState;
10
- if (action.payload.cacheOverride === true ||
11
- draft.byCountryListCode[action.payload.countryListKey].fetchState !==
12
- 'Completed') {
13
- if (action.payload.countryListKey === 'nationalityCountryList') {
14
- actions.push((0, countryListReducer_1.fetchNationalityCountryList)());
15
- }
16
- }
17
- return (0, rxjs_1.from)(actions);
18
- }));
19
- exports.fetchCountryListEpic = fetchCountryListEpic;
@@ -1,7 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { ZeniAPI } from '../../../zeniAPI';
4
- import { RootState } from '../../../reducer';
5
- import { fetchNationalityCountryList, updateCountryList, updateCountryListFailure } from '../countryListReducer';
6
- export declare type ActionType = ReturnType<typeof fetchNationalityCountryList> | ReturnType<typeof updateCountryList> | ReturnType<typeof updateCountryListFailure>;
7
- export declare const fetchNationalityCountryListEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchNationalityCountryListEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../responsePayload");
7
- const countryListReducer_1 = require("../countryListReducer");
8
- const fetchNationalityCountryListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(countryListReducer_1.fetchNationalityCountryList.match), (0, operators_1.switchMap)(() => {
9
- const queryValue = {
10
- region: 'US',
11
- legal_type: 'BUSINESS',
12
- onboarding_fields: ['nationality'],
13
- };
14
- return zeniAPI
15
- .getJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/international-wire/onboarding-fields?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
16
- .pipe((0, operators_1.mergeMap)((response) => {
17
- var _a, _b;
18
- if ((0, responsePayload_1.isSuccessResponse)(response)) {
19
- return (0, rxjs_1.of)((0, countryListReducer_1.updateCountryList)({
20
- countryListKey: 'nationalityCountryList',
21
- countryListPayload: (_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.labels.nationality.field_values) !== null && _b !== void 0 ? _b : [],
22
- }));
23
- }
24
- else {
25
- return (0, rxjs_1.of)((0, countryListReducer_1.updateCountryListFailure)({
26
- countryListKey: 'nationalityCountryList',
27
- status: response.status,
28
- }));
29
- }
30
- }), (0, operators_1.catchError)((error) => {
31
- return (0, rxjs_1.of)((0, countryListReducer_1.updateCountryListFailure)({
32
- countryListKey: 'nationalityCountryList',
33
- status: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch Nationality Country List REST API call errored out' +
34
- JSON.stringify(error)),
35
- }));
36
- }));
37
- }));
38
- exports.fetchNationalityCountryListEpic = fetchNationalityCountryListEpic;
@@ -1,6 +0,0 @@
1
- import { Country } from '../countryListState';
2
- export interface CountryListPayload {
3
- code: string;
4
- description: string;
5
- }
6
- export declare function toCountry(payload: CountryListPayload): Country;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toCountry = void 0;
4
- function toCountry(payload) {
5
- return {
6
- countryCode: payload.code,
7
- countryName: payload.description,
8
- };
9
- }
10
- exports.toCountry = toCountry;
@@ -1,11 +0,0 @@
1
- import { ZeniAPIResponse } from '../../../responsePayload';
2
- import { CountryListPayload } from './countryListPayload';
3
- export interface NationalityCountryPayload {
4
- labels: {
5
- nationality: {
6
- field_hint_text: string;
7
- field_values: CountryListPayload[];
8
- };
9
- };
10
- }
11
- export declare type NationalityCountryPayloadResponse = ZeniAPIResponse<NationalityCountryPayload>;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { ZeniAPI } from '../../../../../zeniAPI';
4
- import { RootState } from '../../../../../reducer';
5
- import { fetchInternationalVerificationForm, updateInternationalVerificationForm, updateVerificationFormFailure, initializeIntlVerificationForm } from '../internationalWireVerificationReducer';
6
- export declare type ActionType = ReturnType<typeof fetchInternationalVerificationForm> | ReturnType<typeof updateInternationalVerificationForm> | ReturnType<typeof updateVerificationFormFailure> | ReturnType<typeof initializeIntlVerificationForm>;
7
- export declare const fetchIntlVerificationFormEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchIntlVerificationFormEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../../../responsePayload");
7
- const internationalWireVerificationReducer_1 = require("../internationalWireVerificationReducer");
8
- const fetchIntlVerificationFormEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(internationalWireVerificationReducer_1.fetchInternationalVerificationForm.match), (0, operators_1.switchMap)((action) => {
9
- const query = {
10
- region: 'US',
11
- legal_type: 'BUSINESS',
12
- };
13
- return zeniAPI
14
- .getJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/international-wire/onboarding-fields?query=${encodeURIComponent(JSON.stringify(query))}`)
15
- .pipe((0, operators_1.mergeMap)((response) => {
16
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
17
- return (0, rxjs_1.from)([
18
- (0, internationalWireVerificationReducer_1.updateInternationalVerificationForm)({
19
- internationalWireFormPayload: response.data.labels,
20
- }),
21
- (0, internationalWireVerificationReducer_1.initializeIntlVerificationForm)(action.payload.companyId, response.data.labels),
22
- ]);
23
- }
24
- else {
25
- return (0, rxjs_1.of)((0, internationalWireVerificationReducer_1.updateVerificationFormFailure)({
26
- error: response.status,
27
- }));
28
- }
29
- }), (0, operators_1.catchError)((error) => {
30
- return (0, rxjs_1.of)((0, internationalWireVerificationReducer_1.updateVerificationFormFailure)({
31
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch international verification form REST API call errored out' +
32
- JSON.stringify(error)),
33
- }));
34
- }));
35
- }));
36
- exports.fetchIntlVerificationFormEpic = fetchIntlVerificationFormEpic;
@@ -1,6 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { updateVerificationFormLocalData, initializeIntlVerificationForm } from '../internationalWireVerificationReducer';
4
- import { RootState } from '../../../../../reducer';
5
- export declare type ActionType = ReturnType<typeof updateVerificationFormLocalData> | ReturnType<typeof initializeIntlVerificationForm>;
6
- export declare const initializeIntlVerificationFormEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initializeIntlVerificationFormEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const internationalWireVerificationReducer_1 = require("../internationalWireVerificationReducer");
7
- const initializeIntlVerificationFormEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(internationalWireVerificationReducer_1.initializeIntlVerificationForm.match), (0, operators_1.mergeMap)((action) => {
8
- const { companyId, internationalWireFormPayload } = action.payload;
9
- const actions = [];
10
- const state = state$.value;
11
- const onboardingDataFromCompanyInfo = state.companyState.companiesById[companyId].companyBillPayInfo
12
- .internationalWireOnboardingDetails;
13
- const localData = {};
14
- Object.keys(internationalWireFormPayload).forEach((formFieldKey) => {
15
- const values = onboardingDataFromCompanyInfo[formFieldKey].values;
16
- localData[formFieldKey] =
17
- internationalWireFormPayload[formFieldKey].type === 'enum'
18
- ? values.length === 1
19
- ? typeof values[0] === 'object' && 'code' in values[0]
20
- ? values[0].code
21
- : ''
22
- : values.map((value) => typeof value === 'object' && 'code' in value ? value.code : '')
23
- : values[0];
24
- });
25
- actions.push((0, internationalWireVerificationReducer_1.updateVerificationFormLocalData)(localData));
26
- return (0, rxjs_1.from)(actions);
27
- }));
28
- exports.initializeIntlVerificationFormEpic = initializeIntlVerificationFormEpic;
@@ -1,9 +0,0 @@
1
- import { ActionsObservable, StateObservable } from 'redux-observable';
2
- import { Observable } from 'rxjs';
3
- import { ZeniAPI } from '../../../../../zeniAPI';
4
- import { RootState } from '../../../../../reducer';
5
- import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
6
- import { submitInternationalVerificationForm, updateVerificationFormSubmissionStatus } from '../internationalWireVerificationReducer';
7
- import { updateInternationalWireOnboardingStatus } from '../../../../../entity/company/companyReducer';
8
- export declare type ActionType = ReturnType<typeof submitInternationalVerificationForm> | ReturnType<typeof updateVerificationFormSubmissionStatus> | ReturnType<typeof updateInternationalWireOnboardingStatus> | ReturnType<typeof openSnackbar>;
9
- export declare const submitIntlVerificationEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.submitIntlVerificationEpic = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const responsePayload_1 = require("../../../../../responsePayload");
7
- const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
8
- const internationalWireVerificationReducer_1 = require("../internationalWireVerificationReducer");
9
- const companyReducer_1 = require("../../../../../entity/company/companyReducer");
10
- const submitIntlVerificationEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(internationalWireVerificationReducer_1.submitInternationalVerificationForm.match), (0, operators_1.switchMap)((action) => {
11
- const { internationalWireVerificationState } = state$.value;
12
- const { companyId } = action.payload;
13
- const localData = internationalWireVerificationState.verificationFormLocalData;
14
- if (localData != null) {
15
- return zeniAPI
16
- .postAndGetJSON(`${zeniAPI.apiEndPoints.payMicroServiceBaseUrl}/1.0/international-wire/onboarding`, toIntlWireVerificationPayload(localData))
17
- .pipe((0, operators_1.mergeMap)((response) => {
18
- var _a;
19
- const actions = [];
20
- if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
21
- actions.push((0, internationalWireVerificationReducer_1.updateVerificationFormSubmissionStatus)({
22
- fetchState: 'Completed',
23
- error: undefined,
24
- }));
25
- actions.push((0, snackbarReducer_1.openSnackbar)({
26
- messageSection: 'business_verification_submit',
27
- messageText: 'success',
28
- type: 'success',
29
- }));
30
- if (response.data != null) {
31
- actions.push((0, companyReducer_1.updateInternationalWireOnboardingStatus)({
32
- companyId: companyId,
33
- status: (_a = response.data) === null || _a === void 0 ? void 0 : _a.international_wire_onboarding_status,
34
- }));
35
- }
36
- }
37
- else {
38
- actions.push((0, internationalWireVerificationReducer_1.updateVerificationFormSubmissionStatus)({
39
- fetchState: 'Error',
40
- error: response.status,
41
- }));
42
- actions.push((0, snackbarReducer_1.openSnackbar)({
43
- messageSection: 'business_verification_submit',
44
- messageText: 'failed',
45
- type: 'error',
46
- }));
47
- }
48
- return (0, rxjs_1.from)(actions);
49
- }), (0, operators_1.catchError)((error) => {
50
- return (0, rxjs_1.of)((0, internationalWireVerificationReducer_1.updateVerificationFormSubmissionStatus)({
51
- fetchState: 'Error',
52
- error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Submit international wire verification REST API call errored out' +
53
- JSON.stringify(error)),
54
- }));
55
- }));
56
- }
57
- else {
58
- return (0, rxjs_1.from)([]);
59
- }
60
- }));
61
- exports.submitIntlVerificationEpic = submitIntlVerificationEpic;
62
- const toIntlWireVerificationPayload = (localData) => {
63
- return {
64
- is_applicant_declaration: true,
65
- form_details: localData,
66
- };
67
- };
@@ -1,26 +0,0 @@
1
- import { AllowedValueWithCode } from '../../../../commonStateTypes/allowedValue';
2
- import { ZeniAPIResponse } from '../../../../responsePayload';
3
- import { VerificationFormField } from './internationalWireVerificationState';
4
- export interface FieldPayload {
5
- label: string;
6
- type: string;
7
- field_hint_text?: string;
8
- field_values?: {
9
- code: string;
10
- description: string;
11
- }[];
12
- is_multiple_values_allowed?: boolean;
13
- }
14
- export declare const toDynamicFormField: (key: string, payload: FieldPayload) => VerificationFormField;
15
- export declare type IntlVerificationFormResponse = ZeniAPIResponse<IntlVerificationFormPayload>;
16
- export interface IntlVerificationFormPayload {
17
- labels: Record<string, FieldPayload>;
18
- create_time: string;
19
- update_time: string;
20
- }
21
- interface SubmitIntlVerificationFormPayload {
22
- international_wire_onboarding_status: AllowedValueWithCode;
23
- status_remarks: string | null;
24
- }
25
- export declare type SubmitIntlVerificationFormResponse = ZeniAPIResponse<SubmitIntlVerificationFormPayload>;
26
- export {};
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toDynamicFormField = void 0;
4
- const toDynamicFormField = (key, payload) => {
5
- var _a, _b;
6
- return ({
7
- name: key,
8
- label: payload.label,
9
- placeholder: (_a = payload.field_hint_text) !== null && _a !== void 0 ? _a : '',
10
- isMultipleValuesAllowed: (_b = payload.is_multiple_values_allowed) !== null && _b !== void 0 ? _b : false,
11
- type: payload.type,
12
- fieldValues: payload.field_values != null && payload.field_values.length > 0
13
- ? payload.field_values.map((fieldValue) => {
14
- return {
15
- code: fieldValue.code,
16
- description: fieldValue.description,
17
- };
18
- })
19
- : [],
20
- });
21
- };
22
- exports.toDynamicFormField = toDynamicFormField;
@@ -1,22 +0,0 @@
1
- import { FieldPayload } from './internationalWireVerificationPayload';
2
- import { VerificationFormLocalData, InternationalWireVerificationState } from './internationalWireVerificationState';
3
- import { FetchState } from '../../../../commonStateTypes/common';
4
- import { ZeniAPIStatus } from '../../../../responsePayload';
5
- export declare const initialState: InternationalWireVerificationState;
6
- export declare const fetchInternationalVerificationForm: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
7
- companyId: string;
8
- }, string, never, never>, updateInternationalVerificationForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
9
- internationalWireFormPayload: Record<string, FieldPayload>;
10
- }, string>, updateVerificationFormFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
11
- error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
12
- }, string>, updateVerificationFormLocalData: import("@reduxjs/toolkit").ActionCreatorWithPayload<VerificationFormLocalData, string>, submitInternationalVerificationForm: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
13
- companyId: string;
14
- }, string, never, never>, updateVerificationFormSubmissionStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
15
- fetchState: FetchState;
16
- error?: ZeniAPIStatus<Record<string, unknown>> | undefined;
17
- }, string>, initializeIntlVerificationForm: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, internationalWireFormPayload: Record<string, FieldPayload>], {
18
- companyId: string;
19
- internationalWireFormPayload: Record<string, FieldPayload>;
20
- }, string, never, never>, clearInternationalVerificationView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
21
- declare const _default: import("@reduxjs/toolkit").Reducer<InternationalWireVerificationState, import("@reduxjs/toolkit").AnyAction>;
22
- export default _default;
@@ -1,89 +0,0 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearInternationalVerificationView = exports.initializeIntlVerificationForm = exports.updateVerificationFormSubmissionStatus = exports.submitInternationalVerificationForm = exports.updateVerificationFormLocalData = exports.updateVerificationFormFailure = exports.updateInternationalVerificationForm = exports.fetchInternationalVerificationForm = exports.initialState = void 0;
5
- const toolkit_1 = require("@reduxjs/toolkit");
6
- const internationalWireVerificationPayload_1 = require("./internationalWireVerificationPayload");
7
- exports.initialState = {
8
- verificationFormFetchState: {
9
- fetchState: 'Not-Started',
10
- },
11
- verificationFormFields: [],
12
- verificationFormLocalData: {},
13
- verificationFormSubmitState: {
14
- fetchState: 'Not-Started',
15
- },
16
- };
17
- const internationalWireVerification = (0, toolkit_1.createSlice)({
18
- name: 'internationalWireVerification',
19
- initialState: exports.initialState,
20
- reducers: {
21
- fetchInternationalVerificationForm: {
22
- reducer(draft) {
23
- draft.verificationFormFetchState = {
24
- fetchState: 'In-Progress',
25
- error: undefined,
26
- };
27
- },
28
- prepare(companyId) {
29
- return {
30
- payload: {
31
- companyId,
32
- },
33
- };
34
- },
35
- },
36
- updateInternationalVerificationForm(draft, action) {
37
- const { internationalWireFormPayload } = action.payload;
38
- const verificationFormFields = [];
39
- Object.keys(internationalWireFormPayload).forEach((key) => {
40
- verificationFormFields.push((0, internationalWireVerificationPayload_1.toDynamicFormField)(key, internationalWireFormPayload[key]));
41
- });
42
- draft.verificationFormFields = verificationFormFields;
43
- draft.verificationFormFetchState.fetchState = 'Completed';
44
- },
45
- updateVerificationFormFailure(draft, action) {
46
- const { error } = action.payload;
47
- draft.verificationFormFetchState.fetchState = 'Error';
48
- draft.verificationFormFetchState.error = error;
49
- },
50
- updateVerificationFormLocalData(draft, action) {
51
- draft.verificationFormLocalData = Object.assign({}, action.payload);
52
- },
53
- submitInternationalVerificationForm: {
54
- reducer(draft) {
55
- draft.verificationFormSubmitState.fetchState = 'In-Progress';
56
- draft.verificationFormSubmitState.error = undefined;
57
- },
58
- prepare(companyId) {
59
- return {
60
- payload: { companyId },
61
- };
62
- },
63
- },
64
- updateVerificationFormSubmissionStatus(draft, action) {
65
- const { fetchState, error } = action.payload;
66
- draft.verificationFormSubmitState.fetchState = fetchState;
67
- draft.verificationFormSubmitState.error = error;
68
- },
69
- initializeIntlVerificationForm: {
70
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
71
- reducer(_draft) {
72
- // do nothing
73
- },
74
- prepare(companyId, internationalWireFormPayload) {
75
- return {
76
- payload: {
77
- companyId,
78
- internationalWireFormPayload,
79
- },
80
- };
81
- },
82
- },
83
- clearInternationalVerificationView(draft) {
84
- Object.assign(draft, exports.initialState);
85
- },
86
- },
87
- });
88
- _a = internationalWireVerification.actions, exports.fetchInternationalVerificationForm = _a.fetchInternationalVerificationForm, exports.updateInternationalVerificationForm = _a.updateInternationalVerificationForm, exports.updateVerificationFormFailure = _a.updateVerificationFormFailure, exports.updateVerificationFormLocalData = _a.updateVerificationFormLocalData, exports.submitInternationalVerificationForm = _a.submitInternationalVerificationForm, exports.updateVerificationFormSubmissionStatus = _a.updateVerificationFormSubmissionStatus, exports.initializeIntlVerificationForm = _a.initializeIntlVerificationForm, exports.clearInternationalVerificationView = _a.clearInternationalVerificationView;
89
- exports.default = internationalWireVerification.reducer;
@@ -1,15 +0,0 @@
1
- import { ID, FetchStateAndError } from '../../../../commonStateTypes/common';
2
- import { RootState } from '../../../../reducer';
3
- import { SelectorView } from '../../../../commonStateTypes/viewAndReport/viewAndReport';
4
- import { VerificationFormField, VerificationFormLocalData } from './internationalWireVerificationState';
5
- import { File } from '../../../../entity/file/fileState';
6
- export interface InternationalWireVerificationView extends SelectorView {
7
- verificationFormFetchState: FetchStateAndError;
8
- verificationFormFields: VerificationFormField[];
9
- verificationFormLocalData: VerificationFormLocalData;
10
- verificationFormSubmitState: FetchStateAndError;
11
- userFiles: File[];
12
- deleteFileStatusById: Record<ID, FetchStateAndError | undefined>;
13
- updateFileStatusById: Record<ID, FetchStateAndError | undefined>;
14
- }
15
- export declare const getIntlWireVerificationView: (state: RootState) => InternationalWireVerificationView;