@zeniai/client-epic-state 5.0.66 → 5.0.67
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/chargeCard/chargeCardReducer.d.ts +2 -19
- package/lib/entity/chargeCard/chargeCardReducer.js +2 -35
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +1 -14
- package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +2 -36
- package/lib/esm/entity/chargeCard/chargeCardReducer.js +1 -34
- package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionReducer.js +1 -35
- package/lib/esm/index.js +5 -9
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -6
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -11
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -127
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -20
- package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +2 -0
- package/lib/esm/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
- package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +9 -28
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
- package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
- package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
- package/lib/index.d.ts +6 -10
- package/lib/index.js +36 -50
- package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
- package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -6
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +0 -10
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +0 -21
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -2
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -8
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -128
- package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -2
- package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -14
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -20
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -1
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +4 -1
- package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -40
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
- package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +3 -18
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +10 -29
- package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
- package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +1 -3
- package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
- package/package.json +28 -57
- package/lib/commonStateTypes/cacheOverrideFetchReducer.d.ts +0 -17
- package/lib/commonStateTypes/cacheOverrideFetchReducer.js +0 -20
- package/lib/commonStateTypes/pusherActions.d.ts +0 -11
- package/lib/commonStateTypes/pusherActions.js +0 -6
- package/lib/esm/commonStateTypes/cacheOverrideFetchReducer.js +0 -16
- package/lib/esm/commonStateTypes/pusherActions.js +0 -3
- package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +0 -17
- package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
- package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +0 -10
- package/lib/view/expenseAutomationView/types/completedSubTab.js +0 -21
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UpdateType } from '../../commonStateTypes/common';
|
|
2
2
|
import { ChargeCardState } from './chargeCard';
|
|
3
3
|
import { ChargeCardPayload } from './chargeCardPayload';
|
|
4
4
|
export declare const initialState: ChargeCardState;
|
|
5
5
|
export declare const updateChargeCards: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[chargeCards: ChargeCardPayload[], updateType?: UpdateType | undefined], ChargeCardPayload[], "chargeCard/updateChargeCards", never, {
|
|
6
6
|
updateType: UpdateType;
|
|
7
|
-
}>, updateChargeCard: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardPayload, "chargeCard/updateChargeCard">,
|
|
8
|
-
cardId: ID;
|
|
9
|
-
cardStatus: {
|
|
10
|
-
code: string;
|
|
11
|
-
name: string;
|
|
12
|
-
};
|
|
13
|
-
isLockedByAdmin: boolean | undefined;
|
|
14
|
-
}, "chargeCard/updateChargeCardStatusFromPusher">, updateChargeCardSpendingFromPusher: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
|
-
cardId: ID;
|
|
16
|
-
currencyCode: string;
|
|
17
|
-
currencySymbol: string;
|
|
18
|
-
balance?: number;
|
|
19
|
-
dailyPurchaseSpends?: number;
|
|
20
|
-
dailyWithdrawals?: number;
|
|
21
|
-
hold?: number;
|
|
22
|
-
monthlyPurchaseSpends?: number;
|
|
23
|
-
monthlyWithdrawals?: number;
|
|
24
|
-
}, "chargeCard/updateChargeCardSpendingFromPusher">, removeChargeCard: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCard/removeChargeCard">, clearAllChargeCards: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCard/clearAllChargeCards">;
|
|
7
|
+
}>, updateChargeCard: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardPayload, "chargeCard/updateChargeCard">, removeChargeCard: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCard/removeChargeCard">, clearAllChargeCards: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCard/clearAllChargeCards">;
|
|
25
8
|
declare const _default: import("redux").Reducer<ChargeCardState>;
|
|
26
9
|
export default _default;
|
|
@@ -4,11 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
var _a;
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.clearAllChargeCards = exports.removeChargeCard = exports.
|
|
7
|
+
exports.clearAllChargeCards = exports.removeChargeCard = exports.updateChargeCard = exports.updateChargeCards = exports.initialState = void 0;
|
|
8
8
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
9
9
|
const assignWith_1 = __importDefault(require("lodash/assignWith"));
|
|
10
|
-
const amount_1 = require("../../commonStateTypes/amount");
|
|
11
|
-
const chargeCard_1 = require("./chargeCard");
|
|
12
10
|
const chargeCardPayload_1 = require("./chargeCardPayload");
|
|
13
11
|
exports.initialState = {
|
|
14
12
|
chargeCardByID: {},
|
|
@@ -44,37 +42,6 @@ const chargeCard = (0, toolkit_1.createSlice)({
|
|
|
44
42
|
const latestChargeCard = (0, chargeCardPayload_1.mapChargeCardPayloadToChargeCard)(action.payload);
|
|
45
43
|
draft.chargeCardByID[latestChargeCard.id] = latestChargeCard;
|
|
46
44
|
},
|
|
47
|
-
updateChargeCardStatusFromPusher(draft, action) {
|
|
48
|
-
const { cardId, cardStatus, isLockedByAdmin } = action.payload;
|
|
49
|
-
const card = draft.chargeCardByID[cardId];
|
|
50
|
-
if (card != null) {
|
|
51
|
-
card.status = {
|
|
52
|
-
code: (0, chargeCard_1.toCardStatusCodeType)(cardStatus.code),
|
|
53
|
-
name: cardStatus.name,
|
|
54
|
-
};
|
|
55
|
-
if (isLockedByAdmin !== undefined) {
|
|
56
|
-
card.isLockedByAdmin = isLockedByAdmin;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
updateChargeCardSpendingFromPusher(draft, action) {
|
|
61
|
-
const { cardId, currencyCode, currencySymbol } = action.payload;
|
|
62
|
-
const card = draft.chargeCardByID[cardId];
|
|
63
|
-
if (card == null) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const amt = (v) => v !== undefined ? (0, amount_1.toAmount)(v, currencyCode, currencySymbol) : undefined;
|
|
67
|
-
card.balance = amt(action.payload.balance) ?? card.balance;
|
|
68
|
-
card.hold = amt(action.payload.hold) ?? card.hold;
|
|
69
|
-
card.dailyPurchaseSpends =
|
|
70
|
-
amt(action.payload.dailyPurchaseSpends) ?? card.dailyPurchaseSpends;
|
|
71
|
-
card.monthlyPurchaseSpends =
|
|
72
|
-
amt(action.payload.monthlyPurchaseSpends) ?? card.monthlyPurchaseSpends;
|
|
73
|
-
card.dailyWithdrawals =
|
|
74
|
-
amt(action.payload.dailyWithdrawals) ?? card.dailyWithdrawals;
|
|
75
|
-
card.monthlyWithdrawals =
|
|
76
|
-
amt(action.payload.monthlyWithdrawals) ?? card.monthlyWithdrawals;
|
|
77
|
-
},
|
|
78
45
|
removeChargeCard(draft, action) {
|
|
79
46
|
delete draft.chargeCardByID[action.payload];
|
|
80
47
|
},
|
|
@@ -83,5 +50,5 @@ const chargeCard = (0, toolkit_1.createSlice)({
|
|
|
83
50
|
},
|
|
84
51
|
},
|
|
85
52
|
});
|
|
86
|
-
_a = chargeCard.actions, exports.updateChargeCards = _a.updateChargeCards, exports.updateChargeCard = _a.updateChargeCard, exports.
|
|
53
|
+
_a = chargeCard.actions, exports.updateChargeCards = _a.updateChargeCards, exports.updateChargeCard = _a.updateChargeCard, exports.removeChargeCard = _a.removeChargeCard, exports.clearAllChargeCards = _a.clearAllChargeCards;
|
|
87
54
|
exports.default = chargeCard.reducer;
|
|
@@ -5,20 +5,7 @@ export declare const initialState: ChargeCardTransactionState;
|
|
|
5
5
|
export declare const updateChargeCardTransactions: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardTransactionPayload[], "chargeCardTransaction/updateChargeCardTransactions">, updateChargeCardTransaction: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardTransactionPayload, "chargeCardTransaction/updateChargeCardTransaction">, updateChargeCardTransactionAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
6
6
|
data: TransactionReceiptsPayload;
|
|
7
7
|
transactionId: ID;
|
|
8
|
-
}, "chargeCardTransaction/updateChargeCardTransactionAttachments">,
|
|
9
|
-
transactionId: ID;
|
|
10
|
-
transactionStatus: {
|
|
11
|
-
code: string;
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
}, "chargeCardTransaction/updateChargeCardTransactionStatusFromPusher">, updateChargeCardTransactionFromPusher: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
15
|
-
cardId: ID;
|
|
16
|
-
transaction: ChargeCardTransactionPayload;
|
|
17
|
-
}, "chargeCardTransaction/updateChargeCardTransactionFromPusher">, updateChargeCardTransactionReceiptFromPusher: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
18
|
-
attachmentFilePaths: string[];
|
|
19
|
-
cardId: ID;
|
|
20
|
-
transactionId: ID;
|
|
21
|
-
}, "chargeCardTransaction/updateChargeCardTransactionReceiptFromPusher">, removeChargeCardTransaction: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardTransaction/removeChargeCardTransaction">, removeChargeCardTransactionAttachmentByThirdPartyTransactionId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
8
|
+
}, "chargeCardTransaction/updateChargeCardTransactionAttachments">, removeChargeCardTransaction: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardTransaction/removeChargeCardTransaction">, removeChargeCardTransactionAttachmentByThirdPartyTransactionId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
22
9
|
attachmentFileName: string;
|
|
23
10
|
thirdPartyTransactionId: ID;
|
|
24
11
|
}, "chargeCardTransaction/removeChargeCardTransactionAttachmentByThirdPartyTransactionId">, clearAllChargeCardTransactions: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardTransaction/clearAllChargeCardTransactions">;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearAllChargeCardTransactions = exports.removeChargeCardTransactionAttachmentByThirdPartyTransactionId = exports.removeChargeCardTransaction = exports.
|
|
4
|
+
exports.clearAllChargeCardTransactions = exports.removeChargeCardTransactionAttachmentByThirdPartyTransactionId = exports.removeChargeCardTransaction = exports.updateChargeCardTransactionAttachments = exports.updateChargeCardTransaction = exports.updateChargeCardTransactions = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
-
const chargeCardTransaction_1 = require("./chargeCardTransaction");
|
|
7
6
|
const chargeCardTransactionPayload_1 = require("./chargeCardTransactionPayload");
|
|
8
|
-
const pusherActions_1 = require("../../commonStateTypes/pusherActions");
|
|
9
7
|
exports.initialState = {
|
|
10
8
|
chargeCardTransactionById: {},
|
|
11
9
|
};
|
|
@@ -52,42 +50,10 @@ const chargeCardTransaction = (0, toolkit_1.createSlice)({
|
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
},
|
|
55
|
-
updateChargeCardTransactionStatusFromPusher(draft, action) {
|
|
56
|
-
const { transactionId, transactionStatus } = action.payload;
|
|
57
|
-
const transaction = draft.chargeCardTransactionById[transactionId];
|
|
58
|
-
if (transaction != null) {
|
|
59
|
-
transaction.transactionStatus = {
|
|
60
|
-
code: (0, chargeCardTransaction_1.toCardTransactionStatusCode)(transactionStatus.code),
|
|
61
|
-
name: transactionStatus.name,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
updateChargeCardTransactionFromPusher(draft, action) {
|
|
66
|
-
const entity = (0, chargeCardTransactionPayload_1.toChargeCardTransaction)(action.payload.transaction);
|
|
67
|
-
draft.chargeCardTransactionById[entity.id] = entity;
|
|
68
|
-
},
|
|
69
|
-
updateChargeCardTransactionReceiptFromPusher(draft, action) {
|
|
70
|
-
const { transactionId, attachmentFilePaths } = action.payload;
|
|
71
|
-
const transaction = draft.chargeCardTransactionById[transactionId];
|
|
72
|
-
if (transaction != null) {
|
|
73
|
-
transaction.attachmentFilePaths = attachmentFilePaths;
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
53
|
clearAllChargeCardTransactions(draft) {
|
|
77
54
|
draft.chargeCardTransactionById = {};
|
|
78
55
|
},
|
|
79
56
|
},
|
|
80
|
-
extraReducers: (builder) => {
|
|
81
|
-
builder
|
|
82
|
-
.addCase(pusherActions_1.addChargeCardTransactionFromPusher, (draft, action) => {
|
|
83
|
-
const entity = (0, chargeCardTransactionPayload_1.toChargeCardTransaction)(action.payload.transaction);
|
|
84
|
-
draft.chargeCardTransactionById[entity.id] = entity;
|
|
85
|
-
})
|
|
86
|
-
.addCase(pusherActions_1.addDeclinedChargeCardTransactionFromPusher, (draft, action) => {
|
|
87
|
-
const entity = (0, chargeCardTransactionPayload_1.toChargeCardTransaction)(action.payload.transaction);
|
|
88
|
-
draft.chargeCardTransactionById[entity.id] = entity;
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
57
|
});
|
|
92
|
-
_a = chargeCardTransaction.actions, exports.updateChargeCardTransactions = _a.updateChargeCardTransactions, exports.updateChargeCardTransaction = _a.updateChargeCardTransaction, exports.updateChargeCardTransactionAttachments = _a.updateChargeCardTransactionAttachments, exports.
|
|
58
|
+
_a = chargeCardTransaction.actions, exports.updateChargeCardTransactions = _a.updateChargeCardTransactions, exports.updateChargeCardTransaction = _a.updateChargeCardTransaction, exports.updateChargeCardTransactionAttachments = _a.updateChargeCardTransactionAttachments, exports.removeChargeCardTransaction = _a.removeChargeCardTransaction, exports.removeChargeCardTransactionAttachmentByThirdPartyTransactionId = _a.removeChargeCardTransactionAttachmentByThirdPartyTransactionId, exports.clearAllChargeCardTransactions = _a.clearAllChargeCardTransactions;
|
|
93
59
|
exports.default = chargeCardTransaction.reducer;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { createSlice } from '@reduxjs/toolkit';
|
|
2
2
|
import assignWith from 'lodash/assignWith';
|
|
3
|
-
import { toAmount } from '../../commonStateTypes/amount';
|
|
4
|
-
import { toCardStatusCodeType } from './chargeCard';
|
|
5
3
|
import { mapChargeCardPayloadToChargeCard, } from './chargeCardPayload';
|
|
6
4
|
export const initialState = {
|
|
7
5
|
chargeCardByID: {},
|
|
@@ -37,37 +35,6 @@ const chargeCard = createSlice({
|
|
|
37
35
|
const latestChargeCard = mapChargeCardPayloadToChargeCard(action.payload);
|
|
38
36
|
draft.chargeCardByID[latestChargeCard.id] = latestChargeCard;
|
|
39
37
|
},
|
|
40
|
-
updateChargeCardStatusFromPusher(draft, action) {
|
|
41
|
-
const { cardId, cardStatus, isLockedByAdmin } = action.payload;
|
|
42
|
-
const card = draft.chargeCardByID[cardId];
|
|
43
|
-
if (card != null) {
|
|
44
|
-
card.status = {
|
|
45
|
-
code: toCardStatusCodeType(cardStatus.code),
|
|
46
|
-
name: cardStatus.name,
|
|
47
|
-
};
|
|
48
|
-
if (isLockedByAdmin !== undefined) {
|
|
49
|
-
card.isLockedByAdmin = isLockedByAdmin;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
updateChargeCardSpendingFromPusher(draft, action) {
|
|
54
|
-
const { cardId, currencyCode, currencySymbol } = action.payload;
|
|
55
|
-
const card = draft.chargeCardByID[cardId];
|
|
56
|
-
if (card == null) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const amt = (v) => v !== undefined ? toAmount(v, currencyCode, currencySymbol) : undefined;
|
|
60
|
-
card.balance = amt(action.payload.balance) ?? card.balance;
|
|
61
|
-
card.hold = amt(action.payload.hold) ?? card.hold;
|
|
62
|
-
card.dailyPurchaseSpends =
|
|
63
|
-
amt(action.payload.dailyPurchaseSpends) ?? card.dailyPurchaseSpends;
|
|
64
|
-
card.monthlyPurchaseSpends =
|
|
65
|
-
amt(action.payload.monthlyPurchaseSpends) ?? card.monthlyPurchaseSpends;
|
|
66
|
-
card.dailyWithdrawals =
|
|
67
|
-
amt(action.payload.dailyWithdrawals) ?? card.dailyWithdrawals;
|
|
68
|
-
card.monthlyWithdrawals =
|
|
69
|
-
amt(action.payload.monthlyWithdrawals) ?? card.monthlyWithdrawals;
|
|
70
|
-
},
|
|
71
38
|
removeChargeCard(draft, action) {
|
|
72
39
|
delete draft.chargeCardByID[action.payload];
|
|
73
40
|
},
|
|
@@ -76,5 +43,5 @@ const chargeCard = createSlice({
|
|
|
76
43
|
},
|
|
77
44
|
},
|
|
78
45
|
});
|
|
79
|
-
export const { updateChargeCards, updateChargeCard,
|
|
46
|
+
export const { updateChargeCards, updateChargeCard, removeChargeCard, clearAllChargeCards, } = chargeCard.actions;
|
|
80
47
|
export default chargeCard.reducer;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { createSlice } from '@reduxjs/toolkit';
|
|
2
|
-
import { toCardTransactionStatusCode, } from './chargeCardTransaction';
|
|
3
2
|
import { toChargeCardTransaction, } from './chargeCardTransactionPayload';
|
|
4
|
-
import { addChargeCardTransactionFromPusher, addDeclinedChargeCardTransactionFromPusher } from '../../commonStateTypes/pusherActions';
|
|
5
3
|
export const initialState = {
|
|
6
4
|
chargeCardTransactionById: {},
|
|
7
5
|
};
|
|
@@ -48,42 +46,10 @@ const chargeCardTransaction = createSlice({
|
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
},
|
|
51
|
-
updateChargeCardTransactionStatusFromPusher(draft, action) {
|
|
52
|
-
const { transactionId, transactionStatus } = action.payload;
|
|
53
|
-
const transaction = draft.chargeCardTransactionById[transactionId];
|
|
54
|
-
if (transaction != null) {
|
|
55
|
-
transaction.transactionStatus = {
|
|
56
|
-
code: toCardTransactionStatusCode(transactionStatus.code),
|
|
57
|
-
name: transactionStatus.name,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
updateChargeCardTransactionFromPusher(draft, action) {
|
|
62
|
-
const entity = toChargeCardTransaction(action.payload.transaction);
|
|
63
|
-
draft.chargeCardTransactionById[entity.id] = entity;
|
|
64
|
-
},
|
|
65
|
-
updateChargeCardTransactionReceiptFromPusher(draft, action) {
|
|
66
|
-
const { transactionId, attachmentFilePaths } = action.payload;
|
|
67
|
-
const transaction = draft.chargeCardTransactionById[transactionId];
|
|
68
|
-
if (transaction != null) {
|
|
69
|
-
transaction.attachmentFilePaths = attachmentFilePaths;
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
49
|
clearAllChargeCardTransactions(draft) {
|
|
73
50
|
draft.chargeCardTransactionById = {};
|
|
74
51
|
},
|
|
75
52
|
},
|
|
76
|
-
extraReducers: (builder) => {
|
|
77
|
-
builder
|
|
78
|
-
.addCase(addChargeCardTransactionFromPusher, (draft, action) => {
|
|
79
|
-
const entity = toChargeCardTransaction(action.payload.transaction);
|
|
80
|
-
draft.chargeCardTransactionById[entity.id] = entity;
|
|
81
|
-
})
|
|
82
|
-
.addCase(addDeclinedChargeCardTransactionFromPusher, (draft, action) => {
|
|
83
|
-
const entity = toChargeCardTransaction(action.payload.transaction);
|
|
84
|
-
draft.chargeCardTransactionById[entity.id] = entity;
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
53
|
});
|
|
88
|
-
export const { updateChargeCardTransactions, updateChargeCardTransaction, updateChargeCardTransactionAttachments,
|
|
54
|
+
export const { updateChargeCardTransactions, updateChargeCardTransaction, updateChargeCardTransactionAttachments, removeChargeCardTransaction, removeChargeCardTransactionAttachmentByThirdPartyTransactionId, clearAllChargeCardTransactions, } = chargeCardTransaction.actions;
|
|
89
55
|
export default chargeCardTransaction.reducer;
|
package/lib/esm/index.js
CHANGED
|
@@ -37,9 +37,6 @@ import { toCardAddressType, toCardType, toCreditLimitFrequencyCodeType, toShippi
|
|
|
37
37
|
import { getChargeCardById } from './entity/chargeCard/chargeCardSelector';
|
|
38
38
|
import { attachmentFilePathToAttachment, } from './entity/chargeCardTransaction/chargeCardTransactionPayload';
|
|
39
39
|
import { updateChargeCardTransactionAttachments } from './entity/chargeCardTransaction/chargeCardTransactionReducer';
|
|
40
|
-
import { updateChargeCardStatusFromPusher, updateChargeCardSpendingFromPusher, } from './entity/chargeCard/chargeCardReducer';
|
|
41
|
-
import { updateChargeCardTransactionStatusFromPusher, updateChargeCardTransactionFromPusher, updateChargeCardTransactionReceiptFromPusher, } from './entity/chargeCardTransaction/chargeCardTransactionReducer';
|
|
42
|
-
import { addChargeCardTransactionFromPusher, addDeclinedChargeCardTransactionFromPusher, } from './commonStateTypes/pusherActions';
|
|
43
40
|
import { getControllersName, getFirstControllerEmail, getFirstControllerId, } from './entity/company/companyHelper';
|
|
44
41
|
import { getCompanyByCompanyId, getCompanyInfoForAllCockpitCompaniesInState, getControllersForCompany, } from './entity/company/companySelector';
|
|
45
42
|
import { ALL_ACCOUNTING_CONNECTION_CREATION_MODES, isCompanyEligibleForTreasury, } from './entity/company/companyStateTypes';
|
|
@@ -170,13 +167,12 @@ import { clearExpenseAutomationFluxAnalysisView, fetchFluxAnalysisView, reviewFl
|
|
|
170
167
|
import { clearJeScheduleLocalData as clearExpenseAutomationJEScheduleLocalData, clearExpenseAutomationJESchedulesView, fetchJeSchedulesPage as fetchExpenseAutomationJESchedulesPage, ignoreRecommendedJeSchedule as ignoreExpenseAutomationJESchedule, initializeAccountSettingsView as initializeJeAccountSettingsView, initializeJeScheduleLocalData, removeJeScheduleTransactionKey, retryJeSchedule as retryExpenseAutomationJESchedule, saveAccountSettings as saveJeAccountSettings, saveAccountSettingsLocalData as saveJeAccountSettingsLocalData, updateJESchedulesUIState as updateExpenseAutomationJESchedulesUIState, updateJeScheduleLocalDataById, updateJeScheduleTransactionKeys, } from './view/expenseAutomationView/reducers/jeSchedulesViewReducer';
|
|
171
168
|
import { acknowledgeBulkUploadConfirmMatchComplete, bulkUploadAutomatchingTimedOut, bulkUploadReceipts, bulkUploadReceiptsFailure, bulkUploadReceiptsSuccess, clearBulkUpload, clearManualSearchResults, clearMissingReceiptsTabNavigation, confirmBulkUploadMatch, confirmBulkUploadMatchFailure, confirmBulkUploadMatchSuccess, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsFailure, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatches, fetchBulkUploadBatchesFailure, fetchBulkUploadBatchesSuccess, fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess, fetchMissingReceipts as fetchExpenseAutomationMissingReceipts, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, markMissingReceiptAsDone as markExpenseAutomationMissingReceiptAsDone, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess, setBulkUploadCompletedSubTab, setBulkUploadResultsTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, storeBatchDetails, updateBulkUploadProgress, updateMissingReceiptUploadState as updateExpenseAutomationMissingReceiptUploadState, updateMissingReceiptsUIState as updateExpenseAutomationMissingReceiptsUIState, uploadMissingReceiptSuccess as uploadExpenseAutomationMissingReceiptSuccess, } from './view/expenseAutomationView/reducers/missingReceiptsViewReducer';
|
|
172
169
|
import { deleteAccountStatement, excludeAccountFromReconciliation, fetchReconciliation as fetchReconciliationView, includeAccountInReconciliation, saveReconciliationDetail as saveExpenseAutomationReconciliationDetail, saveReconciliationReview as saveExpenseAutomationReconciliationReview, setConnectionInProgressForAccount as setConnectionInProgressForAccountReconciliation, setStatementParseInProgress, updateAccountReconciliationLocalData as updateExpenseAutomationAccountReconciliationLocalData, updateSelectedAccountId as updateExpenseAutomationAccountReconciliationSelectedAccountId, updateSelectedTab as updateExpenseAutomationAccountReconciliationSelectedTab, updateReconListScrollPosition as updateExpenseAutomationReconListScrollPosition, updateReviewTabSortState as updateExpenseAutomationReconReviewTabListSortState, updateReviewTabLocalData as updateExpenseAutomationReconReviewTabLocalData, updateReconcileTabListScrollState as updateExpenseAutomationReconcileTabListScrollState, updateReconcileTabListSortState as updateExpenseAutomationReconcileTabListSortState, updateReconcileTabLocalData as updateExpenseAutomationReconcileTabLocalData, updateSelectedDrawerAccountId as updateExpenseAutomationSelectedDrawerAccountId, updateNodeCollapseState, updateStatementUploadChosen, uploadAccountStatement, } from './view/expenseAutomationView/reducers/reconciliationViewReducer';
|
|
173
|
-
import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markTransactionAsNotMiscategorized, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab,
|
|
170
|
+
import { backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationView, initializeTransactionCategorizationViewLocalData, markTransactionAsNotMiscategorized, saveTransactionCategorization, saveTransactionCategorizationLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, setEntityRecommendationForLineIdsForCategorization, syncTransactionCategorizationFromDetailSave, updateCurrentSelectedTransactionCategorizationTab, updateSelectedCheckboxTransactionIds, updateSelectedCustomerForTransaction, updateSelectedTransactionId, updateSelectedVendorForTransaction, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, updateTransactionCategorizationUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, } from './view/expenseAutomationView/reducers/transactionsViewReducer';
|
|
174
171
|
import { getExpenseAutomationFluxAnalysisView } from './view/expenseAutomationView/selectors/fluxAnalysisViewSelector';
|
|
175
172
|
import { getExpenseAutomationReconciliationView, isAccountReconReport, } from './view/expenseAutomationView/selectors/reconciliationViewSelector';
|
|
176
173
|
import { getExpenseAutomationTransactionView } from './view/expenseAutomationView/selectors/transactionCategorizationSelector';
|
|
177
174
|
import { toJEScheduleMainTab as toExpenseAutomationJEScheduleMainTab, toJEScheduleSortKey as toExpenseAutomationJEScheduleSortKey, } from './view/expenseAutomationView/types/jeSchedulesViewState';
|
|
178
|
-
import { BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toMatchSource, toMissingReceiptsTab, } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
179
|
-
import { DEFAULT_COMPLETED_SUB_TAB, toCompletedSubTab, } from './view/expenseAutomationView/types/completedSubTab';
|
|
175
|
+
import { BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab, } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
180
176
|
import { toMissingReceiptsSortKey as toExpenseAutomationMissingReceiptsSortKey, } from './view/expenseAutomationView/types/missingReceiptsViewState';
|
|
181
177
|
import { toReconciliationTabsType, } from './view/expenseAutomationView/types/reconciliationViewState';
|
|
182
178
|
import { toTransactionsTabKey as toExpenseAutomationTransactionsTabKey, toTransactionsSortKey, } from './view/expenseAutomationView/types/transactionsViewState';
|
|
@@ -299,7 +295,7 @@ import { fetchChargeCardConfig } from './view/spendManagement/chargeCards/charge
|
|
|
299
295
|
import { closeChargeCard, completeCVVActivationWait, completeDebitCardSetPinWait, fetchChargeCardDetail, fetchChargeCardDetailPage, fetchChargeCardTransactionAttachments, fetchChargeCardTransactionList, fetchChargeCardTransactionStatistics, fetchChargeCardsRecurringExpenses, fetchDepositAccountLimit, lockChargeCard, startCVVActivationWait, startDebitCardSetPinWait, unlockChargeCard, updateChargeCardDetail, updateChargeCardName, updateChargeCardSpendLimit, updateChargeCardSpendLimitSuccessOrFailure, updateChargeCardTransactionIsViewReceiptClicked, updateChargeCardTransactionReceiptsShowTickFetchStatus, updateChargeCardTransactionUploadReceiptsFetchStatus, updateDebitCardPinAttempt, updatePhysicalChargeCardAttempt, } from './view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer';
|
|
300
296
|
import { getChargeCardCVVActivateView, getChargeCardControlDetailView, getChargeCardDetailView, getChargeCardRecurringExpensesView, getChargeCardTransactionAttachmentView, getDebitCardSetPinView, getDepositAccountLimitFetchStateByDepositAccountId, } from './view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailSelector';
|
|
301
297
|
import { toChargeCardSortKeyType, } from './view/spendManagement/chargeCards/chargeCardList/chargeCardList';
|
|
302
|
-
import { closeChargeCards, fetchChargeCardList, fetchChargeCardListPage, fetchCreditAccount, fetchCreditAccountRepayment, fetchDebitCardSummary, lockChargeCards, resendCardInvite, revokeCardInvite, revokeChargeCardsInvite, unlockChargeCards, updateBulkActionCardIds, updateSearchText as updateChargeCardListSearchText, updateChargeCardListUIState, updateChargeCardsSpendLimit,
|
|
298
|
+
import { closeChargeCards, fetchChargeCardList, fetchChargeCardListPage, fetchCreditAccount, fetchCreditAccountRepayment, fetchDebitCardSummary, lockChargeCards, resendCardInvite, revokeCardInvite, revokeChargeCardsInvite, unlockChargeCards, updateBulkActionCardIds, updateSearchText as updateChargeCardListSearchText, updateChargeCardListUIState, updateChargeCardsSpendLimit, updateRowActionCardId, } from './view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer';
|
|
303
299
|
import { anyCardOnHold, getChargeCardBulkActionView, getChargeCardListView, getChargeCardRecurringExpensesByCardIds, getChargeCardRowActionView, getCreditAccountDetails, getDebitCardList, getDebitCardSummary, getDepositAccountListWithDebitCardIssued, getMyPendingActivationChargeCardListView, getMyRequestOnHoldChargeCardListWithShippingAddress, } from './view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector';
|
|
304
300
|
import { PAYMENT_HISTORY_FILTER_CATEGORIES, } from './view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistory';
|
|
305
301
|
import { getChargeCardPaymentHistoryDownloadReport, } from './view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryDownloadSelector';
|
|
@@ -445,7 +441,7 @@ export { stringToUnion, stringToUnionStrict };
|
|
|
445
441
|
export { fetchMonthEndCloseChecks, fetchMonthClosePerformanceTrend, getMonthEndCloseChecksViewByTenantId, ALL_MONTH_END_CLOSE_CHECKS_FREQUENCY, };
|
|
446
442
|
export {
|
|
447
443
|
// Bulk Upload Types
|
|
448
|
-
BATCH_FILE_STATUSES, isUnmatchedTabFileStatus,
|
|
444
|
+
BATCH_FILE_STATUSES, isUnmatchedTabFileStatus, toBatchFileStatus, toBatchStatusValue, toBulkUploadPhase, toBulkUploadResultsTab, toBulkUploadSortKey, toCompletedSubTab, toMatchSource, toMissingReceiptsTab, toExpenseAutomationJEScheduleMainTab, toExpenseAutomationJEScheduleSortKey, getExpenseAutomationView, toExpenseAutomationMissingReceiptsSortKey, toExpenseAutomationTransactionsTabKey, toExpenseAutomationViewType, uploadExpenseAutomationMissingReceiptSuccess, markExpenseAutomationMissingReceiptAsDone, fetchAllExpenseAutomationTabs, refreshExpenseAutomationCurrentTab, updateCurrentSelectedTransactionCategorizationTab, fetchExpenseAutomationMissingReceipts,
|
|
449
445
|
// Bulk Upload Actions
|
|
450
446
|
bulkUploadReceipts, bulkUploadAutomatchingTimedOut, bulkUploadReceiptsSuccess, bulkUploadReceiptsFailure, restoreBulkUploadAutomatchingOnMount, restoreBulkUploadMatchingState, updateBulkUploadProgress, pusherBatchStatusUpdate, requestMissingReceiptsTabNavigation, clearMissingReceiptsTabNavigation, fetchBulkUploadBatchDetails, fetchBulkUploadBatchDetailsSuccess, fetchBulkUploadBatchDetailsFailure, storeBatchDetails, fetchMoreBatchDetails, fetchMoreBatchDetailsComplete, fetchMoreBatchDetailsFailure, fetchBulkUploadBatches, fetchBulkUploadBatchesSuccess, fetchBulkUploadBatchesFailure, confirmBulkUploadMatch, confirmBulkUploadMatchSuccess, confirmBulkUploadMatchFailure, setBulkUploadResultsTab, setBulkUploadCompletedSubTab, setBulkUploadSortConfig, setBulkUploadUploadedFileCount, clearBulkUpload, searchTransactionsForManualMatch, searchTransactionsForManualMatchSuccess, searchTransactionsForManualMatchFailure, clearManualSearchResults, acknowledgeBulkUploadConfirmMatchComplete, fetchCompletedTransactions, fetchCompletedTransactionsSuccess, fetchCompletedTransactionsFailure, fetchFluxAnalysisView, clearExpenseAutomationFluxAnalysisView, updateOperatingExpensesIdsForReview as updateFluxOperatingExpensesIdsForReview, updateSelectedSectionIdsForReview as updateFluxAnalysisSelectedSectionIdsForReview, reviewFluxAnalysisView, updateExpenseAutomationMissingReceiptUploadState, updateExpenseAutomationMissingReceiptsUIState, updateTransactionCategorizationUploadReceiptState, uploadTransactionCategorizationReceiptSuccess, getExpenseAutomationFluxAnalysisView, updateCurrentSelectedView, updateCurrentSelectedPeriod, getExpenseAutomationTransactionView, updateFluxAnalysisViewUIState, updateFluxAnalysisViewPageMetaData, MAX_SELECTION_LIMIT, checkIfAllLineItemsAreCategoryClassFilled, getLineItemsByTransactionIdsFromLocalData, isAnyItemWithUncategorizedExpenseAccount, excludeAccountFromReconciliation, includeAccountInReconciliation, saveExpenseAutomationReconciliationDetail, updateExpenseAutomationReconcileTabListScrollState, updateExpenseAutomationReconReviewTabListSortState, updateExpenseAutomationReconcileTabListSortState, updateExpenseAutomationReconcileTabLocalData, updateExpenseAutomationAccountReconciliationSelectedTab, updateExpenseAutomationAccountReconciliationSelectedAccountId, getExpenseAutomationReconciliationView, fetchReconciliationView, uploadAccountStatementIntoDocumentAI, updateExpenseAutomationReconListScrollPosition, setConnectionInProgressForAccountReconciliation, getAccountReconByAccountIdAndSelectedPeriod, toReconciliationTabsType, isAccountReconReport, updateExpenseAutomationReconReviewTabLocalData, updateExpenseAutomationSelectedDrawerAccountId, saveExpenseAutomationReconciliationReview, updateExpenseAutomationAccountReconciliationLocalData, toReconciliationAccountSource, deleteAccountStatement, uploadAccountStatement, updateNodeCollapseState, updateStatementUploadChosen, isReviewTransactionBankTransferType, isReviewTransactionBillPaymentType, isReviewTransactionCreditCardPaymentType, isReviewTransactionDepositType, isReviewTransactionExpenseType, isReviewTransactionCreditCardCreditType, setStatementParseInProgress, };
|
|
451
447
|
export { fetchTransactionCategorization, fetchTransactionCategorizationView, updateTransactionCategorizationUIState, updateSelectedCheckboxTransactionIds, setEntityRecommendationForLineIdsForCategorization, initializeTransactionCategorizationViewLocalData, setAllItemsToCategoryClassInLocalDataForCategorization, saveTransactionCategorizationLocalData, fetchTransactionCategorizationFailure, saveTransactionCategorization, updateTransactionCategorization, updateTransactionCategorizationSaveStatus, markTransactionAsNotMiscategorized, updateSelectedVendorForTransaction, updateSelectedCustomerForTransaction, updateSelectedTransactionId, syncTransactionCategorizationFromDetailSave, backgroundRefetchReviewTab, clearExpenseAutomationTransactionsView, toTransactionsSortKey, };
|
|
@@ -600,7 +596,7 @@ export { fetchUserRoleConfig, getUserRoleConfig };
|
|
|
600
596
|
export { getCompanyHealthMetricConfig, fetchCompanyHealthMetricConfig, };
|
|
601
597
|
export { updateCompaniesHealth, updateCompanyHealth, };
|
|
602
598
|
export { clearCompanyHealthMetricView, fetchCompanyHealthMetricView, initializeCompanyHealthMetricViewLocalData, removeSelectedCompanyId, saveCompanyHealthMetricById, updateCompanyHealthMetricLocalStore, updateCompanyHealthMetricViewErrorStatus, updateCompanyHealthMetricViewSuccessStatus, updateCompanyHealthViewUIState, };
|
|
603
|
-
export { updateChargeCardTransactionAttachments,
|
|
599
|
+
export { updateChargeCardTransactionAttachments, attachmentFilePathToAttachment, isCompanyRunwayInfinite, getCompanyHealthMetricView, hasCompanyHealthMetricFormFieldChanged, companyHealthMetricDropDownOptions, getChargeCardBusinessVerificationDetails, fetchDebitCardSummary, fetchChargeCardList, fetchChargeCardListPage, fetchChargeCardConfig, fetchCreditAccount, fetchCreditAccountRepayment, getChargeCardListView, getMyPendingActivationChargeCardListView, getMyRequestOnHoldChargeCardListWithShippingAddress, clearChargeCardRepaymentDetail, fetchChargeCardRepaymentDetail, initiateChargeCardRepayment, updateChargeCardRepaymentLocalStore, getChargeCardRepaymentDetail, fetchChargeCardPaymentPage, fetchChargeCardPaymentHistory, updatePaymentHistoryDownloadUIState, updatePaymentHistoryFilters, updatePaymentHistorySearchText, updatePaymentHistoryUIState, getChargeCardPaymentHistoryDownloadReport, getChargeCardPaymentHistoryView, getPaymentHistorySourceAccountName, getPaymentStatusDisplayText, PAYMENT_HISTORY_FILTER_CATEGORIES, getCreditAccountDetails, fetchChargeCardDetailPage, fetchChargeCardDetail, fetchChargeCardTransactionStatistics, fetchDepositAccountLimit, getChargeCardDetailView, getChargeCardControlDetailView, getDepositAccountLimitFetchStateByDepositAccountId, getChargeCardTransactionAttachmentView, getDebitCardSetPinView, getChargeCardRecurringExpensesByCardIds, getChargeCardRecurringExpensesView, getChargeCardRowActionView, getChargeCardBulkActionView, getChargeCardCVVActivateView, fetchChargeCardTransactionList, fetchCashbackDetail, toChargeCardSortKeyType, getCashbackDetail, getZeniDateFromPeriod, toCreditLimitFrequencyCodeType, getDepositAccountListWithDebitCardIssued, getIssueChargeCardView, getChargeCardSetupViewDetails, fetchChargeCardStatementList, getChargeCardStatements, fetchChargeCardSetupView, enableChargeCardAutoPay, acceptChargeCardTerms, expressInterestInChargeCard, getDepositAccountLimitForChargeCardByDepositAccountId, toCardAddressType, toShippingAddressType, toCardType, issueChargeCards, fetchIssueCardPage, fetchDepositAccountListForCards, getDebitCardList, getDebitCardSummary, updateCustomAddressId, updateChargeCardsLocalStore, resetIssueChargeCardForm, updateBulkActionCardIds, updateChargeCardListSearchText, updateChargeCardListUIState, updateCashbackDetailUIState, updateChargeCardDetail, updatePhysicalChargeCardAttempt, lockChargeCard, unlockChargeCard, closeChargeCard, updateChargeCardName, getCardUserOnboardingView, initializeCardUserOnboardingLocalData, updateCardUserOnboardingLocalData, saveCardOnboardingUserDetails, updateChargeCardTransactionUploadReceiptsFetchStatus, completeDebitCardSetPinWait, startDebitCardSetPinWait, updateDebitCardPinAttempt, updateChargeCardTransactionReceiptsShowTickFetchStatus, updateChargeCardTransactionIsViewReceiptClicked, fetchChargeCardTransactionAttachments, completeCVVActivationWait, startCVVActivationWait, updateChargeCardSpendLimit, updateChargeCardSpendLimitSuccessOrFailure, resendCardInvite, revokeCardInvite, updateRowActionCardId, revokeChargeCardsInvite, lockChargeCards, unlockChargeCards, closeChargeCards, updateChargeCardsSpendLimit, fetchChargeCardsRecurringExpenses, startCardUserOnboardingActivationWait, completeCardUserOnboardingActivationWait, setFirstViewAfterActivation, setFirstViewCompleteAfterActivation, setCurrentDisplayedCardId, getChargeCardById, anyCardOnHold, };
|
|
604
600
|
export { TIME_SERIES_DURATIONS, convertToTimeSeriesSelectionRange, toTimeSeriesDuration, fetchAggregatedReport, aggregatedReportView, };
|
|
605
601
|
export { fetchApAging, getApAgingReport, updateApAgingUIState, };
|
|
606
602
|
export { fetchApAgingDetail, getApAgingDetailForVendor, updateApAgingDetailUIState, };
|
package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js
CHANGED
|
@@ -5,7 +5,6 @@ import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
|
5
5
|
import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
6
6
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
7
7
|
import { fetchCompletedTransactions, fetchCompletedTransactionsFailure, fetchCompletedTransactionsSuccess, getCompletedTransactionsCacheKey, } from '../../reducers/missingReceiptsViewReducer';
|
|
8
|
-
import { DEFAULT_COMPLETED_SUB_TAB } from '../../types/completedSubTab';
|
|
9
8
|
export const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchCompletedTransactions.match), switchMap((action) => {
|
|
10
9
|
const state = state$.value;
|
|
11
10
|
const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationMissingReceiptsViewState: { bulkUpload }, } = state;
|
|
@@ -40,7 +39,7 @@ export const fetchCompletedTransactionsEpic = (actions$, state$, zeniAPI) => act
|
|
|
40
39
|
if (sortOrder != null) {
|
|
41
40
|
queryPayload.sort_order = sortOrder === 'ascending' ? 'asc' : 'desc';
|
|
42
41
|
}
|
|
43
|
-
if (completedSubTab !==
|
|
42
|
+
if (completedSubTab !== 'all') {
|
|
44
43
|
queryPayload.match_type = completedSubTab;
|
|
45
44
|
}
|
|
46
45
|
const encodedQuery = encodeURIComponent(JSON.stringify(queryPayload));
|
|
@@ -4,7 +4,6 @@ import { updateTransactions } from '../../../../entity/transaction/transactionRe
|
|
|
4
4
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
5
5
|
import { supportedTransactionPayloadToManualSearchResult } from '../../payload/missingReceiptsPayload';
|
|
6
6
|
import { searchTransactionsForManualMatch, searchTransactionsForManualMatchFailure, searchTransactionsForManualMatchSuccess, } from '../../reducers/missingReceiptsViewReducer';
|
|
7
|
-
import { DEFAULT_COMPLETED_SUB_TAB } from '../../types/completedSubTab';
|
|
8
7
|
import { toTransactionsSortKey } from '../../types/transactionsViewState';
|
|
9
8
|
import { rollingCalendarDateRangeInclusive } from '../../helpers/rollingCalendarDateRangeInclusive';
|
|
10
9
|
/**
|
|
@@ -47,11 +46,6 @@ export const searchTransactionsForManualMatchEpic = (actions$, state$, zeniAPI)
|
|
|
47
46
|
page_token: pageToken ?? null,
|
|
48
47
|
page_size: manualSearch.pageSize,
|
|
49
48
|
search_text: query,
|
|
50
|
-
// Manual search ignores the Completed sub-tab axis — always span the
|
|
51
|
-
// default sentinel so the receipt-matching UX returns results
|
|
52
|
-
// regardless of where the transaction would otherwise be bucketed on
|
|
53
|
-
// the Completed tab.
|
|
54
|
-
sub_tab: DEFAULT_COMPLETED_SUB_TAB,
|
|
55
49
|
};
|
|
56
50
|
return zeniAPI
|
|
57
51
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
@@ -5,8 +5,7 @@ import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
|
5
5
|
import { updateTransactions } from '../../../../entity/transaction/transactionReducer';
|
|
6
6
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
7
7
|
import { getLineItemsByTransactionsIdsFromResponse } from '../../helpers/transactionCategorizationLocalDataHelper';
|
|
8
|
-
import { fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationSuccess, initializeTransactionCategorizationViewLocalData, resetOtherTabsFetchState,
|
|
9
|
-
import { DEFAULT_COMPLETED_SUB_TAB } from '../../types/completedSubTab';
|
|
8
|
+
import { fetchTransactionCategorization, fetchTransactionCategorizationFailure, fetchTransactionCategorizationSuccess, initializeTransactionCategorizationViewLocalData, resetOtherTabsFetchState, updateTotalCountForTransactionCategorization, updateTransactionCategorizationUIState, } from '../../reducers/transactionsViewReducer';
|
|
10
9
|
import { TRANSACTIONS_TABS, toTransactionsSortKey, } from '../../types/transactionsViewState';
|
|
11
10
|
export const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchTransactionCategorization.match), switchMap((action) => {
|
|
12
11
|
const { expenseAutomationViewState: { selectedPeriodByTenantId }, expenseAutomationTransactionsViewState, } = state$.value;
|
|
@@ -24,9 +23,6 @@ export const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) =>
|
|
|
24
23
|
page_token: pageToken,
|
|
25
24
|
page_size: 25,
|
|
26
25
|
search_text: uiState.searchString,
|
|
27
|
-
sub_tab: selectedTab === 'autoCategorized'
|
|
28
|
-
? expenseAutomationTransactionsViewState.selectedTransactionCategorizationCompletedSubTab
|
|
29
|
-
: DEFAULT_COMPLETED_SUB_TAB,
|
|
30
26
|
};
|
|
31
27
|
return zeniAPI
|
|
32
28
|
.getJSON(`${zeniAPI.apiEndPoints.accountMicroServiceBaseUrl}/1.0/expense-automation/transactions?query=${encodeURIComponent(JSON.stringify(queryParam))}`)
|
|
@@ -49,12 +45,6 @@ export const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) =>
|
|
|
49
45
|
selectedTab,
|
|
50
46
|
totalCount: response.data.total_count,
|
|
51
47
|
}));
|
|
52
|
-
updateActions.push(updateParentTotalCountForTab({
|
|
53
|
-
selectedPeriod,
|
|
54
|
-
selectedTab,
|
|
55
|
-
parentTotalCount: response.data.parent_tab_total_count ??
|
|
56
|
-
response.data.total_count,
|
|
57
|
-
}));
|
|
58
48
|
updateActions.push(resetOtherTabsFetchState({
|
|
59
49
|
refreshViewInBackground,
|
|
60
50
|
tabs: TRANSACTIONS_TABS.filter((tab) => selectedTab !== tab),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createAction, createSlice } from '@reduxjs/toolkit';
|
|
2
2
|
import { toMonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
|
|
3
|
-
import { DEFAULT_COMPLETED_SUB_TAB, } from '../types/completedSubTab';
|
|
4
3
|
import { MIN_MANUAL_TRANSACTION_SEARCH_LENGTH, } from '../types/missingReceiptsViewState';
|
|
5
4
|
export const getCompletedTransactionsCacheKey = (periodId, sortKey, sortOrder, subTab) => {
|
|
6
5
|
const sortKeyPart = sortKey ?? 'none';
|
|
@@ -13,7 +12,7 @@ export const initialBulkUploadState = {
|
|
|
13
12
|
batchListByPeriod: {},
|
|
14
13
|
batchListFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
15
14
|
batchStatusById: {},
|
|
16
|
-
completedSubTab:
|
|
15
|
+
completedSubTab: 'all',
|
|
17
16
|
completedTransactionsByPeriod: {},
|
|
18
17
|
confirmMatchStatus: { fetchState: 'Not-Started', error: undefined },
|
|
19
18
|
currentBatchId: undefined,
|