@zeniai/client-epic-state 5.0.88-beta0ND → 5.0.88-betaAR2
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 +0 -1
- package/lib/entity/company/companyPayload.d.ts +0 -4
- package/lib/entity/company/companyPayload.js +0 -4
- package/lib/entity/company/companyStateTypes.d.ts +0 -4
- package/lib/entity/paymentAccount/paymentAccountSelector.d.ts +0 -1
- package/lib/entity/paymentAccount/paymentAccountSelector.js +0 -4
- package/lib/entity/tenant/epic/deleteConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveAPIKeyConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/epic/saveConnectorCredentialsEpic.d.ts +3 -3
- package/lib/entity/tenant/epic/saveOAuthConnectionEpic.d.ts +1 -1
- package/lib/entity/tenant/tenantPayload.d.ts +0 -1
- package/lib/entity/tenant/tenantReducer.d.ts +25 -38
- package/lib/entity/tenant/tenantReducer.js +5 -65
- package/lib/entity/tenant/tenantState.d.ts +0 -1
- package/lib/epic.d.ts +3 -8
- package/lib/epic.js +3 -9
- package/lib/esm/commonStateTypes/animations.js +0 -1
- package/lib/esm/entity/company/companyPayload.js +0 -4
- package/lib/esm/entity/paymentAccount/paymentAccountSelector.js +0 -3
- package/lib/esm/entity/tenant/tenantReducer.js +3 -63
- package/lib/esm/epic.js +3 -9
- package/lib/esm/index.js +6 -9
- package/lib/esm/view/expenseAutomationView/transactionFilterHelpers.js +106 -18
- package/lib/esm/view/fileView/epic/deleteFileEpic.js +2 -2
- package/lib/esm/view/fileView/epic/deleteFileListEpic.js +2 -2
- package/lib/esm/view/fileView/epic/updateFileNameEpic.js +2 -2
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewReducer.js +50 -217
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewSelector.js +1 -7
- package/lib/esm/view/onboardingView/customerView/onboardingCustomerViewState.js +0 -12
- package/lib/esm/view/spendManagement/commonSetup/setupViewReducer.js +52 -105
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/index.d.ts +7 -11
- package/lib/index.js +31 -51
- package/lib/view/expenseAutomationView/transactionFilterHelpers.js +106 -18
- package/lib/view/fileView/epic/deleteFileEpic.js +1 -1
- package/lib/view/fileView/epic/deleteFileListEpic.js +1 -1
- package/lib/view/fileView/epic/updateFileNameEpic.js +1 -1
- package/lib/view/onboardingView/customerView/onboardingCustomerViewPayload.d.ts +0 -3
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.d.ts +4 -41
- package/lib/view/onboardingView/customerView/onboardingCustomerViewReducer.js +51 -219
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.d.ts +1 -5
- package/lib/view/onboardingView/customerView/onboardingCustomerViewSelector.js +2 -11
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.d.ts +0 -40
- package/lib/view/onboardingView/customerView/onboardingCustomerViewState.js +1 -13
- package/lib/view/spendManagement/commonSetup/setupViewReducer.d.ts +2 -28
- package/lib/view/spendManagement/commonSetup/setupViewReducer.js +53 -106
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +2 -7
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -6
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -19
- package/package.json +1 -1
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.d.ts +0 -21
- package/lib/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -54
- package/lib/esm/entity/tenant/epic/initEmailConnectOAuthEpic.js +0 -50
- package/lib/esm/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -42
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -29
- package/lib/esm/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -40
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -52
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -59
- package/lib/esm/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -14
- package/lib/esm/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -205
- package/lib/esm/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -28
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.d.ts +0 -7
- package/lib/view/onboardingView/customerView/epic/aiAgentsActivation/fetchAiAgentsActivationStatusEpic.js +0 -46
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.d.ts +0 -8
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiActivationViewedEpic.js +0 -33
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.d.ts +0 -9
- package/lib/view/onboardingView/customerView/epic/customerDetails/acknowledgeOnboardingAiFinanceTeamEpic.js +0 -44
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.d.ts +0 -28
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKybDocumentEpic.js +0 -56
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.d.ts +0 -30
- package/lib/view/spendManagement/commonSetup/epic/setup/parseUploadedKycDocumentEpic.js +0 -63
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.d.ts +0 -33
- package/lib/view/spendManagement/commonSetup/kycKybAutofillActions.js +0 -17
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.d.ts +0 -24
- package/lib/view/spendManagement/commonSetup/kycKybParseMapper.js +0 -213
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.d.ts +0 -125
- package/lib/view/spendManagement/commonSetup/types/kycKybAutofill.js +0 -32
|
@@ -31,28 +31,87 @@ exports.TRANSACTION_FILTER_CATEGORIES = [
|
|
|
31
31
|
{ value: 'class', type: 'dropdown' },
|
|
32
32
|
{ value: 'amount', type: 'numberRange' },
|
|
33
33
|
];
|
|
34
|
+
/**
|
|
35
|
+
* Per-line amounts for a transaction, preserving the canonical source
|
|
36
|
+
* precedence:
|
|
37
|
+
*
|
|
38
|
+
* 1. `transactionLocalData.transactionReviewLocalData.lineItemById` —
|
|
39
|
+
* the locally-edited line items the user sees in the grid. Reflects
|
|
40
|
+
* unsaved edits so the filter matches what the user actually has on
|
|
41
|
+
* screen, not the pre-edit server state.
|
|
42
|
+
* 2. `transaction.transaction.lines` — persisted lines from the
|
|
43
|
+
* transaction payload.
|
|
44
|
+
* 3. `[transaction.amount.amount]` — single-element fallback for
|
|
45
|
+
* transactions that don't have a `lines` array at all (treat the
|
|
46
|
+
* transaction-level amount as a one-line transaction).
|
|
47
|
+
*
|
|
48
|
+
* Returned as an array so the amount filter in `transactionMatchesCategory`
|
|
49
|
+
* can OR-combine per-line `matchAmount` results: a transaction is included
|
|
50
|
+
* if ANY of its lines satisfies the operator, and the full row (with all
|
|
51
|
+
* lines, matching or not) renders downstream. Before the per-line change
|
|
52
|
+
* this helper's predecessor in `getCategoryValueForTransaction` summed
|
|
53
|
+
* these values into a single aggregate and compared the sum.
|
|
54
|
+
*
|
|
55
|
+
* **Missing amounts.** Lines (or transactions) whose amount field is
|
|
56
|
+
* `null` / `undefined` / `NaN` are *dropped* from the returned array
|
|
57
|
+
* rather than coerced to `0`. Coercing to `0` would silently make a
|
|
58
|
+
* row with no amount data match operators like `less_than 100`, even
|
|
59
|
+
* though we genuinely don't know what the amount is — a semantic
|
|
60
|
+
* regression flagged in PR review. By filtering instead, the empty-array
|
|
61
|
+
* case bubbles up to `transactionMatchesCategory`, which falls back to
|
|
62
|
+
* the same "absent value: only `not_equal` matches" contract used by
|
|
63
|
+
* non-amount fields.
|
|
64
|
+
*
|
|
65
|
+
* The defensive `?.` chains stay in place so a partial payload (state
|
|
66
|
+
* init, Pusher mid-sync, partially-resolved server response) doesn't
|
|
67
|
+
* throw; the difference is `?? 0` → filter-out.
|
|
68
|
+
*/
|
|
69
|
+
const getLineAmountsForTransaction = (transaction) => {
|
|
70
|
+
const localData = transaction?.transactionLocalData?.transactionReviewLocalData;
|
|
71
|
+
if (localData?.lineItemById != null) {
|
|
72
|
+
const lineItems = Object.values(localData.lineItemById);
|
|
73
|
+
if (lineItems.length > 0) {
|
|
74
|
+
return lineItems
|
|
75
|
+
.map((lineItem) => lineItem?.amount?.amount)
|
|
76
|
+
.filter(isFiniteNumber);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (transaction?.transaction?.lines != null &&
|
|
80
|
+
transaction.transaction.lines.length > 0) {
|
|
81
|
+
return transaction.transaction.lines
|
|
82
|
+
.map((line) => line?.amount?.amount)
|
|
83
|
+
.filter(isFiniteNumber);
|
|
84
|
+
}
|
|
85
|
+
const txAmount = transaction?.amount?.amount;
|
|
86
|
+
return isFiniteNumber(txAmount) ? [txAmount] : [];
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Type guard that survives an `Array<number | undefined>.filter(...)` and
|
|
90
|
+
* narrows the result to `number[]`. Also rejects `NaN` so downstream
|
|
91
|
+
* `matchAmount` never sees a value that fails every operator silently
|
|
92
|
+
* (because every comparison with `NaN` is false, `NaN < 100`, `NaN > 100`,
|
|
93
|
+
* `NaN === N` all yield `false` — the row would silently slip through
|
|
94
|
+
* `not_equal` but fail every other operator, which is exactly the
|
|
95
|
+
* absent-value contract we want to apply explicitly via an empty array
|
|
96
|
+
* instead).
|
|
97
|
+
*/
|
|
98
|
+
const isFiniteNumber = (value) => typeof value === 'number' && Number.isFinite(value);
|
|
34
99
|
/**
|
|
35
100
|
* Resolve the comparable value for a transaction against a given filter field.
|
|
36
101
|
* Returns undefined when the transaction doesn't carry the field — callers
|
|
37
102
|
* decide whether absence counts as a match (for 'not_equal' it does).
|
|
103
|
+
*
|
|
104
|
+
* NOTE: the `'amount'` field is NOT handled here. Amount matching is
|
|
105
|
+
* per-line (see `getLineAmountsForTransaction` + the early-return in
|
|
106
|
+
* `transactionMatchesCategory`) and would otherwise need to return a
|
|
107
|
+
* non-scalar value that doesn't fit this helper's contract.
|
|
38
108
|
*/
|
|
39
109
|
const getCategoryValueForTransaction = (key, transaction) => {
|
|
40
110
|
switch (key) {
|
|
41
111
|
case 'amount': {
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
if (localDataForAmount?.lineItemById) {
|
|
46
|
-
const lineItems = Object.values(localDataForAmount.lineItemById);
|
|
47
|
-
if (lineItems.length > 0) {
|
|
48
|
-
return lineItems.reduce((sum, lineItem) => sum + (lineItem.amount?.amount ?? 0), 0);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if (transaction.transaction.lines &&
|
|
52
|
-
transaction.transaction.lines.length > 0) {
|
|
53
|
-
return transaction.transaction.lines.reduce((sum, line) => sum + (line.amount?.amount ?? 0), 0);
|
|
54
|
-
}
|
|
55
|
-
return transaction.amount.amount;
|
|
112
|
+
// Handled per-line in `transactionMatchesCategory` — see the note on
|
|
113
|
+
// this function's JSDoc and `getLineAmountsForTransaction` above.
|
|
114
|
+
return undefined;
|
|
56
115
|
}
|
|
57
116
|
case 'payee': {
|
|
58
117
|
if (isNonEmptyString(transaction.vendorName)) {
|
|
@@ -190,6 +249,37 @@ const matchAmount = (amount, category) => {
|
|
|
190
249
|
return op === 'not_equal' ? !matched : matched;
|
|
191
250
|
};
|
|
192
251
|
const transactionMatchesCategory = (transaction, category) => {
|
|
252
|
+
if (category.field === 'amount') {
|
|
253
|
+
// Per-line matching: the transaction is included if ANY of its lines
|
|
254
|
+
// satisfies the operator. This is what the user expects when a
|
|
255
|
+
// multi-line transaction contains lines at different amounts — they
|
|
256
|
+
// want the row to surface if even one line falls in the filter's
|
|
257
|
+
// range. The full row (with non-matching lines too) renders
|
|
258
|
+
// downstream; this matcher only decides row inclusion. Same
|
|
259
|
+
// operator + sign semantics as the aggregate version, just applied
|
|
260
|
+
// per line.
|
|
261
|
+
//
|
|
262
|
+
// `not_equal` deserves a sanity-check: `matchAmount` already inverts
|
|
263
|
+
// internally for that operator, so for a line whose amount is NOT
|
|
264
|
+
// in the filter's `values`, matchAmount returns true; for a line
|
|
265
|
+
// whose amount IS in the values, it returns false. `.some()` over
|
|
266
|
+
// lines therefore means "the transaction has at least one line that
|
|
267
|
+
// is not equal to any of the filter values" — which is the right
|
|
268
|
+
// match-any-line interpretation of `not_equal` (a transaction
|
|
269
|
+
// matches if it has a line that satisfies the negation).
|
|
270
|
+
const lineAmounts = getLineAmountsForTransaction(transaction);
|
|
271
|
+
if (lineAmounts.length === 0) {
|
|
272
|
+
// No valid (finite) amount data on the transaction or its lines —
|
|
273
|
+
// apply the same absent-value contract the generic branch below
|
|
274
|
+
// uses for non-amount fields: only `not_equal` matches a missing
|
|
275
|
+
// value, every other operator excludes it. Coercing missing
|
|
276
|
+
// amounts to `0` upstream (the previous behavior) would have made
|
|
277
|
+
// such rows silently match `less_than 100`, `in_between [0, 50]`,
|
|
278
|
+
// etc., which the PR review correctly flagged as a regression.
|
|
279
|
+
return category.matchingOperator === 'not_equal';
|
|
280
|
+
}
|
|
281
|
+
return lineAmounts.some((lineAmount) => matchAmount(lineAmount, category));
|
|
282
|
+
}
|
|
193
283
|
const value = getCategoryValueForTransaction(category.field, transaction);
|
|
194
284
|
if (value == null) {
|
|
195
285
|
// Absent-value semantics — pinning these down explicitly so the
|
|
@@ -209,12 +299,10 @@ const transactionMatchesCategory = (transaction, category) => {
|
|
|
209
299
|
// are filtered out.
|
|
210
300
|
//
|
|
211
301
|
// Only the `not_equal` branch returns `true` here; everything else
|
|
212
|
-
// falls through to the `false` below.
|
|
302
|
+
// falls through to the `false` below. Note: 'amount' never lands here
|
|
303
|
+
// because it short-circuits to the per-line path above.
|
|
213
304
|
return category.matchingOperator === 'not_equal';
|
|
214
305
|
}
|
|
215
|
-
if (category.field === 'amount') {
|
|
216
|
-
return matchAmount(Number(value), category);
|
|
217
|
-
}
|
|
218
306
|
const valueStr = value.toString();
|
|
219
307
|
const valueInList = category.values.some((v) => v.toString() === valueStr);
|
|
220
308
|
return category.matchingOperator === 'not_equal' ? !valueInList : valueInList;
|
|
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const fileReducer_1 = require("../../../entity/file/fileReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
8
|
const fileViewReducer_1 = require("../fileViewReducer");
|
|
9
|
-
const deleteFileEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fileViewReducer_1.deleteFile.match), (0, operators_1.
|
|
9
|
+
const deleteFileEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fileViewReducer_1.deleteFile.match), (0, operators_1.switchMap)((action) => {
|
|
10
10
|
/**
|
|
11
11
|
* tenantId is required for deleting onboarding files.
|
|
12
12
|
*/
|
|
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const fileReducer_1 = require("../../../entity/file/fileReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
8
|
const fileViewReducer_1 = require("../fileViewReducer");
|
|
9
|
-
const deleteFileListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fileViewReducer_1.deleteFileList.match), (0, operators_1.
|
|
9
|
+
const deleteFileListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fileViewReducer_1.deleteFileList.match), (0, operators_1.switchMap)((action) => {
|
|
10
10
|
const { fileIds } = action.payload;
|
|
11
11
|
return zeniAPI
|
|
12
12
|
.deleteAndGetJSON(`${zeniAPI.apiEndPoints.fileMicroServiceBaseUrl}/1.0/files?query=${encodeURIComponent(JSON.stringify({ file_ids: fileIds }))}`)
|
|
@@ -6,7 +6,7 @@ const operators_1 = require("rxjs/operators");
|
|
|
6
6
|
const fileReducer_1 = require("../../../entity/file/fileReducer");
|
|
7
7
|
const responsePayload_1 = require("../../../responsePayload");
|
|
8
8
|
const fileViewReducer_1 = require("../fileViewReducer");
|
|
9
|
-
const updateFileNameEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fileViewReducer_1.updateFileName.match), (0, operators_1.
|
|
9
|
+
const updateFileNameEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(fileViewReducer_1.updateFileName.match), (0, operators_1.switchMap)((action) => {
|
|
10
10
|
/**
|
|
11
11
|
* tenantId is required for updating onboarding file names.
|
|
12
12
|
*/
|
|
@@ -15,9 +15,6 @@ export interface OnboardingStatusPayload {
|
|
|
15
15
|
is_user_landed_to_interim_page: boolean;
|
|
16
16
|
should_complete_onboarding: boolean;
|
|
17
17
|
}
|
|
18
|
-
export interface AiFinanceTeamAcknowledgementPayload {
|
|
19
|
-
is_onboarding_ai_finance_team_acknowledged: boolean;
|
|
20
|
-
}
|
|
21
18
|
interface CompaniesData {
|
|
22
19
|
companies: CompanyPayload[];
|
|
23
20
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ID } from '../../../commonStateTypes/common';
|
|
2
2
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
3
3
|
import { CompanyOfficerType } from '../../companyView/types/companyPassport/companyUsersLocalData';
|
|
4
|
-
import { CompanyDetailsLocalData, CompanyOfficerLocalData } from '../../spendManagement/commonSetup/setupViewState';
|
|
5
4
|
import { PlaidLinkTokenType } from '../../spendManagement/plaidAccount/plaidAccountViewState';
|
|
6
|
-
import {
|
|
5
|
+
import { OnboardingCustomerViewState, OnboardingCustomerViewUIState, OnboardingStep } from './onboardingCustomerViewState';
|
|
7
6
|
export declare const initialState: OnboardingCustomerViewState;
|
|
8
7
|
export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, cacheOverride?: any, reCalculateCurrentStep?: any], {
|
|
9
8
|
companyId: string;
|
|
@@ -17,17 +16,7 @@ export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").Act
|
|
|
17
16
|
companyId: string;
|
|
18
17
|
checkOnboardingComplete: boolean;
|
|
19
18
|
productSuitePage: boolean;
|
|
20
|
-
}, "onboardingCustomerView/updateOnboardingCustomerViewCompleteStatus", never, never>, updateOnboardingCustomerViewCompleteStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewCompleteStatusSuccess">, updateOnboardingCustomerViewCompleteStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewCompleteStatusFailure", never, never>,
|
|
21
|
-
companyId: string;
|
|
22
|
-
}, "onboardingCustomerView/acknowledgeOnboardingAiFinanceTeam", never, never>, acknowledgeOnboardingAiFinanceTeamSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/acknowledgeOnboardingAiFinanceTeamSuccess">, acknowledgeOnboardingAiFinanceTeamFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/acknowledgeOnboardingAiFinanceTeamFailure", never, never>, acknowledgeOnboardingAiActivationViewed: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
23
|
-
companyId: string;
|
|
24
|
-
}, "onboardingCustomerView/acknowledgeOnboardingAiActivationViewed", never, never>, acknowledgeOnboardingAiActivationViewedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/acknowledgeOnboardingAiActivationViewedSuccess">, acknowledgeOnboardingAiActivationViewedFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/acknowledgeOnboardingAiActivationViewedFailure", never, never>, fetchAiAgentsActivationStatus: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/fetchAiAgentsActivationStatus">, fetchAiAgentsActivationStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
25
|
-
counts: AiAgentsActivationCounts;
|
|
26
|
-
phases: AiAgentsActivationPhase[];
|
|
27
|
-
}], {
|
|
28
|
-
counts: AiAgentsActivationCounts;
|
|
29
|
-
phases: AiAgentsActivationPhase[];
|
|
30
|
-
}, "onboardingCustomerView/fetchAiAgentsActivationStatusSuccess", never, never>, fetchAiAgentsActivationStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/fetchAiAgentsActivationStatusFailure", never, never>, aiAgentsActivationCountsUpdated: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: Partial<AiAgentsActivationCounts>], Partial<AiAgentsActivationCounts>, "onboardingCustomerView/aiAgentsActivationCountsUpdated", never, never>, aiAgentsActivationPhaseChanged: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: AiAgentsActivationPhase], AiAgentsActivationPhase, "onboardingCustomerView/aiAgentsActivationPhaseChanged", never, never>, updateOnboardingCustomerViewDashboardLoaded: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
19
|
+
}, "onboardingCustomerView/updateOnboardingCustomerViewCompleteStatus", never, never>, updateOnboardingCustomerViewCompleteStatusSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewCompleteStatusSuccess">, updateOnboardingCustomerViewCompleteStatusFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewCompleteStatusFailure", never, never>, updateOnboardingCustomerViewDashboardLoaded: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string], {
|
|
31
20
|
companyId: string;
|
|
32
21
|
}, "onboardingCustomerView/updateOnboardingCustomerViewDashboardLoaded", never, never>, updateOnboardingCustomerViewDashboardLoadedSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/updateOnboardingCustomerViewDashboardLoadedSuccess">, updateOnboardingCustomerViewDashboardLoadedFailure: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[error: ZeniAPIStatus<Record<string, unknown>>], ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/updateOnboardingCustomerViewDashboardLoadedFailure", never, never>, updateOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[companyId: string, sendForVerification: boolean, reCalculateCurrentStep?: boolean | undefined, isBillingAddressUpdate?: boolean | undefined, officerType?: "Officer_1" | "Officer_3" | "Officer_2" | "Officer_4" | "Officer_5" | "Officer_6" | "Officer_7" | "Officer_8" | "Officer_9" | "Officer_10" | undefined], {
|
|
33
22
|
companyId: string;
|
|
@@ -83,37 +72,11 @@ export declare const fetchOnboardingCustomerView: import("@reduxjs/toolkit").Act
|
|
|
83
72
|
companyId: ID;
|
|
84
73
|
currentStep?: OnboardingStep;
|
|
85
74
|
reCalculateCurrentStep?: boolean;
|
|
86
|
-
}, "onboardingCustomerView/updateOnboardingCustomerViewLocalStoreData">, saveOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<import("
|
|
75
|
+
}, "onboardingCustomerView/updateOnboardingCustomerViewLocalStoreData">, saveOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<import("../../..").SetupViewLocalData>, "onboardingCustomerView/saveOnboardingCustomerViewDataInLocalStore">, saveOnboardingCompnayOfficerPhoneInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
87
76
|
officerType: CompanyOfficerType;
|
|
88
77
|
phone: string | number;
|
|
89
78
|
}, "onboardingCustomerView/saveOnboardingCompnayOfficerPhoneInLocalStore">, updateOnboardingCustomerViewUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<Partial<OnboardingCustomerViewUIState>, "onboardingCustomerView/updateOnboardingCustomerViewUIState">, sendOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/sendOnboardingOfficerOtp">, sendOnboardingOfficerOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
90
79
|
otpChallenge: string;
|
|
91
|
-
}, "onboardingCustomerView/sendOnboardingOfficerOtpSuccess">, sendOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/sendOnboardingOfficerOtpFailure">, resendOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/resendOnboardingOfficerOtp">, verifyOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtp">, verifyOnboardingOfficerOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtpSuccess">, verifyOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/verifyOnboardingOfficerOtpFailure">, clearOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerViewDataInLocalStore">, clearOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerView"
|
|
92
|
-
autoFilledFieldNames: string[];
|
|
93
|
-
companyId: ID;
|
|
94
|
-
fileId: ID;
|
|
95
|
-
officerType: CompanyOfficerType;
|
|
96
|
-
values: Partial<CompanyOfficerLocalData>;
|
|
97
|
-
}], {
|
|
98
|
-
autoFilledFieldNames: string[];
|
|
99
|
-
companyId: ID;
|
|
100
|
-
fileId: ID;
|
|
101
|
-
officerType: CompanyOfficerType;
|
|
102
|
-
values: Partial<CompanyOfficerLocalData>;
|
|
103
|
-
}, "onboardingCustomerView/applyKycDocumentAutofillForOnboarding", never, never>, applyKybDocumentAutofillForOnboarding: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: {
|
|
104
|
-
autoFilledFieldNames: string[];
|
|
105
|
-
companyId: ID;
|
|
106
|
-
fileId: ID;
|
|
107
|
-
values: Partial<CompanyDetailsLocalData>;
|
|
108
|
-
}], {
|
|
109
|
-
autoFilledFieldNames: string[];
|
|
110
|
-
companyId: ID;
|
|
111
|
-
fileId: ID;
|
|
112
|
-
values: Partial<CompanyDetailsLocalData>;
|
|
113
|
-
}, "onboardingCustomerView/applyKybDocumentAutofillForOnboarding", never, never>, clearKycKybAutofillForOnboarding: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload?: {
|
|
114
|
-
officerType?: CompanyOfficerType;
|
|
115
|
-
} | undefined], {
|
|
116
|
-
officerType?: CompanyOfficerType;
|
|
117
|
-
}, "onboardingCustomerView/clearKycKybAutofillForOnboarding", never, never>;
|
|
80
|
+
}, "onboardingCustomerView/sendOnboardingOfficerOtpSuccess">, sendOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/sendOnboardingOfficerOtpFailure">, resendOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/resendOnboardingOfficerOtp">, verifyOnboardingOfficerOtp: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtp">, verifyOnboardingOfficerOtpSuccess: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/verifyOnboardingOfficerOtpSuccess">, verifyOnboardingOfficerOtpFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "onboardingCustomerView/verifyOnboardingOfficerOtpFailure">, clearOnboardingCustomerViewDataInLocalStore: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerViewDataInLocalStore">, clearOnboardingCustomerView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"onboardingCustomerView/clearOnboardingCustomerView">;
|
|
118
81
|
declare const _default: import("redux").Reducer<OnboardingCustomerViewState>;
|
|
119
82
|
export default _default;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.verifyOnboardingOfficerOtpFailure = exports.verifyOnboardingOfficerOtpSuccess = exports.verifyOnboardingOfficerOtp = exports.resendOnboardingOfficerOtp = exports.sendOnboardingOfficerOtpFailure = exports.sendOnboardingOfficerOtpSuccess = exports.sendOnboardingOfficerOtp = exports.updateOnboardingCustomerViewUIState = exports.saveOnboardingCompnayOfficerPhoneInLocalStore = exports.saveOnboardingCustomerViewDataInLocalStore = exports.updateOnboardingCustomerViewLocalStoreData = exports.updateOnboardingCustomerViewAccountDetails = exports.updateCurrentStep = exports.getOnboardingPlaidLinkTokenFailure = exports.getOnboardingPlaidLinkTokenSuccess = exports.getOnboardingPlaidLinkToken = exports.establishOnboardingPlaidConnectionFailure = exports.establishOnboardingPlaidConnectionSuccess = exports.establishOnboardingPlaidConnection = exports.updateOnboardingPaymentAccountLoginStatusFailure = exports.updateOnboardingPaymentAccountLoginStatusSuccess = exports.updateOnboardingPaymentAccountLoginStatus = exports.updateOnboardingPaymentAccountStatusFailure = exports.updateOnboardingPaymentAccountStatusSuccess = exports.updateOnboardingPaymentAccountStatus = exports.updateOnboardingCustomerViewFailure = exports.updateOnboardingCustomerViewSuccess = exports.updateOnboardingCustomerView = exports.updateOnboardingCustomerViewDashboardLoadedFailure = exports.updateOnboardingCustomerViewDashboardLoadedSuccess = exports.updateOnboardingCustomerViewDashboardLoaded = exports.
|
|
5
|
-
exports.clearKycKybAutofillForOnboarding = exports.applyKybDocumentAutofillForOnboarding = exports.applyKycDocumentAutofillForOnboarding = exports.clearOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = void 0;
|
|
4
|
+
exports.clearOnboardingCustomerView = exports.clearOnboardingCustomerViewDataInLocalStore = exports.verifyOnboardingOfficerOtpFailure = exports.verifyOnboardingOfficerOtpSuccess = exports.verifyOnboardingOfficerOtp = exports.resendOnboardingOfficerOtp = exports.sendOnboardingOfficerOtpFailure = exports.sendOnboardingOfficerOtpSuccess = exports.sendOnboardingOfficerOtp = exports.updateOnboardingCustomerViewUIState = exports.saveOnboardingCompnayOfficerPhoneInLocalStore = exports.saveOnboardingCustomerViewDataInLocalStore = exports.updateOnboardingCustomerViewLocalStoreData = exports.updateOnboardingCustomerViewAccountDetails = exports.updateCurrentStep = exports.getOnboardingPlaidLinkTokenFailure = exports.getOnboardingPlaidLinkTokenSuccess = exports.getOnboardingPlaidLinkToken = exports.establishOnboardingPlaidConnectionFailure = exports.establishOnboardingPlaidConnectionSuccess = exports.establishOnboardingPlaidConnection = exports.updateOnboardingPaymentAccountLoginStatusFailure = exports.updateOnboardingPaymentAccountLoginStatusSuccess = exports.updateOnboardingPaymentAccountLoginStatus = exports.updateOnboardingPaymentAccountStatusFailure = exports.updateOnboardingPaymentAccountStatusSuccess = exports.updateOnboardingPaymentAccountStatus = exports.updateOnboardingCustomerViewFailure = exports.updateOnboardingCustomerViewSuccess = exports.updateOnboardingCustomerView = exports.updateOnboardingCustomerViewDashboardLoadedFailure = exports.updateOnboardingCustomerViewDashboardLoadedSuccess = exports.updateOnboardingCustomerViewDashboardLoaded = exports.updateOnboardingCustomerViewCompleteStatusFailure = exports.updateOnboardingCustomerViewCompleteStatusSuccess = exports.updateOnboardingCustomerViewCompleteStatus = exports.fetchOnboardingCustomerSetupViewFailure = exports.fetchOnboardingCustomerSetupViewSuccess = exports.fetchOnboardingCustomerSetupView = exports.fetchOnboardingCustomerView = exports.initialState = void 0;
|
|
6
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
7
6
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
8
|
-
const kycKybAutofillActions_1 = require("../../spendManagement/commonSetup/kycKybAutofillActions");
|
|
9
|
-
const onboardingCustomerViewState_1 = require("./onboardingCustomerViewState");
|
|
10
7
|
const initialStatus = {
|
|
11
8
|
fetchState: 'Not-Started',
|
|
12
9
|
error: undefined,
|
|
@@ -16,31 +13,61 @@ exports.initialState = {
|
|
|
16
13
|
saveStatus: initialStatus,
|
|
17
14
|
dashboardLoadedStatus: initialStatus,
|
|
18
15
|
currentStep: 'link_payment_account',
|
|
19
|
-
parsingDocumentFileIds: [],
|
|
20
16
|
companyDetails: {
|
|
21
|
-
autoFilledFields: [],
|
|
22
17
|
localData: undefined,
|
|
23
18
|
},
|
|
24
|
-
companyOfficerUpdateStatus:
|
|
25
|
-
|
|
26
|
-
autoFilledFields: [],
|
|
19
|
+
companyOfficerUpdateStatus: {
|
|
20
|
+
Officer_1: {
|
|
27
21
|
localData: undefined,
|
|
28
22
|
sendOtpStatus: initialStatus,
|
|
29
23
|
otpverificationStatus: initialStatus,
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
24
|
+
},
|
|
25
|
+
Officer_2: {
|
|
26
|
+
localData: undefined,
|
|
27
|
+
sendOtpStatus: initialStatus,
|
|
28
|
+
otpverificationStatus: initialStatus,
|
|
29
|
+
},
|
|
30
|
+
Officer_3: {
|
|
31
|
+
localData: undefined,
|
|
32
|
+
sendOtpStatus: initialStatus,
|
|
33
|
+
otpverificationStatus: initialStatus,
|
|
34
|
+
},
|
|
35
|
+
Officer_4: {
|
|
36
|
+
localData: undefined,
|
|
37
|
+
sendOtpStatus: initialStatus,
|
|
38
|
+
otpverificationStatus: initialStatus,
|
|
39
|
+
},
|
|
40
|
+
Officer_5: {
|
|
41
|
+
localData: undefined,
|
|
42
|
+
sendOtpStatus: initialStatus,
|
|
43
|
+
otpverificationStatus: initialStatus,
|
|
44
|
+
},
|
|
45
|
+
Officer_6: {
|
|
46
|
+
localData: undefined,
|
|
47
|
+
sendOtpStatus: initialStatus,
|
|
48
|
+
otpverificationStatus: initialStatus,
|
|
49
|
+
},
|
|
50
|
+
Officer_7: {
|
|
51
|
+
localData: undefined,
|
|
52
|
+
sendOtpStatus: initialStatus,
|
|
53
|
+
otpverificationStatus: initialStatus,
|
|
54
|
+
},
|
|
55
|
+
Officer_8: {
|
|
56
|
+
localData: undefined,
|
|
57
|
+
sendOtpStatus: initialStatus,
|
|
58
|
+
otpverificationStatus: initialStatus,
|
|
59
|
+
},
|
|
60
|
+
Officer_9: {
|
|
61
|
+
localData: undefined,
|
|
62
|
+
sendOtpStatus: initialStatus,
|
|
63
|
+
otpverificationStatus: initialStatus,
|
|
64
|
+
},
|
|
65
|
+
Officer_10: {
|
|
66
|
+
localData: undefined,
|
|
67
|
+
sendOtpStatus: initialStatus,
|
|
68
|
+
otpverificationStatus: initialStatus,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
44
71
|
primaryContactDetails: {},
|
|
45
72
|
paymentAccountDetails: {
|
|
46
73
|
fetchStatus: initialStatus,
|
|
@@ -68,7 +95,6 @@ exports.initialState = {
|
|
|
68
95
|
},
|
|
69
96
|
fetchState: 'Not-Started',
|
|
70
97
|
error: undefined,
|
|
71
|
-
aiAgentsActivation: { ...onboardingCustomerViewState_1.emptyAiAgentsActivationSubview },
|
|
72
98
|
uiState: {
|
|
73
99
|
isQBOPopupOpen: false,
|
|
74
100
|
isCardPaymentPopupOpen: false,
|
|
@@ -158,126 +184,6 @@ const onboardingCustomerView = (0, toolkit_1.createSlice)({
|
|
|
158
184
|
};
|
|
159
185
|
},
|
|
160
186
|
},
|
|
161
|
-
acknowledgeOnboardingAiFinanceTeam: {
|
|
162
|
-
reducer(draft) {
|
|
163
|
-
draft.aiFinanceTeamAcknowledgementStatus = {
|
|
164
|
-
fetchState: 'In-Progress',
|
|
165
|
-
error: undefined,
|
|
166
|
-
};
|
|
167
|
-
},
|
|
168
|
-
prepare(companyId) {
|
|
169
|
-
return {
|
|
170
|
-
payload: { companyId },
|
|
171
|
-
};
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
acknowledgeOnboardingAiFinanceTeamSuccess(draft) {
|
|
175
|
-
draft.aiFinanceTeamAcknowledgementStatus = {
|
|
176
|
-
fetchState: 'Completed',
|
|
177
|
-
error: undefined,
|
|
178
|
-
};
|
|
179
|
-
},
|
|
180
|
-
acknowledgeOnboardingAiFinanceTeamFailure: {
|
|
181
|
-
reducer(draft, action) {
|
|
182
|
-
draft.aiFinanceTeamAcknowledgementStatus = {
|
|
183
|
-
fetchState: 'Error',
|
|
184
|
-
error: action.payload,
|
|
185
|
-
};
|
|
186
|
-
},
|
|
187
|
-
prepare(error) {
|
|
188
|
-
return {
|
|
189
|
-
payload: error,
|
|
190
|
-
};
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
acknowledgeOnboardingAiActivationViewed: {
|
|
194
|
-
reducer(draft) {
|
|
195
|
-
draft.aiActivationViewedAcknowledgementStatus = {
|
|
196
|
-
fetchState: 'In-Progress',
|
|
197
|
-
error: undefined,
|
|
198
|
-
};
|
|
199
|
-
},
|
|
200
|
-
prepare(companyId) {
|
|
201
|
-
return {
|
|
202
|
-
payload: { companyId },
|
|
203
|
-
};
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
acknowledgeOnboardingAiActivationViewedSuccess(draft) {
|
|
207
|
-
draft.aiActivationViewedAcknowledgementStatus = {
|
|
208
|
-
fetchState: 'Completed',
|
|
209
|
-
error: undefined,
|
|
210
|
-
};
|
|
211
|
-
},
|
|
212
|
-
acknowledgeOnboardingAiActivationViewedFailure: {
|
|
213
|
-
reducer(draft, action) {
|
|
214
|
-
draft.aiActivationViewedAcknowledgementStatus = {
|
|
215
|
-
fetchState: 'Error',
|
|
216
|
-
error: action.payload,
|
|
217
|
-
};
|
|
218
|
-
},
|
|
219
|
-
prepare(error) {
|
|
220
|
-
return {
|
|
221
|
-
payload: error,
|
|
222
|
-
};
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
fetchAiAgentsActivationStatus(draft) {
|
|
226
|
-
draft.aiAgentsActivation.fetchStatus = {
|
|
227
|
-
fetchState: 'In-Progress',
|
|
228
|
-
error: undefined,
|
|
229
|
-
};
|
|
230
|
-
},
|
|
231
|
-
fetchAiAgentsActivationStatusSuccess: {
|
|
232
|
-
reducer(draft, action) {
|
|
233
|
-
draft.aiAgentsActivation.fetchStatus = {
|
|
234
|
-
fetchState: 'Completed',
|
|
235
|
-
error: undefined,
|
|
236
|
-
};
|
|
237
|
-
draft.aiAgentsActivation.phases = action.payload.phases;
|
|
238
|
-
draft.aiAgentsActivation.counts = action.payload.counts;
|
|
239
|
-
},
|
|
240
|
-
prepare(payload) {
|
|
241
|
-
return { payload };
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
fetchAiAgentsActivationStatusFailure: {
|
|
245
|
-
reducer(draft, action) {
|
|
246
|
-
draft.aiAgentsActivation.fetchStatus = {
|
|
247
|
-
fetchState: 'Error',
|
|
248
|
-
error: action.payload,
|
|
249
|
-
};
|
|
250
|
-
},
|
|
251
|
-
prepare(error) {
|
|
252
|
-
return { payload: error };
|
|
253
|
-
},
|
|
254
|
-
},
|
|
255
|
-
aiAgentsActivationCountsUpdated: {
|
|
256
|
-
reducer(draft, action) {
|
|
257
|
-
draft.aiAgentsActivation.counts = {
|
|
258
|
-
...draft.aiAgentsActivation.counts,
|
|
259
|
-
...action.payload,
|
|
260
|
-
};
|
|
261
|
-
},
|
|
262
|
-
prepare(payload) {
|
|
263
|
-
return { payload };
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
aiAgentsActivationPhaseChanged: {
|
|
267
|
-
reducer(draft, action) {
|
|
268
|
-
const target = draft.aiAgentsActivation.phases;
|
|
269
|
-
const index = target.findIndex((phase) => phase.key === action.payload.key);
|
|
270
|
-
if (index === -1) {
|
|
271
|
-
target.push(action.payload);
|
|
272
|
-
}
|
|
273
|
-
else {
|
|
274
|
-
target[index] = { ...target[index], ...action.payload };
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
prepare(payload) {
|
|
278
|
-
return { payload };
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
187
|
updateOnboardingCustomerViewDashboardLoaded: {
|
|
282
188
|
reducer(draft) {
|
|
283
189
|
draft.dashboardLoadedStatus = {
|
|
@@ -690,81 +596,7 @@ const onboardingCustomerView = (0, toolkit_1.createSlice)({
|
|
|
690
596
|
clearOnboardingCustomerView(draft) {
|
|
691
597
|
Object.assign(draft, exports.initialState);
|
|
692
598
|
},
|
|
693
|
-
/** Merge AI-parsed officer fields into the officer's onboarding localData. */
|
|
694
|
-
applyKycDocumentAutofillForOnboarding: {
|
|
695
|
-
reducer(draft, action) {
|
|
696
|
-
const { officerType, values, autoFilledFieldNames, fileId } = action.payload;
|
|
697
|
-
const slot = draft.companyOfficerUpdateStatus[officerType];
|
|
698
|
-
slot.localData = Object.assign({}, slot.localData, values);
|
|
699
|
-
slot.autoFilledFields = Array.from(new Set([...slot.autoFilledFields, ...autoFilledFieldNames]));
|
|
700
|
-
draft.parsingDocumentFileIds = draft.parsingDocumentFileIds.filter((id) => id !== fileId);
|
|
701
|
-
},
|
|
702
|
-
prepare(payload) {
|
|
703
|
-
return { payload };
|
|
704
|
-
},
|
|
705
|
-
},
|
|
706
|
-
/** Merge AI-parsed company fields into companyDetails onboarding localData. */
|
|
707
|
-
applyKybDocumentAutofillForOnboarding: {
|
|
708
|
-
reducer(draft, action) {
|
|
709
|
-
const { values, autoFilledFieldNames, fileId } = action.payload;
|
|
710
|
-
draft.companyDetails.localData = Object.assign({}, draft.companyDetails.localData, values);
|
|
711
|
-
const prev = draft.companyDetails.autoFilledFields ?? [];
|
|
712
|
-
draft.companyDetails.autoFilledFields = Array.from(new Set([...prev, ...autoFilledFieldNames]));
|
|
713
|
-
draft.parsingDocumentFileIds = draft.parsingDocumentFileIds.filter((id) => id !== fileId);
|
|
714
|
-
},
|
|
715
|
-
prepare(payload) {
|
|
716
|
-
return { payload };
|
|
717
|
-
},
|
|
718
|
-
},
|
|
719
|
-
/** Wipe AI-autofill badges during onboarding. */
|
|
720
|
-
clearKycKybAutofillForOnboarding: {
|
|
721
|
-
reducer(draft, action) {
|
|
722
|
-
const { officerType } = action.payload;
|
|
723
|
-
if (officerType != null) {
|
|
724
|
-
draft.companyOfficerUpdateStatus[officerType].autoFilledFields = [];
|
|
725
|
-
}
|
|
726
|
-
else {
|
|
727
|
-
draft.companyDetails.autoFilledFields = [];
|
|
728
|
-
Object.keys(draft.companyOfficerUpdateStatus).forEach((key) => {
|
|
729
|
-
draft.companyOfficerUpdateStatus[key].autoFilledFields = [];
|
|
730
|
-
});
|
|
731
|
-
}
|
|
732
|
-
},
|
|
733
|
-
prepare(payload = {}) {
|
|
734
|
-
return { payload };
|
|
735
|
-
},
|
|
736
|
-
},
|
|
737
|
-
},
|
|
738
|
-
extraReducers: (builder) => {
|
|
739
|
-
const addParsingFileId = (draft, fileId) => {
|
|
740
|
-
if (!draft.parsingDocumentFileIds.includes(fileId)) {
|
|
741
|
-
draft.parsingDocumentFileIds.push(fileId);
|
|
742
|
-
}
|
|
743
|
-
};
|
|
744
|
-
const removeParsingFileId = (draft, fileId) => {
|
|
745
|
-
draft.parsingDocumentFileIds = draft.parsingDocumentFileIds.filter((id) => id !== fileId);
|
|
746
|
-
};
|
|
747
|
-
builder.addCase(kycKybAutofillActions_1.parseUploadedKycDocument, (draft, action) => {
|
|
748
|
-
if (action.payload.target === 'onboarding') {
|
|
749
|
-
addParsingFileId(draft, action.payload.fileId);
|
|
750
|
-
}
|
|
751
|
-
});
|
|
752
|
-
builder.addCase(kycKybAutofillActions_1.parseUploadedKybDocument, (draft, action) => {
|
|
753
|
-
if (action.payload.target === 'onboarding') {
|
|
754
|
-
addParsingFileId(draft, action.payload.fileId);
|
|
755
|
-
}
|
|
756
|
-
});
|
|
757
|
-
builder.addCase(kycKybAutofillActions_1.parseUploadedKycDocumentFailure, (draft, action) => {
|
|
758
|
-
if (action.payload.target === 'onboarding') {
|
|
759
|
-
removeParsingFileId(draft, action.payload.fileId);
|
|
760
|
-
}
|
|
761
|
-
});
|
|
762
|
-
builder.addCase(kycKybAutofillActions_1.parseUploadedKybDocumentFailure, (draft, action) => {
|
|
763
|
-
if (action.payload.target === 'onboarding') {
|
|
764
|
-
removeParsingFileId(draft, action.payload.fileId);
|
|
765
|
-
}
|
|
766
|
-
});
|
|
767
599
|
},
|
|
768
600
|
});
|
|
769
|
-
_a = onboardingCustomerView.actions, exports.fetchOnboardingCustomerView = _a.fetchOnboardingCustomerView, exports.fetchOnboardingCustomerSetupView = _a.fetchOnboardingCustomerSetupView, exports.fetchOnboardingCustomerSetupViewSuccess = _a.fetchOnboardingCustomerSetupViewSuccess, exports.fetchOnboardingCustomerSetupViewFailure = _a.fetchOnboardingCustomerSetupViewFailure, exports.updateOnboardingCustomerViewCompleteStatus = _a.updateOnboardingCustomerViewCompleteStatus, exports.updateOnboardingCustomerViewCompleteStatusSuccess = _a.updateOnboardingCustomerViewCompleteStatusSuccess, exports.updateOnboardingCustomerViewCompleteStatusFailure = _a.updateOnboardingCustomerViewCompleteStatusFailure, exports.
|
|
601
|
+
_a = onboardingCustomerView.actions, exports.fetchOnboardingCustomerView = _a.fetchOnboardingCustomerView, exports.fetchOnboardingCustomerSetupView = _a.fetchOnboardingCustomerSetupView, exports.fetchOnboardingCustomerSetupViewSuccess = _a.fetchOnboardingCustomerSetupViewSuccess, exports.fetchOnboardingCustomerSetupViewFailure = _a.fetchOnboardingCustomerSetupViewFailure, exports.updateOnboardingCustomerViewCompleteStatus = _a.updateOnboardingCustomerViewCompleteStatus, exports.updateOnboardingCustomerViewCompleteStatusSuccess = _a.updateOnboardingCustomerViewCompleteStatusSuccess, exports.updateOnboardingCustomerViewCompleteStatusFailure = _a.updateOnboardingCustomerViewCompleteStatusFailure, exports.updateOnboardingCustomerViewDashboardLoaded = _a.updateOnboardingCustomerViewDashboardLoaded, exports.updateOnboardingCustomerViewDashboardLoadedSuccess = _a.updateOnboardingCustomerViewDashboardLoadedSuccess, exports.updateOnboardingCustomerViewDashboardLoadedFailure = _a.updateOnboardingCustomerViewDashboardLoadedFailure, exports.updateOnboardingCustomerView = _a.updateOnboardingCustomerView, exports.updateOnboardingCustomerViewSuccess = _a.updateOnboardingCustomerViewSuccess, exports.updateOnboardingCustomerViewFailure = _a.updateOnboardingCustomerViewFailure, exports.updateOnboardingPaymentAccountStatus = _a.updateOnboardingPaymentAccountStatus, exports.updateOnboardingPaymentAccountStatusSuccess = _a.updateOnboardingPaymentAccountStatusSuccess, exports.updateOnboardingPaymentAccountStatusFailure = _a.updateOnboardingPaymentAccountStatusFailure, exports.updateOnboardingPaymentAccountLoginStatus = _a.updateOnboardingPaymentAccountLoginStatus, exports.updateOnboardingPaymentAccountLoginStatusSuccess = _a.updateOnboardingPaymentAccountLoginStatusSuccess, exports.updateOnboardingPaymentAccountLoginStatusFailure = _a.updateOnboardingPaymentAccountLoginStatusFailure, exports.establishOnboardingPlaidConnection = _a.establishOnboardingPlaidConnection, exports.establishOnboardingPlaidConnectionSuccess = _a.establishOnboardingPlaidConnectionSuccess, exports.establishOnboardingPlaidConnectionFailure = _a.establishOnboardingPlaidConnectionFailure, exports.getOnboardingPlaidLinkToken = _a.getOnboardingPlaidLinkToken, exports.getOnboardingPlaidLinkTokenSuccess = _a.getOnboardingPlaidLinkTokenSuccess, exports.getOnboardingPlaidLinkTokenFailure = _a.getOnboardingPlaidLinkTokenFailure, exports.updateCurrentStep = _a.updateCurrentStep, exports.updateOnboardingCustomerViewAccountDetails = _a.updateOnboardingCustomerViewAccountDetails, exports.updateOnboardingCustomerViewLocalStoreData = _a.updateOnboardingCustomerViewLocalStoreData, exports.saveOnboardingCustomerViewDataInLocalStore = _a.saveOnboardingCustomerViewDataInLocalStore, exports.saveOnboardingCompnayOfficerPhoneInLocalStore = _a.saveOnboardingCompnayOfficerPhoneInLocalStore, exports.updateOnboardingCustomerViewUIState = _a.updateOnboardingCustomerViewUIState, exports.sendOnboardingOfficerOtp = _a.sendOnboardingOfficerOtp, exports.sendOnboardingOfficerOtpSuccess = _a.sendOnboardingOfficerOtpSuccess, exports.sendOnboardingOfficerOtpFailure = _a.sendOnboardingOfficerOtpFailure, exports.resendOnboardingOfficerOtp = _a.resendOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtp = _a.verifyOnboardingOfficerOtp, exports.verifyOnboardingOfficerOtpSuccess = _a.verifyOnboardingOfficerOtpSuccess, exports.verifyOnboardingOfficerOtpFailure = _a.verifyOnboardingOfficerOtpFailure, exports.clearOnboardingCustomerViewDataInLocalStore = _a.clearOnboardingCustomerViewDataInLocalStore, exports.clearOnboardingCustomerView = _a.clearOnboardingCustomerView;
|
|
770
602
|
exports.default = onboardingCustomerView.reducer;
|
|
@@ -15,7 +15,7 @@ import { CompanyView } from '../../companyView/types/companyView';
|
|
|
15
15
|
import { CompanyDetails, CompanyOfficersDetails } from '../../spendManagement/commonSetup/setupViewSelector';
|
|
16
16
|
import { CompanyOfficerLocalData } from '../../spendManagement/commonSetup/setupViewState';
|
|
17
17
|
import { PlaidConnectionDetails } from '../../spendManagement/plaidAccount/plaidAccountViewState';
|
|
18
|
-
import {
|
|
18
|
+
import { OnboardingCustomerViewUIState, OnboardingStep } from './onboardingCustomerViewState';
|
|
19
19
|
export interface OnboardingCustomerView {
|
|
20
20
|
allNationalityCountries: Country[];
|
|
21
21
|
allRequiredStepsCompleted: boolean;
|
|
@@ -28,7 +28,6 @@ export interface OnboardingCustomerView {
|
|
|
28
28
|
fetchStatus: FetchStateAndError;
|
|
29
29
|
halfCompletedSteps: OnboardingStep[];
|
|
30
30
|
isInterimEmailSent: boolean;
|
|
31
|
-
parsingDocumentFileIds: ID[];
|
|
32
31
|
paymentAccountFetchStatus: FetchStateAndError;
|
|
33
32
|
paymentAccountUpdateStatus: FetchStateAndError;
|
|
34
33
|
pendingSaveDetails: {
|
|
@@ -56,6 +55,3 @@ export declare const onboardingStepsData: (isValidConnection: boolean, productSe
|
|
|
56
55
|
};
|
|
57
56
|
export declare function isCompanyDetailsSavePending(fileState: FileState, company?: CompanyView, primaryContact?: User, companyDetailsLocalData?: CompanyDetails): boolean;
|
|
58
57
|
export declare const getProductSettingsString: (productSettings: TenantProductSettings | undefined) => string;
|
|
59
|
-
export declare const getAiAgentsActivationSubview: (state: RootState) => AiAgentsActivationSubview;
|
|
60
|
-
export declare const getAiAgentsActivationPhases: (state: RootState) => AiAgentsActivationPhase[];
|
|
61
|
-
export declare const getAiAgentsActivationCounts: (state: RootState) => AiAgentsActivationCounts;
|