@zeniai/client-epic-state 4.19.85 → 4.19.86-beta0AD
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/account/accountPayload.d.ts +2 -0
- package/lib/entity/account/accountPayload.js +2 -0
- package/lib/entity/account/accountState.d.ts +2 -0
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +1 -2
- package/lib/entity/depositAccount/depositAccount.d.ts +1 -1
- package/lib/entity/depositAccount/depositAccount.js +1 -1
- package/lib/epic.d.ts +4 -1
- package/lib/epic.js +4 -1
- package/lib/esm/entity/account/accountPayload.js +2 -0
- package/lib/esm/entity/depositAccount/depositAccount.js +1 -1
- package/lib/esm/epic.js +4 -1
- package/lib/esm/index.js +4 -4
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +34 -1
- package/lib/esm/view/aiCfoView/aiCfoViewSelector.js +5 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +26 -0
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +24 -0
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +20 -1
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +2 -1
- package/lib/esm/view/spendManagement/billPay/billList/billListSelector.js +10 -0
- package/lib/esm/view/spendManagement/billPay/billList/billListState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
- package/lib/esm/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
- package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +3 -3
- package/lib/index.d.ts +7 -5
- package/lib/index.js +37 -31
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/lib/view/aiCfoView/aiCfoViewPayload.d.ts +11 -0
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +11 -1
- package/lib/view/aiCfoView/aiCfoViewReducer.js +35 -2
- package/lib/view/aiCfoView/aiCfoViewSelector.d.ts +4 -1
- package/lib/view/aiCfoView/aiCfoViewSelector.js +6 -1
- package/lib/view/aiCfoView/aiCfoViewState.d.ts +15 -0
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -0
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +30 -0
- package/lib/view/auditReportView/auditReportViewState.d.ts +1 -1
- package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +7 -5
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +7 -0
- package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +28 -0
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +11 -3
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +21 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +1 -0
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +2 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.js +2 -1
- package/lib/view/spendManagement/billPay/billList/billListSelector.js +10 -0
- package/lib/view/spendManagement/billPay/billList/billListState.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billList/billListState.js +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.js +1 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +2 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.d.ts +1 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListSelector.js +12 -0
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiListView/remiListState.js +1 -0
- package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +3 -3
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AiCfoAnswerPayload, ChatSessionPayload } from '../../entity/aiCfo/aiCfoPayload';
|
|
2
2
|
import { UserRolePayload } from '../../entity/userRole/userRolePayload';
|
|
3
3
|
import { ZeniAPIResponse } from '../../responsePayload';
|
|
4
|
+
import { AiCfoSuggestedQuestionsPageContext } from './aiCfoViewState';
|
|
4
5
|
export type ContextStatus = 'NONE' | 'NOT_FOUND' | 'PERMISSION_DENIED' | 'SUCCESS';
|
|
5
6
|
export interface CreateSessionResponseData {
|
|
6
7
|
chat_session_id: string;
|
|
@@ -23,4 +24,14 @@ interface AcceptMasterTOSPayload {
|
|
|
23
24
|
user_roles: UserRolePayload[];
|
|
24
25
|
}
|
|
25
26
|
export type AcceptMasterTOSResponse = ZeniAPIResponse<AcceptMasterTOSPayload>;
|
|
27
|
+
/**
|
|
28
|
+
* Payload returned in `data` for GET .../suggested-questions?page_context=...
|
|
29
|
+
* Field names match the REST API (snake_case).
|
|
30
|
+
*/
|
|
31
|
+
export interface SuggestedQuestionsDataPayload {
|
|
32
|
+
generated_at: string;
|
|
33
|
+
page_context: AiCfoSuggestedQuestionsPageContext;
|
|
34
|
+
suggested_questions: string[];
|
|
35
|
+
}
|
|
36
|
+
export type FetchSuggestedQuestionsResponse = ZeniAPIResponse<SuggestedQuestionsDataPayload>;
|
|
26
37
|
export {};
|
|
@@ -4,6 +4,7 @@ import { ChatSessionPayload } from '../../entity/aiCfo/aiCfoPayload';
|
|
|
4
4
|
import { AiCfoAnswerResponseType } from '../../entity/aiCfo/aiCfoState';
|
|
5
5
|
import { ZeniAPIStatus } from '../../responsePayload';
|
|
6
6
|
import { ContextStatus } from './aiCfoViewPayload';
|
|
7
|
+
import { AiCfoSuggestedQuestionsPageContext } from './aiCfoViewState';
|
|
7
8
|
import { AiCfoViewState } from './aiCfoViewState';
|
|
8
9
|
export declare const initialAiCfoViewState: AiCfoViewState;
|
|
9
10
|
export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[sessionId: string, questionAnswerId: string, userId: string, questionId: string, createdAt: import("dayjs").Dayjs, question: string, files?: File[] | undefined], {
|
|
@@ -89,6 +90,15 @@ export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
89
90
|
}, "aiCfoView/clearDeleteChatSessionStatus">, clearAiCfoView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearAiCfoView">, updateCotCollapsedState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
90
91
|
isCollapsed: boolean;
|
|
91
92
|
questionAnswerId: ID;
|
|
92
|
-
}, "aiCfoView/updateCotCollapsedState"
|
|
93
|
+
}, "aiCfoView/updateCotCollapsedState">, fetchSuggestedQuestions: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
94
|
+
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
95
|
+
}, "aiCfoView/fetchSuggestedQuestions">, fetchSuggestedQuestionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
96
|
+
generatedAt: string;
|
|
97
|
+
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
98
|
+
suggestedQuestions: string[];
|
|
99
|
+
}, "aiCfoView/fetchSuggestedQuestionsSuccess">, fetchSuggestedQuestionsFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
100
|
+
error: ZeniAPIStatus;
|
|
101
|
+
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
102
|
+
}, "aiCfoView/fetchSuggestedQuestionsFailure">;
|
|
93
103
|
declare const _default: import("redux").Reducer<AiCfoViewState>;
|
|
94
104
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.updateCotCollapsedState = exports.clearAiCfoView = exports.clearDeleteChatSessionStatus = exports.deleteChatSessionFailure = exports.deleteChatSessionSuccess = exports.deleteChatSession = exports.acceptMasterTOSFailure = exports.acceptMasterTOSSuccess = exports.acceptMasterTOS = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearLastContextMessage = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.initializeNewSessionState = exports.createSessionAndSubmit = exports.createSessionFailure = exports.createSessionSuccess = exports.createSession = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.updateResponseState = exports.submitQuestionFailure = exports.submitQuestionSuccess = exports.submitQuestion = exports.initialAiCfoViewState = void 0;
|
|
4
|
+
exports.fetchSuggestedQuestionsFailure = exports.fetchSuggestedQuestionsSuccess = exports.fetchSuggestedQuestions = exports.updateCotCollapsedState = exports.clearAiCfoView = exports.clearDeleteChatSessionStatus = exports.deleteChatSessionFailure = exports.deleteChatSessionSuccess = exports.deleteChatSession = exports.acceptMasterTOSFailure = exports.acceptMasterTOSSuccess = exports.acceptMasterTOS = exports.stopSubmitQuestionFailure = exports.stopSubmitQuestionSuccess = exports.stopSubmitQuestion = exports.stopSubmitFailure = exports.stopSubmitSuccess = exports.stopSubmit = exports.clearLastContextMessage = exports.clearCurrentSessionId = exports.fetchChatHistoryFailure = exports.fetchChatHistorySuccess = exports.fetchChatHistory = exports.fetchChatSessionsForUserFailure = exports.fetchChatSessionsForUserSuccess = exports.fetchChatSessionsForUser = exports.createSessionAndSubmitFailure = exports.createSessionAndSubmitSuccess = exports.initializeNewSessionState = exports.createSessionAndSubmit = exports.createSessionFailure = exports.createSessionSuccess = exports.createSession = exports.setSession = exports.clearInput = exports.updateCurrentInput = exports.updateAiCfoViewScrollPosition = exports.updateResponseState = exports.submitQuestionFailure = exports.submitQuestionSuccess = exports.submitQuestion = exports.initialAiCfoViewState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
exports.initialAiCfoViewState = {
|
|
7
7
|
fetchState: 'Not-Started',
|
|
@@ -33,6 +33,7 @@ exports.initialAiCfoViewState = {
|
|
|
33
33
|
fetchChatSessionHistoryByChatSessionId: {},
|
|
34
34
|
responseStateByChatSessionId: {},
|
|
35
35
|
stopSubmitStateByChatSessionId: {},
|
|
36
|
+
suggestedQuestionsByPageContext: {},
|
|
36
37
|
};
|
|
37
38
|
const aiCfoView = (0, toolkit_1.createSlice)({
|
|
38
39
|
name: 'aiCfoView',
|
|
@@ -365,6 +366,38 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
365
366
|
clearCurrentSessionId(draft) {
|
|
366
367
|
draft.uiState.currentChatSessionId = undefined;
|
|
367
368
|
},
|
|
369
|
+
fetchSuggestedQuestions(draft, action) {
|
|
370
|
+
const { pageContext } = action.payload;
|
|
371
|
+
const prev = draft.suggestedQuestionsByPageContext[pageContext];
|
|
372
|
+
draft.suggestedQuestionsByPageContext[pageContext] = {
|
|
373
|
+
fetchState: 'In-Progress',
|
|
374
|
+
pageContext,
|
|
375
|
+
suggestedQuestions: prev?.suggestedQuestions ?? [],
|
|
376
|
+
generatedAt: prev?.generatedAt,
|
|
377
|
+
error: undefined,
|
|
378
|
+
};
|
|
379
|
+
},
|
|
380
|
+
fetchSuggestedQuestionsSuccess(draft, action) {
|
|
381
|
+
const { pageContext, generatedAt, suggestedQuestions } = action.payload;
|
|
382
|
+
draft.suggestedQuestionsByPageContext[pageContext] = {
|
|
383
|
+
fetchState: 'Completed',
|
|
384
|
+
pageContext,
|
|
385
|
+
generatedAt,
|
|
386
|
+
suggestedQuestions,
|
|
387
|
+
error: undefined,
|
|
388
|
+
};
|
|
389
|
+
},
|
|
390
|
+
fetchSuggestedQuestionsFailure(draft, action) {
|
|
391
|
+
const { pageContext, error } = action.payload;
|
|
392
|
+
const prev = draft.suggestedQuestionsByPageContext[pageContext];
|
|
393
|
+
draft.suggestedQuestionsByPageContext[pageContext] = {
|
|
394
|
+
fetchState: 'Error',
|
|
395
|
+
pageContext,
|
|
396
|
+
suggestedQuestions: prev?.suggestedQuestions ?? [],
|
|
397
|
+
generatedAt: prev?.generatedAt,
|
|
398
|
+
error,
|
|
399
|
+
};
|
|
400
|
+
},
|
|
368
401
|
clearAiCfoView(draft) {
|
|
369
402
|
Object.assign(draft, exports.initialAiCfoViewState);
|
|
370
403
|
},
|
|
@@ -375,5 +408,5 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
375
408
|
},
|
|
376
409
|
},
|
|
377
410
|
});
|
|
378
|
-
_a = aiCfoView.actions, exports.submitQuestion = _a.submitQuestion, exports.submitQuestionSuccess = _a.submitQuestionSuccess, exports.submitQuestionFailure = _a.submitQuestionFailure, exports.updateResponseState = _a.updateResponseState, exports.updateAiCfoViewScrollPosition = _a.updateAiCfoViewScrollPosition, exports.updateCurrentInput = _a.updateCurrentInput, exports.clearInput = _a.clearInput, exports.setSession = _a.setSession, exports.createSession = _a.createSession, exports.createSessionSuccess = _a.createSessionSuccess, exports.createSessionFailure = _a.createSessionFailure, exports.createSessionAndSubmit = _a.createSessionAndSubmit, exports.initializeNewSessionState = _a.initializeNewSessionState, exports.createSessionAndSubmitSuccess = _a.createSessionAndSubmitSuccess, exports.createSessionAndSubmitFailure = _a.createSessionAndSubmitFailure, exports.fetchChatSessionsForUser = _a.fetchChatSessionsForUser, exports.fetchChatSessionsForUserSuccess = _a.fetchChatSessionsForUserSuccess, exports.fetchChatSessionsForUserFailure = _a.fetchChatSessionsForUserFailure, exports.fetchChatHistory = _a.fetchChatHistory, exports.fetchChatHistorySuccess = _a.fetchChatHistorySuccess, exports.fetchChatHistoryFailure = _a.fetchChatHistoryFailure, exports.clearCurrentSessionId = _a.clearCurrentSessionId, exports.clearLastContextMessage = _a.clearLastContextMessage, exports.stopSubmit = _a.stopSubmit, exports.stopSubmitSuccess = _a.stopSubmitSuccess, exports.stopSubmitFailure = _a.stopSubmitFailure, exports.stopSubmitQuestion = _a.stopSubmitQuestion, exports.stopSubmitQuestionSuccess = _a.stopSubmitQuestionSuccess, exports.stopSubmitQuestionFailure = _a.stopSubmitQuestionFailure, exports.acceptMasterTOS = _a.acceptMasterTOS, exports.acceptMasterTOSSuccess = _a.acceptMasterTOSSuccess, exports.acceptMasterTOSFailure = _a.acceptMasterTOSFailure, exports.deleteChatSession = _a.deleteChatSession, exports.deleteChatSessionSuccess = _a.deleteChatSessionSuccess, exports.deleteChatSessionFailure = _a.deleteChatSessionFailure, exports.clearDeleteChatSessionStatus = _a.clearDeleteChatSessionStatus, exports.clearAiCfoView = _a.clearAiCfoView, exports.updateCotCollapsedState = _a.updateCotCollapsedState;
|
|
411
|
+
_a = aiCfoView.actions, exports.submitQuestion = _a.submitQuestion, exports.submitQuestionSuccess = _a.submitQuestionSuccess, exports.submitQuestionFailure = _a.submitQuestionFailure, exports.updateResponseState = _a.updateResponseState, exports.updateAiCfoViewScrollPosition = _a.updateAiCfoViewScrollPosition, exports.updateCurrentInput = _a.updateCurrentInput, exports.clearInput = _a.clearInput, exports.setSession = _a.setSession, exports.createSession = _a.createSession, exports.createSessionSuccess = _a.createSessionSuccess, exports.createSessionFailure = _a.createSessionFailure, exports.createSessionAndSubmit = _a.createSessionAndSubmit, exports.initializeNewSessionState = _a.initializeNewSessionState, exports.createSessionAndSubmitSuccess = _a.createSessionAndSubmitSuccess, exports.createSessionAndSubmitFailure = _a.createSessionAndSubmitFailure, exports.fetchChatSessionsForUser = _a.fetchChatSessionsForUser, exports.fetchChatSessionsForUserSuccess = _a.fetchChatSessionsForUserSuccess, exports.fetchChatSessionsForUserFailure = _a.fetchChatSessionsForUserFailure, exports.fetchChatHistory = _a.fetchChatHistory, exports.fetchChatHistorySuccess = _a.fetchChatHistorySuccess, exports.fetchChatHistoryFailure = _a.fetchChatHistoryFailure, exports.clearCurrentSessionId = _a.clearCurrentSessionId, exports.clearLastContextMessage = _a.clearLastContextMessage, exports.stopSubmit = _a.stopSubmit, exports.stopSubmitSuccess = _a.stopSubmitSuccess, exports.stopSubmitFailure = _a.stopSubmitFailure, exports.stopSubmitQuestion = _a.stopSubmitQuestion, exports.stopSubmitQuestionSuccess = _a.stopSubmitQuestionSuccess, exports.stopSubmitQuestionFailure = _a.stopSubmitQuestionFailure, exports.acceptMasterTOS = _a.acceptMasterTOS, exports.acceptMasterTOSSuccess = _a.acceptMasterTOSSuccess, exports.acceptMasterTOSFailure = _a.acceptMasterTOSFailure, exports.deleteChatSession = _a.deleteChatSession, exports.deleteChatSessionSuccess = _a.deleteChatSessionSuccess, exports.deleteChatSessionFailure = _a.deleteChatSessionFailure, exports.clearDeleteChatSessionStatus = _a.clearDeleteChatSessionStatus, exports.clearAiCfoView = _a.clearAiCfoView, exports.updateCotCollapsedState = _a.updateCotCollapsedState, exports.fetchSuggestedQuestions = _a.fetchSuggestedQuestions, exports.fetchSuggestedQuestionsSuccess = _a.fetchSuggestedQuestionsSuccess, exports.fetchSuggestedQuestionsFailure = _a.fetchSuggestedQuestionsFailure;
|
|
379
412
|
exports.default = aiCfoView.reducer;
|
|
@@ -3,7 +3,8 @@ import { FetchStateAndError } from '../../commonStateTypes/common';
|
|
|
3
3
|
import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { AiCfoSelectorView } from '../../entity/aiCfo/aiCfoSelector';
|
|
5
5
|
import { RootState } from '../../reducer';
|
|
6
|
-
import {
|
|
6
|
+
import { AiCfoSuggestedQuestionsPageContext } from './aiCfoViewState';
|
|
7
|
+
import { AiCfoViewUIState, SuggestedQuestionsForPageContext } from './aiCfoViewState';
|
|
7
8
|
export interface AiCfoViewSelector extends SelectorView, AiCfoSelectorView {
|
|
8
9
|
createSessionAndSubmitState: FetchStateAndError;
|
|
9
10
|
createSessionState: FetchStateAndError;
|
|
@@ -17,6 +18,8 @@ export interface AiCfoViewSelector extends SelectorView, AiCfoSelectorView {
|
|
|
17
18
|
thought: FetchStateAndError;
|
|
18
19
|
}>;
|
|
19
20
|
stopSubmitStateByChatSessionId: Record<ID, FetchStateAndError>;
|
|
21
|
+
suggestedQuestionsByPageContext: Partial<Record<AiCfoSuggestedQuestionsPageContext, SuggestedQuestionsForPageContext>>;
|
|
20
22
|
uiState: AiCfoViewUIState;
|
|
21
23
|
}
|
|
22
24
|
export declare const getAiCfoView: (state: RootState) => AiCfoViewSelector;
|
|
25
|
+
export declare function getSuggestedQuestionsForPageContext(state: RootState, pageContext: AiCfoSuggestedQuestionsPageContext): SuggestedQuestionsForPageContext | undefined;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAiCfoView = void 0;
|
|
4
|
+
exports.getSuggestedQuestionsForPageContext = getSuggestedQuestionsForPageContext;
|
|
4
5
|
const aiCfoSelector_1 = require("../../entity/aiCfo/aiCfoSelector");
|
|
5
6
|
const getAiCfoView = (state) => {
|
|
6
|
-
const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, } = state.aiCfoViewState;
|
|
7
|
+
const { fetchState, error, uiState, createSessionState, createSessionAndSubmitState, deleteChatSessionStateByChatSessionId, stopSubmitStateByChatSessionId, responseStateByChatSessionId, fetchChatSessionHistoryByChatSessionId, masterTOSAcceptanceState, suggestedQuestionsByPageContext, } = state.aiCfoViewState;
|
|
7
8
|
return {
|
|
8
9
|
fetchState,
|
|
9
10
|
error,
|
|
@@ -15,8 +16,12 @@ const getAiCfoView = (state) => {
|
|
|
15
16
|
uiState,
|
|
16
17
|
fetchChatSessionHistoryByChatSessionId,
|
|
17
18
|
masterTOSAcceptanceState,
|
|
19
|
+
suggestedQuestionsByPageContext,
|
|
18
20
|
...(0, aiCfoSelector_1.getAiCfoSelectorView)(state.aiCfoState),
|
|
19
21
|
version: 1,
|
|
20
22
|
};
|
|
21
23
|
};
|
|
22
24
|
exports.getAiCfoView = getAiCfoView;
|
|
25
|
+
function getSuggestedQuestionsForPageContext(state, pageContext) {
|
|
26
|
+
return state.aiCfoViewState.suggestedQuestionsByPageContext[pageContext];
|
|
27
|
+
}
|
|
@@ -25,6 +25,19 @@ export interface AiCfoViewUIState {
|
|
|
25
25
|
lastContextMessage?: string;
|
|
26
26
|
lastContextStatus?: ContextStatus;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Supported `page_context` values for GET .../suggested-questions and related UI state.
|
|
30
|
+
*/
|
|
31
|
+
export type AiCfoSuggestedQuestionsPageContext = 'balance_sheet' | 'profit_loss' | 'vendors' | 'transactions' | 'cash_flow' | 'accounts_receivable' | 'accounts_payable' | 'transaction_details';
|
|
32
|
+
/**
|
|
33
|
+
* Suggested starter questions for AI CFO for a given page slug (e.g. balance_sheet).
|
|
34
|
+
* Populated by {@link fetchSuggestedQuestionsEpic}; UI may fall back to Statsig defaults.
|
|
35
|
+
*/
|
|
36
|
+
export interface SuggestedQuestionsForPageContext extends FetchStateAndError {
|
|
37
|
+
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
38
|
+
suggestedQuestions: string[];
|
|
39
|
+
generatedAt?: string;
|
|
40
|
+
}
|
|
28
41
|
export interface AiCfoViewState extends FetchStateAndError {
|
|
29
42
|
allChatSessionIds: ID[];
|
|
30
43
|
createSessionAndSubmitState: FetchStateAndError;
|
|
@@ -39,5 +52,7 @@ export interface AiCfoViewState extends FetchStateAndError {
|
|
|
39
52
|
thought: FetchStateAndError;
|
|
40
53
|
}>;
|
|
41
54
|
stopSubmitStateByChatSessionId: Record<ID, FetchStateAndError>;
|
|
55
|
+
/** Keyed by `page_context` query value (e.g. balance_sheet). */
|
|
56
|
+
suggestedQuestionsByPageContext: Partial<Record<AiCfoSuggestedQuestionsPageContext, SuggestedQuestionsForPageContext>>;
|
|
42
57
|
uiState: AiCfoViewUIState;
|
|
43
58
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { RootState } from '../../../reducer';
|
|
4
|
+
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
|
+
import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess } from '../aiCfoViewReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof fetchSuggestedQuestions> | ReturnType<typeof fetchSuggestedQuestionsSuccess> | ReturnType<typeof fetchSuggestedQuestionsFailure>;
|
|
7
|
+
/** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
|
|
8
|
+
export declare const fetchSuggestedQuestionsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchSuggestedQuestionsEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const responsePayload_1 = require("../../../responsePayload");
|
|
7
|
+
const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
|
|
8
|
+
/** GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=... */
|
|
9
|
+
const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.fetchSuggestedQuestions.match), (0, operators_1.switchMap)((action) => {
|
|
10
|
+
const { pageContext } = action.payload;
|
|
11
|
+
const query = new URLSearchParams({ page_context: pageContext });
|
|
12
|
+
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
|
|
13
|
+
return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
|
|
14
|
+
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
15
|
+
return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsSuccess)({
|
|
16
|
+
pageContext: response.data.page_context,
|
|
17
|
+
generatedAt: response.data.generated_at,
|
|
18
|
+
suggestedQuestions: response.data.suggested_questions,
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
return (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsFailure)({
|
|
22
|
+
pageContext,
|
|
23
|
+
error: response.status,
|
|
24
|
+
}));
|
|
25
|
+
}), (0, operators_1.catchError)((error) => (0, rxjs_1.of)((0, aiCfoViewReducer_1.fetchSuggestedQuestionsFailure)({
|
|
26
|
+
pageContext,
|
|
27
|
+
error: (0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Fetch suggested questions REST API call failed', error instanceof Error ? { message: error.message } : undefined),
|
|
28
|
+
}))));
|
|
29
|
+
}));
|
|
30
|
+
exports.fetchSuggestedQuestionsEpic = fetchSuggestedQuestionsEpic;
|
|
@@ -3,7 +3,7 @@ import { Status } from '../../commonStateTypes/status';
|
|
|
3
3
|
import { View } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
4
4
|
import { ZeniDate } from '../../zeniDayJS';
|
|
5
5
|
import { AuditSummary } from '../reviewCompanyView/reviewCompanyViewState';
|
|
6
|
-
export declare const toAuditRuleEntityType: (v: string) => "dashboard" | "
|
|
6
|
+
export declare const toAuditRuleEntityType: (v: string) => "dashboard" | "transactions" | "reports";
|
|
7
7
|
export type AuditRuleEntityType = ReturnType<typeof toAuditRuleEntityType>;
|
|
8
8
|
declare const toAuditRuleEntityIdType: (v: string) => "cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "uncategorized-expense" | "uncategorized-income";
|
|
9
9
|
export type AuditRuleEntityIdType = ReturnType<typeof toAuditRuleEntityIdType>;
|
package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js
CHANGED
|
@@ -15,11 +15,13 @@ const uploadMissingReceiptSuccessEpic = (actions$, state$) => actions$.pipe((0,
|
|
|
15
15
|
updateActions.push((0, transactionReducer_1.updateTransaction)(transactionPayload.transaction_id, transactionPayload, updateType));
|
|
16
16
|
if (currentTenant != null) {
|
|
17
17
|
const monthEndChecksPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
if (monthEndChecksPeriod != null) {
|
|
19
|
+
updateActions.push((0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
|
|
20
|
+
tenantId: currentTenant.tenantId,
|
|
21
|
+
period: monthEndChecksPeriod,
|
|
22
|
+
refreshViewInBackground: true,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
23
25
|
}
|
|
24
26
|
return (0, rxjs_1.from)(updateActions);
|
|
25
27
|
}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
+
import { updateTransaction } from '../../../../entity/transaction/transactionReducer';
|
|
3
|
+
import { RootState } from '../../../../reducer';
|
|
4
|
+
import { fetchMonthEndCloseChecks } from '../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer';
|
|
5
|
+
import { uploadTransactionCategorizationReceiptSuccess } from '../../reducers/transactionsViewReducer';
|
|
6
|
+
export type ActionType = ReturnType<typeof uploadTransactionCategorizationReceiptSuccess> | ReturnType<typeof fetchMonthEndCloseChecks> | ReturnType<typeof updateTransaction>;
|
|
7
|
+
export declare const uploadTransactionReceiptSuccessEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => import("rxjs").Observable<ActionType>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uploadTransactionReceiptSuccessEpic = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const operators_1 = require("rxjs/operators");
|
|
6
|
+
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
7
|
+
const transactionReducer_1 = require("../../../../entity/transaction/transactionReducer");
|
|
8
|
+
const monthEndCloseChecksViewReducer_1 = require("../../../monthEndCloseChecksView/monthEndCloseChecksViewReducer");
|
|
9
|
+
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
10
|
+
const uploadTransactionReceiptSuccessEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.uploadTransactionCategorizationReceiptSuccess.match), (0, operators_1.mergeMap)((action) => {
|
|
11
|
+
const { transactionPayload, updateType } = action.payload;
|
|
12
|
+
const updateActions = [];
|
|
13
|
+
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state$.value);
|
|
14
|
+
const selectedPeriodByTenantId = state$.value.expenseAutomationViewState.selectedPeriodByTenantId;
|
|
15
|
+
updateActions.push((0, transactionReducer_1.updateTransaction)(transactionPayload.transaction_id, transactionPayload, updateType));
|
|
16
|
+
if (currentTenant != null) {
|
|
17
|
+
const monthEndChecksPeriod = selectedPeriodByTenantId[currentTenant.tenantId];
|
|
18
|
+
if (monthEndChecksPeriod != null) {
|
|
19
|
+
updateActions.push((0, monthEndCloseChecksViewReducer_1.fetchMonthEndCloseChecks)({
|
|
20
|
+
tenantId: currentTenant.tenantId,
|
|
21
|
+
period: monthEndChecksPeriod,
|
|
22
|
+
refreshViewInBackground: true,
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return (0, rxjs_1.from)(updateActions);
|
|
27
|
+
}));
|
|
28
|
+
exports.uploadTransactionReceiptSuccessEpic = uploadTransactionReceiptSuccessEpic;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FetchState, ID } from '../../../commonStateTypes/common';
|
|
1
|
+
import { FetchState, FetchStateAndError, ID, UpdateType } from '../../../commonStateTypes/common';
|
|
2
2
|
import { COTTransactionTrackingByTransactionId, RecommendationWithCOT } from '../../../commonStateTypes/recommendationBase';
|
|
3
3
|
import { MonthYearPeriod, TimePeriod } from '../../../commonStateTypes/timePeriod';
|
|
4
4
|
import { PageToken } from '../../../commonStateTypes/viewAndReport/viewAndReport';
|
|
@@ -7,7 +7,7 @@ import { ClassBase } from '../../../entity/class/classState';
|
|
|
7
7
|
import { CustomerBase } from '../../../entity/customer/customerState';
|
|
8
8
|
import { Entity } from '../../../entity/genericEntity/entity';
|
|
9
9
|
import { RecommendationWithCOTByLineId, TransactionID } from '../../../entity/transaction/stateTypes/transaction';
|
|
10
|
-
import { SupportedTransaction, SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
|
|
10
|
+
import { SupportedTransaction, SupportedTransactionPayload, SupportedTransactionWithCOT } from '../../../entity/transaction/transactionState';
|
|
11
11
|
import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
12
12
|
import { ZeniAPIStatus } from '../../../responsePayload';
|
|
13
13
|
import { UncategorizedAccounts } from '../../accountList/accountListSelector';
|
|
@@ -158,6 +158,14 @@ export declare const fetchTransactionCategorization: import("@reduxjs/toolkit").
|
|
|
158
158
|
}, "expenseAutomationTransactionsView/syncTransactionCategorizationFromDetailSave", never, never>, backgroundRefetchReviewTab: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[period: TimePeriod, isUncategorizedExpenseCategoryEnabled?: boolean | undefined], {
|
|
159
159
|
period: TimePeriod;
|
|
160
160
|
isUncategorizedExpenseCategoryEnabled: boolean | undefined;
|
|
161
|
-
}, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never
|
|
161
|
+
}, "expenseAutomationTransactionsView/backgroundRefetchReviewTab", never, never>, updateTransactionCategorizationUploadReceiptState: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionId: string, fetchStatus: FetchStateAndError], {
|
|
162
|
+
selectedTab: "review" | "autoCategorized";
|
|
163
|
+
transactionId: string;
|
|
164
|
+
fetchStatus: FetchStateAndError;
|
|
165
|
+
}, "expenseAutomationTransactionsView/updateTransactionCategorizationUploadReceiptState", never, never>, uploadTransactionCategorizationReceiptSuccess: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[selectedTab: "review" | "autoCategorized", transactionPayload: SupportedTransactionPayload, updateType?: UpdateType | undefined], {
|
|
166
|
+
selectedTab: "review" | "autoCategorized";
|
|
167
|
+
transactionPayload: SupportedTransactionPayload;
|
|
168
|
+
updateType: UpdateType;
|
|
169
|
+
}, "expenseAutomationTransactionsView/uploadTransactionCategorizationReceiptSuccess", never, never>;
|
|
162
170
|
declare const _default: import("redux").Reducer<TransactionsViewState>;
|
|
163
171
|
export default _default;
|
|
@@ -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.uploadTransactionCategorizationReceiptSuccess = exports.updateTransactionCategorizationUploadReceiptState = 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;
|
|
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"));
|
|
@@ -43,6 +43,7 @@ exports.initialTransactionTabViewState = {
|
|
|
43
43
|
transactionIdsBySelectedPeriod: {},
|
|
44
44
|
selectedCheckBoxTransactionIds: [],
|
|
45
45
|
transactionIdsWithUnsavedData: [],
|
|
46
|
+
uploadReceiptStatusById: {},
|
|
46
47
|
selectedTransactionId: undefined,
|
|
47
48
|
selectedTransactionLineId: undefined,
|
|
48
49
|
};
|
|
@@ -706,6 +707,24 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
706
707
|
clearExpenseAutomationTransactionsView(draft) {
|
|
707
708
|
Object.assign(draft, exports.initialState);
|
|
708
709
|
},
|
|
710
|
+
updateTransactionCategorizationUploadReceiptState: {
|
|
711
|
+
reducer(draft, action) {
|
|
712
|
+
const { transactionId, fetchStatus, selectedTab } = action.payload;
|
|
713
|
+
draft.transactionCategorizationView[selectedTab].uploadReceiptStatusById[transactionId] = fetchStatus;
|
|
714
|
+
},
|
|
715
|
+
prepare(selectedTab, transactionId, fetchStatus) {
|
|
716
|
+
return { payload: { selectedTab, transactionId, fetchStatus } };
|
|
717
|
+
},
|
|
718
|
+
},
|
|
719
|
+
uploadTransactionCategorizationReceiptSuccess: {
|
|
720
|
+
reducer(draft, action) {
|
|
721
|
+
const { transactionPayload, selectedTab } = action.payload;
|
|
722
|
+
draft.transactionCategorizationView[selectedTab].uploadReceiptStatusById[transactionPayload.transaction_id] = { fetchState: 'Completed', error: undefined };
|
|
723
|
+
},
|
|
724
|
+
prepare(selectedTab, transactionPayload, updateType = 'merge') {
|
|
725
|
+
return { payload: { selectedTab, transactionPayload, updateType } };
|
|
726
|
+
},
|
|
727
|
+
},
|
|
709
728
|
syncTransactionCategorizationFromDetailSave: {
|
|
710
729
|
prepare(transactionId, updatedTransaction, pendingReviewLineIds, uncategorizedIncomeExpense, isUncategorizedExpenseCategoryEnabled) {
|
|
711
730
|
return {
|
|
@@ -777,5 +796,5 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
777
796
|
},
|
|
778
797
|
},
|
|
779
798
|
});
|
|
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;
|
|
799
|
+
_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, exports.updateTransactionCategorizationUploadReceiptState = _a.updateTransactionCategorizationUploadReceiptState, exports.uploadTransactionCategorizationReceiptSuccess = _a.uploadTransactionCategorizationReceiptSuccess;
|
|
781
800
|
exports.default = expenseAutomationTransactionsView.reducer;
|
|
@@ -28,6 +28,7 @@ export interface ExpenseAutomationTransactionViewSelector extends SelectorView {
|
|
|
28
28
|
transactions: SupportedTransactionWithCOT[];
|
|
29
29
|
uiState: TransactionsViewUIState;
|
|
30
30
|
uncategorizedAccounts: UncategorizedAccounts;
|
|
31
|
+
uploadReceiptStatusById: Record<ID, FetchStateAndError>;
|
|
31
32
|
selectedTransactionId?: ID;
|
|
32
33
|
selectedTransactionLineId?: ID;
|
|
33
34
|
}
|
|
@@ -16,7 +16,7 @@ const expenseAutomationViewSelectorTypes_1 = require("../selectorTypes/expenseAu
|
|
|
16
16
|
function getExpenseAutomationTransactionView(state) {
|
|
17
17
|
const { accountState, classState, classListState, accountListState, expenseAutomationTransactionsViewState, expenseAutomationViewState, transactionState, monthEndCloseChecksState, } = state;
|
|
18
18
|
const { selectedTransactionCategorizationTab } = expenseAutomationTransactionsViewState;
|
|
19
|
-
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
19
|
+
const { uiState, refreshStatus, saveStatus, markAsNotMiscategorizedStatus, transactionIdsBySelectedPeriod, transactionReviewLocalDataById, selectedCheckBoxTransactionIds, transactionIdsWithUnsavedData, uploadReceiptStatusById, selectedTransactionId, selectedTransactionLineId, } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTransactionCategorizationTab];
|
|
20
20
|
const uncategorizedIncomeExpense = (0, accountListSelector_1.getUncategorizedAccounts)(accountState, accountListState, 'accountList');
|
|
21
21
|
const accountList = (0, accountListSelector_1.getAccountList)(accountState, accountListState, 'accountList');
|
|
22
22
|
const classList = (0, classListSelector_1.getClassList)(classState, classListState);
|
|
@@ -100,6 +100,7 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
100
100
|
completionStatus,
|
|
101
101
|
totalCountByTab,
|
|
102
102
|
fetchStateByTransactionTabs: fetchStateByTab,
|
|
103
|
+
uploadReceiptStatusById,
|
|
103
104
|
selectedTransactionId,
|
|
104
105
|
selectedTransactionLineId,
|
|
105
106
|
};
|
|
@@ -15,7 +15,7 @@ import { VendorBase } from '../../../entity/vendor/vendorState';
|
|
|
15
15
|
import { ZeniDate } from '../../../zeniDayJS';
|
|
16
16
|
import { EntityRecommendationKey } from '../../recommendation/recommendationState';
|
|
17
17
|
import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
|
|
18
|
-
export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class" | "
|
|
18
|
+
export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class" | "payment_account" | "transaction_type" | "memo_and_receipt";
|
|
19
19
|
export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
|
|
20
20
|
export declare const TRANSACTIONS_TABS: readonly ["review", "autoCategorized"];
|
|
21
21
|
export declare const toTransactionsTabKey: (v: string) => "review" | "autoCategorized";
|
|
@@ -97,6 +97,7 @@ export interface TransactionsTabViewState extends FetchedState {
|
|
|
97
97
|
transactionIdsWithUnsavedData: ID[];
|
|
98
98
|
transactionReviewLocalDataById: Record<ID | TransactionDetailKey, SupportedTransactionCategorization>;
|
|
99
99
|
uiState: TransactionsViewUIState;
|
|
100
|
+
uploadReceiptStatusById: Record<ID, FetchStateAndError>;
|
|
100
101
|
selectedTransactionId?: ID;
|
|
101
102
|
selectedTransactionLineId?: ID;
|
|
102
103
|
}
|
|
@@ -7,10 +7,11 @@ const TRANSACTIONS_SORT_KEYS = [
|
|
|
7
7
|
'vendor',
|
|
8
8
|
'amount',
|
|
9
9
|
'transaction_type',
|
|
10
|
+
'payment_account',
|
|
10
11
|
'date',
|
|
11
12
|
'category',
|
|
12
13
|
'class',
|
|
13
|
-
'
|
|
14
|
+
'memo_and_receipt',
|
|
14
15
|
];
|
|
15
16
|
const toTransactionsSortKey = (v) => (0, stringToUnion_1.stringToUnion)(v, TRANSACTIONS_SORT_KEYS);
|
|
16
17
|
exports.toTransactionsSortKey = toTransactionsSortKey;
|
|
@@ -424,6 +424,14 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
|
|
|
424
424
|
transactionsWithNoSortKeyValue.push(transaction);
|
|
425
425
|
}
|
|
426
426
|
break;
|
|
427
|
+
case 'invoiceNumber':
|
|
428
|
+
if (transaction.documentId != null) {
|
|
429
|
+
transactionsWithSortKeyValue.push(transaction);
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
transactionsWithNoSortKeyValue.push(transaction);
|
|
433
|
+
}
|
|
434
|
+
break;
|
|
427
435
|
case 'dueDate':
|
|
428
436
|
if (currentTab === 'draft') {
|
|
429
437
|
if (Boolean(transaction.dueDate) === true) {
|
|
@@ -526,6 +534,8 @@ const getBillListOnSort = (sortKey, sortOrder, currentTab, transactions) => {
|
|
|
526
534
|
return transaction.totalAmountInUSD?.amount ?? 0;
|
|
527
535
|
case 'paymentMethod':
|
|
528
536
|
return transaction.billPayInfo.billPaymentMethodType.name;
|
|
537
|
+
case 'invoiceNumber':
|
|
538
|
+
return transaction.documentId;
|
|
529
539
|
}
|
|
530
540
|
}, getColumnWiseSortOrder(sortOrder));
|
|
531
541
|
return [
|
|
@@ -37,7 +37,7 @@ declare const toBillTabType: (v: string) => "paid" | "pending_approval" | "sched
|
|
|
37
37
|
export type BillTab = ReturnType<typeof toBillTabType>;
|
|
38
38
|
declare const toBillsSubTabType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "offline";
|
|
39
39
|
export type BillsSubTabType = ReturnType<typeof toBillsSubTabType>;
|
|
40
|
-
declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceDate";
|
|
40
|
+
declare const toBillPaySortKeyType: (v: string) => "amount" | "status" | "name" | "dueDate" | "paymentMethod" | "invoiceNumber" | "invoiceDate";
|
|
41
41
|
export declare type BillPayViewSortKey = ReturnType<typeof toBillPaySortKeyType>;
|
|
42
42
|
export interface BillPayFilters {
|
|
43
43
|
categories: BillPayFilterCategory[];
|
|
@@ -47,6 +47,7 @@ const ALL_BILL_PAY_SORT_KEYS = [
|
|
|
47
47
|
'invoiceDate',
|
|
48
48
|
'name',
|
|
49
49
|
'paymentMethod',
|
|
50
|
+
'invoiceNumber',
|
|
50
51
|
];
|
|
51
52
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
52
53
|
const toBillPaySortKeyType = (v) => (0, stringToUnion_1.stringToUnion)(v, ALL_BILL_PAY_SORT_KEYS);
|
|
@@ -61,7 +61,7 @@ export declare const initialCreditAcc: CreditAccount;
|
|
|
61
61
|
export declare const initialDebitCardSummaries: DebitCardSummaries;
|
|
62
62
|
export declare const initialResendRevokeCardInvite: ResendRevokeCardInvite;
|
|
63
63
|
export declare const initialCreditAccountRepayment: CreditAccountRepayment;
|
|
64
|
-
export declare const toChargeCardSortKeyType: (v: string) => "status" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
|
|
64
|
+
export declare const toChargeCardSortKeyType: (v: string) => "status" | "accountType" | "owner" | "cardName" | "limit" | "department" | "cardType" | "utilisation";
|
|
65
65
|
export declare type ChargeCardViewSortKey = ReturnType<typeof toChargeCardSortKeyType>;
|
|
66
66
|
export declare const ALL_CASHBACK_SORT_KEYS: readonly ["month", "cashback"];
|
|
67
67
|
export declare const toCashbackSortKeyType: (v: string) => "month" | "cashback";
|
|
@@ -233,6 +233,8 @@ const getCardsBySortKey = (card, sortKey) => {
|
|
|
233
233
|
return card.cardName.toLowerCase();
|
|
234
234
|
case 'cardType':
|
|
235
235
|
return card.type.code;
|
|
236
|
+
case 'accountType':
|
|
237
|
+
return card.type.code.includes('credit') ? 'credit' : 'debit';
|
|
236
238
|
case 'status':
|
|
237
239
|
return card.status.code;
|
|
238
240
|
case 'utilisation':
|
|
@@ -42,6 +42,7 @@ export interface ReimbursementView extends Reimbursement {
|
|
|
42
42
|
approvers: Approvers;
|
|
43
43
|
submittedBy: User | undefined;
|
|
44
44
|
bulkSelectInfo?: RemiBulkSelectInfo;
|
|
45
|
+
createdByUser?: User;
|
|
45
46
|
}
|
|
46
47
|
export declare const getRemiList: (state: RootState, currentTimePeriod: TimePeriod, isBulkActionFeatureEnabled: boolean) => RemiListReport;
|
|
47
48
|
export declare const getApproversOrRejectors: (reimbursement: Reimbursement, entityApprovalStatusState: EntityApprovalStatusState, userState: UserState) => Approvers;
|
|
@@ -51,6 +51,7 @@ const getRemiList = (state, currentTimePeriod, isBulkActionFeatureEnabled) => {
|
|
|
51
51
|
return {
|
|
52
52
|
...reimbursement,
|
|
53
53
|
submittedBy: (0, userSelector_1.getUserByUserId)(userState, reimbursement.reimburseeUserId),
|
|
54
|
+
createdByUser: (0, userSelector_1.getUserByUserId)(userState, reimbursement.createdBy),
|
|
54
55
|
approvers: approvers,
|
|
55
56
|
};
|
|
56
57
|
});
|
|
@@ -423,6 +424,14 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
|
|
|
423
424
|
reimbursementsWithNoSortKeyValue.push(reimbursement);
|
|
424
425
|
}
|
|
425
426
|
break;
|
|
427
|
+
case 'createdBy':
|
|
428
|
+
if (reimbursement.createdByUser != null) {
|
|
429
|
+
reimbursementsWithSortKeyValue.push(reimbursement);
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
reimbursementsWithNoSortKeyValue.push(reimbursement);
|
|
433
|
+
}
|
|
434
|
+
break;
|
|
426
435
|
}
|
|
427
436
|
});
|
|
428
437
|
const getColumnWiseSortOrder = (sortOrder) => {
|
|
@@ -430,6 +439,7 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
|
|
|
430
439
|
case 'reportName':
|
|
431
440
|
case 'type':
|
|
432
441
|
case 'status':
|
|
442
|
+
case 'createdBy':
|
|
433
443
|
return sortOrder === 'ascending' ? 'asc' : 'desc';
|
|
434
444
|
default:
|
|
435
445
|
return sortOrder === 'ascending' ? 'desc' : 'asc';
|
|
@@ -449,6 +459,8 @@ const getRemiListOnSort = (sortKey, sortOrder, currentTab, reimbursements) => {
|
|
|
449
459
|
return getStatusPerTab(reimbursement);
|
|
450
460
|
case 'amount':
|
|
451
461
|
return reimbursement.amount.amount ?? 0;
|
|
462
|
+
case 'createdBy':
|
|
463
|
+
return `${reimbursement.createdByUser?.firstName ?? ''} ${reimbursement.createdByUser?.lastName ?? ''}`.toLowerCase();
|
|
452
464
|
}
|
|
453
465
|
}, getColumnWiseSortOrder(sortOrder));
|
|
454
466
|
return [
|
|
@@ -38,7 +38,7 @@ export declare const toRemiSubTabTypeStrict: (v: string) => "rejected" | "failed
|
|
|
38
38
|
export type RemiSubTabType = ReturnType<typeof toRemiSubTabType>;
|
|
39
39
|
export declare const toRemiSubTabUnderScoreType: (v: string) => "rejected" | "failed" | "ach" | "wire" | "cancelled" | "deleted" | "overdue" | "all" | "awaiting_approval" | "awaiting_my_approval" | "my_drafts" | "awaiting_all_approval";
|
|
40
40
|
export type RemiSubTabUnderScoreType = ReturnType<typeof toRemiSubTabUnderScoreType>;
|
|
41
|
-
declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "submittedOn" | "reportName";
|
|
41
|
+
declare const toReimbursementSortKeyType: (v: string) => "amount" | "status" | "type" | "createdBy" | "submittedOn" | "reportName";
|
|
42
42
|
export type ReimbursementViewSortKey = ReturnType<typeof toReimbursementSortKeyType>;
|
|
43
43
|
export interface ReimbursementFilters {
|
|
44
44
|
categories: ReimbursementFilterCategory[];
|