@zeniai/client-epic-state 4.19.77-betaAS2 → 4.19.77-betaML1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/entity/company/companyPayload.d.ts +0 -1
- package/lib/entity/company/companyPayload.js +0 -1
- package/lib/entity/company/companyStateTypes.d.ts +0 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/epic.d.ts +2 -1
- package/lib/epic.js +2 -1
- package/lib/esm/entity/company/companyPayload.js +0 -1
- package/lib/esm/entity/snackbar/snackbarTypes.js +1 -0
- package/lib/esm/epic.js +2 -1
- package/lib/esm/index.js +4 -6
- package/lib/esm/view/accountList/accountListReducer.js +3 -1
- package/lib/esm/view/accountList/accountListSelector.js +8 -0
- package/lib/esm/view/accountList/fetchAccountListEpic.js +20 -10
- package/lib/esm/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +0 -3
- package/lib/esm/view/companyView/types/companyPassport/companyPassportLocalData.js +0 -1
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/convertTransactionTypeEpic.js +78 -0
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +5 -0
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +30 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +3 -0
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +1 -4
- package/lib/esm/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +1 -2
- package/lib/esm/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
- package/lib/esm/view/spendManagement/commonSetup/types/businessVerification.js +1 -141
- package/lib/esm/view/transactionDetail/epics/transactionDetailEpic.js +5 -0
- package/lib/esm/view/transactionDetail/transactionDetailSelector.js +2 -0
- package/lib/index.d.ts +4 -7
- package/lib/index.js +35 -37
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- package/lib/view/accountList/accountListReducer.d.ts +2 -1
- package/lib/view/accountList/accountListReducer.js +3 -1
- package/lib/view/accountList/accountListSelector.d.ts +6 -1
- package/lib/view/accountList/accountListSelector.js +10 -1
- package/lib/view/accountList/accountListState.d.ts +1 -1
- package/lib/view/accountList/fetchAccountListEpic.js +20 -10
- package/lib/view/companyView/epic/companyPassport/updateCompanyDetailsEpic.js +0 -3
- package/lib/view/companyView/types/companyPassport/companyDetailsLocalData.d.ts +0 -1
- package/lib/view/companyView/types/companyPassport/companyPassportLocalData.js +0 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/convertTransactionTypeEpic.d.ts +38 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/convertTransactionTypeEpic.js +82 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +5 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +17 -1
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +31 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +10 -1
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +3 -0
- package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js +1 -4
- package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js +1 -2
- package/lib/view/spendManagement/commonSetup/setupViewSelector.d.ts +0 -1
- package/lib/view/spendManagement/commonSetup/setupViewSelector.js +1 -2
- package/lib/view/spendManagement/commonSetup/setupViewState.d.ts +0 -1
- package/lib/view/spendManagement/commonSetup/types/businessVerification.d.ts +3 -30
- package/lib/view/spendManagement/commonSetup/types/businessVerification.js +0 -143
- package/lib/view/transactionDetail/epics/transactionDetailEpic.js +5 -0
- package/lib/view/transactionDetail/transactionDetailSelector.d.ts +4 -1
- package/lib/view/transactionDetail/transactionDetailSelector.js +2 -0
- package/package.json +1 -1
|
@@ -3,7 +3,8 @@ import { AccountListResponse } from './accountListPayload';
|
|
|
3
3
|
import { AccountList, AccountListKeyType, AccountListState } from './accountListState';
|
|
4
4
|
export declare const initialAccountList: AccountList;
|
|
5
5
|
export declare const initialState: AccountListState;
|
|
6
|
-
export declare const fetchAccountList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountListKey: AccountListKeyType, fetchFullResponse?: any, excludeAccountPayableAccounts?: any, excludeAccountReceivableAccounts?: any, isLimitedCategoryEnabled?: any, filterAccountTypes?: ("cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets")[] | undefined, isIncludeDeleted?: boolean | undefined], {
|
|
6
|
+
export declare const fetchAccountList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[accountListKey: AccountListKeyType, fetchFullResponse?: any, excludeAccountPayableAccounts?: any, excludeAccountReceivableAccounts?: any, isLimitedCategoryEnabled?: any, filterAccountTypes?: ("cash_position" | "fixed_assets" | "bank" | "credit_card" | "expenses" | "cogs" | "income" | "cash_in" | "cash_out" | "other_income" | "other_expense" | "accounts_receivable" | "other_current_assets" | "other_assets" | "accounts_payable" | "other_current_liabilities" | "long_term_liabilities" | "equity" | "current_liabilities" | "current_assets")[] | undefined, isIncludeDeleted?: boolean | undefined, query?: Record<string, unknown> | undefined], {
|
|
7
|
+
query?: Record<string, unknown> | undefined;
|
|
7
8
|
isIncludeDeleted?: true | undefined;
|
|
8
9
|
accountListKey: AccountListKeyType;
|
|
9
10
|
fetchFullResponse: any;
|
|
@@ -34,6 +34,7 @@ exports.initialState = {
|
|
|
34
34
|
reimbursementAccountList: exports.initialAccountList,
|
|
35
35
|
schedulesAccountList: exports.initialAccountList,
|
|
36
36
|
billPayAccountList: exports.initialAccountList,
|
|
37
|
+
bankAndCreditCardAccounts: exports.initialAccountList,
|
|
37
38
|
},
|
|
38
39
|
};
|
|
39
40
|
const accountList = (0, toolkit_1.createSlice)({
|
|
@@ -49,7 +50,7 @@ const accountList = (0, toolkit_1.createSlice)({
|
|
|
49
50
|
error: undefined,
|
|
50
51
|
};
|
|
51
52
|
},
|
|
52
|
-
prepare(accountListKey, fetchFullResponse = false, excludeAccountPayableAccounts = false, excludeAccountReceivableAccounts = false, isLimitedCategoryEnabled = false, filterAccountTypes, isIncludeDeleted) {
|
|
53
|
+
prepare(accountListKey, fetchFullResponse = false, excludeAccountPayableAccounts = false, excludeAccountReceivableAccounts = false, isLimitedCategoryEnabled = false, filterAccountTypes, isIncludeDeleted, query) {
|
|
53
54
|
return {
|
|
54
55
|
payload: {
|
|
55
56
|
accountListKey,
|
|
@@ -59,6 +60,7 @@ const accountList = (0, toolkit_1.createSlice)({
|
|
|
59
60
|
isLimitedCategoryEnabled,
|
|
60
61
|
filterAccountTypes: filterAccountTypes ?? [],
|
|
61
62
|
...(isIncludeDeleted === true && { isIncludeDeleted }),
|
|
63
|
+
...(query != null && { query }),
|
|
62
64
|
},
|
|
63
65
|
};
|
|
64
66
|
},
|
|
@@ -2,7 +2,7 @@ import { NestedAccountHierarchyForReport } from '../../commonStateTypes/accountV
|
|
|
2
2
|
import { FetchState, ID } from '../../commonStateTypes/common';
|
|
3
3
|
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { AccountBase, AccountLabel, AccountState } from '../../entity/account/accountState';
|
|
5
|
-
import { AccountListKeyType, AccountListState } from './accountListState';
|
|
5
|
+
import { AccountList, AccountListKeyType, AccountListState } from './accountListState';
|
|
6
6
|
export interface AccountListSelectorView extends SelectorView {
|
|
7
7
|
accounts: AccountBase[];
|
|
8
8
|
}
|
|
@@ -28,3 +28,8 @@ export declare const getFilteredNestedAndAccountListsForLabel: (accountState: Ac
|
|
|
28
28
|
nestedAccountList: NestedAccountHierarchyForReport[];
|
|
29
29
|
};
|
|
30
30
|
export declare const getAccountIdsForLabel: (accountListState: AccountListState, accountListKey: AccountListKeyType, accountLabel: AccountLabel) => ID[];
|
|
31
|
+
/**
|
|
32
|
+
* Selector for bank and credit card accounts (e.g. used in the convert transaction type drawer).
|
|
33
|
+
* Fetched once when transaction categorization or transaction detail is loaded; result is cached.
|
|
34
|
+
*/
|
|
35
|
+
export declare const getBankAndCreditCardAccountList: (accountListState: AccountListState) => AccountList;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAccountIdsForLabel = exports.getFilteredNestedAndAccountListsForLabel = exports.getNestedAccountListHierarchy = exports.getUncategorizedAccounts = exports.getAccountListFetchState = exports.getAccountList = void 0;
|
|
3
|
+
exports.getBankAndCreditCardAccountList = exports.getAccountIdsForLabel = exports.getFilteredNestedAndAccountListsForLabel = exports.getNestedAccountListHierarchy = exports.getUncategorizedAccounts = exports.getAccountListFetchState = exports.getAccountList = void 0;
|
|
4
4
|
const accountSelector_1 = require("../../entity/account/accountSelector");
|
|
5
|
+
const BANK_AND_CREDIT_CARD_ACCOUNTS_KEY = 'bankAndCreditCardAccounts';
|
|
5
6
|
const getAccountList = (accountState, accountListState, accountListKey) => {
|
|
6
7
|
const accListState = accountListState.byReportId[accountListKey];
|
|
7
8
|
return {
|
|
@@ -81,3 +82,11 @@ const getAccountIdsForLabel = (accountListState, accountListKey, accountLabel) =
|
|
|
81
82
|
return [];
|
|
82
83
|
};
|
|
83
84
|
exports.getAccountIdsForLabel = getAccountIdsForLabel;
|
|
85
|
+
/**
|
|
86
|
+
* Selector for bank and credit card accounts (e.g. used in the convert transaction type drawer).
|
|
87
|
+
* Fetched once when transaction categorization or transaction detail is loaded; result is cached.
|
|
88
|
+
*/
|
|
89
|
+
const getBankAndCreditCardAccountList = (accountListState) => {
|
|
90
|
+
return accountListState.byReportId[BANK_AND_CREDIT_CARD_ACCOUNTS_KEY];
|
|
91
|
+
};
|
|
92
|
+
exports.getBankAndCreditCardAccountList = getBankAndCreditCardAccountList;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NestedAccountHierarchyForReport } from '../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { FetchedState, ID } from '../../commonStateTypes/common';
|
|
3
3
|
import { AccountLabel } from '../../entity/account/accountState';
|
|
4
|
-
export type AccountListKeyType = 'accountList' | 'reimbursementAccountList' | 'schedulesAccountList' | 'billPayAccountList';
|
|
4
|
+
export type AccountListKeyType = 'accountList' | 'reimbursementAccountList' | 'schedulesAccountList' | 'billPayAccountList' | 'bankAndCreditCardAccounts';
|
|
5
5
|
export interface AccountList extends FetchedState {
|
|
6
6
|
accountIds: ID[];
|
|
7
7
|
accountIdsByLabel: Record<AccountLabel, ID[]>;
|
|
@@ -16,26 +16,36 @@ const getAccountTypes = (isLimitedCategoryEnabled, filterAccountTypes) => {
|
|
|
16
16
|
return [];
|
|
17
17
|
};
|
|
18
18
|
const fetchAccountListEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(accountListReducer_1.fetchAccountList.match), (0, operators_1.mergeMap)((action) => {
|
|
19
|
-
const { accountListKey, fetchFullResponse, excludeAccountPayableAccounts, excludeAccountReceivableAccounts, isLimitedCategoryEnabled, filterAccountTypes, isIncludeDeleted, } = action.payload;
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
const { accountListKey, fetchFullResponse, excludeAccountPayableAccounts, excludeAccountReceivableAccounts, isLimitedCategoryEnabled, filterAccountTypes, isIncludeDeleted, query, } = action.payload;
|
|
20
|
+
const queryValue = (() => {
|
|
21
|
+
if (accountListKey === 'bankAndCreditCardAccounts') {
|
|
22
|
+
return { bank_accounts: true, credit_card_accounts: true };
|
|
23
|
+
}
|
|
24
|
+
if (query != null) {
|
|
25
|
+
return query;
|
|
26
|
+
}
|
|
27
|
+
const accountTypes = getAccountTypes(isLimitedCategoryEnabled, filterAccountTypes);
|
|
28
|
+
return {
|
|
29
|
+
is_bookkeeping_admin: fetchFullResponse,
|
|
30
|
+
is_exclude_account_payable_accounts: excludeAccountPayableAccounts,
|
|
31
|
+
is_exclude_account_receivable_accounts: excludeAccountReceivableAccounts,
|
|
32
|
+
account_types: accountTypes,
|
|
33
|
+
...(isIncludeDeleted === true && { is_include_deleted: true }),
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
28
36
|
return zeniAPI
|
|
29
37
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/accounts?query=${encodeURIComponent(JSON.stringify(queryValue))}`)
|
|
30
38
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
31
39
|
if ((0, responsePayload_1.isSuccessResponse)(response)) {
|
|
32
40
|
const actions = [
|
|
33
|
-
(0, accountReducer_1.updateAccounts)(response.data?.accounts ?? [], 'account_list'),
|
|
34
41
|
(0, accountListReducer_1.updateAccountList)({
|
|
35
42
|
accountListKey,
|
|
36
43
|
accountListResponse: response,
|
|
37
44
|
}),
|
|
38
45
|
];
|
|
46
|
+
if (accountListKey !== 'bankAndCreditCardAccounts') {
|
|
47
|
+
actions.unshift((0, accountReducer_1.updateAccounts)(response.data?.accounts ?? [], 'account_list'));
|
|
48
|
+
}
|
|
39
49
|
return (0, rxjs_1.from)(actions);
|
|
40
50
|
}
|
|
41
51
|
else {
|
|
@@ -15,9 +15,6 @@ const updateCompanyDetailsEpic = (actions$, state$, zeniAPI) => actions$.pipe((0
|
|
|
15
15
|
...(0, companyPassportViewPayload_1.toCompanyIncInfoUpdatableInfoPayload)(companyDetails.incInfo),
|
|
16
16
|
...(0, companyPassportViewPayload_1.toCompanyTaxInfoUpdatableInfoPayload)(companyDetails.taxDetails),
|
|
17
17
|
...(0, companyPassportViewPayload_1.toCompanyFileInfoPayload)(companyDetails.incInfo, companyDetails.taxDetails),
|
|
18
|
-
...(companyDetails.companyInfo.companyIndustryType != null && {
|
|
19
|
-
company_industry_type: companyDetails.companyInfo.companyIndustryType,
|
|
20
|
-
}),
|
|
21
18
|
...(companyDetails.companyInfo.companySubIndustry != null && {
|
|
22
19
|
company_industry_sub_type: companyDetails.companyInfo.companySubIndustry,
|
|
23
20
|
}),
|
|
@@ -13,7 +13,6 @@ function toCompanyPassportLocalData(companyView, companyFiles) {
|
|
|
13
13
|
website: companyInfo.companyUrl,
|
|
14
14
|
meetingLink: companyInfo.meetingUrl,
|
|
15
15
|
industry: companyQuestionaire.companyIndustry,
|
|
16
|
-
companyIndustryType: incInfo.companyIndustryType,
|
|
17
16
|
companySubIndustry: incInfo.companySubIndustry,
|
|
18
17
|
businessModel: companyQuestionaire.companyBusinessModel ?? '',
|
|
19
18
|
phone: companyInfo.phone ?? '',
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { ID } from '../../../../commonStateTypes/common';
|
|
3
|
+
import { openSnackbar } from '../../../../entity/snackbar/snackbarReducer';
|
|
4
|
+
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
|
+
import { convertTransactionType, convertTransactionTypeFailure, convertTransactionTypeSuccess, removeTransactionsFromCategorizationList } from '../../reducers/transactionsViewReducer';
|
|
7
|
+
export type ActionType = ReturnType<typeof convertTransactionType> | ReturnType<typeof convertTransactionTypeSuccess> | ReturnType<typeof convertTransactionTypeFailure> | ReturnType<typeof removeTransactionsFromCategorizationList> | ReturnType<typeof openSnackbar>;
|
|
8
|
+
export declare const convertTransactionTypeEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => import("rxjs").Observable<{
|
|
9
|
+
payload: {
|
|
10
|
+
messageSection: import("../../../..").SnackbarMessageSections;
|
|
11
|
+
messageText: import("../../../..").SnackbarMessageSectionTexts;
|
|
12
|
+
type: import("../../../..").SnackbarMessageType;
|
|
13
|
+
showStatusIcon?: boolean;
|
|
14
|
+
variables?: {
|
|
15
|
+
variableName: string;
|
|
16
|
+
variableValue: string;
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
type: "snackbar/openSnackbar";
|
|
20
|
+
} | {
|
|
21
|
+
payload: {
|
|
22
|
+
transactionId: ID;
|
|
23
|
+
};
|
|
24
|
+
type: "expenseAutomationTransactionsView/convertTransactionTypeSuccess";
|
|
25
|
+
} | {
|
|
26
|
+
payload: {
|
|
27
|
+
error: import("../../../../responsePayload").ZeniAPIStatus;
|
|
28
|
+
transactionId: ID;
|
|
29
|
+
};
|
|
30
|
+
type: "expenseAutomationTransactionsView/convertTransactionTypeFailure";
|
|
31
|
+
} | {
|
|
32
|
+
payload: {
|
|
33
|
+
selectedPeriod: import("../../../..").MonthYearPeriod;
|
|
34
|
+
selectedTab: import("../../types/transactionsViewState").TransactionsTab;
|
|
35
|
+
transactionIds: ID[];
|
|
36
|
+
};
|
|
37
|
+
type: "expenseAutomationTransactionsView/removeTransactionsFromCategorizationList";
|
|
38
|
+
}>;
|
package/lib/view/expenseAutomationView/epics/transactionCategorization/convertTransactionTypeEpic.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertTransactionTypeEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const snackbarReducer_1 = require("../../../../entity/snackbar/snackbarReducer");
|
|
7
|
+
const responsePayload_1 = require("../../../../responsePayload");
|
|
8
|
+
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
9
|
+
function toConvertTransactionTypePayload(payload) {
|
|
10
|
+
return {
|
|
11
|
+
from_account_integration_id: payload.fromAccountIntegrationId,
|
|
12
|
+
to_account_integration_id: payload.toAccountIntegrationId,
|
|
13
|
+
transaction_id: payload.transactionId,
|
|
14
|
+
transaction_type: payload.transactionType,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const convertTransactionTypeEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.convertTransactionType.match), (0, operators_1.mergeMap)((action) => {
|
|
18
|
+
const { transactionId, transactionType, toAccountIntegrationId, fromAccountIntegrationId, selectedTab, selectedPeriod, } = action.payload;
|
|
19
|
+
const apiPayload = toConvertTransactionTypePayload({
|
|
20
|
+
transactionId,
|
|
21
|
+
transactionType,
|
|
22
|
+
toAccountIntegrationId,
|
|
23
|
+
fromAccountIntegrationId,
|
|
24
|
+
});
|
|
25
|
+
return zeniAPI
|
|
26
|
+
.putAndGetJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/transactions/transaction-type`, apiPayload)
|
|
27
|
+
.pipe((0, operators_1.mergeMap)((response) => {
|
|
28
|
+
if ((0, responsePayload_1.isSuccessStatus)(response)) {
|
|
29
|
+
return (0, rxjs_1.from)([
|
|
30
|
+
(0, transactionsViewReducer_1.removeTransactionsFromCategorizationList)({
|
|
31
|
+
selectedTab,
|
|
32
|
+
selectedPeriod,
|
|
33
|
+
transactionIds: [transactionId],
|
|
34
|
+
}),
|
|
35
|
+
(0, transactionsViewReducer_1.convertTransactionTypeSuccess)({ transactionId }),
|
|
36
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
37
|
+
messageSection: 'convert_transaction_type',
|
|
38
|
+
messageText: 'success',
|
|
39
|
+
type: 'success',
|
|
40
|
+
}),
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
const errorStatus = response.status ?? {
|
|
44
|
+
code: 0,
|
|
45
|
+
message: 'Unknown error',
|
|
46
|
+
};
|
|
47
|
+
return (0, rxjs_1.from)([
|
|
48
|
+
(0, transactionsViewReducer_1.convertTransactionTypeFailure)({
|
|
49
|
+
transactionId,
|
|
50
|
+
error: errorStatus,
|
|
51
|
+
}),
|
|
52
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
53
|
+
messageSection: 'convert_transaction_type',
|
|
54
|
+
messageText: 'failed',
|
|
55
|
+
type: 'error',
|
|
56
|
+
variables: [
|
|
57
|
+
{
|
|
58
|
+
variableName: 'errorMessage',
|
|
59
|
+
variableValue: errorStatus.message ?? errorStatus.title ?? 'Request failed',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
}),
|
|
63
|
+
]);
|
|
64
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
65
|
+
(0, transactionsViewReducer_1.convertTransactionTypeFailure)({
|
|
66
|
+
transactionId,
|
|
67
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', `Convert transaction type failed: ${JSON.stringify(error)}`),
|
|
68
|
+
}),
|
|
69
|
+
(0, snackbarReducer_1.openSnackbar)({
|
|
70
|
+
messageSection: 'convert_transaction_type',
|
|
71
|
+
messageText: 'failed',
|
|
72
|
+
type: 'error',
|
|
73
|
+
variables: [
|
|
74
|
+
{
|
|
75
|
+
variableName: 'errorMessage',
|
|
76
|
+
variableValue: error instanceof Error ? error.message : String(error),
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
}),
|
|
80
|
+
])));
|
|
81
|
+
}));
|
|
82
|
+
exports.convertTransactionTypeEpic = convertTransactionTypeEpic;
|
|
@@ -24,6 +24,11 @@ const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pi
|
|
|
24
24
|
accountList.fetchState === 'Not-Started') {
|
|
25
25
|
updateActions.push((0, accountListReducer_1.fetchAccountList)('accountList', true));
|
|
26
26
|
}
|
|
27
|
+
const bankAndCreditCardAccounts = state$.value.accountListState.byReportId.bankAndCreditCardAccounts;
|
|
28
|
+
if (bankAndCreditCardAccounts.hasValidState() === false &&
|
|
29
|
+
bankAndCreditCardAccounts.fetchState === 'Not-Started') {
|
|
30
|
+
updateActions.push((0, accountListReducer_1.fetchAccountList)('bankAndCreditCardAccounts'));
|
|
31
|
+
}
|
|
27
32
|
const classList = state$.value.classListState;
|
|
28
33
|
if (classList.hasValidState() === false &&
|
|
29
34
|
classList.fetchState === 'Not-Started') {
|
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
|
|
|
37
37
|
export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
|
|
38
38
|
export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
|
|
39
39
|
export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
|
|
40
|
-
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipts_upload" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed";
|
|
40
|
+
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipts_upload" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "convert_transaction_type";
|
|
41
41
|
messageText: "notification" | "success" | "failed";
|
|
42
42
|
type: "error" | "success" | "info";
|
|
43
43
|
variables: {
|
|
@@ -149,7 +149,23 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
149
149
|
lineId: ID;
|
|
150
150
|
selectedTab: TransactionsTab;
|
|
151
151
|
transactionId: ID;
|
|
152
|
-
}, "expenseAutomationTransactionsView/updateSelectedTransactionId">,
|
|
152
|
+
}, "expenseAutomationTransactionsView/updateSelectedTransactionId">, removeTransactionsFromCategorizationList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
153
|
+
selectedPeriod: MonthYearPeriod;
|
|
154
|
+
selectedTab: TransactionsTab;
|
|
155
|
+
transactionIds: ID[];
|
|
156
|
+
}, "expenseAutomationTransactionsView/removeTransactionsFromCategorizationList">, convertTransactionType: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
157
|
+
fromAccountIntegrationId: string;
|
|
158
|
+
selectedPeriod: MonthYearPeriod;
|
|
159
|
+
selectedTab: TransactionsTab;
|
|
160
|
+
toAccountIntegrationId: string;
|
|
161
|
+
transactionId: ID;
|
|
162
|
+
transactionType: "transfer" | "credit_card_payment";
|
|
163
|
+
}, "expenseAutomationTransactionsView/convertTransactionType">, convertTransactionTypeSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
164
|
+
transactionId: ID;
|
|
165
|
+
}, "expenseAutomationTransactionsView/convertTransactionTypeSuccess">, convertTransactionTypeFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
166
|
+
error: ZeniAPIStatus;
|
|
167
|
+
transactionId: ID;
|
|
168
|
+
}, "expenseAutomationTransactionsView/convertTransactionTypeFailure">, syncTransactionCategorizationFromDetailSave: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[transactionId: TransactionID, updatedTransaction: SupportedTransactionWithCOT, pendingReviewLineIds: string[], uncategorizedIncomeExpense: UncategorizedAccounts, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
153
169
|
transactionId: TransactionID;
|
|
154
170
|
updatedTransaction: SupportedTransactionWithCOT;
|
|
155
171
|
pendingReviewLineIds: string[];
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
7
|
+
exports.backgroundRefetchReviewTab = exports.syncTransactionCategorizationFromDetailSave = exports.convertTransactionTypeFailure = exports.convertTransactionTypeSuccess = exports.convertTransactionType = exports.removeTransactionsFromCategorizationList = exports.updateSelectedTransactionId = exports.setEntityRecommendationForLineIdsForCategorization = exports.clearExpenseAutomationTransactionsView = exports.clearExpenseAutomationTransactionsViewPerTabView = exports.updateSelectedCheckboxTransactionIds = exports.fetchTransactionCategorizationView = exports.resetOtherTabsFetchState = exports.fetchTransactionCategorizationSuccess = exports.updateTotalCountForTransactionCategorization = exports.setAllItemsToCategoryClassInLocalDataForCategorization = exports.updateSelectedCustomerForTransaction = exports.updateSelectedVendorForTransaction = exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = exports.markTransactionAsNotMiscategorized = exports.updateTransactionCategorizationSaveStatus = exports.updateCurrentSelectedTransactionCategorizationTab = exports.updateTransactionCategorization = exports.saveTransactionCategorization = exports.fetchTransactionCategorizationFailure = exports.saveTransactionCategorizationLocalData = exports.initializeTransactionCategorizationViewLocalData = exports.updateTransactionCategorizationUIState = exports.fetchTransactionCategorization = exports.initialState = exports.initialTransactionTabViewState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const get_1 = __importDefault(require("lodash/get"));
|
|
10
10
|
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
@@ -706,6 +706,35 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
706
706
|
clearExpenseAutomationTransactionsView(draft) {
|
|
707
707
|
Object.assign(draft, exports.initialState);
|
|
708
708
|
},
|
|
709
|
+
removeTransactionsFromCategorizationList(draft, action) {
|
|
710
|
+
const { selectedTab, selectedPeriod, transactionIds } = action.payload;
|
|
711
|
+
const periodId = (0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod);
|
|
712
|
+
const tabView = draft.transactionCategorizationView[selectedTab];
|
|
713
|
+
const currentIds = tabView.transactionIdsBySelectedPeriod[periodId] ?? [];
|
|
714
|
+
tabView.transactionIdsBySelectedPeriod[periodId] = currentIds.filter((id) => !transactionIds.includes(id));
|
|
715
|
+
transactionIds.forEach((id) => {
|
|
716
|
+
delete tabView.transactionReviewLocalDataById[id];
|
|
717
|
+
});
|
|
718
|
+
tabView.selectedCheckBoxTransactionIds =
|
|
719
|
+
tabView.selectedCheckBoxTransactionIds.filter((id) => !transactionIds.includes(id));
|
|
720
|
+
tabView.transactionIdsWithUnsavedData =
|
|
721
|
+
tabView.transactionIdsWithUnsavedData.filter((id) => !transactionIds.includes(id));
|
|
722
|
+
},
|
|
723
|
+
convertTransactionType(_draft, _action) {
|
|
724
|
+
// Trigger only; epic performs the API call. No state change.
|
|
725
|
+
void _draft;
|
|
726
|
+
void _action;
|
|
727
|
+
},
|
|
728
|
+
convertTransactionTypeSuccess(_draft, _action) {
|
|
729
|
+
// UI can listen for this to close the convert drawer. No state change.
|
|
730
|
+
void _draft;
|
|
731
|
+
void _action;
|
|
732
|
+
},
|
|
733
|
+
convertTransactionTypeFailure(_draft, _action) {
|
|
734
|
+
// UI can listen for this to show error in the convert drawer. No state change.
|
|
735
|
+
void _draft;
|
|
736
|
+
void _action;
|
|
737
|
+
},
|
|
709
738
|
syncTransactionCategorizationFromDetailSave: {
|
|
710
739
|
prepare(transactionId, updatedTransaction, pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) {
|
|
711
740
|
return {
|
|
@@ -777,5 +806,5 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
777
806
|
},
|
|
778
807
|
},
|
|
779
808
|
});
|
|
780
|
-
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab;
|
|
809
|
+
_a = expenseAutomationTransactionsView.actions, exports.fetchTransactionCategorization = _a.fetchTransactionCategorization, exports.updateTransactionCategorizationUIState = _a.updateTransactionCategorizationUIState, exports.initializeTransactionCategorizationViewLocalData = _a.initializeTransactionCategorizationViewLocalData, exports.saveTransactionCategorizationLocalData = _a.saveTransactionCategorizationLocalData, exports.fetchTransactionCategorizationFailure = _a.fetchTransactionCategorizationFailure, exports.saveTransactionCategorization = _a.saveTransactionCategorization, exports.updateTransactionCategorization = _a.updateTransactionCategorization, exports.updateCurrentSelectedTransactionCategorizationTab = _a.updateCurrentSelectedTransactionCategorizationTab, exports.updateTransactionCategorizationSaveStatus = _a.updateTransactionCategorizationSaveStatus, exports.markTransactionAsNotMiscategorized = _a.markTransactionAsNotMiscategorized, exports.updateStatusForTransactionNotMiscategorizedUpdateForCategorization = _a.updateStatusForTransactionNotMiscategorizedUpdateForCategorization, exports.updateSelectedVendorForTransaction = _a.updateSelectedVendorForTransaction, exports.updateSelectedCustomerForTransaction = _a.updateSelectedCustomerForTransaction, exports.setAllItemsToCategoryClassInLocalDataForCategorization = _a.setAllItemsToCategoryClassInLocalDataForCategorization, exports.updateTotalCountForTransactionCategorization = _a.updateTotalCountForTransactionCategorization, exports.fetchTransactionCategorizationSuccess = _a.fetchTransactionCategorizationSuccess, exports.resetOtherTabsFetchState = _a.resetOtherTabsFetchState, exports.fetchTransactionCategorizationView = _a.fetchTransactionCategorizationView, exports.updateSelectedCheckboxTransactionIds = _a.updateSelectedCheckboxTransactionIds, exports.clearExpenseAutomationTransactionsViewPerTabView = _a.clearExpenseAutomationTransactionsViewPerTabView, exports.clearExpenseAutomationTransactionsView = _a.clearExpenseAutomationTransactionsView, exports.setEntityRecommendationForLineIdsForCategorization = _a.setEntityRecommendationForLineIdsForCategorization, exports.updateSelectedTransactionId = _a.updateSelectedTransactionId, exports.removeTransactionsFromCategorizationList = _a.removeTransactionsFromCategorizationList, exports.convertTransactionType = _a.convertTransactionType, exports.convertTransactionTypeSuccess = _a.convertTransactionTypeSuccess, exports.convertTransactionTypeFailure = _a.convertTransactionTypeFailure, exports.syncTransactionCategorizationFromDetailSave = _a.syncTransactionCategorizationFromDetailSave, exports.backgroundRefetchReviewTab = _a.backgroundRefetchReviewTab;
|
|
781
810
|
exports.default = expenseAutomationTransactionsView.reducer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NestedAccountHierarchyForReport } from '../../../commonStateTypes/accountView/nestedAccountID';
|
|
2
2
|
import { NestedClassHierarchyForReport } from '../../../commonStateTypes/classesView/nestedClassID';
|
|
3
|
-
import { CompletionStatusType, FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
3
|
+
import { CompletionStatusType, FetchState, FetchStateAndError, ID } from '../../../commonStateTypes/common';
|
|
4
4
|
import { SelectorView } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
5
5
|
import { AccountBase } from '../../../entity/account/accountState';
|
|
6
6
|
import { ClassBase } from '../../../entity/class/classState';
|
|
@@ -11,12 +11,20 @@ export interface TransactionReviewLocalDataSelectorView {
|
|
|
11
11
|
transactionId: ID;
|
|
12
12
|
transactionReviewLocalData: TransactionReviewLocalData;
|
|
13
13
|
}
|
|
14
|
+
/** Debit account fetch for transfer drawer (keyed by transaction id string). */
|
|
15
|
+
export interface TransactionCategorizationDebitAccountInfo {
|
|
16
|
+
fetchState: FetchState;
|
|
17
|
+
accountId?: ID;
|
|
18
|
+
accountName?: string;
|
|
19
|
+
}
|
|
14
20
|
export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
15
21
|
accountList: AccountBase[];
|
|
16
22
|
accountsHierarchyList: NestedAccountHierarchyForReport[];
|
|
17
23
|
classHierarchyList: NestedClassHierarchyForReport[];
|
|
18
24
|
classList: ClassBase[];
|
|
19
25
|
completionStatus: CompletionStatusType;
|
|
26
|
+
createTransferEntryStatus: FetchState;
|
|
27
|
+
debitAccountInfoByTransactionId: Record<ID, TransactionCategorizationDebitAccountInfo>;
|
|
20
28
|
fetchStateByTransactionTabs: Record<TransactionsTab, FetchStateAndError>;
|
|
21
29
|
markAsNotMiscategorizedStatus: FetchStateAndError;
|
|
22
30
|
refreshStatus: FetchStateAndError;
|
|
@@ -26,6 +34,7 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
26
34
|
transactionIdsWithUnsavedData: ID[];
|
|
27
35
|
transactionLocalData: TransactionReviewLocalDataSelectorView[];
|
|
28
36
|
transactions: SupportedTransactionWithCOT[];
|
|
37
|
+
transferAccounts: AccountBase[];
|
|
29
38
|
uiState: TransactionsViewUIState;
|
|
30
39
|
uncategorizedAccounts: UncategorizedAccounts;
|
|
31
40
|
selectedTransactionId?: ID;
|
|
@@ -102,5 +102,8 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
102
102
|
fetchStateByTransactionTabs: fetchStateByTab,
|
|
103
103
|
selectedTransactionId,
|
|
104
104
|
selectedTransactionLineId,
|
|
105
|
+
createTransferEntryStatus: 'Not-Started',
|
|
106
|
+
transferAccounts: [],
|
|
107
|
+
debitAccountInfoByTransactionId: {},
|
|
105
108
|
};
|
|
106
109
|
}
|
package/lib/view/spendManagement/commonSetup/epic/setup/updateBusinessVerificationDetailsEpic.js
CHANGED
|
@@ -143,7 +143,7 @@ function toUsNexusTypeKey(value) {
|
|
|
143
143
|
return US_NEXUS_LABEL_TO_KEY[value] ?? value;
|
|
144
144
|
}
|
|
145
145
|
const toBusinessVerificationCompanyDataPayload = (companyLocalData, sendForVerification, companyAddressData, registeredAddressData, setupViewType) => {
|
|
146
|
-
const { companyDescription, companyLegalName, companyIndustry,
|
|
146
|
+
const { companyDescription, companyLegalName, companyIndustry, companySubIndustry, countriesOfOperations, companySourceOfFunds, companySourceOfFundsDescription, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, website, incDate, taxIdOrEIN, phone, syncToken, fileIds, typeOfIncorporation, stateOfIncorporation, sourceOfFunds, } = companyLocalData;
|
|
147
147
|
const company = {
|
|
148
148
|
is_ready_for_verification: sendForVerification,
|
|
149
149
|
file_ids: fileIds,
|
|
@@ -201,9 +201,6 @@ const toBusinessVerificationCompanyDataPayload = (companyLocalData, sendForVerif
|
|
|
201
201
|
company['company_industry'] = companyIndustry;
|
|
202
202
|
}
|
|
203
203
|
Object.assign(company, {
|
|
204
|
-
...(companyIndustryType != null && {
|
|
205
|
-
company_industry_type: companyIndustryType,
|
|
206
|
-
}),
|
|
207
204
|
...(companySubIndustry != null && {
|
|
208
205
|
company_industry_sub_type: companySubIndustry,
|
|
209
206
|
}),
|
package/lib/view/spendManagement/commonSetup/epic/setup/updateSetupViewLocalStoreDataEpic.js
CHANGED
|
@@ -53,14 +53,13 @@ function toSetupViewLocalData(company, users, userRoles, primaryContact) {
|
|
|
53
53
|
const { companyInfo, incInfo, taxInfo, questionaire, companyBillPayInfo } = company;
|
|
54
54
|
const { companyId, companyDescription, companyLegalName, companyUrl, phone, syncToken, sourceOfFunds, companySourceOfFunds: incCompanySourceOfFunds, companySourceOfFundsDescription, countriesOfOperations, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, usNexus, usNexusTypes, } = companyInfo;
|
|
55
55
|
const { usersSelectedForVerification: usersSelected } = companyBillPayInfo;
|
|
56
|
-
const { fileIds, companyIncDate: incDate, companyIncType, companyIncState, companySubIndustry,
|
|
56
|
+
const { fileIds, companyIncDate: incDate, companyIncType, companyIncState, companySubIndustry, } = incInfo;
|
|
57
57
|
const { companyIndustry } = questionaire;
|
|
58
58
|
const { taxId } = taxInfo;
|
|
59
59
|
const companyDetails = {
|
|
60
60
|
companyId,
|
|
61
61
|
companyDescription,
|
|
62
62
|
companyIndustry,
|
|
63
|
-
companyIndustryType,
|
|
64
63
|
companyLegalName,
|
|
65
64
|
companySubIndustry,
|
|
66
65
|
companySourceOfFunds: incCompanySourceOfFunds,
|
|
@@ -69,7 +69,6 @@ export interface CompanyDetails {
|
|
|
69
69
|
addressStatus?: NewAddressData;
|
|
70
70
|
companyDescription?: string;
|
|
71
71
|
companyIndustry?: string;
|
|
72
|
-
companyIndustryType?: string;
|
|
73
72
|
companyLegalName?: string;
|
|
74
73
|
companySourceOfFunds?: string;
|
|
75
74
|
companySourceOfFundsDescription?: string;
|
|
@@ -114,7 +114,7 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
|
|
|
114
114
|
if (companyDetails.localData != null) {
|
|
115
115
|
const deleteFileStatusById = {};
|
|
116
116
|
const updateFileStatusById = {};
|
|
117
|
-
const { syncToken, companyDescription, companyLegalName, website, companyIndustry,
|
|
117
|
+
const { syncToken, companyDescription, companyLegalName, website, companyIndustry, companySubIndustry, companySourceOfFunds, companySourceOfFundsDescription, countriesOfOperations, phone, taxIdOrEIN, incDate, fileIds, typeOfIncorporation, sourceOfFunds, transactionVolume, transactionVolumeDescription, purposeOfAccount, purposeOfAccountDescription, regulatedStatus, regulatedStatusDescription, stateOfIncorporation, usNexus, usNexusTypes, } = companyDetails.localData;
|
|
118
118
|
fileIds.forEach((fileId) => {
|
|
119
119
|
deleteFileStatusById[fileId] = (0, fileViewSelector_1.getFileDeleteStatusById)(state, fileId);
|
|
120
120
|
});
|
|
@@ -128,7 +128,6 @@ const getCompanyAndIdentityDetails = (state, companyId, companyAndIdentityDetail
|
|
|
128
128
|
companyDescription,
|
|
129
129
|
companyLegalName,
|
|
130
130
|
companyIndustry,
|
|
131
|
-
companyIndustryType,
|
|
132
131
|
companySubIndustry,
|
|
133
132
|
companySourceOfFunds,
|
|
134
133
|
companySourceOfFundsDescription,
|
|
@@ -16,7 +16,6 @@ export interface CompanyDetailsLocalData {
|
|
|
16
16
|
fileIds: ID[];
|
|
17
17
|
companyDescription?: string;
|
|
18
18
|
companyIndustry?: string;
|
|
19
|
-
companyIndustryType?: string;
|
|
20
19
|
companyLegalName?: string;
|
|
21
20
|
companySourceOfFunds?: string;
|
|
22
21
|
companySourceOfFundsDescription?: string;
|
|
@@ -1,31 +1,5 @@
|
|
|
1
1
|
import { ID } from '../../../../commonStateTypes/common';
|
|
2
2
|
import { AddressUpdatableInfoPayload } from '../../../addressView/addressViewPayload';
|
|
3
|
-
export declare const COMPANY_TRANSACTION_VOLUME_CODES: readonly ["less_than_10000", "10000_50000", "50001_250000", "250001_1000000", "1000001_2000000", "over_2000000"];
|
|
4
|
-
export type CompanyTransactionVolumeCode = (typeof COMPANY_TRANSACTION_VOLUME_CODES)[number];
|
|
5
|
-
export declare const COMPANY_SOURCE_OF_FUNDS_CODES: readonly ["sales_of_goods", "sales_of_services", "customer_payments", "investment_capital", "business_loans", "owner_contributions", "franchise_revenue", "rental_income", "government_contracts_grants", "donations_fundraising", "membership_fees_subscriptions", "licensing_royalties", "commission_income", "import_export_revenue", "cryptocurrency_activity"];
|
|
6
|
-
export type CompanySourceOfFundsCode = (typeof COMPANY_SOURCE_OF_FUNDS_CODES)[number];
|
|
7
|
-
export declare const COMPANY_PURPOSE_OF_ACCOUNT_CODES: readonly ["retail_sales", "ecommerce_sales", "cash_heavy_operations", "import_export_trade", "professional_services_not_handling_funds", "professional_services_handling_funds", "holding_investment_company", "property_management_real_estate", "charitable_nonprofit", "construction_contracting", "commercial_cash_operations", "freight_forwarding_logistics", "third_party_payment_processing", "technology_startup", "wholesale_distribution", "franchise_operation", "healthcare_provider", "educational_institution"];
|
|
8
|
-
export type CompanyPurposeOfAccountCode = (typeof COMPANY_PURPOSE_OF_ACCOUNT_CODES)[number];
|
|
9
|
-
/** Industry type codes for onboarding / business verification (paired with sub-industry). */
|
|
10
|
-
export declare const COMPANY_ONBOARDING_INDUSTRY_TYPE_CODES: readonly ["retail_consumer_goods", "financial_services", "food_agriculture", "healthcare_pharmaceuticals", "professional_services", "manufacturing_industrial", "real_estate_construction", "logistics_transportation", "wholesale_trade", "business_support_services", "escort_dating_adult_entertainment"];
|
|
11
|
-
export type CompanyOnboardingIndustryTypeCode = (typeof COMPANY_ONBOARDING_INDUSTRY_TYPE_CODES)[number];
|
|
12
|
-
export declare const COMPANY_ONBOARDING_SUB_INDUSTRY_CODES_BY_INDUSTRY: {
|
|
13
|
-
readonly retail_consumer_goods: readonly ["grocery_stores_supermarkets", "convenience_stores", "specialty_food_retailers", "gas_stations_retail", "general_merchandise_department", "online_retail_ecommerce", "subscription_membership", "direct_to_consumer", "cannabis"];
|
|
14
|
-
readonly financial_services: readonly ["banks_credit_unions", "fintech_payment_processing", "insurance_providers", "investment_advisors_broker", "lending_mortgage", "treasury_management", "personal_finance_apps", "retirement_planning", "real_estate_investment", "money_service_businesses", "cryptocurrency", "debt_collection", "payday_lending", "gambling"];
|
|
15
|
-
readonly food_agriculture: readonly ["farms_agricultural", "food_wholesalers_distributors", "restaurants_cafes", "bars_nightclubs", "catering_services", "farmers_markets", "restaurant_tech_pos"];
|
|
16
|
-
readonly healthcare_pharmaceuticals: readonly ["hospitals_clinics", "pharmacies", "medical_equipment", "biotechnology", "home_health", "healthcare_staffing", "wellness_benefits", "healthcare_social_assistance"];
|
|
17
|
-
readonly professional_services: readonly ["legal_services", "accounting_auditing", "consulting_firms", "marketing_advertising", "real_estate_agents_property", "corporate_services_incorporation", "hr_workforce_management", "direct_marketing_telemarketing", "legal_accounting_consulting_programming"];
|
|
18
|
-
readonly manufacturing_industrial: readonly ["chemical_manufacturing", "electronics_hardware", "automotive_manufacturing", "construction_materials", "textiles_apparel", "mining"];
|
|
19
|
-
readonly real_estate_construction: readonly ["real_estate", "construction"];
|
|
20
|
-
readonly logistics_transportation: readonly ["transportation_warehousing"];
|
|
21
|
-
readonly wholesale_trade: readonly ["wholesale_trade"];
|
|
22
|
-
readonly business_support_services: readonly ["business_support_building"];
|
|
23
|
-
readonly escort_dating_adult_entertainment: readonly ["escort_services", "dating_adult_entertainment"];
|
|
24
|
-
};
|
|
25
|
-
export type CompanyOnboardingSubIndustryTypeCode = {
|
|
26
|
-
[K in keyof typeof COMPANY_ONBOARDING_SUB_INDUSTRY_CODES_BY_INDUSTRY]: (typeof COMPANY_ONBOARDING_SUB_INDUSTRY_CODES_BY_INDUSTRY)[K][number];
|
|
27
|
-
}[keyof typeof COMPANY_ONBOARDING_SUB_INDUSTRY_CODES_BY_INDUSTRY];
|
|
28
|
-
export declare function getCompanyOnboardingSubIndustryCodesForIndustry(industryTypeCode: string | undefined | null): CompanyOnboardingSubIndustryTypeCode[];
|
|
29
3
|
export interface CompanyOfficerVerificationPayload {
|
|
30
4
|
additional_submitted_documents_for_verification_file_ids: {
|
|
31
5
|
social_security_card: ID[];
|
|
@@ -92,14 +66,13 @@ export interface CompanyDetailsVerificationPayload {
|
|
|
92
66
|
company_countries_of_operations?: string[];
|
|
93
67
|
company_inc_state?: string | null;
|
|
94
68
|
company_industry_sub_type?: string;
|
|
95
|
-
|
|
96
|
-
company_purpose_of_account?: CompanyPurposeOfAccountCode;
|
|
69
|
+
company_purpose_of_account?: string;
|
|
97
70
|
company_purpose_of_account_desc?: string;
|
|
98
71
|
company_regulated_states?: boolean;
|
|
99
72
|
company_regulated_states_desc?: string;
|
|
100
|
-
company_source_of_funds?:
|
|
73
|
+
company_source_of_funds?: string;
|
|
101
74
|
company_source_of_funds_desc?: string;
|
|
102
|
-
company_transaction_vol_expectations?:
|
|
75
|
+
company_transaction_vol_expectations?: string;
|
|
103
76
|
company_transaction_vol_expectations_desc?: string;
|
|
104
77
|
company_us_nexus?: boolean;
|
|
105
78
|
company_us_nexus_desc?: string[];
|