@zeniai/client-epic-state 5.0.67-beta0ND → 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.
Files changed (105) hide show
  1. package/lib/entity/chargeCard/chargeCardReducer.d.ts +2 -19
  2. package/lib/entity/chargeCard/chargeCardReducer.js +2 -35
  3. package/lib/entity/chargeCardRepayment/chargeCardRepayment.d.ts +1 -1
  4. package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.d.ts +1 -14
  5. package/lib/entity/chargeCardTransaction/chargeCardTransactionReducer.js +2 -36
  6. package/lib/entity/creditAgent/creditAgentState.d.ts +1 -1
  7. package/lib/epic.d.ts +10 -11
  8. package/lib/epic.js +11 -12
  9. package/lib/esm/entity/chargeCard/chargeCardReducer.js +1 -34
  10. package/lib/esm/entity/chargeCardTransaction/chargeCardTransactionReducer.js +1 -35
  11. package/lib/esm/epic.js +11 -12
  12. package/lib/esm/index.js +13 -19
  13. package/lib/esm/reducer.js +2 -8
  14. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
  15. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -6
  16. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +1 -11
  17. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
  18. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -127
  19. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -20
  20. package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +2 -0
  21. package/lib/esm/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +0 -4
  22. package/lib/esm/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
  23. package/lib/esm/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
  24. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
  25. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
  26. package/lib/esm/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
  27. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +9 -28
  28. package/lib/esm/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
  29. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
  30. package/lib/esm/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
  31. package/lib/esm/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
  32. package/lib/index.d.ts +15 -22
  33. package/lib/index.js +58 -77
  34. package/lib/reducer.d.ts +2 -8
  35. package/lib/reducer.js +2 -8
  36. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +1 -2
  37. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -6
  38. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.d.ts +2 -2
  39. package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +0 -10
  40. package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +0 -21
  41. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +1 -2
  42. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +1 -2
  43. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +2 -8
  44. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -128
  45. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -2
  46. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -14
  47. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -20
  48. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -1
  49. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +4 -1
  50. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -40
  51. package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.d.ts +1 -2
  52. package/lib/view/scheduleView/scheduleDetailView/epics/fetchScheduleDetailsPageEpic.js +0 -4
  53. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.d.ts +1 -3
  54. package/lib/view/spendManagement/chargeCards/cashbackDetail/cashbackDetailReducer.js +2 -3
  55. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.d.ts +1 -3
  56. package/lib/view/spendManagement/chargeCards/chargeCardConfig/chargeCardConfigReducer.js +2 -3
  57. package/lib/view/spendManagement/chargeCards/chargeCardDetail/chargeCardDetailReducer.js +18 -55
  58. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailEpic.js +2 -16
  59. package/lib/view/spendManagement/chargeCards/chargeCardDetail/fetchChargeCardDetailPageEpic.js +4 -5
  60. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.d.ts +3 -18
  61. package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListReducer.js +10 -29
  62. package/lib/view/spendManagement/chargeCards/chargeCardList/fetchChargeCardListPageEpic.js +6 -9
  63. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.d.ts +1 -3
  64. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/chargeCardPaymentHistoryReducer.js +2 -3
  65. package/lib/view/spendManagement/chargeCards/chargeCardPaymentHistory/fetchChargeCardPaymentPageEpic.js +1 -1
  66. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.d.ts +1 -3
  67. package/lib/view/spendManagement/chargeCards/chargeCardRepaymentDetail/chargeCardRepaymentDetailReducer.js +3 -7
  68. package/package.json +1 -1
  69. package/lib/commonStateTypes/cacheOverrideFetchReducer.d.ts +0 -17
  70. package/lib/commonStateTypes/cacheOverrideFetchReducer.js +0 -20
  71. package/lib/commonStateTypes/pusherActions.d.ts +0 -11
  72. package/lib/commonStateTypes/pusherActions.js +0 -6
  73. package/lib/entity/scheduleActivityLog/scheduleActivityLogPayload.d.ts +0 -36
  74. package/lib/entity/scheduleActivityLog/scheduleActivityLogPayload.js +0 -55
  75. package/lib/entity/scheduleActivityLog/scheduleActivityLogReducer.d.ts +0 -6
  76. package/lib/entity/scheduleActivityLog/scheduleActivityLogReducer.js +0 -27
  77. package/lib/entity/scheduleActivityLog/scheduleActivityLogSelector.d.ts +0 -4
  78. package/lib/entity/scheduleActivityLog/scheduleActivityLogSelector.js +0 -17
  79. package/lib/entity/scheduleActivityLog/scheduleActivityLogState.d.ts +0 -51
  80. package/lib/entity/scheduleActivityLog/scheduleActivityLogState.js +0 -23
  81. package/lib/esm/commonStateTypes/cacheOverrideFetchReducer.js +0 -16
  82. package/lib/esm/commonStateTypes/pusherActions.js +0 -3
  83. package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogPayload.js +0 -49
  84. package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogReducer.js +0 -23
  85. package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogSelector.js +0 -10
  86. package/lib/esm/entity/scheduleActivityLog/scheduleActivityLogState.js +0 -19
  87. package/lib/esm/view/expenseAutomationView/types/completedSubTab.js +0 -17
  88. package/lib/esm/view/scheduleActivityLogView/fetchScheduleActivityLogEpic.js +0 -43
  89. package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewPayload.js +0 -1
  90. package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewReducer.js +0 -47
  91. package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewSelector.js +0 -33
  92. package/lib/esm/view/scheduleActivityLogView/scheduleActivityLogViewState.js +0 -1
  93. package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
  94. package/lib/view/expenseAutomationView/types/completedSubTab.d.ts +0 -10
  95. package/lib/view/expenseAutomationView/types/completedSubTab.js +0 -21
  96. package/lib/view/scheduleActivityLogView/fetchScheduleActivityLogEpic.d.ts +0 -9
  97. package/lib/view/scheduleActivityLogView/fetchScheduleActivityLogEpic.js +0 -47
  98. package/lib/view/scheduleActivityLogView/scheduleActivityLogViewPayload.d.ts +0 -8
  99. package/lib/view/scheduleActivityLogView/scheduleActivityLogViewPayload.js +0 -2
  100. package/lib/view/scheduleActivityLogView/scheduleActivityLogViewReducer.d.ts +0 -17
  101. package/lib/view/scheduleActivityLogView/scheduleActivityLogViewReducer.js +0 -51
  102. package/lib/view/scheduleActivityLogView/scheduleActivityLogViewSelector.d.ts +0 -8
  103. package/lib/view/scheduleActivityLogView/scheduleActivityLogViewSelector.js +0 -36
  104. package/lib/view/scheduleActivityLogView/scheduleActivityLogViewState.d.ts +0 -5
  105. package/lib/view/scheduleActivityLogView/scheduleActivityLogViewState.js +0 -2
@@ -1,7 +1,6 @@
1
1
  import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
2
2
  import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
3
3
  import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
4
- import { CompletedSubTab } from './completedSubTab';
5
4
  export declare const toMissingReceiptsSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
6
5
  export type MissingReceiptsSortKey = ReturnType<typeof toMissingReceiptsSortKey>;
7
6
  export interface MissingReceiptsViewUIState {
@@ -32,6 +31,8 @@ export declare const toBulkUploadResultsTab: (v: string) => "completed" | "unmat
32
31
  export type BulkUploadResultsTab = ReturnType<typeof toBulkUploadResultsTab>;
33
32
  export declare const toMissingReceiptsTab: (v: string) => "completed" | "unmatched" | "missing";
34
33
  export type MissingReceiptsTab = ReturnType<typeof toMissingReceiptsTab>;
34
+ export declare const toCompletedSubTab: (v: string) => "all" | "manual" | "ai_accountant";
35
+ export type CompletedSubTab = ReturnType<typeof toCompletedSubTab>;
35
36
  export declare const toMatchSource: (v: string) => "manual" | "ai";
36
37
  export type MatchSource = ReturnType<typeof toMatchSource>;
37
38
  export declare const toBulkUploadSortKey: (v: string) => "date" | "amount" | "vendor" | "category" | "class";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toBulkUploadSortKey = exports.toMatchSource = exports.toMissingReceiptsTab = exports.toBulkUploadResultsTab = exports.toBulkUploadPhase = exports.toBatchFileStatus = exports.BATCH_FILE_STATUSES = exports.toBatchStatusValue = exports.MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = exports.toMissingReceiptsSortKey = void 0;
3
+ exports.toBulkUploadSortKey = exports.toMatchSource = exports.toCompletedSubTab = exports.toMissingReceiptsTab = exports.toBulkUploadResultsTab = exports.toBulkUploadPhase = exports.toBatchFileStatus = exports.BATCH_FILE_STATUSES = exports.toBatchStatusValue = exports.MIN_MANUAL_TRANSACTION_SEARCH_LENGTH = exports.toMissingReceiptsSortKey = void 0;
4
4
  exports.isUnmatchedTabFileStatus = isUnmatchedTabFileStatus;
5
5
  const stringToUnion_1 = require("../../../commonStateTypes/stringToUnion");
6
6
  const MISSING_RECEIPTS_SORT_KEYS = [
@@ -49,6 +49,9 @@ exports.toBulkUploadResultsTab = toBulkUploadResultsTab;
49
49
  const MISSING_RECEIPTS_TABS = ['missing', 'completed', 'unmatched'];
50
50
  const toMissingReceiptsTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), MISSING_RECEIPTS_TABS);
51
51
  exports.toMissingReceiptsTab = toMissingReceiptsTab;
52
+ const COMPLETED_SUB_TABS = ['all', 'ai_accountant', 'manual'];
53
+ const toCompletedSubTab = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), COMPLETED_SUB_TABS);
54
+ exports.toCompletedSubTab = toCompletedSubTab;
52
55
  const MATCH_SOURCES = ['ai', 'manual'];
53
56
  const toMatchSource = (v) => (0, stringToUnion_1.stringToUnion)(v.trim().toLowerCase(), MATCH_SOURCES);
54
57
  exports.toMatchSource = toMatchSource;
@@ -1,5 +1,5 @@
1
1
  import { Amount } from '../../../commonStateTypes/amount';
2
- import { FetchState, FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
2
+ import { FetchStateAndError, FetchedState, ID } from '../../../commonStateTypes/common';
3
3
  import { Recommendation, RecommendationWithCOT } from '../../../commonStateTypes/recommendationBase';
4
4
  import { SortOrder } from '../../../commonStateTypes/selectorTypes/sortOrderTypes';
5
5
  import { MonthYearPeriodId } from '../../../commonStateTypes/timePeriod';
@@ -13,11 +13,9 @@ import { TransactionID } from '../../../entity/transaction/stateTypes/transactio
13
13
  import { BillableStatus, CategorizationStatusType, PlatformLineDetailType, ProductOrService, TransactionLineBase } from '../../../entity/transaction/stateTypes/transactionLine';
14
14
  import { TransactionCategory, TransactionType } from '../../../entity/transaction/stateTypes/transactionType';
15
15
  import { VendorBase } from '../../../entity/vendor/vendorState';
16
- import { ZeniAPIStatus } from '../../../responsePayload';
17
16
  import { ZeniDate } from '../../../zeniDayJS';
18
17
  import { EntityRecommendationKey } from '../../recommendation/recommendationState';
19
18
  import { TransactionDetailKey } from '../../transactionDetail/transactionDetailState';
20
- import { CompletedSubTab } from './completedSubTab';
21
19
  export declare const toTransactionsSortKey: (v: string) => "date" | "amount" | "vendor" | "project" | "category" | "class" | "payment_account" | "transaction_type" | "memo_and_receipt";
22
20
  export type TransactionsSortKey = ReturnType<typeof toTransactionsSortKey>;
23
21
  export declare const TRANSACTIONS_TABS: readonly ["review", "autoCategorized"];
@@ -105,44 +103,7 @@ export interface TransactionsTabViewState extends FetchedState {
105
103
  selectedTransactionId?: ID;
106
104
  selectedTransactionLineId?: ID;
107
105
  }
108
- /**
109
- * Snapshot of the autoCategorized tab's paginated dataset for a single
110
- * Completed sub-tab. Stored in {@link TransactionsViewState.autoCategorizedSubTabCache}
111
- * so revisiting an already-loaded sub-tab can short-circuit the fetch epic
112
- * (mirrors parent-tab caching). The snapshot is period-spanning — both the
113
- * `totalCount` map and `transactionIdsBySelectedPeriod` map preserve every
114
- * period the user has paged through under that sub-tab.
115
- *
116
- * `scrollPosition` is captured per sub-tab so revisiting a sub-tab restores
117
- * the user's last scroll offset; switching to a fresh / never-visited sub-tab
118
- * starts at the top instead of inheriting the previous sub-tab's offset.
119
- */
120
- export interface AutoCategorizedSubTabSnapshot {
121
- error: ZeniAPIStatus | undefined;
122
- fetchState: FetchState;
123
- pageToken: PageToken;
124
- scrollPosition: TransactionsViewUIState['scrollPosition'];
125
- totalCount: Record<MonthYearPeriodId, number>;
126
- transactionIdsBySelectedPeriod: Record<MonthYearPeriodId, ID[]>;
127
- }
128
106
  export type TransactionsViewState = {
129
- /**
130
- * Per-sub-tab snapshot cache for the Completed (autoCategorized) tab. Keyed
131
- * by {@link CompletedSubTab}. Populated as the user navigates between
132
- * sub-tabs and consulted on every switch — the active autoCategorized slot
133
- * is restored from here when a snapshot exists, otherwise it is reset and
134
- * the fetch epic loads page 1 fresh.
135
- */
136
- autoCategorizedSubTabCache: Partial<Record<CompletedSubTab, AutoCategorizedSubTabSnapshot>>;
137
- /**
138
- * Period-keyed parent tab counts, scoped per {@link TransactionsTab}.
139
- * Sourced from the listing response's `parent_tab_total_count` and used
140
- * exclusively to drive the parent tab badges on the UI — every other
141
- * count consumer (pagination, sub-tab chips, in-tab "showing X of Y")
142
- * keeps reading from {@link TransactionsViewUIState.totalCount}.
143
- */
144
- parentTotalCountByTab: Record<TransactionsTab, Record<MonthYearPeriodId, number>>;
145
- selectedTransactionCategorizationCompletedSubTab: CompletedSubTab;
146
107
  selectedTransactionCategorizationTab: TransactionsTab;
147
108
  transactionCategorizationView: Record<TransactionsTab, TransactionsTabViewState>;
148
109
  };
@@ -3,7 +3,6 @@ import { Observable } from 'rxjs';
3
3
  import { RootState } from '../../../../reducer';
4
4
  import { fetchAccountList } from '../../../accountList/accountListReducer';
5
5
  import { fetchClassList } from '../../../classList/classListReducer';
6
- import { fetchScheduleActivityLog } from '../../../scheduleActivityLogView/scheduleActivityLogViewReducer';
7
6
  import { fetchScheduleDetails, fetchScheduleDetailsPage } from '../scheduleDetailReducer';
8
- export type ActionType = ReturnType<typeof fetchScheduleDetails> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchScheduleActivityLog> | ReturnType<typeof fetchScheduleDetailsPage>;
7
+ export type ActionType = ReturnType<typeof fetchScheduleDetails> | ReturnType<typeof fetchClassList> | ReturnType<typeof fetchAccountList> | ReturnType<typeof fetchScheduleDetailsPage>;
9
8
  export declare const fetchScheduleDetailsPageEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
@@ -5,7 +5,6 @@ const rxjs_1 = require("rxjs");
5
5
  const operators_1 = require("rxjs/operators");
6
6
  const accountListReducer_1 = require("../../../accountList/accountListReducer");
7
7
  const classListReducer_1 = require("../../../classList/classListReducer");
8
- const scheduleActivityLogViewReducer_1 = require("../../../scheduleActivityLogView/scheduleActivityLogViewReducer");
9
8
  const scheduleListHelper_1 = require("../../scheduleListView/scheduleListHelper");
10
9
  const scheduleDetailReducer_1 = require("../scheduleDetailReducer");
11
10
  const fetchScheduleDetailsPageEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(scheduleDetailReducer_1.fetchScheduleDetailsPage.match), (0, operators_1.mergeMap)((action) => {
@@ -23,9 +22,6 @@ const fetchScheduleDetailsPageEpic = (actions$, state$) => actions$.pipe((0, ope
23
22
  }
24
23
  if (action.payload.selectedJeScheduleDetailId != null) {
25
24
  scheduleDetailsActions.push((0, scheduleDetailReducer_1.fetchScheduleDetails)(action.payload.scheduleType, action.payload.selectedJeScheduleDetailId, action.payload.cacheOverride));
26
- // Prefetch the schedule activity log alongside the detail page so the
27
- // side panel renders instantly when the user taps the navbar icon.
28
- scheduleDetailsActions.push((0, scheduleActivityLogViewReducer_1.fetchScheduleActivityLog)(action.payload.selectedJeScheduleDetailId));
29
25
  }
30
26
  return (0, rxjs_1.concat)((0, rxjs_1.from)(scheduleDetailsActions));
31
27
  }));
@@ -2,9 +2,7 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
2
2
  import { ChargeCardCashbackPayload } from './cashbackDetailPayload';
3
3
  import { CashbackDetailState, CashbackDetailUIState } from './cashbackDetailState';
4
4
  export declare const initialState: CashbackDetailState;
5
- export declare const fetchCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
6
- cacheOverride: boolean;
7
- }, "cashbackDetail/fetchCashbackDetail", never, never>, updateCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardCashbackPayload, "cashbackDetail/updateCashbackDetail">, updateCashbackDetailFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cashbackDetail/updateCashbackDetailFailure">, updateCashbackDetailUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
5
+ export declare const fetchCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cashbackDetail/fetchCashbackDetail">, updateCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardCashbackPayload, "cashbackDetail/updateCashbackDetail">, updateCashbackDetailFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "cashbackDetail/updateCashbackDetailFailure">, updateCashbackDetailUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
8
6
  uiState: Partial<CashbackDetailUIState>;
9
7
  }, "cashbackDetail/updateCashbackDetailUIState">, clearCashbackDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cashbackDetail/clearCashbackDetail">;
10
8
  declare const _default: import("redux").Reducer<CashbackDetailState>;
@@ -5,7 +5,6 @@ exports.clearCashbackDetail = exports.updateCashbackDetailUIState = exports.upda
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const viewAndReportPayloadv2_1 = require("../../../../commonPayloadTypes/v2/viewAndReportPayloadv2");
7
7
  const amount_1 = require("../../../../commonStateTypes/amount");
8
- const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
9
8
  const cashbackDetailState_1 = require("./cashbackDetailState");
10
9
  exports.initialState = {
11
10
  fetchState: 'Not-Started',
@@ -32,10 +31,10 @@ const cashbackDetail = (0, toolkit_1.createSlice)({
32
31
  name: 'cashbackDetail',
33
32
  initialState: exports.initialState,
34
33
  reducers: {
35
- fetchCashbackDetail: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
34
+ fetchCashbackDetail(draft) {
36
35
  draft.fetchState = 'In-Progress';
37
36
  draft.error = undefined;
38
- }),
37
+ },
39
38
  updateCashbackDetail(draft, action) {
40
39
  draft.cashbackByPeriod = toCashbackByPeriod(action.payload);
41
40
  draft.cashbackSummary = toCashbackSummary(action.payload);
@@ -2,8 +2,6 @@ import { ZeniAPIStatus } from '../../../../responsePayload';
2
2
  import { ChargeCardConfigPayload } from './chargeCardConfigPayload';
3
3
  import { ChargeCardConfigState } from './chargeCardConfigState';
4
4
  export declare const initialState: ChargeCardConfigState;
5
- export declare const fetchChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
6
- cacheOverride: boolean;
7
- }, "chargeCardConfig/fetchChargeCardConfig", never, never>, updateChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardConfigPayload, "chargeCardConfig/updateChargeCardConfig">, updateChargeCardConfigFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardConfig/updateChargeCardConfigFailure">, clearChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardConfig/clearChargeCardConfig">;
5
+ export declare const fetchChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardConfig/fetchChargeCardConfig">, updateChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardConfigPayload, "chargeCardConfig/updateChargeCardConfig">, updateChargeCardConfigFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardConfig/updateChargeCardConfigFailure">, clearChargeCardConfig: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardConfig/clearChargeCardConfig">;
8
6
  declare const _default: import("redux").Reducer<ChargeCardConfigState>;
9
7
  export default _default;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.clearChargeCardConfig = exports.updateChargeCardConfigFailure = exports.updateChargeCardConfig = exports.fetchChargeCardConfig = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const amount_1 = require("../../../../commonStateTypes/amount");
7
- const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
8
7
  const chargeCard_1 = require("../../../../entity/chargeCard/chargeCard");
9
8
  const chargeCardConfigPayload_1 = require("./chargeCardConfigPayload");
10
9
  exports.initialState = {
@@ -35,10 +34,10 @@ const chargeCardConfig = (0, toolkit_1.createSlice)({
35
34
  name: 'chargeCardConfig',
36
35
  initialState: exports.initialState,
37
36
  reducers: {
38
- fetchChargeCardConfig: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
37
+ fetchChargeCardConfig(draft) {
39
38
  draft.fetchState = 'In-Progress';
40
39
  draft.error = undefined;
41
- }),
40
+ },
42
41
  updateChargeCardConfig(draft, action) {
43
42
  const { payload } = action;
44
43
  draft.creditLimitFrequency =
@@ -6,7 +6,6 @@ const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const sortOrderPayload_1 = require("../../../../commonPayloadTypes/sortOrderPayload");
7
7
  const attachmentPayload_1 = require("../../../../entity/transaction/payloadTypes/attachmentPayload");
8
8
  const chargeCardDetail_1 = require("./chargeCardDetail");
9
- const pusherActions_1 = require("../../../../commonStateTypes/pusherActions");
10
9
  exports.initialState = {
11
10
  detailById: {},
12
11
  recurringExpensesByChargeCardId: {},
@@ -69,30 +68,19 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
69
68
  },
70
69
  fetchChargeCardTransactionList: {
71
70
  reducer(draft, action) {
72
- const { chargeCardId, pageToken, pageTokenType, cacheOverride } = action.payload;
71
+ const { chargeCardId, pageToken, pageTokenType } = action.payload;
73
72
  const existingCardDetail = draft.detailById[chargeCardId] ?? chargeCardDetail_1.emptyChargeCardDetail;
74
- const existingUi = existingCardDetail.transactionList.uiState;
75
- // cacheOverride=true (Pusher): preserve fetchState, error, and scroll
76
- // to avoid skeleton flash. Normal fetches reset as before.
77
73
  draft.detailById[chargeCardId] = {
78
74
  ...existingCardDetail,
79
75
  transactionList: {
80
76
  ...existingCardDetail.transactionList,
81
- fetchState: cacheOverride
82
- ? existingCardDetail.transactionList.fetchState
83
- : 'In-Progress',
84
- error: cacheOverride
85
- ? existingCardDetail.transactionList.error
86
- : undefined,
77
+ fetchState: 'In-Progress',
78
+ error: undefined,
87
79
  uiState: {
88
- ...existingUi,
89
- // Preserve scroll on silent refresh so users aren't snapped
90
- // away from their reading position.
91
- scrollYOffset: cacheOverride
92
- ? existingUi.scrollYOffset
93
- : existingUi.pageToken === null
94
- ? 0
95
- : existingUi.scrollYOffset,
80
+ ...existingCardDetail.transactionList.uiState,
81
+ scrollYOffset: existingCardDetail.transactionList.uiState.pageToken === null
82
+ ? 0
83
+ : existingCardDetail.transactionList.uiState.scrollYOffset,
96
84
  pageToken: pageToken,
97
85
  pageTokenType: pageTokenType,
98
86
  },
@@ -109,24 +97,18 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
109
97
  const { chargeCardId, data, cacheOverride } = action.payload;
110
98
  const existingCardDetail = draft.detailById[chargeCardId] ?? chargeCardDetail_1.emptyChargeCardDetail;
111
99
  const newTransactionIds = data.transactions.map((tran) => tran.transaction_id);
112
- const existingIds = existingCardDetail.transactionList.transactionIds;
113
- // cacheOverride (Pusher): refresh page 1 but keep page 2+ IDs.
114
- // Normal pagination: append new page, deduped.
115
- const newIdSet = new Set(newTransactionIds);
116
- const mergedTransactionIds = cacheOverride
117
- ? [
118
- ...newTransactionIds,
119
- ...existingIds.filter((id) => !newIdSet.has(id)),
120
- ]
121
- : [
122
- ...existingIds,
123
- ...newTransactionIds.filter((id) => !existingIds.includes(id)),
124
- ];
125
100
  draft.detailById[chargeCardId] = {
126
101
  ...existingCardDetail,
127
102
  transactionList: {
128
103
  ...existingCardDetail.transactionList,
129
- transactionIds: mergedTransactionIds,
104
+ transactionIds: [
105
+ ...new Set([
106
+ ...(cacheOverride
107
+ ? []
108
+ : existingCardDetail.transactionList.transactionIds),
109
+ ...newTransactionIds,
110
+ ]),
111
+ ],
130
112
  fetchState: 'Completed',
131
113
  error: undefined,
132
114
  uiState: {
@@ -138,12 +120,9 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
138
120
  limit: data.query.limit,
139
121
  pageToken: data.query.page_token,
140
122
  pageTokenType: data.query.page_token_type,
141
- // Preserve scroll on silent refresh; reset on user-triggered first page.
142
- scrollYOffset: cacheOverride
143
- ? existingCardDetail.transactionList.uiState.scrollYOffset
144
- : existingCardDetail.transactionList.uiState.pageToken === null
145
- ? 0
146
- : existingCardDetail.transactionList.uiState.scrollYOffset,
123
+ scrollYOffset: existingCardDetail.transactionList.uiState.pageToken === null
124
+ ? 0
125
+ : existingCardDetail.transactionList.uiState.scrollYOffset,
147
126
  },
148
127
  },
149
128
  };
@@ -657,22 +636,6 @@ const chargeCardDetail = (0, toolkit_1.createSlice)({
657
636
  Object.assign(draft, exports.initialState);
658
637
  },
659
638
  },
660
- extraReducers: (builder) => {
661
- const prependTransaction = (draft, cardId, txId) => {
662
- const detail = draft.detailById[cardId];
663
- if (detail != null &&
664
- !detail.transactionList.transactionIds.includes(txId)) {
665
- detail.transactionList.transactionIds.unshift(txId);
666
- }
667
- };
668
- builder
669
- .addCase(pusherActions_1.addChargeCardTransactionFromPusher, (draft, action) => {
670
- prependTransaction(draft, action.payload.cardId, action.payload.transaction.transaction_id);
671
- })
672
- .addCase(pusherActions_1.addDeclinedChargeCardTransactionFromPusher, (draft, action) => {
673
- prependTransaction(draft, action.payload.cardId, action.payload.transaction.transaction_id);
674
- });
675
- },
676
639
  });
677
640
  _a = chargeCardDetail.actions, exports.fetchChargeCardDetailPage = _a.fetchChargeCardDetailPage, exports.fetchChargeCardDetail = _a.fetchChargeCardDetail, exports.updateChargeCardDetailFetchState = _a.updateChargeCardDetailFetchState, exports.fetchChargeCardTransactionList = _a.fetchChargeCardTransactionList, exports.updateChargeCardDetailUIState = _a.updateChargeCardDetailUIState, exports.updateChargeCardTransactionList = _a.updateChargeCardTransactionList, exports.updateChargeCardTransactionUploadReceiptsFetchStatus = _a.updateChargeCardTransactionUploadReceiptsFetchStatus, exports.fetchChargeCardTransactionAttachments = _a.fetchChargeCardTransactionAttachments, exports.updateChargeCardTransactionIsViewReceiptClicked = _a.updateChargeCardTransactionIsViewReceiptClicked, exports.updateChargeCardTransactionAttachmentsFailure = _a.updateChargeCardTransactionAttachmentsFailure, exports.updatePhysicalChargeCardAttemptSuccessOrFailure = _a.updatePhysicalChargeCardAttemptSuccessOrFailure, exports.updatePhysicalChargeCardAttempt = _a.updatePhysicalChargeCardAttempt, exports.updateDebitCardPinAttempt = _a.updateDebitCardPinAttempt, exports.updateDebitCardPinAttemptSuccessOrFailure = _a.updateDebitCardPinAttemptSuccessOrFailure, exports.updateChargeCardTransactionReceiptsShowTickFetchStatus = _a.updateChargeCardTransactionReceiptsShowTickFetchStatus, exports.updateChargeCardTransactionAttachmentsInCardDetail = _a.updateChargeCardTransactionAttachmentsInCardDetail, exports.updateChargeCardTransactionListFailure = _a.updateChargeCardTransactionListFailure, exports.updateChargeCardDetail = _a.updateChargeCardDetail, exports.startCVVActivationWait = _a.startCVVActivationWait, exports.completeCVVActivationWait = _a.completeCVVActivationWait, exports.startDebitCardSetPinWait = _a.startDebitCardSetPinWait, exports.completeDebitCardSetPinWait = _a.completeDebitCardSetPinWait, exports.updateChargeCardDetailUpdateStatus = _a.updateChargeCardDetailUpdateStatus, exports.updateChargeCardSpendLimit = _a.updateChargeCardSpendLimit, exports.updateChargeCardSpendLimitSuccessOrFailure = _a.updateChargeCardSpendLimitSuccessOrFailure, exports.updateChargeCardName = _a.updateChargeCardName, exports.updateChargeCardNameSuccessOrFailure = _a.updateChargeCardNameSuccessOrFailure, exports.lockChargeCard = _a.lockChargeCard, exports.lockChargeCardSuccessOrFailure = _a.lockChargeCardSuccessOrFailure, exports.unlockChargeCard = _a.unlockChargeCard, exports.unlockChargeCardSuccessOrFailure = _a.unlockChargeCardSuccessOrFailure, exports.closeChargeCard = _a.closeChargeCard, exports.closeChargeCardSuccessOrFailure = _a.closeChargeCardSuccessOrFailure, exports.fetchDepositAccountLimit = _a.fetchDepositAccountLimit, exports.updateDepositAccountLimitFetchStatus = _a.updateDepositAccountLimitFetchStatus, exports.fetchChargeCardTransactionStatistics = _a.fetchChargeCardTransactionStatistics, exports.updateChargeCardTransactionStatistics = _a.updateChargeCardTransactionStatistics, exports.updateChargeCardTransactionStatisticsFetchState = _a.updateChargeCardTransactionStatisticsFetchState, exports.fetchChargeCardsRecurringExpenses = _a.fetchChargeCardsRecurringExpenses, exports.updateChargeCardsRecurringExpenses = _a.updateChargeCardsRecurringExpenses, exports.updateChargeCardsRecurringExpensesFetchState = _a.updateChargeCardsRecurringExpensesFetchState, exports.sendOtpCardHolder = _a.sendOtpCardHolder, exports.resendOtpCardHolder = _a.resendOtpCardHolder, exports.sendOtpCardHolderSuccess = _a.sendOtpCardHolderSuccess, exports.sendOtpCardHolderFailure = _a.sendOtpCardHolderFailure, exports.verifyOtpCardHolder = _a.verifyOtpCardHolder, exports.verifyOtpCardHolderSuccess = _a.verifyOtpCardHolderSuccess, exports.verifyOtpCardHolderFailure = _a.verifyOtpCardHolderFailure, exports.clearChargeCardDetail = _a.clearChargeCardDetail;
678
641
  exports.default = chargeCardDetail.reducer;
@@ -19,24 +19,13 @@ const fetchChargeCardDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((
19
19
  const chargeCardAction = [];
20
20
  const state = state$.value;
21
21
  const chargeCardDetail = (0, get_1.default)(state.chargeCardDetailState.detailById, chargeCardId, undefined);
22
- // Skip if a user-triggered fetch is already in-flight (not applicable
23
- // to cacheOverride/Pusher refreshes, which always proceed).
24
22
  if (cacheOverride === true ||
25
23
  chargeCardDetail == null ||
26
24
  chargeCardDetail.fetchState !== 'In-Progress') {
27
- // Silent refresh: preserve fetchState to avoid skeleton flash.
28
- // Discriminate via fetchState (not null-check) because the reducer
29
- // always creates an entry before the epic runs.
30
- const isSilentRefresh = cacheOverride === true &&
31
- chargeCardDetail != null &&
32
- chargeCardDetail.fetchState !== 'Not-Started';
33
25
  chargeCardAction.push((0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
34
26
  chargeCardId,
35
- isRefreshingViewInBackground: isSilentRefresh,
36
- fetchState: isSilentRefresh
37
- ? chargeCardDetail.fetchState
38
- : 'In-Progress',
39
- error: isSilentRefresh ? chargeCardDetail.error : undefined,
27
+ isRefreshingViewInBackground: cacheOverride,
28
+ fetchState: 'In-Progress',
40
29
  }));
41
30
  const query = {
42
31
  is_include_card_activation_events: true,
@@ -54,8 +43,6 @@ const fetchChargeCardDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((
54
43
  }));
55
44
  }
56
45
  else {
57
- // Surface errors even on silent refresh so the user
58
- // knows data is stale (follow-up: consider toast instead).
59
46
  return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
60
47
  chargeCardId,
61
48
  fetchState: 'Error',
@@ -64,7 +51,6 @@ const fetchChargeCardDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((
64
51
  }));
65
52
  }
66
53
  }), (0, operators_1.catchError)((error) => {
67
- // Surface network failures even on silent refresh.
68
54
  return (0, rxjs_1.of)((0, chargeCardDetailReducer_1.updateChargeCardDetailFetchState)({
69
55
  chargeCardId,
70
56
  fetchState: 'Error',
@@ -18,16 +18,15 @@ const fetchChargeCardDetailPageEpic = (actions$, state$) => actions$.pipe((0, op
18
18
  ? exsitingChargeCardDetail.transactionList.uiState.pageTokenType
19
19
  : null;
20
20
  if (cacheOverride === true) {
21
- // Forward cacheOverride to all sub-fetches to prevent skeleton flash.
22
21
  chargeCardTransactionListAction.push((0, chargeCardDetailReducer_1.fetchChargeCardDetail)(chargeCardId, cacheOverride));
23
22
  //latest transactions need to be fetched hence removing pageToken and pageTokenType
24
- chargeCardTransactionListAction.push((0, chargeCardDetailReducer_1.fetchChargeCardTransactionList)(chargeCardId, null, null, true));
25
- chargeCardTransactionListAction.push((0, chargeCardConfigReducer_1.fetchChargeCardConfig)(true));
23
+ chargeCardTransactionListAction.push((0, chargeCardDetailReducer_1.fetchChargeCardTransactionList)(chargeCardId, null, null));
24
+ chargeCardTransactionListAction.push((0, chargeCardConfigReducer_1.fetchChargeCardConfig)());
26
25
  if (doFetchCreditAccounts && isCreditCardEnabled) {
27
- chargeCardTransactionListAction.push((0, chargeCardListReducer_1.fetchCreditAccount)(true));
26
+ chargeCardTransactionListAction.push((0, chargeCardListReducer_1.fetchCreditAccount)());
28
27
  }
29
28
  if (doFetchCreditAccounts && isCreditCardEnabled) {
30
- chargeCardTransactionListAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)(true));
29
+ chargeCardTransactionListAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)());
31
30
  }
32
31
  }
33
32
  else {
@@ -10,30 +10,15 @@ export declare const fetchChargeCardListPage: import("@reduxjs/toolkit").ActionC
10
10
  isDebitCardEnabled: boolean;
11
11
  isCreditCardEnabled: boolean;
12
12
  cacheOverride: any;
13
- }, "chargeCardList/fetchChargeCardListPage", never, never>, fetchCreditAccountRepayment: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
14
- cacheOverride: boolean;
15
- }, "chargeCardList/fetchCreditAccountRepayment", never, never>, updateCreditAccountRepayment: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountRepaymentPayload, "chargeCardList/updateCreditAccountRepayment">, updateCreditAccountRepaymentFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountRepaymentFailure">, updateCreditAccountRepaymentAmountAndDate: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
13
+ }, "chargeCardList/fetchChargeCardListPage", never, never>, fetchCreditAccountRepayment: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchCreditAccountRepayment">, updateCreditAccountRepayment: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountRepaymentPayload, "chargeCardList/updateCreditAccountRepayment">, updateCreditAccountRepaymentFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountRepaymentFailure">, updateCreditAccountRepaymentAmountAndDate: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
16
14
  amount: Amount;
17
15
  date: ZeniDate;
18
- }, "chargeCardList/updateCreditAccountRepaymentAmountAndDate">, updateRowActionCardId: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "chargeCardList/updateRowActionCardId">, fetchCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
19
- cacheOverride: boolean;
20
- }, "chargeCardList/fetchCreditAccount", never, never>, updateCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountPayload[], "chargeCardList/updateCreditAccount">, updateCreditAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountFailure">, fetchDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
21
- cacheOverride: boolean;
22
- }, "chargeCardList/fetchDebitCardSummary", never, never>, updateDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithPayload<DebitCardSummariesPayload, "chargeCardList/updateDebitCardSummary">, updateDebitCardSummaryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateDebitCardSummaryFailure">, fetchChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
23
- cacheOverride: boolean;
24
- }, "chargeCardList/fetchChargeCardList", never, never>, updateChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
16
+ }, "chargeCardList/updateCreditAccountRepaymentAmountAndDate">, updateRowActionCardId: import("@reduxjs/toolkit").ActionCreatorWithOptionalPayload<string | undefined, "chargeCardList/updateRowActionCardId">, fetchCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchCreditAccount">, updateCreditAccount: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreditAccountPayload[], "chargeCardList/updateCreditAccount">, updateCreditAccountFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateCreditAccountFailure">, fetchDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchDebitCardSummary">, updateDebitCardSummary: import("@reduxjs/toolkit").ActionCreatorWithPayload<DebitCardSummariesPayload, "chargeCardList/updateDebitCardSummary">, updateDebitCardSummaryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateDebitCardSummaryFailure">, fetchChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/fetchChargeCardList">, updateChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
25
17
  chargeCardListPayload: ChargeCardListPayload;
26
18
  keepExistingListItems?: boolean;
27
19
  }, "chargeCardList/updateChargeCardList">, updateChargeCardListFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardList/updateChargeCardListFailure">, updateSearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardList/updateSearchText">, updateBulkActionCardIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "chargeCardList/updateBulkActionCardIds">, updateChargeCardListUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
28
20
  uiState: Partial<ChargeCardListUIState>;
29
- }, "chargeCardList/updateChargeCardListUIState">, updateCreditAccountBalanceFromPusher: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
30
- currencyCode: string;
31
- currencySymbol: string;
32
- available?: number;
33
- balance?: number;
34
- cashback?: number;
35
- hold?: number;
36
- }, "chargeCardList/updateCreditAccountBalanceFromPusher">, clearChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/clearChargeCardList">, resendCardInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardId: string], {
21
+ }, "chargeCardList/updateChargeCardListUIState">, clearChargeCardList: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardList/clearChargeCardList">, resendCardInvite: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cardId: string], {
37
22
  cardId: string;
38
23
  }, "chargeCardList/resendCardInvite", never, never>, resendCardInviteSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
39
24
  cardId: ID;
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.revokeChargeCardsInviteSuccessOrFailure = exports.revokeChargeCardsInvite = exports.closeChargeCardsSuccessOrFailure = exports.closeChargeCards = exports.unlockChargeCardsSuccessOrFailure = exports.unlockChargeCards = exports.lockChargeCardsSuccessOrFailure = exports.lockChargeCards = exports.updateChargeCardsSpendLimitSuccessOrFailure = exports.updateChargeCardsSpendLimit = exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateCreditAccountBalanceFromPusher = exports.updateChargeCardListUIState = exports.updateBulkActionCardIds = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateDebitCardSummaryFailure = exports.updateDebitCardSummary = exports.fetchDebitCardSummary = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.updateRowActionCardId = exports.updateCreditAccountRepaymentAmountAndDate = exports.updateCreditAccountRepaymentFailure = exports.updateCreditAccountRepayment = exports.fetchCreditAccountRepayment = exports.fetchChargeCardListPage = exports.initialState = void 0;
4
+ exports.revokeChargeCardsInviteSuccessOrFailure = exports.revokeChargeCardsInvite = exports.closeChargeCardsSuccessOrFailure = exports.closeChargeCards = exports.unlockChargeCardsSuccessOrFailure = exports.unlockChargeCards = exports.lockChargeCardsSuccessOrFailure = exports.lockChargeCards = exports.updateChargeCardsSpendLimitSuccessOrFailure = exports.updateChargeCardsSpendLimit = exports.revokeCardInviteFailure = exports.revokeCardInviteSuccess = exports.revokeCardInvite = exports.resendCardInviteFailure = exports.resendCardInviteSuccess = exports.resendCardInvite = exports.clearChargeCardList = exports.updateChargeCardListUIState = exports.updateBulkActionCardIds = exports.updateSearchText = exports.updateChargeCardListFailure = exports.updateChargeCardList = exports.fetchChargeCardList = exports.updateDebitCardSummaryFailure = exports.updateDebitCardSummary = exports.fetchDebitCardSummary = exports.updateCreditAccountFailure = exports.updateCreditAccount = exports.fetchCreditAccount = exports.updateRowActionCardId = exports.updateCreditAccountRepaymentAmountAndDate = exports.updateCreditAccountRepaymentFailure = exports.updateCreditAccountRepayment = exports.fetchCreditAccountRepayment = exports.fetchChargeCardListPage = exports.initialState = void 0;
5
5
  const toolkit_1 = require("@reduxjs/toolkit");
6
6
  const amount_1 = require("../../../../commonStateTypes/amount");
7
- const cacheOverrideFetchReducer_1 = require("../../../../commonStateTypes/cacheOverrideFetchReducer");
8
7
  const zeniDayJS_1 = require("../../../../zeniDayJS");
9
8
  const chargeCardList_1 = require("./chargeCardList");
10
9
  exports.initialState = {
@@ -48,10 +47,6 @@ exports.initialState = {
48
47
  revokeCardInvite: chargeCardList_1.initialResendRevokeCardInvite,
49
48
  creditAccountRepayment: chargeCardList_1.initialCreditAccountRepayment,
50
49
  };
51
- // Silent-Pusher-refresh contract: when cacheOverride=true, fetch reducers
52
- // leave fetchState and error unchanged so the list page's reduceFetchState
53
- // selector stays 'Completed' and doesn't flash ChargeCardListLoading.
54
- // See createCacheOverrideFetchReducer for details.
55
50
  const chargeCardList = (0, toolkit_1.createSlice)({
56
51
  name: 'chargeCardList',
57
52
  initialState: exports.initialState,
@@ -71,10 +66,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
71
66
  };
72
67
  },
73
68
  },
74
- fetchCreditAccountRepayment: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
69
+ fetchCreditAccountRepayment(draft) {
75
70
  draft.creditAccountRepayment.fetchState = 'In-Progress';
76
71
  draft.creditAccountRepayment.error = undefined;
77
- }),
72
+ },
78
73
  updateCreditAccountRepaymentAmountAndDate(draft, action) {
79
74
  draft.creditAccountRepayment.initiatedRepayments = action.payload.amount;
80
75
  draft.creditAccountRepayment.initiatedRepaymentDate = action.payload.date;
@@ -92,10 +87,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
92
87
  updateRowActionCardId(draft, action) {
93
88
  draft.rowActionCardId = action.payload;
94
89
  },
95
- fetchCreditAccount: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
90
+ fetchCreditAccount(draft) {
96
91
  draft.creditAccount.fetchState = 'In-Progress';
97
92
  draft.creditAccount.error = undefined;
98
- }),
93
+ },
99
94
  updateCreditAccount(draft, action) {
100
95
  if (action.payload.length > 0) {
101
96
  draft.creditAccount = toCreditAccount(action.payload[0]);
@@ -108,10 +103,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
108
103
  error: action.payload,
109
104
  };
110
105
  },
111
- fetchDebitCardSummary: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
106
+ fetchDebitCardSummary(draft) {
112
107
  draft.debitCardSummaries.fetchState = 'In-Progress';
113
108
  draft.debitCardSummaries.error = undefined;
114
- }),
109
+ },
115
110
  updateDebitCardSummary(draft, action) {
116
111
  draft.debitCardSummaries = toDebitCardSummaries(action.payload);
117
112
  },
@@ -122,10 +117,10 @@ const chargeCardList = (0, toolkit_1.createSlice)({
122
117
  error: action.payload,
123
118
  };
124
119
  },
125
- fetchChargeCardList: (0, cacheOverrideFetchReducer_1.createCacheOverrideFetchReducer)((draft) => {
120
+ fetchChargeCardList(draft) {
126
121
  draft.fetchState = 'In-Progress';
127
122
  draft.error = undefined;
128
- }),
123
+ },
129
124
  updateChargeCardList(draft, action) {
130
125
  const { cards, unassigned_credit } = action.payload.chargeCardListPayload;
131
126
  const newCard = cards.map((card) => card.card_id);
@@ -161,20 +156,6 @@ const chargeCardList = (0, toolkit_1.createSlice)({
161
156
  draft.uiState.scrollYOffset = action.payload.uiState.scrollYOffset;
162
157
  }
163
158
  },
164
- updateCreditAccountBalanceFromPusher(draft, action) {
165
- const { currencyCode, currencySymbol } = action.payload;
166
- const amt = (v) => v !== undefined
167
- ? (0, amount_1.toAmount)(v, currencyCode, currencySymbol)
168
- : undefined;
169
- draft.creditAccount.available =
170
- amt(action.payload.available) ?? draft.creditAccount.available;
171
- draft.creditAccount.balance =
172
- amt(action.payload.balance) ?? draft.creditAccount.balance;
173
- draft.creditAccount.hold =
174
- amt(action.payload.hold) ?? draft.creditAccount.hold;
175
- draft.creditAccount.cashback =
176
- amt(action.payload.cashback) ?? draft.creditAccount.cashback;
177
- },
178
159
  clearChargeCardList(draft) {
179
160
  Object.assign(draft, exports.initialState);
180
161
  },
@@ -330,7 +311,7 @@ const chargeCardList = (0, toolkit_1.createSlice)({
330
311
  },
331
312
  },
332
313
  });
333
- _a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccountRepayment = _a.fetchCreditAccountRepayment, exports.updateCreditAccountRepayment = _a.updateCreditAccountRepayment, exports.updateCreditAccountRepaymentFailure = _a.updateCreditAccountRepaymentFailure, exports.updateCreditAccountRepaymentAmountAndDate = _a.updateCreditAccountRepaymentAmountAndDate, exports.updateRowActionCardId = _a.updateRowActionCardId, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchDebitCardSummary = _a.fetchDebitCardSummary, exports.updateDebitCardSummary = _a.updateDebitCardSummary, exports.updateDebitCardSummaryFailure = _a.updateDebitCardSummaryFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.updateSearchText = _a.updateSearchText, exports.updateBulkActionCardIds = _a.updateBulkActionCardIds, exports.updateChargeCardListUIState = _a.updateChargeCardListUIState, exports.updateCreditAccountBalanceFromPusher = _a.updateCreditAccountBalanceFromPusher, exports.clearChargeCardList = _a.clearChargeCardList, exports.resendCardInvite = _a.resendCardInvite, exports.resendCardInviteSuccess = _a.resendCardInviteSuccess, exports.resendCardInviteFailure = _a.resendCardInviteFailure, exports.revokeCardInvite = _a.revokeCardInvite, exports.revokeCardInviteSuccess = _a.revokeCardInviteSuccess, exports.revokeCardInviteFailure = _a.revokeCardInviteFailure, exports.updateChargeCardsSpendLimit = _a.updateChargeCardsSpendLimit, exports.updateChargeCardsSpendLimitSuccessOrFailure = _a.updateChargeCardsSpendLimitSuccessOrFailure, exports.lockChargeCards = _a.lockChargeCards, exports.lockChargeCardsSuccessOrFailure = _a.lockChargeCardsSuccessOrFailure, exports.unlockChargeCards = _a.unlockChargeCards, exports.unlockChargeCardsSuccessOrFailure = _a.unlockChargeCardsSuccessOrFailure, exports.closeChargeCards = _a.closeChargeCards, exports.closeChargeCardsSuccessOrFailure = _a.closeChargeCardsSuccessOrFailure, exports.revokeChargeCardsInvite = _a.revokeChargeCardsInvite, exports.revokeChargeCardsInviteSuccessOrFailure = _a.revokeChargeCardsInviteSuccessOrFailure;
314
+ _a = chargeCardList.actions, exports.fetchChargeCardListPage = _a.fetchChargeCardListPage, exports.fetchCreditAccountRepayment = _a.fetchCreditAccountRepayment, exports.updateCreditAccountRepayment = _a.updateCreditAccountRepayment, exports.updateCreditAccountRepaymentFailure = _a.updateCreditAccountRepaymentFailure, exports.updateCreditAccountRepaymentAmountAndDate = _a.updateCreditAccountRepaymentAmountAndDate, exports.updateRowActionCardId = _a.updateRowActionCardId, exports.fetchCreditAccount = _a.fetchCreditAccount, exports.updateCreditAccount = _a.updateCreditAccount, exports.updateCreditAccountFailure = _a.updateCreditAccountFailure, exports.fetchDebitCardSummary = _a.fetchDebitCardSummary, exports.updateDebitCardSummary = _a.updateDebitCardSummary, exports.updateDebitCardSummaryFailure = _a.updateDebitCardSummaryFailure, exports.fetchChargeCardList = _a.fetchChargeCardList, exports.updateChargeCardList = _a.updateChargeCardList, exports.updateChargeCardListFailure = _a.updateChargeCardListFailure, exports.updateSearchText = _a.updateSearchText, exports.updateBulkActionCardIds = _a.updateBulkActionCardIds, exports.updateChargeCardListUIState = _a.updateChargeCardListUIState, exports.clearChargeCardList = _a.clearChargeCardList, exports.resendCardInvite = _a.resendCardInvite, exports.resendCardInviteSuccess = _a.resendCardInviteSuccess, exports.resendCardInviteFailure = _a.resendCardInviteFailure, exports.revokeCardInvite = _a.revokeCardInvite, exports.revokeCardInviteSuccess = _a.revokeCardInviteSuccess, exports.revokeCardInviteFailure = _a.revokeCardInviteFailure, exports.updateChargeCardsSpendLimit = _a.updateChargeCardsSpendLimit, exports.updateChargeCardsSpendLimitSuccessOrFailure = _a.updateChargeCardsSpendLimitSuccessOrFailure, exports.lockChargeCards = _a.lockChargeCards, exports.lockChargeCardsSuccessOrFailure = _a.lockChargeCardsSuccessOrFailure, exports.unlockChargeCards = _a.unlockChargeCards, exports.unlockChargeCardsSuccessOrFailure = _a.unlockChargeCardsSuccessOrFailure, exports.closeChargeCards = _a.closeChargeCards, exports.closeChargeCardsSuccessOrFailure = _a.closeChargeCardsSuccessOrFailure, exports.revokeChargeCardsInvite = _a.revokeChargeCardsInvite, exports.revokeChargeCardsInviteSuccessOrFailure = _a.revokeChargeCardsInviteSuccessOrFailure;
334
315
  exports.default = chargeCardList.reducer;
335
316
  // helper
336
317
  const toCreditAccount = (payload) => ({
@@ -17,21 +17,18 @@ const fetchChargeCardListPageEpic = (actions$, state$) => actions$.pipe((0, oper
17
17
  const state = state$.value;
18
18
  const cashbackDetailState = state.cashbackDetailState;
19
19
  if (cacheOverride === true) {
20
- // Forward cacheOverride to all sub-fetches to prevent skeleton flash.
21
20
  if (doFetchCreditAccountsDebitSummaryAndCashback === true) {
22
21
  if (isCreditCardEnabled) {
23
- chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccount)(true));
24
- chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)(true));
22
+ chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccount)());
23
+ chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchCreditAccountRepayment)());
25
24
  }
26
25
  if (isDebitCardEnabled) {
27
- chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchDebitCardSummary)(true));
26
+ chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchDebitCardSummary)());
28
27
  }
29
- chargeCardListPageAction.push((0, cashbackDetailReducer_1.fetchCashbackDetail)(true));
28
+ chargeCardListPageAction.push((0, cashbackDetailReducer_1.fetchCashbackDetail)());
30
29
  }
31
- chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchChargeCardList)(true));
32
- // Config participates in the list page's reduceFetchState — needs cacheOverride.
33
- chargeCardListPageAction.push((0, chargeCardConfigReducer_1.fetchChargeCardConfig)(true));
34
- // These don't participate in the list page's reduceFetchState.
30
+ chargeCardListPageAction.push((0, chargeCardListReducer_1.fetchChargeCardList)());
31
+ chargeCardListPageAction.push((0, chargeCardConfigReducer_1.fetchChargeCardConfig)());
35
32
  chargeCardListPageAction.push((0, userListViewReducer_1.fetchUserListByType)('cardHolderCandidate', true));
36
33
  chargeCardListPageAction.push((0, userListViewReducer_1.fetchUserListByType)('cardAdmin', true));
37
34
  chargeCardListPageAction.push((0, classListReducer_1.fetchClassList)());
@@ -8,9 +8,7 @@ export declare const addRepaymentToChargeCardPaymentHistory: import("@reduxjs/to
8
8
  zeniCreditAccountId: ID;
9
9
  }, "chargeCardPaymentHistory/addRepaymentToChargeCardPaymentHistory">, fetchChargeCardPaymentPage: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: any], {
10
10
  cacheOverride: any;
11
- }, "chargeCardPaymentHistory/fetchChargeCardPaymentPage", never, never>, fetchChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[cacheOverride?: boolean | undefined], {
12
- cacheOverride: boolean;
13
- }, "chargeCardPaymentHistory/fetchChargeCardPaymentHistory", never, never>, updateChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardPaymentHistoryPayload, "chargeCardPaymentHistory/updateChargeCardPaymentHistory">, updateChargeCardPaymentHistoryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardPaymentHistory/updateChargeCardPaymentHistoryFailure">, clearChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardPaymentHistory/clearChargeCardPaymentHistory">, updatePaymentHistoryFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
11
+ }, "chargeCardPaymentHistory/fetchChargeCardPaymentPage", never, never>, fetchChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardPaymentHistory/fetchChargeCardPaymentHistory">, updateChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithPayload<ChargeCardPaymentHistoryPayload, "chargeCardPaymentHistory/updateChargeCardPaymentHistory">, updateChargeCardPaymentHistoryFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "chargeCardPaymentHistory/updateChargeCardPaymentHistoryFailure">, clearChargeCardPaymentHistory: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"chargeCardPaymentHistory/clearChargeCardPaymentHistory">, updatePaymentHistoryFilters: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
14
12
  filters: PaymentHistoryFilters;
15
13
  }, "chargeCardPaymentHistory/updatePaymentHistoryFilters">, updatePaymentHistorySearchText: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "chargeCardPaymentHistory/updatePaymentHistorySearchText">, updatePaymentHistoryDownloadUIState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
16
14
  uiState: Partial<ChargeCardPaymentHistoryDownloadUIState>;