@zeniai/client-epic-state 5.0.82-betaAS1 → 5.0.83-betaRR0
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/common/aiCfo/aiCfoSuggestedQuestionsPageContext.d.ts +1 -1
- package/lib/entity/aiCfo/aiCfoPayload.d.ts +140 -1
- package/lib/entity/aiCfo/aiCfoReducer.d.ts +23 -2
- package/lib/entity/aiCfo/aiCfoReducer.js +328 -5
- package/lib/entity/aiCfo/aiCfoSelector.d.ts +13 -1
- package/lib/entity/aiCfo/aiCfoSelector.js +28 -1
- package/lib/entity/aiCfo/aiCfoState.d.ts +225 -4
- package/lib/entity/aiCfo/aiCfoState.js +30 -1
- package/lib/entity/cardPolicy/cardPolicyPayload.d.ts +277 -0
- package/lib/entity/cardPolicy/cardPolicyPayload.js +143 -0
- package/lib/entity/cardPolicy/cardPolicyReducer.d.ts +19 -0
- package/lib/entity/cardPolicy/cardPolicyReducer.js +175 -0
- package/lib/entity/cardPolicy/cardPolicySelector.d.ts +32 -0
- package/lib/entity/cardPolicy/cardPolicySelector.js +99 -0
- package/lib/entity/cardPolicy/cardPolicyState.d.ts +205 -0
- package/lib/entity/cardPolicy/cardPolicyState.js +14 -0
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.d.ts +18 -0
- package/lib/entity/cardPolicy/extractPolicyDocumentEpic.js +68 -0
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.d.ts +26 -0
- package/lib/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +47 -0
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.d.ts +25 -0
- package/lib/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +39 -0
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.d.ts +23 -0
- package/lib/entity/cardPolicy/policyRecommendationFromUploadEpic.js +104 -0
- package/lib/entity/jeSchedules/jeSchedulesTypes.d.ts +1 -1
- package/lib/entity/monthEndCloseChecks/monthEndCloseChecksState.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/entity/tenant/clearAllEpic.d.ts +6 -2
- package/lib/entity/tenant/clearAllEpic.js +8 -0
- package/lib/entity/tenant/tenantPayload.d.ts +0 -3
- package/lib/entity/tenant/tenantReducer.d.ts +1 -1
- package/lib/entity/tenant/tenantReducer.js +3 -23
- package/lib/entity/tenant/tenantState.d.ts +0 -3
- package/lib/epic.d.ts +11 -3
- package/lib/epic.js +11 -3
- package/lib/esm/entity/aiCfo/aiCfoReducer.js +328 -5
- package/lib/esm/entity/aiCfo/aiCfoSelector.js +26 -1
- package/lib/esm/entity/aiCfo/aiCfoState.js +27 -0
- package/lib/esm/entity/cardPolicy/cardPolicyPayload.js +130 -0
- package/lib/esm/entity/cardPolicy/cardPolicyReducer.js +171 -0
- package/lib/esm/entity/cardPolicy/cardPolicySelector.js +75 -0
- package/lib/esm/entity/cardPolicy/cardPolicyState.js +9 -0
- package/lib/esm/entity/cardPolicy/extractPolicyDocumentEpic.js +64 -0
- package/lib/esm/entity/cardPolicy/fetchCardPolicyVendorOptionsEpic.js +43 -0
- package/lib/esm/entity/cardPolicy/policyDocumentExtractionToRecommendationBridgeEpic.js +35 -0
- package/lib/esm/entity/cardPolicy/policyRecommendationFromUploadEpic.js +100 -0
- package/lib/esm/entity/snackbar/snackbarTypes.js +3 -0
- package/lib/esm/entity/tenant/clearAllEpic.js +8 -0
- package/lib/esm/entity/tenant/tenantReducer.js +2 -22
- package/lib/esm/epic.js +11 -3
- package/lib/esm/index.js +29 -11
- package/lib/esm/reducer.js +12 -0
- package/lib/esm/view/aiCfoView/aiCfoViewReducer.js +6 -3
- package/lib/esm/view/aiCfoView/epics/createSessionAndSubmitEpic.js +5 -2
- package/lib/esm/view/aiCfoView/epics/createSessionEpic.js +2 -1
- package/lib/esm/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +12 -2
- package/lib/esm/view/dashboard/dashboardReducer.js +5 -1
- package/lib/esm/view/dashboard/dashboardSelector.js +2 -1
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +70 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +22 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +56 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +49 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +42 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +72 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +21 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +56 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +45 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +39 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +53 -0
- package/lib/esm/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +25 -0
- package/lib/esm/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +25 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +1 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +62 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +47 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +2 -2
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +62 -4
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +61 -0
- package/lib/esm/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +69 -0
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +1 -45
- package/lib/index.d.ts +28 -11
- package/lib/index.js +154 -29
- package/lib/reducer.d.ts +12 -0
- package/lib/reducer.js +12 -0
- package/lib/view/aiCfoView/aiCfoViewReducer.d.ts +11 -2
- package/lib/view/aiCfoView/aiCfoViewReducer.js +6 -3
- package/lib/view/aiCfoView/epics/createSessionAndSubmitEpic.js +5 -2
- package/lib/view/aiCfoView/epics/createSessionEpic.js +2 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.d.ts +8 -1
- package/lib/view/aiCfoView/epics/fetchSuggestedQuestionsEpic.js +12 -2
- package/lib/view/dashboard/dashboardReducer.d.ts +1 -1
- package/lib/view/dashboard/dashboardReducer.js +6 -2
- package/lib/view/dashboard/dashboardSelector.d.ts +1 -0
- package/lib/view/dashboard/dashboardSelector.js +2 -1
- package/lib/view/dashboard/dashboardState.d.ts +1 -0
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/expenseAutomationView/types/reconciliationViewState.d.ts +1 -1
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/scheduleView/scheduleListView/scheduleListTypes.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js +74 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.d.ts +21 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js +28 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts +25 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.d.ts +19 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/fetchCardPolicyDetailEpic.js +60 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.d.ts +18 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/updateCardPolicyEpic.js +53 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.d.ts +16 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/archiveCardPolicyEpic.js +46 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer.js +76 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.d.ts +21 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListSelector.js +27 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.d.ts +19 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.d.ts +19 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyList/fetchCardPolicyListEpic.js +60 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.d.ts +13 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer.js +49 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.d.ts +32 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicySelector.js +46 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.d.ts +45 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState.js +2 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.d.ts +25 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyTemplateEpic.js +57 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.d.ts +15 -0
- package/lib/view/spendManagement/chargeCards/cardPolicy/createCardPolicy/fetchCardPolicyMccCategoriesEpic.js +29 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.d.ts +14 -0
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardListSelector.js +27 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.d.ts +79 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/aiCardCreationFormDraftTypes.js +2 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.d.ts +25 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/buildAiCardCreationFormDraftSeed.js +66 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.d.ts +26 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/deriveAiCardRowsFromTeams.js +51 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.d.ts +2 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardEpic.js +1 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.d.ts +12 -2
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardReducer.js +63 -5
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.d.ts +42 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardSelector.js +68 -1
- package/lib/view/spendManagement/chargeCards/issueChargeCard/issueChargeCardState.d.ts +18 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.d.ts +11 -0
- package/lib/view/spendManagement/chargeCards/issueChargeCard/toIssueChargeCardLocalDataFromDraft.js +73 -0
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.d.ts +1 -1
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewReducer.js +2 -46
- package/lib/view/spendManagement/treasury/treasurySetUp/treasurySetupViewState.d.ts +0 -2
- package/lib/view/taskManager/taskListView/taskListReducer.d.ts +1 -1
- package/package.json +1 -1
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -18
- package/lib/esm/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -18
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoIntroClosedByOutsideClickEpic.js +0 -22
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.d.ts +0 -8
- package/lib/view/spendManagement/treasury/treasurySetUp/epic/updateTreasuryPromoRemindMeLaterClickedEpic.js +0 -22
package/lib/reducer.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { BillTransactionState } from './entity/billPay/billTransaction/billTrans
|
|
|
10
10
|
import { ContactState } from './entity/billPay/contact/contact';
|
|
11
11
|
import { RecurringBillState } from './entity/billPay/recurringBills/recurringBillsState';
|
|
12
12
|
import { CardPaymentState } from './entity/cardPayment/cardPaymentState';
|
|
13
|
+
import { CardPolicyState } from './entity/cardPolicy/cardPolicyState';
|
|
13
14
|
import { ChargeCardState } from './entity/chargeCard/chargeCard';
|
|
14
15
|
import { ChargeCardRepaymentState } from './entity/chargeCardRepayment/chargeCardRepayment';
|
|
15
16
|
import { ChargeCardTransactionState } from './entity/chargeCardTransaction/chargeCardTransaction';
|
|
@@ -83,6 +84,9 @@ import { BankAccountViewState } from './view/bankAccountView/bankAccountViewStat
|
|
|
83
84
|
import { BillPayCardState } from './view/billPayCard/billPayCardState';
|
|
84
85
|
import { CardBalanceState } from './view/cardBalance/cardBalanceState';
|
|
85
86
|
import { CardPaymentViewState } from './view/cardPayment/cardPaymentViewState';
|
|
87
|
+
import { CardPolicyDetailState } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState';
|
|
88
|
+
import { CardPolicyListState } from './view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListState';
|
|
89
|
+
import { CreateCardPolicyState } from './view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyState';
|
|
86
90
|
import { CashBalanceState } from './view/cashBalance/cashBalanceState';
|
|
87
91
|
import { CashFlowState } from './view/cashFlow/cashFlowState';
|
|
88
92
|
import { CashInCashOutState } from './view/cashInCashOut/cashInCashOutState';
|
|
@@ -235,6 +239,7 @@ type EntitiesState = {
|
|
|
235
239
|
bankAccountState: BankAccountState;
|
|
236
240
|
billTransactionState: BillTransactionState;
|
|
237
241
|
cardPaymentState: CardPaymentState;
|
|
242
|
+
cardPolicyState: CardPolicyState;
|
|
238
243
|
chargeCardRepaymentState: ChargeCardRepaymentState;
|
|
239
244
|
chargeCardState: ChargeCardState;
|
|
240
245
|
chargeCardTransactionState: ChargeCardTransactionState;
|
|
@@ -319,6 +324,8 @@ type ViewsState = {
|
|
|
319
324
|
cannedResponsesState: CannedResponsesViewState;
|
|
320
325
|
cardBalanceState: CardBalanceState;
|
|
321
326
|
cardPaymentViewState: CardPaymentViewState;
|
|
327
|
+
cardPolicyDetailState: CardPolicyDetailState;
|
|
328
|
+
cardPolicyListState: CardPolicyListState;
|
|
322
329
|
cardUserOnboardingState: CardUserOnboardingState;
|
|
323
330
|
cashbackDetailState: CashbackDetailState;
|
|
324
331
|
cashBalanceState: CashBalanceState;
|
|
@@ -342,6 +349,7 @@ type ViewsState = {
|
|
|
342
349
|
companyTaskManagerViewState: CompanyTaskManagerViewState;
|
|
343
350
|
companyViewState: CompanyViewState;
|
|
344
351
|
countryListState: CountryListState;
|
|
352
|
+
createCardPolicyState: CreateCardPolicyState;
|
|
345
353
|
createTransferEntryState: CreateTransferEntryState;
|
|
346
354
|
creditAgentEntityState: CreditAgentEntityState;
|
|
347
355
|
creditAgentViewState: CreditAgentViewState;
|
|
@@ -480,6 +488,8 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
480
488
|
billsBulkActionViewState: BillsBulkActionViewState;
|
|
481
489
|
cardBalanceState: CardBalanceState;
|
|
482
490
|
cardPaymentViewState: CardPaymentViewState;
|
|
491
|
+
cardPolicyDetailState: CardPolicyDetailState;
|
|
492
|
+
cardPolicyListState: CardPolicyListState;
|
|
483
493
|
cardUserOnboardingState: CardUserOnboardingState;
|
|
484
494
|
cashbackDetailState: CashbackDetailState;
|
|
485
495
|
cashBalanceState: CashBalanceState;
|
|
@@ -503,6 +513,7 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
503
513
|
companyTaskManagerViewState: CompanyTaskManagerViewState;
|
|
504
514
|
companyViewState: CompanyViewState;
|
|
505
515
|
countryListState: CountryListState;
|
|
516
|
+
createCardPolicyState: CreateCardPolicyState;
|
|
506
517
|
creditAgentEntityState: CreditAgentEntityState;
|
|
507
518
|
creditAgentViewState: CreditAgentViewState;
|
|
508
519
|
dashboardState: DashboardState;
|
|
@@ -627,6 +638,7 @@ declare const reducers: import("redux").Reducer<import("redux").CombinedState<{
|
|
|
627
638
|
billPayConfigState: BillPayConfigState;
|
|
628
639
|
billTransactionState: BillTransactionState;
|
|
629
640
|
cardPaymentState: CardPaymentState;
|
|
641
|
+
cardPolicyState: CardPolicyState;
|
|
630
642
|
chargeCardState: ChargeCardState;
|
|
631
643
|
chargeCardRepaymentState: ChargeCardRepaymentState;
|
|
632
644
|
chargeCardTransactionState: ChargeCardTransactionState;
|
package/lib/reducer.js
CHANGED
|
@@ -50,6 +50,7 @@ const billTransactionReducer_1 = __importStar(require("./entity/billPay/billTran
|
|
|
50
50
|
const contactReducer_1 = __importStar(require("./entity/billPay/contact/contactReducer"));
|
|
51
51
|
const recurringBillsReducer_1 = __importStar(require("./entity/billPay/recurringBills/recurringBillsReducer"));
|
|
52
52
|
const cardPaymentReducer_1 = __importStar(require("./entity/cardPayment/cardPaymentReducer"));
|
|
53
|
+
const cardPolicyReducer_1 = __importStar(require("./entity/cardPolicy/cardPolicyReducer"));
|
|
53
54
|
const chargeCardReducer_1 = __importStar(require("./entity/chargeCard/chargeCardReducer"));
|
|
54
55
|
const chargeCardRepaymentReducer_1 = __importStar(require("./entity/chargeCardRepayment/chargeCardRepaymentReducer"));
|
|
55
56
|
const chargeCardTransactionReducer_1 = __importStar(require("./entity/chargeCardTransaction/chargeCardTransactionReducer"));
|
|
@@ -123,6 +124,9 @@ const bankAccountViewReducer_1 = __importStar(require("./view/bankAccountView/ba
|
|
|
123
124
|
const billPayCardReducer_1 = __importStar(require("./view/billPayCard/billPayCardReducer"));
|
|
124
125
|
const cardBalanceReducer_1 = __importStar(require("./view/cardBalance/cardBalanceReducer"));
|
|
125
126
|
const cardPaymentViewReducer_1 = __importStar(require("./view/cardPayment/cardPaymentViewReducer"));
|
|
127
|
+
const cardPolicyDetailReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer"));
|
|
128
|
+
const cardPolicyListReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardPolicy/cardPolicyList/cardPolicyListReducer"));
|
|
129
|
+
const createCardPolicyReducer_1 = __importStar(require("./view/spendManagement/chargeCards/cardPolicy/createCardPolicy/createCardPolicyReducer"));
|
|
126
130
|
const cashBalanceReducer_1 = __importStar(require("./view/cashBalance/cashBalanceReducer"));
|
|
127
131
|
const cashFlowReducer_1 = __importStar(require("./view/cashFlow/cashFlowReducer"));
|
|
128
132
|
const cashInCashOutReducer_1 = __importStar(require("./view/cashInCashOut/cashInCashOutReducer"));
|
|
@@ -277,6 +281,7 @@ const initialEntitiesState = {
|
|
|
277
281
|
bankAccountState: bankAccountReducer_1.initialState,
|
|
278
282
|
billTransactionState: billTransactionReducer_1.initialState,
|
|
279
283
|
cardPaymentState: cardPaymentReducer_1.initialState,
|
|
284
|
+
cardPolicyState: cardPolicyReducer_1.initialState,
|
|
280
285
|
chargeCardState: chargeCardReducer_1.initialState,
|
|
281
286
|
chargeCardRepaymentState: chargeCardRepaymentReducer_1.initialState,
|
|
282
287
|
chargeCardTransactionState: chargeCardTransactionReducer_1.initialState,
|
|
@@ -361,6 +366,8 @@ const initialViewsState = {
|
|
|
361
366
|
billsBulkActionViewState: billsBulkActionViewReducer_1.initialState,
|
|
362
367
|
cardBalanceState: cardBalanceReducer_1.initialState,
|
|
363
368
|
cardPaymentViewState: cardPaymentViewReducer_1.initialState,
|
|
369
|
+
cardPolicyDetailState: cardPolicyDetailReducer_1.initialState,
|
|
370
|
+
cardPolicyListState: cardPolicyListReducer_1.initialState,
|
|
364
371
|
cardUserOnboardingState: cardUserOnboardingReducer_1.initialState,
|
|
365
372
|
cashbackDetailState: cashbackDetailReducer_1.initialState,
|
|
366
373
|
cashBalanceState: cashBalanceReducer_1.initialState,
|
|
@@ -384,6 +391,7 @@ const initialViewsState = {
|
|
|
384
391
|
companyTaskManagerViewState: companyTaskManagerViewReducer_1.initialState,
|
|
385
392
|
companyViewState: companyViewReducer_1.initialState,
|
|
386
393
|
countryListState: countryListReducer_1.initialState,
|
|
394
|
+
createCardPolicyState: createCardPolicyReducer_1.initialState,
|
|
387
395
|
creditAgentEntityState: creditAgentReducer_1.initialCreditAgentEntityState,
|
|
388
396
|
creditAgentViewState: creditAgentViewReducer_1.initialState,
|
|
389
397
|
dashboardLayoutState: dashboardLayoutReducer_1.initialState,
|
|
@@ -514,6 +522,7 @@ const entityReducers = {
|
|
|
514
522
|
billPayConfigState: billPayConfigReducer_1.default,
|
|
515
523
|
billTransactionState: billTransactionReducer_1.default,
|
|
516
524
|
cardPaymentState: cardPaymentReducer_1.default,
|
|
525
|
+
cardPolicyState: cardPolicyReducer_1.default,
|
|
517
526
|
chargeCardState: chargeCardReducer_1.default,
|
|
518
527
|
chargeCardRepaymentState: chargeCardRepaymentReducer_1.default,
|
|
519
528
|
chargeCardTransactionState: chargeCardTransactionReducer_1.default,
|
|
@@ -597,6 +606,8 @@ const viewReducers = {
|
|
|
597
606
|
billsBulkActionViewState: billsBulkActionViewReducer_1.default,
|
|
598
607
|
cardBalanceState: cardBalanceReducer_1.default,
|
|
599
608
|
cardPaymentViewState: cardPaymentViewReducer_1.default,
|
|
609
|
+
cardPolicyDetailState: cardPolicyDetailReducer_1.default,
|
|
610
|
+
cardPolicyListState: cardPolicyListReducer_1.default,
|
|
600
611
|
cardUserOnboardingState: cardUserOnboardingReducer_1.default,
|
|
601
612
|
cashbackDetailState: cashbackDetailReducer_1.default,
|
|
602
613
|
cashBalanceState: cashBalanceReducer_1.default,
|
|
@@ -620,6 +631,7 @@ const viewReducers = {
|
|
|
620
631
|
companyTaskManagerViewState: companyTaskManagerViewReducer_1.default,
|
|
621
632
|
companyViewState: companyViewReducer_1.default,
|
|
622
633
|
countryListState: countryListReducer_1.default,
|
|
634
|
+
createCardPolicyState: createCardPolicyReducer_1.default,
|
|
623
635
|
creditAgentEntityState: creditAgentReducer_1.default,
|
|
624
636
|
creditAgentViewState: creditAgentViewReducer_1.default,
|
|
625
637
|
dashboardState: dashboardReducer_1.default,
|
|
@@ -25,17 +25,18 @@ export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
25
25
|
}, "aiCfoView/updateResponseState">, updateAiCfoViewScrollPosition: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "aiCfoView/updateAiCfoViewScrollPosition">, updateCurrentInput: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "aiCfoView/updateCurrentInput">, clearInput: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"aiCfoView/clearInput">, setSession: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
26
26
|
agentId: string;
|
|
27
27
|
sessionId: string;
|
|
28
|
-
}, "aiCfoView/setSession">, createSession: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[agentId: string, userId: string, contextRefId?: string | undefined, contextType?: string | undefined], {
|
|
28
|
+
}, "aiCfoView/setSession">, createSession: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[agentId: string, userId: string, contextRefId?: string | undefined, contextType?: string | undefined, pageContext?: string | undefined], {
|
|
29
29
|
agentId: string;
|
|
30
30
|
contextRefId: string | undefined;
|
|
31
31
|
contextType: string | undefined;
|
|
32
|
+
pageContext: string | undefined;
|
|
32
33
|
userId: string;
|
|
33
34
|
}, "aiCfoView/createSession", never, never>, createSessionSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
34
35
|
agentId: string;
|
|
35
36
|
sessionId: ID;
|
|
36
37
|
contextMessage?: string;
|
|
37
38
|
contextStatus?: ContextStatus;
|
|
38
|
-
}, "aiCfoView/createSessionSuccess">, createSessionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "aiCfoView/createSessionFailure">, createSessionAndSubmit: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[agentId: string, userId: string, questionAnswerId: string, questionId: string, createdAt: import("dayjs").Dayjs, question: string, files?: File[] | undefined], {
|
|
39
|
+
}, "aiCfoView/createSessionSuccess">, createSessionFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<ZeniAPIStatus<Record<string, unknown>>, "aiCfoView/createSessionFailure">, createSessionAndSubmit: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[agentId: string, userId: string, questionAnswerId: string, questionId: string, createdAt: import("dayjs").Dayjs, question: string, files?: File[] | undefined, pageContext?: string | undefined], {
|
|
39
40
|
agentId: string;
|
|
40
41
|
userId: string;
|
|
41
42
|
questionAnswerId: string;
|
|
@@ -43,6 +44,7 @@ export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
43
44
|
createdAt: import("dayjs").Dayjs;
|
|
44
45
|
question: string;
|
|
45
46
|
files: File[] | undefined;
|
|
47
|
+
pageContext: string | undefined;
|
|
46
48
|
}, "aiCfoView/createSessionAndSubmit", never, never>, initializeNewSessionState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
47
49
|
agentId: string;
|
|
48
50
|
sessionId: ID;
|
|
@@ -92,6 +94,13 @@ export declare const submitQuestion: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
92
94
|
questionAnswerId: ID;
|
|
93
95
|
}, "aiCfoView/updateCotCollapsedState">, fetchSuggestedQuestions: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
94
96
|
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
97
|
+
/**
|
|
98
|
+
* AI Card Creation flow: when true, the epic appends `&no_card_created=true`
|
|
99
|
+
* so the backend tailors prompts for a tenant that has not yet created a
|
|
100
|
+
* card. The bucket key is unchanged (`pageContext`); see
|
|
101
|
+
* `useFetchSuggestedQuestionsWhenReady` for the refetch-on-flag-flip rule.
|
|
102
|
+
*/
|
|
103
|
+
noCardCreated?: boolean;
|
|
95
104
|
}, "aiCfoView/fetchSuggestedQuestions">, fetchSuggestedQuestionsSuccess: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
96
105
|
generatedAt: string;
|
|
97
106
|
pageContext: AiCfoSuggestedQuestionsPageContext;
|
|
@@ -192,8 +192,10 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
192
192
|
draft.createSessionState.fetchState = 'In-Progress';
|
|
193
193
|
draft.createSessionState.error = undefined;
|
|
194
194
|
},
|
|
195
|
-
prepare(agentId, userId, contextRefId, contextType) {
|
|
196
|
-
return {
|
|
195
|
+
prepare(agentId, userId, contextRefId, contextType, pageContext) {
|
|
196
|
+
return {
|
|
197
|
+
payload: { agentId, contextRefId, contextType, pageContext, userId },
|
|
198
|
+
};
|
|
197
199
|
},
|
|
198
200
|
},
|
|
199
201
|
createSessionSuccess(draft, action) {
|
|
@@ -224,7 +226,7 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
224
226
|
draft.createSessionAndSubmitState.fetchState = 'In-Progress';
|
|
225
227
|
draft.createSessionAndSubmitState.error = undefined;
|
|
226
228
|
},
|
|
227
|
-
prepare(agentId, userId, questionAnswerId, questionId, createdAt, question, files) {
|
|
229
|
+
prepare(agentId, userId, questionAnswerId, questionId, createdAt, question, files, pageContext) {
|
|
228
230
|
return {
|
|
229
231
|
payload: {
|
|
230
232
|
agentId,
|
|
@@ -234,6 +236,7 @@ const aiCfoView = (0, toolkit_1.createSlice)({
|
|
|
234
236
|
createdAt,
|
|
235
237
|
question,
|
|
236
238
|
files,
|
|
239
|
+
pageContext,
|
|
237
240
|
},
|
|
238
241
|
};
|
|
239
242
|
},
|
|
@@ -69,8 +69,11 @@ function waitForChannelSubscription(pusherInstance, channelName, timeoutMs = 500
|
|
|
69
69
|
}));
|
|
70
70
|
}
|
|
71
71
|
const createSessionAndSubmitEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.createSessionAndSubmit.match), (0, operators_1.switchMap)((action) => {
|
|
72
|
-
const { agentId, userId, questionAnswerId, questionId, createdAt, question, files, } = action.payload;
|
|
73
|
-
const payload = {
|
|
72
|
+
const { agentId, userId, questionAnswerId, questionId, createdAt, question, files, pageContext, } = action.payload;
|
|
73
|
+
const payload = {
|
|
74
|
+
agent_id: agentId,
|
|
75
|
+
...(pageContext != null && { page_context: pageContext }),
|
|
76
|
+
};
|
|
74
77
|
return zeniAPI
|
|
75
78
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/sessions`, payload)
|
|
76
79
|
.pipe((0, operators_1.mergeMap)((response) => {
|
|
@@ -8,11 +8,12 @@ const responsePayload_1 = require("../../../responsePayload");
|
|
|
8
8
|
const zeniDayJS_1 = require("../../../zeniDayJS");
|
|
9
9
|
const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
|
|
10
10
|
const createSessionEpic = (actions$, _, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.createSession.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
-
const { agentId, contextRefId, contextType, userId } = action.payload;
|
|
11
|
+
const { agentId, contextRefId, contextType, pageContext, userId } = action.payload;
|
|
12
12
|
const payload = {
|
|
13
13
|
agent_id: agentId,
|
|
14
14
|
...(contextRefId != null && { context_ref_id: contextRefId }),
|
|
15
15
|
...(contextType != null && { context_type: contextType }),
|
|
16
|
+
...(pageContext != null && { page_context: pageContext }),
|
|
16
17
|
};
|
|
17
18
|
return zeniAPI
|
|
18
19
|
.postAndGetJSON(`${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/sessions`, payload)
|
|
@@ -4,5 +4,12 @@ import { RootState } from '../../../reducer';
|
|
|
4
4
|
import { ZeniAPI } from '../../../zeniAPI';
|
|
5
5
|
import { fetchSuggestedQuestions, fetchSuggestedQuestionsFailure, fetchSuggestedQuestionsSuccess } from '../aiCfoViewReducer';
|
|
6
6
|
export type ActionType = ReturnType<typeof fetchSuggestedQuestions> | ReturnType<typeof fetchSuggestedQuestionsSuccess> | ReturnType<typeof fetchSuggestedQuestionsFailure>;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=...
|
|
9
|
+
*
|
|
10
|
+
* Appends `&no_card_created=true` when the action payload sets
|
|
11
|
+
* `noCardCreated: true` (AI Card Creation flow on the cards list — the tenant
|
|
12
|
+
* has not yet created any card). Any other value omits the flag entirely so
|
|
13
|
+
* the existing call sites continue to issue the unchanged request.
|
|
14
|
+
*/
|
|
8
15
|
export declare const fetchSuggestedQuestionsEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -5,13 +5,23 @@ const rxjs_1 = require("rxjs");
|
|
|
5
5
|
const operators_1 = require("rxjs/operators");
|
|
6
6
|
const responsePayload_1 = require("../../../responsePayload");
|
|
7
7
|
const aiCfoViewReducer_1 = require("../aiCfoViewReducer");
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* GET {aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?page_context=...
|
|
10
|
+
*
|
|
11
|
+
* Appends `&no_card_created=true` when the action payload sets
|
|
12
|
+
* `noCardCreated: true` (AI Card Creation flow on the cards list — the tenant
|
|
13
|
+
* has not yet created any card). Any other value omits the flag entirely so
|
|
14
|
+
* the existing call sites continue to issue the unchanged request.
|
|
15
|
+
*/
|
|
9
16
|
const fetchSuggestedQuestionsEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(aiCfoViewReducer_1.fetchSuggestedQuestions.match),
|
|
10
17
|
// mergeMap (not switchMap): each page_context is keyed separately in Redux; switchMap
|
|
11
18
|
// would cancel in-flight HTTP for context A when B is requested, leaving A stuck In-Progress.
|
|
12
19
|
(0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const { pageContext } = action.payload;
|
|
20
|
+
const { pageContext, noCardCreated } = action.payload;
|
|
14
21
|
const query = new URLSearchParams({ page_context: pageContext });
|
|
22
|
+
if (noCardCreated === true) {
|
|
23
|
+
query.set('no_card_created', 'true');
|
|
24
|
+
}
|
|
15
25
|
const url = `${zeniAPI.apiEndPoints.aiCfoMicroServiceBaseUrl}/1.0/suggested-questions?${query.toString()}`;
|
|
16
26
|
return zeniAPI.getJSON(url).pipe((0, operators_1.mergeMap)((response) => {
|
|
17
27
|
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
@@ -7,6 +7,6 @@ export declare const fetchDashboard: import("@reduxjs/toolkit").ActionCreatorWit
|
|
|
7
7
|
fetchFullReport: any;
|
|
8
8
|
cacheOverride: any;
|
|
9
9
|
excludeResources: ("cash_balance" | "card_balance" | "expense_automation_card" | "operating_expenses" | "operating_expenses_by_classes" | "revenue" | "revenue_by_classes" | "net_burn_or_income" | "net_burn_or_income_story_card" | "net_burn_or_income_by_classes" | "cash_position" | "top_expenses" | "profit_and_loss" | "profit_and_loss_by_classes" | "profit_and_loss_by_projects" | "balance_sheet" | "cash_flow" | "dashboard" | "finance_statement" | "transaction_list_of_account" | "transaction_list_missing_receipt" | "transaction_list_of_account_by_class" | "transaction_list_of_account_by_project" | "transaction_detail" | "cash_in_cash_out" | "insights_dashboard" | "company_details" | "class_list" | "account_list" | "account_list_by_type" | "vendor" | "task_card" | "bill_pay" | "reimbursement" | "bill_pay_card" | "reimbursement_card" | "bill_pay_promo_card" | "zeni_accounts" | "zeni_accounts_promo_card" | "zeni_treasury" | "charge_cards" | "other_connection" | "reimbursement_promo_card" | "onboarding" | "operating_expenses_by_vendor" | "operating_expenses_by_vendor_summary" | "vendors_tab" | "accounts_payable_aging" | "accounts_receivable_aging" | "vendor_global_review" | "prepaid_expenses" | "fixed_assets" | "notification" | "rewards_card" | "billing" | "flux_analysis_operating_expense" | "account_reconciliation" | "zeni_credit_promo_card" | "treasury_promo_card" | "excluded_account_reconciliation" | "transfer_accounts" | "credit_card_transfer_accounts")[];
|
|
10
|
-
}, "dashboard/fetchDashboard", never, never>, clearDashboard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"dashboard/clearDashboard">;
|
|
10
|
+
}, "dashboard/fetchDashboard", never, never>, updateTreasuryVideoClosed: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"dashboard/updateTreasuryVideoClosed">, clearDashboard: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"dashboard/clearDashboard">;
|
|
11
11
|
declare const _default: import("redux").Reducer<DashboardState>;
|
|
12
12
|
export default _default;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.clearDashboard = exports.fetchDashboard = exports.initialState = void 0;
|
|
4
|
+
exports.clearDashboard = exports.updateTreasuryVideoClosed = exports.fetchDashboard = exports.initialState = void 0;
|
|
5
5
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
6
|
const zeniDayJS_1 = require("../../zeniDayJS");
|
|
7
7
|
exports.initialState = {
|
|
8
8
|
lastFetchRequestTime: undefined,
|
|
9
|
+
isTreasuryVideoClosed: false,
|
|
9
10
|
};
|
|
10
11
|
const dashboard = (0, toolkit_1.createSlice)({
|
|
11
12
|
name: 'dashboard',
|
|
@@ -28,10 +29,13 @@ const dashboard = (0, toolkit_1.createSlice)({
|
|
|
28
29
|
};
|
|
29
30
|
},
|
|
30
31
|
},
|
|
32
|
+
updateTreasuryVideoClosed(draft) {
|
|
33
|
+
draft.isTreasuryVideoClosed = true;
|
|
34
|
+
},
|
|
31
35
|
clearDashboard(draft) {
|
|
32
36
|
Object.assign(draft, exports.initialState);
|
|
33
37
|
},
|
|
34
38
|
},
|
|
35
39
|
});
|
|
36
|
-
_a = dashboard.actions, exports.fetchDashboard = _a.fetchDashboard, exports.clearDashboard = _a.clearDashboard;
|
|
40
|
+
_a = dashboard.actions, exports.fetchDashboard = _a.fetchDashboard, exports.updateTreasuryVideoClosed = _a.updateTreasuryVideoClosed, exports.clearDashboard = _a.clearDashboard;
|
|
37
41
|
exports.default = dashboard.reducer;
|
|
@@ -6,6 +6,7 @@ import { CardType } from './dashboardState';
|
|
|
6
6
|
export interface DashboardReport extends SelectorReport {
|
|
7
7
|
cardsForDashboardUI: CardType[];
|
|
8
8
|
cardsOrdered: CardType[];
|
|
9
|
+
isTreasuryVideoClosed: boolean;
|
|
9
10
|
reportsInOrder: (SelectorReport | SelectorView)[];
|
|
10
11
|
tenantsOrdered: TenantsOrdered;
|
|
11
12
|
currentTenant?: Tenant;
|
|
@@ -45,7 +45,7 @@ const tenantSelector = (0, toolkit_1.createSelector)(tenantSelector_1.getTenants
|
|
|
45
45
|
exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalanceSelector_1.getCardBalance, cashBalanceSelector_1.getCashBalance, getOperatingExpensesForLast5Periods, getRevenueForLast4Periods, topExSelector_1.getTop6Expenses, getNetBurnOrIncomeForLast4Periods, getNetBurnOrIncomeStoryCard, getCashPositionLast5Periods, getCashInCashOutLast4Periods, insightsCardSelector_1.getInsights, companyPassportViewSelector_1.getCompanyPassportView, tasksCardSelector_1.getTasksCardReport, billPayCardSelector_1.getBillPayCardReport, reimbursementCardSelector_1.getReimbursementCardReport, apAgingSelector, arAgingSelector, zeniAccountsPromoCardSelector_1.getZeniAccountsPromoCard, referralSelector_1.getRewardsPlanCard, dashboardLayoutSelector_1.getDashboardCardsOrdered, (state) => {
|
|
46
46
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
47
47
|
return (0, monthEndCloseChecksViewSelector_1.getMonthEndCloseChecksViewByTenantId)(state, currentTenant.tenantId);
|
|
48
|
-
}, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (_state, _additionalExcludedReports, signedInUser) => signedInUser, (_state, _excluded, _signedInUser, isExpenseAutomationFeatureEnabledV2) => isExpenseAutomationFeatureEnabledV2, (_state, _excluded, _signedInUser, _enabledV2, isExpenseAutomationFeatureEnabled) => isExpenseAutomationFeatureEnabled, (_state, _excluded, _signedInUser, _enabledV2, _enabled, isTreasuryFeatureEnabled) => isTreasuryFeatureEnabled, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, cards, monthEndCloseChecksView, tenantState, additionalExcludedReports, signedInUser, isExpenseAutomationFeatureEnabledV2, isExpenseAutomationFeatureEnabled, isTreasuryFeatureEnabled) => {
|
|
48
|
+
}, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (_state, _additionalExcludedReports, signedInUser) => signedInUser, (_state, _excluded, _signedInUser, isExpenseAutomationFeatureEnabledV2) => isExpenseAutomationFeatureEnabledV2, (_state, _excluded, _signedInUser, _enabledV2, isExpenseAutomationFeatureEnabled) => isExpenseAutomationFeatureEnabled, (_state, _excluded, _signedInUser, _enabledV2, _enabled, isTreasuryFeatureEnabled) => isTreasuryFeatureEnabled, (state) => state.dashboardState.isTreasuryVideoClosed, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, cards, monthEndCloseChecksView, tenantState, additionalExcludedReports, signedInUser, isExpenseAutomationFeatureEnabledV2, isExpenseAutomationFeatureEnabled, isTreasuryFeatureEnabled, isTreasuryVideoClosed) => {
|
|
49
49
|
const isReimbursementFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
|
|
50
50
|
.isReimbursementFeatureEnabled;
|
|
51
51
|
const isBillPayFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
|
|
@@ -276,5 +276,6 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
|
|
|
276
276
|
...tenants,
|
|
277
277
|
reportsInOrder,
|
|
278
278
|
cardsForDashboardUI: cardsCopy,
|
|
279
|
+
isTreasuryVideoClosed,
|
|
279
280
|
};
|
|
280
281
|
});
|
|
@@ -2,5 +2,6 @@ import { ReportID } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
|
2
2
|
import { ZeniDate } from '../../zeniDayJS';
|
|
3
3
|
export type CardType = ReportID | 'information_card' | 'zeni_promo_card' | 'expense_automation_card' | 'rewards_card';
|
|
4
4
|
export interface DashboardState {
|
|
5
|
+
isTreasuryVideoClosed: boolean;
|
|
5
6
|
lastFetchRequestTime?: ZeniDate;
|
|
6
7
|
}
|
package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare const getLineItemsByTransactionsIdsFromResponse: (transactions: S
|
|
|
39
39
|
export declare const getLineItemsByTransactionIdsFromLocalData: (transactionLocalData: TransactionReviewLocalDataSelectorView[], selectedTab: TransactionsTab) => Record<ID, string[]>;
|
|
40
40
|
export declare const mergeTabSpecificLineItems: (currentTabSpecificLineItems: TabSpecificLineItems, selectedTab: TransactionsTab, newLineItems: TabSpecificLineItems) => TabSpecificLineItems;
|
|
41
41
|
export declare const getSnackbarMessageForTransactionReview: (updatedCount: number, failedCount: number, categorizedCount: number) => {
|
|
42
|
-
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron";
|
|
42
|
+
messageSection: "common" | "transactionDetails_updatingPastTransactions" | "transactionDetails_transactionUpdated" | "cockpit_month_end_email_sent" | "cockpit_month_end_email_save" | "cockpit_month_end_email_attachment_upload" | "je_bill_link" | "je_posted" | "audit_score_updated" | "people_invite_people" | "people_invite_multiple_people" | "people_delete_person" | "people_update_person" | "reimbursement_updated" | "reimbursement_deleted" | "reimbursement_cancelled_deleted" | "reimbursement_cancelled" | "reimbursement_approved" | "reimbursement_rejected" | "reimbursement_sent_for_approval" | "account_added" | "business_verification_save" | "business_verification_submit" | "business_verification_from_bills_submit" | "plaid_connection" | "unlink_deposit_account" | "reimbursement_setup" | "reimbursement_approval_create" | "reimbursement_duplicate_approval_create" | "reimbursement_approval_update" | "reimbursement_duplicate_approval_update" | "reimbursement_approval_delete" | "reimbursement_create_mileage" | "reimbursement_update_mileage" | "reimbursement_accept_term" | "reimbursement_accept_employee_term" | "reimbursement_bulk_submit" | "reimbursement_bulk_processed" | "bill_pay_setup" | "zeni_accounts_setup" | "bill_pay_approval_create" | "bill_pay_duplicate_approval_create" | "bill_pay_approval_update" | "bill_pay_duplicate_approval_update" | "bill_pay_approval_delete" | "bill_pay_updated" | "bill_pay_deleted" | "bill_pay_cancelled_deleted" | "bill_pay_cancelled" | "bill_pay_approved" | "real_time_approver_added" | "bill_pay_rejected" | "bill_pay_sent_for_approval" | "bill_pay_accept_term" | "bill_pay_bulk_submit" | "bill_pay_bulk_processed" | "bill_pay_refund" | "bill_pay_retry" | "bill_pay_marked_as_paid" | "zeni_account_accept_term" | "update_vendor" | "data_refresh_update" | "delete_bank_account" | "create_bank_account" | "create_bank_account_ach" | "create_bank_account_wire" | "create_bank_account_international" | "transfer_money" | "update_zeni_account_nickname" | "create_checking_account" | "deposit_check" | "create_vendor" | "onboarding_customer_view" | "onboarding_customer_view_complete" | "onboarding_customer_identity_verification_save" | "onboarding_customer_identity_verification_submit" | "onboarding_customer_business_verification_save" | "onboarding_customer_business_verification_submit" | "retry_bank_account_connection" | "dashboard_invite_sent" | "onboarding_info_saved" | "approve_original_merchant" | "approve_global_merchant" | "reject_global_merchant" | "create_global_merchant" | "fetch_global_merchant_no_recommendation" | "save_vendor_renamed" | "save_vendor_sent_for_review" | "save_vendor_marked_as_employee" | "save_vendor_marked_as_local_contractor" | "charge_card_setup" | "charge_card_accept_term" | "charge_card_receipt_upload" | "charge_card_resend_invite" | "charge_card_revoke_invite" | "card_policy_created" | "card_policy_updated" | "card_policy_deleted" | "charge_card_update_limit" | "charge_cards_update_limit" | "close_charge_card" | "lock_charge_card" | "lock_charge_card_card_user" | "lock_charge_cards" | "unlock_charge_card" | "unlock_charge_card_card_user" | "unlock_charge_cards" | "close_charge_cards" | "revoke_invite_charge_cards" | "charge_card_express_interest" | "create_schedule" | "save_schedule" | "delete_schedule" | "ignore_schedule" | "save_task_detail" | "fetch_task_detail" | "delete_task" | "archive_task" | "snooze_task" | "unsnooze_task" | "create_tag" | "delete_tag" | "update_charge_card" | "update_charge_card_name" | "update_charge_card_name_card_user" | "issue_charge_card" | "issue_charge_cards" | "notification_settings_saved" | "referral_invite_sent" | "notification_mark_as_read" | "mark_as_complete_schedule" | "cancel_journal_entry" | "settings_accounting_accounts_updated" | "create_card_setup" | "confirm_card_setup" | "add_card_payment_source" | "fetch_payment_sources" | "task_assigned_toast_notification" | "task_due_tomorrow_toast_notification" | "task_deleted_toast_notification" | "task_archived_toast_notification" | "task_overdue_toast_notification" | "task_overdue_toast_notification_creator" | "task_notification_count" | "task_activities_toast_notification" | "task_created_toast_notification" | "task_group_creation_success" | "task_group_deletion_success" | "task_group_update_success" | "primary_funding_account_updated" | "task_time_spent_validation" | "missing_receipts_attachment" | "flux_analysis_unreviewed" | "flux_analysis_reviewed" | "receipt_match" | "receipts_upload" | "receipts_bulk_match" | "billing_address_view" | "express_pay_submit" | "exclude_transaction" | "reconcile" | "save_reconcile_for_later" | "recon_transaction_categorize" | "recon_transaction_match" | "update_debit_card_pin_attempt" | "set_debit_card_pin" | "ai_cfo_create_session_and_submit" | "ai_cfo_chat_session_deleted" | "charge_card_auto_pay_enable" | "charge_card_auto_pay_disable" | "treasury_setup" | "treasury_accept_term" | "treasury_transfer_money" | "treasury_transfer_money_failed" | "auto_transfer_rule_create" | "auto_transfer_rule_update" | "auto_transfer_rule_delete" | "auto_transfer_rule_pause" | "auto_transfer_rule_resume" | "treasury_update_portfolio_allocation" | "send_email_magic_link_to_user" | "complete_profile_done" | "create_transfer_entry" | "reports_resync" | "invalid_phone_number" | "transactions_categorized_updated_failed" | "transaction_categorized_updated_failed" | "transactionsCategorized_transactionsUpdated" | "transactionsCategorized_transactionUpdated" | "transactionCategorized_transactionsUpdated" | "transactionCategorized_transactionUpdated" | "transactionsCategorized_transactionsFailed" | "transactionsCategorized_transactionFailed" | "transactionCategorized_transactionsFailed" | "transactionCategorized_transactionFailed" | "transactionsUpdated_transactionsFailed" | "transactionsUpdated_transactionFailed" | "transactionUpdated_transactionsFailed" | "transactionUpdated_transactionFailed" | "transactionsCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionsUpdated_transactionFailed" | "transactionsCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionsUpdated_transactionsFailed" | "transactionsCategorized_transactionUpdated_transactionFailed" | "transactionCategorized_transactionsUpdated_transactionFailed" | "transactionCategorized_transactionUpdated_transactionsFailed" | "transactionCategorized_transactionUpdated_transactionFailed" | "accounting_classes_enabled_update" | "account_excluded_from_reconciliation" | "account_included_in_reconciliation" | "ai_accountant_trigger_job" | "oauth_consent_approve" | "oauth_consent_invalid_request" | "credit_agent_update_profile" | "credit_agent_save_macro" | "credit_agent_schedule_cron";
|
|
43
43
|
messageText: "notification" | "failed" | "success";
|
|
44
44
|
type: "error" | "success" | "info";
|
|
45
45
|
variables: {
|
|
@@ -20,7 +20,7 @@ export interface SaveReconciliationDetailFailurePayload {
|
|
|
20
20
|
error: ZeniAPIStatus;
|
|
21
21
|
fetchStateByAction: SaveReconcileDetailActionPayload;
|
|
22
22
|
}
|
|
23
|
-
export declare const toReconciliationTabsType: (v: string) => "
|
|
23
|
+
export declare const toReconciliationTabsType: (v: string) => "review" | "reconcile";
|
|
24
24
|
export declare type ReconciliationViewTabType = ReturnType<typeof toReconciliationTabsType>;
|
|
25
25
|
declare const toReconReconcileSortKeysType: (v: string) => "date" | "amount" | "type" | "account" | "memo" | "clearedDate" | "payee" | "transactionDirection" | "recommended";
|
|
26
26
|
export declare type ReconReconcileSortKey = ReturnType<typeof toReconReconcileSortKeysType>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare const toPeopleSortKeyType: (v: string) => "
|
|
1
|
+
declare const toPeopleSortKeyType: (v: string) => "department" | "name" | "role" | "manager" | "lastSeen";
|
|
2
2
|
export type PeopleViewSortKey = ReturnType<typeof toPeopleSortKeyType>;
|
|
3
3
|
export {};
|
|
@@ -7,7 +7,7 @@ export declare const getScheduleListKey: (selectedCategory: ID, selectedTimefram
|
|
|
7
7
|
export type ScheduleListKey = ReturnType<typeof getScheduleListKey>;
|
|
8
8
|
export declare const toScheduleSubTabType: (v: string) => "completed" | "new" | "ongoing" | "all";
|
|
9
9
|
export type ScheduleSubTabType = ReturnType<typeof toScheduleSubTabType>;
|
|
10
|
-
declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "
|
|
10
|
+
declare const toScheduleSortKeyType: (v: string) => "months" | "amount" | "vendor" | "status" | "class" | "user" | "createTime" | "memo" | "balanceAsOfToday" | "transactionDate" | "transactionType" | "assetId" | "scheduleCategory" | "startMonth" | "accruedExpenseCategory" | "expenseCategory" | "accumulatedDepreciationCategory" | "endMonth";
|
|
11
11
|
export declare type ScheduleListSortKey = ReturnType<typeof toScheduleSortKeyType>;
|
|
12
12
|
export interface DownloadJEScheduleTabOptions {
|
|
13
13
|
categoryId: ID;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FetchState } from '../../../../../commonStateTypes/common';
|
|
2
|
+
import { CreateCardPolicyTemplateRequest } from '../../../../../entity/cardPolicy/cardPolicyPayload';
|
|
3
|
+
import { ZeniAPIStatus } from '../../../../../responsePayload';
|
|
4
|
+
import { CardPolicyDetailState } from './cardPolicyDetailState';
|
|
5
|
+
export declare const initialState: CardPolicyDetailState;
|
|
6
|
+
export declare const fetchCardPolicyDetail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[templateId: string], string, "cardPolicyDetail/fetchCardPolicyDetail", never, never>, updateCardPolicyDetailFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
7
|
+
fetchState: FetchState;
|
|
8
|
+
error?: ZeniAPIStatus;
|
|
9
|
+
}, "cardPolicyDetail/updateCardPolicyDetailFetchStatus">, updateCardPolicyFormDraft: import("@reduxjs/toolkit").ActionCreatorWithPayload<CreateCardPolicyTemplateRequest, "cardPolicyDetail/updateCardPolicyFormDraft">, updateCardPolicy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[templateId: string], string, "cardPolicyDetail/updateCardPolicy", never, never>, updateCardPolicyFetchStatus: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
10
|
+
fetchState: FetchState;
|
|
11
|
+
error?: ZeniAPIStatus;
|
|
12
|
+
}, "cardPolicyDetail/updateCardPolicyFetchStatus">, clearCardPolicyDetail: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"cardPolicyDetail/clearCardPolicyDetail">;
|
|
13
|
+
declare const _default: import("redux").Reducer<CardPolicyDetailState>;
|
|
14
|
+
export default _default;
|
package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailReducer.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.clearCardPolicyDetail = exports.updateCardPolicyFetchStatus = exports.updateCardPolicy = exports.updateCardPolicyFormDraft = exports.updateCardPolicyDetailFetchStatus = exports.fetchCardPolicyDetail = exports.initialState = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
exports.initialState = {
|
|
7
|
+
detailTemplateId: undefined,
|
|
8
|
+
detailFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
9
|
+
updateFetchState: { fetchState: 'Not-Started', error: undefined },
|
|
10
|
+
formDraft: undefined,
|
|
11
|
+
};
|
|
12
|
+
const cardPolicyDetail = (0, toolkit_1.createSlice)({
|
|
13
|
+
name: 'cardPolicyDetail',
|
|
14
|
+
initialState: exports.initialState,
|
|
15
|
+
reducers: {
|
|
16
|
+
/**
|
|
17
|
+
* Kick off the `GET /cards/1.0/policy-templates/{id}` request. The
|
|
18
|
+
* accompanying epic dispatches `updateCreatedCardPolicyTemplate` on
|
|
19
|
+
* the entity slice + `updateCardPolicyFormDraft` (seeded from the
|
|
20
|
+
* template) + `updateCardPolicyDetailFetchStatus` here.
|
|
21
|
+
*/
|
|
22
|
+
fetchCardPolicyDetail: {
|
|
23
|
+
reducer(draft, action) {
|
|
24
|
+
draft.detailTemplateId = action.payload;
|
|
25
|
+
draft.detailFetchState.fetchState = 'In-Progress';
|
|
26
|
+
draft.detailFetchState.error = undefined;
|
|
27
|
+
// Reset the draft so a stale form from a previous template
|
|
28
|
+
// doesn't leak into the new edit session.
|
|
29
|
+
draft.formDraft = undefined;
|
|
30
|
+
},
|
|
31
|
+
prepare(templateId) {
|
|
32
|
+
return { payload: templateId };
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
updateCardPolicyDetailFetchStatus(draft, action) {
|
|
36
|
+
draft.detailFetchState.fetchState = action.payload.fetchState;
|
|
37
|
+
draft.detailFetchState.error = action.payload.error;
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* Replace (or seed) the local edit-form draft. Dispatched by the
|
|
41
|
+
* detail-fetch epic with the camelCased values pulled from the
|
|
42
|
+
* fetched template, and by the edit page itself as the user types.
|
|
43
|
+
*/
|
|
44
|
+
updateCardPolicyFormDraft(draft, action) {
|
|
45
|
+
draft.formDraft = action.payload;
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Kick off the `PUT /cards/1.0/policy-templates/{id}` save. The
|
|
49
|
+
* epic reads the current `formDraft` from state, posts the wire
|
|
50
|
+
* body, then dispatches `updateCreatedCardPolicyTemplate` (entity)
|
|
51
|
+
* + `updateCardPolicyFetchStatus({fetchState: 'Completed'})` here.
|
|
52
|
+
*/
|
|
53
|
+
updateCardPolicy: {
|
|
54
|
+
reducer(draft,
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
56
|
+
_action) {
|
|
57
|
+
draft.updateFetchState.fetchState = 'In-Progress';
|
|
58
|
+
draft.updateFetchState.error = undefined;
|
|
59
|
+
},
|
|
60
|
+
prepare(templateId) {
|
|
61
|
+
return { payload: templateId };
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
updateCardPolicyFetchStatus(draft, action) {
|
|
65
|
+
draft.updateFetchState.fetchState = action.payload.fetchState;
|
|
66
|
+
draft.updateFetchState.error = action.payload.error;
|
|
67
|
+
},
|
|
68
|
+
clearCardPolicyDetail(draft) {
|
|
69
|
+
Object.assign(draft, exports.initialState);
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
_a = cardPolicyDetail.actions, exports.fetchCardPolicyDetail = _a.fetchCardPolicyDetail, exports.updateCardPolicyDetailFetchStatus = _a.updateCardPolicyDetailFetchStatus, exports.updateCardPolicyFormDraft = _a.updateCardPolicyFormDraft, exports.updateCardPolicy = _a.updateCardPolicy, exports.updateCardPolicyFetchStatus = _a.updateCardPolicyFetchStatus, exports.clearCardPolicyDetail = _a.clearCardPolicyDetail;
|
|
74
|
+
exports.default = cardPolicyDetail.reducer;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FetchStateAndError, ID } from '../../../../../commonStateTypes/common';
|
|
2
|
+
import { CreateCardPolicyTemplateRequest } from '../../../../../entity/cardPolicy/cardPolicyPayload';
|
|
3
|
+
import { CardPolicyTemplate } from '../../../../../entity/cardPolicy/cardPolicyState';
|
|
4
|
+
import { RootState } from '../../../../../reducer';
|
|
5
|
+
/**
|
|
6
|
+
* Composite view returned by `getCardPolicyDetailView` — the only
|
|
7
|
+
* public shape the Card Policy edit page should consume. Mirrors how
|
|
8
|
+
* `chargeCardDetailSelector` joins the view-side lifecycle slots with
|
|
9
|
+
* the entity-store template.
|
|
10
|
+
*/
|
|
11
|
+
export interface CardPolicyDetailSelectorView {
|
|
12
|
+
detailFetchState: FetchStateAndError;
|
|
13
|
+
updateFetchState: FetchStateAndError;
|
|
14
|
+
formDraft?: CreateCardPolicyTemplateRequest;
|
|
15
|
+
template?: CardPolicyTemplate;
|
|
16
|
+
templateId?: ID;
|
|
17
|
+
}
|
|
18
|
+
export declare function getCardPolicyDetailView(state: RootState): CardPolicyDetailSelectorView;
|
|
19
|
+
export declare function getCardPolicyFormDraft(state: RootState): CreateCardPolicyTemplateRequest | undefined;
|
|
20
|
+
export declare function getCardPolicyDetailFetchState(state: RootState): FetchStateAndError;
|
|
21
|
+
export declare function getUpdateCardPolicyFetchState(state: RootState): FetchStateAndError;
|
package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailSelector.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCardPolicyDetailView = getCardPolicyDetailView;
|
|
4
|
+
exports.getCardPolicyFormDraft = getCardPolicyFormDraft;
|
|
5
|
+
exports.getCardPolicyDetailFetchState = getCardPolicyDetailFetchState;
|
|
6
|
+
exports.getUpdateCardPolicyFetchState = getUpdateCardPolicyFetchState;
|
|
7
|
+
const cardPolicySelector_1 = require("../../../../../entity/cardPolicy/cardPolicySelector");
|
|
8
|
+
function getCardPolicyDetailView(state) {
|
|
9
|
+
const { cardPolicyDetailState, cardPolicyState } = state;
|
|
10
|
+
return {
|
|
11
|
+
templateId: cardPolicyDetailState.detailTemplateId,
|
|
12
|
+
template: cardPolicyDetailState.detailTemplateId != null
|
|
13
|
+
? (0, cardPolicySelector_1.getCardPolicyTemplateById)(cardPolicyState, cardPolicyDetailState.detailTemplateId)
|
|
14
|
+
: undefined,
|
|
15
|
+
formDraft: cardPolicyDetailState.formDraft,
|
|
16
|
+
detailFetchState: cardPolicyDetailState.detailFetchState,
|
|
17
|
+
updateFetchState: cardPolicyDetailState.updateFetchState,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function getCardPolicyFormDraft(state) {
|
|
21
|
+
return state.cardPolicyDetailState.formDraft;
|
|
22
|
+
}
|
|
23
|
+
function getCardPolicyDetailFetchState(state) {
|
|
24
|
+
return state.cardPolicyDetailState.detailFetchState;
|
|
25
|
+
}
|
|
26
|
+
function getUpdateCardPolicyFetchState(state) {
|
|
27
|
+
return state.cardPolicyDetailState.updateFetchState;
|
|
28
|
+
}
|
package/lib/view/spendManagement/chargeCards/cardPolicy/cardPolicyDetail/cardPolicyDetailState.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FetchStateAndError, ID } from '../../../../../commonStateTypes/common';
|
|
2
|
+
import { CreateCardPolicyTemplateRequest } from '../../../../../entity/cardPolicy/cardPolicyPayload';
|
|
3
|
+
/**
|
|
4
|
+
* View-side state for the Card Policy edit page.
|
|
5
|
+
*
|
|
6
|
+
* Mirrors `issueChargeCard` (a single page that owns a local form
|
|
7
|
+
* draft + commits on save). There is no separate read-only "detail"
|
|
8
|
+
* surface today — the same page loads the existing template and offers
|
|
9
|
+
* inline edits. The saved template itself lives on the entity slice;
|
|
10
|
+
* the page joins via `getCardPolicyDetailView`.
|
|
11
|
+
*/
|
|
12
|
+
export interface CardPolicyDetailState {
|
|
13
|
+
/** Lifecycle for the initial `GET /policy-templates/{id}` request. */
|
|
14
|
+
detailFetchState: FetchStateAndError;
|
|
15
|
+
/** Lifecycle for the `PUT /policy-templates/{id}` save. */
|
|
16
|
+
updateFetchState: FetchStateAndError;
|
|
17
|
+
/** Template currently being edited; cleared when the page unmounts. */
|
|
18
|
+
detailTemplateId?: ID;
|
|
19
|
+
/**
|
|
20
|
+
* Local form draft seeded from the entity template on fetch success
|
|
21
|
+
* and mutated as the user edits. `undefined` until the detail fetch
|
|
22
|
+
* lands so the page can render a skeleton until then.
|
|
23
|
+
*/
|
|
24
|
+
formDraft?: CreateCardPolicyTemplateRequest;
|
|
25
|
+
}
|